/* ============================================================
   Clef — sombre, pastel et plat : des aplats, des lèvres, aucune lueur
   ============================================================ */

:root {
  /* Sombre et pastel, à la manière de Duolingo. Le fond est une ardoise
     légèrement bleutée plutôt qu'un noir, les surfaces sont des aplats — --card
     et --card-2 sont identiques, si bien que chaque dégradé hérité devient plat
     sans avoir à être réécrit — et les accents sont désaturés.

     Le principe du fond éteint tient toujours : les bannières et les contours
     se paient en gemmes et ne valent que s'ils se voient. Une interface calme
     est ce qui fait briller ce qui a été gagné. */
  --bg: #131a1e;
  --chrome: rgba(19, 26, 30, 0.72);      /* la barre d'onglets, translucide */
  --bg-2: #1a2327;
  --card: #1b2429;
  --card-2: #1b2429;
  --line: #2a363c;
  /* Neumorphisme et lueurs ne sont plus que des jetons transparents : les règles
     qui les citent encore se taisent toutes d'un coup, et rien ne se rallume si
     l'une d'elles a échappé au nettoyage. */
  --shadow-dark: transparent;
  --shadow-light: transparent;
  --green-glow: transparent;
  --green-glow-soft: transparent;
  --red-glow: transparent;
  --green: #6fcf97;
  --green-soft: #8ddcae;
  --green-dim: #4ea877;
  --ink: #0f2a1b;                /* encre sombre sur les aplats pastel */
  --card-green: #6fcf97;
  --card-green-deep: #4ea877;
  --card-green-ink: #0f2a1b;
  --text: #edf3f0;
  --text-dim: #9aaca5;
  --text-faint: #6b7d77;
  /* Or et rouge existent en deux versions : pour écrire (--gold, --red) et pour
     remplir (--gold-fill, --red-fill). Sur fond sombre elles coïncident ; sur
     blanc, un or qui se lit en texte est une moutarde terne en aplat, et un or
     qui fait un bel aplat est illisible en texte. */
  --red: #ff8a98;
  --red-fill: #ff8a98;
  --gold: #f2c86b;
  --gold-fill: #f2c86b;
  --gold-deep: #c99a3f;
  --gold-ink: #3a2a06;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  /* Une couleur pleine, sans lavis. Les deux dégradés radiaux verts qui
     tenaient ici couvraient 1200 et 900 pixels : sur un fond sombre, ça ne se
     lit pas comme une texture, ça se lit comme deux flaques de l'accent
     posées derrière le contenu. */
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", "SF Pro Rounded", ui-rounded, -apple-system, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  /* `hidden` turns body into a scroll container, and iOS then drops the
     rubber-band bounce at the top and bottom of the page. `clip` contains the
     same overflow without creating a scroller, so the bounce comes back.
     `hidden` stays as the fallback for iOS below 16. */
  overflow-x: hidden;
}
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select { font-family: inherit; }
.hidden { display: none !important; }

#app { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* ============ Primitives : aplats, contours, lèvres ============
   Plus de neumorphisme. Ses deux ombres floues simulaient un relief en
   brouillant les bords ; ici une surface est un aplat cerné d'un contour de
   2px, et ce qui s'enfonce sous le doigt porte une lèvre pleine en dessous.
   Les contours sont des ombres internes plutôt que des bordures : aucun
   élément ne change de taille, donc rien ne bouge dans la mise en page. */
.neo {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--line);
}

.neo-btn {
  background: var(--card);
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line);
  color: var(--text);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  transition: transform 0.08s, box-shadow 0.08s, color 0.15s;
}
.neo-btn:hover:not(:disabled) { color: var(--green-soft); }
.neo-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 0 0 2px var(--line);
}
.neo-btn.subtle { color: var(--text-dim); font-weight: 600; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  background: var(--green);
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 var(--green-dim);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--green-dim); }
/* Not a greyscaled green — that read as a broken button rather than a waiting
   one. A neutral surface with a contour says "nothing to press yet". */
.btn-primary:disabled {
  background: var(--bg-2);
  color: var(--text-faint);
  filter: none;
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn-primary.small { width: auto; padding: 10px 18px; font-size: 14px; }
.btn-primary.bad { background: var(--red-fill); color: #3a0d15; box-shadow: 0 4px 0 #cf6272; }
.btn-primary.skip { background: var(--gold-fill); color: var(--gold-ink); box-shadow: 0 4px 0 var(--gold-deep); }

.btn-danger {
  padding: 12px 18px;
  border-radius: 14px;
  background: #e8707f;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 0 #b44f5c;
}
.btn-danger:active { transform: translateY(4px); box-shadow: 0 0 0 #b44f5c; }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-dim);
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
}
.icon-btn:active { transform: translateY(1px); }

/* ============ HUD ============ */
#hud {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 4px 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
/* Des compteurs, pas des pastilles : une icône et un nombre, rien autour.
   Quatre boîtes cernées de couleur faisaient un tableau de bord là où il n'y a
   que quatre chiffres à lire. */
.hud-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 6px;
  border-radius: 14px;
  font-size: 16px;
}
.hud-item b { color: var(--text); font-weight: 900; letter-spacing: -0.01em; transition: transform 0.18s cubic-bezier(.34,1.7,.64,1); display: inline-block; }
.hud-item b.pop { animation: hud-pop 0.42s cubic-bezier(.34,1.7,.64,1); }
@keyframes hud-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hud-icon { display: inline-flex; }
.hud-icon .ico { width: 20px; height: 20px; }
#hud-streak:not(.lit) .ico-flame { filter: grayscale(1) brightness(0.7); animation: none; }

#hud-streak.lit b { color: #f5ad62; }
#hud-gems b { color: #7cc7ec; }
#hud-hearts b { color: var(--red); }
#hud-xp b { color: var(--gold); }

/* ============ Tab bar ============ */
#tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(600px, 100%);
  display: flex;
  z-index: 40;
  /* The home indicator needs clearance, not the full 34pt inset plus padding
     on top of it — that left a visible band of empty page under the labels. */
  padding: 6px 10px max(6px, calc(env(safe-area-inset-bottom) - 10px));
  /* Une couche translucide plutot qu'un bandeau opaque : le contenu defile
     dessous et reste perceptible, ce qui ancre la barre dans la page au lieu
     de lui voler un rectangle. Un seul element porte le flou — la regle qui
     interdit filter: blur() dans ce fichier visait quatorze bannieres animees
     en meme temps, pas un fond fixe. */
  background: var(--chrome);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  /* Le filet dur de 2px est remplace par une arete claire, la lumiere qui
     accroche le materiau, et par le degrade de .tabbar-edge juste au-dessus. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
/* Bord de defilement : le contenu s'efface en approchant de la barre, au lieu
   d'etre coupe net par une ligne. */
#tabbar::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 22px;
  background: linear-gradient(to top, var(--chrome), transparent);
  pointer-events: none;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px;
  border-radius: 16px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: color 0.2s, transform 0.1s;
}
.tab-icon { display: inline-flex; transition: transform 0.2s; }
.tab-icon .ico { width: 22px; height: 22px; }
.tab.active {
  color: var(--green-soft);
  background: rgba(111, 207, 151, 0.12);
  box-shadow: inset 0 0 0 2px rgba(111, 207, 151, 0.45);
}
.tab.active .tab-icon { transform: scale(1.12); }
.tab:active .tab-icon { transform: scale(0.92); }

main#screen { padding-bottom: 110px; }
body.chrome-off main#screen { padding-bottom: 0; }

/* ============ Onboarding ============ */
.onboard { padding-top: 6vh; animation: fadeup 0.5s ease; }
.onboard-hero { text-align: center; margin-bottom: 26px; }
.logo-mark {
  font-size: 64px;
  filter: none;
  animation: bob 3s ease-in-out infinite;
}
.logo-mark svg { width: 84px; height: 84px; display: block; margin: 0 auto; }
.logo-mark .logo-img { width: 96px; height: 96px; display: block; margin: 0 auto; object-fit: contain; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.logo-word {
  font-size: 52px;
  font-weight: 900;
  /* Negatif, pas positif : plus un texte grandit, plus ses lettres paraissent
     ecartees. On resserre en grand, on ouvre en petit — voir .tab, a 11px,
     qui ouvre a 0.04em pour la raison inverse. */
  letter-spacing: -0.015em;
  background: linear-gradient(120deg, var(--green-soft), var(--green), #7dffc9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.tagline { color: var(--text-dim); margin-top: 8px; line-height: 1.5; }
.onboard-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Onboarding, one question per screen ----------
   Column layout so the question sits under the progress bar and the action
   button is pinned to the bottom, wherever the answers end — the same shape
   as a lesson, which is exactly the point. */
.onboard-flow {
  padding-top: calc(12px + env(safe-area-inset-top));
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.onboard-flow .session-top { margin-bottom: 26px; }
.ob-top-spacer { width: 40px; flex: none; }   /* balances the theme button */
.ob-step { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.ob-question {
  font-size: 24px; font-weight: 900; line-height: 1.3;
  color: var(--text);
}
.ob-question .ob-hint { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; }
/* The answers take the whole height left between question and button, so no
   screen is half empty and every target is comfortably thumb-sized. */
.ob-answers { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ob-actions {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 0 calc(18px + env(safe-area-inset-bottom));
}

/* Bigger targets, scoped to the onboarding so the same classes stay compact
   in Settings and the results screens. */
.onboard-flow .goal-row { gap: 12px; }
.onboard-flow .goal-row > button {
  min-height: 132px; font-size: 15px; padding: 16px 10px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.onboard-flow .goal-row > button b { font-size: 19px; }
.onboard-flow .avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.onboard-flow .avatar-pick { border-radius: 20px; font-size: 34px; }
.onboard-flow .inst-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.onboard-flow .inst-pick { padding: 18px 6px; gap: 8px; font-size: 12.5px; }
.onboard-flow .inst-emoji { font-size: 30px; }
.onboard-flow .ob-input { font-size: 20px; padding: 20px 18px; text-align: center; }

@media (max-width: 380px) {
  .ob-question { font-size: 21px; }
  .onboard-flow .goal-row > button { min-height: 112px; }
  .onboard-flow .avatar-pick { font-size: 28px; }
  .onboard-flow .inst-emoji { font-size: 26px; }
}
.ob-label { font-size: 13px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.avatar-pick {
  aspect-ratio: 1; border-radius: 14px; font-size: 22px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 7px var(--shadow-dark);
  transition: transform 0.12s, box-shadow 0.2s;
}
.avatar-pick.sel {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px var(--green);
}
.ob-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  background: var(--card-2);
  box-shadow: inset 4px 4px 9px var(--shadow-dark);
}
.ob-input:focus { box-shadow: inset 4px 4px 9px var(--shadow-dark), 0 0 0 2px var(--green-dim); }
.ob-input.slim { width: auto; padding: 8px 12px; }
.type-answer { text-align: center; font-size: 22px; font-weight: 900; letter-spacing: 0.04em; }
.type-answer.right { box-shadow: 0 0 0 2px var(--green); color: var(--green-soft); }
.type-answer.wrong { box-shadow: 0 0 0 2px #e2314f; color: #ff8fa3; animation: shake 0.4s; }
.goal-row { display: flex; gap: 10px; }
.goal-pick { flex: 1; text-align: center; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.goal-pick b { color: var(--text); font-size: 15px; }
.goal-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark);
}
.goal-pick.sel b { color: var(--green-soft); }

@keyframes fadeup { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ============ Learn path ============ */
.learn { animation: fadeup 0.35s ease; }

.daily-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  margin-bottom: 26px;
  /* Neutre, et non plus vert : la banderole du chapitre juste en dessous porte
     déjà la couleur, et deux aplats verts empilés se disputaient le haut de
     l'écran. L'objectif du jour se distingue par son or, pas par son fond. */
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
}
.daily-left { flex: 1; }

/* Encre sombre sur les banderoles pastel, comme sur .btn-primary : du blanc
   sur un vert clair ne se lit pas. */
.chapter-head { color: var(--ch-ink); }
.chapter-head .chapter-txt p { color: var(--ch-ink); opacity: 0.72; }
.chapter-head .chapter-prog {
  color: var(--ch-ink);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}
.chapter-head .chapter-emoji { filter: none; }
.daily-title { font-weight: 900; font-size: 16px; }
.daily-sub { color: var(--text-dim); font-size: 13px; margin: 3px 0 9px; }
.daily-track {
  height: 12px; border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
}
.daily-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--green);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.daily-card .daily-fill { background: var(--gold-fill); }
.daily-ring {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px;
  color: var(--green-soft);
  background: var(--bg-2);
}
.daily-ring.done {
  color: var(--ink);
  background: var(--green);
  box-shadow: 0 4px 0 var(--green-dim);
  font-size: 24px;
}
.daily-card .daily-ring { color: var(--gold); }
.daily-card .daily-ring.done { color: var(--gold-ink); background: var(--gold-fill); box-shadow: 0 4px 0 var(--gold-deep); }

.chapter {
  position: relative; margin-bottom: 20px;
  /* Teinte par défaut, pour un chapitre qui n'en déclarerait pas : le vert. */
  --ch-a: var(--card-green); --ch-a-lip: var(--card-green-deep);
  --ch-c: var(--green-soft); --ch-c-lip: var(--green-dim);
  --ch-ring: rgba(111, 207, 151, 0.35);
  --ch-ink: var(--card-green-ink);
}
.chapter.locked { opacity: 0.45; filter: saturate(0.4); }
.chapter-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
  position: sticky;
  /* 64px is the HUD's own height; without the safe area it stuck *inside* the
     HUD, and showed through the transparent lower half of its gradient. */
  top: calc(64px + env(safe-area-inset-top));
  z-index: 5;
  background: var(--ch-a);
  /* Sans halo, a tous les paliers. Une banderole n'est jamais cliquable : elle
     situe, elle n'appelle pas. Le halo etait pourtant le meme que celui du
     jalon courant, donc les deux se disputaient l'oeil et aucun ne gagnait.

     Et sans neumorphisme non plus. La paire d'ombres floues, une sombre en bas
     a droite et une claire en haut a gauche, simule un relief en brouillant les
     quatre bords a la fois — or ce sont les bords que l'oeil utilise pour lire
     une mise en page. A la place, une levre pleine et decalee : meme sensation
     de relief, aucun flou, et la banderole redevient un rectangle net. */
  box-shadow: 0 4px 0 var(--ch-a-lip);
}
.chapter-emoji { font-size: 30px; }
.chapter-txt { flex: 1; }
.chapter-txt h2 { font-size: 17px; font-weight: 900; }
.chapter-txt p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.chapter-prog {
  font-size: 13px; font-weight: 900; color: var(--green-soft);
  padding: 6px 11px; border-radius: 12px;
  background: var(--bg-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
}

/* n°5 — aerer. Supprimer les etiquettes de tous les jalons sauf deux libere
   la place ; on la rend au vide plutot qu'a du contenu. Un parcours se lit a
   son rythme, pas a sa densite. */
/* ============ Le parcours en portée ============
   Les leçons d'un chapitre sont les notes de sa mélodie, écrites sur une vraie
   portée. Une leçon faite est une note noircie, la leçon en cours est la seule
   en couleur, et une leçon verrouillée reste une note creuse : rien n'est
   encore joué. La leçon de contrôle est une ronde — la note finale du morceau. */
/* Les blocs de chapitre se touchent : c'est ce qui fait de seize dessins une
   seule portée, du premier mi au dernier do. La banderole se pose par-dessus,
   dans la zone où la partition s'efface. */
.chapter { margin-bottom: 0; position: relative; }
.staff-road { display: block; width: 100%; overflow: visible; position: relative; z-index: 1; }

/* ---------- Les décors de chapitre ----------
   Un dessin par chapitre, dans la couleur du chapitre, derrière la portée. Il
   reste collé à l'écran pendant que le chapitre défile : un décor qui a sa
   propre vitesse donne de la profondeur, un aplat n'en donne aucune. */
/* Rangé sur le bord, et grand : on n'en voit qu'une tranche, jamais la portée
   n'est traversée. Plus de défilement propre non plus — l'effet de profondeur
   rendait mal, le décor reste simplement là où il est posé. */
/* Au-delà du téléphone, la partition est centrée et laisse de la marge : le
   décor peut en prendre plus, toujours sans toucher la première ligne. */
/* `hidden`, pas `visible` : le decor est cale a gauche pour qu'on n'en voie
   qu'une tranche de 22 px, mais `overflow: visible` laissait son contenu
   peindre bien au-dela de sa boite — les noms de notes du cercle des quintes
   tombaient en travers des titres de lecons, et la spirale coupait la portee.
   Visible surtout sur les chapitres courts, ou le decor occupe 82 % de la
   hauteur au lieu de 53 %. */

/* Tout le décor emprunte la teinte du chapitre. Assez présent pour qu'on le
   remarque, assez discret pour qu'on lise les notes par-dessus. */

/* Chaque décor bouge à sa manière, toujours lentement : le parcours doit
   respirer, pas clignoter. */


@media (prefers-reduced-motion: reduce) {
}
.chapter .chapter-head {
  position: absolute; top: 22px; left: 0; right: 0; z-index: 3;
  margin-bottom: 0;
}
/* Une banderole de hauteur fixe : c'est elle qui doit tomber pile dans le
   fondu, et un blurb sur trois lignes la ferait déborder. */
.chapter .chapter-txt p {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.staff-bar { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.melody-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px; border-radius: 14px;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--text-dim); font-size: 13px; font-weight: 800;
  transition: transform 0.09s, box-shadow 0.09s, color 0.18s;
}
.melody-btn:disabled { opacity: 0.45; }
.melody-btn:not(:disabled):active { transform: translateY(2px); }
.melody-btn.playing { color: var(--ch-ink); background: var(--ch-c); box-shadow: 0 3px 0 var(--ch-c-lip); }
/* Triangle de lecture, carré à l'arrêt : le même bouton dit « écouter » et
   « ça joue, appuie pour couper ». */
.mel-play {
  width: 0; height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.melody-btn.playing .mel-play {
  width: 11px; height: 12px; border: none; background: currentColor; border-radius: 2px;
}

.staff-road .staff-line { stroke: #3c4d55; stroke-width: 1.5; }
.staff-road .staff-line.thick { stroke-width: 3.4; }
/* Lignes supplémentaires et altérations : la portée accepte maintenant un
   morceau écrit un peu haut, un peu bas, ou avec des dièses. */
.staff-road .staff-line.supp { stroke: #556a73; stroke-width: 2; }
.snote-alt { fill: var(--encre); font-size: 15px; font-weight: 700; }
/* La barre de mesure porte la couleur du chapitre qu'elle ouvre. */
.staff-road .barline { stroke: var(--ch-a); }
.snote-label { fill: var(--text-dim); font-size: 12.5px; font-weight: 700; }
.snote.open .snote-label { fill: var(--text); font-weight: 900; }
.snote.lock .snote-label { opacity: 0.55; }
/* La tête de note bascule avec la portée : un quart de tour, et son inclinaison
   d'origine par-dessus. */
.staff-road .snote-head { transform: rotate(-16deg); }
.snote { cursor: pointer; }
.snote-hit { fill: transparent; }
/* L'inclinaison de la tête de note se fait ici, et pas en attribut SVG :
   `transform-box: fill-box` change la façon dont un attribut `transform` est
   lu, et les deux ensemble envoyaient les notes n'importe où. */
/* La forme dit la durée, la couleur dit où on en est. Une blanche et une ronde
   se dessinent creuses, une noire et plus bref se noircissent — et la leçon en
   cours est la seule en couleur, faite ou pas. */
.snote-head, .snote-stem, .snote-flag, .snote-dot, .snote-alt {
  --encre: #5d6f77;
  transition: fill 0.2s, stroke 0.2s;
}
.snote.done .snote-head, .snote.done .snote-stem,
.snote.done .snote-flag, .snote.done .snote-dot, .snote.done .snote-alt { --encre: #93a7a1; }
.snote.open .snote-head, .snote.open .snote-stem,
.snote.open .snote-flag, .snote.open .snote-dot, .snote.open .snote-alt { --encre: var(--ch-c); }

.snote-stem { stroke: var(--encre); stroke-width: 2.2; }
.snote-flag { fill: var(--encre); stroke: none; }
.snote-dot { fill: var(--encre); }
.snote.plein .snote-head { fill: var(--encre); stroke: none; }
.snote.creux .snote-head { fill: none; stroke: var(--encre); stroke-width: 3.2; }

.snote-ring { fill: none; stroke: var(--ch-ring); stroke-width: 3.4; }
.snote.lock { cursor: default; }
.snote.lock .snote-head, .snote.lock .snote-stem,
.snote.lock .snote-flag, .snote.lock .snote-dot, .snote.lock .snote-alt { opacity: 0.5; }

/* Les silences : ils appartiennent au morceau, pas au parcours — plus discrets
   que les notes, et jamais cliquables. */
.srest { pointer-events: none; }
.srest-ink { fill: none; stroke: #5d6f77; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.srest-fill, .srest-bar { fill: #5d6f77; opacity: 0.75; }
/* La lueur suit le son, une note après l'autre. */
.snote-head, .snote-ring { transform-box: fill-box; transform-origin: center; }
/* La lueur qui court le long de la melodie. Elle ne prend pas la teinte du
   chapitre mais celle de l'annee : verte tant qu'on apprend a lire, or des
   l'Annee 2, pour que la bascule s'entende et se voie au meme instant. */
.snote.sounding .snote-head {
  fill: var(--lueur); stroke: var(--lueur);
  transform: rotate(-16deg) scale(1.45);
  filter: drop-shadow(0 0 10px var(--lueur)) drop-shadow(0 0 22px var(--lueur));
  transition: transform 0.12s cubic-bezier(.34,1.7,.64,1), filter 0.12s;
}
.snote.sounding .snote-stem, .snote.sounding .snote-flag { stroke: var(--lueur); fill: var(--lueur); }
.snote.sounding .staff-line.supp { stroke: var(--lueur); opacity: 0.8; }
.chapter { --lueur: #7cd591; }
.chapter.tier2 { --lueur: #ffd54f; }


/* Le jalon de révision quitte le bord gauche : il prend place dans la barre
   au-dessus de la portée, à côté du bouton de lecture. */
.staff-bar .review-node {
  position: static; width: 44px; height: 44px; animation: none; flex: none;
}
.staff-bar .review-label, .staff-bar .review-stars { display: none; }
.staff-bar .review-ico .ico { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  .snote.sounding .snote-head { transform: rotate(-16deg); }
}

/* ============ L'accordeur ============
   Ce qui était cinq cœurs est une aiguille : ton instrument est-il juste ?
   Elle penche à chaque faute, passe à l'or, puis au rouge. Arrivée au bout,
   l'instrument est faux et il faut le réaccorder — à l'oreille. */
.tuner { display: block; overflow: visible; }
.tuner-arc { fill: none; stroke: var(--line); stroke-width: 2.4; stroke-linecap: round; }
.tuner-mid { stroke: var(--text-dim); stroke-width: 1.6; }
.tuner-needle {
  stroke: var(--green); stroke-width: 2.6; stroke-linecap: round;
  transition: transform 0.45s cubic-bezier(.34,1.3,.64,1), stroke 0.3s;
}
.tuner-pin { fill: var(--green); transition: fill 0.3s; }
.tuner.tendu .tuner-needle, .tuner.tendu .tuner-pin { stroke: var(--gold); fill: var(--gold); }
.tuner.faux .tuner-needle, .tuner.faux .tuner-pin { stroke: var(--red); fill: var(--red); }

.hud-tuner { display: inline-flex; align-items: center; }
.session-tuner { display: inline-flex; }

.tune-ico { display: grid; place-items: center; margin-bottom: 6px; color: var(--green); }
.tune-ico .ico { width: 42px; height: 42px; }
.tune-row { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; }
.tune-row .neo-btn { flex: 1; padding: 11px 8px; font-size: 14px; }
/* Un curseur sans graduation : le seul repère est l'oreille. */
.tune-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; margin: 12px 0 4px; background: transparent;
}
.tune-slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 6px; background: var(--bg-2);
  box-shadow: inset 0 0 0 2px var(--line);
}
.tune-slider::-moz-range-track {
  height: 8px; border-radius: 6px; background: var(--bg-2);
  box-shadow: inset 0 0 0 2px var(--line);
}
.tune-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; margin-top: -11px; border-radius: 50%;
  background: var(--green); box-shadow: 0 4px 0 var(--green-dim);
}
.tune-slider::-moz-range-thumb {
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: var(--green); box-shadow: 0 4px 0 var(--green-dim);
}
.tune-hint { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.tune-hint.miss { color: var(--gold); font-weight: 800; }

/* Sur fond clair, une note grise se perd : on écrit en noir, comme sur du
   papier. La leçon en cours garde la couleur de son chapitre. */
body.theme-light .snote-head, body.theme-light .snote-stem,
body.theme-light .snote-flag, body.theme-light .snote-dot { --encre: #4a5b62; }
body.theme-light .snote.done .snote-head, body.theme-light .snote.done .snote-stem,
body.theme-light .snote.done .snote-flag, body.theme-light .snote.done .snote-dot { --encre: #2c3a40; }
body.theme-light .srest-ink { stroke: #4a5b62; }
body.theme-light .srest-fill, body.theme-light .srest-bar { fill: #4a5b62; }
body.theme-light .staff-road .staff-line { stroke: #1f2d25; }

/* Les etoiles quittent le parcours : le popup de la lecon les affiche deja,
   avec le meilleur score, et c'est la qu'on les cherche. Sur la carte elles
   ajoutaient trois signes sous chaque jalon deja fait — de l'information sur
   du passe, repetee dix fois, entre soi et la seule chose qui compte : la
   suite. Le balisage reste, il porte le compte pour qui inspecte la page. */
.node-stars { display: none; }

/* ---------- Spaced review node ----------
   Sits beside the path, not in it: it is a side quest, not a step. Gold
   rather than green so it never reads as "the next lesson to do", and it
   only exists at all when something has actually faded. */
.review-node {
  position: absolute; left: 14px; top: 8px; z-index: 2;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  /* Neutre, l'or sur l'icône seulement : un disque doré se confondait avec les
     jalons de l'année 3, qui sont désormais les seuls à porter l'or. */
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line);
  color: var(--gold);
  animation: reviewBob 3.4s ease-in-out infinite;
}
.review-node:active { transform: translateY(3px); }
.review-ico .ico { width: 26px; height: 26px; }
/* Label and stars hang below the disc, wider than it and centred on it. */
.review-label {
  /* Anchored so the text box starts at the screen edge and still centres on
     the disc: centring on the node alone pushed the wider label off-screen. */
  position: absolute; top: 68px; left: -14px; width: 90px;
  font-size: 11px; font-weight: 800; line-height: 1.25;
  color: var(--gold); text-align: center;
}
.review-stars {
  position: absolute; top: 122px; left: -14px; width: 90px; text-align: center;
  font-size: 13px; letter-spacing: 1px; color: var(--gold);
  white-space: nowrap;
}
@keyframes reviewBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

@media (max-width: 360px) {
  .review-node { width: 54px; height: 54px; left: 10px; }
  .review-ico .ico { width: 22px; height: 22px; }
  .review-label { top: 60px; left: -10px; width: 74px; font-size: 10.5px; }
  .review-stars { top: 112px; left: -10px; width: 74px; }
}
}
.node-row { display: flex; flex-direction: column; align-items: center; width: 130px; }
/* ---------- Le relief des jalons ----------
   Une LEVRE, pas un halo : une ombre pleine, sans flou, decalee vers le bas et
   de la meme forme que le bouton. C'est ce qui donne aux boutons de Duolingo
   leur relief de touche, et c'est l'exact oppose du neumorphisme qui tenait
   ici : lui simulait la profondeur en brouillant les quatre bords a la fois,
   alors que ce sont les bords que l'oeil utilise pour lire une mise en page.

   Deux variables, et une seule regle d'appui pour les dix etats : la hauteur
   tombe a 1px et le bouton descend d'autant, donc il s'enfonce reellement au
   lieu de retrecir. `--lip` porte la couleur, toujours un cran sous le fond de
   l'etat concerne — une levre plus sombre que son bouton se lit comme sa
   tranche, une levre d'une autre teinte se lit comme une faute. */
.node {
  --lip-h: 6px;
  /* Trois paliers de luminance, et ils doivent rester dans cet ordre :
     bouton (63) > levre (46) > fond (25). La levre est la TRANCHE du bouton,
     donc plus sombre que lui ; mais si elle passe sous le fond elle disparait,
     et c'est exactement ce qui arrivait avec l'ancien jalon presque aussi
     sombre que la page. Eclaircir le bouton est ce qui fait exister le relief. */
  --lip: #243036;
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #33424a;
  box-shadow: 0 var(--lip-h) 0 var(--lip);
  transition: transform 0.09s, box-shadow 0.09s;
}
.node-ico { font-size: 30px; }
/* Les icônes des jalons ont leurs couleurs propres — note verte, étoile dorée,
   cadenas gris foncé. Sur un aplat vert ou or, la note verte disparaissait, et
   le cadenas se fondait dans le gris. Sur un jalon coloré elles passent à
   l'encre sombre, comme le texte des banderoles ; verrouillées, en gris clair. */
.node.lock .node-ico { filter: brightness(0) invert(1); opacity: 0.38; font-size: 24px; }
.node.done .node-ico,
.node.open .node-ico { filter: brightness(0); opacity: 0.62; }
.node.open {
  --lip: var(--green-dim);
  background: var(--green);
  box-shadow:
    0 var(--lip-h) 0 var(--lip),
    0 0 0 7px var(--bg),
    0 0 0 11px rgba(111, 207, 151, 0.35);
  /* Fixe, et non plus battant. Un halo qui respire attire l'oeil en
     permanence : il ne dit plus « c'est ici », il dit « regarde-moi », et
     l'oeil finit par s'en detourner pour lire le reste. Une bague nette, tenue,
     designe aussi bien et cesse de reclamer. */
}
.node.done {
  --lip: var(--green-dim);
  background: var(--green);
  /* Une lecon finie ne brille plus : elle est derriere toi. Tant que chaque
     jalon deja fait rayonnait, la carte comptait dix points lumineux et le
     seul qui comptait — le suivant — se noyait dedans. */
  box-shadow: 0 var(--lip-h) 0 var(--lip);
}
.node.boss { width: 96px; height: 96px; }

/* ---------- Années 1 et 2 : sans ornement ----------
   L'année 2 avait son anneau de circuit tournant, son liseré doré et sa note en
   exposant. Tout est parti avec le néon : sans lueur, un anneau pointillé qui
   tourne ne se lit plus que comme du bruit. L'année 2 reprend le style de
   l'année 1, et seule l'année 3 se distingue. */
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Le cercle chromatique, du vert à l'or ----------
   Les seize chapitres parcourent la roue des couleurs dans l'ordre : vert au
   départ, puis cyan, bleu, violet, magenta, rouge, orange, et l'or à l'arrivée.
   Ce n'est plus un assortiment de teintes, c'est une suite — le parcours entier
   raconte une progression, et la couleur dit d'un coup d'œil où l'on en est.

   Conséquence assumée : la teinte suit le RANG du chapitre, pas son identité.
   C'est l'inverse du principe précédent, et c'est le dégradé qui l'impose — une
   suite n'existe que dans l'ordre. L'instrument ne déplace qu'un chapitre (la
   clé de fa avant la clé de sol, ou le rythme en tête pour les batteurs) : deux
   voisins échangent leur teinte, le dégradé reste continu.

   Les couleurs sont calculées en OKLCH, à clarté perçue constante. En hsl() à
   réglages fixes, le jaune sort deux fois plus clair que le bleu, et l'encre
   sombre des banderoles cesserait d'être lisible sur la moitié de la roue. */
.chapter.ch-w1  { --ch-a: #7cd591; --ch-a-lip: #40a35c; --ch-c: #a8ebb5; --ch-c-lip: #69ba7c; --ch-ring: rgba(168, 235, 181, 0.35); --ch-ink: #133c1f; }
.chapter.ch-w2  { --ch-a: #54d8b1; --ch-a-lip: #10a481; --ch-c: #91edcd; --ch-c-lip: #43bd99; --ch-ring: rgba(145, 237, 205, 0.35); --ch-ink: #023d2e; }
.chapter.ch-w3  { --ch-a: #2fd8d0; --ch-a-lip: #11a19b; --ch-c: #82ede6; --ch-c-lip: #1dbcb5; --ch-ring: rgba(130, 237, 230, 0.35); --ch-ink: #023b39; }
.chapter.ch-w4  { --ch-a: #2fd4ec; --ch-a-lip: #129db0; --ch-c: #82eafc; --ch-c-lip: #1db8ce; --ch-ring: rgba(130, 234, 252, 0.35); --ch-ink: #023a42; }
.chapter.ch-w5  { --ch-a: #58ccff; --ch-a-lip: #0099ca; --ch-c: #a6e1fe; --ch-c-lip: #43b2e1; --ch-ring: rgba(166, 225, 254, 0.35); --ch-ink: #03384c; }
.chapter.ch-w6  { --ch-a: #8ac3fd; --ch-a-lip: #3f90dd; --ch-c: #badbfe; --ch-c-lip: #67aaed; --ch-ring: rgba(186, 219, 254, 0.35); --ch-ink: #133555; }
.chapter.ch-w7  { --ch-a: #a5bbfe; --ch-a-lip: #6b86e1; --ch-c: #c9d7fe; --ch-c-lip: #87a0f0; --ch-ring: rgba(201, 215, 254, 0.35); --ch-ink: #253056; }
.chapter.ch-w8  { --ch-a: #bcb2fe; --ch-a-lip: #8c7bda; --ch-c: #d6d2fd; --ch-c-lip: #a497ea; --ch-ring: rgba(214, 210, 253, 0.35); --ch-ink: #332c54; }
.chapter.ch-w9  { --ch-a: #d7a6fc; --ch-a-lip: #a672cb; --ch-c: #e7cafe; --ch-c-lip: #bc8fdd; --ch-ring: rgba(231, 202, 254, 0.35); --ch-ink: #3e284d; }
.chapter.ch-w10 { --ch-a: #ed9ee5; --ch-a-lip: #bb6ab4; --ch-c: #fec0f7; --ch-c-lip: #cf88c8; --ch-ring: rgba(254, 192, 247, 0.35); --ch-ink: #462444; }
.chapter.ch-w11 { --ch-a: #fc9ac9; --ch-a-lip: #c96598; --ch-c: #fdc5de; --ch-c-lip: #dd84af; --ch-ring: rgba(253, 197, 222, 0.35); --ch-ink: #4d2238; }
.chapter.ch-w12 { --ch-a: #fd9ead; --ch-a-lip: #d26479; --ch-c: #fec7ce; --ch-c-lip: #e48393; --ch-ring: rgba(254, 199, 206, 0.35); --ch-ink: #50222b; }
.chapter.ch-w13 { --ch-a: #ffa192; --ch-a-lip: #d36757; --ch-c: #ffc9bf; --ch-c-lip: #e68677; --ch-ring: rgba(255, 201, 191, 0.35); --ch-ink: #51231d; }
.chapter.ch-w14 { --ch-a: #fea573; --ch-a-lip: #d26c28; --ch-c: #fecbaf; --ch-c-lip: #e58b55; --ch-ring: rgba(254, 203, 175, 0.35); --ch-ink: #4e270d; }
.chapter.ch-w15 { --ch-a: #faab3f; --ch-a-lip: #c07b0b; --ch-c: #ffcd94; --ch-c-lip: #dc932e; --ch-ring: rgba(255, 205, 148, 0.35); --ch-ink: #492b00; }
.chapter.ch-w16 { --ch-a: #e6b816; --ch-a-lip: #ab8704; --ch-c: #f9d46b; --ch-c-lip: #c89f07; --ch-ring: rgba(249, 212, 107, 0.35); --ch-ink: #403100; }

.chapter .node.done {
  --lip: #243036;
  background: #33424a;
  /* 1,5px : un simple fil. À 3px le liseré redevenait un anneau de couleur, et
     les leçons faites recommençaient à attirer l'œil. */
  box-shadow: 0 var(--lip-h) 0 var(--lip), inset 0 0 0 1.5px var(--ch-a);
}
/* Étoile en gris clair : visible, mais sans rien réclamer. Le cadenas des
   leçons verrouillées reste plus pâle encore. */
.chapter .node.done .node-ico { filter: brightness(0) invert(1); opacity: 0.6; }
body.theme-light .chapter .node.done { --lip: #cfd8d3; background: #e3e9e6; }
body.theme-light .chapter .node.done .node-ico { filter: brightness(0); opacity: 0.42; }
.chapter .node.open {
  --lip: var(--ch-c-lip);
  background: var(--ch-c);
  box-shadow:
    0 var(--lip-h) 0 var(--lip),
    0 0 0 7px var(--bg),
    0 0 0 11px var(--ch-ring);
}

.node.tier3 .node-rays,
.node.tier3 .node-hud,
.path-connector { display: none; }

.node.boss .node-ico { font-size: 42px; }
.node:not(:disabled):hover { transform: translateY(-1px); }
/* La touche s'enfonce : la levre passe a 1px et le bouton descend de 5px, donc
   la somme reste constante et rien ne bouge autour. Un `scale` aurait fait
   retrecir le bouton — ce qui ne ressemble a rien de physique. */
.node:not(:disabled):active { --lip-h: 1px; transform: translateY(5px); }
/* Les etoiles quittent le parcours : le popup de la lecon les affiche deja,
   avec le meilleur score, et c'est la qu'on les cherche. Sur la carte elles
   ajoutaient trois signes sous chaque jalon deja fait — de l'information sur
   du passe, repetee dix fois, entre soi et la seule chose qui compte : la
   suite. Le balisage reste, il porte le compte pour qui inspecte la page. */
/* Le nom ne suit que le jalon COURANT et les jalons-reperes. Dix noms empiles
   se lisent comme une liste, et une liste n'est plus un chemin ; le nom des
   autres est dans le popup, a une tape. Le combinateur `+` suffit — l'etiquette
   est le frere immediat du bouton — la ou `:has()` exclurait les vieux
   navigateurs. Regroupe ici, avec la mise en forme : une regle `display` posee
   plus haut dans le fichier se serait fait reprendre par celle-ci, a egalite de
   specificite. */
.node-label {
  display: none;
  margin-top: 12px;
  font-size: 12.5px; font-weight: 800;
  color: var(--text-dim);
  text-align: center;
}
.node.open + .node-label,
.node.boss + .node-label { display: block; }

/* ============ Generic pages ============ */
.page { animation: fadeup 0.35s ease; }
.page-title { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.page-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.section-title { font-size: 17px; font-weight: 900; margin: 26px 0 12px; }
.count-chip {
  font-size: 12px; color: var(--green-soft);
  background: var(--card-2); padding: 3px 9px; border-radius: 10px;
  box-shadow: inset 2px 2px 5px var(--shadow-dark);
  vertical-align: 2px;
}
.tier-chip {
  display: inline-block; font-size: 11px; font-weight: 900;
  color: var(--gold-ink); background: var(--gold-fill);
  padding: 3px 10px; border-radius: 10px; margin-right: 8px;
  box-shadow: none;
  vertical-align: 2px;
}
/* La portee n'est pas au milieu de la page : ses cinq lignes occupent les
   unites 70 a 150 d'un dessin large de 340, soit un centre a 32,3 %. La
   pastille s'y aligne au lieu de flotter au centre geometrique. */
.tier-divider { text-align: left; margin: 34px 0 18px; position: relative; }
.tier-divider span { margin-left: 32.3%; transform: translateX(-50%); }
.tier-divider span {
  display: inline-block; background: linear-gradient(135deg, #ffe082, #ffb300);
  color: #3a2a00; font-weight: 900; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 6px 18px; border-radius: 20px;
  box-shadow: none;
}
.tier-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: var(--card-2); z-index: -1;
}
.empty-note, .sim-note { color: var(--text-faint); font-size: 13px; margin: 10px 0 16px; line-height: 1.5; }
.sim-note { text-align: center; margin-top: 26px; }
.legal-links { color: var(--text-faint); font-size: 13px; margin: 10px 0 16px; line-height: 1.5; text-align: center; margin-top: 26px; }
.legal-links a { color: var(--text-faint); text-decoration: underline; }

/* ============ Practice ============ */
.fact-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px;
  margin: 16px 0 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 2px rgba(111, 207, 151, 0.35);
}
.fact-badge {
  align-self: flex-start;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green-soft);
  text-shadow: none;
}
.fact-title { font-size: 16.5px; font-weight: 900; color: var(--text); }
.fact-text { font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }

/* ---------- Daily quests ----------
   A thin strip under the daily fact, three rows and no more. Deliberately
   quieter than the practice cards below it: quests are a nudge, not the thing
   you came to tap. */
.quests {
  margin: 0 0 18px;
  padding: 12px 14px 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.quests-head {
  font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 6px;
}
.quest {
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px 0;
  font-size: 13px; font-weight: 700; color: var(--text-dim);
}
.quest-row { display: flex; align-items: center; gap: 10px; }
.quest-label { flex: 1; min-width: 0; }
.quest-track {
  width: 64px; height: 6px; flex: none;
  border-radius: 4px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: inset 2px 2px 4px var(--shadow-dark);
}
.quest-fill {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.quest-reward { width: 34px; text-align: right; font-size: 12px; font-weight: 900; color: var(--text-faint); }
.quest.done { color: var(--green-soft); }
.quest.done .quest-reward { color: var(--green); font-size: 15px; }
/* The collect button only exists while there is something to collect, so the
   strip stays thin the rest of the time. Full green, unlike everything else on
   this screen — it is the one thing here that pays out. */
.quest-claim {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--green);
  color: var(--ink);
  font-size: 13px; font-weight: 900; letter-spacing: 0.02em;
  box-shadow: 0 3px 0 var(--green-dim);
  animation: questReady 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.3s, height 0.3s, padding 0.3s, margin 0.3s;
  overflow: hidden;
}
.quest-claim:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-dim); }
.quest-claim .qc-label { text-transform: uppercase; }
.q-reward-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(3, 48, 26, 0.22);
  font-size: 12.5px; font-weight: 900;
}
.q-reward-chip .ico { width: 14px; height: 14px; }
.quest-claim.claiming { transform: scale(0.97); box-shadow: 0 1px 0 var(--green-dim); }
@keyframes questReady {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- Club: the week's effort ----------
   A breakdown of real XP by who earned it, not a bar filling towards an
   invented target. One glance tells you whether the club is a team or one
   player carrying it. */
.club-effort { padding: 16px 18px; margin-bottom: 18px; }
.ce-total { font-size: 26px; font-weight: 900; color: var(--green-soft); letter-spacing: -0.02em; }
.ce-total span { font-size: 13px; font-weight: 800; color: var(--text-faint); letter-spacing: 0; }
.ce-bar {
  display: flex; height: 14px; margin: 12px 0 10px;
  border-radius: 8px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: inset 2px 2px 5px var(--shadow-dark);
}
.ce-seg { display: block; height: 100%; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ce-seg.s1, .ce-key i.s1 { background: #8ddcae; }
.ce-seg.s2, .ce-key i.s2 { background: #6fcf97; }
.ce-seg.s3, .ce-key i.s3 { background: #4ea877; }
.ce-seg.s4, .ce-key i.s4 { background: #3b8a61; }
.ce-seg.s5, .ce-key i.s5 { background: #2d6b4b; }
.ce-seg.rest, .ce-key i.rest { background: var(--text-faint); opacity: 0.55; }
.ce-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ce-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.ce-key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- Club: reactions ----------
   Four fixed emojis and nothing else — the closed vocabulary is what makes the
   club safe for children without a moderation queue behind it. */
.react-bar { display: flex; gap: 4px; flex: none; margin-left: 8px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 6px; border-radius: 9px;
  font-size: 13px; line-height: 1;
  background: var(--bg-2);
  box-shadow: inset 1px 1px 3px var(--shadow-dark);
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.2s;
}
.react-btn b { font-size: 10.5px; font-weight: 900; color: var(--text-faint); }
.react-btn:active:not(:disabled) { transform: scale(0.88); }
/* Sent already: the database refuses a second one, so the button stops asking. */
.react-btn.done { opacity: 0.45; box-shadow: none; }
.react-btn:disabled { cursor: default; }

/* The emoji leaves the button and drifts up — a reaction you cannot see leave
   is a reaction nobody believes was sent. */
.emote-pop {
  position: fixed; z-index: 60; left: 0; top: 0;
  font-size: 26px; line-height: 1;
  pointer-events: none; will-change: transform, opacity;
}

/* ---------- Club: activity feed ---------- */
.club-feed { list-style: none; padding: 8px 4px; margin: 0; }
.cf-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px; color: var(--text-dim);
}
.cf-row + .cf-row { box-shadow: inset 0 1px 0 rgba(143, 179, 156, 0.10); }
.cf-avatar { font-size: 17px; flex: none; }
.cf-text { flex: 1; min-width: 0; line-height: 1.45; }
.cf-text b { color: var(--text); font-weight: 800; }
.cf-text i { color: var(--green-soft); font-style: normal; font-weight: 700; }
.cf-age { flex: none; font-size: 11.5px; color: var(--text-faint); }

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

/* ---------- Platform moderation ----------
   Deliberately plain and a little severe: this is a queue of things to judge,
   not a feature to enjoy. It only ever renders for a staff account. */
.report-row {
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 6px 6px 14px var(--shadow-dark),
    inset 0 0 0 1.5px rgba(255, 152, 0, 0.35);
}
.report-row.handled { box-shadow: 6px 6px 14px var(--shadow-dark), inset 0 0 0 1px rgba(143, 179, 156, 0.2); opacity: 0.7; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.report-who { font-weight: 900; font-size: 14px; }
.report-age { font-size: 12px; color: var(--text-faint); flex: none; }
/* The reported words are shown as written, never prettified: the judgement
   has to be made on exactly what the other player saw. */
.report-body {
  font-size: 15px; line-height: 1.5;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg-2);
  box-shadow: inset 2px 2px 5px var(--shadow-dark);
  word-break: break-word;
}
.report-reason { font-size: 13px; color: var(--text-dim); }
.report-actions { display: flex; gap: 10px; align-items: center; }
.report-actions .btn-primary, .report-actions .btn-danger { width: auto; }
.report-done { font-size: 13px; font-weight: 800; color: var(--text-faint); }
.count-chip.alert { background: #ff9800; color: #2b1a00; }

/* ---------- Path jump ----------
   Deliberately quiet: it is a shortcut, not a call to action, so it reads as
   part of the furniture until you need it. */
.path-jump {
  position: fixed;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 30;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--text-dim);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 5px 5px 12px var(--shadow-dark);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, color 0.2s;
}
.path-jump.show { opacity: 0.94; transform: none; pointer-events: auto; }
.path-jump.show:active { transform: scale(0.93); }
.path-jump:hover { color: var(--green-soft); }
.path-jump .ico { width: 22px; height: 22px; transition: transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1); }
/* One button, two directions — the arrow turns over rather than swapping. */
.path-jump.down .ico { transform: rotate(180deg); }

/* ---------- Reward flight ----------
   Sprites are fixed-position and transform-only, so they cost nothing in
   layout and never widen the page on their way across it. */
.fly-reward {
  position: fixed; z-index: 60; left: 0; top: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  pointer-events: none;
  will-change: transform, opacity;
}
.fly-reward .ico { width: 24px; height: 24px; }
.fly-gems .ico { filter: none; }
.fly-xp .ico { filter: none; }
.fly-hearts .ico { filter: none; }

/* Each arrival knocks the chip, so a burst of nine reads as nine things
   landing rather than one number changing. */
.hud-item.hit { animation: hudHit 0.38s cubic-bezier(0.34, 1.6, 0.64, 1); }
@keyframes hudHit {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.17); }
}

/* A quest waiting to be collected is worth a dot on the tab that owns it. */
.tab { position: relative; }
.tab.has-dot .tab-icon::after {
  content: '';
  position: absolute; top: -2px; right: -6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff9800;
  box-shadow: 0 0 0 2px var(--bg);
  animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Results with the counters showing: leave room for the fixed HUD. */
body.hud-only .results { padding-top: calc(80px + env(safe-area-inset-top)); }

@media (prefers-reduced-motion: reduce) {
  .quest-claim, .tab.has-dot .tab-icon::after, .hud-item.hit { animation: none; }
  .path-jump, .path-jump .ico { transition: none; }
}

.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.practice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 18px;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.2s;
}
.practice-card:not(.locked):hover { transform: translateY(-2px); }
.practice-card:not(.locked):active { transform: scale(0.97); }
.practice-card.locked { opacity: 0.5; }
/* La carte mise en avant prend l'aplat pastel et l'encre sombre des banderoles :
   le vert foncé saturé à texte blanc était le dernier vestige de l'ancien style
   sur cet écran. */
.practice-card.feature-card {
  background: var(--green);
  box-shadow: 0 4px 0 var(--green-dim);
}
.practice-card.feature-card .pc-title, .practice-card.feature-card .pc-desc { color: var(--ink); }
.practice-card.feature-card .pc-desc { opacity: 0.85; }
.pc-emoji { font-size: 30px; filter: none; }
.pc-title { font-size: 16px; font-weight: 900; }
.pc-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }

/* ============ League ============ */
.league-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 20px; }
.league-shield { font-size: 44px; filter: none; animation: bob 3s ease-in-out infinite; }
.league-head .page-title { margin: 0; font-size: 22px; }
.league-head .page-sub { margin: 2px 0 0; }
.league-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.league-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
}
.league-row.me {
  box-shadow: 6px 6px 14px var(--shadow-dark), 0 0 0 2px var(--green-dim);
}
.lr-rank { width: 30px; text-align: center; font-weight: 900; color: var(--text-dim); font-size: 15px; }
.lr-rank.medal { font-size: 20px; }
.lr-avatar { font-size: 24px; }
.lr-name { flex: 1; font-weight: 800; font-size: 14.5px; }
.lr-xp { font-weight: 900; color: var(--green-soft); font-size: 14px; }
.league-cut {
  text-align: center; font-size: 11.5px; font-weight: 900;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-dim); padding: 4px 0;
}
.league-cut.demo { color: var(--red); opacity: 0.7; }
.follow-mini {
  width: 30px; height: 30px; border-radius: 50%;
  font-weight: 900; color: var(--green-soft);
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  font-size: 15px;
}
.follow-mini.on { color: var(--ink); background: var(--green); box-shadow: none; }

.league-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  background: var(--card-2); border-radius: 14px; padding: 4px;
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
}
.league-tab {
  flex: 1; padding: 10px 0; border-radius: 11px;
  font-weight: 800; font-size: 13.5px; color: var(--text-dim);
}
.league-tab.on { color: var(--ink); background: var(--green); box-shadow: none; }

/* ============ Clubs ============ */
.club-list { display: flex; flex-direction: column; gap: 14px; }
.club-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.club-rank { font-weight: 900; color: var(--text-faint); font-size: 13px; }
.club-emoji { font-size: 34px; filter: none; }
.club-info { flex: 1; }
.club-info h3 { font-size: 16px; font-weight: 900; }
.club-info p { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.club-meta { color: var(--green-dim) !important; font-weight: 800; }
.club-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px; margin-bottom: 8px; }
.club-head-emoji { font-size: 44px; filter: none; }
.club-head-txt { flex: 1; }
.club-head-txt h1 { font-size: 22px; font-weight: 900; }
.club-head-txt p { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.member-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; }
.member-row.me { box-shadow: 5px 5px 10px var(--shadow-dark), 0 0 0 2px var(--green-dim); }


/* ============ Profile ============ */
.profile-head { position: relative; overflow: hidden; display: flex; gap: 16px; padding: 20px; align-items: center; margin-bottom: 18px; }
.profile-avatar {
  width: 78px; height: 78px;
  font-size: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  box-shadow: inset 5px 5px 10px var(--shadow-dark);
}
.profile-txt { flex: 1; }
.profile-txt h1 { font-size: 22px; font-weight: 900; }
.profile-title { color: var(--green-soft); font-weight: 800; font-size: 13.5px; margin: 2px 0 8px; }
.profile-sub { color: var(--text-faint); font-size: 12px; margin-top: 6px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 8px; }
.stat-n { font-size: 17px; font-weight: 900; }
.stat-l { font-size: 11px; color: var(--text-dim); font-weight: 700; }

.shop-row { display: flex; gap: 12px; }
.shop-item {
  flex: 1; padding: 16px; text-align: center;
  font-size: 14px; font-weight: 800; line-height: 1.6;
  transition: transform 0.12s;
}
.shop-item b { color: var(--green-soft); }
.shop-item:active { transform: scale(0.97); }
.shop-owned { display: block; font-size: 11px; color: var(--text-faint); }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge { padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.badge:not(.got) { opacity: 0.45; }
.badge.got { box-shadow: 6px 6px 14px var(--shadow-dark); }
.badge-emoji { font-size: 26px; }
.badge.got .badge-emoji { filter: none; }
.badge-title { font-size: 12.5px; font-weight: 900; }
.badge-desc { font-size: 10.5px; color: var(--text-faint); line-height: 1.35; }

/* ============ Name banners (Lottie plaques behind a player's name) ============ */
/* border-radius: inherit — the rows carry a radius but no overflow:hidden, so
   a square banner box showed its corners past the rounded edge. Clipping the
   banner to its own inherited radius fixes it on every platform, rather than
   relying on the parent to clip a composited child. */
.profile-banner, .row-banner { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.profile-banner { opacity: 0.6; border-radius: var(--radius); }
.profile-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, var(--card) 12%, transparent 60%); }
/* A row is about 12:1 and a banner is 6:1, so stretching the host across the
   whole row forced a choice between two bad ones: crop the artwork through its
   middle, or shrink it and reveal the edge of its own rectangle. Neither was
   necessary — the host simply has to keep the banner's proportions. Anchored
   to the right at 6:1, the artwork is shown whole and undistorted, and the
   name keeps the left of the row to itself. */
.row-banner {
  left: auto; right: 0;
  aspect-ratio: 1200 / 190;
  border-radius: 0;
  opacity: 0.55;
  /* Fades into the row rather than ending on a hard vertical edge. Replaces
     the radial mask below, which only existed to clip a full-width banner to
     the row's rounded corners — the row clips it now. */
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 55%);
  mask-image: linear-gradient(90deg, transparent 2%, #000 55%);
}
.row-banner::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.22);
}
.name-banner-anim, .name-banner-anim svg { width: 100%; height: 100%; display: block; }

/* ---------- Prestige: rows carrying a year banner ----------
   A chapter banner is one checkpoint; a year banner means every chapter of a
   whole year is finished. That rarity deserves to read from across the
   leaderboard, so the card itself gets a gold ring, not just the artwork.
   Deliberately static — the banner behind it already animates, and a pulsing
   ring on every prestige row would cost frames for nothing. */
.league-row.prestige, .member-row.prestige {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light),
              0 0 0 2px rgba(255, 213, 79, 0.55), 0 0 22px rgba(255, 213, 79, 0.28);
}
/* Both at once: gold ring inside, the usual green "this is you" just outside,
   so a player still finds their own line at a glance. */
.league-row.me.prestige, .member-row.me.prestige {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light),
              0 0 0 2px rgba(255, 213, 79, 0.6), 0 0 0 4px var(--green-dim),
              0 0 24px rgba(255, 213, 79, 0.32);
}
.profile-head.prestige {
  box-shadow: 8px 8px 18px var(--shadow-dark), -6px -6px 14px var(--shadow-light),
              0 0 0 2px rgba(255, 213, 79, 0.5), 0 0 28px rgba(255, 213, 79, 0.26);
}
/* WebKit only: lottie-web puts translate3d() on its <svg>, which promotes it to
   a GPU layer. A composited layer escapes a rounded `overflow: hidden` parent —
   square corners — and is rasterised at a fixed resolution — pixelation. Both
   symptoms show on iOS while the same file renders cleanly on the web.
   Dropping the transform keeps the SVG in the normal paint order; the mask is
   the long-standing Safari belt-and-braces for clipping to a radius. */
.name-banner-anim svg { transform: none !important; }
/* Safari's long-standing trick for clipping a child to a rounded corner.
   .row-banner is excluded: it carries its own fade-out mask, and the row now
   clips it directly. */
.profile-banner {
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}
.profile-avatar, .profile-txt { position: relative; z-index: 1; }
.league-row, .member-row { position: relative; overflow: hidden; }
/* .card-outline and .card-emitter are excluded alongside .row-banner: both are
   absolutely positioned overlays carrying their own z-index, above the text
   rather than level with it. Forcing `position: relative` on the emitter is
   not a cosmetic slip — it collapses the box to 0x0, so `inset: 0` stops
   applying and every glyph piles up at the same point outside the row. */
.league-row > *:not(.row-banner):not(.card-outline):not(.card-emitter):not(.card-halo),
.member-row > *:not(.row-banner):not(.card-outline):not(.card-emitter):not(.card-halo) { position: relative; z-index: 1; }

/* ---------- CSS name banners ----------
   One class per chapter, built entirely from gradients: each weighs nothing,
   needs no player, and keeps animating offline. Deliberately low-contrast —
   a banner sits *behind* a username and must never fight the text on top.
   Year 2 and 3 chapters lean gold to echo the path's own progression.

   No filter: blur() anywhere. An earlier version used it for softness and the
   Profile screen — which shows fourteen of these at once — dropped to 4 fps on
   an iPhone: animated blur is about the most expensive thing you can ask a
   mobile GPU for. The softness now comes from extra gradient stops, which look
   the same and cost nothing. */
.banner-css { position: relative; overflow: hidden; border-radius: inherit; }
/* Overflow sideways only: sweeps need room to travel horizontally, but a
   vertical pattern must line up with the visible strip, not spill past it. */
.banner-css::before, .banner-css::after {
  content: ''; position: absolute; inset: 0 -45%; pointer-events: none;
}
.banner-css.frozen::before, .banner-css.frozen::after { animation-play-state: paused; }

/* Kept at ±20%: the layer is 190% wide, so this already shifts it by ~38% of
   the visible strip — any more and an edge of the banner is left bare. */
@keyframes bnSweep { from { transform: translateX(-20%); } to { transform: translateX(20%); } }
@keyframes bnRipple { 0% { transform: scale(.35); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes bnDrift { to { background-position: 240% 0; } }
@keyframes bnBreathe { 0%, 100% { opacity: .3; transform: scale(.92); } 50% { opacity: .75; transform: scale(1.04); } }

/* Year 1 — green */
.bn-rhythm::before { background: repeating-linear-gradient(90deg, rgba(0, 230, 118, .30) 0 6px, transparent 6px 26px); animation: bnSweep 3.2s linear infinite alternate; }
.bn-ear1::before { background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, .5) 0%, rgba(0, 230, 118, .22) 34%, rgba(0, 230, 118, .06) 58%, transparent 76%); animation: bnRipple 3.6s ease-out infinite; }
.bn-ear1::after { background: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, .38) 0%, rgba(0, 230, 118, .16) 34%, transparent 70%); animation: bnRipple 3.6s ease-out 1.8s infinite; }

/* Year 2 — green shading into gold */
.bn-scales::before { background: repeating-linear-gradient(58deg, rgba(0, 230, 118, .18) 0 9px, transparent 9px 34px); animation: bnSweep 6s linear infinite alternate; }
/* Two voices, one green one gold, drifting toward each other — an interval. */
.bn-intervals::before {
  background: radial-gradient(circle at 32% 50%, rgba(0, 230, 118, .46) 0%, rgba(0, 230, 118, .2) 34%, transparent 66%),
              radial-gradient(circle at 68% 50%, rgba(255, 213, 79, .38) 0%, rgba(255, 213, 79, .16) 34%, transparent 66%);
  animation: bnSweep 6.5s ease-in-out infinite alternate;
}
.bn-chords::before {
  background: linear-gradient(180deg, transparent 4%, rgba(0, 230, 118, .12) 14%, rgba(0, 230, 118, .3) 26%, rgba(0, 230, 118, .12) 38%, transparent 50%, rgba(0, 230, 118, .1) 62%, rgba(0, 230, 118, .24) 74%, rgba(0, 230, 118, .1) 86%, transparent 96%);
  animation: bnSweep 7s ease-in-out infinite alternate;
}
/* Blue greys out against the dark card, so harmony blends green into gold. */
.bn-harmony::before {
  background: radial-gradient(circle at 24% 45%, rgba(0, 230, 118, .4) 0%, rgba(0, 230, 118, .16) 36%, transparent 68%),
              radial-gradient(circle at 52% 60%, rgba(120, 240, 175, .3) 0%, rgba(120, 240, 175, .12) 36%, transparent 68%),
              radial-gradient(circle at 78% 45%, rgba(255, 213, 79, .32) 0%, rgba(255, 213, 79, .13) 36%, transparent 68%);
  animation: bnBreathe 6.5s ease-in-out infinite;
}
.bn-culture::before { background: linear-gradient(100deg, transparent 30%, rgba(255, 213, 79, .55) 50%, transparent 70%); animation: bnSweep 5.5s ease-in-out infinite alternate; }
.bn-singing::before { background: radial-gradient(ellipse at 50% 60%, rgba(0, 230, 118, .46) 0%, rgba(0, 230, 118, .2) 38%, transparent 72%); animation: bnBreathe 4.4s ease-in-out infinite; }

/* Year 3 — gold, denser, faster */
.bn-ear2::before { background: radial-gradient(circle at 50% 50%, rgba(255, 213, 79, .46) 0%, rgba(255, 213, 79, .2) 34%, transparent 70%); animation: bnRipple 2.8s ease-out infinite; }
.bn-ear2::after { background: radial-gradient(circle at 50% 50%, rgba(255, 213, 79, .34) 0%, rgba(255, 213, 79, .14) 34%, transparent 70%); animation: bnRipple 2.8s ease-out 1.4s infinite; }
.bn-chords2::before {
  background: linear-gradient(180deg, transparent 3%, rgba(255, 213, 79, .14) 10%, rgba(255, 213, 79, .32) 20%, rgba(255, 213, 79, .14) 30%, transparent 40%, rgba(255, 213, 79, .12) 52%, rgba(255, 213, 79, .26) 60%, rgba(255, 213, 79, .12) 68%, transparent 80%, rgba(255, 213, 79, .2) 90%, transparent 98%);
  animation: bnSweep 5s ease-in-out infinite alternate;
}

/* Notes étrangères — la portée tient en place, dorée comme les autres
   chapitres d'Année 3 ; seules les intruses traversent, et elles sont de la
   mauvaise couleur. Le chapitre entier tient dans cette image. */
.bn-nct::before {
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 213, 79, .24) 7px 8px, transparent 8px 15px);
}
/* Rayon en px, pas en % : sur une bande deux fois plus large que haute, un
   pourcentage se mesure sur la diagonale et la note devient une flaque. */
.bn-nct::after {
  background: radial-gradient(circle 5px at 19% 34%, rgba(186, 128, 255, .62), transparent),
              radial-gradient(circle 4px at 47% 64%, rgba(186, 128, 255, .5), transparent),
              radial-gradient(circle 5px at 76% 40%, rgba(186, 128, 255, .58), transparent);
  animation: bnSweep 6.8s ease-in-out infinite alternate;
}

/* ---------- Bannieres de fin d'Annee 3 ----------
   Celles-ci assument l'eclat : fonds or et vert satures, opacites hautes,
   halos larges. Deux regles tiennent quand meme.

   Pas de `filter: blur()`. Le halo est fait de points d'arret de degrade
   supplementaires, jamais d'un flou : le flou anime avait fait tomber l'ecran
   Profil a 4 images par seconde sur iPhone avec quatorze bannieres, et on en
   affiche desormais vingt-trois.

   Et un voile sombre central, pose en premier dans la pile de ::after (donc
   peint par-dessus le reste de la couche) : il rend le pseudo lisible sans
   eteindre la banniere, au lieu de baisser l'opacite de l'ensemble. */
.bn-cad2::before, .bn-secdom::before, .bn-modul::before, .bn-voice::before,
.bn-figbass::before, .bn-modes::before, .bn-phrase::before, .bn-ornam::before,
.bn-compose::before { opacity: .95; }

.bn-cad2::before {
  background: linear-gradient(100deg, rgba(255, 190, 40, .5) 0%, rgba(255, 228, 130, .85) 26%, rgba(255, 190, 40, .45) 48%, rgba(255, 236, 170, .8) 72%, rgba(255, 190, 40, .5) 100%);
  animation: bnSweep 5.4s ease-in-out infinite alternate;
}
.bn-cad2::after {
  background: radial-gradient(ellipse 52% 72% at 50% 50%, rgba(8, 14, 10, .5), transparent 72%),
              repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 3px, transparent 3px 30px);
  animation: bnSweep 9s linear infinite alternate;
}

.bn-secdom::before {
  background: radial-gradient(circle at 22% 50%, rgba(255, 224, 110, 1) 0%, rgba(255, 190, 40, .75) 30%, transparent 62%),
              radial-gradient(circle at 78% 50%, rgba(130, 255, 185, 1) 0%, rgba(0, 220, 110, .7) 30%, transparent 62%),
              linear-gradient(90deg, #4a3400, #0a4a26);
  animation: bnSweep 6.4s ease-in-out infinite alternate;
}
.bn-secdom::after {
  background: radial-gradient(ellipse 46% 62% at 50% 50%, rgba(8, 14, 10, .42), transparent 72%);
}

.bn-modul::before {
  background: linear-gradient(90deg, rgba(0, 230, 118, .85) 0%, rgba(90, 225, 150, .6) 32%, rgba(255, 220, 110, .6) 68%, rgba(255, 190, 40, .9) 100%);
  animation: bnSweep 7.5s ease-in-out infinite alternate;
}
.bn-modul::after {
  background: radial-gradient(ellipse 54% 72% at 50% 50%, rgba(8, 14, 10, .48), transparent 72%),
              linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, .5) 50%, transparent 56%);
  animation: bnSweep 6.2s ease-in-out infinite alternate;
}

.bn-voice::before {
  background: repeating-linear-gradient(0deg, rgba(255, 213, 79, .8) 0 2px, transparent 2px 11px),
              linear-gradient(90deg, rgba(0, 120, 60, .75), rgba(0, 180, 95, .55), rgba(0, 120, 60, .75));
}
.bn-voice::after {
  background: radial-gradient(ellipse 50% 70% at 50% 50%, rgba(8, 14, 10, .5), transparent 70%),
              radial-gradient(circle 70px at 30% 50%, rgba(170, 255, 205, .5), transparent),
              radial-gradient(circle 70px at 72% 50%, rgba(255, 236, 170, .45), transparent);
  animation: bnSweep 8.4s ease-in-out infinite alternate;
}

.bn-figbass::before {
  background: repeating-linear-gradient(90deg, rgba(255, 213, 79, .9) 0 7px, rgba(255, 213, 79, .18) 7px 12px, transparent 12px 34px),
              linear-gradient(180deg, rgba(70, 50, 0, .7), rgba(30, 22, 0, .7));
  animation: bnSweep 6s linear infinite alternate;
}
.bn-figbass::after {
  background: radial-gradient(ellipse 52% 70% at 50% 50%, rgba(8, 14, 10, .55), transparent 70%),
              radial-gradient(circle 90px at 50% 50%, rgba(255, 240, 180, .4), transparent);
  animation: bnBreathe 5.2s ease-in-out infinite;
}

.bn-modes::before {
  background: linear-gradient(90deg, rgba(0, 200, 105, .92) 0%, rgba(0, 200, 105, .55) 46%, rgba(255, 205, 60, .55) 54%, rgba(255, 205, 60, .92) 100%);
  animation: bnSweep 7s ease-in-out infinite alternate;
}
.bn-modes::after {
  background: radial-gradient(ellipse 50% 70% at 50% 50%, rgba(8, 14, 10, .52), transparent 70%),
              repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 2px, transparent 2px 22px);
  animation: bnSweep 11s linear infinite alternate;
}

.bn-phrase::before {
  background: repeating-linear-gradient(90deg, rgba(255, 213, 79, .85) 0 26px, rgba(0, 200, 105, .7) 26px 52px),
              linear-gradient(180deg, rgba(40, 32, 0, .5), rgba(0, 30, 16, .5));
  animation: bnSweep 8s ease-in-out infinite alternate;
}
.bn-phrase::after {
  background: radial-gradient(ellipse 54% 74% at 50% 50%, rgba(8, 14, 10, .58), transparent 72%),
              radial-gradient(circle 60px at 25% 50%, rgba(255, 245, 200, .45), transparent),
              radial-gradient(circle 60px at 75% 50%, rgba(190, 255, 215, .4), transparent);
  animation: bnBreathe 6s ease-in-out infinite;
}

.bn-ornam::before {
  /* Un fond opaque sous le degrade conique : sans lui les alphas se melangent
     au noir de la carte et le ruban vire au vert sombre. */
  background: conic-gradient(from 0deg at 50% 50%, rgba(255, 213, 79, .95), rgba(120, 245, 175, .9), rgba(255, 245, 200, .95), rgba(60, 220, 130, .9), rgba(255, 213, 79, .95)),
              linear-gradient(0deg, #2a1f00, #2a1f00);
  animation: bnSweep 7.6s linear infinite alternate;
}
.bn-ornam::after {
  background: radial-gradient(ellipse 46% 62% at 50% 50%, rgba(8, 14, 10, .4), transparent 72%),
              radial-gradient(circle 5px at 16% 32%, rgba(255, 255, 255, .95), transparent),
              radial-gradient(circle 3px at 38% 66%, rgba(255, 255, 255, .7), transparent),
              radial-gradient(circle 4px at 62% 30%, rgba(255, 255, 255, .8), transparent),
              radial-gradient(circle 3px at 84% 64%, rgba(255, 255, 255, .7), transparent);
  animation: bnSweep 7.2s ease-in-out infinite alternate;
}

/* Le dernier chapitre de l'annee : le plus charge des neuf, volontairement. */
.bn-compose::before {
  background: radial-gradient(ellipse 70% 120% at 20% 50%, rgba(255, 236, 170, .95), rgba(255, 190, 40, .55) 42%, transparent 70%),
              radial-gradient(ellipse 70% 120% at 80% 50%, rgba(140, 255, 190, .9), rgba(0, 220, 110, .5) 42%, transparent 70%),
              linear-gradient(90deg, rgba(60, 44, 0, .7), rgba(0, 46, 24, .7));
  animation: bnSweep 5.8s ease-in-out infinite alternate;
}
.bn-compose::after {
  background: radial-gradient(ellipse 50% 70% at 50% 50%, rgba(8, 14, 10, .55), transparent 68%),
              repeating-linear-gradient(74deg, rgba(255, 255, 255, .3) 0 2px, transparent 2px 26px);
  animation: bnSweep 6.6s ease-in-out infinite alternate;
}

/* ---------- Signature banners ----------
   The seventeen above are variations on one idea: a coloured shape sliding
   sideways. These five each do something none of the others can, which is the
   only reason to have them.

   They opt out of the shared `inset: 0 -45%`. That overflow exists so a
   translateX sweep never runs out of layer; these are built on
   background-position instead, and the extra 90% of width would put every
   percentage in the wrong place.

   Seamless looping without `alternate`: with `background-size: 50%`, a
   background-position of 100% offsets the image by exactly 50% × (1 − 0.5) of
   the box — one whole tile — so the end frame is pixel-identical to the start.
   Any size of 1/(k+1) works the same way. */
.bn-score::before, .bn-score::after,
.bn-spectre::before, .bn-spectre::after,
.bn-holo::before, .bn-holo::after,
.bn-horizon::before, .bn-horizon::after,
.bn-eclipse::before, .bn-eclipse::after { inset: 0; }

/* La Partition — the staff holds still and the music travels across it.
   Sliding the staff instead would have produced a moving pattern; a score is
   something you read, and reading needs the lines to stay where they are. */
.bn-score::before {
  background:
    linear-gradient(rgba(0, 230, 118, .38) 0 0),
    linear-gradient(rgba(0, 230, 118, .38) 0 0),
    linear-gradient(rgba(0, 230, 118, .38) 0 0),
    linear-gradient(rgba(0, 230, 118, .38) 0 0),
    linear-gradient(rgba(0, 230, 118, .38) 0 0);
  background-repeat: no-repeat;
  background-size: 100% 1.2px;
  background-position: 0 24%, 0 37%, 0 50%, 0 63%, 0 76%;
}
.bn-score::after {
  /* Seven note heads on staff degrees, tilted to sit on the lines and in the
     spaces alternately — the shape of a phrase rather than a row of dots. */
  background:
    radial-gradient(ellipse 1.2% 5% at 6% 63%, rgba(0, 230, 118, .95) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 13% 50%, rgba(0, 230, 118, .9) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 20% 30%, rgba(120, 255, 190, .95) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 27% 43%, rgba(0, 230, 118, .9) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 34% 76%, rgba(0, 230, 118, .85) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 41% 56%, rgba(120, 255, 190, .9) 0 62%, transparent 66%),
    radial-gradient(ellipse 1.2% 5% at 46% 24%, rgba(0, 230, 118, .95) 0 62%, transparent 66%);
  background-size: 50% 100%;
  animation: bnScroll 9s linear infinite;
}
@keyframes bnScroll { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Spectre — nine bars, each with its own height at every step. This is the
   only banner whose parts disagree with one another: a single gradient can
   slide or fade, it cannot have nine independent opinions. Cheap all the
   same — animating background-size repaints one element, nothing composites. */
.bn-spectre::before {
  background:
    linear-gradient(rgba(0, 230, 118, .55) 0 0), linear-gradient(rgba(0, 230, 118, .55) 0 0),
    linear-gradient(rgba(120, 255, 190, .5) 0 0), linear-gradient(rgba(0, 230, 118, .55) 0 0),
    linear-gradient(rgba(255, 213, 79, .5) 0 0),  linear-gradient(rgba(0, 230, 118, .55) 0 0),
    linear-gradient(rgba(120, 255, 190, .5) 0 0), linear-gradient(rgba(0, 230, 118, .55) 0 0),
    linear-gradient(rgba(255, 213, 79, .5) 0 0);
  background-repeat: no-repeat;
  background-position: 6% 100%, 17% 100%, 28% 100%, 39% 100%, 50% 100%, 61% 100%, 72% 100%, 83% 100%, 94% 100%;
  animation: bnSpectre 2.4s ease-in-out infinite;
}
@keyframes bnSpectre {
  0%,
  100% { background-size: 4px 30%, 4px 62%, 4px 44%, 4px 78%, 4px 36%, 4px 68%, 4px 50%, 4px 84%, 4px 40%; }
  25%  { background-size: 4px 70%, 4px 34%, 4px 82%, 4px 42%, 4px 74%, 4px 30%, 4px 88%, 4px 46%, 4px 66%; }
  50%  { background-size: 4px 46%, 4px 86%, 4px 32%, 4px 64%, 4px 50%, 4px 90%, 4px 36%, 4px 70%, 4px 30%; }
  75%  { background-size: 4px 82%, 4px 48%, 4px 68%, 4px 34%, 4px 88%, 4px 44%, 4px 74%, 4px 32%, 4px 78%; }
}

/* Holographique — a fixed micro-grating over a spectrum that moves under it.
   The trading-card foil, and the trick is exactly that mismatch: the grating
   never shifts while the colour does, which the eye reads as a surface being
   tilted rather than a picture being animated. */
.bn-holo::before {
  background:
    repeating-linear-gradient(112deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 5px),
    linear-gradient(96deg, rgba(255, 55, 125, .52), rgba(255, 190, 55, .48) 16%, rgba(110, 255, 160, .48) 34%,
                    rgba(80, 190, 255, .52) 52%, rgba(195, 115, 255, .52) 70%, rgba(255, 55, 125, .52));
  background-size: 100% 100%, 300% 100%;
  animation: bnHolo 5.5s ease-in-out infinite alternate;
}
@keyframes bnHolo {
  from { background-position: 0 0,   0% 0; }
  to   { background-position: 0 0, 100% 0; }
}
.bn-holo::after {
  background: linear-gradient(104deg, transparent 40%, rgba(255, 255, 255, .5) 50%, transparent 60%);
  background-size: 260% 100%;
  animation: bnHoloGlint 3.4s ease-in-out infinite alternate;
}
@keyframes bnHoloGlint { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Horizon — three ridges at three speeds, and a star field slower still.
   Depth, which no single layer can fake: the near ridge crosses the far one,
   and the crossing is the whole effect. */
.bn-horizon::before {
  background:
    radial-gradient(1.4px 1.4px at 12% 24%, rgba(255, 255, 255, .8), transparent),
    radial-gradient(1.2px 1.2px at 31% 13%, rgba(255, 255, 255, .65), transparent),
    radial-gradient(1.5px 1.5px at 54% 28%, rgba(255, 255, 255, .75), transparent),
    radial-gradient(1.2px 1.2px at 73% 11%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1.4px 1.4px at 89% 26%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(ellipse 34% 82% at 22% 122%, rgba(90, 180, 255, .32) 0 60%, transparent 64%),
    radial-gradient(ellipse 40% 96% at 64% 126%, rgba(0, 200, 140, .38) 0 60%, transparent 64%),
    radial-gradient(ellipse 46% 108% at 38% 132%, rgba(0, 120, 90, .55) 0 60%, transparent 64%);
  background-size: 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%;
  animation: bnHorizon 24s linear infinite;
}
@keyframes bnHorizon {
  from { background-position:   0% 0,   0% 0,   0% 0,   0% 0,   0% 0,   0% 0,   0% 0,   0% 0; }
  to   { background-position: 100% 0, 100% 0, 100% 0, 100% 0, 100% 0, 300% 0, 500% 0, 800% 0; }
}

/* Éclipse — the rarest banner in the game, and the only one that is an event
   rather than a texture: a dark disc crosses a bright one, and the corona
   flares at totality. Radii in percent, not pixels, because a banner is about
   6:1 in both places it appears — 5% of the width and 30% of the height come
   out the same size, so the "circle" stays round on a card and on a row. */
.bn-eclipse::before {
  background:
    radial-gradient(1.3px 1.3px at 9% 26%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(1.1px 1.1px at 27% 74%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1.3px 1.3px at 78% 22%, rgba(255, 255, 255, .65), transparent),
    radial-gradient(1.1px 1.1px at 92% 68%, rgba(255, 255, 255, .5), transparent),
    radial-gradient(ellipse 9% 54% at 50% 50%,
      rgba(255, 250, 228, 1) 0 58%, rgba(255, 216, 120, .8) 66%,
      rgba(255, 178, 60, .38) 78%, rgba(255, 150, 40, .12) 90%, transparent 99%);
  background-repeat: no-repeat;
  background-position: 9% 26%, 27% 74%, 78% 22%, 92% 68%, 50% 50%;
}
/* The occluder's layer is 40% of the strip, not 100%, and that is the whole
   reason it moves. A percentage background-position offsets by X% of
   (box − image): with an image the size of the box that is zero, so the disc
   sat dead centre over the corona for eleven seconds and the "eclipse" was a
   permanently covered sun. At 40% it has 60% of the width to cross, and the
   radii are scaled up to match so the disc keeps its size. */
.bn-eclipse::after {
  background: radial-gradient(ellipse 20% 48% at 50% 50%, #050d0a 0 76%, rgba(5, 13, 10, .55) 84%, transparent 96%);
  background-repeat: no-repeat;
  background-size: 40% 100%;
  animation: bnEclipse 11s ease-in-out infinite alternate;
}
@keyframes bnEclipse {
  from { background-position: 18% 50%; }
  to   { background-position: 82% 50%; }
}

/* ============ Profile-card outlines ============
   A 2px band traced around a card. Drawn as a gradient behind a mask that
   hollows out the middle — the usual two-element gradient-border trick would
   need an opaque inner box, which would cover the banner underneath.

   Colour travels by panning a background, never by animating a filter: the
   League screen can show thirty of these at once, and the same lesson was
   already paid for once with the CSS banners above. */
.card-outline {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-radius: inherit;
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* The ring is drawn on the card; the glow it throws is the card's own shadow,
   read from one custom property. One rule per context beats one rule per
   outline per context — an outline only has to declare its colours. */
.profile-head.has-outline {
  box-shadow: 8px 8px 18px var(--shadow-dark), -6px -6px 14px var(--shadow-light),
              0 0 28px var(--ol-glow);
}
.league-row.has-outline, .member-row.has-outline {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light),
              0 0 20px var(--ol-glow);
}
/* Still find your own line at a glance: green just outside, the chosen ring on
   the edge itself. */
.league-row.me.has-outline, .member-row.me.has-outline {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light),
              0 0 0 3px var(--green-dim), 0 0 22px var(--ol-glow);
}

/* A symmetrical gradient panned back and forth: the ends match, so `alternate`
   never shows a seam and no second copy of the image is needed. */
@keyframes olPan { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* Gold — the ring a year banner used to light on its own. Static on purpose:
   it is the oldest and the quietest, and it has to stay recognisable. */
.ol-gold { --ol-glow: rgba(255, 213, 79, 0.30); --ol-spark: #ffe4a0; }
.ol-gold > .card-outline {
  background: linear-gradient(115deg, #8a6100, #ffd54f 30%, #fff6d0 48%, #ffd54f 66%, #8a6100);
}

/* Three gradients panned at three speeds, the middle one running backwards.
   A single layer can only slide; it is the crossing of layers that reads as
   fire. It costs nothing extra — an element takes as many backgrounds as you
   like, `background-position` animates all of them in one declaration, and
   there is still no filter anywhere. Measured at a hundred rings on screen:
   the same frame rate as an empty page. */
.ol-fire { --ol-glow: rgba(255, 106, 20, 0.42); --ol-spark: #ffc48a; }
.ol-fire > .card-outline {
  background:
    linear-gradient(100deg, transparent 8%, rgba(255, 255, 255, 0.9) 48%, transparent 88%),
    repeating-linear-gradient(74deg, transparent 0 5px, rgba(255, 193, 7, 0.8) 5px 9px, transparent 9px 17px),
    linear-gradient(110deg, #5c0f00, #ff5722 20%, #ff9800 38%, #ffe0a3 50%, #ff9800 62%, #ff5722 80%, #5c0f00);
  background-size: 320% 100%, 160% 100%, 240% 100%;
  background-blend-mode: screen, overlay, normal;
  animation: olFire 2.9s ease-in-out infinite alternate;
}
@keyframes olFire {
  from { background-position:   0% 0, 100% 0,   0% 0; }
  to   { background-position: 100% 0,   0% 0, 100% 0; }
}

/* Frost — pale blue under a white crest that slides at its own, slower pace. */
.ol-frost { --ol-glow: rgba(140, 210, 255, 0.38); --ol-spark: #eaf8ff; }
.ol-frost > .card-outline {
  background:
    linear-gradient(96deg, transparent 18%, rgba(255, 255, 255, 0.75) 50%, transparent 82%),
    linear-gradient(110deg, #1d5b8a, #6fc4ff 24%, #dff2ff 50%, #6fc4ff 76%, #1d5b8a);
  background-size: 300% 100%, 240% 100%;
  background-blend-mode: screen, normal;
  animation: olFrost 6s ease-in-out infinite alternate;
}
@keyframes olFrost {
  from { background-position: 100% 0,   0% 0; }
  to   { background-position:   0% 0, 100% 0; }
}

/* Voltage — hard-edged stripes racing round, with an irregular flicker on top.
   steps(1) so it snaps rather than fades: a dimmer is not a spark. */
.ol-volt { --ol-glow: rgba(64, 224, 255, 0.45); --ol-spark: #c2f6ff; }
.ol-volt > .card-outline {
  background: repeating-linear-gradient(100deg,
    #06384a 0 8px, #40e0ff 8px 13px, #eafcff 13px 16px, #40e0ff 16px 21px, #06384a 21px 34px);
  background-size: 200% 100%;
  animation: olPan 0.9s linear infinite alternate, olFlicker 2.3s steps(1) infinite;
}
@keyframes olFlicker {
  0%, 42%, 100% { opacity: 1; }
  46% { opacity: 0.4; }
  50% { opacity: 1; }
  70% { opacity: 0.55; }
  74% { opacity: 1; }
}

/* Aurora — green folding into violet, drifting slowly enough to be noticed
   twice rather than at once. */
.ol-aurora { --ol-glow: rgba(150, 110, 255, 0.40); --ol-spark: #c8b4ff; }
.ol-aurora > .card-outline {
  background:
    linear-gradient(88deg, transparent 22%, rgba(220, 255, 240, 0.55) 50%, transparent 78%),
    linear-gradient(110deg, #0b6b4f, #00e676 20%, #45e0d0 38%, #7a6cff 56%, #d46cff 74%, #00e676 90%, #0b6b4f);
  background-size: 260% 100%, 170% 100%;
  background-blend-mode: screen, normal;
  animation: olAurora 7s ease-in-out infinite alternate;
}
@keyframes olAurora {
  from { background-position: 100% 0,   0% 0; }
  to   { background-position:   0% 0, 100% 0; }
}

/* Prism — the whole spectrum, the most expensive and the loudest. A panned
   rainbow rather than a rotating conic: rotating the element would turn the
   ring's own shape with it. */
.ol-prism { --ol-glow: rgba(255, 255, 255, 0.38); --ol-spark: #ffffff; }
.ol-prism > .card-outline {
  /* Only 140% on the spectrum: the point of this one is that all of it is on
     the card at once. Zoomed in like the others it would read as two colours,
     which is not what fifteen hundred gems is buying. The white crest above it
     travels the other way, so the light moves through the colours instead of
     with them. */
  background:
    linear-gradient(94deg, transparent 20%, rgba(255, 255, 255, 0.8) 50%, transparent 80%),
    linear-gradient(110deg, #ff3b5c, #ff9800 14%, #ffe83d 28%, #00e676 42%, #40e0ff 56%, #7a6cff 70%, #ff5cf0 84%, #ff3b5c);
  background-size: 300% 100%, 140% 100%;
  background-blend-mode: screen, normal;
  animation: olPrism 4s linear infinite alternate;
}
@keyframes olPrism {
  from { background-position: 100% 0,   0% 0; }
  to   { background-position:   0% 0, 100% 0; }
}

/* ---------- Fondateur (collector) : platine vinyle, pixel art ----------
   Pixel art is not a matter of hard edges — every banner here could have
   those. It is a matter of QUANTISED MOTION and a grid the drawing cannot
   escape. So the platter turns in steps() and never rests between two angles,
   and a fixed grid of dark lines sits above the whole scene: that grid is what
   turns smooth gradients into pixels, exactly as a sprite is redrawn onto the
   screen's own grid rather than between its cells.

   The scene lives on the RIGHT of the strip, like every other banner here: the
   left belongs to the avatar and the name. */
.bn-founder::before, .bn-founder::after { inset: 0; }

/* The plinth: planks across, grain along them, and vertical shading so it is
   a piece of wood rather than a set of stripes. */
.bn-founder::before {
  background:
    /* grain: a fine dark line every cell, so the planks are not flat colour */
    repeating-linear-gradient(180deg, rgba(56, 24, 0, .3) 0 1px, transparent 1px 9px),
    /* knots and figure: three wide, slow bands across the grain, at cell
       boundaries so nothing lands between two pixels */
    repeating-linear-gradient(90deg,
      rgba(255, 190, 120, .10) 0 45px, transparent 45px 108px,
      rgba(60, 26, 0, .16) 108px 153px, transparent 153px 234px),
    /* the plank joins: one dark cell where two boards meet */
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(40, 16, 0, .55) 26px 27px, transparent 27px 45px),
    /* the boards themselves — warm, and clearly different from one another */
    repeating-linear-gradient(180deg,
      #9c5f24 0 18px, #b06f2e 18px 27px, #8a521c 27px 45px,
      #bd7c3c 45px 63px, #955a20 63px 81px, #a86828 81px 90px);
  background-size: 100% 9px, 234px 100%, 100% 45px, 100% 90px;
  z-index: 0;
}

/* The grid, dead still and above everything — the pixels themselves. */
.bn-founder::after {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 9px);
  z-index: 5;
}

.bn-founder > i { position: absolute; z-index: 2; }

/* The platter under the record, one shade off the wood so the disc is not
   floating on the plinth. */
.bn-founder .tt-platter {
  right: 28%; top: 6%; height: 88%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(58, 55, 50, .45) 0 96%, transparent 97%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

/* The record. A circle of concentric grooves is rotationally symmetric, so on
   its own it would spin invisibly — the sheen and the label's wedge are what
   make the motion readable at all. */
.bn-founder .tt-disc {
  right: 30%; top: 12%; height: 76%; aspect-ratio: 1;
  border-radius: 50%;
  /* Order matters more than anything else here, and the first attempt got it
     wrong: a conic-gradient has no radius, so the gold label painted the whole
     record and buried the vinyl beneath it. The label has to be a radial
     circle; the rotation is then carried by the two things that are
     deliberately off-centre — the sheen and the cue dot — because concentric
     grooves are rotationally symmetric and would spin invisibly. */
  background:
    radial-gradient(circle at 50% 50%, #4a3010 0 5%, transparent 6%),
    radial-gradient(circle at 63% 50%, #a8341f 0 4%, transparent 5%),
    conic-gradient(from 0deg,
      transparent 0 34%, rgba(255, 255, 255, .22) 41% 47%, transparent 54% 72%,
      rgba(255, 255, 255, .1) 78% 82%, transparent 88% 100%),
    radial-gradient(circle at 50% 50%, #f0b93c 0 26%, #d99a24 26% 27%, transparent 28%),
    repeating-radial-gradient(circle at 50% 50%, #141414 0 2px, #242424 2px 4px);
  animation: ttSpin 3s steps(12) infinite;
}
@keyframes ttSpin { to { transform: rotate(360deg); } }

/* The tonearm, tracking slowly inward and back. Four steps over nine seconds:
   barely a movement, but the difference between a drawing and a machine. */
.bn-founder .tt-arm {
  right: 21%; top: 20%;
  width: 30%; height: 4px;
  background: linear-gradient(90deg, #efe9db 0 76%, #b9b1a0 76% 100%);
  box-shadow: 0 0 0 1px rgba(24, 12, 0, .7);
  transform-origin: right center;
  transform: rotate(26deg);
  animation: ttArm 9s steps(4) infinite alternate;
  z-index: 3;
}
@keyframes ttArm { to { transform: rotate(33deg); } }
.bn-founder .tt-pivot {
  right: 19.5%; top: 15%;
  width: 9px; height: 9px; border-radius: 50%;
  background: #d8d2c4;
  box-shadow: 0 0 0 1px rgba(24, 12, 0, .7);
  z-index: 4;
}

/* The speed controls, bottom right of the deck: 33, 45, and the stop. Sized
   in fixed pixels like the grid cell, not in percent — a knob that grew with
   the card would stop being a knob and start being a plate, and pixel art is
   the one style where a fixed size is the honest choice. */
.bn-founder .tt-knobs {
  /* 20%, not 5%: at the far right the knobs sat underneath the XP figure in a
     league row. Below the arm's pivot is where they belong on a real deck
     anyway, so the constraint and the drawing agree. */
  right: 20%; bottom: 15%;
  width: 43px; height: 13px;
  background:
    radial-gradient(circle at 6.5px 6.5px, #f2f2f0 0 3px, #cfcfcb 3px 4.5px, #6e6e68 4.5px 5.5px, transparent 6px),
    radial-gradient(circle at 21.5px 6.5px, #f2f2f0 0 3px, #cfcfcb 3px 4.5px, #6e6e68 4.5px 5.5px, transparent 6px),
    radial-gradient(circle at 36.5px 6.5px, #d8d4cc 0 3px, #a8a49c 3px 4.5px, #5c5a54 4.5px 5.5px, transparent 6px);
  z-index: 3;
}

/* The badge on the plinth, where a deck carries its brand. "FIRST PRESS" is
   the collector's term for a record's original run — it says "you were here
   for the first pressing" in the object's own vocabulary, which beats
   borrowing slang that will date.

   No web font: a pixel typeface would be a network dependency for ten
   letters, and it would be the one thing on this banner that fails offline.
   The lettering is monospaced, spaced out and small, and the scene's own grid
   sits above it at z-index 5 — so the glyphs get chopped into cells exactly
   like everything else here. The pixelation is the banner's, not the font's. */
.bn-founder .tt-badge {
  /* Anchored from the right like every other piece of the deck. Anchored left
     it sat behind the avatar on a profile card and under the row's fade mask
     in a league line — visible in neither of the two places it appears. */
  right: 36%; bottom: 15%;
  font: 800 13px/1 ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: .14em;
  color: #f5c84e;
  /* Hard offset, never a blur: a shadow with soft edges is the one thing that
     cannot happen on a pixel grid. */
  text-shadow: 1px 1px 0 rgba(38, 16, 0, .9);
  white-space: nowrap;
  z-index: 4;
  animation: ttFloat 2.4s steps(1) infinite;
}
/* Whole pixels, and it jumps between them — a float that glided would undo
   every other decision on this banner. */
@keyframes ttFloat {
  0%   { transform: translateY(0); }
  25%  { transform: translateY(-1px); }
  50%  { transform: translateY(-2px); }
  75%  { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

/* The lettering shows where the banner is the SUBJECT — the collector shelf,
   the gift reveal, a picker tile — and hides where it is a BACKGROUND behind
   somebody's name. A league row has a deck, a name and an XP figure in about
   200px on a phone; a profile card has three lines of text across its left
   half. In both, words on the wood compete with words that have to be read.
   Same rule as the sparks and the halo: the crowded context gets less. */
.row-banner .tt-badge,
.profile-banner .tt-badge { display: none; }

/* A frozen banner holds its drawing but stops its machinery. */
.bn-founder.frozen > i { animation-play-state: paused; }

/* ---------- The champion's banner ----------
   The one banner nobody keeps. It is worn by whoever finished last week first
   and it changes hands every Monday, so it has a job the others do not: it
   must be identifiable from across a leaderboard, in a 52px row, WITHOUT its
   lettering — banner text is hidden in rows and on profile cards, for the
   reasons the founder banner found out the hard way.

   So the recognition is carried entirely by shape and colour: gold where
   everything else in the app is green, a crown, two laurels. Nothing to read.
   The lettering exists for the three places where the banner is the subject
   rather than a background — the picker, the gift, the collector shelf — and
   there it names the week rather than the player, because the player's name is
   already printed beside it in all six places this renders. */
/* ::after deliberately keeps the default inset: 0 -45%. The sweep translates
   ±20%, and it needs the extra width or it drags an edge across the gold. */
.bn-champion::before {
  inset: 0;
  background:
    /* a soft warm centre, so the strip is a struck surface and not a flat fill */
    radial-gradient(ellipse 60% 140% at 78% 50%, rgba(255, 214, 120, .30), transparent 70%),
    linear-gradient(103deg, #2b1f04 0 30%, #5c430b 55%, #2b1f04 82%);
}
/* The specular band: the only thing here that slides. Everything else turns or
   bobs, and one travelling highlight is what makes gold read as metal instead
   of as paint. */
.bn-champion::after {
  background: linear-gradient(102deg,
    transparent 0 42%, rgba(255, 243, 200, .42) 50%, transparent 58%);
  animation: bnSweep 5.2s ease-in-out infinite alternate;
}

.bn-champion > i { position: absolute; z-index: 2; }

/* Light turning behind the crown. The wedges never move relative to one
   another — the whole disc rotates — which is what a light source going round
   actually looks like. Masked to a soft edge so it is a glow and not a wheel. */
/* Every piece of this scene shares one centre, and that is the whole trick.
   Mixing a percentage anchor with a pixel size — what the founder banner does,
   and gets away with because its pieces never have to line up — made the
   laurel drift across the crown as the strip changed width. A wreath is only a
   wreath when it is concentric with what it surrounds.

   Sized in `cqh`, one percent of the strip's own height, so the scene scales
   with the banner: the same drawing has to work at 96px tall on a profile card
   and at 23px in a picker tile. The pixel values above each `cqh` line are the
   fallback — a browser without container queries drops the `cqh` declaration
   and keeps the pixels, rather than rendering nothing at all. */
.bn-champion { container-type: size; }

.bn-champion .ch-rays {
  right: -4px; top: 50%; width: 130px; height: 130px; margin-top: -65px;
  right: -4cqh; width: 140cqh; height: 140cqh; margin-top: -70cqh;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(255, 222, 140, .34) 0 7deg, transparent 7deg 30deg,
    rgba(255, 222, 140, .34) 30deg 37deg, transparent 37deg 60deg,
    rgba(255, 222, 140, .34) 60deg 67deg, transparent 67deg 90deg,
    rgba(255, 222, 140, .34) 90deg 97deg, transparent 97deg 120deg,
    rgba(255, 222, 140, .34) 120deg 127deg, transparent 127deg 150deg,
    rgba(255, 222, 140, .34) 150deg 157deg, transparent 157deg 180deg,
    rgba(255, 222, 140, .34) 180deg 187deg, transparent 187deg 210deg,
    rgba(255, 222, 140, .34) 210deg 217deg, transparent 217deg 240deg,
    rgba(255, 222, 140, .34) 240deg 247deg, transparent 247deg 270deg,
    rgba(255, 222, 140, .34) 270deg 277deg, transparent 277deg 300deg,
    rgba(255, 222, 140, .34) 300deg 307deg, transparent 307deg 330deg,
    rgba(255, 222, 140, .34) 330deg 337deg, transparent 337deg 360deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 34%, transparent 70%);
  mask-image: radial-gradient(circle, #000 0 34%, transparent 70%);
  z-index: 1;
  animation: chTurn 18s linear infinite;
}
@keyframes chTurn { to { transform: rotate(360deg); } }

/* A crown rather than a cup: at this size a trophy is a gold blob, while five
   points and a base still read as a crown. Same shape the app already uses for
   its prestige icon, so it is recognised before it is examined. */
.bn-champion .ch-cup {
  right: 45px; top: 50%; width: 32px; height: 25px; margin-top: -12px;
  right: 48cqh; width: 34cqh; height: 27cqh; margin-top: -13cqh;
  background: linear-gradient(180deg, #fff0c4 0%, #f5c84e 46%, #c08e22 100%);
  clip-path: polygon(0% 100%, 100% 100%, 100% 24%, 74% 56%, 50% 0%, 26% 56%, 0% 24%);
  filter: drop-shadow(0 0 7px rgba(255, 200, 80, .55));
  z-index: 3;
  animation: chBob 3.4s ease-in-out infinite;
}
@keyframes chBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Two half-rings flanking the crown. A circle clipped down its middle is a
   laurel at this scale, and it costs one element instead of fourteen leaves. */
.bn-champion .ch-laurel-l, .bn-champion .ch-laurel-r {
  right: 34px; top: 50%; width: 54px; height: 54px; margin-top: -27px;
  right: 36cqh; width: 58cqh; height: 58cqh; margin-top: -29cqh;
  border-width: max(1.5px, 3.2cqh);
  border: 3px solid rgba(245, 200, 78, .78);
  border-radius: 50%;
  /* Clipped just past the middle, so the two halves leave a gap at the top and
     bottom instead of closing into a ring. */
  clip-path: inset(0 56% 0 0);
  z-index: 2;
}
.bn-champion .ch-laurel-l { transform: rotate(-12deg); }
.bn-champion .ch-laurel-r { transform: scaleX(-1) rotate(-12deg); }

/* The lettering. Monospaced and spaced out like the founder's, for the same
   reason: no web font, because ten letters are not worth a network dependency
   that fails offline. */
.bn-champion .ch-tag {
  left: 10px; right: 98px; top: 50%; margin-top: -11px;
  right: 100cqh; margin-top: -11cqh;
  text-align: center; overflow: hidden;
  font: 900 max(9px, 13cqh)/1 ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: .2em;
  color: #ffeec2;
  text-shadow: 0 0 9px rgba(255, 200, 80, .65);
  white-space: nowrap;
  z-index: 4;
}
.bn-champion .ch-week {
  left: 10px; right: 98px; top: 50%; margin-top: 4px;
  right: 100cqh; margin-top: 4cqh;
  text-align: center; overflow: hidden;
  font: 800 max(8px, 11cqh)/1 ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', 'Courier New', monospace;
  letter-spacing: .16em;
  color: rgba(255, 233, 168, .72);
  white-space: nowrap;
  z-index: 4;
}
/* Same rule as the founder's badge, and the same reason: in a row or on a
   profile card these words sit behind words that have to be read. An absent
   week leaves an empty element rather than a dangling separator. */
.row-banner .ch-tag, .row-banner .ch-week,
.profile-banner .ch-tag, .profile-banner .ch-week { display: none; }

.bn-champion.frozen > i { animation-play-state: paused; }

/* ---------- Escaping outlines: light past the frame ----------
   Everything above is bound to the card's edge, because a 2px band cannot be
   anywhere else. `.card-halo` is mounted OUTSIDE it — negative inset, and a
   mask that hollows out exactly the card's own box, so only the band beyond
   the border survives.

   That needs the clip lifted, which is the delicate part. The card and the
   league rows both carry `overflow: hidden`, and two children were relying on
   it: `.profile-banner` clips itself already, but `.row-banner` had its radius
   removed on purpose once the row began clipping it directly. It gets it back
   here — its right, top and bottom edges sit on the row's, and the only side
   that overhangs is the left, which its own fade mask has already erased. */
.profile-head.ol-escape, .league-row.ol-escape, .member-row.ol-escape { overflow: visible; }
.ol-escape > .row-banner { border-radius: inherit; }

.card-halo {
  position: absolute; z-index: 0; pointer-events: none;
  inset: calc(var(--halo, 15px) * -1);
  border-radius: calc(var(--radius) + var(--halo, 15px));
  padding: var(--halo, 15px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* Solar — the senior of the gold ring. It breathes rather than travels: the
   band brightens and dims on its own clock while the colour pans on another,
   so the two never line up twice. */
.ol-solar { --ol-glow: rgba(255, 205, 90, .5); --ol-spark: #ffe6b0; }
.ol-solar > .card-outline {
  background: linear-gradient(115deg, #a06a00, #ffd54f 26%, #fffbe8 48%, #ffd54f 70%, #a06a00);
  background-size: 240% 100%;
  animation: olPan 4.4s ease-in-out infinite alternate;
}
.ol-solar > .card-halo {
  background: linear-gradient(115deg, rgba(255, 170, 30, 0), rgba(255, 214, 110, .6) 28%,
              rgba(255, 250, 226, .9) 50%, rgba(255, 214, 110, .6) 72%, rgba(255, 170, 30, 0));
  background-size: 300% 100%;
  animation: olPan 4.4s ease-in-out infinite alternate, olBreathe 3.1s ease-in-out infinite;
}
@keyframes olBreathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* Shockwave — the halo is not a border here, it is a wave leaving the card.
   Transform and opacity only, which the compositor handles without repainting
   anything: the cheapest effect in the stylesheet and the one that travels
   furthest. Two waves half a cycle apart, so one is always on its way out. */
.ol-wave { --ol-glow: rgba(80, 220, 255, .45); --ol-spark: #bfefff; }
.ol-wave > .card-outline {
  background: linear-gradient(110deg, #0b4a63, #35c8ff 28%, #eaffff 50%, #35c8ff 72%, #0b4a63);
  background-size: 240% 100%;
  animation: olPan 3s ease-in-out infinite alternate;
}
.ol-wave > .card-halo {
  background: linear-gradient(110deg, rgba(53, 200, 255, .75), rgba(190, 245, 255, .9) 50%, rgba(53, 200, 255, .75));
  animation: olWave 2.8s ease-out infinite;
}
.ol-wave > .card-halo::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: inherit;
  animation: olWave 2.8s ease-out 1.4s infinite;
}
@keyframes olWave {
  0%   { transform: scale(1, 1); opacity: .9; }
  65%  {                         opacity: .28; }
  100% { transform: scale(var(--wx, 1.1), var(--wy, 1.3)); opacity: 0; }
}

/* Comet — a point that orbits outside the card, with three dimmer copies a few
   hundredths behind it for a tail. The keyframes are deliberately not evenly
   spaced: a card is about 6:1, so an even split would send the point crawling
   along the short sides and sprinting down the long ones. 43/7/43/7 is the
   perimeter's own proportion, and the speed comes out constant. */
.ol-comet { --ol-glow: rgba(120, 210, 255, .45); --ol-spark: #d8f2ff; }
.ol-comet > .card-outline {
  background: linear-gradient(110deg, #10304a, #4a7fa8 30%, #a8d8f0 50%, #4a7fa8 70%, #10304a);
  background-size: 240% 100%;
  animation: olPan 6s ease-in-out infinite alternate;
}
/* No mask and no padding: this halo is a track for its dots, not a band. */
.ol-comet > .card-halo { -webkit-mask: none; mask: none; padding: 0; }
.ol-comet > .card-halo i {
  position: absolute; left: 0; top: 0;
  width: var(--dot, 5px); height: var(--dot, 5px);
  margin: calc(var(--dot, 5px) / -2);
  border-radius: 50%;
  background: #ffffff;
  opacity: var(--fade, 1);
  box-shadow: 0 0 8px 3px rgba(120, 220, 255, .95), 0 0 22px 9px rgba(50, 165, 255, .5);
  animation: olOrbit 4.6s linear var(--lag, 0s) infinite;
}
/* --ow / --oh are the halo's measured pixel size, written by JS. They cannot
   be percentages: inside translate() a percentage means "of my own width", and
   a 5px dot walking 100% of itself goes nowhere. */
@keyframes olOrbit {
  0%   { transform: translate(0, 0); }
  43%  { transform: translate(var(--ow, 100px), 0); }
  50%  { transform: translate(var(--ow, 100px), var(--oh, 40px)); }
  93%  { transform: translate(0, var(--oh, 40px)); }
  100% { transform: translate(0, 0); }
}

/* ---------- Emitters: what a card gives off ----------
   Below the ring (z-index 3) and above the banner, so a note passes in front
   of the name and behind the edge. Clipped to the card: `.profile-head` hides
   its overflow, so a glyph fades out before the border rather than escaping
   into the page — which is the better read anyway, and the only one that
   keeps the rounded corners.

   Everything specific to one glyph — where it starts, how fast, how far it
   drifts — is an inline custom property written once at mount. Nothing here
   runs a script per frame. */
.card-emitter {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; overflow: hidden; border-radius: inherit;
}
.card-emitter i {
  /* The launch point is a fraction of the travel, not a fixed -14px. On a 96px
     card those pixels were nothing; on a 56px league row they were a quarter
     of the flight, spent below the clip — the glyph did its whole fade-in
     while invisible and only appeared once it was already dimming. */
  position: absolute; left: var(--x); bottom: calc(var(--travel, 118px) * -0.1);
  font-size: var(--size); font-style: normal; line-height: 1;
  color: var(--ol-spark, #fff);
  text-shadow: 0 0 7px var(--ol-glow);
  opacity: 0;
  animation: sparkFly var(--dur) linear var(--delay) infinite;
}
/* Distance comes from --travel, which JS measures off the host, and direction
   from --dir, which belongs to the outline. That split is what lets the same
   two rules serve a 96px profile card and a 52px league row: an ember written
   as "-128px" would shoot straight out of the top of a row before it had begun
   to fade, and a snowflake would never reach the bottom of a card. */
@keyframes sparkFly {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  9%   { opacity: 0.95; }
  70%  { opacity: 0.55; }
  100% { transform: translate(var(--drift), calc(var(--travel, 118px) * var(--dir, -1)))
                    rotate(var(--spin, 22deg));
         opacity: 0; }
}
/* Gold rises slowly and barely turns: the ring itself is deliberately static,
   and its notes must not contradict it. */
.ol-gold .card-emitter i   { --dir: -0.75; --spin: 12deg;  animation-timing-function: ease-out; }
.ol-fire .card-emitter i   { --dir: -1.1;  --spin: 30deg;  animation-timing-function: ease-out; }
/* Frost falls. Starting at the top and travelling down is the whole
   difference between a snowflake and an ember — one sign and one edge. */
.ol-frost .card-emitter i  { --dir: 1;     --spin: 240deg; bottom: auto; top: calc(var(--travel, 118px) * -0.1); }
/* Volt: short, quick, gone. The snap comes from a life of barely a second,
   not from an opacity trick fighting the glide. */
.ol-volt .card-emitter i   { --dir: -0.62; --spin: 0deg;   animation-timing-function: ease-in; }
.ol-aurora .card-emitter i { --dir: -0.9;  --spin: 16deg;  animation-timing-function: ease-in-out; }
.ol-prism .card-emitter i  { --dir: -1;    --spin: 28deg; }

/* Volunteered, not asked for: this app is used by children in a classroom, and
   a screen full of drifting glyphs is exactly what this setting exists for. */
@media (prefers-reduced-motion: reduce) {
  .card-emitter { display: none; }
  /* The halo stays — it is what the player earned — but it stops travelling.
     An expanding wave and an orbiting point are exactly the two things this
     setting is asking not to see. */
  .card-halo, .card-halo::before, .card-halo i { animation: none; }
  .ol-comet > .card-halo { display: none; }
}

/* ============ Customise-my-card screen ============ */
/* The entry point on Profile: the card in miniature, wearing what is on it
   right now, so the button shows the thing it edits. */
.card-entry {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px; text-align: left; width: 100%;
}
.card-entry-banner { position: absolute; inset: 0; right: 0; left: auto; aspect-ratio: 1200 / 190; opacity: 0.45; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 60%);
  mask-image: linear-gradient(90deg, transparent 4%, #000 60%); }
.card-entry .ce-txt { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.card-entry .ce-txt b { font-size: 14.5px; font-weight: 900; }
.card-entry .ce-txt small { font-size: 11.5px; color: var(--text-faint); font-weight: 700; }
.card-entry .ce-chev { position: relative; z-index: 2; color: var(--text-faint); font-size: 24px; font-weight: 900; line-height: 1; }

.cz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.cz-head .page-title { font-size: 22px; }
.cz-back { flex-shrink: 0; }
/* The whole point of the screen: the card never leaves the screen while the
   lists move under it. Offset by the HUD, which is sticky at 0. */
.cz-stage {
  position: sticky; top: 58px; z-index: 20;
  padding: 10px 0 14px;
  margin: 8px 0 4px;
  background: linear-gradient(var(--bg) 91%, transparent);
}
.cz-stage .profile-head { margin-bottom: 0; }
.cz-stage .profile-banner { display: block; }
/* Two previews, not one. A banner behind a profile card fills it; the same
   banner in a league row is a 6:1 strip anchored right under a veil. Showing
   only the card was selling the wrong picture — the row is where everyone
   else actually sees it. */
.cz-cap {
  display: block; margin: 0 2px 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint);
}
.cz-stage .cz-cap + * { margin-bottom: 0; }
.cz-stage .cz-cap:not(:first-child) { margin-top: 12px; }
.cz-rowdemo { list-style: none; padding: 0; margin: 0; }
.cz-rowdemo .league-row { pointer-events: none; }

.cz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.cz-col-title {
  font-size: 13px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim); margin: 6px 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.cz-list { display: flex; flex-direction: column; gap: 9px; }
.cz-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 10px 10px 11px; text-align: left;
}
.cz-tile.locked { opacity: 0.52; }
.cz-tile.sel {
  box-shadow: 6px 6px 14px var(--shadow-dark), -4px -4px 10px var(--shadow-light),
              0 0 0 2px var(--green-dim), 0 0 16px var(--green-glow-soft);
}
/* Same 6:1 as the artwork, so a tile shows the banner whole — the framing
   lesson the league rows already learned. */
.cz-strip {
  position: relative; width: 100%; aspect-ratio: 1200 / 190;
  border-radius: 7px; overflow: hidden; background: var(--bg-2);
  display: grid; place-items: center;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}
.cz-strip.empty, .cz-ring.empty { background: var(--bg-2); }
.cz-strip .ico { width: 14px; height: 14px; opacity: 0.7; }
.cz-ring {
  position: relative; width: 100%; aspect-ratio: 1200 / 190;
  border-radius: 7px; background: var(--bg-2);
}
.cz-ring.has-outline { box-shadow: 0 0 12px var(--ol-glow); }
.cz-ring > .card-outline { border-radius: 7px; }
.cz-label { font-size: 12px; font-weight: 800; line-height: 1.25; }
.cz-hint { font-size: 10.5px; font-weight: 700; color: var(--text-faint); line-height: 1.3; }
.cz-hint.owned { color: var(--green-soft); }
/* "Cannot be bought" is a selling point, not a disclaimer — it is the only
   thing separating the rarest banners from the most expensive ones. */
.cz-hint.nobuy { color: #ffd54f; letter-spacing: 0.03em; text-transform: uppercase; font-size: 9.5px; font-weight: 900; }
.cz-tile.signature .cz-label { color: #ffd54f; }
.cz-tile.signature.locked { opacity: 0.72; }
/* ---------- Collector section ----------
   Full width under both columns, not a tile among the others. A thing with no
   route to it should not be filed next to seventeen things that have one. */
.cz-collector {
  margin-top: 22px;
  padding: 16px 14px 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 213, 79, .05), transparent 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 213, 79, .18);
}
.cz-collector.has { box-shadow: inset 0 0 0 1px rgba(255, 213, 79, .4), 0 0 26px rgba(255, 213, 79, .1); }
.cz-col-title.collector { color: #ffd54f; margin-top: 0; }
.cz-collector-sub {
  font-size: 11.5px; font-weight: 700; color: var(--text-faint);
  margin: -4px 0 12px; letter-spacing: .01em;
}
/* One item, shown large: the section exists to display it, not to list it. */
.cz-collector .cz-list { gap: 12px; }
.cz-collector .cz-strip { aspect-ratio: 1200 / 300; border-radius: 10px; }
.cz-collector .cz-label { font-size: 14px; color: #ffd54f; }
.cz-collector .cz-tile.locked { opacity: 0.6; }

.cz-buy-strip {
  position: relative; height: 30px; border-radius: 10px; overflow: hidden;
  background: var(--bg-2); margin: 0 auto 14px; max-width: 220px;
}
.cz-price {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 900; color: #6fd8ff;
}
.cz-price .ico { width: 13px; height: 13px; }
/* The ring being bought, shown at the top of the confirmation. */
.cz-buy-ring {
  position: relative; height: 44px; border-radius: 14px;
  background: var(--bg-2); margin: 0 auto 14px; max-width: 220px;
}
.cz-buy-ring > .card-outline { border-radius: 14px; }

.friend-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.friend-meta { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.follow-btn {
  padding: 7px 13px; border-radius: 12px;
  font-size: 12px; font-weight: 900;
  color: var(--green-soft);
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
}
.follow-btn.on { color: #04240f; background: var(--green); box-shadow: 0 0 12px var(--green-glow); }
.suggest-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; }
.suggest-card {
  min-width: 108px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 10px;
}
.suggest-avatar { font-size: 28px; }
.suggest-name { font-size: 12px; font-weight: 800; text-align: center; }

.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; gap: 12px; padding: 12px 14px; align-items: center; }
.feed-txt { font-size: 13.5px; line-height: 1.45; }
.feed-txt b { color: var(--green-soft); }
.feed-time { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.settings { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
/* Wraps rather than overflowing. The school-code row pairs a long label with
   an input and a button, and French labels run much longer than English
   ("Un code d'établissement ?" vs "School code"): without wrapping, the row
   pushed the Join button off-screen and made the whole page scroll sideways
   on iOS. min-width:0 is what actually lets the input shrink — flex items
   refuse to go below their content width otherwise. */
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px 12px;
  font-weight: 800; font-size: 14.5px;
}
.vol-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.setting-row .vol-wrap { flex: 1 1 auto; justify-content: flex-end; }
.setting-row .ob-input.slim { flex: 1 1 110px; min-width: 0; }
.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 150px; height: 8px; border-radius: 6px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  outline: none;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), var(--green));
  box-shadow: 0 0 12px var(--green-glow); cursor: pointer;
}
.vol-slider::-moz-range-thumb {
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: linear-gradient(145deg, var(--green-soft), var(--green));
  box-shadow: 0 0 12px var(--green-glow); cursor: pointer;
}
.neo-btn.slim { padding: 8px 12px; }
.vol-test { font-size: 15px; }

/* ============ Session ============ */
.session { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-top: calc(14px + env(safe-area-inset-top)); animation: fadeup 0.3s ease; }
.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.progress-track {
  flex: 1; height: 14px; border-radius: 10px;
  background: var(--bg-2);
  /* Contour : sans lui, la piste se confondait avec le fond et, à la première
     question, rien ne disait « où j'en suis ». */
  box-shadow: inset 0 0 0 2px var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 10px;
  background: var(--green);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
/* At 0% the fill has no width, but its box-shadow still rendered a
   floating glow blob near the left edge — looked like a rendering bug. */
.progress-fill.zero { box-shadow: none; }
.session-hearts { display: flex; gap: 2px; font-size: 15px; }
.heart.empty { opacity: 0.5; }
.session-mode-chip {
  font-size: 11px; font-weight: 900; letter-spacing: 0.06em;
  color: var(--green-soft); text-transform: uppercase;
  padding: 5px 10px; border-radius: 10px;
  background: var(--card-2); box-shadow: inset 2px 2px 5px var(--shadow-dark);
}

.session-body { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.q-prompt { font-size: 21px; font-weight: 900; line-height: 1.35; }
.q-prompt b { color: var(--green-soft); }

.play-big {
  align-self: center;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 30px;
  border-radius: 20px;
  font-size: 17px; font-weight: 900;
  color: var(--green-soft);
  box-shadow: 6px 6px 12px var(--shadow-dark);
}
.play-ico { font-size: 24px; }

.q-visual { display: flex; justify-content: center; }
.glyph-visual {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 40px;
  /* Sans ça la boîte se dimensionne sur son contenu et sort de la carte : une
     suite trop longue traversait l'écran. Le JS calcule déjà la bonne taille
     de police, ceci est le garde-fou si un cas lui échappe. */
  max-width: 100%; box-sizing: border-box;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--line);
}
.big-glyph { font-size: 64px; line-height: 1.1; text-align: center; max-width: 100%; overflow-wrap: break-word; text-shadow: none; }
.glyph-sub { font-size: 12px; color: var(--text-dim); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

/* Staff SVG */
.staff-svg {
  width: min(360px, 92vw);
  background: var(--bg-2);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--line);
  padding: 6px;
}
.staff-line { stroke: #56676e; stroke-width: 1.6; }
.staff-line.thick { stroke-width: 3; }
.clef { fill: #b9c9c3; }
.clef-img { opacity: 0.85; }
.clef-clair { display: none; }
.notehead { fill: var(--green-soft); filter: none; }
.stem { stroke: var(--green-soft); stroke-width: 2.4; }
.accidental { fill: var(--green-soft); font-weight: bold; }
.notehead.hl { fill: var(--gold); }

/* Options */
/* Everything flows from the top, slack falls at the bottom. One answer per
   full-width row rather than a 2×2 grid: each option gets the whole width, so
   a long answer no longer has to wrap inside a narrow half-column. */
/* The answers take whatever is left between the question and the pinned
   validate button, and split it evenly — five options on a staff question used
   to run underneath the button, and the last one could not be tapped at all.
   The floor is what a thumb needs; below it the page scrolls again rather than
   shrinking targets into uselessness. */
/* flex-basis auto with the default min-height: this grows to fill the gap on
   a roomy screen, but refuses to shrink under its own rows on a cramped one —
   so the page gains height and scrolls instead of hiding the last option under
   the button, which is unreachable however far you scroll. */
.q-answers { flex: 1 1 auto; display: flex; flex-direction: column; }
.opt-grid {
  display: grid; grid-template-columns: 1fr; gap: 10px;
  /* flex:1 rather than height:100% — a percentage height does not resolve
     against a parent whose own height came from flex-grow. */
  flex: 1 1 auto;
  grid-auto-rows: minmax(54px, 1fr);
}
/* Les options gardent le contour et la lèvre de .neo-btn : c'est l'écran qu'on
   regarde le plus, chaque réponse doit se détacher nettement du fond. */
.opt {
  font-size: 17px; text-align: center; position: relative;
  min-height: 0;
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: center;
}
.opt.sel {
  color: var(--green-soft);
  background: rgba(111, 207, 151, 0.12);
  box-shadow: inset 0 0 0 2px var(--green), 0 3px 0 var(--green-dim);
}
.opt.right {
  color: var(--ink) !important;
  background: var(--green);
  box-shadow: none;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.opt.wrong {
  color: #3a0d15 !important;
  background: var(--red-fill);
  box-shadow: none;
  animation: shake 0.4s;
}
@keyframes pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}
.shake { animation: shake 0.4s; }

/* Piano */
.piano {
  position: relative;
  display: flex;
  height: 190px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 8px 8px 16px var(--shadow-dark);
}
.pkey.white {
  flex: 1;
  margin: 0 2px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#e8f5ec, #c9dcd0);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px;
  color: #23392c;
  font-weight: 900; font-size: 13px;
  transition: transform 0.06s, background 0.15s;
}
.pkey.white:active { transform: translateY(2px); }
.pkey.black {
  position: absolute;
  top: 8px;
  width: 9%;
  height: 58%;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(#20281f, #0a0e0b);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 -5px 0 rgba(255, 255, 255, 0.05);
  z-index: 2;
}
.pkey.sel.white { background: #c9eed8; box-shadow: none; }
.pkey.sel.black { background: linear-gradient(#1d5c3a, #0e3320); box-shadow: none; }
.pkey.right.white, .pkey.right.black { background: var(--green) !important; box-shadow: none; }
.pkey.wrong.white, .pkey.wrong.black { background: linear-gradient(#ff8fa3, #e2314f) !important; box-shadow: none; }

/* Tiles */
.tiles-answer {
  min-height: 62px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 10px;
  border-radius: 16px;
  background: var(--card-2);
  box-shadow: inset 4px 4px 10px var(--shadow-dark);
}
.tiles-hint { color: var(--text-faint); font-size: 13px; font-weight: 700; }
.tiles-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 6px; }
.tile { font-size: 17px; font-weight: 900; padding: 12px 18px; }
.tile.used { opacity: 0.25; pointer-events: none; box-shadow: inset 4px 4px 8px var(--shadow-dark); }
.tile.picked { color: var(--green-soft); animation: pop 0.25s; }

/* Match pairs */
.match-box { display: flex; gap: 14px; justify-content: center; }
.match-col { display: flex; flex-direction: column; gap: 10px; flex: 1; max-width: 220px; }
.match-tile { font-size: 14.5px; font-weight: 800; padding: 12px 10px; text-align: center; }
.match-tile.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), 0 0 0 2px var(--green-dim);
}
.match-tile.matched {
  color: var(--ink);
  background: linear-gradient(160deg, var(--green-soft), var(--green));
  box-shadow: none;
  opacity: 0.55;
  pointer-events: none;
}
.match-tile.wrong {
  color: #fff;
  background: linear-gradient(160deg, #ff6b84, #e2314f);
  box-shadow: none;
  animation: shake 0.4s;
}

/* Singing */
.sing-box { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.sing-target { font-size: 15px; font-weight: 800; color: var(--text-dim); }
.sing-target b { color: var(--green-soft); font-size: 19px; }
.pitch-gauge { width: 100%; max-width: 380px; }
.gauge-track {
  position: relative;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(90deg, #2a1520, #131a15 35%, #10331f 47%, #10331f 53%, #131a15 65%, #2a1520);
  box-shadow: inset 5px 5px 10px var(--shadow-dark);
  overflow: hidden;
}
.gauge-center {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 3px; margin-left: -1.5px;
  background: var(--green);
  box-shadow: none;
}
.gauge-needle {
  position: absolute; top: 5px; bottom: 5px;
  left: 50%; width: 10px; margin-left: -5px;
  border-radius: 6px;
  background: #e8f5ec;
  box-shadow: none;
  opacity: 0.25;
  transition: left 0.09s linear, background 0.2s;
}
.gauge-needle.in-tune { background: var(--green-soft); box-shadow: none; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-weight: 800; margin-top: 6px; padding: 0 4px; }
.sing-note { font-size: 20px; font-weight: 900; color: var(--green-soft); min-height: 28px; }
.hold-ring {
  width: 100%; max-width: 380px; height: 10px;
  border-radius: 8px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  overflow: hidden;
}
.hold-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green-dim), var(--green)); box-shadow: none; border-radius: 8px; }
.sing-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sing-mic-btn.active { color: var(--green-soft); box-shadow: inset 5px 5px 10px var(--shadow-dark); }
.sing-status { font-size: 13px; color: var(--text-dim); font-weight: 700; text-align: center; min-height: 18px; }
/* Shown only when the microphone fails: the raw measurements, so a report says
   what actually happened instead of "it did not work". */
.sing-diag {
  font-size: 10.5px; letter-spacing: 0.02em;
  color: var(--text-faint); text-align: center; min-height: 14px;
  font-variant-numeric: tabular-nums;
}

/* Feedback footer */
/* Pinned to the bottom of the viewport rather than sitting after the answers:
   a staff question with five options pushed the button below the fold, and
   nobody should have to scroll to submit an answer they have already chosen.
   Sticky rather than fixed so it still sits in flow on short questions. */
.session-footer {
  position: sticky; bottom: 0; z-index: 10;
  padding: 18px 0 calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(transparent, var(--bg) 24%);
}
.feedback {
  border-radius: 18px;
  padding: 16px 18px;
  animation: slideup 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Des aplats teintés et un contour de la même couleur, plus de dégradé sombre :
   le bandeau dit juste ou faux par sa teinte, lisible d'un coup d'œil. */
.feedback.ok { background: #1c3328; box-shadow: inset 0 0 0 2px #2f5c43; }
.feedback.bad { background: #3a2229; box-shadow: inset 0 0 0 2px #6b3642; }
.feedback.skip { background: #3a3220; box-shadow: inset 0 0 0 2px #6b5a2e; }
.fb-head { font-size: 17px; font-weight: 900; }
.feedback.ok .fb-head { color: var(--green-soft); }
.feedback.bad .fb-head { color: var(--red); }
.fb-answer { margin-top: 6px; font-size: 14.5px; }
.fb-answer b { color: var(--green-soft); }
.fb-explain { margin-top: 6px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.fb-explain b { color: var(--text); }
@keyframes slideup { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ============ Results ============ */
.results {
  min-height: calc(100vh - 40px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 30px 0 40px;
  animation: fadeup 0.4s ease;
}
.results-hero { text-align: center; }
.results-emoji { font-size: 74px; animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); filter: none; }
.results-hero h1 { font-size: 30px; font-weight: 900; margin-top: 8px; }
.results-hero.failed .results-emoji { filter: none; }
.lesson-lottie { width: 340px; height: 340px; max-width: 88vw; max-height: 88vw; margin: 0 auto; }
.lesson-lottie svg { width: 100% !important; height: 100% !important; }
.results-sub { color: var(--text-dim); margin-top: 4px; font-weight: 700; }
.streak-hero { padding-top: 24px; }
.streak-flame { font-size: 130px; animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); filter: none; }
.streak-hero h1 { font-size: 34px; margin-top: 12px; }
.streak-hero .results-sub { font-size: 16px; margin-top: 8px; }
.stars { margin-top: 14px; font-size: 42px; letter-spacing: 8px; }
.star { color: #2a3a2f; display: inline-block; }
.star.lit {
  color: var(--gold);
  text-shadow: none;
  animation: starpop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes starpop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1); } }
.results-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.r-card { padding: 14px 22px; text-align: center; min-width: 92px; }
.r-label { font-size: 11px; font-weight: 900; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.r-value { font-size: 22px; font-weight: 900; color: var(--green-soft); margin-top: 3px; }
.streak-card .r-value { color: var(--gold); }
/* ---------- Banner reveal on the results screen ----------
   A banner is the only reward you keep and display to other players, so it
   is shown as artwork rather than announced in a line of text. A year banner
   gets the same gold ring the carrier's card will wear. */
.banner-earned {
  margin: 12px 0;
  animation: slideup 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.banner-earned-art {
  position: relative;
  height: 74px; border-radius: 16px; overflow: hidden;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.banner-earned.tier .banner-earned-art {
  box-shadow: 0 0 0 2px rgba(255, 213, 79, 0.6);
}
.banner-earned-txt {
  margin-top: 8px; text-align: center;
  font-size: 14px; font-weight: 800; color: var(--text-dim);
}
.banner-earned-txt b { color: var(--green-soft); }
.banner-earned.tier .banner-earned-txt b { color: var(--gold); }

.levelup, .badge-earned {
  text-align: center; padding: 13px 16px;
  font-size: 14.5px; font-weight: 800;
  animation: fadeup 0.5s ease both;
  box-shadow: 6px 6px 14px var(--shadow-dark);
}
.levelup b, .badge-earned b { color: var(--green-soft); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 7, 5, 0.75);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: min(420px, 100%);
  padding: 26px;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal h3 { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; justify-content: center; }
.modal-actions.column { flex-direction: column; }
.modal-hearts { font-size: 54px; }
.lesson-pop-emoji { font-size: 54px; filter: none; }
.pop-chapter { font-weight: 800; }
.pop-xp { color: var(--green-soft) !important; font-weight: 900; margin-top: 6px; }

/* ============ Toasts ============ */
#toasts {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 10px;
  width: min(400px, calc(100vw - 30px));
  pointer-events: none;
}
.toast {
  padding: 13px 18px;
  font-size: 14px; font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 8px 8px 18px var(--shadow-dark);
}
.toast.show { opacity: 1; transform: none; }

/* ============ Confetti canvas ============ */
#confetti {
  position: fixed; inset: 0;
  z-index: 80;
  pointer-events: none;
  display: none;
}

/* ============ Small screens ============ */
@media (max-width: 460px) {
  .stats-grid, .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .q-prompt { font-size: 18px; }
  .node-row { width: 110px; }
}

/* ============ Scrollbars ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1d2b21; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ============================================================
   SVG icon set — sizing & animations
   ============================================================ */
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }

/* Immobiles : une flamme qui vacille, un cœur qui bat et un éclair qui pulse en
   permanence, c'est trois choses qui bougent sans que rien ne se passe. */
.ico-flame { transform-origin: 50% 88%; }
@keyframes ico-flicker {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.06, 0.95) rotate(-2.5deg); }
  60% { transform: scale(0.96, 1.05) rotate(2deg); }
}
.ico-gem .glint, .ico-trophyC .glint { opacity: 0.55; }
@keyframes ico-glint {
  0%, 55%, 100% { opacity: 0; }
  65%, 82% { opacity: 1; }
}
.ico-heart { transform-origin: center; }
@keyframes ico-beat {
  0%, 24%, 100% { transform: scale(1); }
  8% { transform: scale(1.14); }
  16% { transform: scale(0.98); }
}
@keyframes ico-bolt {
  0%, 100% { filter: none; }
  50% { filter: none; }
}
.ico-note { transform-origin: center; }
@keyframes ico-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-1.5px) rotate(-4deg); }
}
.ico-flag .pennant { transform-origin: 30% 30%; }
@keyframes ico-wave {
  0%, 100% { transform: skewY(0); }
  50% { transform: skewY(-4deg); }
}
.ico-star { filter: none; }
.ico-speaker .arc { opacity: 0.4; }
.playing .ico-speaker .a1, .play-big:active .ico-speaker .a1 { animation: ico-arc 0.9s ease-in-out infinite; }
.playing .ico-speaker .a2, .play-big:active .ico-speaker .a2 { animation: ico-arc 0.9s ease-in-out 0.2s infinite; }
@keyframes ico-arc { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Icon sizing in specific slots */
.node-ico .ico { width: 1em; height: 1em; }
.node-ico { display: inline-flex; font-size: 32px; }
.node.boss .node-ico { font-size: 46px; }
.stat-n .ico { width: 19px; height: 19px; }
.lr-rank .ico { width: 24px; height: 24px; }
.league-shield .ico { width: 46px; height: 46px; }
.play-ico .ico { width: 24px; height: 24px; }
.shop-item .ico { width: 20px; height: 20px; }
.heart .ico { width: 17px; height: 17px; }
.session-hearts { align-items: center; }
.r-value .ico { width: 20px; height: 20px; }
.sing-mic-btn .ico, .placement-btn .ico { width: 18px; height: 18px; }

/* ============ Onboarding additions ============ */
.ob-hint { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.inst-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.inst-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px;
  font-size: 11px; font-weight: 800;
  color: var(--text-dim);
}
.inst-pick .inst-emoji { font-size: 22px; }
.inst-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark),
    0 0 0 2px var(--green-dim);
}
.name-pick { flex: 1; text-align: center; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.name-pick b { color: var(--text); font-size: 14px; }
.name-pick.sel {
  color: var(--green-soft);
  box-shadow: inset 5px 5px 10px var(--shadow-dark);
}
.name-pick.sel b { color: var(--green-soft); }
.placement-btn { text-align: center; color: var(--text-dim); font-size: 14px; }
.placement-btn b { color: var(--gold); }
.theme-toggle { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 5; }
.onboard { position: relative; }
.place-chip {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 20px;
  font-size: 15px; font-weight: 800;
  color: var(--text-dim);
}
.place-chip b { color: var(--green-soft); }

/* ============ Rhythm tap game ============ */
.tap-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rhythm-display {
  display: flex; align-items: stretch;
  width: 100%; max-width: 460px;
  padding: 14px 18px;
  gap: 6px;
}
.r-cell {
  flex-basis: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  padding: 8px 2px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.r-glyph { display: grid; place-items: center; }
.time-sig {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-right: 12px; margin-right: 6px;
  border-right: 2px solid var(--text-faint);
  font-size: 22px; font-weight: 900; line-height: 1.15;
  color: var(--green-soft);
  text-shadow: none;
}
.r-note { width: 34px; height: 54px; }
.big-glyph .big-note { width: 64px; height: 84px; }
.big-note.r-note { width: 64px; height: 84px; }
.big-note .r-head.open { stroke-width: 3; }
.big-note .r-stem { stroke-width: 3; }
.guide-glyph-row { display: flex; gap: 14px; justify-content: center; align-items: flex-end; }
.guide-glyph-row .big-note { width: 40px; height: 56px; }
.r-head { fill: var(--green-soft); stroke: var(--green-soft); }
.r-head.open { fill: none; stroke-width: 2.6; }
.r-stem, .r-flag, .r-dot { stroke: var(--green-soft); fill: var(--green-soft); stroke-width: 2.4; }
.r-rest { stroke: var(--green-soft); fill: none; }
.r-rest-fill { fill: var(--green-soft); stroke: none; }
.r-cell.rest .r-rest, .r-cell.rest .r-stem { stroke: var(--text-faint); }
.r-cell.rest .r-rest-fill { fill: var(--text-faint); }
.r-cell.now { background: rgba(111, 207, 151, 0.12); box-shadow: inset 0 0 0 1.5px var(--green-dim); transform: scale(1.08); }
.r-cell.now .r-head, .r-cell.now .r-stem, .r-cell.now .r-flag, .r-cell.now .r-dot { stroke: var(--gold); }
.r-cell.now .r-head:not(.open), .r-cell.now .r-stem, .r-cell.now .r-flag, .r-cell.now .r-dot { fill: var(--gold); }
.count-dots { display: flex; gap: 10px; }
.cdot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card-2);
  box-shadow: inset 2px 2px 4px var(--shadow-dark);
  transition: background 0.1s, box-shadow 0.1s;
}
.cdot.on { background: var(--green); box-shadow: none; }
.tap-pad {
  width: 158px; height: 158px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; letter-spacing: 0.12em;
  color: var(--text-dim);
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: 9px 9px 18px var(--shadow-dark);
  transition: transform 0.05s, box-shadow 0.2s, color 0.2s;
  touch-action: manipulation;
  user-select: none;
}
.tap-pad.live {
  color: var(--green-soft);
  box-shadow: 9px 9px 18px var(--shadow-dark),
    0 0 0 3px rgba(111, 207, 151, 0.5);
}
.tap-pad:disabled { cursor: default; }
.tap-pad:not(:disabled):active, .tap-pad.hit {
  transform: scale(0.93);
  box-shadow: inset 7px 7px 14px var(--shadow-dark);
}
.tap-pad.hit { animation: padhit 0.18s ease-out; }
@keyframes padhit {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ============ Flash reading (timed memorize, then play) ============ */
.flash-box { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.flash-stage {
  width: 100%; max-width: 460px;
  display: flex; justify-content: center;
  padding: 10px 4px;
  overflow: hidden;
}
.flash-visual { transition: opacity 0.25s, filter 0.25s; }
.flash-visual.hidden { opacity: 0; filter: blur(10px); pointer-events: none; }
.flash-timer {
  width: 100%; max-width: 300px; height: 8px;
  border-radius: 6px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 6px var(--shadow-dark);
  overflow: hidden;
}
.flash-timer-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: none;
  border-radius: 6px;
}
.flash-picked {
  min-height: 40px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
}
.flash-note-chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--green-soft), var(--green));
  color: var(--ink);
  font-weight: 900; font-size: 15px;
  box-shadow: none;
  animation: pop 0.25s;
}
.flash-piano { width: 100%; }

/* ============================================================
   Zones d'exercice des années 2 et 3
   ============================================================ */
/* Elles avaient leur propre fond : vert plus profond, lavis, texture de circuit
   imprimé, liseré doré autour du bouton. Retirés avec le néon — pendant une
   question, la seule chose à regarder est la question. */
body.tier2-zone, body.tier3-zone { background: var(--bg); }

.tier-badge-big { position: relative; width: 140px; height: 140px; margin: 0 auto 18px; display: grid; place-items: center; }
.tier-badge-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 8px var(--green); }
.tier-badge-big.tier3 .tier-badge-ring { box-shadow: inset 0 0 0 8px var(--gold-fill); }
.tier-badge-num { position: relative; font-size: 56px; font-weight: 900; color: var(--text); }

/* ============================================================
   Light theme
   ============================================================ */
/* The light theme used to tint everything green — background, cards and path
   nodes all sat in the same pale mint, so nothing could stand out and green
   had no room left to act as an accent. The ground is now near-neutral and
   the cards are white; green is spent only where it means something. */
body.theme-light {
  --bg: #f6f9f7;
  --chrome: rgba(246, 249, 247, 0.72);
  --bg-2: #edf2ef;
  --card: #ffffff;
  --card-2: #ffffff;
  --line: #e1e8e4;
  --shadow-dark: transparent;
  --shadow-light: transparent;
  --green: #5cc58a;
  --green-soft: #2e9a60;      /* vert d'écriture : le pastel ne se lit pas sur blanc */
  --green-dim: #43a870;
  --green-glow: transparent;
  --green-glow-soft: transparent;
  --ink: #0f2a1b;
  --card-green: #7fd3a4;
  --card-green-deep: #5db787;
  --card-green-ink: #0f2a1b;
  --text: #1c2a23;
  --text-dim: #5a6b63;
  --text-faint: #8b9b93;
  --gold: #9a6c00;
  --gold-fill: #f4cd76;
  --gold-deep: #d6a64a;
  --gold-ink: #3a2a06;
  --red: #d8365a;
  --red-fill: #ff97a4;
  --red-glow: transparent;
  background: var(--bg);
}
body.theme-light .btn-primary { color: #03301a; }

/* Plus de recette propre au thème clair pour les surfaces : aplats, contours de
   2px et lèvres sont ceux du thème sombre, seuls les jetons changent. Il ne
   reste ici que ce qu'un jeton ne peut pas dire. */
/* The HUD numbers were picked for a dark ground. On white the same pastels are
   smudges, so light theme takes the dark end of each hue. */
body.theme-light #hud-streak.lit b { color: #c05f00; }
body.theme-light #hud-gems b { color: #00718f; }
body.theme-light #hud-hearts b { color: #c11f42; }
body.theme-light #hud-xp b { color: #8c6400; }
body.theme-light .avatar-pick,
body.theme-light .ob-input {
  box-shadow:
    inset 0 0 0 1px rgba(20, 45, 32, 0.12);
}
body.theme-light .feedback.ok { background: #e3f6ea; box-shadow: inset 0 0 0 2px #bfe6cd; }
body.theme-light .feedback.ok .fb-head { color: #1f8a52; }
body.theme-light .feedback.bad { background: #fde6ea; box-shadow: inset 0 0 0 2px #f5c3cc; }
body.theme-light .feedback.bad .fb-head { color: #b8224a; }
body.theme-light .feedback.skip { background: #fbf1d6; }
/* Surfaces whose colour was hard-coded for the dark theme but whose text is
   themed: on light they turned into dark ink on a dark card. */
/* Recessed wells only read as recessed against a darker ground. On light the
   track was lighter than the page, so at question one there was no sense of
   "how far in am I". Real well: tinted floor plus a hairline rim. */
/* The flash exercise sits its visual on a .neo stage. Once the staff became
   white paper, that was a white card inside a white card. The stage turns
   into a grey tray so the paper reads as sitting on something. */
body.theme-light .flash-stage {
  background: var(--bg-2);
  box-shadow: inset 0 0 0 2px var(--line);
}
body.theme-light .flash-timer {
  background: #d7e2db;
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.13);
}
body.theme-light .flash-timer-fill { box-shadow: none; }
body.theme-light .flash-note-chip { color: #ffffff; box-shadow: none; }
body.theme-light .ce-bar { background: #d7e2db; box-shadow: none; }
body.theme-light .react-btn { background: #eef2f0; box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.12); }
body.theme-light .cf-row + .cf-row { box-shadow: inset 0 1px 0 rgba(20, 45, 32, 0.10); }
body.theme-light .path-jump {
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.14);
}
body.theme-light .quest-claim { color: var(--ink); box-shadow: 0 3px 0 var(--green-dim); }
body.theme-light .quest-claim:active { box-shadow: 0 1px 0 var(--green-dim); }
body.theme-light .q-reward-chip { background: rgba(3, 48, 26, 0.16); }
body.theme-light .tab.has-dot .tab-icon::after { box-shadow: 0 0 0 2px var(--bg); }
body.theme-light .fly-gems .ico { filter: none; }
body.theme-light .fly-xp .ico { filter: none; }
body.theme-light .fly-hearts .ico { filter: none; }
body.theme-light .progress-track {
  background: #d7e2db;
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.13);
}
body.theme-light .quest-track {
  background: #d7e2db;
  box-shadow: none;
}
body.theme-light .fact-card {
  background: #eef8f2;
  box-shadow: inset 0 0 0 2px #cfeadb;
}
body.theme-light .fact-badge { color: #0b7a3d; text-shadow: none; }
body.theme-light .review-label, body.theme-light .review-stars { color: #a97600; }
body.theme-light .league-row.prestige,
body.theme-light .member-row.prestige {
  box-shadow: 6px 6px 14px var(--shadow-dark),
    0 0 0 2px rgba(176, 125, 0, 0.6);
}
body.theme-light .league-row.me.prestige,
body.theme-light .member-row.me.prestige {
  box-shadow: 6px 6px 14px var(--shadow-dark),
    0 0 0 2px rgba(176, 125, 0, 0.65),
    0 0 0 4px var(--green-dim);
}
body.theme-light .profile-head.prestige {
  box-shadow: 8px 8px 18px var(--shadow-dark),
    0 0 0 2px rgba(176, 125, 0, 0.55);
}
/* ---- Outlines in the light theme ----
   Two separate corrections. The glow has to be re-declared because the light
   `.neo` shadow is a different recipe entirely, with a hairline ring that must
   survive; and a ring is only a ring if it is darker than what it encloses, so
   the outlines built around a white or pale-gold crest get that stop replaced
   rather than merely dimmed. */
body.theme-light .profile-head.has-outline {
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.11);
}
body.theme-light .league-row.has-outline, body.theme-light .member-row.has-outline {
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.11);
}
body.theme-light .league-row.me.has-outline, body.theme-light .member-row.me.has-outline {
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.11),
    0 0 0 3px var(--green-dim);
}
body.theme-light .cz-tile.sel {
  box-shadow: 0 0 0 2px var(--green-dim);
}
body.theme-light .ol-gold { --ol-glow: rgba(176, 125, 0, 0.28); --ol-spark: #9a6f00; }
body.theme-light .ol-gold > .card-outline {
  background: linear-gradient(115deg, #6b4a00, #c99700 30%, #ffd54f 48%, #c99700 66%, #6b4a00);
}
body.theme-light .ol-frost { --ol-glow: rgba(30, 130, 200, 0.32); --ol-spark: #2b8fc4; }
body.theme-light .ol-frost > .card-outline {
  background:
    linear-gradient(96deg, transparent 18%, rgba(255, 255, 255, 0.55) 50%, transparent 82%),
    linear-gradient(110deg, #10405f, #2b9bd8 24%, #8fd8ff 50%, #2b9bd8 76%, #10405f);
  background-size: 300% 100%, 240% 100%;
}
body.theme-light .ol-volt { --ol-glow: rgba(0, 150, 190, 0.34); --ol-spark: #0d8fb0; }
body.theme-light .ol-volt > .card-outline {
  background: repeating-linear-gradient(100deg,
    #04303f 0 8px, #0d9dc4 8px 13px, #7fe6ff 13px 16px, #0d9dc4 16px 21px, #04303f 21px 34px);
  background-size: 200% 100%;
}
/* Sparks follow the same rule as the rings: a pale glyph on a white card is
   not a glyph. Only the colour changes — the motion is the motion. */
body.theme-light .ol-fire { --ol-glow: rgba(214, 80, 0, 0.36); --ol-spark: #d24800; }
/* The three escaping outlines all peak at near-white, which is the one colour
   a white card cannot show. Only the halos and the comet's own dots need
   restating — the rings underneath are already mid-tone. */
body.theme-light .ol-solar { --ol-glow: rgba(190, 132, 0, 0.4); --ol-spark: #a87400; }
body.theme-light .ol-solar > .card-halo {
  background: linear-gradient(115deg, rgba(190, 132, 0, 0), rgba(226, 158, 20, .7) 28%,
              rgba(246, 190, 60, .95) 50%, rgba(226, 158, 20, .7) 72%, rgba(190, 132, 0, 0));
  background-size: 300% 100%;
}
body.theme-light .ol-wave { --ol-glow: rgba(0, 130, 180, 0.38); --ol-spark: #0d7fa6; }
body.theme-light .ol-wave > .card-halo {
  background: linear-gradient(110deg, rgba(0, 145, 200, .8), rgba(60, 190, 235, .95) 50%, rgba(0, 145, 200, .8));
}
body.theme-light .ol-comet { --ol-glow: rgba(0, 120, 190, 0.36); --ol-spark: #0b6f9c; }
body.theme-light .ol-comet > .card-halo i {
  background: #0d5f88;
  box-shadow: none;
}
body.theme-light .ol-aurora { --ol-glow: rgba(110, 70, 210, 0.34); --ol-spark: #6a4fd0; }
body.theme-light .ol-prism { --ol-glow: rgba(120, 90, 200, 0.30); --ol-spark: #7a5fd0; }

/* ---- Signature banners in the light theme ----
   Only the two built on "bright against dark" need saying again. Éclipse was
   the worst of it: its corona is near-white, so on a white card the halo
   vanished and all that was left was the occluder — a grey blob floating over
   nothing. It becomes a diagram instead of a night sky: an amber corona and a
   deep occluder, both darker than the paper. The other three are transparent
   greens and golds, which were already legible on either ground. */
body.theme-light .bn-eclipse::before {
  background:
    radial-gradient(1.6px 1.6px at 9% 26%, rgba(30, 60, 46, .5), transparent),
    radial-gradient(1.4px 1.4px at 27% 74%, rgba(30, 60, 46, .38), transparent),
    radial-gradient(1.6px 1.6px at 78% 22%, rgba(30, 60, 46, .45), transparent),
    radial-gradient(1.4px 1.4px at 92% 68%, rgba(30, 60, 46, .38), transparent),
    radial-gradient(ellipse 9% 54% at 50% 50%,
      rgba(214, 132, 0, .95) 0 58%, rgba(226, 158, 30, .7) 66%,
      rgba(232, 176, 70, .34) 78%, rgba(236, 190, 100, .12) 90%, transparent 99%);
  background-repeat: no-repeat;
  background-position: 9% 26%, 27% 74%, 78% 22%, 92% 68%, 50% 50%;
}
body.theme-light .bn-eclipse::after {
  background: radial-gradient(ellipse 20% 48% at 50% 50%, #16241d 0 76%, rgba(22, 36, 29, .55) 84%, transparent 96%);
  background-repeat: no-repeat;
  background-size: 40% 100%;
}
/* Fondateur in the light theme. The wood already carries its own value, so
   only the plinth is lifted — a dark panel at 0.6 opacity over white turns to
   mud, and this one has to stay a piece of furniture. */
body.theme-light .bn-founder::before {
  background:
    repeating-linear-gradient(180deg, rgba(92, 52, 14, .38) 0 1px, transparent 1px 9px),
    linear-gradient(90deg, rgba(255, 255, 255, .45), transparent 22%, transparent 62%, rgba(255, 255, 255, .3)),
    repeating-linear-gradient(180deg,
      #b07a3e 0 18px, #c48c4c 18px 27px, #a06c30 27px 45px,
      #cb9558 45px 63px, #a97438 63px 81px, #bd854799 81px 90px);
  background-size: 100% 9px, 100% 100%, 100% 90px;
}
body.theme-light .bn-founder::after {
  background:
    repeating-linear-gradient(90deg, rgba(60, 30, 0, .13) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(180deg, rgba(60, 30, 0, .09) 0 1px, transparent 1px 9px);
}

body.theme-light .bn-horizon::before {
  background:
    radial-gradient(1.6px 1.6px at 12% 24%, rgba(30, 60, 46, .45), transparent),
    radial-gradient(1.4px 1.4px at 31% 13%, rgba(30, 60, 46, .35), transparent),
    radial-gradient(1.7px 1.7px at 54% 28%, rgba(30, 60, 46, .42), transparent),
    radial-gradient(1.4px 1.4px at 73% 11%, rgba(30, 60, 46, .32), transparent),
    radial-gradient(1.6px 1.6px at 89% 26%, rgba(30, 60, 46, .4), transparent),
    radial-gradient(ellipse 34% 82% at 22% 122%, rgba(30, 110, 180, .4) 0 60%, transparent 64%),
    radial-gradient(ellipse 40% 96% at 64% 126%, rgba(0, 140, 96, .45) 0 60%, transparent 64%),
    radial-gradient(ellipse 46% 108% at 38% 132%, rgba(0, 82, 60, .6) 0 60%, transparent 64%);
  background-size: 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%;
}

body.theme-light .banner-earned.tier .banner-earned-art {
  box-shadow: 0 0 0 2px rgba(176, 125, 0, 0.6);
}

/* Un jalon verrouillé est un disque gris clair sur fond blanc, et son cadenas
   repasse à l'encre sombre : le gris clair du thème sombre y serait invisible. */
body.theme-light .node.lock { --lip: #cfd8d3; background: #e3e9e6; }
body.theme-light .node.lock .node-ico { filter: brightness(0); opacity: 0.28; }
/* White paper and dark staff lines, but the notation itself stays green: the
   wash-out was green-on-green, not green as such, and on white paper the same
   ink reads cleanly. Gold still marks the note the question is about. */
body.theme-light .staff-svg {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.14);
}
body.theme-light .staff-line { stroke: #1f2d25; stroke-width: 1.4; }
body.theme-light .staff-line.thick { stroke-width: 3; }
body.theme-light .clef { fill: var(--green-soft); }
body.theme-light .clef-sombre { display: none; }
body.theme-light .clef-clair { display: inline; }
body.theme-light .clef-img { opacity: 1; }
/* The glow was built to bloom on black; on white it only smears the edge. */
body.theme-light .notehead, body.theme-light .accidental { fill: var(--green-soft); filter: none; }
body.theme-light .stem { stroke: var(--green-soft); }
body.theme-light .notehead.hl { fill: #a86f00; filter: none; }
/* White keys on a white card had nothing to sit in and no edges between them.
   A real keyboard is white keys in a dark case with hairline gaps — which is
   also the only arrangement where white-on-white reads. */
body.theme-light .piano {
  background: linear-gradient(145deg, #2b3a33, #1d2823);
  box-shadow: inset 0 0 0 1px rgba(20, 45, 32, 0.30);
}
body.theme-light .pkey.white {
  background: linear-gradient(#ffffff, #eef2ef);
  color: #2a4433;
  box-shadow: inset 0 -6px 0 rgba(20, 45, 32, 0.16), inset 0 0 0 1px rgba(20, 45, 32, 0.28);
}
body.theme-light .pkey.black {
  background: linear-gradient(#2f3a35, #0c110f);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 -5px 0 rgba(255, 255, 255, 0.08);
}
body.theme-light .pkey.sel.white { background: linear-gradient(#b8f5d5, #4fd68f); }
body.theme-light .pkey.sel.black { background: linear-gradient(#1d5c3a, #0e3320); }
body.theme-light .gauge-track { background: linear-gradient(90deg, #f0dbe0, #e9f4ed 35%, #d3f2e0 47%, #d3f2e0 53%, #e9f4ed 65%, #f0dbe0); }
body.theme-light .gauge-needle { background: #355442; box-shadow: none; }
body.theme-light .gauge-needle.in-tune { background: #00c853; }
body.theme-light .star { color: #cfe0d5; }
body.theme-light .modal-overlay { background: rgba(220, 235, 225, 0.72); }
body.theme-light .ico-heartEmpty path { stroke: #b8cbbe; }
body.theme-light ::-webkit-scrollbar-thumb { background: #b8cec0; }
body.theme-light .logo-word { text-shadow: none; }
body.theme-light .tiles-hint, body.theme-light .empty-note, body.theme-light .sim-note { color: #7d998a; }

/* ============================================================
   Cloud: auth, club gate, create-club, account box
   ============================================================ */
.club-loading { padding: 40px; text-align: center; font-size: 32px; opacity: 0.7; }
.club-gate { padding: 30px 24px; text-align: center; margin-top: 10px; }
.club-gate .gate-emoji { font-size: 52px; filter: none; }
.club-gate .gate-emoji .ico { width: 52px; height: 52px; }
.league-solo { text-align: center; margin: 6px 0 16px; }
.club-gate h2 { font-size: 20px; font-weight: 900; margin: 10px 0 6px; }
.club-gate p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.club-gate .btn-primary { max-width: 320px; margin: 0 auto; }

.cc-emoji-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.cc-emoji {
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
  background: var(--card-2);
  box-shadow: inset 3px 3px 7px var(--shadow-dark);
  transition: transform 0.12s, box-shadow 0.2s;
}
.cc-emoji.sel { transform: scale(1.1); box-shadow: 0 0 0 2px var(--green); }

.account-box { gap: 12px; }
.account-row { font-weight: 800; font-size: 14px; }
.account-sync { font-size: 12.5px; color: var(--green-soft); font-weight: 700; }
.account-box .btn-primary, .account-box .neo-btn { width: 100%; }

/* ============================================================
   Guide (theory handbook)
   ============================================================ */
.guide-page { animation: fadeup 0.35s ease; }
.guide-chapter { margin-bottom: 14px; }
.guide-head {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  text-align: left;
}
.guide-emoji { font-size: 26px; filter: none; }
.guide-ch-title { flex: 1; font-size: 16px; font-weight: 900; }
.guide-caret { color: var(--green-soft); font-size: 15px; transition: transform 0.25s; }
.guide-chapter.open .guide-caret { transform: rotate(180deg); }

/* Mind-map feel: cards hang off a connector line under the chapter node */
.guide-cards {
  display: none;
  flex-direction: column; gap: 12px;
  margin: 12px 0 4px 24px;
  padding-left: 20px;
  border-left: 2px dashed rgba(111, 207, 151, 0.28);
}
.guide-chapter.open .guide-cards { display: flex; animation: fadeup 0.3s ease; }
.guide-card { padding: 16px 18px; position: relative; }
.guide-card::before {
  content: ''; position: absolute; left: -22px; top: 26px;
  width: 16px; height: 2px; background: rgba(111, 207, 151, 0.28);
}
.guide-card-title { font-size: 15px; font-weight: 900; color: var(--green-soft); margin-bottom: 10px; }
.guide-visual { display: flex; justify-content: center; margin: 6px 0 12px; }
.guide-visual .staff-svg { width: min(300px, 80vw); }
.guide-points { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.guide-points li {
  position: relative; padding-left: 18px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.guide-points li::before {
  content: '♪'; position: absolute; left: 0; top: 0;
  color: var(--green-dim); font-size: 12px;
}
.guide-points b { color: var(--green-soft); }
.guide-points i { color: var(--text-dim); font-style: italic; }

/* mini labelled keyboard */
.guide-kb {
  position: relative; display: flex; height: 96px;
  width: min(300px, 82vw); padding: 6px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: inset 4px 4px 10px var(--shadow-dark);
}
.gk-white {
  flex: 1; margin: 0 1.5px; border-radius: 0 0 6px 6px;
  background: linear-gradient(#e8f5ec, #c9dcd0);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px;
  color: #23392c; font-weight: 900; font-size: 11px;
}
.gk-black {
  position: absolute; top: 6px; width: 9%; height: 56%;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(#20281f, #0a0e0b); z-index: 2;
}
body.theme-light .gk-white { background: linear-gradient(#ffffff, #e9f0ea); }

/* 6-tab bar: tighten a touch so labels fit */
#tabbar .tab { padding-left: 2px; padding-right: 2px; }
.tab-label { font-size: 10.5px; }
@media (max-width: 460px) {
  .tab-label { font-size: 9.5px; letter-spacing: 0; }
  .tab-icon .ico { width: 20px; height: 20px; }
}

.ob-signin-row { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--text-dim); }
.ob-signin-link {
  color: var(--green-soft); font-weight: 900; font-size: 13.5px;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.ob-signin-link:hover { color: var(--green); }
#delete-account { margin-top: 4px; opacity: 0.9; }

/* ============ Écran de cadeau ============
   Deux temps plutôt qu'un : une boîte fermée qu'on touche, puis ce qu'il y
   avait dedans. Une récompense déjà apparue quand on lève les yeux est une
   notification ; une qu'on ouvre est un moment. */
.gift-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 18px;
}
.gift-stage { width: 100%; max-width: 420px; text-align: center; }

/* La boîte. Pas d'image : un couvercle, un corps, un ruban, et une attente
   qui respire pour dire « touche-moi » sans l'écrire. */
.gift-box {
  position: relative; width: 132px; height: 118px; margin: 0 auto;
  animation: giftIdle 2.4s ease-in-out infinite;
}
.gift-box .gb-body {
  position: absolute; left: 6px; right: 6px; bottom: 0; height: 78px;
  border-radius: 10px;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-dim);
}
.gift-box .gb-lid {
  position: absolute; left: 0; right: 0; top: 22px; height: 26px;
  border-radius: 8px;
  background: var(--green-soft);
  box-shadow: 0 4px 0 var(--green-dim);
  transform-origin: 50% 100%;
  transition: transform .5s cubic-bezier(.34, 1.6, .64, 1), opacity .5s ease;
  z-index: 2;
}
.gift-box .gb-ribbon {
  position: absolute; left: 50%; top: 22px; bottom: 0; width: 16px;
  margin-left: -8px; border-radius: 3px;
  background: var(--gold-fill);
  box-shadow: none;
  z-index: 3;
  transition: opacity .35s ease;
}
@keyframes giftIdle {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-7px) rotate(1.5deg); }
}
.gift-box:active { transform: scale(.95); }
/* Le couvercle décolle et part en tournant ; le ruban s'efface avec lui. */
.gift-box.open { animation: none; }
.gift-box.open .gb-lid { transform: translateY(-64px) rotate(-22deg); opacity: 0; }
.gift-box.open .gb-ribbon { opacity: 0; }
.gift-box.open .gb-body { animation: giftBurst .55s cubic-bezier(.34, 1.6, .64, 1); }
@keyframes giftBurst {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12, .9); }
  100% { transform: scale(1); }
}

.gift-reveal { animation: fadeup .45s ease; }
.gift-title { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
/* Le mot personnel : c'est la partie qui compte, elle a droit à de l'air. */
.gift-msg {
  font-size: 14.5px; line-height: 1.55; color: var(--text-dim);
  margin: 0 auto 22px; max-width: 340px;
}
.gift-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 10px; text-align: left;
  animation: fadeup .4s ease backwards;
  animation-delay: calc(var(--i) * .12s + .1s);
}
.gi-icon { font-size: 20px; display: inline-flex; }
.gi-icon .ico { width: 20px; height: 20px; }
.gi-label { font-size: 14px; font-weight: 800; flex: 1; }
/* La bannière offerte se montre en vrai, et sur toute la largeur : à côté du
   libellé elle n'avait que 40 % de la carte, ce qui rognait l'artwork — c'est
   le seul endroit où on la découvre, elle mérite la place. */
.gi-art {
  position: relative; width: 100%; margin-top: 6px;
  aspect-ratio: 1200 / 190; border-radius: 8px; overflow: hidden;
  background: var(--bg-2);
}
.gift-actions { margin-top: 18px; }

/* ---- Bouton de partage ---- */
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 13px 16px; margin-bottom: 18px;
  font-size: 14.5px; font-weight: 900; color: var(--green-soft);
}
.share-btn .ico { width: 18px; height: 18px; }
.share-btn:disabled { opacity: .55; }

/* ============ Écrans de moment ============
   Badge, bannière, série, année : un écran chacun, tous bâtis pareil pour
   qu'ils se suivent sans que rien ne saute d'un écran à l'autre. */
.moment {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 22px;
  animation: fadeup .4s ease;
}
/* L'emoji du badge : il arrive en grandissant, comme le couvercle du cadeau
   qui décolle — c'est le même moment, il mérite le même traitement. */
.moment-art {
  font-size: 96px; line-height: 1; margin-bottom: 22px;
  filter: none;
  animation: momentPop .6s cubic-bezier(.34, 1.6, .64, 1);
}
@keyframes momentPop {
  0%   { transform: scale(.3) rotate(-14deg); opacity: 0; }
  60%  { transform: scale(1.14) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
/* La bannière au format de l'artwork, grande : c'est ici qu'on la découvre. */
.moment-banner {
  position: relative; width: 100%; max-width: 420px;
  aspect-ratio: 1200 / 190; border-radius: 14px; overflow: hidden;
  background: var(--bg-2); margin-bottom: 24px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.moment-banner.tier { box-shadow: 0 0 0 2px rgba(255, 213, 79, .55); }
.moment-kicker {
  font-size: 12.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-soft); margin-bottom: 8px;
}
.moment-name { font-size: 30px; font-weight: 900; margin-bottom: 10px; }
.moment-sub {
  font-size: 14.5px; line-height: 1.5; color: var(--text-dim);
  max-width: 340px; margin-bottom: 30px;
}
.moment-actions { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.moment-actions .share-btn { margin-bottom: 0; }

/* ---------- Reactions received ----------
   Your own row could never hold buttons — the database forbids clapping
   yourself — so the slot sat empty and you never saw the half of the exchange
   that was about you. Deliberately not buttons: nothing here is pressable,
   and it should not look like it is. */
.react-bar.got { gap: 6px; }
.react-got {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 13px; line-height: 1;
  opacity: 0.95;
}
.react-got b { font-size: 10.5px; font-weight: 900; color: var(--green-soft); }
.react-none { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ---------- Rows that open a card ----------
   Rows were inert until now: a list of names with no way to find out who
   anyone is. The affordance stays quiet — a leaderboard is a ranking first. */
.league-row.clickable, .member-row.clickable { cursor: pointer; }
.league-row.clickable:active, .member-row.clickable:active { transform: scale(0.985); }

/* ---------- Somebody else's card ---------- */
/* The card opens filled with the name and avatar the row already knew, and
   these stand in for the numbers until they land. A spinner would have said
   "wait"; a skeleton the size of the real card says "this is the card", and
   nothing moves when the data replaces it. */
.pc-skel {
  display: block; height: 1em; min-height: 12px; border-radius: 6px;
  margin: 3px auto;
  background: linear-gradient(90deg, var(--card-2) 0%, var(--card) 50%, var(--card-2) 100%);
  background-size: 220% 100%;
  animation: pcSkel 1.25s ease-in-out infinite;
}
.pc-skel.thin { height: 0.75em; min-height: 9px; opacity: 0.7; }
.pc-skel.w40 { width: 40%; } .pc-skel.w50 { width: 50%; }
.pc-skel.w60 { width: 60%; } .pc-skel.w70 { width: 70%; }
.profile-txt .pc-skel { margin-left: 0; }
.pc-skel-badge {
  width: 34px; height: 34px;
  background: linear-gradient(90deg, var(--card-2) 0%, var(--card) 50%, var(--card-2) 100%);
  background-size: 220% 100%;
  animation: pcSkel 1.25s ease-in-out infinite;
  box-shadow: none; opacity: 0.55;
}
@keyframes pcSkel { 0% { background-position: 130% 0; } 100% { background-position: -30% 0; } }

/* The swap itself: content arriving, not a panel jumping. The overlay is never
   rebuilt, so this is the only thing that animates on load. */
.pc-in { animation: pcIn 0.22s ease-out; }
@keyframes pcIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pc-skel, .pc-skel-badge { animation: none; }
  .pc-in { animation: none; }
}
.player-card { display: flex; flex-direction: column; gap: 14px; }
.player-card .profile-head { margin: 0; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc-badges {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 4px 2px;
}
/* Only the badges actually earned. A grid of padlocks belongs on your own
   profile, where it is a list of things to go and get; on someone else's it is
   just a list of what they have not done. */
.pc-badge {
  font-size: 22px; line-height: 1;
  padding: 6px; border-radius: 12px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

/* ---------- The league's past weeks ---------- */
.hall-list { display: flex; flex-direction: column; gap: 10px; }
.hall-week {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
}
.hw-key {
  flex: none; width: 44px;
  font-size: 12px; font-weight: 900; letter-spacing: .06em;
  color: var(--text-faint);
}
.hw-top { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hw-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 2px 0;
}
.hw-row.first .hw-name { color: var(--gold, #f5c84e); font-weight: 900; }
.hw-medal { flex: none; width: 20px; text-align: center; font-size: 13px; font-weight: 900; }
.hw-avatar { flex: none; font-size: 16px; line-height: 1; }
.hw-name { flex: 1; font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-xp { flex: none; font-size: 11.5px; font-weight: 900; color: var(--text-faint); }

/* ---------- My podiums ----------
   The permanent half of the league. Weekly XP is wiped every Monday by
   design; this list only ever grows, and it is the reason a finished week was
   worth playing. */
.podium-lead { font-size: 13px; color: var(--text-dim); margin: -4px 0 10px; }
.podium-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.podium-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
}
.podium-row.first { box-shadow: 6px 6px 14px var(--shadow-dark), 0 0 0 1.5px rgba(245, 200, 78, .45); }
.pd-medal { flex: none; width: 24px; text-align: center; font-size: 15px; font-weight: 900; }
.pd-week { flex: 1; font-size: 13.5px; font-weight: 800; }
.pd-xp { flex: none; font-size: 12px; font-weight: 900; color: var(--text-faint); }

/* ============ Preferences systeme ============
   La translucidite de la barre d'onglets est un confort, pas une structure :
   qui demande moins de transparence ou plus de contraste recoit un fond plein,
   sans que rien ne bouge de place. */
/* Sur fond clair, une arete blanche ne se voit pas : c'est une ombre tenue
   qui detache la barre du contenu, pas une lumiere. */
body.theme-light #tabbar { box-shadow: inset 0 1px 0 rgba(15, 42, 27, 0.10); }

@media (prefers-reduced-transparency: reduce) {
  #tabbar {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #tabbar::before { display: none; }
}
@media (prefers-contrast: more) {
  #tabbar {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: inset 0 2px 0 var(--line);
  }
  #tabbar::before { display: none; }
}
