* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-family-text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ---------- COQUILLE ---------- */
/* Habillage plat partout (hub, jeux, Réglages) : fond parchemin, filets fins, ni ombre ni verre sur le shell. */
.shell {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
}

.panel {
  position: relative;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 3.75vw, 48px);
  background: transparent;
  overflow: auto;
}

.panel.wide {
  max-width: 1280px;
}

h1 {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: clamp(19px, 4.5vw, 25px);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- HUBS : GRILLE DE TUILES ---------- */
.grid-head {
  margin: 16px 0 28px;
}

.grid-head h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.tile {
  /* sous-grille : icône, titre, description et lien s'alignent d'une tuile à l'autre */
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  justify-items: start;
  gap: 6px;
  min-height: 188px;
  padding: 22px 24px 20px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--color-sys-bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.12s;
}

.tile:hover:not(.soon) { border-color: var(--accent); }

.tile-icon { color: var(--accent); margin-bottom: 8px; }

.tile-title {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
}

.tile-desc {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.tile-go {
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.tile.soon { cursor: default; background: transparent; border-style: dashed; }
.tile.soon .tile-icon,
.tile.soon .tile-title,
.tile.soon .tile-go { color: var(--grey-text); }
.tile.soon .tile-go { font-weight: 500; }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
}

/* ---------- PAGE EXERCICE ---------- */
.ex-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 9px;
}

.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--control-border);
  border-radius: 999px;
  background: var(--color-sys-bg-raised);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--ink);
  padding: 6px 13px;
  cursor: pointer;
}

.backbtn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

select {
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: 7px 26px 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--color-sys-bg-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236f665c' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 9px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.namebox {
  align-self: center;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  padding: clamp(12px, 2.4vh, 16px) 0;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: var(--color-sys-bg-raised);
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--accent-dark);
}

/* ---------- PORTÉE ---------- */
.staff-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
}

.staff-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.staff-svg.placing {
  cursor: pointer;
}

.staff-line,
.ledger-line {
  stroke: var(--ink);
  stroke-width: 1.3;
}

.clef-glyph {
  font-family: var(--font-family-music);
  fill: var(--ink);
  stroke: none;
}

.note-head {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
}

.ghost {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-dasharray: 3 3;
}

.note-head.reveal-correct {
  fill: var(--success);
  fill-opacity: 0.55;
}

.note-head.reveal-wrong {
  fill: var(--grey-ind);
}

.marker-line {
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: 0.55;
}

.window-note {
  transition: transform 0.18s ease-out;
}

.side-label {
  font-family: var(--font-family-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.head-label {
  font-family: var(--font-family-text);
  font-size: var(--font-size-xs);
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
}

/* Défilement continu : la prochaine note à deviner est cerclée. */
.scroll-note.is-target .note-head { stroke: var(--accent-dark); stroke-width: 2.2; }

.side-label.ok { fill: var(--color-sys-feedback-correct-text); }
.side-label.no { fill: var(--grey-text); }

.learn-note {
  cursor: pointer;
}

.learn-label {
  fill: var(--accent-dark);
  font-family: var(--font-family-text);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* ---------- SOUS LA PORTÉE ---------- */

.replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--control-border);
  border-radius: 999px;
  background: var(--color-sys-bg-raised);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.replay:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.feedback {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--muted);
}

.feedback.correct {
  color: var(--color-sys-feedback-correct-text);
}

.feedback b {
  color: var(--accent-dark);
}

.answers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.answer-btn {
  padding: clamp(12px, 2.6vh, 17px) 0;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--color-sys-bg-raised);
  border: 1.5px solid var(--control-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.answer-btn:hover {
  border-color: var(--accent);
  background: #f7f4ee;
}

/* ---------- APPRENDRE ---------- */
.learn-layout {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.learn-left {
  flex: 1 1 56%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.learn-left h2 {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--font-size-lg);
  margin: 0;
}

.learn-hint {
  font-size: var(--font-size-xs);
  color: var(--muted);
  margin: -4px 0 0;
}

.learn-staff {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.faq {
  flex: 1 1 44%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
  border: 1px solid var(--color-sys-border-subtle);
}

.faq h3 {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--font-size-md);
  margin: 0 0 4px;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-size-sm);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: var(--component-target-comfort);
  color: var(--ink);
}

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

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 600;
}

.faq details[open] summary::after {
  content: "–";
}

.learn-sources { margin: var(--space-4) 0 0; font-size: var(--font-size-xs); line-height: 1.55; color: var(--color-sys-text-secondary); }
.learn-sources a { color: var(--color-sys-text-accent); }

.faq p {
  margin: 8px 0 2px;
  font-size: var(--font-size-xs);
  line-height: 1.55;
  color: var(--color-sys-text-primary);
}

.btn-primary {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--color-sys-text-on-accent);
  cursor: pointer;
  margin-top: 6px;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9.5px 22px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--color-sys-bg-raised);
  color: var(--accent-dark);
  cursor: pointer;
  margin-top: 6px;
}

.btn-secondary:hover {
  background: var(--color-sys-bg-raised);
}

.theory-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  /* Le cours défile en entier : la FAQ n'est plus coincée dans une petite boîte qui défile toute seule. */
  .learn-layout {
    flex-direction: column;
    height: auto;
  }
  /* Pas en mode « app tournée » (.rot-ccw) : sa hauteur ne suit pas celle de la fenêtre. */
  .app:not(.rot-ccw) #learn-page { flex: none; height: auto; } /* #learn-page est lui-même le .ex-page : il suit son contenu, le panneau défile */
  .app:not(.rot-ccw) .learn-layout { flex: none; }
  .app:not(.rot-ccw) .learn-left { flex: none; }
  .app:not(.rot-ccw) .learn-staff { flex: none; height: min(52vh, 420px); }
  .app:not(.rot-ccw) .faq { flex: none; overflow: visible; }
}

[hidden] {
  display: none !important;
}

/* ----- clavier personnalisable (défilement continu) ----- */
.key-hint {
  display: block;
  min-height: 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--muted);
  line-height: 12px;
}

.seg-wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.seg-label { font-size: 14px; font-weight: 500; }
.seg { display: flex; gap: 6px; }
.seg-btn {
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 7px 14px;
  border: 1.5px solid var(--control-border);
  border-radius: 999px;
  background: var(--color-sys-bg-raised);
  color: var(--ink);
  cursor: pointer;
}
.seg-btn:hover { border-color: var(--accent); }
.seg-btn.on { border-color: var(--accent); color: var(--accent-dark); }

.kbd-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.kbd-key {
  min-width: 150px;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 7px 12px;
  border: 1.5px solid var(--control-border);
  border-radius: 8px;
  background: var(--color-sys-bg-raised);
  color: var(--ink);
  cursor: pointer;
}

.kbd-key:hover,
.kbd-key.waiting {
  border-color: var(--accent);
}

.kbd-key.waiting {
  color: var(--accent-dark);
}

/* ---------- PAGE D'ACCUEIL (première visite) ---------- */
body.is-home {
  background: var(--paper);
}

body.is-home .nav,
body.is-home .shell,
body.is-home .game {
  display: none;
}

.home {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--paper);
}

.home {
  scroll-behavior: smooth;
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  min-height: 68px;
  flex: none; /* ne rétrécit pas : sans cela, le min-height fixe l'écrase quand la navigation passe sur 2 lignes (mobile) */
  padding: 0 clamp(20px, 4vw, 56px);
  background: var(--paper);
}

.home-logo {
  order: 1;
  padding: 14px 0 8px;
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.home-nav {
  order: 2;
  flex: 1 1 520px;
  display: flex;
  justify-content: center;
  gap: clamp(16px, 2.4vw, 32px);
  font-size: 14.5px;
  white-space: nowrap;
}

.home-nav a,
.home-enter {
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
  text-decoration: none;
}

.home-enter {
  order: 2;
  font-weight: 500;
  color: var(--ink);
}

.home-logo:hover,
.home-nav a:hover,
.home-enter:hover {
  color: var(--accent);
}

@media (max-width: 760px) {
  .home-nav {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 8px;
    font-size: clamp(11px, 3.2vw, 13.5px);
    padding-bottom: 8px;
  }
}

/* Le titre « Comment NotaNext fonctionne » doit apparaître en bas de la première vue :
   le hero est raccourci de la hauteur de ce titre (marge haute + titre + respiration). */
.home {
  --comment-pt: clamp(28px, 3.5vw, 48px);
  --comment-h2: calc(clamp(30px, 4vw, 48px) * 1.1);
}

#comment { padding-top: var(--comment-pt); }

.home-hero {
  min-height: calc(100dvh - 68px - var(--comment-pt) - var(--comment-h2) - 28px);
  flex-shrink: 0; /* ne jamais se compresser sous la hauteur de son contenu (la démo débordait sur téléphone) */
  display: flex;
  flex-direction: column;
}

.home-main {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 4vw, 56px);
}

/* direction: rtl place le texte à droite et l'aperçu à gauche en large ;
   en étroit, le texte reste au-dessus (comme sur la maquette). */
.home-grid {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  direction: rtl;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.home-text,
.home-demo {
  direction: ltr;
}

.home-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(18px, 2.4vw, 28px);
}

.home-text h1 {
  font-weight: 400;
  font-size: clamp(42px, 6.2vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
}

.home-text h1 em {
  color: var(--accent);
}

.home-text p {
  margin: 0;
  max-width: 30em;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
  text-wrap: pretty;
}

.home-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 6px;
}

.home-cta span {
  font-size: 14px;
  color: var(--muted);
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px 14px;
  border-radius: 999px;
  border-bottom: 3px solid var(--accent-dark);
  background: var(--accent);
  color: var(--paper);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.home-btn:hover {
  background: var(--accent-dark);
}

/* Le seul panneau "verre" de cet écran : l'aperçu de l'exercice. */
.home-demo {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.55);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(184, 80, 47, 0.08);
}

.home-demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-demo-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(184, 80, 47, 0.09);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.home-demo-tabs span {
  padding: 6px 14px;
  border-radius: 999px;
}

.home-demo-tabs span.on {
  background: var(--paper);
  color: var(--accent);
}

.home-demo-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.home-demo svg {
  display: block;
  margin: 14px 0 4px;
}

.home-staff {
  stroke: var(--ink);
  stroke-width: 1.4;
  fill: none;
}

.home-clef {
  font-family: var(--font-family-music);
  fill: var(--ink);
}

#home-note {
  fill: var(--accent);
}

#home-stem {
  stroke: var(--accent);
  stroke-width: 1.7;
  fill: none;
}

.home-question {
  display: flex;
  align-items: center;
  min-height: 34px;
  font-family: var(--font-family-display);
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--ink);
}

.home-question.ok {
  color: var(--success);
}

.home-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.home-answers button {
  padding: 13px 0;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.home-answers button:hover:not(.correct):not(.wrong) {
  border-color: var(--accent);
}

.home-answers button.correct {
  border-color: var(--success);
  background: rgba(63, 125, 82, 0.14);
  color: var(--success);
}

.home-answers button.wrong {
  border-color: var(--grey-ind);
  background: rgba(154, 147, 138, 0.14);
  color: var(--grey-ind);
}

.home-footer {
  margin-top: clamp(64px, 9vw, 120px);
  padding: 24px clamp(20px, 4vw, 56px) 28px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.home-footer a {
  color: var(--muted);
}

.home-section {
  --home-pad: clamp(20px, 4vw, 56px);
  scroll-margin-top: 72px;
  padding: clamp(56px, 8vw, 110px) var(--home-pad) 0;
}

.home-wrap {
  max-width: 1240px;
  margin: 0 auto;
}

.home-section h2 {
  margin: 0 0 clamp(28px, 4vw, 52px);
  font-family: var(--font-family-display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(28px, 4vw, 56px);
}

.home-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}

.home-step span {
  font-family: var(--font-family-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.home-step h3,
.home-tile h3,
.home-course h3 {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: 600;
  line-height: 1.25;
}

.home-step h3 { margin-top: 6px; font-size: 22px; }

.home-step p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
}

.home-method {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

.home-method h2 {
  margin: 0;
}

.home-method > div {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 38em;
}

.home-method p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  text-wrap: pretty;
}

.home-sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
}

.home-sources a {
  color: var(--accent);
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 20px;
}

.home-tile,
.home-course {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 88%, #e7cba2);
  border: 1.5px solid var(--border);
}

.home-tile.soon,
.home-course.soon {
  background: transparent;
  border-style: dashed;
}

.home-tile h3 { font-size: 22px; }

.home-tile p {
  margin: 4px 0 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

.home-tile svg {
  display: block;
  width: 100%;
}

.home-tile.soon svg { opacity: 0.5; }

.home-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.home-tile-msg {
  font-family: var(--font-family-display);
  font-size: 18px;
}

.home-tile-msg.ok { color: var(--color-sys-feedback-correct-text); }
.home-tile-msg.no { color: var(--grey-text); }

.home-try {
  padding: 9px 20px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.home-try:hover {
  background: var(--accent);
  color: var(--paper);
}

.home-soon {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 85%, var(--border));
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* Bandeau des cours : défile horizontalement, avec accroche à chaque carte. Il déborde jusqu'aux bords de
   l'écran (marges négatives) mais sa première carte part du même bord que les titres et les autres sections
   (marge de page + centrage de .home-wrap, 1240 px). */
.home-courses {
  display: flex;
  gap: 20px;
  margin: 0 calc(-1 * var(--home-pad));
  padding: 0 calc(var(--home-pad) + max(0px, (100% - 1240px) / 2));
  scroll-padding-inline: calc(var(--home-pad) + max(0px, (100% - 2 * var(--home-pad) - 1240px) / 2));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.home-courses::-webkit-scrollbar {
  display: none;
}

.home-course {
  flex: 0 0 min(300px, 80vw);
  min-height: 240px;
  scroll-snap-align: start;
  gap: 12px;
}

.home-course-kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-course h3 { font-size: 24px; }

.home-course .home-try {
  align-self: flex-start;
}

.home-course p {
  flex: 1;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- PAGES D'APPRENDRE (cours, hors hub) ---------- */
#learn-page {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.panel.wide #learn-page { max-width: 940px; }

/* ---------- CADRE DE JEU (commun à tous les jeux) ---------- */
/* La carte de jeu remplace les vues S'exercer / Apprendre ; le header (logo NotaNext) reste visible. */
body.in-game .shell { display: none; }

.game {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 0 12px 12px;
}

.gf {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(14px, 2.4vh, 22px) clamp(14px, 2.4vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--color-sys-bg-raised);
  border: 1px solid var(--color-sys-border-subtle);
  overflow: hidden;
  isolation: isolate; /* garde le z-index de .gf-config (5) à l'intérieur du cadre : le message « Tourne ton téléphone » (z-index 2) le recouvre */
}

.gf-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.gf-top .backbtn { justify-self: start; }

.gf-title {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: 20px;
  text-align: center;
}

.gf-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gf-count {
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--font-size-xl);
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Titre de l'écran de jeu : masqué à l'écran quand la place manque, mais conservé pour les lecteurs d'écran (repère h1). */
@media (max-width: 520px) { .gf-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* Bouton d'orientation : téléphone uniquement */
.gf-rotate-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--control-border);
  border-radius: 50%;
  background: var(--color-sys-bg-raised);
  color: var(--ink);
  cursor: pointer;
}

body.is-phone .gf-rotate-btn { display: inline-flex; }

.gf-config {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.gf-config:empty { display: none; }
.gf-config { min-height: 38px; }
.gf-config .namebox { height: 36px; padding: 0; width: 84px; }

.gf-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Bloc portée : sélecteur de clé au-dessus à gauche, puis la portée. */
.stage-row {
  flex: 0 0 80%;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.clef-side { flex: 0 0 auto; align-self: flex-start; }
.gf .stage-row .staff-box { flex: 1 1 0; min-height: 0; width: 100%; }

/* Même dimensions pour la portée de tous les jeux : pleine largeur de la carte,
   hauteur = 80 % de l'ancienne portée (qui remplissait toute la zone). */
.gf .staff-box {
  flex: 0 0 80%;
  min-height: 0;
  width: 100%;
}

.replay.big { font-size: 16px; padding: 14px 26px; }

.gf-feedback {
  flex: 0 0 auto;
  margin: 0;
  min-height: 1.6em;
  text-align: center;
}

.gf-next { flex: 0 0 auto; display: flex; justify-content: center; }
.gf-next:has(button[hidden]) { display: none; }

.gf-answers {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Boutons de notes : 4 en haut (Do Mi Sol Si), 3 centrés dessous (Ré Fa La). */
.gf-answers:has(.answer-btn) {
  grid-template-columns: repeat(8, 1fr);
  width: min(100%, 560px);
  margin-inline: auto;
}
.gf-answers:has(.answer-btn) .answer-btn { grid-column: span 2; }
.gf-answers:has(.answer-btn) .answer-btn:nth-child(5) { grid-column: 2 / span 2; }

.gf-answers .answer-btn {
  text-align: center;
  padding: clamp(10px, 2.4vh, 17px) 0;
  border-radius: 8px;
}

.gf-answers .spacer { visibility: hidden; }

/* Message « Tourne ton téléphone » (3 s) puis rotation automatique du jeu */
.gf-hint { display: none; }

.game.show-hint .gf-hint {
  position: absolute;
  inset: 0 12px 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.gf-hint-body {
  margin: auto;
  width: 100%;
  text-align: center;
}

.gf-hint-icon { color: var(--accent); animation: tilt 1.6s ease-in-out infinite; }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 70%, 100% { transform: rotate(-90deg); } }

.gf-hint h2 { margin: 10px 0 8px; font-family: var(--font-family-display); font-weight: 600; font-size: var(--font-size-xl); line-height: 1.15; }
.gf-hint p { margin: 0; color: var(--muted); }

/* Jeu tourné de force (téléphone) : la carte occupe tout l'écran, sans header */
body.game-rotated .nav { display: none; }

.game.rot-cw,
.game.rot-ccw {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100dvh;
  height: 100dvw;
  padding: 8px;
  transform-origin: top left;
}

.game.rot-cw { transform: translateX(100dvw) rotate(90deg); }
.game.rot-ccw { transform: translateY(100dvh) rotate(-90deg); }

/* Écran bas (téléphone en paysage, ou jeu tourné de force) : cadre compact */
@media (max-height: 520px) {
  body:not(.game-portrait) .nav { padding-top: 8px; padding-bottom: 4px; }
  body:not(.game-portrait) .gf { gap: 4px; padding: 8px 16px; }
  body:not(.game-portrait) .gf-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body:not(.game-portrait) .gf-answers { gap: 6px; }
  body:not(.game-portrait) .gf-answers .answer-btn { padding: 5px 0; font-size: 14px; }
  body:not(.game-portrait) .gf .stage-row { flex-basis: 100%; }
  body:not(.game-portrait) .gf .key-hint { display: none; }
  body:not(.game-portrait) .gf-feedback { font-size: var(--font-size-md); min-height: 1.3em; }
  body:not(.game-portrait) .gf-config { min-height: 0; }
  body:not(.game-portrait) .gf-config select, body:not(.game-portrait) .gf-config .replay { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
  body:not(.game-portrait) .gf-config .namebox { height: 30px; }
  body:not(.game-portrait) .stage-row { gap: 3px; }
  body:not(.game-portrait) .clef-side select { min-height: var(--component-target-min); font-size: var(--font-size-xs); padding: 3px 18px 3px 7px; background-position: right 6px center; }
}

.game.rot-cw .gf { gap: 4px; padding: 8px 16px; }
.game.rot-cw .gf-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.game.rot-cw .gf-answers { gap: 6px; }
.game.rot-cw .gf-answers .answer-btn { padding: 5px 0; font-size: 14px; }
.game.rot-cw .gf .stage-row { flex-basis: 100%; }
.game.rot-cw .gf .key-hint { display: none; }
.game.rot-cw .gf-feedback { font-size: var(--font-size-md); min-height: 1.3em; }
.game.rot-cw .gf-config { min-height: 0; }
.game.rot-cw .gf-config select, .game.rot-cw .gf-config .replay { padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.game.rot-cw .gf-config .namebox { height: 30px; }
.game.rot-cw .stage-row { gap: 3px; }
.game.rot-cw .clef-side select { min-height: var(--component-target-min); font-size: var(--font-size-xs); padding: 3px 18px 3px 7px; background-position: right 6px center; }

/* ---------- PAGE SE CONNECTER ---------- */
.page-panel { max-width: 860px; height: auto; max-height: 100%; align-self: flex-start; margin-top: clamp(0px, 3vh, 28px); }

.page-title {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
  margin-bottom: 28px;
}

.page-title { text-align: center; }
.account-back { align-self: flex-start; margin-bottom: 12px; }
.runner {
  display: block;
  width: 100%;
  height: clamp(220px, 36vw, 340px);
  overflow: hidden;
}

/* ---------- CHOIX D'INSTRUMENT ---------- */
.gf-config { position: relative; z-index: 5; }
.inst-menu { position: relative; }
.inst-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--color-sys-bg-raised);
  cursor: pointer;
}
.inst-trigger:hover { border-color: var(--accent); }
.inst-trigger svg:last-child { color: var(--muted); }
.inst-ico { display: inline-flex; }
.inst-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.inst-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.inst-list li:hover { background: var(--color-sys-tint-copper-subtle); }
.inst-list li[aria-selected="true"] { background: var(--color-sys-tint-copper-soft); color: var(--accent-dark); }
.inst-note { font-size: 12px; color: var(--muted); }
@media (max-height: 520px) {
  body:not(.game-portrait) .inst-trigger { padding: 3px 9px 3px 8px; font-size: 12px; }
  body:not(.game-portrait) .inst-ico svg { width: 16px; height: 16px; }
  body:not(.game-portrait) .inst-list li { padding: 5px 10px 5px 8px; font-size: var(--font-size-sm); }
  body:not(.game-portrait) .inst-note { display: none; }
}
.game.rot-cw .inst-trigger { padding: 3px 9px 3px 8px; font-size: 12px; }
.game.rot-cw .inst-ico svg { width: 16px; height: 16px; }
.game.rot-cw .inst-list li { padding: 5px 10px 5px 8px; font-size: var(--font-size-sm); }
.game.rot-cw .inst-note { display: none; }

/* ---------- OREILLE ABSOLUE ---------- */
/* Deviner : 7 notes en cercle autour du bouton rond. */
.ear-wheel {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  max-height: 420px;
  max-width: 100%; /* sans cela, sur un écran étroit (390 px) la roue de 420 px dépasse de la carte */
  aspect-ratio: 1;
  align-self: center;
  container-type: size;
}
.ear-note {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  font-size: max(12px, 5cqw);
  font-weight: 500;
  color: var(--ink);
  background: var(--color-sys-bg-raised);
  border: 1.5px solid var(--control-border);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.ear-note:hover { border-color: var(--accent); background: #f7f4ee; }
.ear-note.good { border-color: var(--success); background: var(--color-sys-tint-correct-soft); color: var(--color-sys-feedback-correct-text); animation: earPop var(--motion-duration-slow) ease; }
.ear-note.bad { border-color: var(--grey-ind); background: var(--color-sys-tint-wrong-soft); color: var(--grey-text); }
.ear-note.reveal { border-color: var(--success); background: var(--color-sys-tint-correct-soft); color: var(--color-sys-feedback-correct-text); outline: 2px solid var(--color-sys-tint-correct-line); outline-offset: 3px; }
.ear-note.good { outline: 2px solid var(--color-sys-tint-correct-line); outline-offset: 3px; }
@keyframes earPop { 0% { transform: translate(-50%, -50%) scale(1); } 40% { transform: translate(-50%, -50%) scale(1.14); } 100% { transform: translate(-50%, -50%) scale(1); } }

.ear-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--color-sys-text-on-accent);
  cursor: pointer;
}
.ear-play:hover { background: var(--accent-dark); }
.ear-play svg { width: 42%; height: 42%; margin-left: 6%; }

/* Placer : bouton rond au-dessus de la portée. */
.ear-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ear-stage .ear-play.small { position: static; transform: none; flex: 0 0 auto; width: 54px; height: 54px; }
.gf .ear-stage .stage-row { flex: 1 1 0; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--control-border); transition: background var(--motion-duration-base); flex: 0 0 auto; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--color-sys-bg-raised); transition: transform var(--motion-duration-base); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.ghost-label { font-family: var(--font-family-text); font-size: var(--font-size-xs); font-weight: 600; fill: var(--ink); pointer-events: none; }
.ghost-label.above { paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; font-size: var(--font-size-sm); }

/* Choix d'instrument en 5 grands boutons (Oreille absolue — deviner). */
.gf-answers:has(.inst-row) { display: block; width: 100%; }
.inst-row { display: flex; justify-content: center; gap: 10px; }
.inst-big {
  flex: 1 1 0;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--ink);
  background: var(--color-sys-bg-raised);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.inst-big .inst-ico svg { width: 26px; height: 26px; }
.inst-big:hover { border-color: var(--accent); }
.inst-big.on { border-color: var(--accent); background: var(--color-sys-tint-copper-subtle); color: var(--accent-dark); }

@media (max-height: 520px) {
  body:not(.game-portrait) .ear-stage { flex-direction: row; align-items: stretch; gap: 10px; }
  body:not(.game-portrait) .ear-stage .ear-play.small { width: 40px; height: 40px; align-self: center; }
  body:not(.game-portrait) .ear-guess .gf-feedback { position: absolute; right: 6%; top: 50%; transform: translateY(-50%); max-width: 22%; }
  body:not(.game-portrait) .inst-row { gap: 6px; }
  body:not(.game-portrait) .inst-big { flex-direction: row; justify-content: center; gap: 6px; padding: 4px 4px; font-size: 12px; }
  body:not(.game-portrait) .inst-big .inst-ico svg { width: 16px; height: 16px; }
  body:not(.game-portrait) .switch { font-size: 12px; }
}
.game.rot-cw .ear-stage { flex-direction: row; align-items: stretch; gap: 10px; }
.game.rot-cw .ear-stage .ear-play.small { width: 40px; height: 40px; align-self: center; }
.game.rot-cw .ear-guess .gf-feedback { position: absolute; right: 6%; top: 50%; transform: translateY(-50%); max-width: 22%; }
.game.rot-cw .inst-row { gap: 6px; }
.game.rot-cw .inst-big { flex-direction: row; justify-content: center; gap: 6px; padding: 4px 4px; font-size: 12px; }
.game.rot-cw .inst-big .inst-ico svg { width: 16px; height: 16px; }
.game.rot-cw .switch { font-size: 12px; }

/* ---------- APPLICATION : BLOC TOURNABLE (Apprendre en portrait sur téléphone) ---------- */
/* Grille de l'app : colonne de gauche (logo + navigation) et vue à droite. Mobile : logo en haut, vue, navigation en bas. */
.app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--component-nav-sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "logo main" "nav main";
}
.app > .nav { grid-area: logo; }
.app > .mainnav { grid-area: nav; }
.app > .shell { grid-area: main; min-width: 0; }
body.m .app {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo" "main" "nav";
}
/* Pendant un jeu, la barre fine du haut reste ; la navigation disparaît. */
body.in-game .app { flex: 0 0 auto; display: block; }
body.is-home .app { display: none; }

.app.rot-ccw {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100dvh;
  height: 100dvw;
  transform-origin: top left;
  transform: translateY(100dvh) rotate(-90deg);
}

/* Les requêtes de largeur voient l'écran (paysage) : on rejoue ici celles qui visent un écran étroit. */
.app.rot-ccw .grid { grid-template-columns: 1fr; }
.app.rot-ccw .tile { min-height: 0; }
.app.rot-ccw .learn-layout { flex-direction: column; height: auto; }

/* Message « Tourne ton téléphone » avant la rotation d'Apprendre */
.app-hint {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--paper);
}
body.app-hint-on .app-hint { display: flex; }
.app-hint h2 { margin: 10px 0 8px; font-family: var(--font-family-display); font-weight: 600; font-size: var(--font-size-xl); line-height: 1.15; }
.app-hint p { margin: 0; color: var(--muted); }
.app-hint .gf-hint-icon { color: var(--accent); animation: tilt 1.6s ease-in-out infinite; }

/* Oreille absolue — placer : en portrait la portée garde des proportions lisibles (pas d'étirement en hauteur). */
.ear-place .stage-row, .place-game .stage-row { justify-content: center; }
.gf.ear-place .stage-row .staff-box { flex: 0 1 auto; width: 100%; aspect-ratio: 2 / 1; max-height: 100%; }
/* Téléphone : pour placer une note au doigt, la portée est presque carrée (≈ 18 px par demi-ton au lieu de 8,5 ou 5)
   et la place réservée aux boutons de réponse (jeu « Placer la note ») est rendue. */
body.m #game .gf.ear-place .stage-row .staff-box,
body.m #game .gf.place-game .stage-row .staff-box { flex: 0 1 auto; width: 100%; aspect-ratio: 1.1 / 1; max-height: 100%; }
body.m #game .gf.place-game .gf-answers { display: none; }
/* Si le joueur passe « Placer la note » en paysage, la portée reprend sa forme large. */
body.m #game.rot-cw .gf.place-game .stage-row .staff-box { flex: 1 1 0; aspect-ratio: auto; }
@media (max-height: 520px) { body.m:not(.game-portrait) #game .gf.place-game .stage-row .staff-box { flex: 1 1 0; aspect-ratio: auto; } }

/* ---------- FOCUS CLAVIER ---------- */
:where(a, button, select, input, [tabindex]):focus-visible,
.staff-svg:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}
.inst-list li:focus-visible { background: var(--color-sys-tint-copper-soft); outline: 2px solid var(--accent-dark); outline-offset: -2px; }
.home { scroll-padding-top: 76px; } /* l'en-tête collant ne masque pas l'élément focalisé */

.hint-keep { margin-top: 18px; }
.app-hint .backbtn { margin-top: 18px; }

/* Les titres de page des écrans de jeu et de cours sont de vrais titres (h1) : même aspect qu'avant. */
h1.gf-title { margin: 0; }
.learn-left h1 { font-size: 28px; margin: 0 0 8px; }

.runner-pause { align-self: center; margin-top: 10px; }

/* « Réduire les animations » : plus de mouvement en boucle (fond, aperçus, flèche de rotation). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Rotation automatique : le bouton est « enfoncé » quand elle est active (réglage commun à tous les jeux). */
/* Le bouton reste blanc ; seule l'icône change d'orientation : inclinée = rotation automatique, droite = désactivée. */
.gf-rotate-btn svg { transition: transform 0.25s ease; }
.gf-rotate-btn[aria-pressed="false"] svg { transform: rotate(90deg); }

/* =====================================================================
   SHELL V2 (maquette design/shell-v2-2026-10-20.html) : en-tête, barre d'onglets, hub, Réglages, pages texte
   Plat : fond parchemin, filets d'1 px, aucune ombre, aucun verre, aucun cercle décoratif.
   ===================================================================== */

/* ----- en-tête : le logo ----- */
.nav {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  height: 72px;
  padding: 0 clamp(20px, 3.75vw, 48px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.nav .nav-home {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-family-display);
  font-weight: 600;
  font-size: var(--font-size-xl);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav button:focus-visible { outline: var(--border-width-focus) solid var(--color-sys-focus-ring); outline-offset: var(--border-width-strong); }

/* ----- navigation à 4 destinations ----- */
.mainnav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--component-nav-link-height);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-sys-text-secondary);
  font-size: var(--font-size-md);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--motion-duration-fast) var(--motion-easing-out);
}
.mainnav a:hover { background: var(--color-sys-tint-copper-subtle); color: var(--color-sys-text-primary); }
.mainnav a:active { background: var(--color-sys-tint-copper-soft); }
.mainnav a:focus-visible { outline: var(--border-width-focus) solid var(--color-sys-focus-ring); outline-offset: calc(-1 * var(--border-width-focus)); }
.mainnav .mn-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mainnav a.on { background: var(--color-sys-tint-ink-subtle); color: var(--color-sys-text-primary); font-weight: 600; }
.mainnav a.on .mn-ico { color: var(--color-sys-action-primary); }
.mainnav a.on::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: var(--space-2);
  width: var(--component-nav-accent-bar-desktop);
  border-radius: var(--radius-pill);
  background: var(--color-sys-action-primary);
}

/* Ordinateur : colonne de gauche. */
body:not(.m):not(.in-game) .nav {
  height: auto;
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 0;
  border-right: 1px solid var(--hair);
}
body:not(.m):not(.in-game) .mainnav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4) var(--space-6);
  border-right: 1px solid var(--hair);
  background: var(--paper);
}

/* Mobile : barre fine en haut (logo) et barre du bas à 4 colonnes. */
body.m .nav {
  height: 52px;
  padding: 0 20px;
}
body.m .nav .nav-home { font-size: 24px; }
body.m .mainnav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hair);
  background: var(--paper);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.m .mainnav a {
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--component-nav-bar-height);
  padding: var(--space-2) 0;
  border-radius: 0;
  background: none;
  font-size: var(--font-size-xs);
}
body.m .mainnav a:hover { background: var(--color-sys-tint-copper-subtle); }
body.m .mainnav a.on { background: none; color: var(--color-sys-action-primary); }
body.m .mainnav .mn-ico { width: var(--component-nav-pill-width); height: var(--component-nav-pill-height); border-radius: var(--radius-pill); }
body.m .mainnav a.on .mn-ico { background: var(--color-sys-tint-copper-soft); color: var(--color-sys-action-primary); }
body.m .mainnav a.on svg { stroke-width: 2.4; }
body.m .mainnav a.on::before {
  top: -1px;
  bottom: auto;
  left: 22%;
  right: 22%;
  width: auto;
  height: var(--component-nav-accent-bar-mobile);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
body.in-game .mainnav { display: none; }

/* ----- hub S'exercer ----- */
.hub { padding-bottom: 56px; }
.hub-head { padding: 40px 0 24px; }
.hub-head h1 { margin: 0; font-size: 48px; line-height: 1.05; letter-spacing: -0.02em; }
.hub-help { margin: 10px 0 0; font-size: var(--font-size-md); color: var(--grey-text); }
.hub-grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 72px; align-items: start; }

.hub-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  margin: 0 16px 24px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--color-sys-bg-raised);
  color: var(--grey-text);
}
.hub-search svg { flex: none; }
.hub-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hub-search input {
  flex: 1;
  align-self: stretch; /* toute la hauteur du champ est cliquable */
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.hub-slash {
  flex: none;
  padding: 1px 8px;
  border: 1.5px solid var(--hair);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--grey-text);
}
.hub-clear { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; border: 0; background: none; color: var(--grey-text); cursor: pointer; border-radius: 50%; }
.hub-clear:hover { color: var(--ink); }
.hub-clear[hidden] { display: none; }
.hub-search:has(.hub-clear:not([hidden])) .hub-slash { display: none; }

.hub-fam-head { padding: 0 16px 12px; }
.hub-fam-head h2 { margin: 0; font-family: var(--font-family-display); font-weight: 600; font-size: 24px; color: var(--accent); }
.hub-fam-head p { margin: 0; font-size: var(--font-size-md); color: var(--grey-text); }
.hub-fam.second { margin-top: 40px; }
.hub-fam.second .hub-fam-head { padding-top: 18px; border-top: 2px solid var(--ink); }

.hub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.hub-row:hover { background: rgba(33, 29, 24, 0.05); }
.hub-row.sel { background: var(--color-sys-tint-copper-subtle); }
.hub-row:active { background: var(--color-sys-tint-copper-strong); }
.hub-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hub-row-text { flex: 1; min-width: 0; display: block; }
.hub-row-title { display: block; font-family: var(--font-family-display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.hub-row-title b { font-weight: 600; color: var(--accent-dark); text-decoration: underline; text-decoration-thickness: var(--border-width-hairline); text-underline-offset: 3px; } /* la partie trouvée se distingue aussi sans la couleur */
.hub-row-desc { display: block; margin-top: 2px; font-size: var(--font-size-md); line-height: 22px; color: var(--grey-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-tag { flex: none; padding: 2px 10px; border: 1.5px solid var(--hair); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--grey-text); }
.hub-chev { flex: none; color: var(--grey-text); transition: transform var(--motion-duration-base); }
.hub-row.sel .hub-chev { color: var(--accent); transform: translateX(4px); }
.hub-thumb { display: none; }

.hub-empty { padding: 32px 16px; }
.hub-empty-t { margin: 0 0 6px; font-family: var(--font-family-display); font-weight: 600; font-size: var(--font-size-xl); }
.hub-empty-d { margin: 0 0 18px; color: var(--grey-text); }

.hub-detail { padding: 8px 0 0 8px; min-width: 0; }
.hub-detail-fade { transition: opacity var(--motion-duration-fast); }
.hub-detail-fade.out { opacity: 0; }
.hub-detail-text { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.hub-detail-title { display: block; font-family: var(--font-family-display); font-weight: 600; font-size: 36px; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); }
.hub-detail-desc { display: block; margin: 10px 0 24px; font-size: var(--font-size-md); line-height: 26px; color: var(--grey-text); }
.hub-preview-wrap {
  position: relative;
  width: 100%;
  max-width: 578px;
  aspect-ratio: 578 / 460;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
}
.hub-preview-wrap.no-preview { display: none; }
.hub-preview { position: absolute; inset: 0; pointer-events: none; }
.hub-demo-host, .hub-thumb-host {
  position: absolute;
  left: 0;
  top: 0;
  width: 760px;
  height: 605px;
  display: flex;
  padding: 0 12px 12px;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
}
.hub-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
  min-height: var(--component-target-min);
  cursor: pointer;
}
.hub-launch:hover { color: var(--accent-dark); }
.hub-launch svg { flex: none; }
.hub-detail:has(.no-preview) .hub-launch { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .hub-detail-fade { transition: none; } }

/* ----- hub mobile : variante C (rangées hautes, aperçu à droite 168 × 72) ----- */
@media (max-width: 900px) {
  .hub { padding-bottom: 32px; }
  .hub-head { padding: 24px 0 16px; }
  .hub-head h1 { font-size: 34px; }
  .hub-help { font-size: 16px; }
  .hub-grid { display: block; }
  .hub-detail { display: none; }
  .hub-search { margin: 0 0 20px; }
  .hub-slash { display: none; }
  .hub-fam-head { padding-left: 0; padding-right: 0; }
  .hub-row { min-height: 96px; padding: 12px 0; }
  .hub-row-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 20px; }
  .hub-chev { display: none; }
  .hub-thumb { display: block; position: relative; flex: none; width: 168px; height: 72px; overflow: hidden; border: 1px solid var(--hair); border-radius: 8px; background: var(--paper); pointer-events: none; }
  .hub-thumb-host { width: 760px; height: 605px; }
  .hub-row[data-kind="learn"] .hub-thumb { display: none; }
  .hub-row .hub-tag { order: 1; }
}
@media (max-width: 520px) {
  .hub-thumb { width: 132px; height: 72px; }
}

/* ----- Réglages ----- */
.settings { width: 100%; max-width: 720px; padding: 40px 0 64px; }
.settings h1 { font-size: 48px; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 8px; }
.set-sec { padding: 28px 0; border-top: 1px solid var(--hair); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.set-sec:first-of-type { margin-top: 16px; }
.set-sec h2 { margin: 0; font-family: var(--font-family-display); font-weight: 600; font-size: 24px; color: var(--accent); }
.set-hint { margin: 0; font-size: var(--font-size-md); line-height: 22px; color: var(--grey-text); max-width: 60ch; }
.set-warn { margin: 0; font-size: 14px; line-height: 20px; color: var(--grey-text); border-left: 3px solid var(--accent); padding-left: 10px; }
.settings .seg-wrap { justify-content: flex-start; gap: 16px; }
.settings .seg-btn { font-size: var(--font-size-md); padding: 10px 18px; min-height: 44px; }
.settings .seg-btn.on { background: var(--color-sys-tint-copper-subtle); border-color: var(--accent); }
.settings .kbd-rows { max-width: 360px; }
.settings .kbd-row { font-size: 16px; }
.settings .kbd-key { min-width: 140px; min-height: 44px; font-size: var(--font-size-md); }
.settings .kbd-key.dup { border-color: var(--accent); color: var(--accent-dark); }
.settings .btn-primary, .settings .btn-secondary { min-height: 44px; }
.settings .switch { font-size: 16px; min-height: 44px; }
.set-fill { display: flex; flex-direction: column; gap: 8px; }
.set-vol { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 420px; }
.set-vol label { font-size: 16px; font-weight: 500; }
.set-vol input[type="range"] { flex: 1; min-height: 44px; accent-color: var(--accent); }
.set-vol output { min-width: 3.2em; text-align: right; font-size: var(--font-size-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.set-inst-label { margin: 0; }
.set-inst { display: flex; flex-wrap: wrap; gap: 10px; }
.set-inst .inst-big { min-height: 48px; padding: 8px 16px; }
.set-confirm { padding: 16px; border: 1.5px solid var(--ink); border-radius: 12px; max-width: 460px; }
.set-confirm p { margin: 0 0 12px; font-size: var(--font-size-md); line-height: 22px; }
.set-links { width: 100%; margin: 0; padding: 0; list-style: none; }
.set-links a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 4px; border-bottom: 1px solid var(--hair); font-size: var(--font-size-md); font-weight: 500; color: var(--ink); text-decoration: none; }
.set-links a:hover { color: var(--accent-dark); }
.set-links a svg { color: var(--grey-text); }
body.m .settings { padding: 24px 0 40px; }
body.m .settings h1 { font-size: 34px; }
body.m .panel { padding-left: 20px; padding-right: 20px; padding-bottom: 56px; } /* marge basse : le contenu passe sous l'icône de retours */

/* ----- pages texte ----- */
.doc { width: 100%; max-width: 68ch; padding: 32px 0 64px; }
.doc h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; margin: 18px 0 12px; }
.doc h2 { margin: 32px 0 8px; font-family: var(--font-family-display); font-weight: 600; font-size: var(--font-size-xl); }
.doc p, .doc li { font-size: 16px; line-height: 1.6; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--accent-dark); text-underline-offset: 3px; }
.doc-date { color: var(--grey-text); font-size: 14px !important; }
.doc-todo { background: transparent; color: var(--accent-dark); border-bottom: 1.5px dashed var(--accent); font-weight: 600; }
.doc-back { text-decoration: none; }
body.m .doc h1 { font-size: 32px; }

/* ----- icône de retours bêta ----- */
.fb-btn {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark); /* bordeaux du site */
  cursor: pointer;
  touch-action: none;
}
.fb-btn:hover { color: var(--ink); }
.fb-btn svg { stroke-width: 1.8; }
.fb-btn.dragging { cursor: grabbing; color: var(--ink); }
.fb-btn[hidden] { display: none; }
.fb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
/* Message d'état du bouton de retours (ex. formulaire injoignable) : plat, au-dessus de l'icône. */
.fb-note {
  position: fixed;
  z-index: 41;
  right: var(--space-6);
  bottom: calc(var(--space-6) + var(--component-target-comfort) + var(--space-2));
  max-width: min(320px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-3) var(--space-4);
  border: var(--border-width-hairline) solid var(--color-sys-border-control);
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
  color: var(--color-sys-text-primary);
  font-size: var(--font-size-sm);
  line-height: var(--font-line-height-snug);
  cursor: pointer;
}
.fb-note:not(.on) { opacity: 0; pointer-events: none; }
body.m .fb-note { right: var(--space-4); bottom: calc(72px + env(safe-area-inset-bottom, 0px) + var(--component-target-comfort) + var(--space-2)); }
body.m.in-game .fb-note { bottom: calc(var(--space-3) + var(--component-target-comfort) + var(--space-2)); }
body.is-home .fb-note { display: none; }
body.m .fb-btn { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
body.m.in-game .fb-btn { bottom: 12px; }
/* Jeu tourné de force : l'icône reste en bas à droite de l'écran de jeu (de la partition), donc elle tourne avec lui. */
body.game-rotated:not(.game-portrait) .fb-btn { left: calc(var(--space-3) + env(safe-area-inset-left, 0px)); right: auto; bottom: var(--space-3); transform: rotate(90deg); }
body.game-portrait .fb-btn { top: var(--space-3); right: var(--space-3); bottom: auto; left: auto; transform: rotate(-90deg); }
/* Téléphone en paysage : la barre d'onglets est un peu plus basse et laisse la place à l'icône de retours, qui reste
   ainsi tout en bas à droite de l'écran, comme dans les jeux. */
@media (max-height: 520px) and (orientation: landscape) {
  body.m .mainnav { padding-right: calc(var(--component-target-comfort) + var(--space-6) + env(safe-area-inset-right, 0px)); }
  body.m .mainnav a { min-height: 52px; }
  body.m .fb-btn { right: calc(var(--space-3) + env(safe-area-inset-right, 0px)); bottom: calc(var(--space-1) + env(safe-area-inset-bottom, 0px)); }
  body.m.in-game .fb-btn { bottom: var(--space-2); }
  body.m .fb-note { right: calc(var(--space-3) + env(safe-area-inset-right, 0px)); bottom: calc(52px + env(safe-area-inset-bottom, 0px) + var(--space-2)); }
  body.m.in-game .fb-note { bottom: calc(var(--component-target-comfort) + var(--space-4)); }
}
/* Écran de jeu : l'icône reste dans une marge réservée, jamais sur la portée ni sur les touches. */
body.in-game .game { padding-right: 72px; }
body.m.in-game .game { padding-right: 12px; }
@media (max-width: 760px) and (orientation: portrait) { body.in-game .game { padding-bottom: 64px; } }
@media (max-height: 520px) and (orientation: landscape) { body.m.in-game .game { padding-right: 72px; } }
/* Jeu tourné de force : la marge de l'icône suit la rotation (le bas de l'écran pour rot-cw, la droite pour rot-ccw). */
.game.rot-cw { padding: 0 72px 12px 12px !important; }
.game.rot-ccw { padding: 0 12px 72px 12px !important; }

/* Apprendre (hors périmètre de cette refonte) : mêmes marges que les autres écrans, sans cadre autour. */
#learn-grid, #learn-page { padding: 24px 0 32px; }
#learn-grid .grid-head { margin-top: 0; }
#learn-grid .grid-head { margin-bottom: var(--space-4); }
.learn-search { margin: 0 0 var(--space-6); max-width: 440px; }
#learn-empty { padding: var(--space-4) 0; }
body.m #learn-grid, body.m #learn-page { padding-top: 16px; }
@media (max-height: 520px) {
  body.m .nav { height: 40px; }
  body.m .nav .nav-home { font-size: 20px; }
}

/* ----- familles du hub et sections de Réglages : menus déroulants ----- */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.hub-fam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hub-fam-titles { display: block; min-width: 0; }
.hub-fam-chev, .set-chev { flex: none; color: var(--grey-text); transition: transform var(--motion-duration-base); }
details[open] > summary .hub-fam-chev, details[open] > summary .set-chev { transform: rotate(180deg); }
.hub-fam-head:hover .hub-fam-chev, .set-sec > summary:hover .set-chev { color: var(--ink); }
.hub-fam-head:focus-visible, .set-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hub-fam.second { border-top: 0; }
.hub-fam.second > .hub-fam-head { margin-top: 40px; padding-top: 18px; border-top: 2px solid var(--ink); }
.hub-fam:not(.second) > .hub-fam-head h2 + p { margin-bottom: 0; }

.set-sec { display: block; padding: 0; border-top: 1px solid var(--hair); }
.set-sec:first-of-type { margin-top: 16px; }
.set-sec > summary { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.set-sec > summary h2 { margin: 0; }
.set-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 4px 0 28px; }
.settings .set-sec:last-of-type { border-bottom: 1px solid var(--hair); }

/* Clavier (ordinateur) : les sept notes en ligne, la touche sous chaque nom. */
.settings .kbd-rows { max-width: none; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.settings .kbd-row { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; width: 92px; text-align: center; }
.settings .kbd-key { min-width: 0; width: 100%; }

/* Jeu tourné (téléphone) : l'en-tête reste caché, malgré la mise en page mobile de la barre. */
body.m.game-rotated .nav { display: none; }

/* Fenêtre des retours bêta (Tally) : cadre bordeaux de la charte (cuivre foncé), bien visible. */
.tally-popup { border: 3px solid var(--accent-dark) !important; border-radius: var(--radius-md) !important; }
.set-beta > summary h2 { color: var(--accent-dark); }
.set-beta { border-top: 2px solid var(--accent-dark); }

/* Chargement sur l'accueil : l'app reste masquée jusqu'à ce que le routeur prenne la main (js/game.js, route). */
html.boot-home .app, html.boot-home .game { display: none; }
html.boot-home .home { display: block; }
html.boot-home .fb-btn { display: none; }

/* =====================================================================
   CHEMIN DE LEÇONS (#/cours) et PROFIL (#/profil)
   Plat : aplats et contours fins, aucune ombre, aucun reflet, aucun halo. Cotes : jetons `component.path.*`.
   ===================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.profil-line { margin: 0 0 var(--space-2); font-size: var(--font-size-md); color: var(--color-sys-text-secondary); }

#cours-panel { align-items: center; }
/* Mobile : le chemin occupe toute la largeur (375 px de la maquette) ; seul le bandeau d'unité garde des marges. */
body.m #cours-panel { padding-left: 0; padding-right: 0; }
body.m .path-unit { margin: 0 var(--space-4); }
.path-page { width: 100%; max-width: var(--component-path-column-width); padding: var(--space-4) 0 var(--space-8); }
body:not(.m) .path-page { padding-top: var(--space-8); }
.path-unit {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width-hairline) solid var(--color-sys-border-control);
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
}
.path-unit-name { font-size: var(--font-size-md); font-weight: 600; color: var(--color-sys-text-primary); }
.path-unit-note { font-size: var(--font-size-xs); color: var(--color-sys-text-secondary); }

.path { position: relative; width: 100%; }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.path-line .dot.done { fill: var(--color-sys-stamp-navy); }
.path-line .dot.recent { fill: var(--color-sys-action-primary); }
.path-line .dot.todo { fill: var(--color-sys-border-control); }
.path-list { margin: 0; padding: 0; list-style: none; }
.path-node { position: absolute; margin: 0; padding: 0; }

/* Disque de leçon : un bouton, jamais la couleur seule (coche, lecture, cadenas, pointillé + libellés). */
.disc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: var(--border-width-strong) solid transparent;
  border-radius: var(--radius-circle);
  cursor: pointer;
  font: inherit;
  transition: background-color var(--motion-duration-fast) var(--motion-easing-out), transform var(--motion-duration-fast) var(--motion-easing-out);
}
.path-node.done .disc { background: var(--color-sys-stamp-navy); border-color: var(--color-sys-stamp-navy); color: var(--color-sys-bg-page); }
.path-node.current .disc { background: var(--color-sys-action-primary); border-color: var(--color-sys-action-primary); color: var(--color-sys-text-on-accent); }
.path-node.current .disc:hover { background: var(--color-sys-action-primary-hover); border-color: var(--color-sys-action-primary-hover); }
/* Un seul contour cuivre fixe autour du disque en cours. */
.path-node.current .disc::after {
  content: "";
  position: absolute;
  inset: calc(-1 * (var(--space-1) + var(--border-width-strong)));
  border: var(--border-width-strong) solid var(--color-sys-action-primary);
  border-radius: var(--radius-circle);
  pointer-events: none;
}
.path-node.locked .disc { background: var(--color-sys-border-subtle); border-color: var(--color-sys-border-control); color: var(--color-sys-text-secondary); }
.path-node.soon .disc { background: var(--color-sys-bg-page); border-style: dashed; border-color: var(--color-sys-border-control); }
.path-node.done .disc:hover, .path-node.locked .disc:hover, .path-node.soon .disc:hover {
  outline: var(--border-width-strong) solid var(--color-sys-border-control);
  outline-offset: var(--space-1);
}
.disc:active { transform: scale(0.96); }
.disc:focus-visible {
  outline: var(--border-width-focus) solid var(--color-sys-focus-ring);
  outline-offset: calc(var(--space-2) + var(--border-width-strong));
}

.path-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  cursor: pointer;
}
.path-label.left { right: calc(100% + var(--space-4)); align-items: flex-end; text-align: right; }
.path-label.right { left: calc(100% + var(--space-4)); align-items: flex-start; text-align: left; }
.path-title { font-size: var(--font-size-md); font-weight: 600; line-height: var(--font-line-height-snug); color: var(--color-sys-text-primary); }
.path-node.current .path-title { font-family: var(--font-family-display); font-size: var(--font-size-lg); line-height: var(--font-line-height-tight); }
.path-node.locked .path-title { color: var(--color-sys-text-secondary); }
.path-soon { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-sys-text-secondary); }
.path-tag {
  display: inline-flex;
  align-items: center;
  height: var(--component-path-tag-height);
  padding: 0 var(--space-2);
  border: var(--border-width-medium) solid var(--color-sys-text-primary);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-sys-text-primary);
}

/* Bulle « Commencer » / « Continuer » : à droite du disque, au-dessus quand la place manque. */
.path-bubble {
  position: absolute;
  top: 50%;
  left: calc(100% + var(--space-4) + var(--space-1));
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  height: var(--component-path-bubble-height);
  padding: 0 var(--space-3);
  border: var(--border-width-strong) solid var(--color-sys-action-primary);
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
  color: var(--color-sys-action-primary-hover);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.path-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-1 * (var(--space-1) + var(--border-width-strong) / 2));
  width: var(--space-2);
  height: var(--space-2);
  border-left: var(--border-width-strong) solid var(--color-sys-action-primary);
  border-bottom: var(--border-width-strong) solid var(--color-sys-action-primary);
  background: var(--color-sys-bg-raised);
  transform: translateY(-50%) rotate(45deg);
}
.path-bubble.top { top: auto; left: 50%; bottom: calc(100% + var(--space-6)); transform: translateX(-50%); }
.path-bubble.top::before {
  top: auto;
  left: 50%;
  bottom: calc(-1 * (var(--space-1) + var(--border-width-strong) / 2));
  border-left: 0;
  border-bottom: var(--border-width-strong) solid var(--color-sys-action-primary);
  border-right: var(--border-width-strong) solid var(--color-sys-action-primary);
  transform: translateX(-50%) rotate(45deg);
}

/* Bulle d'information (région `role="status"`) : vide tant qu'aucune leçon n'est touchée. */
.path-tip { position: absolute; z-index: 5; top: 0; left: 0; }
.path-tip:not(:empty) {
  max-width: min(280px, calc(100% - 2 * var(--space-2)));
  padding: var(--space-3) var(--space-4);
  border: var(--border-width-hairline) solid var(--color-sys-border-control);
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
  color: var(--color-sys-text-primary);
  font-size: var(--font-size-md);
  line-height: var(--font-line-height-snug);
}
@media (prefers-reduced-motion: reduce) {
  .disc, .mainnav a { transition: none; }
  .disc:active { transform: none; }
}

/* ---------- FICHES, TEST ET RÉSULTAT (#/lecon/…) : version test, passe 1 ---------- */
#lecon-panel { align-items: center; }
.lecon-reading {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: none;
  width: 100%;
  height: var(--component-lecon-progress-line);
  background: transparent;
}
.lecon-reading-bar {
  display: block;
  height: 100%;
  background: var(--color-sys-action-primary);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--motion-duration-fast) linear;
}
.lecon-page {
  width: 100%;
  max-width: var(--component-lecon-column-width);
  padding: var(--space-2) 0 calc(var(--space-16) + var(--space-8));
  font-size: var(--font-size-reading);
  line-height: 1.55;
  color: var(--color-sys-text-primary);
}
.lecon-page p { margin: 0 0 var(--space-3); }
.lecon-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-6); }
.lecon-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--component-target-comfort);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-sys-text-secondary);
  text-decoration: none;
}
.lecon-back:hover { color: var(--color-sys-text-primary); }
.lecon-title { font-size: var(--font-size-2xl); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--space-6); }
.lecon-section { margin: 0 0 var(--space-8); }
.lecon-section h2, .lecon-end h2 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-3);
}
.lecon-def { font-weight: 400; }
.lecon-why { color: var(--color-sys-text-secondary); }
.lecon-foot {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: var(--border-width-hairline) solid var(--color-sys-border-subtle);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--color-sys-text-secondary);
}
.lecon-foot a, .lecon-back:focus-visible { text-underline-offset: 3px; }
.lecon-foot a { color: var(--color-sys-text-accent); }
.lecon-end { margin-top: var(--space-8); padding-top: var(--space-6); border-top: var(--border-width-hairline) solid var(--color-sys-border-subtle); }
.lecon-actions { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.lecon-main { min-height: var(--component-target-comfort); margin-top: 0; padding: 0 var(--space-6); font-size: var(--font-size-md); }
.btn-secondary.emph { border-width: var(--border-width-strong); background: var(--color-sys-tint-copper-soft); }

/* Halo qui pulse : un seul par écran, sur le bouton de la prochaine étape ; arrêté tant qu'un élément animé joue. */
.lecon-halo { animation: lecon-halo calc(var(--motion-duration-slow) * 8) ease-out infinite; }
.is-moving .lecon-halo { animation: none; }
@keyframes lecon-halo {
  0% { box-shadow: 0 0 0 0 var(--color-sys-tint-copper-strong); }
  30%, 100% { box-shadow: 0 0 0 var(--component-lecon-halo-spread) transparent; }
}

/* Repères de fiche */
.lecon-repere {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-sys-stamp-navy-tint);
  color: var(--color-sys-text-primary);
}
.lecon-repere-vide { align-items: center; justify-content: center; min-height: calc(var(--space-16) + var(--space-4)); font-size: var(--font-size-sm); color: var(--color-sys-text-primary); }
.lecon-beats { display: flex; gap: var(--space-4); }
.lecon-beat {
  width: var(--component-lecon-beat-disc);
  height: var(--component-lecon-beat-disc);
  border-radius: var(--radius-circle);
  border: var(--border-width-strong) solid var(--color-sys-stamp-navy);
  background: transparent;
  transition: background var(--motion-duration-fast) linear;
}
.lecon-beat.on { background: var(--color-sys-stamp-navy); }
.lecon-play { margin-top: 0; min-height: var(--component-target-comfort); }

/* Test */
.lecon-steps { display: flex; gap: var(--space-2); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.lecon-steps li {
  width: var(--component-lecon-step-disc);
  height: var(--component-lecon-step-disc);
  border-radius: var(--radius-circle);
  border: var(--border-width-strong) solid var(--color-sys-border-control);
}
.lecon-steps li.done { background: var(--color-sys-stamp-navy); border-color: var(--color-sys-stamp-navy); }
.lecon-steps li.now { border-color: var(--color-sys-stamp-navy); }
.lecon-qcount { font-size: var(--font-size-sm); color: var(--color-sys-text-secondary); margin: 0 0 var(--space-3); }
.lecon-qtitle { font-size: var(--font-size-xl); line-height: 1.25; margin: 0 0 var(--space-6); }
.lecon-sons { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-6); }
.lecon-son {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: calc(var(--space-16) + var(--space-8));
  min-height: var(--component-target-comfort);
  padding: var(--space-1) var(--space-4);
  border: var(--border-width-medium) solid var(--color-sys-border-control);
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: var(--font-size-md);
  color: var(--color-sys-text-secondary);
  cursor: default;
}
.lecon-son small { font-size: var(--font-size-xs); }
.lecon-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.lecon-option {
  min-height: calc(var(--space-12) + var(--space-2));
  border: var(--border-width-strong) solid var(--color-sys-border-control);
  border-radius: var(--radius-md);
  background: var(--color-sys-bg-raised);
  font: inherit;
  font-size: var(--font-size-reading);
  font-weight: 600;
  color: var(--color-sys-text-primary);
  cursor: pointer;
}
.lecon-option:hover { border-color: var(--color-sys-text-accent); }
.lecon-option[aria-checked="true"] { border-color: var(--color-sys-text-accent); background: var(--color-sys-tint-copper-soft); }
.lecon-option.locked { cursor: default; }
.lecon-tapzone { display: flex; justify-content: center; margin: var(--space-2) 0 var(--space-6); }
.lecon-tap {
  width: var(--component-lecon-tap-disc);
  height: var(--component-lecon-tap-disc);
  max-width: 100%;
  border-radius: var(--radius-circle);
  border: var(--border-width-strong) solid var(--color-sys-stamp-navy);
  background: var(--color-sys-stamp-navy-tint);
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-sys-stamp-navy);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--motion-duration-fast) linear, background var(--motion-duration-fast) linear;
}
.lecon-tap:active { transform: scale(0.97); }
.lecon-tap.tapped { background: var(--color-sys-stamp-navy); color: var(--color-sys-text-on-accent); font-size: var(--font-size-3xl); }
.lecon-tap.locked { cursor: default; }
.lecon-fb { margin-top: var(--space-4); border-radius: var(--radius-sm); font-weight: 600; }
.lecon-fb.ok, .lecon-fb.ko { padding: var(--space-3) var(--space-4); }
.lecon-fb.ok { background: var(--color-sys-tint-correct-soft); color: var(--color-sys-feedback-correct-text); }
.lecon-fb.ko { background: var(--color-sys-tint-wrong-soft); color: var(--color-sys-feedback-wrong-text); }
.lecon-note { margin-top: var(--space-6); font-size: var(--font-size-sm); color: var(--color-sys-text-secondary); }

/* Résultat */
.lecon-score { color: var(--color-sys-reward-score); white-space: nowrap; }
.lecon-msg { font-size: var(--font-size-lg); margin-bottom: var(--space-6); }
.lecon-corrections { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.lecon-corrections li { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.lecon-num {
  width: var(--component-lecon-number-disc);
  height: var(--component-lecon-number-disc);
  border: 0;
  border-radius: var(--radius-circle);
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
  cursor: pointer;
}
.lecon-num.ok { background: var(--color-sys-feedback-correct); color: var(--color-sys-text-on-accent); }
.lecon-num.ko { background: var(--color-sys-feedback-wrong-fill); color: var(--color-sys-text-primary); }
.lecon-num[aria-pressed="true"] { outline: var(--border-width-focus) solid var(--color-sys-focus-ring); outline-offset: var(--space-1); }
.lecon-num-label { font-size: var(--font-size-sm); font-weight: 600; }
.lecon-num-label.ok, .lecon-detail-a.ok { color: var(--color-sys-feedback-correct-text); }
.lecon-num-label.ko, .lecon-detail-a.ko { color: var(--color-sys-feedback-wrong-text); }
.lecon-detail { min-height: calc(var(--space-12) + var(--space-8)); }
.lecon-detail-q { margin-bottom: var(--space-1); }
.lecon-detail-a { font-weight: 600; }

.lecon-back:focus-visible, .lecon-option:focus-visible, .lecon-tap:focus-visible, .lecon-num:focus-visible,
.lecon-main:focus-visible, .lecon-play:focus-visible, .lecon-page a:focus-visible, .lecon-son:focus-visible {
  outline: var(--border-width-focus) solid var(--color-sys-focus-ring);
  outline-offset: var(--space-1);
}
.lecon-main:disabled { background: transparent; border: var(--border-width-medium) solid var(--color-sys-border-control); color: var(--color-sys-text-secondary); cursor: default; }

@media (min-width: 760px) {
  .lecon-title { font-size: var(--font-size-3xl); }
  .lecon-actions { flex-direction: row; flex-wrap: wrap; }
  .lecon-actions .lecon-main { flex: 0 1 auto; }
  body:not(.m) .lecon-page { padding-top: var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  .lecon-halo { animation: none; }
  .lecon-reading-bar, .lecon-beat, .lecon-tap { transition: none; }
  .lecon-tap:active { transform: none; }
}

/* Mise en forme des fiches : gras, italique (Newsreader), souligné cuivre, terme défini surligné. Tout reste plat. */
.lecon-page strong { font-weight: 600; }
.lecon-page em { font-family: var(--font-family-display); font-style: italic; font-size: 1.08em; }
.lecon-page u {
  text-decoration: underline;
  text-decoration-color: var(--color-sys-text-accent);
  text-decoration-thickness: var(--border-width-strong);
  text-underline-offset: var(--space-1);
}
.lecon-term {
  padding: 0 var(--space-1);
  margin: 0 calc(-1 * var(--space-1));
  border-radius: var(--radius-sm);
  background: var(--color-sys-tint-copper-soft);
  color: inherit;
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lecon-title::after {
  content: "";
  display: block;
  width: var(--space-12);
  height: var(--border-width-focus);
  margin-top: var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-sys-action-primary);
}
.lecon-section + .lecon-section { padding-top: var(--space-6); border-top: var(--border-width-hairline) solid var(--color-sys-border-subtle); }
.lecon-section h2 { display: flex; align-items: center; gap: var(--space-3); }
.lecon-section h2::before {
  content: "";
  flex: none;
  width: var(--space-3);
  height: var(--space-2);
  border-radius: var(--radius-circle);
  background: var(--color-sys-action-primary);
  transform: rotate(-20deg);
}
.lecon-page .lecon-def { font-size: var(--font-size-lg); line-height: 1.45; }
.lecon-line { font-size: var(--font-size-lg); }
.lecon-why {
  padding-left: var(--space-3);
  border-left: var(--border-width-strong) solid var(--color-sys-border-subtle);
  font-style: italic;
}

/* Parcours « une idée par écran » (js/parcours.js). Aucune couleur en dur : uniquement les variables du design system.
   Couleurs provisoires : la charte refaite les remplacera dans tokens.css. */
.pc-page { padding-bottom: calc(var(--space-16) + var(--space-8)); }
.pc-titre { margin-bottom: var(--space-6); }
.pc-label { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-sys-text-secondary); margin-bottom: var(--space-2); }
.pc-lignes { margin: 0 0 var(--space-6); }
.pc-page .pc-ligne { margin: 0 0 var(--space-1); font-size: var(--font-size-reading); line-height: 1.6; }
.pc-comparaison { padding-left: var(--space-4); border-left: var(--border-width-strong) solid var(--color-sys-border-subtle); color: var(--color-sys-text-secondary); }
.pc-comparaison-tag { display: block; font-size: var(--font-size-xs); font-weight: 600; margin-bottom: var(--space-1); }
.pc-groupe-texte { margin: 0 0 var(--space-6); }
.pc-groupe-texte .pc-lignes { margin: 0; }
.pc-schema { margin: 0 0 var(--space-6); }
.pc-schema svg { display: block; width: 100%; height: auto; max-width: 640px; margin: 0 auto; }
.pc-cote { display: flex; flex-direction: column; gap: var(--space-4); }
.pc-cote .pc-schema { margin: 0; }
.pc-cote .pc-schema svg { max-width: 320px; }
@media (min-width: 760px) {
  .pc-cote { flex-direction: row; align-items: center; gap: var(--space-6); }
  .pc-cote-gauche { flex-direction: row; }
  .pc-cote-droite { flex-direction: row-reverse; }
  .pc-cote .pc-schema { flex: 0 0 44%; }
  .pc-cote .pc-lignes { flex: 1; }
}
.pc-terme { font: inherit; font-weight: 600; color: var(--color-sys-text-accent); background: none; border: 0; border-bottom: 2px dotted currentColor; padding: 0; cursor: pointer; }
.pc-terme[aria-expanded="true"] { background: var(--color-sys-tint-copper-soft); }
.pc-bulle { margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-sys-tint-copper-soft); display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--font-size-md); }
.pc-bulle[hidden] { display: none; }
.pc-bulle-tag { font-size: var(--font-size-xs); font-weight: 600; color: var(--color-sys-text-secondary); }
.pc-bulle-mot { font-weight: 600; }
.pc-bulle-comp { color: var(--color-sys-text-secondary); }
.pc-jeu { margin: var(--space-4) 0; border-radius: var(--radius-md); overflow: hidden; border: var(--border-width-hairline) solid var(--color-sys-border-subtle); }
.pc-jeu-frame { display: block; width: 100%; height: 560px; border: 0; }
.pc-attente { font-size: var(--font-size-sm); color: var(--color-sys-text-secondary); }
.pc-question { font-family: var(--font-family-display); font-size: var(--font-size-xl); line-height: 1.25; margin-bottom: var(--space-4); }
.pc-options { grid-template-columns: 1fr; }
.pc-option { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); text-align: left; }
.pc-option[aria-checked="true"] { border-color: var(--color-sys-text-primary); background: var(--color-sys-bg-raised); }
.pc-option.pc-bonne { border-color: var(--color-sys-feedback-correct); background: var(--color-sys-tint-correct-soft); }
.pc-lettre { flex: none; width: var(--space-8); height: var(--space-8); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--color-sys-bg-page); font-weight: 600; }
.pc-resultats { list-style: none; margin: 0 0 var(--space-8); padding: 0; }
.pc-resultats li { display: flex; justify-content: space-between; align-items: baseline; padding: var(--space-3) 0; border-bottom: var(--border-width-hairline) solid var(--color-sys-border-subtle); }
.pc-section { font-size: var(--font-size-lg); margin: 0 0 var(--space-3); }
.pc-retenir { margin: 0 0 var(--space-8); padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.pc-lexique { margin: 0 0 var(--space-6); }
.pc-lexique dt { font-weight: 600; margin-top: var(--space-3); }
.pc-lexique dd { margin: 0; color: var(--color-sys-text-secondary); }

/* Mise en page : flèches sur les côtés (grand écran) ou en bas (téléphone) */
.pc-rangee { width: 100%; display: flex; align-items: flex-start; justify-content: center; gap: var(--space-4); }
.pc-rangee .lecon-page { flex: 0 1 var(--component-lecon-column-width); min-width: 0; }
.pc-fleche, .pc-fleche-vide { flex: none; width: var(--space-12); height: var(--space-12); }
.pc-fleche { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-circle); border: var(--border-width-strong) solid var(--color-sys-border-control); background: var(--color-sys-bg-raised); color: var(--color-sys-text-primary); cursor: pointer; }
.pc-fleche:hover:not([disabled]) { border-color: var(--color-sys-text-accent); color: var(--color-sys-text-accent); }
.pc-fleche-d:not([disabled]) { background: var(--color-sys-action-primary); border-color: var(--color-sys-action-primary); color: var(--color-sys-text-on-accent); }
.pc-fleche[disabled] { opacity: .4; cursor: not-allowed; }
.pc-fleche[hidden] { display: none; }
.pc-haut { position: sticky; top: 45vh; margin-top: 45vh; }
.pc-barre-bas { display: none; }
@media (max-width: 1000px) {
  .pc-haut { display: none; }
  .pc-barre-bas { display: flex; justify-content: space-between; margin-top: var(--space-6); }
}
.pc-kicker { font-size: var(--font-size-sm); color: var(--color-sys-text-secondary); margin: 0 0 var(--space-1); }
.pc-corps > * { animation: pc-entree var(--motion-duration-slow, 250ms) ease-out both; }
.pc-corps > *:nth-child(2) { animation-delay: 60ms; }
.pc-corps > *:nth-child(3) { animation-delay: 120ms; }
.pc-corps > *:nth-child(n+4) { animation-delay: 180ms; }
@keyframes pc-entree { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pc-corps > * { animation: none; } }
.pc-bulle-tete { display: flex; justify-content: space-between; align-items: center; }
.pc-etoile { border: 0; background: none; padding: var(--space-1); cursor: pointer; color: var(--color-sys-text-secondary); display: inline-flex; border-radius: var(--radius-sm); }
.pc-etoile[aria-pressed="true"] { color: var(--color-sys-reward-score); }
.pc-etoile[aria-pressed="true"] svg path { fill: currentColor; }
.pc-etoile:hover { color: var(--color-sys-text-accent); }
.pc-retenir { background: var(--color-sys-stamp-navy-tint); border-radius: var(--radius-md); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-8); margin: 0 0 var(--space-8); list-style: disc; }
.pc-lexique { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin: 0 0 var(--space-6); }
@media (min-width: 760px) { .pc-lexique { grid-template-columns: 1fr 1fr; } }
.pc-notion { border: var(--border-width-hairline) solid var(--color-sys-border-subtle); border-radius: var(--radius-md); background: var(--color-sys-bg-raised); padding: var(--space-3) var(--space-4); }
.pc-notion h3 { font-size: var(--font-size-md); margin: 0; }
.pc-notion p { margin: var(--space-1) 0 0; font-size: var(--font-size-md); }
.pc-notion-tete { display: flex; justify-content: space-between; align-items: center; }
.pc-touche { cursor: pointer; }
.pc-touche:hover { fill: var(--color-sys-tint-copper-soft); }
.pc-touche:focus-visible { outline: 2px solid var(--color-sys-text-accent); }
.pc-jouee { fill: var(--color-sys-tint-copper-soft); }
.pc-estompe { opacity: .4; }
.pc-joue { min-height: var(--space-6); text-align: center; font-size: var(--font-size-md); color: var(--color-sys-text-secondary); margin-top: var(--space-2); }
/* Jeux des leçons (S'exercer) : pas d'aperçu animé, donc pas de vignette vide. */
.hub-row[data-kind="frame"] .hub-thumb { display: none; }
