/* Police intégrée (licence OFL, voir fonts/OFL.txt) : une seule police variable pour toutes les graisses. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F4EFE6;
  --surface: #FFFCF6;
  --ink: #1E2230;
  --muted: #6D6A72;
  --line: #E3DACB;
  --coral: #EE5A3A;
  --coral-ink: #FFFFFF;
  --teal: #1C9384;
  --sun: #F1B434;
  --good: #1C9384;
  --bad: #D9432A;

  /* Illustrations (jour) */
  --sky-top: #9FD1E8; --sky-bottom: #E8F3EC;
  --sun-disc: #F7C548; --moon-o: 0; --star-o: 0; --glow-o: 0;
  --cloud: #FFFFFF; --cloud-shade: #DCEBF1;
  --hill-far: #C3DDB1; --hill-near: #A9CF8E;
  --tree: #72B05C; --tree-light: #93C878; --tree-dark: #4E8C48; --trunk: #8A5E3F;
  --fence: #FBF4E6; --fence-rail: #E4D6BC;
  --grass-top: #9CCB78; --grass-bottom: #84BA60; --tuft: #6FA84E;
  --walkway: #EFE1C6; --stone: #DCC9A6;
  --wall: #F9EBD5; --wall-line: #EDDABD; --trim: #FFFDF8; --foundation: #CDB99C;
  --roof: #E4573A; --tile-line: #C4432B; --roof-edge: #A9392A; --eave: #943020;
  --chimney: #BE5A43; --chimney-cap: #8E3A2B; --brick: #A84B37;
  --glass-top: #CBE9F5; --glass-bottom: #93C9E0; --curtain: #F3BE4A;
  --door: #7C5037; --door-panel: #694330; --knob: #F1B434; --step: #D8C7AA;
  --lamp: #3B3F4C; --bulb: #FFE7A3;
  --bush: #5B9B47; --bush-light: #7DB860; --berry: #F2603F;
  --planter: #A8674A; --leaf: #5E9E4A;
  --room: #F4DFBC; --room-line: #EAD0A4; --baseboard: #D8B98E; --floor: #CFA173; --floor-line: #B98A5D;
  --pic-frame: #7C5037; --pic: #CBE9F5; --pic-hill: #84BA60; --clock-face: #FFFDF8;
  --smoke: #FFFFFF; --dust: #E3D4B8; --shade: #1E2230;

  --c-rouge: #D63A2A; --c-bleu: #2F62D6; --c-vert: #178A52; --c-violet: #A2379F;
  --c-azur: #0B6FC4; --c-orange: #C75A00; --c-rose: #B8478F; --c-noir: #23283A; --c-blanc: #F3F0EA;

  --meter-track: #F6DDD4;

  --radius: 22px;
  --font: 'Bricolage Grotesque', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171E;
    --surface: #1F222B;
    --ink: #F1ECE3;
    --muted: #9C99A3;
    --line: #2D313C;
    --coral: #F26C4D;
    --teal: #3DB5A5;
    --good: #3DB5A5;
    --bad: #F2694B;


    /* Illustrations (nuit) */
    --sky-top: #0D1730; --sky-bottom: #2C3C62;
    --sun-disc: #F1EAD2; --moon-o: 1; --star-o: .9; --glow-o: .65;
    --cloud: #33425E; --cloud-shade: #2A3751;
    --hill-far: #1E3048; --hill-near: #21393B;
    --tree: #2B5037; --tree-light: #376244; --tree-dark: #21432E; --trunk: #3F2E22;
    --fence: #676C7D; --fence-rail: #515666;
    --grass-top: #2E4F35; --grass-bottom: #24412B; --tuft: #3A6242;
    --walkway: #4B4842; --stone: #5B574F;
    --wall: #A8977D; --wall-line: #978770; --trim: #CEC5B4; --foundation: #6E655A;
    --roof: #A3402D; --tile-line: #843222; --roof-edge: #6E2719; --eave: #5A2015;
    --chimney: #8A4434; --chimney-cap: #5E2C22; --brick: #733829;
    --glass-top: #FFE08A; --glass-bottom: #F4B64A; --curtain: #E0873A;
    --door: #4E3324; --door-panel: #42291D; --step: #6E6558;
    --lamp: #23262F; --bulb: #FFE9A8;
    --bush: #2F5A33; --bush-light: #3C6D41; --berry: #C95038;
    --planter: #6E4432; --leaf: #3A6242;
    --room: #F0D39C; --room-line: #E4C487; --baseboard: #C79E68; --floor: #B98556; --floor-line: #A07147;
    --pic-frame: #6A4330; --pic: #9CC3D6; --clock-face: #FFF6E0;
    --smoke: #8D98AE; --dust: #6E6A62;
    --meter-track: #3A2A27;
    --c-rouge: #FF6B57; --c-bleu: #6E9BFF; --c-vert: #3CC486; --c-violet: #D67AD8;
    --c-azur: #3F95F0; --c-orange: #F29A2E; --c-rose: #FF94BE; --c-blanc: #F3F0EA;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1, h2, p, ol, ul { margin: 0; }

#app { min-height: 100dvh; }

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 24px);
  animation: enter .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

.top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.94); }

/* Accueil */
.hello { margin: 22px 0 18px; }
.date { color: var(--muted); font-size: 15px; }
.date::first-letter { text-transform: uppercase; }
.hello h1 { font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.hello h1 span { color: var(--muted); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; }

.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.games { list-style: none; padding: 0; display: grid; gap: 12px; }
.card {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px;
}
.card.game { transition: transform .12s, box-shadow .2s; box-shadow: 0 1px 0 var(--line), 0 8px 24px -16px rgba(30, 34, 48, .35); }
.card.game:active { transform: scale(.98); }
.thumb {
  flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--bg);
  display: grid; place-items: center; overflow: hidden;
}
.thumb svg { width: 64px; height: 64px; }
.card-body { flex: 1; display: grid; gap: 2px; min-width: 0; }
.card-title { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.card-skill { color: var(--muted); font-size: 14px; }
.card-meta { text-align: right; font-size: 13px; color: var(--muted); line-height: 1.25; }
.card-meta b { color: var(--coral); font-size: 16px; }
.card.soon { opacity: .6; }
.card.soon .thumb svg { filter: saturate(.55); }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); }

/* Règles */
.intro { display: flex; flex-direction: column; }
.intro-art { width: 132px; height: 132px; border-radius: 34px; background: var(--bg); margin: 18px 0 20px; display: grid; place-items: center; overflow: hidden; }
.intro-art svg { width: 132px; height: 132px; }
.intro-title { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.intro-tag { color: var(--muted); font-size: 18px; margin-top: 10px; }
.rules { list-style: none; padding: 0; margin: 26px 0 18px; counter-reset: r; display: grid; gap: 14px; }
.rules li { counter-increment: r; display: flex; gap: 14px; align-items: flex-start; }
.rules li::before {
  content: counter(r); flex: none; width: 30px; height: 30px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-weight: 800; display: grid; place-items: center; font-size: 15px;
}
.intro-meta { color: var(--muted); font-size: 14px; }
.bottom-bar { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
.bottom-bar.two { grid-template-columns: 1fr 1.4fr; }
.btn {
  height: 58px; border-radius: 18px; font-weight: 800; font-size: 18px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--coral); color: var(--coral-ink); border-color: transparent; box-shadow: 0 10px 24px -12px var(--coral); }

/* Jeu */
.screen.game { padding: 0; }
.play { position: relative; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.play-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
}
.progress { list-style: none; padding: 0; display: flex; gap: 6px; }
.progress li { width: 22px; height: 8px; border-radius: 99px; background: var(--line); transition: background .3s, transform .3s; }
.progress li.current { background: var(--ink); transform: scaleX(1.3); }
.progress li.ok { background: var(--good); }
.progress li.ko { background: var(--bad); }
.lvl { min-width: 44px; text-align: right; color: var(--muted); font-size: 15px; }
.lvl b { color: var(--ink); font-size: 18px; }

.stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 12px 24px; transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.scene-wrap { position: relative; width: 100%; }
.scene { width: 100%; border-radius: 26px; display: block; }
.stage-msg {
  position: absolute; left: 50%; top: 14px; transform: translate(-50%, -6px);
  background: var(--surface); color: var(--ink); font-weight: 800; font-size: 18px;
  padding: 8px 16px; border-radius: 99px; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.stage-msg.show { opacity: 1; transform: translate(-50%, 0); }
.stage-msg.good { background: var(--good); color: #fff; }
.stage-msg.bad { background: var(--bad); color: #fff; }

/* Illustrations : toutes les couleurs viennent des variables ci-dessus. */
.art-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.art .sky-top { stop-color: var(--sky-top); }
.art .sky-bottom { stop-color: var(--sky-bottom); }
.art .grass-top { stop-color: var(--grass-top); }
.art .grass-bottom { stop-color: var(--grass-bottom); }
.art .glass-top { stop-color: var(--glass-top); }
.art .glass-bottom { stop-color: var(--glass-bottom); }
.art .glow-in { stop-color: var(--sun-disc); stop-opacity: .5; }
.art .glow-out { stop-color: var(--sun-disc); stop-opacity: 0; }
.art .warm-in { stop-color: #FFCF5C; stop-opacity: .85; }
.art .warm-out { stop-color: #FFCF5C; stop-opacity: 0; }
.art .glow { opacity: var(--glow-o); }
.art .sun { fill: var(--sun-disc); opacity: calc(1 - var(--moon-o)); }
.art .moon { fill: var(--sun-disc); opacity: var(--moon-o); }
.art .star { fill: #FFF4D6; opacity: var(--star-o); }
.art .cloud { fill: var(--cloud); }
.art .cloud-shade { fill: var(--cloud-shade); }
.art .hill-far { fill: var(--hill-far); }
.art .hill-near { fill: var(--hill-near); }
.art .tree { fill: var(--tree); }
.art .tree-light { fill: var(--tree-light); }
.art .tree-dark { fill: var(--tree-dark); }
.art .trunk { fill: var(--trunk); }
.art .fence { fill: var(--fence); }
.art .fence-rail { fill: var(--fence-rail); }
.art .tuft { fill: var(--tuft); }
.art .stem { stroke: var(--tuft); stroke-width: 1.4; stroke-linecap: round; }
.art .walkway { fill: var(--walkway); }
.art .stone { fill: var(--stone); }
.art .house-shadow { fill: var(--shade); opacity: .12; }
.art .p-shadow { fill: var(--shade); opacity: .18; }
.art .shade { fill: var(--shade); opacity: .13; }
.art .wall { fill: var(--wall); }
.art .wall-line { fill: var(--wall-line); }
.art .trim { fill: var(--trim); }
.art .foundation { fill: var(--foundation); }
.art .curtain { fill: var(--curtain); opacity: .9; }
.art .planter { fill: var(--planter); }
.art .leaf { fill: var(--leaf); }
.art .door { fill: var(--door); }
.art .door-panel { fill: var(--door-panel); }
.art .knob { fill: var(--knob); }
.art .step { fill: var(--step); }
.art .cord { stroke: var(--lamp); stroke-width: 1.2; }
.art .lamp { fill: var(--lamp); }
.art .bulb { fill: var(--bulb); }
.art .bush { fill: var(--bush); }
.art .bush-light { fill: var(--bush-light); }
.art .berry { fill: var(--berry); }
.art .roof { fill: var(--roof); }
.art .tile-line { fill: none; stroke: var(--tile-line); stroke-width: 1.4; }
.art .fascia { fill: none; stroke: var(--roof-edge); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }
.art .eave { fill: var(--eave); }
.art .attic-bar { stroke: var(--trim); stroke-width: 2; }
.art .chimney { fill: var(--chimney); }
.art .chimney-cap { fill: var(--chimney-cap); }
.art .brick { stroke: var(--brick); stroke-width: 1.2; fill: none; }
.art .smoke { fill: var(--smoke); }
.art .dust { fill: var(--dust); }
.art .room { fill: var(--room); }
.art .room-line { stroke: var(--room-line); stroke-width: 4; }
.art .baseboard { fill: var(--baseboard); }
.art .floor { fill: var(--floor); }
.art .floor-line { fill: var(--floor-line); }
.art .pic-frame { fill: var(--pic-frame); }
.art .pic { fill: var(--pic); }
.art .pic-hill { fill: var(--pic-hill); }
.art .clock-face { fill: var(--clock-face); }
.art .clock-hand { stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; }
.art .lampshade { fill: var(--coral); }
.art .badge circle { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.art .badge text { fill: var(--surface); font-family: var(--font); font-weight: 800; font-size: 11px; text-anchor: middle; }
.art .glyph { fill: #fff; font-family: var(--font); font-weight: 800; font-size: 20px; text-anchor: middle; }
.art .glyph.ink { fill: #23283A; }

@media (prefers-color-scheme: dark) {
  .art .star { animation: twinkle 3.2s ease-in-out infinite; }
}
@keyframes twinkle { 50% { opacity: calc(var(--star-o) * .35); } }

.answer {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
  box-shadow: 0 -16px 40px -20px rgba(0, 0, 0, .35);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  max-width: 480px; margin: 0 auto;
}
.answer.open { transform: none; }
.q { text-align: center; font-weight: 600; color: var(--muted); font-size: 16px; }
.display {
  text-align: center; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.03em;
  margin: 8px 0 14px;
}
.display.empty { color: var(--line); }
.display.nudge { animation: nudge .3s; }
@keyframes nudge { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button {
  height: 58px; border-radius: 16px; background: var(--bg); font-size: 26px; font-weight: 800;
  display: grid; place-items: center; transition: transform .08s, background .15s;
  touch-action: manipulation; user-select: none;
}
.pad button:active { transform: scale(.94); background: var(--line); }
.pad .pad-alt { color: var(--muted); }
.pad .pad-ok { background: var(--coral); color: var(--coral-ink); font-size: 20px; }
.pad .pad-ok:active { background: var(--coral); filter: brightness(.92); }

/* Calcul express */
.calc-bar { flex: 1; max-width: 220px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.calc-bar i { display: block; height: 100%; background: var(--teal); transform-origin: left; transform: scaleX(0); transition: transform .25s; }
.calc-timer { position: relative; min-width: 76px; text-align: right; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.calc-penalty { position: absolute; right: 0; top: 100%; color: var(--bad); font-size: 14px; opacity: 0; pointer-events: none; }
.calc-penalty.show { animation: penalty 1s ease-out; }
@keyframes penalty { 0% { opacity: 0; transform: translateY(-4px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

.calc-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 0 24px 12px; }
.deck { position: relative; width: min(100%, 340px); aspect-ratio: 1.45; }
.calc-card {
  position: absolute; inset: 0; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 20px 40px -28px rgba(30, 34, 48, .5);
}
.calc-card.b1 { transform: translateY(13px) scale(.94); opacity: .8; }
.calc-card.b2 { transform: translateY(26px) scale(.88); opacity: .5; }
.calc-card.enter { animation: card-in .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes card-in { from { transform: translateY(13px) scale(.94); } }
.calc-card.leave { transition: transform .24s ease-in, opacity .24s ease-in; transform: translateX(-115%) rotate(-9deg); opacity: 0; }
.calc-card.shake { animation: nudge .3s; }
.calc-q { font-size: 58px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-a { margin-top: 16px; font-size: 44px; font-weight: 800; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-a .slot { display: inline-block; min-width: 1.2ch; color: var(--coral); }
.calc-a .slot.empty { color: var(--line); }
.calc-a .fix { color: var(--good); }
.calc-a s { color: var(--bad); opacity: .75; text-decoration-thickness: 4px; margin-right: 8px; }
.calc-go { font-size: 104px; font-weight: 800; line-height: 1; color: var(--coral); }
.stamp {
  position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; transform: scale(0) rotate(-30deg);
}
.stamp.ok { background: var(--good); }
.stamp.ko { background: var(--bad); }
.stamp.show { transition: transform .22s cubic-bezier(.3, 1.6, .5, 1); transform: scale(1) rotate(-10deg); }
.calc-count { color: var(--muted); font-size: 15px; font-weight: 600; text-align: center; }
.calc-pad {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 28px 28px 0 0;
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
}

/* Couleurs piégées */
.stroop-time, .time-bar { flex: 1; max-width: 220px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.stroop-time i, .time-bar i { display: block; height: 100%; background: var(--teal); transform-origin: left; transition: background .3s; }
.stroop-time.low i, .time-bar.low i { background: var(--coral); }
.stroop-hits { min-width: 76px; text-align: right; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.stroop-hits b { color: var(--good); }
.stroop-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 24px 12px; }
.stroop-rule {
  font-weight: 800; font-size: 17px; padding: 10px 20px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); transition: background .15s, color .15s;
}
.stroop-rule.mot { background: var(--ink); color: var(--bg); border-color: transparent; }
.stroop-card {
  width: min(100%, 340px); aspect-ratio: 1.6; border-radius: 30px; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line);
  box-shadow: 0 20px 40px -28px rgba(30, 34, 48, .5);
}
.stroop-card.ok { animation: stroop-ok .25s; }
.stroop-card.ko { animation: nudge .3s; border-color: var(--bad); }
@keyframes stroop-ok { 0% { border-color: var(--good); } 100% { border-color: var(--line); } }
.stroop-word { font-size: 60px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.stroop-word.go { color: var(--coral); font-size: 88px; }
.ink-rouge { color: var(--c-rouge); }
.ink-bleu { color: var(--c-bleu); }
.ink-vert { color: var(--c-vert); }
.ink-violet { color: var(--c-violet); }
.ink-azur { color: var(--c-azur); }
.ink-orange { color: var(--c-orange); }
.ink-rose { color: var(--c-rose); }
.ink-noir { color: var(--c-noir); }
.ink-blanc { color: var(--c-blanc); }
.stroop-pad {
  width: 100%; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 28px 28px 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
}
.stroop-pad button {
  height: 78px; border-radius: 18px; background: var(--bg); color: var(--ink);
  font-size: 22px; font-weight: 800; letter-spacing: .05em;
  transition: transform .08s, background .15s; touch-action: manipulation; user-select: none;
}
.stroop-pad button:active { transform: scale(.95); background: var(--line); }
.stroop-pad button.hint { box-shadow: inset 0 0 0 3px var(--good); }

/* Mots à retenir */
.mots-body { flex: 1; overflow-y: auto; padding: 8px 20px 16px; }
.mots-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-align: center; margin: 6px 0 4px; }
.mots-sub { text-align: center; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.mots-sub.nudge { animation: nudge .3s; color: var(--bad); }
.mots-list { list-style: none; padding: 0; margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mots-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 8px; text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -0.01em;
  animation: enter .35s cubic-bezier(.2, .8, .2, 1) both;
}
.mots-ready { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.mots-big { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--coral); }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip {
  min-height: 46px; padding: 6px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  font-size: 15px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere;
  transition: transform .08s, background .15s, color .15s; touch-action: manipulation;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 800; }
.chip.hit { background: var(--good); color: #fff; border-color: var(--good); font-weight: 800; }
.chip.wrong { background: var(--bad); color: #fff; border-color: var(--bad); text-decoration: line-through; }
.chip.missed { background: var(--surface); color: var(--good); border: 2px dashed var(--good); font-weight: 800; }
.chip.dim { opacity: .4; }
.chip:disabled { cursor: default; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; }
.key.hit { background: var(--good); }
.key.missed { border: 2px dashed var(--good); }
.key.wrong { background: var(--bad); }
.mots-bar { width: 100%; max-width: 480px; margin: 0 auto; padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); }
.mots-bar .btn { width: 100%; }
.mots-bar .btn:disabled { opacity: .45; box-shadow: none; }

/* Réglages d'un jeu */
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-top: 16px;
}
.option-text { display: grid; gap: 2px; }
.option-text b { font-size: 16px; }
.option-text small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.option input {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
  width: 50px; height: 30px; border-radius: 99px; background: var(--line); transition: background .2s;
}
.option input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.option input:checked { background: var(--teal); }
.option input:checked::after { transform: translateX(20px); }
.option input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* Séance du jour */
.seance-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  padding: 18px; margin-bottom: 12px;
  box-shadow: 0 1px 0 var(--line), 0 14px 30px -22px rgba(30, 34, 48, .45);
}
.seance-card .kicker { margin: 0; }
.seance-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 14px; }
.seance-card.done h2 { margin-bottom: 2px; font-size: 30px; }
.seance-card.done .muted { font-size: 15px; }
.seance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.seance-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.seance-thumb { flex: none; width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.seance-thumb svg { width: 100%; height: 100%; }
.seance-arrow { color: var(--muted); display: grid; }
.seance-card .btn { width: 100%; }
.btn.subtle { height: 48px; font-size: 16px; background: var(--bg); border-color: transparent; }

.week-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 14px 16px; margin-bottom: 28px; }
.week-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; color: var(--muted); }
.week-head b { color: var(--ink); font-size: 18px; }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--coral); font-weight: 800; font-size: 15px; padding: 6px 0; }
.week { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-day { font-size: 13px; font-weight: 600; color: var(--muted); }
.week li.is-today .week-day { color: var(--ink); font-weight: 800; }
.week li > :last-child { width: 36px; height: 36px; display: grid; place-items: center; }
.day-dot { position: relative; }
.day-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.week li.missed .day-dot::after { background: var(--muted); opacity: .45; }
.day-ring { border-radius: 50%; border: 2px dashed var(--coral); }

/* Tampon d'un jour joué : une seule teinte, du clair (score bas) au foncé (score haut). */
.day-stamp { --size: 36px; position: relative; width: var(--size); height: var(--size); display: inline-grid; place-items: center; transform: rotate(-8deg); flex: none; }
.day-stamp svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.day-stamp b { position: relative; font-size: calc(var(--size) * .36); font-weight: 800; letter-spacing: -0.02em; }
.day-stamp.t1 path { fill: #F8D5C9; stroke: #F3A58D; stroke-width: 1.2; } .day-stamp.t1 b { color: #6B2A1A; }
.day-stamp.t2 path { fill: #F3A58D; } .day-stamp.t2 b { color: #5A1F10; }
.day-stamp.t3 path { fill: #C84A2C; } .day-stamp.t3 b { color: #FFFFFF; }
.day-stamp.t4 path { fill: #8F2A12; } .day-stamp.t4 b { color: #FFFFFF; }
.day-stamp.drop { animation: stamp-drop .5s 1.05s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes stamp-drop {
  from { transform: scale(2.8) rotate(-30deg); opacity: 0; }
  55% { opacity: 1; }
  to { transform: scale(1) rotate(-8deg); opacity: 1; }
}
/* En mode sombre, l'ancre s'inverse : les scores hauts sont les plus lumineux. */
@media (prefers-color-scheme: dark) {
  .day-stamp.t1 path { fill: #4A2B25; stroke: #6A362B; } .day-stamp.t1 b { color: #F1C4B6; }
  .day-stamp.t2 path { fill: #7C3A2A; } .day-stamp.t2 b { color: #FFE3D9; }
  .day-stamp.t3 path { fill: #BF4F34; } .day-stamp.t3 b { color: #FFFFFF; }
  .day-stamp.t4 path { fill: #FF8B6C; } .day-stamp.t4 b { color: #2A0F08; }
}

.top-title { font-weight: 800; font-size: 17px; }
.top-spacer { width: 44px; }
.rail { list-style: none; padding: 0; margin: 16px 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rail li {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 10px 6px; border-radius: 18px; border: 1px solid transparent;
}
.rail li.current { background: var(--surface); border-color: var(--line); }
.rail li.next { opacity: .5; }
.rail .seance-thumb { width: 52px; height: 52px; border-radius: 14px; }
.rail-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.rail-score { font-size: 13px; font-weight: 800; color: var(--good); }
.rail-last { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; font-size: 15px; margin-bottom: 18px; }
.seance-step .kicker { margin-top: 4px; }
.seance-step .intro-title { margin-top: 2px; }

.parts { list-style: none; padding: 0; margin: 20px 0 16px; display: grid; gap: 12px; }
.parts li { display: grid; grid-template-columns: 9.5em 1fr 2.2em; align-items: center; gap: 12px; font-size: 15px; }
.parts li b { text-align: right; font-size: 17px; }
.meter { height: 10px; border-radius: 99px; background: var(--meter-track); overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--coral); border-radius: 99px; }
.seance-end .week-card { margin: 4px 0 8px; }

/* Progrès */
.page-title { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 14px 0 16px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 14px; color: var(--muted); }
.tile b { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { font-size: 18px; font-weight: 800; text-transform: capitalize; }
.panel-title { font-size: 18px; font-weight: 800; }
.panel-sub { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.icon-btn.sm { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); border-color: transparent; }
.icon-btn.flip svg { transform: scaleX(-1); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.cal-day { height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); font-weight: 800; }
.cal-day.done { padding: 0; }
.cal-day.selected { background: var(--bg); }
.day-detail { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; font-size: 15px; }
.day-detail .parts { margin: 10px 0 0; }
.detail-date::first-letter { text-transform: uppercase; }

.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; border-radius: 8px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--coral); stroke: var(--surface); stroke-width: 2; }
.chart-end { fill: var(--ink); font-family: var(--font); font-size: 13px; font-weight: 800; }
.chart-cross { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.chart-cross.on { opacity: 1; }
.chart-tip[hidden] { display: none; }
.chart-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 6px 10px; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.3;
}
.chart-tip b { font-size: 15px; }
.chart-empty { padding: 18px 0 6px; font-size: 15px; }

/* Résultat */
.result { display: flex; flex-direction: column; }
.kicker { margin-top: 16px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.score { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.score b { font-size: 104px; line-height: .95; font-weight: 800; letter-spacing: -0.05em; color: var(--coral); }
.score span { font-size: 32px; font-weight: 800; color: var(--muted); }
.verdict { font-size: 22px; font-weight: 600; margin-top: 8px; letter-spacing: -0.01em; }
.badge { align-self: flex-start; margin-top: 10px; background: var(--sun); color: #3A2A05; font-weight: 800; padding: 8px 14px; border-radius: 16px; font-size: 15px; }
.recap { list-style: none; padding: 0; margin: 24px 0 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.recap li { display: grid; grid-template-columns: 1fr auto minmax(64px, auto); align-items: baseline; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.recap li:first-child { border-top: 0; }
.recap li > span:last-child { text-align: right; font-weight: 800; }
.recap li.ok > span:last-child { color: var(--good); }
.recap li.ko > span:last-child { color: var(--bad); }
.muted { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .answer, .stage-msg, .progress li { transition: none; }
}
