:root {
  --karate-red: #b71c1c;
  --karate-red-dark: #8a0e0e;
}

body {
  background: #f5f5f5;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

.app-navbar {
  background: linear-gradient(135deg, var(--karate-red) 0%, var(--karate-red-dark) 100%) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  min-height: 56px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
}

.category-card,
.trombi-card {
  border: 2px solid transparent;
  border-radius: 1rem;
  background: white;
  color: #212529;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}
.category-card:active,
.trombi-card:active {
  transform: scale(0.98);
  border-color: var(--karate-red);
  box-shadow: 0 4px 12px rgba(183,28,28,0.2);
}
.trombi-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.75rem;
}
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 0.6rem;
  line-height: 1;
  min-width: 3.5rem;
  text-align: center;
}
.score-badge-complete {
  background: #2e7d32;
  color: #fff;
}
.score-badge-incomplete {
  background: #6c757d;
  color: #fff;
}
.score-badge-sep {
  margin: 0 0.1rem;
  opacity: 0.7;
}
.trombi-card {
  position: relative;
}
.trombi-card .card-body {
  padding-bottom: 2.5rem;
}
.recap-result {
  position: absolute;
  bottom: 0.5rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2e7d32;
}
.recap-belt {
  font-weight: 700;
}
.recap-arrow {
  font-size: 1rem;
  opacity: 0.7;
}
.recap-bars {
  font-weight: 600;
  white-space: nowrap;
}
.trombi-card.is-graded {
  border-color: #2e7d32;
  background: linear-gradient(135deg, #ffffff 0%, #e8f5e9 100%);
}

/* Score buttons – shared base */
.btn-score {
  flex: 1 1 30%;
  min-width: 30%;
  margin: 2px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-radius: 0.6rem !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Each score level gets its own outline color when unselected,
   and its own solid background when selected. */
.btn-score[data-value="0"] { border-color: #9e9e9e; color: #616161; }           /* Non Présenté = gray */
.btn-score[data-value="1"] { border-color: #e53935; color: #c62828; }           /* Insuffisant  = red   */
.btn-score[data-value="2"] { border-color: #ff9800; color: #e65100; }           /* Passable     = orange */
.btn-score[data-value="3"] { border-color: #43a047; color: #2e7d32; }           /* Bien         = green  */
.btn-score[data-value="4"] { border-color: #1e88e5; color: #0d47a1; }           /* Très Bien    = blue   */

/* Selected (checked) state – solid background */
.btn-check:checked + .btn-score[data-value="0"] { background: #757575; border-color: #757575; color: #fff; }
.btn-check:checked + .btn-score[data-value="1"] { background: #c62828; border-color: #c62828; color: #fff; }
.btn-check:checked + .btn-score[data-value="2"] { background: #ef6c00; border-color: #ef6c00; color: #fff; }
.btn-check:checked + .btn-score[data-value="3"] { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.btn-check:checked + .btn-score[data-value="4"] { background: #1565c0; border-color: #1565c0; color: #fff; }

/* Assiduité buttons (unchanged from before) */
.btn-check:checked + .btn-outline-danger    { background: #b71c1c; border-color: #b71c1c; }
.btn-check:checked + .btn-outline-secondary { background: #555;    border-color: #555;    }
.btn-check:checked + .btn-outline-success   { background: #2e7d32; border-color: #2e7d32; }

.nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.nav-breadcrumb-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: opacity 0.15s;
}
.nav-breadcrumb-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}
.nav-breadcrumb-sep {
  opacity: 0.5;
}
.nav-breadcrumb-current {
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Big touch targets on phones */
@media (max-width: 576px) {
  .exercise-card .btn-score {
    flex: 1 1 45%;
    min-width: 45%;
    font-size: 1.05rem;
    padding: 0.9rem 0.4rem;
  }
}