/* ---------------------------------------------------------------------------
   Gabarit commun a toutes les pages.

   - 900 px et plus : menu lateral fixe a gauche (248 px), contenu a droite.
   - Moins de 900 px : barre du haut (logo, serie et XP, theme, connexion) et
     barre d'onglets collee en bas de l'ecran, cinq entrees.

   Les deux navigations sont dans le HTML de chaque page ; une seule est
   affichee a la fois. Les elements `data-state` (visiteur / connecte) sont
   bascules par nav.js, via l'attribut `hidden`.
   --------------------------------------------------------------------------- */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.icon--small {
  width: 16px;
  height: 16px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--t-gap);
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: var(--t-radius-field);
  background: var(--t-accent);
  color: var(--t-on-accent);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--t-gap);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--t-touch);
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

/* Le logo est la flamme seule, sans tuile, comme sur Lycee en ligne. */
.brand__icon {
  flex: none;
  width: 30px;
  height: 30px;
}

.brand__icon path {
  fill: var(--t-logo-fill);
  stroke: var(--t-logo-stroke);
  stroke-width: 1.33;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Contenu --------------------------------------------------------------- */

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem var(--t-gap) 2rem;
}

.page-title {
  margin: 0.5rem 0 1.25rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
}

.section-title {
  margin: 2rem 0 0.75rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

/* --- Barre du haut (mobile) ----------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem var(--t-gap) 0;
}

.topbar .brand {
  font-size: 1.1rem;
  white-space: nowrap;
}

/* Petit ecran avec pastilles : la flamme seule, son nom reste lu. */
@media (max-width: 420px) {
  .topbar:has(.pill:not([hidden])) .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Pastilles de la barre du haut : serie (flamme) et XP (cyan), en aplats
   teintes, comme sur Lycee en ligne. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
  padding: 0 0.75rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-surface);
  color: var(--t-text);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.pill--streak {
  background: var(--t-accent-bg);
  color: var(--t-accent-soft);
}

.pill--streak .icon {
  color: var(--t-streak);
}

.pill--xp {
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--t-touch);
  height: var(--t-touch);
  border: 0;
  border-radius: var(--t-radius-field);
  background: var(--t-surface);
  color: var(--t-muted);
  cursor: pointer;
}

/* --- Barre d'onglets (mobile) --------------------------------------------- */

/* Un element qui prend le focus ou une ancre visee ne passe pas sous la
   barre d'onglets, collee en bas de l'ecran. */
html {
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* Barre flottante aux coins arrondis ; Defier au centre, un bouton flamme
   en relief, a peine plus haut que les autres entrees, son libelle aligne
   sur les leurs (refonte, Thibaud, 9 novembre 2026). */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 0.5rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--t-bg) 45%);
}

.tabbar__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  margin: 0;
  padding: 0.55rem 0.3rem;
  border: 1px solid var(--t-border);
  border-radius: 24px;
  background: var(--t-low);
  list-style: none;
}

.tabbar__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  min-height: 48px;
  color: var(--t-muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-decoration: none;
}

.tabbar__link .icon {
  width: 24px;
  height: 24px;
}

.tabbar__link[aria-current="page"] {
  color: var(--t-accent-text);
}

.tabbar__link[href="/battle-school"][aria-current="page"] {
  color: var(--t-battle-text);
}

.tabbar__link--play {
  margin-top: -1.1rem;
  color: var(--t-text);
}

.tabbar__play {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--t-accent);
  color: var(--t-on-accent);
  box-shadow: var(--t-relief-hi), 0 4px 0 var(--t-accent-edge), 0 0 0 4px var(--t-low);
}

.tabbar__play .icon {
  width: 24px;
  height: 24px;
}

/* --- Menu lateral (desktop) ----------------------------------------------- */

.sidebar {
  display: none;
}

.sidebar .brand {
  padding: 0 0.5rem;
}

.sidebar__list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0 0.9rem;
  border-radius: var(--t-radius-field);
  color: var(--t-nav);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
}

/* Icones en couleur de Lycee en ligne (icones/), en <img> : memes couleurs
   dans les deux themes, l'entree active ne change que le texte et le fond. */
.sidebar__link .icon {
  width: 24px;
  height: 24px;
}

.sidebar__link:hover {
  background: var(--t-surface);
  color: var(--t-text);
}

.sidebar__link[aria-current="page"] {
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
}

.sidebar__link[href="/battle-school"] {
  color: var(--t-battle-text);
}

/* Entree active a la couleur de sa rubrique (maquettes ordinateur du
   11 novembre 2026) : violet pour les cours, cyan pour le brevet, rouge pour
   la Battle School, flamme pour le reste. */
.sidebar__link[href="/cours/"][aria-current="page"] {
  background: var(--t-violet-bg);
  color: var(--t-violet-text);
}

.sidebar__link[href="/brevet/"][aria-current="page"] {
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
}

.sidebar__link[href="/battle-school"][aria-current="page"] {
  background: var(--t-battle-bg);
  color: var(--t-battle-text);
}

/* Le logo de la Battle School tient lieu d'icone a son entree. */
.sidebar__logo {
  flex-shrink: 0;
  width: 26px;
  height: 30px;
  margin: 0 -1px;
}

.sidebar__bottom {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

/* Carte du visiteur : aplat flamme, l'invitation a garder sa progression. */
.save-card {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--t-radius-card);
  background: var(--t-accent);
  color: var(--t-on-accent);
  box-shadow: 0 5px 0 var(--t-accent-edge);
}

.save-card__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
}

.save-card__text {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 800;
}

a.save-card {
  color: var(--t-on-accent);
  text-decoration: none;
}

.save-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--t-touch);
  border-radius: var(--t-radius-field);
  background: var(--t-on-accent);
  color: var(--t-accent);
  font-family: var(--t-font-title);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
}

.member-card__text {
  display: grid;
}

.member-card__name {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.member-card__stats {
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

/* Bascule du theme : un soleil en mode sombre (passer au clair), une lune
   en mode clair, comme sur Lycee en ligne. Le nom du bouton est son
   aria-label. */
.sidebar__theme {
  justify-self: start;
}

.theme-icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-icon--sun {
  display: none;
}

:root[data-theme="light"] .theme-icon--moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-icon--sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-icon--moon {
    display: block;
  }
}

@media (min-width: 900px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 248px;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--t-border);
    background: var(--t-low);
  }

  .app {
    margin-left: 248px;
  }

  html {
    scroll-padding-bottom: 0;
  }

  .tabbar {
    display: none;
  }

  /* Barre du haut sur ordinateur : la marque est dans le menu, il reste a
     droite la serie et les XP d'un eleve, ou « J'ai un code » d'un visiteur.
     Le theme se change dans le menu. */
  .topbar {
    justify-content: flex-end;
    min-height: 44px;
    padding: 1.25rem 2.5rem 0;
  }

  .topbar .brand,
  .topbar [data-theme-toggle] {
    display: none;
  }

  .content {
    padding: 1.25rem 2.5rem 3rem;
  }

  .topbar__code {
    border: 2px solid var(--t-cyan-edge);
    color: var(--t-cyan-text);
  }
}

/* --- Pied de page ---------------------------------------------------------- */

/* Sur le modele de Lycee en ligne : un filet a la largeur du contenu, la
   marque (mobile), des liens discrets en zone de 44 px, le site jumeau en
   dernier. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--t-gap) 1.5rem;
  color: var(--t-muted);
  font-size: 0.8125rem;
}

.site-footer::before {
  content: '';
  flex-basis: 100%;
  margin-bottom: 1.25rem;
  border-top: 2px solid var(--t-border);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-basis: 100%;
  margin: 0;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 0.95rem;
  font-weight: 800;
}

.site-footer__brand .brand__icon {
  width: 20px;
  height: 20px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--t-touch);
  color: var(--t-muted);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--t-text);
}

.site-footer__sister {
  opacity: 0.85;
}

.site-footer__sister img {
  border-radius: 4px;
}

.site-footer__copy {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
}

@media (min-width: 900px) {
  .site-footer {
    padding: 0 2.5rem 2rem;
  }

  /* Le menu lateral porte deja la marque. */
  .site-footer__brand {
    display: none;
  }
}

/* --- Accueil --------------------------------------------------------------- */

/* Refonte (maquettes du 9 novembre 2026) : le hero violet avec sa carte de
   duel, le champ de code, le choix de la classe, puis Reviser, le defi du
   jour et la bataille des colleges, et le bloc des professeurs. Un eleve qui
   revient voit d'abord sa mission ; le hero et le bloc des profs ne
   s'adressent qu'au visiteur. */
.home {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.home .section-title {
  margin: 0;
}

.section-lead {
  margin: 0.25rem 0 0;
  color: var(--t-muted);
  font-weight: 800;
}

.hero {
  position: relative;
  flex-wrap: wrap;
  align-items: center;
  padding: 1.4rem 1.2rem 1.5rem;
  border: 2px solid var(--t-rim);
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 85% 8%, var(--t-glow-gold) 0%, transparent 60%),
    radial-gradient(120% 90% at 10% 0%, var(--t-hero-1) 0%, var(--t-hero-2) 40%, var(--t-hero-3) 75%, var(--t-hero-4) 100%);
  box-shadow: var(--t-relief-soft), 0 10px 0 var(--t-hero-edge), var(--t-shadow-hero);
  color: var(--t-hero-text);
}

.hero__title {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  line-height: 0.95;
}

.hero__accent {
  display: block;
  background: linear-gradient(180deg, var(--t-gold) 0%, var(--t-accent) 55%, var(--t-streak) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 34rem;
  margin: 0;
  color: var(--t-hero-soft);
  font-size: 1.05rem;
  font-weight: 700;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.hero__cta .button {
  flex: 1 1 260px;
}

.hero__alt {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
  color: var(--t-hero-text);
  font-weight: 900;
  text-underline-offset: 4px;
}

.hero__trust {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 18px;
  background: var(--t-overlay);
  color: var(--t-hero-soft);
  font-size: 0.85rem;
  font-weight: 900;
}

.hero__faces {
  display: flex;
}

.hero__faces .avatar {
  width: 32px;
  height: 32px;
  border: 2px solid var(--t-hero-edge);
  font-size: 0.85rem;
}

.hero__faces .avatar + .avatar {
  margin-left: -10px;
}

/* Carte de duel facon ticket, et la carte rouge de la Battle School posee
   en biais derriere. */
.ticket {
  position: relative;
  flex: 1 1 300px;
  max-width: 400px;
  margin: 0 auto;
  padding: 1rem 0.25rem 0.5rem;
}

.ticket__back {
  position: absolute;
  inset: 0 1.5rem 1.5rem;
  border-radius: 26px;
  background: linear-gradient(160deg, var(--t-battle), var(--t-battle-edge));
  transform: rotate(-5deg);
  box-shadow: var(--t-shadow-card);
}

.ticket__card {
  position: relative;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px solid var(--t-gold);
  border-radius: 26px;
  background: linear-gradient(180deg, var(--t-ticket-1) 0%, var(--t-ticket-2) 100%);
  box-shadow: var(--t-shadow-card);
}

.ticket__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ticket__topic {
  color: var(--t-hero-chip);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chip--warm {
  min-height: 26px;
  padding: 0 0.6rem;
  background: var(--t-accent-bg);
  color: var(--t-accent-soft);
  font-size: 0.75rem;
}

.ticket__players {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.ticket__player {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 900;
}

.ticket__avatar {
  width: 58px;
  height: 58px;
  border: 3px solid var(--t-hero-text);
  font-size: 1.6rem;
}

.ticket__avatar--rival {
  border-color: var(--t-gold);
}

.ticket__vs {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: conic-gradient(var(--t-accent), var(--t-streak), var(--t-danger), var(--t-hero-chip), var(--t-cyan), var(--t-accent));
  box-shadow: 0 6px 0 var(--t-hero-4);
}

.ticket__vs span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--t-hero-4);
  font-family: var(--t-font-title);
  font-size: 1.35rem;
  font-weight: 800;
}

.ticket__target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--t-gold-edge);
  border-radius: 16px;
  background: var(--t-gold-wash);
  color: var(--t-accent-soft);
  font-weight: 900;
}

.ticket__target strong {
  color: var(--t-gold);
  font-family: var(--t-font-title);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.ticket__gains {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.ticket__gain {
  display: grid;
  justify-items: center;
  padding: 0.45rem 0.1rem;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 900;
  text-align: center;
}

.ticket__gain strong {
  font-family: var(--t-font-title);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
}

.ticket__gain--xp { background: var(--t-cyan-bg); color: var(--t-cyan-text); }
.ticket__gain--xp strong { color: var(--t-cyan); }
.ticket__gain--clan { background: var(--t-battle-bg); color: var(--t-battle-text); }
.ticket__gain--double { background: var(--t-accent-bg); color: var(--t-accent-soft); }
.ticket__gain--double strong { color: var(--t-accent); }

/* Champ de code : defi au tableau ou classe d'un prof. */
.code-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  padding: 1rem;
  border: 2px solid var(--t-cyan-edge);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.code-entry__label {
  font-family: var(--t-font-title);
  font-size: 1.15rem;
  font-weight: 800;
}

.code-entry__row {
  display: flex;
  gap: 0.6rem;
}

.code-entry__input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 0;
  background: var(--t-bg);
  font-family: var(--t-font-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.code-entry__submit {
  flex: none;
  text-transform: uppercase;
}

.code-entry__hint {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.code-entry .status {
  margin: 0;
}

/* Choix de la classe : quatre tuiles en relief, une couleur par niveau. */
.grades__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.grade-tile {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 128px;
  padding: 0.9rem 1rem;
  border-radius: var(--t-radius-card);
  color: var(--t-on-grade);
  text-decoration: none;
}

.grade-tile--6e { background: linear-gradient(160deg, var(--t-grade-6e), var(--t-grade-6e-edge)); box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-grade-6e-edge); }
.grade-tile--5e { background: linear-gradient(160deg, var(--t-grade-5e), var(--t-grade-5e-edge)); box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-grade-5e-edge); }
.grade-tile--4e { background: linear-gradient(160deg, var(--t-grade-4e), var(--t-grade-4e-edge)); box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-grade-4e-edge); }
.grade-tile--3e { background: linear-gradient(160deg, var(--t-grade-3e), var(--t-grade-3e-edge)); box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-grade-3e-edge); }

.grade-tile__level {
  font-family: var(--t-font-title);
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 0.9;
}

.grade-tile__name {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grade-tile__sub {
  font-size: 0.82rem;
  font-weight: 800;
}

.grade-tile__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-gold);
  color: var(--t-on-accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .grades__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grade-tile {
    min-height: 150px;
  }

  .hero {
    padding: 2.5rem 2.75rem;
  }
}

/* Trois cartes : Reviser, defi du jour, bataille des colleges. */
.home-cards {
  display: grid;
  gap: 1.25rem;
}

.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem;
  border: 2px solid var(--t-border);
  border-radius: 28px;
  background: var(--t-surface);
}

.home-card__title {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.05;
}

.home-card__text {
  margin: 0;
  color: var(--t-muted);
  font-weight: 800;
}

.home-card__action {
  margin-top: auto;
}

.daily-medal {
  display: grid;
  place-items: center;
  align-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--t-accent), var(--t-streak), var(--t-danger), var(--t-hero-chip), var(--t-cyan), var(--t-accent));
  box-shadow: 0 6px 0 var(--t-hero-edge), inset 0 0 0 6px var(--t-hero-4);
  color: var(--t-hero-text);
}

.daily-medal__number {
  font-family: var(--t-font-title);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 0.9;
}

.daily-medal__label {
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-countdown {
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-accent-bg);
  color: var(--t-accent-soft);
  font-size: 0.85rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.home-card--battle {
  border-color: var(--t-battle-edge);
  background: radial-gradient(120% 90% at 0% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 70%);
  color: var(--t-hero-text);
}

.home-card--battle .home-card__text {
  color: var(--t-hero-soft);
}

.home-card__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.home-card__logo {
  flex: none;
  width: 72px;
  height: auto;
}

/* Bloc des professeurs : violet-indigo profond, lueur cyan. */
.profs-pitch {
  padding: 1.6rem 1.3rem;
  border: 2px solid var(--t-info-border);
  border-radius: 32px;
  background:
    radial-gradient(80% 70% at 100% 0%, var(--t-glow-cyan) 0%, transparent 60%),
    linear-gradient(180deg, var(--t-profs-1) 0%, var(--t-profs-2) 100%);
  box-shadow: var(--t-relief-soft), 0 8px 0 var(--t-hero-4);
  color: var(--t-hero-text);
}

.profs-pitch__text {
  display: grid;
  gap: 1.1rem;
}

.profs-pitch__chip {
  justify-self: start;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--t-info);
  border-radius: var(--t-radius-pill);
  background: var(--t-hero-3);
  color: var(--t-hero-soft);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profs-pitch__title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  line-height: 1;
}

.profs-pitch__accent {
  display: block;
  color: var(--t-cyan);
}

.profs-pitch__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profs-pitch__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--t-profs-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.profs-pitch__item strong {
  display: block;
  color: var(--t-hero-text);
  font-family: var(--t-font-title);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
}

.profs-pitch__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.profs-pitch__item--violet .profs-pitch__icon { background: var(--t-violet); color: var(--t-on-violet); box-shadow: 0 4px 0 var(--t-violet-edge); }
.profs-pitch__item--cyan .profs-pitch__icon { background: var(--t-cyan); color: var(--t-on-cyan); box-shadow: 0 4px 0 var(--t-cyan-edge); }
.profs-pitch__item--flame .profs-pitch__icon { background: var(--t-accent); color: var(--t-on-accent); box-shadow: 0 4px 0 var(--t-accent-edge); }
.profs-pitch__item--battle .profs-pitch__icon { background: var(--t-battle); color: var(--t-on-battle); box-shadow: 0 4px 0 var(--t-battle-edge); }

.profs-pitch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profs-pitch__actions .button {
  flex: 1 1 220px;
}

.profs-pitch__more {
  border-color: var(--t-info);
  color: var(--t-hero-text);
}

.profs-pitch__trust {
  margin: 0;
  color: var(--t-profs-text);
  font-size: 0.85rem;
  font-weight: 800;
}

/* Retour : mission du jour, defis a jouer, matieres. */

.subject-progress {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subject-progress__percent {
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.subject-progress__bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--t-low);
  appearance: none;
}

.subject-progress__bar::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--t-low);
}

.subject-progress__bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--t-info);
}

.subject-progress__bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--t-info);
}

/* Carte du defi du jour : le seul aplat jaune de la page. */
.daily-card {
  display: grid;
  gap: 0.6rem;
  padding: 1.25rem;
  border-radius: 24px;
  background: var(--t-accent);
  color: var(--t-on-accent);
  text-decoration: none;
}

.daily-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.daily-card__time {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--t-on-accent);
  color: var(--t-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.daily-card__title {
  font-family: var(--t-font-title);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.05;
}

.daily-card__meta {
  font-size: 0.9rem;
  font-weight: 700;
}

.rounds {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.rounds__step {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  font-weight: 700;
  line-height: 1.3;
}

.rounds__number {
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

/* --- Connexion et inscription ---------------------------------------------- */

/* Une colonne centree ; sur grand ecran, une carte au milieu de la page. Les
   largeurs propres aux etapes s'effacent devant celle du panneau. */
.auth-panel {
  display: grid;
  gap: 1rem;
  max-width: 35rem;
  margin: 0 auto;
}

.auth-panel .page-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.8rem, 5vw, 2.2rem);
}

.auth-panel .step-lead {
  margin: 0;
}

.auth-panel .switch-link {
  max-width: none;
  margin: 0;
}

@media (min-width: 900px) {
  .auth-panel {
    margin-top: 6vh;
    padding: 2.25rem;
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-card);
    background: var(--t-surface);
  }

  /* Pas de carte dans la carte : le profil a rattacher (page parent) s'y fond. */
  .auth-panel .card {
    padding: 0;
    border: 0;
    background: none;
  }
}

/* --- Pages legales --------------------------------------------------------- */

.legal-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.legal-tabs__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--t-surface);
  color: var(--t-muted);
  font-weight: 800;
  text-decoration: none;
}

.legal-tabs__link[aria-current="page"] {
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.prose {
  max-width: 48rem;
  line-height: 1.65;
}

.prose h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.25rem;
}

.prose a {
  color: var(--t-accent-text);
}

.prose__updated {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .prose {
    padding: 2rem 2.5rem;
  }
}

/* --- Profil, parent --------------------------------------------------------- */

.step-lead {
  max-width: 40rem;
  margin: 0 0 1rem;
  color: var(--t-muted);
}

.legal-note {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.85rem;
}

.legal-note a,
.switch-link a {
  color: var(--t-accent-text);
  font-weight: 800;
}

.switch-link {
  max-width: 32rem;
  color: var(--t-muted);
  text-align: center;
}

.profile-card__pseudo {
  margin: 0;
  font-size: 1.5rem;
}

.profile-card__meta {
  margin: 0;
  color: var(--t-muted);
  overflow-wrap: anywhere;
}

#profile-form,
.account-actions {
  max-width: 40rem;
  margin-top: 1rem;
}

/* Un titre en tete de carte n'a pas besoin de la marge d'une section. */
.card > .section-title:first-child {
  margin-top: 0;
}

.decision {
  display: grid;
  gap: 0.6rem;
}

.decision__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 2px solid var(--t-border);
  border-radius: var(--t-radius-field);
  cursor: pointer;
}

.decision__choice:has(input:checked) {
  border-color: var(--t-accent);
  background: var(--t-accent-bg);
}

.decision__choice input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  accent-color: var(--t-accent);
}

/* --- Defis : lancement, defi recu, duel, resultat --------------------------- */

.duel-intro,
.duel,
.duel-result,
#defi-notice {
  max-width: 36rem;
}

.duel-hero {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 1.75rem 1.25rem;
  border: 2px solid var(--t-rim);
  border-radius: 30px;
  background: radial-gradient(120% 80% at 50% 0%, var(--t-hero-2) 0%, var(--t-hero-3) 55%, var(--t-hero-4) 100%);
  box-shadow: var(--t-relief-soft), 0 8px 0 var(--t-hero-edge);
  color: var(--t-hero-soft);
  text-align: center;
}

.avatar--hero {
  width: 96px;
  height: 96px;
  border: 5px solid var(--t-accent);
  border-radius: 50%;
  font-size: 2.4rem;
}

.duel-hero__title {
  margin: 0;
  font-size: 1.2rem;
  text-wrap: balance;
}

.duel-hero__title--big {
  font-size: clamp(2rem, 8vw, 2.8rem);
  color: var(--t-hero-text);
}

.duel-hero__score {
  margin: 0;
  color: var(--t-gold);
  font-family: var(--t-font-title);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

.duel-hero__total {
  font-size: 1.6rem;
}

.duel-hero__lead {
  margin: 0;
  font-weight: 800;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
}

.chip {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-low);
  color: var(--t-text);
  font-size: 0.85rem;
  font-weight: 800;
}

.facts {
  display: grid;
  gap: 0.6rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}

.facts li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.facts__badge {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--t-border);
  color: var(--t-accent-text);
  font-weight: 800;
}

.duel-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.duel-progress {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.duel-progress__bar {
  height: 10px;
  border-radius: 999px;
  background: var(--t-border);
}

.duel-progress__bar[data-state="done"] {
  background: var(--t-success);
}

.duel-progress__bar[data-state="current"] {
  background: var(--t-accent);
  box-shadow: 0 0 0 3px var(--t-accent-bg);
}

.duel-timer {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 64px;
  font-size: 1rem !important;
  border-radius: 50%;
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
  box-shadow: inset 0 0 0 4px var(--t-cyan);
  font-family: var(--t-font-title);
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.duel-scores {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 20px;
  background: var(--t-surface);
  font-weight: 800;
}

.duel-scores__position {
  margin: 0;
  color: var(--t-muted);
  font-family: var(--t-font-text);
  font-size: 0.85rem;
}

.duel-prompt {
  margin: 0 0 1rem;
  padding: 1.2rem 1.1rem;
  border: 2px solid var(--t-border);
  border-radius: 26px;
  background: var(--t-surface);
  font-family: var(--t-font-title);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  counter-reset: answer;
}

/* Quatre grosses reponses en relief, une couleur par lettre (A cyan, B rose,
   C violet, D flamme), comme le defi au tableau de Lycee en ligne. La lettre
   reste ecrite : la couleur ne porte jamais seule l'information. */
.answer {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 96px;
  padding: 1.6rem 0.9rem 0.8rem;
  border: 0;
  border-radius: 22px;
  background: var(--t-cyan);
  color: var(--t-on-cyan);
  box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-cyan-edge);
  font-family: var(--t-font-title);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  counter-increment: answer;
}

.answer::after {
  content: counter(answer, upper-alpha);
  position: absolute;
  top: 0.55rem;
  left: 0.9rem;
  font-size: 0.95rem;
  opacity: 0.7;
}

.answer:nth-child(2) { background: var(--t-danger); color: var(--t-on-danger); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-battle-edge); }
.answer:nth-child(3) { background: var(--t-info); color: var(--t-on-info); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-violet-edge); }
.answer:nth-child(4) { background: var(--t-accent); color: var(--t-on-accent); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-accent-edge); }

.answer:hover:not(:disabled) {
  filter: brightness(1.06);
}

.answer:active:not(:disabled) {
  transform: translateY(3px);
}

/* Apres la reponse, les autres choix s'effacent. */
.answer:disabled:not([data-state]) {
  opacity: 0.4;
}

/* L'etat ne passe jamais par la couleur seule : la bonne reponse porte une
   coche, la mauvaise est barree. */
.answer[data-state="correct"] {
  background: var(--t-success-bg);
  color: var(--t-text);
  box-shadow: inset 0 0 0 3px var(--t-success), 0 6px 0 var(--t-success-border);
}

.answer[data-state="correct"]::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.75em;
  margin-right: 0.5em;
  border: solid var(--t-success);
  border-width: 0 3px 3px 0;
  transform: translateY(-0.1em) rotate(45deg);
}

.answer[data-state="wrong"] {
  background: var(--t-danger-bg);
  color: var(--t-danger-soft);
  box-shadow: inset 0 0 0 3px var(--t-danger), 0 6px 0 var(--t-danger-border);
  text-decoration: line-through;
}

.duel-feedback {
  min-height: 3rem;
  margin: 1rem 0;
  color: var(--t-muted);
  text-align: center;
}

.duel-feedback[data-kind="success"] {
  color: var(--t-success);
}

.duel-feedback[data-kind="error"] {
  color: var(--t-danger);
}

.versus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.versus__side {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--t-text);
  font-size: 1.4rem;
}

.versus__word {
  color: var(--t-accent-text);
  font-size: 1rem;
  font-weight: 800;
}

.stat {
  margin: 1rem 0;
  color: var(--t-muted);
  text-align: center;
}

.stat strong {
  display: block;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 1.6rem;
}

.button--flame {
  border-bottom-color: var(--t-accent-border);
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.corrections {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.correction {
  padding: 0.9rem 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
  background: var(--t-surface);
}

.correction p {
  margin: 0.2rem 0;
}

.correction__prompt {
  font-weight: 800;
}

.correction__answer[data-kind="success"] {
  color: var(--t-success);
}

.correction__answer[data-kind="error"] {
  color: var(--t-danger);
}

.correction__explanation {
  color: var(--t-muted);
  font-size: 0.9rem;
}

/* --- Defi du jour, classements, statistiques ------------------------------ */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.tab {
  min-height: var(--t-touch);
  padding: 0 1.1rem;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-surface);
  color: var(--t-muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.tab:hover:not([aria-selected="true"]) {
  color: var(--t-text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.75rem;
  max-width: 40rem;
  margin: 1rem 0;
}

.board {
  display: grid;
  gap: 0.4rem;
  max-width: 40rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.board-row {
  display: grid;
  grid-template-columns: 2.2rem auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-button);
  background: var(--t-surface);
  font-weight: 800;
}

/* Zones de montee et de descente : bordure en pointille, la couleur n'est
   qu'un renfort. */
.board-row[data-zone="promotion"] {
  border: 1px dashed var(--t-success);
}

.board-row[data-zone="relegation"] {
  border: 1px dashed var(--t-danger);
}

.board-row[data-me="true"] {
  border: 2px solid var(--t-accent);
  background: var(--t-accent-bg);
  color: var(--t-text);
}

.board-row__rank {
  color: var(--t-muted);
  text-align: center;
}

.board-row__pseudo {
  overflow-wrap: anywhere;
}

.board-row__xp {
  color: var(--t-accent-text);
  font-variant-numeric: tabular-nums;
}

/* --- Cours ------------------------------------------------------------------ */

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

/* Un element sans lien (page courante, rubrique sans page) s'aligne sur les liens. */
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.5rem;
  color: var(--t-muted);
}

.section-title a {
  color: inherit;
}

.chapter-list {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chapter-link {
  display: grid;
  gap: 0.25rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
}

.chapter-link__meta {
  color: var(--t-muted);
  font-size: 0.9rem;
}

/* Statut d'un chapitre : du texte, jamais la couleur seule. */
.chapter-status {
  justify-self: start;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--t-low);
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.chapter-status[data-kind="review"] {
  background: var(--t-danger-bg);
  color: var(--t-danger);
}

.chapter-status[data-kind="started"] {
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
}

.chapter-status[data-kind="done"],
.chapter-status[data-kind="mastered"] {
  background: var(--t-success-bg);
  color: var(--t-success);
}

.chapter-status[data-kind="new"] {
  background: var(--t-info-bg);
  color: var(--t-info-text);
}

/* « Reprends ou tu t'es arrete » (Reviser, page d'une classe). */
.resume-card {
  display: grid;
  gap: 0.4rem;
  max-width: 40rem;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
}

.resume-card__label {
  color: var(--t-success);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resume-card strong {
  font-family: var(--t-font-title);
  font-size: 1.2rem;
}

.resume-card__meta {
  color: var(--t-muted);
  font-size: 0.85rem;
}

/* Reviser : recherche et choix de la classe. */

.search-field {
  flex: 1 1 16rem;
  max-width: 28rem;
}

.search-field input {
  width: 100%;
  min-height: var(--t-touch);
  padding: 0 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
  background: var(--t-surface);
  color: var(--t-text);
  font: inherit;
}

.grade-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/*
 * Avant le script des cours (`.js`, pose par theme-init.js, sans
 * `.courses-ready`) : le CSS montre deja ce que le script montrera, pour que
 * la page ne saute pas a son arrivee. Reviser : la 3e seule, ses matieres
 * sans leurs chapitres, la place des boutons de classe ; matiere : les cartes
 * des themes sans les themes. Sans JavaScript, tout reste visible.
 */
.js:not(.courses-ready) [data-grade-block]:not([data-grade-block="3e"]),
.js:not(.courses-ready) [data-subject-block],
.js:not(.courses-ready) [data-theme] {
  display: none;
}

.js:not(.courses-ready) .grade-switch[hidden] {
  display: flex !important;
  visibility: hidden;
}

.grade-switch .chip-button[aria-pressed="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.grade-block > .subject-progress {
  max-width: 40rem;
  margin-bottom: 1.5rem;
}

.subject-block {
  margin-top: 1.25rem;
}

.grade-block .subject-progress__label::after {
  content: " ›";
  color: var(--t-accent-text);
}

/* --- Ecran des themes d'une matiere --------------------------------------- */

.theme-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.theme-card {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  height: 100%;
  min-height: 9rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.theme-card:hover,
.theme-card:focus-visible {
  border-color: var(--t-accent);
  transform: translateY(-2px);
}

.theme-card__count {
  color: var(--t-info-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.theme-card__title {
  font-family: var(--t-font-title);
  line-height: 1.2;
}

.theme-card__title::after {
  content: " ›";
  color: var(--t-accent-text);
}

.theme-card__text {
  color: var(--t-muted);
  font-size: 0.95rem;
}

.theme-card__progress {
  color: var(--t-success);
  font-size: 0.85rem;
  font-weight: 700;
}

.theme-block {
  margin-top: 1.5rem;
}

.theme-block__intro {
  margin: 0 0 1rem;
  color: var(--t-muted);
}

@media (prefers-reduced-motion: reduce) {
  .theme-card {
    transition: none;
  }

  .theme-card:hover,
  .theme-card:focus-visible {
    transform: none;
  }
}

/* --- Chapitre en cartes (lot R7) ------------------------------------------ */

.chapter-meta {
  margin: 0.5rem 0 0;
  color: var(--t-info-text);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Les quatre onglets du chapitre (Vue d'ensemble, Le cours, Exercices,
   Fiche), sur le modele de Lycee en ligne. Sans script, les onglets restent
   caches et les panneaux s'affichent les uns sous les autres. */
.chapter-tabs {
  display: flex;
  max-width: 100%;
  margin: 1.25rem 0 1rem;
  overflow-x: auto;
  border-radius: 999px;
}

.chapter-tab {
  flex: none;
  padding: 0 1rem;
  border: 0;
  color: var(--t-muted);
  font: inherit;
  font-family: var(--t-font-title);
  font-weight: 800;
  cursor: pointer;
}

.chapter-tab:hover {
  color: var(--t-text);
}

/* Telephone : les quatre onglets tiennent sur la largeur, sans defilement cache. */
@media (max-width: 30rem) {
  .chapter-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: var(--t-radius-field);
  }

  .chapter-tab {
    padding: 0.25rem;
    border-radius: var(--t-radius-field);
    font-size: 0.8rem;
    line-height: 1.15;
  }
}

.chapter-panels {
  margin-top: 1.25rem;
}

.chapter-panel {
  max-width: 46rem;
}

/*
 * Le cours, sur le modele de Lycee en ligne : les cartes, et a droite (des
 * 1100 px) le programme et « Pour aller plus loin ». En dessous, le
 * programme suit les cartes.
 */
.chapter-panel--learn {
  max-width: 72rem;
}

.chapter-learn {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.chapter-learn__cards {
  min-width: 0;
  max-width: 46rem;
}

.chapter-program {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.chapter-program__kicker {
  margin: 0;
  color: var(--t-info-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.chapter-program__title {
  margin: 0;
  font-size: 1.1rem;
}

.chapter-panel .chapter-program__steps {
  margin-top: 0;
}

.chapter-path__item[aria-current="step"] {
  color: var(--t-accent-text);
}

.chapter-path__item[aria-current="step"]::before {
  border-color: var(--t-accent);
}

.chapter-resources {
  display: grid;
  gap: 0.5rem;
}

.chapter-resources__title {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.chapter-resource {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--t-touch);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
}

.chapter-resource:hover,
.chapter-resource:focus-visible {
  border-color: var(--t-accent-border);
}

.chapter-resource img {
  flex: none;
}

.chapter-resource strong,
.chapter-resource small {
  display: block;
}

.chapter-resource small {
  color: var(--t-muted);
  font-size: 0.85rem;
}

@media (min-width: 1100px) {
  .chapter-learn {
    grid-template-columns: minmax(0, 46rem) minmax(16rem, 21rem);
    align-items: start;
  }

  .chapter-program {
    position: sticky;
    top: 1rem;
  }
}

.chapter-panel + .chapter-panel {
  margin-top: 1.5rem;
}

.chapter-panel > .section-title {
  margin-top: 0;
}

.chapter-panel > .actions {
  margin-top: 1rem;
}

.chapter-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chapter-stats li {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-surface);
  color: var(--t-muted);
  font-size: 0.9rem;
}

.chapter-stats strong {
  color: var(--t-text);
}

.chapter-panel .chapter-path {
  margin-top: 1.25rem;
}

.chapter-path__note {
  margin: 0.75rem 0 0;
  color: var(--t-muted);
  font-size: 0.85rem;
}

.chapter-exercise,
.chapter-extra,
.chapter-sheet,
.chapter-trap {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.chapter-extra__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.chapter-extra p {
  margin: 0 0 0.75rem;
  color: var(--t-muted);
}

.chapter-sheet__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.2rem;
}

.chapter-trap {
  border-color: var(--t-accent-border);
  background: var(--t-accent-bg);
}

.chapter-trap .chapter-card__label {
  color: var(--t-accent-text);
}

.chapter-cards {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.chapter-card__label {
  margin: 0 0 0.35rem;
  color: var(--t-info-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chapter-card[data-card="trap"] .chapter-card__label {
  color: var(--t-danger);
}

.chapter-card[data-card="exercise"] .chapter-card__label {
  color: var(--t-accent-text);
}

.chapter-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.chapter-card__body > p {
  margin: 0.5rem 0;
}

.chapter-card__formula {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--t-low);
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.chapter-card__tip {
  color: var(--t-muted);
}

.chapter-card__tip strong {
  color: var(--t-text);
}

.chapter-card__steps {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.chapter-card__steps li {
  display: flex;
  gap: 0.75rem;
  counter-increment: step;
}

.chapter-card__steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  border-radius: 8px;
  background: var(--t-low);
  font-weight: 800;
}

.chapter-card__steps li:last-child::before {
  background: var(--t-success-bg);
  color: var(--t-success);
}

/* Indice, corrige, « Explique plus simple », « Exemple de la vie » : des
   depliants bien visibles, comme des boutons, fleche comprise. */
.chapter-card details,
.chapter-card__alt {
  margin-top: 0.75rem;
  padding: 0 0.9rem;
  border: 2px solid var(--t-accent-border);
  border-radius: var(--t-radius-field);
  background: var(--t-accent-bg);
}

.chapter-card details[open],
.chapter-card__alt[open] {
  padding-bottom: 0.75rem;
}

.chapter-card summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--t-touch);
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.chapter-card summary::-webkit-details-marker {
  display: none;
}

.chapter-card summary::before {
  content: "▸";
  flex: none;
  transition: transform 0.15s ease;
}

.chapter-card details[open] > summary::before {
  transform: rotate(90deg);
}

.chapter-card details > :not(summary) {
  color: var(--t-text);
}

/* Une carte par ecran : Precedent, position, Suivant. */
.card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.card-nav__position {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.card-nav__hint {
  margin: 0.5rem 0 0;
  color: var(--t-muted);
  font-size: 0.85rem;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .chapter-card summary::before {
    transition: none;
  }
}

/* Carte verrouillee : son titre reste visible, son corps attend la carte precedente. */
.chapter-card[data-locked="true"] {
  border-style: dashed;
  background: var(--t-low);
}

.chapter-card[data-locked="true"] .chapter-card__title {
  color: var(--t-muted);
}

.chapter-card__lock {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.understood__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.understood__choices .chip-button[aria-pressed="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.understood__note {
  margin: 0.75rem 0 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.chapter-path {
  padding: 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.chapter-path__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.chapter-path__list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-path__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  color: var(--t-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.chapter-path__item::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  border: 2px solid var(--t-border);
  border-radius: 999px;
}

.chapter-path__item[data-state="done"]::before {
  border-color: var(--t-success);
  background: var(--t-success);
}

.chapter-path__item[data-state="locked"] {
  color: var(--t-muted);
}

.capsule__done {
  margin-left: 0.4rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--t-success-bg);
  color: var(--t-success);
  font-family: var(--t-font-text);
  font-size: 0.8rem;
  vertical-align: middle;
}

.capsule-question {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--t-border);
}

.capsule-question__prompt {
  font-weight: 800;
}

.capsule-question__feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
}

.capsule-question__feedback[data-kind="success"] {
  color: var(--t-success);
}

.capsule-question__feedback[data-kind="error"] {
  color: var(--t-danger);
}

/* --- Reviser : bascule Cours / Sujets de brevet (mobile) ------------------- */

.revise-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-button);
  background: var(--t-low);
}

.revise-switch__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--t-touch);
  border-radius: 12px;
  color: var(--t-muted);
  font-weight: 700;
  text-decoration: none;
}

/* --- Brevet ----------------------------------------------------------------- */

/* En-tete des pages du brevet : sans encadre, la page respire. */

.brevet-hero .page-title {
  margin: 0;
}

.brevet-hero__lead {
  max-width: 44rem;
  margin: 0;
  color: var(--t-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.brevet-countdown {
  justify-self: start;
  margin: 0.25rem 0 0;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--t-info-border);
  border-radius: 999px;
  background: var(--t-info-bg);
  color: var(--t-info-text);
  font-size: 0.9rem;
  font-weight: 800;
}

.chips--start {
  justify-content: flex-start;
  margin: 0;
}

/* Par notion et rythme : deux cartes cote a cote des que la place le permet. */
.brevet-tools {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

/* Sessions et epreuves : une seule barre, les annees en onglets, les
   epreuves en filtre. */
.brevet-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--t-border);
}

.year-tabs ul {
  display: inline-flex;
  gap: 0.25rem;
  max-width: 100%;
  margin: 0;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-low);
  list-style: none;
}

.year-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--t-muted);
  font-family: var(--t-font-title);
  font-weight: 800;
  text-decoration: none;
}

.year-tab:hover {
  color: var(--t-text);
}

.year-tab[aria-current="page"] {
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.paper-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Couleur de la matiere : fond teinte et bordure de l'icone. */
.paper-card {
  padding: 1.1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.paper-card[data-subject="francais"] .paper-card__icon { border-color: var(--t-francais-border); background: var(--t-francais-bg); color: var(--t-francais); }
.paper-card[data-subject="maths"] .paper-card__icon { border-color: var(--t-maths-border); background: var(--t-maths-bg); color: var(--t-maths); }
.paper-card[data-subject="histoire-geo"] .paper-card__icon { border-color: var(--t-histoire-geo-border); background: var(--t-histoire-geo-bg); color: var(--t-histoire-geo); }
.paper-card[data-subject="physique-chimie"] .paper-card__icon { border-color: var(--t-physique-chimie-border); background: var(--t-physique-chimie-bg); color: var(--t-physique-chimie); }
.paper-card[data-subject="svt"] .paper-card__icon { border-color: var(--t-svt-border); background: var(--t-svt-bg); color: var(--t-svt); }

.paper-card__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.paper-card__icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--t-info-border);
  border-radius: 14px;
  background: var(--t-info-bg);
  color: var(--t-info);
}

.paper-card__label {
  flex: 1 1 auto;
  min-width: 0;
}

.paper-card__meta {
  flex: none;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--t-low);
  color: var(--t-muted);
  font-family: var(--t-font-text);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Les centres : une liste a lignes separees, pas une pile de pastilles. */
.paper-card__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper-card__links li + li {
  border-top: 1px solid var(--t-border);
}

.paper-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--t-touch);
  padding: 0.35rem 0.25rem;
  color: var(--t-text);
  font-weight: 700;
  text-decoration: none;
}

.paper-link:hover .paper-link__centre {
  color: var(--t-accent-text);
}

.paper-link__centre {
  flex: 1 1 auto;
  min-width: 0;
}

.paper-link__chevron {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--t-muted);
}

.badge {
  flex: none;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--t-border);
  color: var(--t-text);
  font-size: 0.75rem;
  font-weight: 800;
}

.badge--wait {
  background: var(--t-accent-bg);
  color: var(--t-accent-soft);
}

.paper-challenge__title {
  color: var(--t-accent-text);
}

.paper-challenge__guest a {
  color: var(--t-accent-text);
  font-weight: 800;
}

.exercise-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.exercise-item summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--t-touch);
  list-style: none;
  cursor: pointer;
}

.exercise-item summary::-webkit-details-marker {
  display: none;
}

.exercise-item__title {
  margin: 0;
  font-size: 1.05rem;
}

.exercise-item__meta {
  display: block;
  color: var(--t-muted);
  font-family: var(--t-font-text);
  font-size: 0.85rem;
}

.exercise-item__body {
  padding: 0.5rem 0 0.5rem;
  line-height: 1.6;
}

.steps {
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}

.steps li + li {
  margin-top: 0.4rem;
}

.criterion {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--t-success-border);
  border-radius: var(--t-radius-field);
  background: var(--t-success-bg);
  color: var(--t-success);
  font-weight: 700;
}

/* --- Corrige pas a pas (lot R9) ------------------------------------------ */

.exercise-mistake {
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--t-danger-border);
  border-radius: var(--t-radius-field);
  background: var(--t-danger-bg);
}

.exercise-mistake strong {
  color: var(--t-danger);
}

.exercise-hint {
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  border-radius: var(--t-radius-field);
  background: var(--t-info-bg);
}

.exercise-hint strong {
  color: var(--t-info-text);
}

.stepper {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.stepper__count {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.stepper__actions,
.stepper__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stepper__ask {
  margin: 0 0 0.4rem;
  font-weight: 800;
}

.stepper__choices .chip-button[aria-pressed="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.scale {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
}

.scale__title {
  margin: 0 0 0.4rem;
  font-family: var(--t-font-title);
  font-weight: 800;
}

.scale__list {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scale__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.scale__list li span:last-child {
  flex: none;
  color: var(--t-accent-text);
  font-weight: 800;
}

.scale__note {
  margin: 0.5rem 0 0;
  color: var(--t-muted);
  font-size: 0.85rem;
}

/* Page de la session : entree par notion, rythme, filtre, avancement. */
.notion-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--t-success-border);
  border-radius: var(--t-radius-card);
  background: var(--t-success-bg);
  color: var(--t-text);
  text-decoration: none;
}

.notion-card > :not(.notion-card__chevron) {
  grid-column: 1;
}

.notion-card__chevron {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 24px;
  height: 24px;
  color: var(--t-success);
}

.notion-card__label {
  color: var(--t-success);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notion-card strong {
  font-family: var(--t-font-title);
  font-size: 1.2rem;
  line-height: 1.2;
}

.notion-card__meta {
  color: var(--t-muted);
  font-size: 0.85rem;
}

.brevet-rhythm {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.brevet-rhythm__label {
  color: var(--t-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brevet-rhythm strong {
  font-family: var(--t-font-title);
  font-size: 1.2rem;
}

.brevet-rhythm__week {
  color: var(--t-accent-text);
  font-weight: 800;
}

.exam-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.exam-filter .chip-button[aria-pressed="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
}

.paper-status {
  flex: none;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--t-low);
  color: var(--t-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.paper-status[data-kind="started"] {
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
}

@media (min-width: 900px) {
  .brevet-tools {
    grid-template-columns: 2fr 1fr;
  }

}

.exercise-item__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
  color: var(--t-accent-text);
  font-weight: 800;
}

/* Page d'un sujet : le corrige a gauche ; a droite, le sujet officiel, le
   defi, le chrono et les autres centres. En une colonne, le sujet officiel
   vient en premier : on le lit avant d'ouvrir le corrige. */
.paper-layout {
  display: grid;
  gap: 1.25rem;
}

.paper-layout__main > .section-title {
  margin-top: 0;
}

.paper-layout__tools {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 1100px) {
  .paper-layout {
    grid-template-columns: minmax(0, 1fr) 21rem;
    grid-template-areas: "main docs" "main tools";
    grid-template-rows: auto 1fr;
    align-items: start;
  }

  .paper-layout__main { grid-area: main; }
  .paper-layout__docs { grid-area: docs; }
  .paper-layout__tools { grid-area: tools; align-self: start; }
}

.paper-panel {
  padding: 1.1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.paper-panel > p {
  margin: 0 0 0.75rem;
  color: var(--t-muted);
}

.paper-panel__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.paper-docs {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.doc-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
  background: var(--t-low);
  color: var(--t-text);
  text-decoration: none;
}

.doc-link:hover {
  border-color: var(--t-info-border);
}

.doc-link__icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--t-info-bg);
  color: var(--t-info);
}

.doc-link__icon .icon {
  width: 20px;
  height: 20px;
}

.doc-link__text {
  display: grid;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.doc-link__meta {
  color: var(--t-muted);
  font-size: 0.8rem;
}

.paper-panel > .paper-source {
  margin: 0;
  font-size: 0.8rem;
}

.paper-challenge {
  border-color: var(--t-accent-border);
  background: var(--t-accent-bg);
}

.paper-challenge > p {
  color: var(--t-text);
}

.chrono__title {
  margin: 1rem 0 0.25rem;
  font-size: 1rem;
}

.chrono__time {
  margin: 0.25rem 0 0.75rem;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 2.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.paper-panel > .chrono__time {
  color: var(--t-text);
}

.chrono__structure {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.chrono .actions + .status {
  margin-top: 0.75rem;
}

.centre-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
  padding: 0 1rem;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-surface);
  color: var(--t-text);
  font-weight: 800;
  text-decoration: none;
}

/* Un joueur sans compte visible n'a pas de couleur : teinte neutre. */
.board-row .avatar:not([data-color]) {
  background: var(--t-border);
  color: var(--t-text);
}

/* --- Profil invite : sauvegarde, reprise, parent ---------------------------- */

.code-input {
  font-family: var(--t-font-title);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.save-page {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}

.save-page .page-title,
.save-page .step-lead {
  margin: 0;
}

#save-panel {
  display: grid;
  gap: 1rem;
}

.kept {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kept__chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.kept__chip--streak {
  background: var(--t-histoire-geo-bg);
  color: var(--t-histoire-geo);
}

.kept__chip--xp {
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
}

.kept__chip--courses {
  background: var(--t-info-bg);
  color: var(--t-info-text);
}

.save-code {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px solid var(--t-accent);
  border-radius: 22px;
  background: var(--t-surface);
}

.save-code__title {
  margin: 0;
  color: var(--t-accent-text);
  font-family: var(--t-font-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-code__box {
  display: grid;
  gap: 0.75rem;
}

.save-code__value {
  margin: 0;
  padding: 0.6rem;
  border-radius: var(--t-radius-field);
  background: var(--t-low);
  font-family: var(--t-font-title);
  font-size: clamp(1.5rem, 7vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  overflow-wrap: anywhere;
}

.save-code__qr {
  width: min(14rem, 100%);
  justify-self: center;
}

.qr {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.qr__light {
  fill: var(--t-qr-light);
}

.qr__dark {
  fill: var(--t-qr-dark);
}

.actions--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
}

.actions--split .button {
  justify-self: stretch;
}

.parent-qr {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--t-info-border);
  border-radius: 22px;
  background: var(--t-info-bg);
  color: var(--t-info-soft);
}

.parent-qr p {
  margin: 0;
}

.parent-qr__title {
  margin: 0;
  color: var(--t-text);
  font-size: 1.2rem;
}

.parent-qr__box {
  display: grid;
  gap: 0.75rem;
}

.save-page__legal {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.8rem;
  text-align: center;
}

.notice--success {
  border-color: var(--t-success-border);
  background: var(--t-success-bg);
  color: var(--t-success);
}

/* Bandeau de la page Moi : pointille tant que le profil n'est pas sauvegarde. */
.save-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 40rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--t-dashed);
  border-radius: var(--t-radius-card);
  background: var(--t-low);
  color: var(--t-text);
  text-decoration: none;
}

.save-banner[data-saved="true"] {
  border: 1px solid var(--t-success-border);
}

.save-banner__text {
  display: grid;
  gap: 0.15rem;
}

.save-banner__text span {
  color: var(--t-muted);
  font-size: 0.9rem;
}

.save-banner__action {
  color: var(--t-info-text);
  font-weight: 700;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.chip-button {
  min-height: var(--t-touch);
  padding: 0 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: var(--t-low);
  color: var(--t-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.children {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.child-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.child-card__text {
  display: grid;
  flex: 1 1 8rem;
}

.child-card__text span {
  color: var(--t-muted);
  font-size: 0.85rem;
}

/* --- Defis : defi recu, mes defis ------------------------------------------- */

.defi-play-as {
  margin: 0.75rem 0 0;
  color: var(--t-muted);
  font-size: 0.9rem;
  text-align: center;
}

.warmup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--t-info-border);
  border-radius: var(--t-radius-card);
  background: var(--t-info-bg);
  color: var(--t-text);
  text-decoration: none;
}

.warmup__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--t-info);
  color: var(--t-on-info);
}

.warmup__text {
  display: grid;
}

.warmup__text span {
  color: var(--t-info-soft);
  font-size: 0.85rem;
}

.challenge-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.challenge-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: var(--t-low);
}

.challenge-item .avatar {
  width: 44px;
  height: 44px;
  flex: none;
}

.challenge-item__text strong {
  font-weight: 900;
}

.challenge-item__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.challenge-item__text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.challenge-item__text span,
.challenge-item__note {
  color: var(--t-muted);
  font-size: 0.85rem;
}

.button--small {
  min-height: var(--t-touch);
  padding: 0.3rem 1rem;
  font-size: 1rem;
}

/* --- Partage d'un defi : apercu de la carte, boutons ------------------------ */

.share-box {
  justify-items: stretch;
  margin-top: 1.25rem;
}

.share-box .section-title {
  margin-top: 0;
}

.share-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--t-border);
  border-bottom: 6px solid var(--t-accent);
  border-radius: var(--t-radius-card);
  background: var(--t-low);
}

.share-card__avatar {
  width: 56px;
  height: 56px;
  font-size: 1.6rem;
}

.share-card__text {
  display: grid;
  min-width: 0;
}

.share-card__title {
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.share-card__score {
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.share-card__code {
  font-family: var(--t-font-title);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.share-card__cta {
  font-size: 0.85rem;
  font-weight: 700;
}

.share-card__caption {
  margin: 0.4rem 0 1rem;
  color: var(--t-muted);
  font-size: 0.85rem;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: 0.5rem;
}

.share-actions .button {
  justify-self: stretch;
}

/* Le QR vers le telephone n'a de sens que sur ordinateur. */
.share-actions__desktop {
  display: none !important;
}

@media (min-width: 900px) {
  .share-actions__desktop:not([hidden]) {
    display: inline-flex !important;
  }
}

.share-qr {
  width: min(12rem, 100%);
  margin-top: 1rem;
}

/* --- Retour apres une reponse (feedback.js) --------------------------------- */

.duel-feedback,
.capsule-question__feedback {
  text-align: left;
}

.duel-feedback[data-kind="success"],
.duel-feedback[data-kind="error"],
.capsule-question__feedback[data-kind="success"],
.capsule-question__feedback[data-kind="error"] {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--t-success-border);
  border-radius: var(--t-radius-card);
  background: var(--t-success-bg);
  color: var(--t-text);
}

.duel-feedback[data-kind="error"],
.capsule-question__feedback[data-kind="error"] {
  border-color: var(--t-danger-border);
  background: var(--t-danger-bg);
}

.feedback__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.3rem;
  font-weight: 800;
}

[data-kind="success"] > .feedback__title {
  color: var(--t-success);
}

.feedback__mistake,
.feedback__explanation,
.feedback__alternative,
.feedback__ask {
  margin: 0;
}

.feedback__review {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.feedback__method {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--t-radius-field);
  background: var(--t-bg);
  font-weight: 700;
}

.feedback__ask {
  color: var(--t-danger-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

[data-kind="success"] > .feedback__ask {
  color: var(--t-muted);
}

.feedback__others {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-button[aria-pressed="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent-bg);
}

.feedback__course {
  font-weight: 700;
}

.correction__mistake {
  color: var(--t-danger);
  font-weight: 700;
}

.correction__method {
  font-weight: 700;
}

/* --- Ma progression (lot R11) -------------------------------------------- */

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 24rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week__day {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
}

.week__dot {
  width: 100%;
  max-width: 2.5rem;
  aspect-ratio: 1;
  border: 2px solid var(--t-border);
  border-radius: 10px;
  background: var(--t-low);
}

.week__day[data-frozen="true"] .week__dot {
  border-color: var(--t-info);
  background: var(--t-info-bg);
}

.streak-card__freeze {
  margin: 0.75rem 0 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.streak-card__freeze[data-available="true"] {
  color: var(--t-info-text);
}

.week__day[data-today="true"][data-active="false"] .week__dot {
  border-style: dashed;
  border-color: var(--t-streak);
}

.week__label {
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.week__day[data-today="true"] .week__label {
  color: var(--t-text);
}

.review-list {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--t-touch);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--t-border);
  color: var(--t-text);
  text-decoration: none;
}

.review-item__text {
  display: grid;
}

.review-item__text span {
  color: var(--t-muted);
  font-size: 0.85rem;
}

.review-item__state[data-label="Fragile"] {
  color: var(--t-danger);
}

.review-item__state[data-label="Rappel"] {
  color: var(--t-success);
}

.review-empty {
  margin: 0;
  color: var(--t-muted);
}

/* Une case par chapitre : la couleur et le motif portent l'etat, le nom
   accessible le dit en toutes lettres. */
.mastery-cell {
  display: block;
  aspect-ratio: 1;
  border: 2px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-low);
}

.mastery-cell[data-state="mastered"],
.mastery-legend [data-state="mastered"]::before {
  border-color: var(--t-success);
  background: var(--t-success);
}

.mastery-cell[data-state="started"],
.mastery-legend [data-state="started"]::before {
  border-color: var(--t-accent);
  background: var(--t-accent);
}

.mastery-cell[data-state="fragile"],
.mastery-legend [data-state="fragile"]::before {
  border-color: var(--t-danger);
  background: var(--t-danger);
}

.mastery-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0;
  padding: 0;
  color: var(--t-muted);
  font-size: 0.85rem;
  list-style: none;
}

.mastery-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mastery-legend li::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--t-border);
  border-radius: 3px;
  background: var(--t-low);
}

.parent-card {
  display: grid;
  gap: 0.2rem;
  color: var(--t-text);
  text-decoration: none;
}

.parent-card span {
  color: var(--t-muted);
  font-size: 0.9rem;
}

/* --- Quiz d'un chapitre (lot R13) ---------------------------------------- */

.quiz-list {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.quiz-item__prompt {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.quiz-item__choices {
  display: grid;
  margin: 0 0 0.75rem;
}

.quiz-item__answer {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
}

.quiz-item__answer summary {
  min-height: var(--t-touch);
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
}

.quiz-item__answer strong {
  color: var(--t-success);
}

/* Quiz joue comme un defi : une question par ecran, cartes de reponse,
   score a la fin. La barre de progression suit le nombre de questions. */
.quiz-play__progress {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.quiz-play .duel-feedback {
  text-align: left;
}

.quiz-play .feedback__title {
  margin: 0 0 0.3rem;
  font-weight: 800;
}

.quiz-play .feedback__explanation {
  margin: 0;
  color: var(--t-text);
}

.quiz-result .actions {
  margin-top: 1rem;
}

/* --- Badges et parrainage cosmetique (lot R14) ---------------------------- */

.badge-tile {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px dashed var(--t-dashed);
  border-radius: 16px;
  background: var(--t-low);
}

.badge-tile[data-earned="true"] {
  border-style: solid;
  border-color: var(--t-accent);
  background: var(--t-accent-bg);
}

.badge-tile strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.badge-tile__progress {
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-weight: 800;
}

.badge-tile__hint {
  color: var(--t-muted);
  font-size: 0.8rem;
}

/* Le cadre d'avatar debloque par « 3 amis defies » : cosmetique seulement. */
.avatar[data-frame="true"] {
  outline: 3px solid var(--t-accent);
  outline-offset: 3px;
}

.friends-gauge {
  display: grid;
  gap: 0.4rem;
  margin: 1rem 0 0;
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.friends-gauge progress {
  width: 100%;
  height: 8px;
  accent-color: var(--t-accent);
}

/* --- Pages colleges et Battle School ------------------------------------- */

/* Rapport officiel du brevet : sobre. */
.report {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--t-border);
  border-radius: 24px;
  background: var(--t-surface);
}

.report > p {
  margin: 0 0 0.75rem;
}

.report__kicker {
  color: var(--t-info-text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report__title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.report__lead,
.report__source {
  color: var(--t-muted);
}

.report__source {
  font-size: 0.8rem;
}

.report__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  margin: 0 0 0.75rem;
}

.report-card {
  padding: 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-low);
}

.report-card__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.report-card__rate {
  margin: 0 0 0.75rem;
  color: var(--t-muted);
}

.report-card__rate strong {
  color: var(--t-success);
  font-family: var(--t-font-title);
  font-size: 2.4rem;
}

.report-card__facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.report-card__facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.report-card__facts dd {
  margin: 0;
  font-weight: 800;
}

.report-mentions {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-mentions li {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.report-bar {
  width: 100%;
  height: 8px;
}

.report-bar__track { fill: var(--t-border); }
.report-bar__value { fill: var(--t-info); }

.report-chart {
  display: block;
  width: 100%;
  height: 90px;
}

.report-chart__bar { fill: var(--t-info-border); }
.report-chart__bar--latest { fill: var(--t-info); }

.report-chart__labels {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  text-align: center;
}

.report-chart__labels span {
  display: block;
  color: var(--t-muted);
}

.college-note {
  margin: 1.5rem 0 1rem;
  color: var(--t-muted);
  font-size: 0.85rem;
}

.college-note p {
  margin: 0 0 0.25rem;
}

.college-note a {
  color: var(--t-accent-text);
}

/* Fin de partie : ce que la partie a rapporte au clan. */

.clan-gain p {
  margin: 0;
}

.clan-gain__title a {
  color: var(--t-text);
  font-weight: 800;
}

.clan-gain__detail {
  color: var(--t-muted);
  font-size: 0.85rem;
}

/* --- Administration (/admin) --------------------------------------------- */
/* Page hors gabarit, en noindex : des tableaux lisibles, rien de plus. */

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-low);
}

.admin {
  max-width: 64rem;
  margin: 0 auto;
}

.admin .card {
  margin-bottom: 1rem;
  /* Un tableau large defile dans sa carte, jamais la page (390 px). */
  overflow-x: auto;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--t-accent-text);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.admin-kpi__value {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.admin-kpi__meta {
  margin: 0.2rem 0 1rem;
  color: var(--t-muted);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.admin-table caption {
  margin-bottom: 0.4rem;
  color: var(--t-muted);
  text-align: left;
}

.admin-table th,
.admin-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--t-border);
  text-align: left;
}

.admin-table td {
  text-align: right;
}

.admin-review {
  margin: 0.6rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--t-border);
  border-radius: 0.6rem;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.admin-total {
  padding: 0.8rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-low);
}

.admin-total dt {
  color: var(--t-muted);
}

.admin-total dd {
  margin: 0.2rem 0 0;
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  font-weight: 800;
}

/* Fiches profs : recherche, fiche, gestes. */
.admin-search,
.admin-gesture {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem;
  margin: 0.8rem 0;
}

.admin-search .field,
.admin-gesture .field {
  flex: 1 1 14rem;
  margin: 0;
}

.admin-results {
  display: grid;
  gap: 0.4rem;
  margin: 0.6rem 0;
  padding: 0;
  list-style: none;
}

.admin-results .link-button {
  text-align: left;
}

.admin-account {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--t-border);
}

.admin-account__title {
  margin: 0 0 0.6rem;
  font-family: var(--t-font-title);
  font-size: 1.3rem;
}

.admin-account__subtitle {
  margin: 1.2rem 0 0;
  font-family: var(--t-font-title);
}

.admin-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0 0 1rem;
}

.admin-facts dt {
  color: var(--t-muted);
}

.admin-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Mes devoirs (/mes-devoirs) : une carte par devoir, l'echeance en clair. */
.homework {
  display: grid;
  gap: 0.35rem;
}

.homework__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.1rem;
}

.homework__meta,
.homework__due,
.homework__bonus {
  margin: 0;
}

.homework__meta {
  color: var(--t-muted);
  font-size: 0.9rem;
}

.homework__due {
  font-weight: 700;
}

/* En retard : le texte le dit, la couleur ne fait que le souligner. */
.homework__due[data-late="true"] {
  color: var(--t-danger);
}

.homework__bonus {
  color: var(--t-accent-text);
  font-size: 0.9rem;
}

.homework .actions {
  margin-top: 0.4rem;
}

/* Suivi d'un devoir ou d'un eleve (espace profs). */
.follow {
  display: grid;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}

.follow h4,
.follow h5,
.follow p {
  margin: 0;
}

.follow__summary {
  font-weight: 700;
}

.follow__prolong {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}

.follow__questions {
  display: grid;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
  padding-left: 1.4rem;
}

/* Pas commence ou en retard : le texte le dit, la couleur ne fait que le souligner. */
.follow-row[data-status="todo"] {
  border-style: dashed;
}

/* Jeu de classe : serie, objectif de la semaine, jours joues. */
.class-game {
  display: grid;
  gap: 0.4rem;
}

.class-game p {
  margin: 0;
}

.class-game__streak {
  font-weight: 700;
}

.class-game__bar {
  width: 100%;
  height: 0.6rem;
  accent-color: var(--t-accent);
}

.class-game__days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-game__days li {
  min-width: 2.4rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
  text-align: center;
}

/* Joue : le coche le dit, le fond ne fait que le souligner. */
.class-game__days li[data-played="true"] {
  background: var(--t-accent-bg);
  border-color: var(--t-accent-border);
}

.class-ranking {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

/* Defi au tableau : le tableau du prof (projete) et le telephone de l'eleve. */
.live-board .card {
  margin-bottom: 1rem;
}

.live-join__code {
  margin: 0.4rem 0;
  font-family: var(--t-font-title);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.15em;
}

.live-lobby {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-lobby li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-button);
}

.live-prompt {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
}

.live-choices {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
  padding: 0;
  list-style: none;
}

.live-choice {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-field);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
}

/* La bonne reponse : le texte le dit, la bordure ne fait que le souligner. */
.live-choice[data-correct="true"] {
  border: 2px solid var(--t-success);
}

.live-choice__count {
  color: var(--t-muted);
}

/* --- Espace profs, page publique (/profs) ---------------------------------- */
/* Une page de presentation : sections empilees, cartes en grille, tout lisible sans script. */

.profs-hero {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.profs-hero .chip {
  justify-self: start;
}

.profs-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
  margin: 0.4rem 0 0;
}

.profs-counters div {
  display: flex;
  flex-direction: column-reverse;
  padding: 0.8rem 1rem;
  border: 1px solid var(--t-accent-border);
  border-radius: var(--t-radius-card);
  background: var(--t-accent-bg);
}

.profs-counters dt {
  color: var(--t-muted);
}

.profs-counters dd {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--t-accent-text);
}

.profs-section {
  margin-bottom: 2rem;
}

.profs-steps,
.profs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0;
  padding: 0;
  list-style: none;
}

.profs-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.profs-steps {
  counter-reset: profs-step;
}

.profs-steps li {
  counter-increment: profs-step;
}

.profs-steps h3::before {
  content: counter(profs-step) ". ";
  color: var(--t-accent-text);
}

.profs-steps h3,
.profs-grid h3 {
  margin: 0 0 0.4rem;
  font-family: var(--t-font-title);
  font-size: 1.1rem;
}

.profs-steps p,
.profs-grid p {
  margin: 0;
}

.profs-faq {
  display: grid;
  gap: 0.5rem;
}

.profs-faq__item {
  padding: 0.8rem 1rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.profs-faq__item summary {
  font-weight: 700;
  cursor: pointer;
}

.profs-faq__item p {
  margin: 0.5rem 0 0;
}

.profs-final {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
}

/* --- Refonte : ecrans du jeu,
Battle School,
cours -------------------------- */
/* Maquettes du 9 novembre 2026 : ces regles viennent apres celles des
   sections precedentes et les precisent. */

/* Matieres : le nom et la barre a la couleur de la matiere. */
.subject-progress__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  padding: 0.8rem 1rem;
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
  border: 2px solid var(--t-border);
  border-radius: 20px;
}

.subject-progress__label {
  font-family: var(--t-font-title);
  font-size: 1.1rem;
  font-weight: 800;
}

[data-subject-row$="-maths"] .subject-progress__label { color: var(--t-maths); }
[data-subject-row$="-francais"] .subject-progress__label { color: var(--t-francais); }
[data-subject-row$="-histoire-geo"] .subject-progress__label { color: var(--t-histoire-geo); }
[data-subject-row$="-svt"] .subject-progress__label { color: var(--t-svt); }
[data-subject-row$="-physique-chimie"] .subject-progress__label { color: var(--t-physique-chimie); }
[data-subject-row$="-technologie"] .subject-progress__label { color: var(--t-technologie); }
[data-subject-row$="-anglais"] .subject-progress__label { color: var(--t-anglais); }
[data-subject-row$="-espagnol"] .subject-progress__label { color: var(--t-espagnol); }

/* Cartes et listes : coins plus ronds,
bordures de 2 px. */
.chapter-link,
.theme-card,
.exercise-item,
.save-banner {
  border-width: 2px;
  border-radius: 22px;
}

/* Tuiles de gains et de progression : XP en cyan, serie et temps en
   flamme, ligue en or. */
.stats .stat {
  margin: 0;
  padding: 0.9rem 0.5rem;
  border: 0;
  border-radius: 20px;
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
  font-weight: 900;
}

.stats .stat strong {
  color: var(--t-accent-text);
  font-size: 1.9rem;
  line-height: 1.1;
}

.stats .stat--xp {
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
}

.stats .stat--xp strong {
  color: var(--t-cyan-text);
}

.stats .stat--league {
  background: var(--t-surface);
  color: var(--t-muted);
}

.stats .stat--league strong {
  color: var(--t-gold-text);
}

.duel-result .stats {
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  max-width: none;
}

.clan-gain {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 20px;
  background: var(--t-battle-bg);
}

.clan-gain__title strong {
  font-family: var(--t-font-title);
  color: var(--t-battle-text);
  font-size: 1.6rem;
}

.duel-result .versus {
  padding: 0.9rem;
  border-radius: 22px;
  background: var(--t-overlay);
}

/* Chapitre : en-tete a l'aplat de la matiere, en relief ; onglets en
   pastilles separees. */
.chapter-hero {
  display: grid;
  gap: 0.6rem;
  margin: 0.5rem 0 0;
  padding: 1.25rem 1.1rem;
  border-radius: 28px;
  background: var(--t-violet);
  color: var(--t-on-fill);
  box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-violet-edge);
}

.chapter-hero .chapter-meta,
.chapter-hero .page-title,
.chapter-hero .step-lead {
  margin: 0;
  color: var(--t-on-fill);
}

.chapter-hero[data-subject="maths"] { background: var(--t-maths-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-maths-edge); }
.chapter-hero[data-subject="francais"] { background: var(--t-francais-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-francais-edge); }
.chapter-hero[data-subject="histoire-geo"] { background: var(--t-histoire-geo-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-histoire-geo-edge); }
.chapter-hero[data-subject="svt"] { background: var(--t-svt-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-svt-edge); }
.chapter-hero[data-subject="physique-chimie"] { background: var(--t-physique-chimie-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-physique-chimie-edge); }
.chapter-hero[data-subject="anglais"] { background: var(--t-anglais-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-anglais-edge); }
.chapter-hero[data-subject="technologie"] { background: var(--t-technologie-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-technologie-edge); }
.chapter-hero[data-subject="espagnol"] { background: var(--t-espagnol-fill); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-espagnol-edge); }

.chapter-tabs {
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.chapter-tab {
  min-height: 44px;
  border-radius: 14px;
  background: var(--t-surface);
}

.chapter-tab[aria-selected="true"] {
  background: var(--t-text);
  color: var(--t-bg);
}

/* Commencer le cours : apprendre, en violet ; defier reste en flamme. */
.chapter-panel .button[data-go] {
  background: var(--t-violet);
  color: var(--t-on-violet);
  box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-violet-edge);
}

/* Brevet : le cyan des sujets. En-tete en carte sombre, numeros et liens
   des corriges en cyan. */
.brevet-hero {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.1rem;
  border: 2px solid var(--t-cyan-edge);
  border-radius: 28px;
  background: radial-gradient(100% 80% at 100% 0%, var(--t-cyan-edge) 0%, var(--t-cyan-bg) 60%);
  color: var(--t-text);
}

.brevet-hero .breadcrumb a,
.brevet-hero__lead {
  color: var(--t-cyan-text);
}

.chip--brevet {
  border-color: var(--t-cyan);
  background: var(--t-cyan);
  color: var(--t-on-cyan);
}

.exercise-item__toggle {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--t-cyan-text);
}

/* Espace profs : une carte par classe, la pastille du niveau a gauche, le
   code en grand. */
.class-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.class-card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1rem 1.1rem 1.1rem;
  border: 2px solid var(--t-border);
  border-top: 6px solid var(--t-violet);
  border-radius: 22px;
  background: var(--t-surface);
}

.class-card[data-grade="6e"] { border-top-color: var(--t-grade-6e); }
.class-card[data-grade="5e"] { border-top-color: var(--t-grade-5e); }
.class-card[data-grade="4e"] { border-top-color: var(--t-grade-4e); }
.class-card[data-grade="3e"] { border-top-color: var(--t-grade-3e); }

.class-card__name {
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.class-card__meta {
  color: var(--t-muted);
  font-size: 0.9rem;
}

.class-card__code {
  justify-self: start;
  padding: 0.2rem 0.7rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-soft);
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.class-card .button {
  justify-self: start;
  margin-top: 0.4rem;
}

/* --- Reviser (refonte, maquette ReviserMobile) ---------------------------
   Bascule Cours en violet, recherche a loupe, onglets de classe a la
   couleur de la classe, « Reprends » en carte flamme, matieres en cartes a
   bandeau colore, deux par ligne. */
.revise-switch__item--on {
  background: var(--t-violet);
  color: var(--t-on-violet);
}

.revise-tools {
  flex-wrap: wrap;
  align-items: center;
  margin: 1rem 0;
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}

.search-field--icon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: none;
  min-height: 54px;
  padding: 0 1rem;
  border: 2px solid var(--t-border);
  border-radius: 18px;
  background: var(--t-surface);
}

.search-field--icon:focus-within {
  border-color: var(--t-accent-text);
}

.search-field--icon input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
  outline: none;
}

.search-field__icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--t-muted);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.grade-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.js:not(.courses-ready) .grade-tabs[hidden] {
  display: grid !important;
}

.grade-tab {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--t-surface);
  color: var(--t-muted);
  font-family: var(--t-font-title);
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.grade-tab[aria-pressed="true"] { color: var(--t-on-grade); }
.grade-tab[data-grade="6e"][aria-pressed="true"] { background: var(--t-grade-6e); box-shadow: 0 4px 0 var(--t-grade-6e-edge); }
.grade-tab[data-grade="5e"][aria-pressed="true"] { background: var(--t-grade-5e); box-shadow: 0 4px 0 var(--t-grade-5e-edge); }
.grade-tab[data-grade="4e"][aria-pressed="true"] { background: var(--t-grade-4e); box-shadow: 0 4px 0 var(--t-grade-4e-edge); }
.grade-tab[data-grade="3e"][aria-pressed="true"] { background: var(--t-grade-3e); box-shadow: 0 4px 0 var(--t-grade-3e-edge); }

.resume-card:has(.resume-card__body) {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 2px solid var(--t-accent-border);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--t-accent-bg), var(--t-surface));
}

.resume-card__play {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 16px;
  background: var(--t-accent);
  box-shadow: 0 4px 0 var(--t-accent-edge);
}

.resume-card__play svg {
  width: 22px;
  height: 22px;
  fill: var(--t-on-accent);
}

.resume-card__body {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.25rem;
}

.resume-card__body .resume-card__label {
  color: var(--t-accent-text);
  font-weight: 900;
}

.resume-card__body .subject-progress__bar {
  height: 8px;
  background: var(--t-soft);
}

.resume-card__body .subject-progress__bar::-webkit-progress-value { background: var(--t-accent); }
.resume-card__body .subject-progress__bar::-moz-progress-bar { background: var(--t-accent); }

.grade-block > .section-title {
  font-size: 1.5rem;
}

.grade-block > .section-title a {
  color: inherit;
  text-decoration: none;
}

.subject-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.grade-block > .subject-cards {
  max-width: 40rem;
}

@media (min-width: 900px) {
  .grade-block > .subject-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
  }
}

.subject-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 22px;
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
  box-shadow: 0 5px 0 var(--t-violet-edge);
}

.subject-card:active {
  transform: translateY(3px);
}

.subject-card__band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 0.75rem;
  background: var(--t-violet);
  color: var(--t-on-fill);
}

.subject-card__abbr {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--t-overlay-light);
  font-family: var(--t-font-title);
  font-size: 0.95rem;
  font-weight: 800;
}

.subject-card__count {
  padding: 0.15rem 0.5rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  font-size: 0.75rem;
  font-weight: 900;
}

.subject-card__name {
  padding: 0.65rem 0.75rem 0;
  font-family: var(--t-font-title);
  font-size: 1.07rem;
  font-weight: 800;
  line-height: 1.2;
}

.subject-card .subject-progress__bar {
  width: auto;
  margin: 0.4rem 0.75rem 0;
  background: var(--t-border);
}

.subject-card .subject-progress__bar::-webkit-progress-bar {
  background: var(--t-border);
}

.subject-card__status {
  padding: 0.35rem 0.75rem 0.75rem;
  color: var(--t-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.subject-card[data-subject="maths"] { box-shadow: 0 5px 0 var(--t-maths-edge); }
.subject-card[data-subject="maths"] .subject-card__band { background: linear-gradient(150deg, var(--t-maths-fill), var(--t-maths-edge)); }
.subject-card[data-subject="maths"] .subject-progress__bar::-webkit-progress-value { background: var(--t-maths-fill); }
.subject-card[data-subject="maths"] .subject-progress__bar::-moz-progress-bar { background: var(--t-maths-fill); }
.subject-card[data-subject="francais"] { box-shadow: 0 5px 0 var(--t-francais-edge); }
.subject-card[data-subject="francais"] .subject-card__band { background: linear-gradient(150deg, var(--t-francais-fill), var(--t-francais-edge)); }
.subject-card[data-subject="francais"] .subject-progress__bar::-webkit-progress-value { background: var(--t-francais-fill); }
.subject-card[data-subject="francais"] .subject-progress__bar::-moz-progress-bar { background: var(--t-francais-fill); }
.subject-card[data-subject="histoire-geo"] { box-shadow: 0 5px 0 var(--t-histoire-geo-edge); }
.subject-card[data-subject="histoire-geo"] .subject-card__band { background: linear-gradient(150deg, var(--t-histoire-geo-fill), var(--t-histoire-geo-edge)); }
.subject-card[data-subject="histoire-geo"] .subject-progress__bar::-webkit-progress-value { background: var(--t-histoire-geo-fill); }
.subject-card[data-subject="histoire-geo"] .subject-progress__bar::-moz-progress-bar { background: var(--t-histoire-geo-fill); }
.subject-card[data-subject="svt"] { box-shadow: 0 5px 0 var(--t-svt-edge); }
.subject-card[data-subject="svt"] .subject-card__band { background: linear-gradient(150deg, var(--t-svt-fill), var(--t-svt-edge)); }
.subject-card[data-subject="svt"] .subject-progress__bar::-webkit-progress-value { background: var(--t-svt-fill); }
.subject-card[data-subject="svt"] .subject-progress__bar::-moz-progress-bar { background: var(--t-svt-fill); }
.subject-card[data-subject="physique-chimie"] { box-shadow: 0 5px 0 var(--t-physique-chimie-edge); }
.subject-card[data-subject="physique-chimie"] .subject-card__band { background: linear-gradient(150deg, var(--t-physique-chimie-fill), var(--t-physique-chimie-edge)); }
.subject-card[data-subject="physique-chimie"] .subject-progress__bar::-webkit-progress-value { background: var(--t-physique-chimie-fill); }
.subject-card[data-subject="physique-chimie"] .subject-progress__bar::-moz-progress-bar { background: var(--t-physique-chimie-fill); }
.subject-card[data-subject="technologie"] { box-shadow: 0 5px 0 var(--t-technologie-edge); }
.subject-card[data-subject="technologie"] .subject-card__band { background: linear-gradient(150deg, var(--t-technologie-fill), var(--t-technologie-edge)); }
.subject-card[data-subject="technologie"] .subject-progress__bar::-webkit-progress-value { background: var(--t-technologie-fill); }
.subject-card[data-subject="technologie"] .subject-progress__bar::-moz-progress-bar { background: var(--t-technologie-fill); }
.subject-card[data-subject="anglais"] { box-shadow: 0 5px 0 var(--t-anglais-edge); }
.subject-card[data-subject="anglais"] .subject-card__band { background: linear-gradient(150deg, var(--t-anglais-fill), var(--t-anglais-edge)); }
.subject-card[data-subject="anglais"] .subject-progress__bar::-webkit-progress-value { background: var(--t-anglais-fill); }
.subject-card[data-subject="anglais"] .subject-progress__bar::-moz-progress-bar { background: var(--t-anglais-fill); }
.subject-card[data-subject="espagnol"] { box-shadow: 0 5px 0 var(--t-espagnol-edge); }
.subject-card[data-subject="espagnol"] .subject-card__band { background: linear-gradient(150deg, var(--t-espagnol-fill), var(--t-espagnol-edge)); }
.subject-card[data-subject="espagnol"] .subject-progress__bar::-webkit-progress-value { background: var(--t-espagnol-fill); }
.subject-card[data-subject="espagnol"] .subject-progress__bar::-moz-progress-bar { background: var(--t-espagnol-fill); }

/* --- Accueil (refonte, maquettes AccueilVisiteurMobile et AccueilDesktop) --
   Heros en trois temps : le titre, le ticket de duel, puis l'appel a jouer
   pose a cheval sur le ticket. Sur ordinateur, le ticket passe a droite. */
.hero {
  display: grid;
  grid-template-areas: "text" "ticket" "play";
  gap: 1.25rem;
}

.hero__text {
  display: flex;
  flex: 1 1 360px;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  grid-area: text;
}
.hero .ticket { grid-area: ticket; width: 100%; }

.hero__play {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.9rem;
  grid-area: play;
  margin-top: -2.6rem;
}

.hero__play .hero__cta {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
}

.hero__play .hero__alt {
  align-self: center;
}

.hero__spark {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--t-gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.hero__spark--gold { top: 28px; right: 34px; width: 24px; height: 24px; }
.hero__spark--cyan { top: 120px; right: 18px; background: var(--t-cyan); }
.hero__spark--small { top: 66px; right: 12px; width: 6px; height: 6px; border-radius: 50%; clip-path: none; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "text ticket" "play ticket";
    align-items: start;
    column-gap: 2rem;
  }

  .hero__play {
    margin-top: 0;
  }

  .hero__play .hero__cta {
    flex-direction: row;
    align-items: center;
  }

  .hero__play .hero__cta .button {
    flex: 0 1 auto;
  }

  .hero .ticket {
    align-self: center;
  }
}

/* « J'ai un code » dans la barre du haut, pour un visiteur, sur mobile (le
   menu lateral le porte sur ordinateur). */
.topbar__code {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.9rem;
  border-radius: 14px;
  background: var(--t-surface);
  color: var(--t-text);
  font-size: 0.85rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.grades .section-title {
  font-size: 1.75rem;
}

/* Cartes : defi du jour, bataille des colleges, puis « Et pour reviser » ;
   sur ordinateur, Reviser d'abord, trois colonnes. */
.home-cards {
  grid-template-columns: minmax(0, 1fr);
}

.home-card--daily {
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 0;
  text-align: center;
}

.home-card--daily .daily-medal {
  width: 104px;
  height: 104px;
  margin-top: -52px;
}

.home-card--daily .home-card__title {
  font-size: 1.9rem;
}

.home-card__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}

.home-card--daily .home-card__action {
  align-self: stretch;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-card__kicker {
  margin: 0 0 0.2rem;
  color: var(--t-battle-text);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-card--battle .home-card__action {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-card__note {
  margin: 0;
  color: var(--t-hero-soft);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.battle-podium {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.battle-podium__row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 0.9rem;
  border-radius: 16px;
  background: var(--t-overlay-strong);
  font-weight: 900;
}

.battle-podium__row[data-rank="1"] {
  border: 2px solid var(--t-gold);
  background: var(--t-accent-bg);
}

.battle-podium__rank {
  font-family: var(--t-font-title);
  font-size: 1.15rem;
  font-weight: 800;
}

.battle-podium__row[data-rank="1"] .battle-podium__rank { color: var(--t-gold); }
.battle-podium__row[data-rank="3"] .battle-podium__rank { color: var(--t-bronze); }

.battle-podium__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-free {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 52px;
  margin: 0;
  padding: 0 0.9rem;
  border: 2px dashed var(--t-battle);
  border-radius: 16px;
  color: var(--t-battle-text);
  font-weight: 900;
}

.home-revise .section-title {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
}

.home-revise__tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.revise-tile {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: 1rem;
  border-radius: 22px;
  color: var(--t-text);
  text-decoration: none;
}

.revise-tile .icon {
  width: 26px;
  height: 26px;
}

.revise-tile strong {
  font-family: var(--t-font-title);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.revise-tile span {
  font-size: 0.82rem;
  font-weight: 800;
}

.revise-tile--courses {
  background: var(--t-violet);
  color: var(--t-on-violet);
  box-shadow: var(--t-relief-soft), 0 6px 0 var(--t-violet-edge);
}

.revise-tile--brevet {
  border: 2px solid var(--t-cyan);
  background: var(--t-cyan-bg);
  color: var(--t-text);
  box-shadow: 0 6px 0 var(--t-cyan-edge);
}

.revise-tile--brevet .icon,
.revise-tile--brevet > span {
  color: var(--t-cyan-text);
}

@media (min-width: 900px) {
  .home-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .home-revise { order: -1; }

  .home-revise__tiles { grid-template-columns: minmax(0, 1fr); }

  .home-card--daily { margin-top: 0; padding-top: 1.35rem; }
  .home-card--daily .daily-medal { width: 84px; height: 84px; margin-top: 0; }
}

@media (min-width: 900px) {
  .code-entry {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .code-entry__hint,
  .code-entry .status {
    grid-column: 1 / -1;
  }
}

.hero__play .hero__cta .button {
  flex: none;
}

@media (min-width: 900px) {
  .profs-pitch .profs-pitch__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profs-pitch .profs-pitch__actions .button {
    flex: 0 1 auto;
    min-width: 15rem;
  }
}

/* --- Chapitre (refonte, maquette ChapitreMobile) -------------------------
   Bandeau : theme en pastille, titre, capsules / questions / minutes en
   pastilles claires, barre d'avancement. Onglets en pastilles qui defilent.
   Cartes numerotees : un carre a la couleur de la matiere, puis le nom. */
.chapter-hero .chapter-meta {
  font-weight: 900;
  text-transform: uppercase;
  justify-self: start;
  padding: 0.25rem 0.7rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.chapter-hero .page-title {
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.05;
}

.chapter-hero .chapter-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-hero .chapter-stats li {
  padding: 0.25rem 0.7rem;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  color: var(--t-on-fill);
  font-size: 0.82rem;
  font-weight: 900;
}

.chapter-hero .chapter-stats strong {
  color: inherit;
}

.chapter-hero__progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0 0;
  font-family: var(--t-font-title);
  font-weight: 800;
}

.chapter-hero__progress progress {
  flex: 1;
  height: 10px;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  appearance: none;
}

.chapter-hero__progress progress::-webkit-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-overlay); }
.chapter-hero__progress progress::-webkit-progress-value { border-radius: var(--t-radius-pill); background: var(--t-accent); }
.chapter-hero__progress progress::-moz-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-accent); }

.chapter-tabs,
.chapter-tabs[role="tablist"] {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 1rem;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: none;
}

.chapter-tabs .chapter-tab {
  flex: none;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 14px;
  background: var(--t-surface);
  color: var(--t-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.chapter-tabs .chapter-tab[aria-selected="true"] {
  background: var(--t-text);
  color: var(--t-bg);
}

.chapter-card {
  line-height: 1.6;
  border-radius: 24px;
}

.chapter-card .chapter-card__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.chapter-card .chapter-card__label[data-num]::before {
  content: attr(data-num);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--t-violet);
  color: var(--t-on-fill);
  font-size: 1rem;
}

.chapter-card[data-card="capsule"] .chapter-card__label[data-num]::before {
  background: var(--t-accent);
  color: var(--t-on-accent);
}

.chapter-card .chapter-card__title {
  font-family: var(--t-font-text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}

.chapter-card[data-card="capsule"] .chapter-card__title {
  font-family: var(--t-font-title);
  font-size: 1.15rem;
}

.chapter-card .chapter-card__formula {
  padding: 1.1rem 1rem;
  border-radius: 18px;
  background: var(--t-info-bg);
  color: var(--t-text);
  font-size: 1.35rem;
}

.chapter-card .chapter-card__tip {
  padding: 0.8rem 0.9rem 0.8rem 2.1rem;
  border-radius: 16px;
  background: var(--t-accent-bg);
  color: var(--t-accent-soft);
  font-weight: 800;
  position: relative;
}

.chapter-card .chapter-card__tip::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  left: 0.9rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--t-accent);
}

.chapter-card .chapter-card__tip strong {
  color: var(--t-accent-soft);
}

.chapter-card .chapter-card__alt {
  border: 0;
  border-radius: 14px;
  background: var(--t-soft);
}

.chapter-card .chapter-card__alt summary {
  color: var(--t-text);
}

.chapter-card .chapter-card__steps li::before {
  border-radius: 50%;
  background: var(--t-info-bg);
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: var(--t-touch);
  font-weight: 700;
  color: var(--t-muted);
}

.breadcrumb li:last-child a {
  color: var(--t-info-text);
}

.chapter-panels[data-chapter*="-maths-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-maths-fill); }
.chapter-panels[data-chapter*="-francais-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-francais-fill); }
.chapter-panels[data-chapter*="-histoire-geo-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-histoire-geo-fill); }
.chapter-panels[data-chapter*="-svt-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-svt-fill); }
.chapter-panels[data-chapter*="-physique-chimie-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-physique-chimie-fill); }
.chapter-panels[data-chapter*="-technologie-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-technologie-fill); }
.chapter-panels[data-chapter*="-anglais-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-anglais-fill); }
.chapter-panels[data-chapter*="-espagnol-"] .chapter-card:not([data-card="capsule"]) .chapter-card__label[data-num]::before { background: var(--t-espagnol-fill); }

/* Le titre « Le cours » reste pour les lecteurs d'ecran : la carte numerotee
   dit deja ou l'on est. */
.chapter-panel--learn > .section-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Corrige (refonte, maquette CorrigeMobile) --------------------------
   Bandeau cyan : « Corrige College en ligne », pastilles, Mode chrono et
   Sujet officiel ; exercices en cartes numerotees, l'exercice ouvert
   cercle de cyan. */
.brevet-hero__kicker {
  justify-self: start;
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  color: var(--t-cyan-text);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brevet-hero--paper {
  display: grid;
  gap: 0.75rem;
}

.brevet-hero--paper .page-title,
.brevet-hero--paper .chips {
  margin: 0;
}

.brevet-hero__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.brevet-hero__actions .button {
  min-height: 50px;
  font-size: 1rem;
}

.brevet-hero__actions .button--ghost {
  border-color: var(--t-cyan-text);
  color: var(--t-text);
}

@media (min-width: 900px) {
  .brevet-hero__actions {
    display: flex;
  }
}

.exercise-item {
  padding: 0.6rem 1rem;
  border: 2px solid var(--t-border);
  border-radius: 20px;
  background: var(--t-surface);
}

.exercise-item[open] {
  border-color: var(--t-cyan);
}

.exercise-item__num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-weight: 800;
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
  border-radius: 10px;
}

/* Le sujet officiel est dans le bandeau : sur telephone, son encadre passe
   apres le corrige. */
@media (max-width: 1099px) {
  .paper-layout__docs { order: 2; }
  .paper-layout__tools { order: 3; }
}

.bs-crest {
  display: grid;
  place-items: center;
  width: 92px;
  height: 104px;
  background: var(--t-gold);
  clip-path: polygon(50% 0, 100% 14%, 100% 55%, 50% 100%, 0 55%, 0 14%);
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 2.2rem;
  font-weight: 800;
  position: relative;
}

.bs-crest::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
}

.board-row[data-rank="1"] {
  border: 2px solid var(--t-gold);
}

.board-row[data-rank="1"] .board-row__rank { color: var(--t-gold); }
.board-row[data-rank="3"] .board-row__rank { color: var(--t-bronze); }

#bs-board .board-row[data-me="true"] {
  border: 2px solid var(--t-battle);
  background: var(--t-battle-bg);
}

/* --- Partie en cours et resultat (maquettes QuestionMobile, ResultatDefi) --
   Pendant une partie, l'ecran ne garde que le jeu : le titre reste pour les
   lecteurs d'ecran, l'introduction et le choix de la classe s'effacent. */
.content:has(.duel:not([hidden])) > .page-title,
.content:has(.duel-result:not([hidden])) > .page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.content:has(.duel:not([hidden])) > .step-lead,
.content:has(.duel:not([hidden])) > .tabs,
.content:has(.duel:not([hidden])) > .daily-head,
.content:has(.duel-result:not([hidden])) > .step-lead,
.content:has(.duel-result:not([hidden])) > .tabs,
.content:has(.duel-result:not([hidden])) > .daily-head {
  display: none;
}

/* Une reponse longue reste lisible : texte en Nunito, taille selon la place. */
.duel .answers .answer {
  font-family: var(--t-font-text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Resultat : trophee et titre dores sur un halo chaud, sans cadre. Le halo
   s'efface sur le fond sombre de l'ilot (`--t-bg` y est celui du mode
   sombre) : en mode clair, sans ce fond, le titre dore et le texte clair
   tombaient sur le fond de page et devenaient illisibles. */
.duel-result .duel-hero {
  border: 0;
  background: radial-gradient(100% 90% at 50% 0%, var(--t-accent-bg) 0%, transparent 75%), var(--t-bg);
  box-shadow: none;
}

.duel-result .duel-hero::before {
  content: "";
  width: 72px;
  height: 72px;
  background: var(--t-gold);
  clip-path: polygon(20% 0, 80% 0, 80% 12%, 100% 12%, 100% 30%, 78% 52%, 60% 58%, 58% 72%, 72% 72%, 72% 86%, 28% 86%, 28% 72%, 42% 72%, 40% 58%, 22% 52%, 0 30%, 0 12%, 20% 12%);
}

.duel-result .duel-hero__title,
.duel-result .duel-hero__title--big {
  color: var(--t-gold);
  font-size: clamp(2.2rem, 10vw, 3.2rem);
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.duel-result .duel-hero__lead {
  color: var(--t-accent-soft);
  text-wrap: balance;
}

/* --- Accueil d'un eleve (maquette AccueilEleveMobile) -------------------
   Salut et badges, mission du jour, defis a jouer, son clan, sa ligue, ses
   devoirs ; le choix de la classe et les cartes du visiteur s'effacent, le
   champ de code passe en bas. */
.home:has(#home-hero[hidden]) .grades,
.home:has(#home-hero[hidden]) .home-cards {
  display: none;
}

.home:has(#home-hero[hidden]) .code-entry {
  order: 10;
}

.home-greeting {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.home-greeting__text {
  display: grid;
  margin: 0;
}

.home-greeting__text strong {
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  line-height: 1.1;
}

.home-greeting__text span {
  color: var(--t-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.home-clan {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.1rem;
  border: 2px solid var(--t-battle);
  border-radius: 26px;
  background: radial-gradient(120% 90% at 0% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 75%);
  color: var(--t-hero-text);
}

.home-clan__kicker {
  margin: 0;
  color: var(--t-battle-text);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-clan__name {
  margin: 0;
  font-size: 1.4rem;
}

.home-clan__meta,
.home-clan__today,
.home-clan__raid-score {
  margin: 0;
  color: var(--t-hero-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.home-clan__raid {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: var(--t-overlay-strong);
}

.home-clan__raid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}

.home-clan__raid progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-overlay);
  appearance: none;
}

.home-clan__raid progress::-webkit-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-overlay); }
.home-clan__raid progress::-webkit-progress-value { border-radius: var(--t-radius-pill); background: var(--t-battle); }
.home-clan__raid progress::-moz-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-battle); }

.home-homework {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 2px solid var(--t-violet);
  border-radius: 22px;
  background: var(--t-surface);
  color: var(--t-text);
  text-decoration: none;
}

.home-homework__text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.home-homework__text span {
  color: var(--t-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.home:has(#home-hero[hidden]) #home-subjects {
  order: 9;
}

/* --- Ma progression (maquette ProgressionMobile) ------------------------
   Carte du profil en violet, semaine en flammes, a revoir avec un bouton,
   badges en grille de trois, carte de maitrise en lignes de matieres. */

.profile-card .profile-card__pseudo {
  color: var(--t-hero-text);
}

.profile-card .profile-card__meta {
  color: var(--t-hero-soft);
}

.profile-card .avatar--large {
  width: 88px;
  height: 88px;
  border: 4px solid var(--t-gold);
  font-size: 2.4rem;
}

.week__day .week__dot {
  border-radius: 12px;
}

.week__day[data-active="true"] .week__dot {
  border-color: var(--t-accent-border);
  background: radial-gradient(60% 60% at 50% 60%, var(--t-accent) 0%, var(--t-streak) 45%, var(--t-accent-bg) 100%);
}

.week__day[data-today="true"] .week__dot {
  border-color: var(--t-accent);
  box-shadow: 0 3px 0 var(--t-accent-edge);
}

.review-list .review-item {
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 18px;
  background: var(--t-low);
}

.review-item__state {
  flex: none;
  color: var(--t-accent-text);
  font-size: 0.8rem;
  font-weight: 800;
  order: -1;
}

.review-item::after {
  content: "Réviser";
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  background: var(--t-accent);
  box-shadow: 0 3px 0 var(--t-accent-edge);
  color: var(--t-on-accent);
  font-family: var(--t-font-title);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-grid {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.badge-grid .badge-tile {
  position: relative;
  justify-items: center;
  padding: 0.9rem 0.5rem;
  border-radius: 18px;
  text-align: center;
}

.badge-grid .badge-tile::before {
  content: "";
  width: 44px;
  height: 50px;
  background: var(--t-accent);
  clip-path: polygon(50% 0, 100% 14%, 100% 55%, 50% 100%, 0 55%, 0 14%);
}

.badge-grid .badge-tile[data-earned="false"] {
  border: 2px dashed var(--t-border);
  background: transparent;
  color: var(--t-muted);
}

.badge-grid .badge-tile[data-earned="false"]::before {
  background: var(--t-soft);
}

.badge-grid .badge-tile strong {
  font-size: 0.8rem;
}

.badge-grid .badge-tile__hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mastery-grid {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}

.mastery-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
}

.mastery-row__label {
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mastery-row__cells {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mastery-row__cells .mastery-cell {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.profile-card {
  align-items: center;
  gap: 1rem;
  max-width: 40rem;
  justify-items: center;
  border: 2px solid var(--t-rim);
  border-radius: 28px;
  background: radial-gradient(120% 90% at 50% 0%, var(--t-hero-2) 0%, var(--t-hero-3) 55%, var(--t-hero-4) 100%);
  color: var(--t-hero-text);
  text-align: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

#profile-save {
  border: 0;
  background: var(--t-accent);
  box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-accent-edge);
  color: var(--t-on-accent);
}

#profile-save .save-banner__text,
#profile-save .save-banner__action {
  color: var(--t-on-accent);
}

/* --- Defi recu (maquette DefiRecuMobile) ---------------------------------
   Grand avatar de l'adversaire et ses epees, titre en grand, message en
   bulle violette, score a battre ; trois reperes en tuiles. */
.duel-intro .duel-hero {
  border: 0;
  background: radial-gradient(90% 70% at 50% 0%, var(--t-hero-2) 0%, transparent 70%), var(--t-bg);
  box-shadow: none;
}

.duel-hero__face {
  position: relative;
}

.duel-intro .avatar--hero {
  width: 120px;
  height: 120px;
  border: 5px solid var(--t-gold);
  font-size: 3.2rem;
}

.duel-hero__swords {
  position: absolute;
  right: -10px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid var(--t-bg);
  border-radius: 16px;
  background: var(--t-low);
  color: var(--t-accent);
}

.duel-intro .duel-hero__title {
  color: var(--t-hero-text);
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.05;
}

.duel-intro .duel-hero__lead {
  padding: 0.5rem 1rem;
  border-radius: 16px;
  background: var(--t-violet);
  color: var(--t-on-violet);
}

.duel-hero__beat {
  color: var(--t-hero-soft);
  font-family: var(--t-font-text);
  font-size: 0.9rem;
  font-weight: 800;
}

.duel-intro .facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.duel-intro .facts li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.3rem;
  padding: 0.8rem 0.4rem;
  border-radius: 18px;
  background: var(--t-surface);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.duel-intro .facts__badge {
  background: transparent;
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: 1.5rem;
}

.battle-podium__row[data-rank="2"] .battle-podium__rank,
.board-row[data-rank="2"] .board-row__rank { color: var(--t-silver); }

/* --- Espace profs (maquette EspaceProfsDesktop) --------------------------
   Salut et resume, cartes de classe avec serie, ligue et objectif, carte
   « Creer une classe », ligue des classes en panneau sombre. */
.teacher-hello {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}

.teacher-hello__name {
  font-family: var(--t-font-title);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.teacher-hello__summary {
  color: var(--t-muted);
  font-weight: 800;
}

.class-card__game {
  display: grid;
  gap: 0.4rem;
}

.class-card__game:empty {
  display: none;
}

.class-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.class-card__league {
  border: 2px solid var(--t-border);
}

.class-card__league[data-division="bronze"] { border-color: var(--t-bronze); }
.class-card__league[data-division="argent"] { border-color: var(--t-silver); }
.class-card__league[data-division="or"] { border-color: var(--t-gold); }
.class-card__league[data-division="platine"] { border-color: var(--t-cyan); }

.class-card__goal {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 900;
}

.class-card__goal strong {
  color: var(--t-success);
}

.class-card__bar {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-soft);
  appearance: none;
}

.class-card__bar::-webkit-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-soft); }
.class-card__bar::-webkit-progress-value { border-radius: var(--t-radius-pill); background: var(--t-success); }
.class-card__bar::-moz-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-success); }

.class-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
}

.class-card > :not(.class-card__name, .class-card__code) {
  grid-column: 1 / -1;
}

.class-card__code {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

/* Le nom ouvre la classe ; toute la carte est cliquable. */
.class-card__open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.class-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.class-card:has(.class-card__open:hover) {
  border-color: var(--t-violet);
}

.class-card--new {
  padding: 0;
  border: 0;
  background: none;
}

.class-new {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px dashed var(--t-violet);
  border-radius: 22px;
  background: none;
  color: var(--t-info-text);
  font-family: var(--t-font-title);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}

.class-new:hover {
  background: var(--t-info-bg);
}

.class-form {
  max-width: 32rem;
  margin-bottom: 1.5rem;
}

/* Tableau de bord : menu des profs a gauche des 900 px, salut et gestes
   en tete, ligue des classes et devoirs en cours cote a cote. */
.teacher-nav {
  display: none;
}

.teacher-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.teacher-head__who {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
}

.teacher-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.teacher-head__actions .button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.teacher-head__actions .icon {
  width: 20px;
  height: 20px;
}

.teacher-panels {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.teacher-panels .league-panel {
  margin: 0;
}

.teacher-current {
  display: grid;
  gap: 0.75rem;
}

.teacher-current .section-title {
  margin: 0;
}

.teacher-current__table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  font-size: 0.95rem;
}

.teacher-current__table th[scope="col"] {
  padding: 0 0.6rem;
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
}

.teacher-current__table tbody th,
.teacher-current__table tbody td {
  padding: 0.85rem 0.6rem;
  background: var(--t-low);
  font-weight: 800;
  text-align: left;
}

.teacher-current__table tbody th {
  border-radius: 14px 0 0 14px;
}

.teacher-current__table tbody td:last-child {
  border-radius: 0 14px 14px 0;
}

.teacher-current__title {
  color: var(--t-text);
  font-weight: 900;
  text-align: left;
}

.teacher-current__done {
  color: var(--t-muted);
}

.teacher-current__done strong {
  color: var(--t-text);
}

.teacher-current__average[data-level="good"] { color: var(--t-success); }
.teacher-current__average[data-level="mid"] { color: var(--t-accent-text); }
.teacher-current__average[data-level="none"] { color: var(--t-muted); }

/* Sous 600 px, une ligne par devoir en carte : le titre, puis chaque
   valeur precedee de son intitule (la colonne n'est plus lisible). */
@media (max-width: 599px) {
  .teacher-current__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .teacher-current__table,
  .teacher-current__table tbody {
    display: block;
  }

  .teacher-current__table tbody tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    margin-bottom: 0.5rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: var(--t-low);
  }

  .teacher-current__table tbody th {
    flex-basis: 100%;
  }

  .teacher-current__table tbody th,
  .teacher-current__table tbody td {
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .teacher-current__table tbody td::before {
    content: attr(data-label) " ";
    color: var(--t-muted);
    font-size: 0.8rem;
  }
}

.teacher-alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--t-battle-bg);
  color: var(--t-battle-text);
}

.teacher-alert__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--t-battle-text);
  color: var(--t-battle-bg);
  font-weight: 900;
}

.teacher-alert__text {
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
  font-weight: 800;
}

.teacher-alert__text strong {
  color: var(--t-text);
}

@media (min-width: 900px) {
  /* Connecte, le menu des profs remplace la barre du haut. */
  .admin-page:has(#teacher-space:not([hidden])) .admin-bar {
    display: none;
  }

  .admin:has(#teacher-space:not([hidden])) {
    max-width: none;
    padding: 0;
  }

  .admin:has(#teacher-space:not([hidden])) > .page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .teacher-space:not([hidden]) {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 100vh;
  }

  .teacher-nav {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--t-border);
    background: var(--t-low);
  }

  .teacher-nav__badge {
    align-self: flex-start;
    border: 1px solid var(--t-violet);
    color: var(--t-info-text);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .teacher-nav__links {
    display: grid;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
  }

  .teacher-nav__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0 0.9rem;
    border: 0;
    border-radius: var(--t-radius-field);
    background: none;
    color: var(--t-nav);
    font: inherit;
    font-weight: 900;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .teacher-nav__link:hover {
    background: var(--t-surface);
    color: var(--t-text);
  }

  .teacher-nav__link[href="#teacher-list"] {
    background: var(--t-info-bg);
    color: var(--t-info-text);
  }

  .teacher-main {
    padding: 2rem 2.5rem 3rem;
  }
}

@media (min-width: 1100px) {
  .teacher-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}

.league-panel {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 1.2rem;
  border: 2px solid var(--t-rim);
  border-radius: 26px;
  background: linear-gradient(180deg, var(--t-hero-3) 0%, var(--t-hero-4) 100%);
  color: var(--t-hero-text);
}

.league-panel__title {
  margin: 0;
  font-size: 1.4rem;
}

.league-panel__note {
  margin: 0;
  color: var(--t-hero-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.league-rows {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.league-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  min-height: 52px;
  padding: 0.5rem 0.9rem;
  border-radius: 16px;
  background: var(--t-overlay-strong);
  font-weight: 800;
}

.league-row[data-rank="1"] {
  border: 2px solid var(--t-gold);
}

.league-row[data-move="down"] {
  background: var(--t-battle-bg);
}

.league-row__rank {
  width: 1.4rem;
  font-family: var(--t-font-title);
  font-size: 1.15rem;
}

.league-row__name {
  flex: 1 1 6rem;
}

.league-row__division[data-division="bronze"] { color: var(--t-bronze); }
.league-row__division[data-division="argent"] { color: var(--t-silver); }
.league-row__division[data-division="or"] { color: var(--t-gold); }
.league-row__division[data-division="platine"] { color: var(--t-cyan-text); }

.league-row__xp {
  color: var(--t-hero-soft);
}

.league-row__move {
  color: var(--t-success);
  font-weight: 900;
}

.league-row[data-move="down"] .league-row__move {
  color: var(--t-battle-text);
}

.class-game__league {
  margin: 0;
  font-weight: 900;
}

/* ===========================================================================
   Battle School (Thibaud, 11 novembre 2026, sur le modele des pages de
   Lycee en ligne) : l'accueil /battle-school, les pages des colleges, des
   communes, des departements et des academies. Rouge combat et or ; fond
   degrade du rouge vers le noir sur le haut de l'ecran, puis noir, dans
   les deux themes (`body[data-page="battle"] .app` porte les jetons du
   mode sombre, voir tokens.css). Le menu lateral garde le theme choisi.
   =========================================================================== */

body[data-page="battle"] .app {
  background: linear-gradient(180deg, var(--t-battle) 0%, var(--t-battle-edge) 22%, var(--t-bg) 48%) top / 100% 100vh no-repeat, var(--t-bg);
  color: var(--t-text);
}

body[data-page="battle"] .topbar {
  background: transparent;
}

body[data-page="battle"] .content {
  max-width: 1160px;
}

/* Liens du contenu en or ; boutons et cartes cliquables gardent les leurs. */
body[data-page="battle"] main a:not(.button, .bs-neighbour, .bs-pill) {
  color: var(--t-gold);
}

body[data-page="battle"] .breadcrumb,
body[data-page="battle"] .breadcrumb li + li::before {
  color: var(--t-bs-soft);
}

.bs-page {
  display: grid;
  gap: 4rem;
}

.bs-glyph {
  flex-shrink: 0;
}

/* --- Surtitres, titres, mots mis en avant ---------------------------------- */

.bs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--t-gold);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bs-hl {
  position: relative;
  color: var(--t-gold);
}

.bs-accent {
  color: var(--t-battle-text);
}

.bs-panel__title,
.bs-section__title {
  margin: 0;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.1;
}

.bs-panel__lead,
.bs-section__note {
  margin: 0;
  color: var(--t-bs-soft);
  font-size: 0.9375rem;
}

.bs-section {
  display: grid;
  gap: 1rem;
}

.bs-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: 28px;
  background: var(--t-bs-veil);
}

@media (min-width: 720px) {
  .bs-panel {
    padding: 1.5rem;
  }
}

.bs-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--t-gold-edge);
  border-radius: var(--t-radius-card);
  background: var(--t-bs-shade);
  color: var(--t-on-battle);
}

/* --- En-tete : texte a gauche, logo et carte a droite ---------------------- */

.bs-hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 0 1.5rem;
}

@media (min-width: 900px) {
  .bs-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

.bs-hero__text {
  display: grid;
  gap: 1rem;
}

.bs-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.bs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--t-bs-chip-line);
  border-radius: var(--t-radius-pill);
  background: var(--t-bs-shade);
  color: var(--t-on-battle);
  font-weight: 800;
  font-size: 0.8125rem;
}

.bs-chip--red {
  border-color: var(--t-gold);
  background: var(--t-battle);
}

.bs-hero__title {
  margin: 0 0 0.5rem;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.bs-hero__line {
  position: absolute;
  left: 0;
  bottom: -0.15em;
  width: 100%;
  height: 0.3em;
  fill: none;
  stroke: var(--t-gold);
  stroke-width: 4;
  stroke-linecap: round;
}

/* Sur le rouge du haut de l'ecran : blanc, pour le contraste. */
.bs-hero__lead {
  margin: 0;
  color: var(--t-on-battle);
  font-size: 1.0625rem;
}

.bs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bs-cta {
  font-size: 1.0625rem;
}

/* Bouton secondaire sur le rouge : contour clair, meme hauteur. */
.button.bs-ghost {
  border: 2px solid var(--t-bs-ghost);
  background: transparent;
  color: var(--t-on-battle);
  box-shadow: 0 6px 0 var(--t-bs-ghost);
}

.button.bs-ghost:active {
  box-shadow: 0 3px 0 var(--t-bs-ghost);
}

.bs-hero__demo {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1rem;
}

.bs-hero__logo {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 12px 32px var(--t-bs-gold-glow));
}

/* Exemple de raid de l'accueil : une carte inclinee. */
.bs-match {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
  padding: 1rem;
  border: 2px solid var(--t-battle);
  border-radius: var(--t-radius-card);
  background: radial-gradient(120% 70% at 50% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 80%);
  transform: rotate(-2deg);
}

.bs-match__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  justify-self: start;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-battle);
  color: var(--t-on-battle);
  font-weight: 800;
  font-size: 0.75rem;
}

.bs-match__sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.bs-match__side {
  display: grid;
  gap: 2px;
  margin: 0;
  text-align: center;
}

.bs-match__side strong {
  color: var(--t-on-battle);
  font-size: 0.9375rem;
}

.bs-match__side span,
.bs-match__vs {
  margin: 0;
  color: var(--t-gold);
  font-family: var(--t-font-title);
  font-size: 1.5rem;
  font-weight: 800;
}

/* Jauge : du rouge vers l'or (raid, objectif de saison). */
.bs-progress {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-battle-bg);
  appearance: none;
}

.bs-progress::-webkit-progress-bar {
  border-radius: var(--t-radius-pill);
  background: var(--t-battle-bg);
}

.bs-progress::-webkit-progress-value {
  border-radius: var(--t-radius-pill);
  background: linear-gradient(90deg, var(--t-battle), var(--t-gold));
}

.bs-progress::-moz-progress-bar {
  border-radius: var(--t-radius-pill);
  background: linear-gradient(90deg, var(--t-battle), var(--t-gold));
}

/* Carte de score d'un college ou d'un clan, dans l'en-tete. */
.bs-score {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
  padding: 1.25rem 1rem 1rem;
  border: 2px solid var(--t-battle);
  border-radius: 28px;
  background: radial-gradient(120% 70% at 50% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 75%);
  color: var(--t-on-battle);
  text-align: center;
}

.bs-score__label {
  margin: 0;
  color: var(--t-gold);
  font-weight: 800;
}

.bs-score__value {
  margin: 0;
  color: var(--t-gold);
  font-family: var(--t-font-title);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.bs-score__facts,
.bs-score__goal {
  margin: 0;
  color: var(--t-bs-soft);
  font-size: 0.875rem;
}

.bs-score__name {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.25rem;
  line-height: 1.15;
}

/* --- Recherche ------------------------------------------------------------- */

.bs-find__form {
  position: relative;
}

.bs-find__icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  display: flex;
  transform: translateY(-50%);
}

.bs-find__input {
  width: 100%;
  min-height: 56px;
  padding: 0 1rem 0 3.25rem;
  border: 3px solid var(--t-gold);
  border-radius: var(--t-radius-pill);
  background: var(--t-bs-white);
  color: var(--t-bs-ink);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
}

.bs-find__input::placeholder {
  color: var(--t-bs-placeholder);
}

.bs-find__input:focus-visible {
  outline: 3px solid var(--t-on-battle);
  outline-offset: 3px;
}

.bs-find__hint {
  margin: 0;
  color: var(--t-bs-soft);
  font-size: 0.875rem;
}

/* Villes trouvees : pastilles ; colleges d'une ville : lignes. */
.bs-chips,
.bs-results,
.bs-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-results {
  display: grid;
}

.bs-chip-button {
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 2px solid var(--t-bs-chip-line);
  border-radius: var(--t-radius-pill);
  background: var(--t-bs-shade);
  color: var(--t-on-battle);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.bs-chip-button[aria-pressed="true"],
.bs-chip-button[aria-selected="true"] {
  border-color: var(--t-battle-edge);
  background: var(--t-battle);
}

.bs-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: 20px;
  background: var(--t-bs-veil);
}

.bs-result__text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.bs-result__text span {
  color: var(--t-bs-soft);
  font-size: 0.875rem;
}

/* --- Comment ca marche ------------------------------------------------------ */

.bs-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-step {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: var(--t-radius-card);
  background: var(--t-bs-veil);
  color: var(--t-bs-soft);
}

.bs-step strong {
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 1.25rem;
}

.bs-step__number {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--t-gold);
  box-shadow: 0 5px 0 var(--t-gold-edge);
  color: var(--t-bs-ink);
  font-family: var(--t-font-title);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

/* --- Classement : podium puis liste ---------------------------------------- */

.bs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bs-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 0 0;
  list-style: none;
}

.bs-stage__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  text-align: center;
}

.bs-stage__name {
  max-width: 100%;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

body[data-page="battle"] main .bs-stage__name a,
body[data-page="battle"] main .bs-board__name a {
  color: inherit;
  text-decoration: none;
}

body[data-page="battle"] main .bs-board__name a:hover,
body[data-page="battle"] main .bs-stage__name a:hover {
  text-decoration: underline;
}

.bs-stage__score {
  color: var(--t-gold);
  font-size: 0.8125rem;
  font-weight: 800;
}

.bs-stage__block {
  display: grid;
  place-items: start center;
  box-sizing: border-box;
  width: 100%;
  padding-top: 10px;
  border-bottom: 6px solid;
  border-radius: 16px 16px 6px 6px;
  font-family: var(--t-font-title);
  font-size: 1.875rem;
  font-weight: 800;
}

.bs-stage__step[data-rank="1"] .bs-stage__block {
  height: 130px;
  border-color: var(--t-gold-edge);
  background: var(--t-gold);
  color: var(--t-bs-ink);
}

.bs-stage__step[data-rank="2"] .bs-stage__block {
  height: 96px;
  border-color: var(--t-battle-edge);
  background: var(--t-battle);
  color: var(--t-on-battle);
}

.bs-stage__step[data-rank="3"] .bs-stage__block {
  height: 72px;
  border-color: var(--t-bs-bronze-edge);
  background: var(--t-bs-bronze);
  color: var(--t-bs-ink);
}

/* Le college de la page, ou celui de l'eleve, sur le podium. */
.bs-stage__step[data-me="true"] .bs-stage__block {
  box-shadow: 0 0 0 3px var(--t-on-battle);
}

.bs-stage__step[data-me="true"] .bs-stage__name::after {
  content: attr(data-label);
  display: block;
  color: var(--t-bs-soft);
  font-family: var(--t-font-text);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bs-board__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-board__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: 18px;
  background: var(--t-bs-veil);
}

.bs-board__row[data-me="true"] {
  border-color: var(--t-gold);
}

.bs-board__rank {
  min-width: 2ch;
  color: var(--t-bs-soft);
  font-family: var(--t-font-title);
  font-weight: 800;
}

.bs-board__name {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--t-on-battle);
  font-weight: 800;
}

.bs-board__meta {
  color: var(--t-bs-soft);
  font-weight: 700;
  font-size: 0.75rem;
}

.bs-board__score {
  flex-shrink: 0;
  color: var(--t-gold);
  font-weight: 800;
  white-space: nowrap;
}

/* --- Regles en cartes de jeu ---------------------------------------------- */

.bs-rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .bs-rules {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .bs-rules {
    grid-template-columns: repeat(6, 1fr);
  }
}

.bs-rule {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  border: 2px solid var(--t-battle);
  border-radius: var(--t-radius-card);
  background: radial-gradient(120% 70% at 50% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 80%);
  text-align: center;
}

.bs-rule[data-tone="gold"] {
  border-color: var(--t-gold);
}

.bs-rule__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--t-bs-white);
}

.bs-rule__value {
  color: var(--t-gold);
  font-family: var(--t-font-title);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.bs-rule__title {
  margin: 0;
  color: var(--t-on-battle);
  font-size: 1rem;
}

.bs-rule__text {
  margin: 0;
  color: var(--t-bs-soft);
  font-size: 0.8125rem;
}

/* --- Trophees et niveaux --------------------------------------------------- */

.bs-rewards {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .bs-rewards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bs-rewards__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--t-on-battle);
  font-size: 1.125rem;
}

.bs-trophies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-trophy {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 2px solid var(--t-bs-gold-line);
  border-radius: 18px;
  background: var(--t-bs-shade);
  text-align: center;
}

.bs-trophy strong {
  color: var(--t-gold);
}

.bs-trophy span {
  color: var(--t-bs-soft);
  font-size: 0.75rem;
}

/* Trophee a conquerir : en pointilles. */
.bs-trophy[data-kind="locked"] {
  border-style: dashed;
  border-color: var(--t-bs-chip-line);
}

.bs-trophy[data-kind="locked"] strong {
  color: var(--t-bs-soft);
}

/* Escalier des niveaux : une marche par niveau, de plus en plus haute. */
.bs-levels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  margin: 0;
  padding: 0.75rem 0 0;
  list-style: none;
}

.bs-level {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.bs-level__bar {
  width: 100%;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--t-gold), var(--t-battle));
}

.bs-level[data-level="1"] .bs-level__bar { height: 24px; }
.bs-level[data-level="2"] .bs-level__bar { height: 36px; }
.bs-level[data-level="3"] .bs-level__bar { height: 50px; }
.bs-level[data-level="4"] .bs-level__bar { height: 66px; }
.bs-level[data-level="5"] .bs-level__bar { height: 84px; }
.bs-level[data-level="6"] .bs-level__bar { height: 104px; }
.bs-level[data-level="7"] .bs-level__bar { height: 126px; }

.bs-level strong {
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 1rem;
}

.bs-level span:last-child {
  color: var(--t-bs-soft);
  font-size: 0.625rem;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Bandeau final ---------------------------------------------------------- */

.bs-final {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  overflow: hidden;
  padding: 2.5rem 1rem;
  border: 2px solid var(--t-gold);
  border-radius: 32px;
  background: radial-gradient(120% 90% at 50% 0%, var(--t-battle) 0%, var(--t-battle-edge) 45%, var(--t-battle-deep) 100%);
  text-align: center;
}

.bs-final > :not(.bs-confetti) {
  position: relative;
}

.bs-final .bs-panel__lead {
  color: var(--t-on-battle);
}

.bs-final .bs-cta {
  justify-self: center;
}

.bs-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bs-confetti [data-tone="gold"] { fill: var(--t-gold); }
.bs-confetti [data-tone="red"] { fill: var(--t-bs-confetti); }
.bs-confetti [data-tone="white"] { fill: var(--t-bs-white); }

.bs-final__art {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  margin: 0;
}

.bs-final__title {
  margin: 0;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.1;
}

/* --- Territoires : communes et leurs colleges ------------------------------- */

.bs-communes,
.bs-neighbours {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Beaucoup de communes dans un departement : plusieurs colonnes. */
@media (min-width: 720px) {
  .bs-communes {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    align-items: start;
  }
}

.bs-commune {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: var(--t-radius-card);
  background: var(--t-bs-veil);
}

.bs-commune__name {
  margin: 0;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 1.125rem;
}

.bs-commune__colleges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-page="battle"] main .bs-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border: 2px solid var(--t-bs-gold-line);
  border-radius: var(--t-radius-pill);
  background: var(--t-bs-shade);
  color: var(--t-gold);
  font-weight: 800;
  font-size: 0.875rem;
  text-decoration: none;
}

body[data-page="battle"] main a.bs-pill:hover {
  border-color: var(--t-gold);
}

/* Un college (voisin, d'une commune) ou un departement par ligne. */
.bs-neighbour {
  display: grid;
  gap: 0.25rem;
  height: 100%;
  padding: 1rem;
  border: 2px solid var(--t-bs-line);
  border-radius: var(--t-radius-card);
  background: var(--t-bs-veil);
  color: var(--t-on-battle);
  text-decoration: none;
}

body[data-page="battle"] main a.bs-neighbour {
  color: var(--t-on-battle);
  text-decoration: none;
}

body[data-page="battle"] main a.bs-neighbour:hover {
  border-color: var(--t-gold);
}

.bs-neighbour strong {
  font-family: var(--t-font-title);
  font-size: 1.0625rem;
}

.bs-neighbour span {
  color: var(--t-gold);
  font-weight: 800;
  font-size: 0.8125rem;
}

.bs-more {
  font-weight: 800;
}

/* --- Equipes de niveau d'un college ------------------------------------------ */

.bs-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-team {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  border: 2px solid var(--t-bs-line);
  border-radius: var(--t-radius-card);
  background: var(--t-bs-veil);
  text-align: center;
}

.bs-team[data-state="active"] {
  border-color: var(--t-battle);
  background: radial-gradient(120% 70% at 50% 0%, var(--t-battle-glow) 0%, var(--t-battle-deep) 80%);
}

.bs-team__name {
  margin: 0;
  color: var(--t-on-battle);
  font-family: var(--t-font-title);
  font-size: 1.75rem;
  line-height: 1.1;
}

.bs-team__pupils,
.bs-team__meta {
  margin: 0;
  color: var(--t-bs-soft);
  font-size: 0.8125rem;
}

.bs-team__badge {
  margin: 0.25rem 0 0;
  padding: 0.25rem 0.75rem;
  border: 2px dashed var(--t-bs-chip-line);
  border-radius: var(--t-radius-pill);
  color: var(--t-bs-soft);
  font-weight: 800;
  font-size: 0.75rem;
}

.bs-team[data-state="active"] .bs-team__badge {
  border: 0;
  background: var(--t-gold);
  color: var(--t-bs-ink);
  font-family: var(--t-font-title);
  font-size: 1.125rem;
}

.bs-team[data-mine="true"] {
  box-shadow: 0 0 0 3px var(--t-gold);
}

/* Raid en cours : nous contre eux. */
.bs-raid__body {
  display: grid;
  gap: 0.75rem;
}

.bs-raid__body p {
  margin: 0;
}

.bs-raid__gap {
  color: var(--t-bs-soft);
}

/* Blocs de l'eleve sur l'accueil : a la largeur de lecture. */
#bs-clan,
#bs-raid,
.bs-notice {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.bs-clan__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Rapport du brevet, sur le noir. */
body[data-page="battle"] .report {
  margin: 0;
}

.bs-find__guest {
  display: grid;
  gap: 0.5rem;
}

/* ===========================================================================
   Refonte ordinateur, lot 2 : jouer et defier (Thibaud, 11 novembre 2026,
   maquettes ordinateur du canevas). Accueil d'un eleve en deux colonnes,
   page Defis (lancement a gauche, defi du jour et « Mes defis » a droite),
   defi du jour en carte heros, question et resultat plus larges.
   =========================================================================== */

/* Accueil d'un eleve : sur mobile, une seule colonne (mission, defis a
   jouer, clan, ligue, devoirs, matieres) ; des 1100 px, la mission et les
   matieres a gauche, le clan, la ligue et les devoirs a droite. Un visiteur
   n'a pas de mission : le bloc entier se retire. */
.home-member {
  display: grid;
  gap: 1.75rem;
}

.content:has(#home-mission[hidden]) .home-member {
  display: none;
}

.home-member__main,
.home-member__side {
  display: contents;
}

#home-toplay { order: 2; }
#home-clan { order: 3; }
#home-league { order: 4; }
#home-homework { order: 5; }
#home-subjects { order: 6; }

.subject-progress__item[data-subject="maths"] .subject-progress__bar::-webkit-progress-value { background: var(--t-maths-fill); }
.subject-progress__item[data-subject="francais"] .subject-progress__bar::-webkit-progress-value { background: var(--t-francais-fill); }
.subject-progress__item[data-subject="histoire-geo"] .subject-progress__bar::-webkit-progress-value { background: var(--t-histoire-geo-fill); }
.subject-progress__item[data-subject="svt"] .subject-progress__bar::-webkit-progress-value { background: var(--t-svt-fill); }
.subject-progress__item[data-subject="physique-chimie"] .subject-progress__bar::-webkit-progress-value { background: var(--t-physique-chimie-fill); }
.subject-progress__item[data-subject="technologie"] .subject-progress__bar::-webkit-progress-value { background: var(--t-technologie-fill); }
.subject-progress__item[data-subject="anglais"] .subject-progress__bar::-webkit-progress-value { background: var(--t-anglais-fill); }
.subject-progress__item[data-subject="espagnol"] .subject-progress__bar::-webkit-progress-value { background: var(--t-espagnol-fill); }
.subject-progress__item[data-subject="maths"] .subject-progress__bar::-moz-progress-bar { background: var(--t-maths-fill); }
.subject-progress__item[data-subject="francais"] .subject-progress__bar::-moz-progress-bar { background: var(--t-francais-fill); }
.subject-progress__item[data-subject="histoire-geo"] .subject-progress__bar::-moz-progress-bar { background: var(--t-histoire-geo-fill); }
.subject-progress__item[data-subject="svt"] .subject-progress__bar::-moz-progress-bar { background: var(--t-svt-fill); }
.subject-progress__item[data-subject="physique-chimie"] .subject-progress__bar::-moz-progress-bar { background: var(--t-physique-chimie-fill); }
.subject-progress__item[data-subject="technologie"] .subject-progress__bar::-moz-progress-bar { background: var(--t-technologie-fill); }
.subject-progress__item[data-subject="anglais"] .subject-progress__bar::-moz-progress-bar { background: var(--t-anglais-fill); }
.subject-progress__item[data-subject="espagnol"] .subject-progress__bar::-moz-progress-bar { background: var(--t-espagnol-fill); }

@media (min-width: 1100px) {
  .home-member {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
  }

  .home-member__main,
  .home-member__side {
    display: grid;
    gap: 1.25rem;
  }

  #home-subjects .subject-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Question en cours et resultat : plus larges, gros enonce. */
  .duel-intro,
  .duel,
  #defi-notice {
    max-width: 56rem;
  }

  .duel-result {
    max-width: 60rem;
  }

  .duel-prompt {
    padding: 2rem;
    font-size: 2.2rem;
  }

  .answer {
    min-height: 120px;
    font-size: 1.6rem;
  }
}

/* ===========================================================================
   Refonte ordinateur, lot 3 : reviser (Thibaud, 11 novembre 2026). Page
   d'une matiere en bandeau a la couleur de la matiere, cartes de theme en
   relief, quiz d'un chapitre en deux colonnes de choix et appel au defi.
   =========================================================================== */

.subject-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.75rem;
  padding: 1.5rem;
  border-radius: 28px;
  color: var(--t-on-fill);
}

.subject-hero[data-subject="maths"] { background: linear-gradient(135deg, var(--t-maths-fill) 0%, var(--t-maths-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-maths-edge); }
.subject-hero[data-subject="francais"] { background: linear-gradient(135deg, var(--t-francais-fill) 0%, var(--t-francais-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-francais-edge); }
.subject-hero[data-subject="histoire-geo"] { background: linear-gradient(135deg, var(--t-histoire-geo-fill) 0%, var(--t-histoire-geo-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-histoire-geo-edge); }
.subject-hero[data-subject="svt"] { background: linear-gradient(135deg, var(--t-svt-fill) 0%, var(--t-svt-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-svt-edge); }
.subject-hero[data-subject="physique-chimie"] { background: linear-gradient(135deg, var(--t-physique-chimie-fill) 0%, var(--t-physique-chimie-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-physique-chimie-edge); }
.subject-hero[data-subject="technologie"] { background: linear-gradient(135deg, var(--t-technologie-fill) 0%, var(--t-technologie-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-technologie-edge); }
.subject-hero[data-subject="anglais"] { background: linear-gradient(135deg, var(--t-anglais-fill) 0%, var(--t-anglais-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-anglais-edge); }
.subject-hero[data-subject="espagnol"] { background: linear-gradient(135deg, var(--t-espagnol-fill) 0%, var(--t-espagnol-edge) 100%); box-shadow: var(--t-relief-soft), 0 7px 0 var(--t-espagnol-edge); }

.subject-hero__text {
  display: grid;
  flex: 1 1 18rem;
  gap: 0.35rem;
}

.subject-hero .page-title {
  margin: 0;
}

.subject-hero .step-lead {
  margin: 0;
  color: var(--t-on-fill);
  opacity: 0.92;
}

.theme-card {
  border-width: 2px;
  box-shadow: 0 6px 0 var(--t-low);
}

.theme-card__title {
  font-size: 1.3rem;
}

.quiz-item__choices {
  gap: 0.5rem;
  padding: 0;
  list-style: none;
  counter-reset: choix;
}

.quiz-item__choices li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 0.9rem;
  border-radius: 14px;
  background: var(--t-low);
  font-weight: 800;
  counter-increment: choix;
}

.quiz-item__choices li::before {
  content: counter(choix, upper-alpha);
  color: var(--t-violet-text);
  font-family: var(--t-font-title);
}

.quiz-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  max-width: 56rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 2px solid var(--t-accent-edge);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--t-accent-bg) 0%, var(--t-surface) 100%);
  color: var(--t-text);
}

.quiz-cta__text {
  display: grid;
  flex: 1 1 18rem;
  gap: 0.3rem;
}

.quiz-cta__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.5rem;
}

.quiz-cta__lead {
  margin: 0;
  color: var(--t-muted);
}

@media (min-width: 900px) {
  .subject-hero {
    padding: 2rem 2.25rem;
  }

  .quiz-list {
    max-width: 56rem;
  }

  .quiz-item__prompt {
    font-size: 1.35rem;
  }

  .quiz-item__choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===========================================================================
   Refonte ordinateur, lot 4 : le brevet (Thibaud, 11 novembre 2026). Sur
   ordinateur, le compte a rebours de la page d'une session passe en grand
   bloc a droite du heros ; les sujets et leurs corrigés gardent leur mise
   en page, deja a deux colonnes.
   =========================================================================== */

@media (min-width: 1100px) {
  .brevet-hero:has(.brevet-countdown) {
    grid-template-columns: minmax(0, 1fr) 15rem;
    align-items: center;
    column-gap: 2rem;
    padding: 2rem 2.25rem;
  }

  .brevet-hero:has(.brevet-countdown) > * {
    grid-column: 1;
  }

  .brevet-hero:has(.brevet-countdown) .page-title {
    font-size: 3rem;
  }

  .brevet-hero .brevet-countdown {
    grid-column: 2;
    grid-row: 1 / span 3;
    justify-self: stretch;
    margin: 0;
    padding: 1.5rem 1.25rem;
    border: 2px solid var(--t-cyan-edge);
    border-radius: 24px;
    background: var(--t-bg);
    color: var(--t-cyan-text);
    font-family: var(--t-font-title);
    font-size: 1.5rem;
    line-height: 1.2;
    text-align: center;
  }
}

/* ===========================================================================
   Refonte ordinateur, lot 5 : compte et classes (Thibaud, 11 novembre 2026).
   Ma progression en deux colonnes (profil, serie, revisions et maitrise a
   gauche ; badges, sauvegarde et reglages a droite), classement et devoirs
   plus larges.
   =========================================================================== */

.profile-main,
.profile-side {
  display: contents;
}

@media (min-width: 1100px) {
  #profile-panel:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
  }

  .profile-main,
  .profile-side {
    display: grid;
    align-content: start;
    gap: 1rem;
  }

  .profile-main > *,
  .profile-side > * {
    max-width: none;
    margin: 0;
  }

  .board {
    max-width: 56rem;
  }

  #homework-lists:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1.25rem 1.5rem;
  }

  #homework-classes-box,
  #homework-lists > .switch-link {
    grid-column: 1 / -1;
  }
}

/* ===========================================================================
   Refonte ordinateur, lot 6 : profs et pages annexes (Thibaud, 11 novembre
   2026). La page des profs s'ouvre sur un heros violet, ses compteurs a
   droite sur ordinateur ; les pages legales gardent une ligne de lecture
   confortable.
   =========================================================================== */

.profs-hero.dark-island {
  padding: 1.6rem 1.3rem;
  border: 2px solid var(--t-info-border);
  border-radius: 32px;
  background:
    radial-gradient(80% 70% at 100% 0%, var(--t-glow-cyan) 0%, transparent 60%),
    linear-gradient(180deg, var(--t-profs-1) 0%, var(--t-profs-2) 100%);
  box-shadow: var(--t-relief-soft), 0 8px 0 var(--t-hero-4);
  color: var(--t-hero-text);
}

.profs-hero.dark-island .step-lead {
  color: var(--t-hero-text);
}

@media (min-width: 1100px) {
  .profs-hero.dark-island {
    grid-template-columns: minmax(0, 1fr) 17rem;
    column-gap: 2rem;
    align-items: center;
    padding: 2.25rem;
  }

  .profs-hero.dark-island > * {
    grid-column: 1;
  }

  .profs-hero.dark-island .profs-counters {
    grid-column: 2;
    grid-row: 1 / span 4;
    grid-template-columns: 1fr;
    margin: 0;
  }

  .prose.card {
    max-width: 52rem;
  }
}

/* --- Sommaire des pages legales (maquette LegalDesktop, 11 novembre 2026) ---
   Sur mobile, au-dessus du texte ; des 1100 px, colonne fixe a gauche. */
.legal-layout {
  display: grid;
  gap: 1.25rem;
}

.legal-toc {
  padding: 1rem 1.2rem;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-card);
  background: var(--t-surface);
}

.legal-toc__title {
  margin: 0 0 0.5rem;
  color: var(--t-violet-text);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-toc__list {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc__list a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0.2rem 0;
  color: var(--t-text);
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.legal-toc__list a:hover {
  color: var(--t-violet-text);
  text-decoration: underline;
}

@media (min-width: 1100px) {
  .legal-layout {
    grid-template-columns: 16rem minmax(0, 52rem);
    align-items: start;
    gap: 2rem;
  }

  .legal-toc {
    position: sticky;
    top: 1.25rem;
  }
}

/* --- Page introuvable (404.html, maquette ErreurDesktop) ------------------- */
.not-found {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  max-width: 44rem;
  margin: 2rem auto 0;
  text-align: center;
}

.not-found__code {
  margin: 0;
  color: var(--t-accent-text);
  font-family: var(--t-font-title);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
}

.not-found .page-title {
  margin: 0;
}

.not-found__actions {
  justify-content: center;
}

/* --- Page Defis (maquette DefisDesktop) : en-tete et badge, lancement en
   pleine largeur, puis A jouer et En attente cote a cote, Termines dessous. */
.defis-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.defis-head__text .page-title,
.defis-head__text .step-lead {
  margin-bottom: 0;
}

.accent-text {
  color: var(--t-accent-text);
}

.badge-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 22px;
}

.badge-progress__icon {
  width: 26px;
  height: 26px;
  color: var(--t-gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.badge-progress__text {
  display: grid;
  gap: 0.25rem;
  min-width: 12.5rem;
}

.badge-progress__text strong {
  font-family: var(--t-font-title);
  font-size: 1.25rem;
}

.badge-progress__text span {
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-progress__bar {
  width: 100%;
  height: 8px;
  accent-color: var(--t-accent);
}

.defis-page {
  display: grid;
  align-content: start;
  gap: 1.5rem;
}

.defis-create {
  display: grid;
  align-content: start;
  gap: 1rem;
  border: 2px solid var(--t-accent-edge);
  background: linear-gradient(180deg, var(--t-accent-bg) 0%, var(--t-surface) 60%);
}

.kicker {
  margin: 0;
  color: var(--t-accent-text);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.defis-create .section-title {
  margin: -0.5rem 0 0;
  font-size: 1.9rem;
}

/* Nouveau defi en ecrans de cartes (Thibaud, 12 novembre 2026) : sur
   quoi, la matiere, puis le chapitre ; toucher un chapitre lance la partie. */
.create-steps {
  display: flex;
  gap: 6px;
  margin-top: -0.4rem;
}

.create-steps span {
  flex: 1;
  height: 8px;
  border-radius: var(--t-radius-pill);
  background: var(--t-border);
}

.create-steps span[data-on="true"] {
  background: var(--t-accent);
}

.create-flow {
  display: grid;
  gap: 0.9rem;
}

.create-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.create-nav:not(:has(:not([hidden]):not(:empty))) {
  display: none;
}

.create-back {
  min-height: var(--t-touch);
  padding: 0 0.9rem;
  border: 2px solid var(--t-border);
  border-radius: var(--t-radius-pill);
  background: transparent;
  color: var(--t-text);
  font-weight: 900;
  cursor: pointer;
}

.create-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.create-crumbs li {
  padding: 0.3rem 0.7rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-low);
  font-size: 0.85rem;
  font-weight: 900;
}

.create-grades,
.create-subjects,
.chapter-picks {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.create-grades {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grade-card {
  width: 100%;
  min-height: 84px;
  border: 0;
  border-radius: 22px;
  background: var(--t-violet);
  box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-violet-edge);
  color: var(--t-on-fill);
  font-family: var(--t-font-title);
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
}

.grade-card[data-grade="6e"] { background: var(--t-grade-6e); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-grade-6e-edge); }
.grade-card[data-grade="5e"] { background: var(--t-grade-5e); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-grade-5e-edge); }
.grade-card[data-grade="4e"] { background: var(--t-grade-4e); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-grade-4e-edge); }
.grade-card[data-grade="3e"] { background: var(--t-grade-3e); box-shadow: var(--t-relief-hi), 0 6px 0 var(--t-grade-3e-edge); }

.scope-cards {
  display: grid;
  gap: 0.75rem;
}

.scope-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--t-border);
  border-radius: 20px;
  background: var(--t-surface);
  box-shadow: 0 5px 0 var(--t-border);
  color: var(--t-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.scope-card::after {
  content: "›";
  margin-left: auto;
  color: var(--t-muted);
  font-size: 1.6rem;
}

.scope-card[data-scope="chapter"] {
  border-color: var(--t-accent);
  box-shadow: 0 5px 0 var(--t-accent-edge);
}

.scope-card:disabled {
  opacity: 0.5;
  cursor: default;
}

.scope-card__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--t-accent);
  color: var(--t-on-accent);
  font-family: var(--t-font-title);
  font-size: 1.4rem;
  font-weight: 800;
}

.scope-card[data-scope="grade"] .scope-card__icon {
  background: var(--t-violet);
  color: var(--t-on-fill);
}

.scope-card[data-scope="paper"] .scope-card__icon {
  background: var(--t-cyan);
  color: var(--t-on-cyan);
}

.scope-card__text {
  display: grid;
  gap: 0.15rem;
}

.scope-card__text strong {
  font-family: var(--t-font-title);
  font-size: 1.15rem;
}

.scope-card__text span {
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.create-subjects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-subjects .subject-card {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.create-subjects .subject-card__name {
  padding-bottom: 0.8rem;
}

.create-subjects .subject-card__count {
  white-space: nowrap;
}

.create-message {
  margin: 0 0 0.25rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: var(--t-low);
  color: var(--t-muted);
  font-size: 0.9rem;
}

.create-message strong {
  color: var(--t-text);
}

.create-theme {
  margin: 0.9rem 0 0.5rem;
  color: var(--t-muted);
  font-size: 1rem;
}

.chapter-picks {
  gap: 0.6rem;
}

.chapter-picks li {
  display: grid;
}

.chapter-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--t-surface);
  box-shadow: 0 4px 0 var(--t-border);
  color: var(--t-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chapter-pick[data-selected="true"] {
  border-color: var(--t-accent);
}

.chapter-pick:disabled {
  opacity: 0.6;
  cursor: progress;
}

.chapter-pick__text {
  display: grid;
  gap: 0.1rem;
}

.chapter-pick__text strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.chapter-pick__text span {
  color: var(--t-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.chapter-pick__go {
  flex: none;
  margin-left: auto;
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  background: var(--t-accent);
  box-shadow: 0 3px 0 var(--t-accent-edge);
  color: var(--t-on-accent);
  font-family: var(--t-font-title);
  font-size: 0.85rem;
  font-weight: 800;
}

@media (min-width: 900px) {
  .scope-cards {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }

  .create-grades,
  .create-subjects {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chapter-picks {
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  }
}

.mine {
  display: grid;
  gap: 1.25rem;
}

.mine__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 1.25rem;
  align-items: start;
}

.mine-group {
  display: grid;
  gap: 0.75rem;
}

.mine-group__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.4rem;
}

.mine-group__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: var(--t-radius-pill);
  background: var(--t-accent-bg);
  color: var(--t-accent-text);
  font-family: var(--t-font-text);
  font-size: 0.85rem;
  font-weight: 900;
}

.mine-group__empty {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.outcome {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 30px;
  padding: 0 0.75rem;
  border-radius: var(--t-radius-pill);
  font-size: 0.85rem;
  font-weight: 900;
}

.outcome--win { background: var(--t-success-bg); color: var(--t-success); }
.outcome--loss { background: var(--t-danger-bg); color: var(--t-danger-soft); }
.outcome--tie { background: var(--t-low); color: var(--t-text); }

/* --- Defi du jour (maquette DefiDuJourDesktop) ----------------------------- */

.daily-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.daily-head__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.4rem;
  font-weight: 700;
}

.daily-head__grades {
  margin: 0;
}

.daily-head__grades .tab {
  min-width: 64px;
  min-height: 48px;
  border: 2px solid var(--t-border);
  border-radius: 14px;
  background: transparent;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 1.25rem;
}

.daily-head__grades .tab[aria-selected="true"] {
  border-color: var(--t-cyan-deep);
  background: var(--t-cyan-deep);
  color: var(--t-hero-text);
}

.daily-intro {
  display: grid;
  gap: 1.5rem;
}

.daily-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  padding: 2.25rem;
  border: 2px solid var(--t-night-line);
  border-radius: 36px;
  background:
    radial-gradient(60% 70% at 85% 10%, var(--t-glow-gold) 0%, transparent 60%),
    linear-gradient(180deg, var(--t-night-1) 0%, var(--t-night-2) 100%);
  color: var(--t-text);
}

.daily-hero__text {
  display: flex;
  flex: 1 1 420px;
  flex-direction: column;
  gap: 1rem;
}

.daily-hero .kicker {
  color: var(--t-accent);
}

.daily-hero__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
}

.daily-hero__lead {
  margin: 0;
  color: var(--t-hero-soft);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.daily-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.daily-hero__start {
  gap: 0.5rem;
  min-height: 66px;
  padding: 0 1.75rem;
}

.daily-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-hero__chips .chip {
  border: 0;
  font-weight: 900;
}

.chip--cyan {
  background: var(--t-cyan-bg);
  color: var(--t-cyan-text);
}

.chip--battle {
  background: var(--t-battle-bg);
  color: var(--t-battle-text);
}

.daily-hero__clock {
  display: flex;
  flex: 0 1 320px;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.daily-ring {
  position: relative;
  width: 200px;
  height: 200px;
}

.daily-ring__svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.daily-ring__track,
.daily-ring__bar {
  fill: none;
  stroke-width: 14;
}

.daily-ring__track {
  stroke: var(--t-border);
}

.daily-ring__bar {
  stroke: var(--t-accent);
}

.daily-ring__text {
  position: absolute;
  inset: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 50%;
  background: var(--t-night-1);
}

.daily-ring__label {
  color: var(--t-hero-chip);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-ring__text strong {
  font-family: var(--t-font-title);
  font-size: 2.15rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.daily-hero__players {
  margin: 0;
  color: var(--t-hero-soft);
  font-weight: 900;
  text-align: center;
}

.daily-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
}

.daily-stat__label {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-stat--gold .daily-stat__label { color: var(--t-gold-text); }
.daily-stat--cyan .daily-stat__label { color: var(--t-cyan-text); }
.daily-stat--flame .daily-stat__label { color: var(--t-accent-text); }

.daily-stat__value {
  font-family: var(--t-font-title);
  font-size: 2.5rem;
  line-height: 1;
}

.daily-stat__text {
  color: var(--t-muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.daily-after {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  border: 2px solid var(--t-border);
}

.daily-after__text {
  flex: 1 1 320px;
}

.daily-after__title {
  margin: 0 0 0.25rem;
  font-family: var(--t-font-title);
  font-size: 1.4rem;
}

.daily-after__text p {
  margin: 0;
  color: var(--t-muted);
  font-weight: 700;
}

/* --- Accueil d'un eleve (maquette AccueilEleveDesktop) --------------------- */

.home-hello {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.home-hello__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
}

.home-hello__meta {
  margin: 0.35rem 0 0;
  color: var(--t-muted);
  font-weight: 700;
}

.home-hello__badge,
.mission-card__head .chip,
.home-panel__head .chip,
.home-homework__chips .chip {
  border: 0;
  font-weight: 900;
}

.chip--gold { background: var(--t-gold-wash); color: var(--t-gold-text); }
.chip--flame { background: var(--t-accent-bg); color: var(--t-accent-text); }
.chip--violet { background: var(--t-violet-bg); color: var(--t-violet-text); text-decoration: none; }
.chip--success {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: var(--t-success-bg);
  color: var(--t-success);
  font-weight: 900;
}

.mission-card {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 2px solid var(--t-accent-edge);
}

.mission-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mission-card__head .chip {
  margin: 0;
}

.mission-card__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.75rem;
  line-height: 1.1;
}

.mission-card__list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: var(--t-low);
}

.mission-row__icon,
.subject-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.mission-row__icon .icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mission-row__icon--done { background: var(--t-success-bg); color: var(--t-success); }
.mission-row__icon--daily { background: var(--t-accent-bg); color: var(--t-accent); }
.mission-row__icon--daily .icon { fill: currentColor; stroke-width: 1.5; }

.subject-badge {
  background: var(--t-violet);
  color: var(--t-on-fill);
  font-family: var(--t-font-title);
  font-size: 0.95rem;
  font-weight: 800;
}

.subject-badge[data-subject="maths"] { background: var(--t-maths-fill); box-shadow: inset 0 -3px 0 var(--t-maths-edge); }
.subject-badge[data-subject="francais"] { background: var(--t-francais-fill); box-shadow: inset 0 -3px 0 var(--t-francais-edge); }
.subject-badge[data-subject="histoire-geo"] { background: var(--t-histoire-geo-fill); box-shadow: inset 0 -3px 0 var(--t-histoire-geo-edge); }
.subject-badge[data-subject="svt"] { background: var(--t-svt-fill); box-shadow: inset 0 -3px 0 var(--t-svt-edge); }
.subject-badge[data-subject="physique-chimie"] { background: var(--t-physique-chimie-fill); box-shadow: inset 0 -3px 0 var(--t-physique-chimie-edge); }
.subject-badge[data-subject="technologie"] { background: var(--t-technologie-fill); box-shadow: inset 0 -3px 0 var(--t-technologie-edge); }
.subject-badge[data-subject="anglais"] { background: var(--t-anglais-fill); box-shadow: inset 0 -3px 0 var(--t-anglais-edge); }
.subject-badge[data-subject="espagnol"] { background: var(--t-espagnol-fill); box-shadow: inset 0 -3px 0 var(--t-espagnol-edge); }

.mission-row__text {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.1rem;
}

.mission-row__text span {
  color: var(--t-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.mission-row[data-done="true"] .mission-row__text strong {
  color: var(--t-muted);
  text-decoration: line-through;
}

.mission-row[data-done="true"] .mission-row__text span {
  color: var(--t-success);
}

.mission-row .button--small {
  min-height: 44px;
  font-size: 0.95rem;
}

.mission-row .button--glow {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mission-row .icon--small {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}

.mission-card__bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-low);
  appearance: none;
}

.mission-card__bar::-webkit-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-low); }
.mission-card__bar::-webkit-progress-value { border-radius: var(--t-radius-pill); background: linear-gradient(90deg, var(--t-accent-deep), var(--t-accent)); }
.mission-card__bar::-moz-progress-bar { border-radius: var(--t-radius-pill); background: linear-gradient(90deg, var(--t-accent-deep), var(--t-accent)); }

.home-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem 1.5rem;
}

.home-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.home-panel__head .chip {
  margin: 0;
}

.home-panel__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.4rem;
  line-height: 1.15;
}

.home-panel__more {
  justify-self: start;
  color: var(--t-violet-text);
  font-weight: 900;
}

.home-panel__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.home-panel__note {
  margin: 0;
  color: var(--t-muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.home-subjects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-subject {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--t-text);
  text-decoration: none;
}

.home-subject .subject-badge {
  width: 40px;
  height: 40px;
}

.home-subject__text {
  display: grid;
  flex: 1 1 auto;
  gap: 0.25rem;
  min-width: 0;
}

.home-subject__text span {
  color: var(--t-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.home-subject__bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--t-radius-pill);
  background: var(--t-low);
  appearance: none;
}

.home-subject__bar::-webkit-progress-bar { border-radius: var(--t-radius-pill); background: var(--t-low); }
.home-subject[data-subject="maths"] .home-subject__bar::-webkit-progress-value { background: var(--t-maths-fill); }
.home-subject[data-subject="maths"] .home-subject__bar::-moz-progress-bar { background: var(--t-maths-fill); }
.home-subject[data-subject="francais"] .home-subject__bar::-webkit-progress-value { background: var(--t-francais-fill); }
.home-subject[data-subject="francais"] .home-subject__bar::-moz-progress-bar { background: var(--t-francais-fill); }
.home-subject[data-subject="histoire-geo"] .home-subject__bar::-webkit-progress-value { background: var(--t-histoire-geo-fill); }
.home-subject[data-subject="histoire-geo"] .home-subject__bar::-moz-progress-bar { background: var(--t-histoire-geo-fill); }
.home-subject[data-subject="svt"] .home-subject__bar::-webkit-progress-value { background: var(--t-svt-fill); }
.home-subject[data-subject="svt"] .home-subject__bar::-moz-progress-bar { background: var(--t-svt-fill); }
.home-subject[data-subject="physique-chimie"] .home-subject__bar::-webkit-progress-value { background: var(--t-physique-chimie-fill); }
.home-subject[data-subject="physique-chimie"] .home-subject__bar::-moz-progress-bar { background: var(--t-physique-chimie-fill); }
.home-subject[data-subject="technologie"] .home-subject__bar::-webkit-progress-value { background: var(--t-technologie-fill); }
.home-subject[data-subject="technologie"] .home-subject__bar::-moz-progress-bar { background: var(--t-technologie-fill); }
.home-subject[data-subject="anglais"] .home-subject__bar::-webkit-progress-value { background: var(--t-anglais-fill); }
.home-subject[data-subject="anglais"] .home-subject__bar::-moz-progress-bar { background: var(--t-anglais-fill); }
.home-subject[data-subject="espagnol"] .home-subject__bar::-webkit-progress-value { background: var(--t-espagnol-fill); }
.home-subject[data-subject="espagnol"] .home-subject__bar::-moz-progress-bar { background: var(--t-espagnol-fill); }

.home-clan {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.25rem 1.5rem;
  border-color: var(--t-battle-edge);
  border-radius: var(--t-radius-card);
}

.home-clan__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.home-clan__logo {
  display: block;
  flex: 0 0 auto;
}

.home-clan__kicker {
  margin: 0;
}

.home-clan__name {
  margin: 0.15rem 0;
  font-size: 1.4rem;
}

.home-clan__raid {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: var(--t-overlay);
}

.home-clan__raid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
}

.home-clan__raid-score {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin: 0;
  font-family: var(--t-font-title);
}

.home-clan__us,
.home-clan__them {
  font-size: 1.9rem;
}

.home-clan__them,
.home-clan__vs {
  color: var(--t-battle-text);
}

.home-league {
  border: 2px solid var(--t-night-line);
  background: linear-gradient(180deg, var(--t-night-1) 0%, var(--t-night-2) 100%);
}

.home-league__list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-league__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--t-overlay);
}

.home-league__row[data-me="true"] {
  border-color: var(--t-accent);
  background: var(--t-accent-bg);
}

.home-league__rank {
  width: 1.4rem;
  color: var(--t-gold-text);
  font-family: var(--t-font-title);
  font-size: 1.1rem;
}

.home-league__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-league__xp {
  font-family: var(--t-font-title);
}

.home-homework {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
}

.home-homework__text {
  display: grid;
  flex: 1 1 auto;
  gap: 0.1rem;
  min-width: 0;
}

.home-homework__text span {
  color: var(--t-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.home-homework__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content:has(#home-mission:not([hidden])) .code-entry {
  margin-top: 1.5rem;
  border: 2px solid var(--t-cyan-edge);
}

@media (min-width: 900px) {
  .content:has(#home-mission:not([hidden])) .code-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem 1rem;
  }

  .content:has(#home-mission:not([hidden])) .code-entry__hint,
  .content:has(#home-mission:not([hidden])) .code-entry .status {
    grid-column: 1 / -1;
  }
}

/* Rien a droite (ni clan, ni ligue, ni devoirs) : la colonne de gauche prend toute la largeur. */
@media (min-width: 1100px) {
  .home-member:not(:has(.home-member__side > :not([hidden]))) {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Reviser (maquette ReviserDesktop) ------------------------------------- */

.revise-title__grade {
  color: var(--t-cyan-text);
}

.revise-lead {
  margin-top: 0.25rem;
}

.js:not(.courses-ready) .revise-lead:not(:last-of-type) {
  display: none;
}

.resume-card__badge {
  width: 40px;
  height: 40px;
}

.resume-card:has(.resume-card__body) {
  gap: 1rem;
  border: 2px solid var(--t-night-line);
  background: linear-gradient(180deg, var(--t-night-1) 0%, var(--t-night-2) 100%);
}

.resume-card__body .resume-card__label {
  color: var(--t-hero-chip);
}

.resume-card__go {
  flex: 0 0 auto;
  min-height: 44px;
  pointer-events: none;
}

.revise-brevet {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  font-weight: 900;
  text-decoration: none;
}

.revise-brevet .icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.revise-how {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem;
}

.revise-how__title {
  margin: 0;
  font-family: var(--t-font-title);
  font-size: 1.4rem;
}

.revise-how__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.revise-how__step {
  display: grid;
  gap: 0.3rem;
}

.revise-how__step span:last-child {
  color: var(--t-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.revise-how__num {
  font-family: var(--t-font-title);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

.revise-how__step[data-step="1"] .revise-how__num { color: var(--t-violet-text); }
.revise-how__step[data-step="2"] .revise-how__num { color: var(--t-cyan-text); }
.revise-how__step[data-step="3"] .revise-how__num { color: var(--t-accent-text); }

@media (min-width: 900px) {
  .revise-switch {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    background: none;
  }

  .revise-switch__item {
    min-height: 40px;
    padding: 0 1rem;
    border: 2px solid var(--t-border);
    border-radius: var(--t-radius-pill);
    color: var(--t-text);
  }

  .revise-switch__item--on {
    border-color: var(--t-violet);
  }

  .grade-tabs {
    display: flex;
    gap: 0.5rem;
  }

  .js:not(.courses-ready) .grade-tabs[hidden] {
    display: flex !important;
  }

  .grade-tab {
    min-width: 58px;
    min-height: 48px;
    padding: 0 0.9rem;
    border: 2px solid var(--t-border);
    border-radius: 14px;
    background: transparent;
    color: var(--t-text);
  }

  .grade-tab[aria-pressed="true"] {
    border-color: transparent;
  }

  .revise-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: none;
  }

  .revise-tools .search-field--icon {
    flex: 0 1 26rem;
  }

  .grade-block > .subject-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .subject-card {
    border-radius: 24px;
  }

  .subject-card__band {
    align-items: flex-end;
    height: 92px;
    padding: 0 1rem 0.75rem;
  }

  .subject-card__abbr {
    width: auto;
    height: auto;
    background: none;
    font-size: 2.6rem;
    line-height: 1;
  }

  .subject-card__name {
    padding: 0.9rem 1rem 0;
    font-size: 1.15rem;
  }

  .subject-card .subject-progress__bar {
    margin: 0.6rem 1rem 0;
  }

  .subject-card__status {
    padding: 0.45rem 1rem 1rem;
  }
}

/* --- Ma progression d'un visiteur ---------------------------------------
   Avant la premiere partie : ce que la page suivra, a zero, autour d'un
   appel a jouer. Rien n'y est personnel ni lu par l'API. */

.guest-progress {
  display: grid;
  gap: 1.25rem;
  max-width: 64rem;
}

.guest-hero {
  display: grid;
  gap: 0.6rem;
  padding: 1.6rem 1.4rem;
  border: 2px solid var(--t-accent-border);
  border-radius: 28px;
  background: radial-gradient(120% 90% at 0% 0%, var(--t-hero-2) 0%, var(--t-hero-3) 55%, var(--t-hero-4) 100%);
  box-shadow: var(--t-relief-soft), 0 8px 0 var(--t-hero-edge);
  color: var(--t-hero-soft);
}

.guest-hero__kicker,
.guest-card__kicker {
  margin: 0;
  color: var(--t-accent-text);
  font-family: var(--t-font-text);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guest-hero__title {
  margin: 0;
  color: var(--t-hero-text);
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.1;
  text-wrap: balance;
}

.guest-hero__lead {
  max-width: 38rem;
  margin: 0;
  font-weight: 700;
}

.guest-hero .actions {
  margin-top: 0.4rem;
}

.guest-hero__restore {
  margin: 0;
  font-size: 0.9rem;
}

.guest-hero__restore a {
  color: var(--t-accent-text);
  font-weight: 900;
}

.guest-preview {
  display: grid;
  gap: 1rem;
}

.guest-preview > .card {
  max-width: none;
  margin: 0;
}

.guest-card__lead {
  margin: 0.4rem 0 0;
  color: var(--t-muted);
  font-size: 0.9rem;
}

.guest-streak {
  display: grid;
  gap: 1rem;
  border: 2px solid var(--t-accent-border);
}

.guest-streak__count {
  margin: 0.2rem 0 0;
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.guest-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guest-counter {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--t-border);
  border-radius: 20px;
  background: var(--t-surface);
}

.guest-counter__label {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guest-counter[data-kind="xp"] .guest-counter__label { color: var(--t-cyan-text); }
.guest-counter[data-kind="mastered"] .guest-counter__label { color: var(--t-success); }
.guest-counter[data-kind="wins"] .guest-counter__label { color: var(--t-accent-text); }
.guest-counter[data-kind="brevet"] .guest-counter__label { color: var(--t-violet-text); }

.guest-counter strong {
  color: var(--t-text);
  font-family: var(--t-font-title);
  font-size: 2rem;
  line-height: 1;
}

/* Pour un visiteur, le moyen d'obtenir chaque badge reste lisible. */
.guest-badges .badge-grid .badge-tile__hint {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  font-size: 0.75rem;
  white-space: normal;
}

.guest-badges .badge-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guest-map .mastery-grid {
  margin-top: 0.9rem;
}

@media (min-width: 700px) {
  .guest-streak {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    align-items: center;
  }

  .guest-counters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guest-badges .badge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .guest-preview {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .guest-streak,
  .guest-counters {
    grid-column: 1 / -1;
  }
}
