/* À vos tables ! — interface tactile d'abord, grosses cibles, couleurs vives mais lisibles. */
@font-face { font-family: 'Lexend'; font-weight: 100 900; font-display: swap; src: url('/vendor/lexend-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lexend'; font-weight: 100 900; font-display: swap; src: url('/vendor/lexend-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'OpenDyslexic'; font-weight: 400; font-display: swap; src: url('/vendor/opendyslexic-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'OpenDyslexic'; font-weight: 700; font-display: swap; src: url('/vendor/opendyslexic-latin-700-normal.woff2') format('woff2'); }

:root {
  --scale: 1;
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #243b53;
  --muted: #5d7089;
  --line: #e6dccb;
  --brand: #ff6b4a;
  --brand-dark: #d94a2b;
  --teal: #1f9d8f;
  --teal-dark: #167a6f;
  --sun: #ffc93c;
  --good: #1f9d55;
  --good-bg: #dff5e6;
  --bad: #d64545;
  --bad-bg: #fde4e4;
  --skip: #c77700;
  --skip-bg: #fff0d6;
  --shadow: 0 3px 0 rgba(36, 59, 83, 0.12), 0 8px 20px rgba(36, 59, 83, 0.08);
  --radius: 20px;
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --track: normal;
  --lh: 1.45;
}
:root[data-font='dys'] { --font: 'OpenDyslexic', 'Lexend', system-ui, sans-serif; }
:root[data-spacing='large'] { --track: 0.06em; --lh: 1.9; }
:root[data-contrast='high'] {
  --bg: #ffffff; --ink: #000; --muted: #222; --line: #000; --brand: #c2410c; --brand-dark: #7c2d12; --teal: #0b5d55; --teal-dark: #063e39;
  --good: #0a6b30; --good-bg: #c9f2d6; --bad: #a80000; --bad-bg: #ffd5d5; --skip: #7a4300; --skip-bg: #ffe3b0;
}

* { box-sizing: border-box; }
html { font-size: calc(16px * var(--scale)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: var(--lh); letter-spacing: var(--track); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
:root[data-contrast='high'] .panel, :root[data-contrast='high'] .mode, :root[data-contrast='high'] .tile, :root[data-contrast='high'] .answer { border: 2px solid #000; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 0.6rem; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid #3a86ff; outline-offset: 2px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }
.lead { font-size: 1.1rem; }

/* ----- Barre du haut ----- */
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--card); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); white-space: nowrap; }
.brand img { border-radius: 10px; }
.spacer { flex: 1; }
.chip, .avatar-btn { display: flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0.2rem 0.7rem; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.chip[hidden] { display: none; }
.avatar-btn > span:first-child { font-size: 1.5rem; line-height: 1; }
.icon-btn { min-width: 44px; min-height: 44px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-size: 1.25rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.back { font-weight: 800; }
.belt-icon { display: inline-flex; }
@media (max-width: 560px) { .chip-text { display: none; } .brand span { font-size: 1rem; } }
@media (max-width: 440px) { .brand span { display: none; } #topbar { gap: 0.35rem; padding: 0.5rem; } }

#view { max-width: 920px; margin: 0 auto; padding: 1rem 0.9rem 3rem; }

/* ----- Boutons / panneaux ----- */
.panel { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.btn { min-height: 52px; padding: 0.5rem 1.2rem; border: 2px solid var(--line); border-radius: 16px; background: #fff; font-weight: 700; box-shadow: 0 3px 0 rgba(36, 59, 83, 0.15); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--brand); border-color: var(--brand-dark); color: #fff; }
:root[data-contrast='high'] .btn.primary { background: var(--brand); }
.btn.big { min-height: 64px; font-size: 1.2rem; padding: 0.6rem 1.8rem; }
.btn.small { min-height: 40px; padding: 0.2rem 0.8rem; font-size: 0.9rem; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1rem; }
.notice { background: var(--skip-bg); border: 2px solid var(--sun); border-radius: 14px; padding: 0.7rem 0.9rem; font-weight: 600; }

/* ----- Accueil ----- */
.home h1 { margin-top: 0.3rem; }
.modes { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); margin: 1rem 0; }
.mode { display: flex; align-items: center; gap: 0.9rem; padding: 1rem; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); box-shadow: var(--shadow); min-height: 96px; }
.mode:active { transform: translateY(2px); }
.mode-ico { font-size: 2.6rem; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 18px; background: var(--c, #eee); flex: none; }
.mode-body { display: flex; flex-direction: column; }
.mode-body strong { font-size: 1.15rem; }
.mode-body small { color: var(--muted); font-size: 0.88rem; line-height: 1.3; }
.m-voice { --c: #ffd9cf; } .m-flash { --c: #fff0b8; } .m-holes { --c: #d4f1ee; } .m-duel { --c: #e3dbff; } .m-ship { --c: #d3e6ff; }
.m-voice { border-color: var(--brand); }
.next-goal { display: block; }
.meter { display: block; height: 14px; border-radius: 999px; background: #eee3d0; overflow: hidden; margin-top: 0.5rem; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--sun)); border-radius: 999px; }

/* ----- Choix des tables ----- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.7rem; margin: 1rem 0; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-height: 88px; padding: 0.5rem; border-radius: 18px; border: 3px solid var(--line); background: #fff; box-shadow: var(--shadow); font-weight: 800; }
.tile-n { font-size: 1.6rem; }
.tile.s1 { background: #fff7dc; } .tile.s2 { background: #e6f7ea; border-color: #8fd3a5; } .tile.s3 { background: #ffeeb0; border-color: var(--sun); }
.tile.sel { border-color: var(--teal); background: #d9f3f0; outline: 3px solid var(--teal); }
.stars { display: inline-flex; gap: 0.05rem; font-size: 1.1rem; color: #d6cdbb; line-height: 1; }
.stars .on { color: #f5a300; }
.stars.big { font-size: 3rem; gap: 0.3rem; }
.stars.big .on { animation: pop 0.5s ease backwards; }
.stars.big span:nth-child(2).on { animation-delay: 0.2s; } .stars.big span:nth-child(3).on { animation-delay: 0.4s; }
.quick { display: flex; gap: 0.5rem; justify-content: center; }
.opts { display: grid; gap: 0.6rem; margin: 1rem auto; max-width: 560px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.opt-label { font-weight: 600; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.seg button { min-height: 44px; padding: 0.3rem 0.9rem; border: 0; background: transparent; font-weight: 600; border-right: 2px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--teal); color: #fff; }
.switch { width: 62px; height: 36px; border-radius: 999px; border: 2px solid var(--line); background: #ddd; position: relative; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch.on { background: var(--teal); } .switch.on i { transform: translateX(26px); }

/* ----- Récitation ----- */
.intro, .record, .waiting, .revise { text-align: center; }
.demo { list-style: none; padding: 0; margin: 1rem auto; max-width: 340px; }
.demo-line { padding: 0.5rem 1rem; margin: 0.4rem 0; border-radius: 14px; background: #f6efe0; font-size: 1.6rem; font-weight: 800; opacity: 0.45; transition: all 0.3s; }
.demo-line.lit { opacity: 1; background: var(--good-bg); transform: scale(1.06); color: var(--good); }
.say { font-style: italic; color: var(--teal-dark); font-weight: 600; }
.rhythm-light { width: 46px; height: 46px; border-radius: 50%; margin: 0.5rem auto; background: #e5dcc9; }
.rhythm-light.pulse { animation: pulse-light 0.7s ease-out; }
.wave { width: 100%; max-width: 600px; height: 120px; display: block; margin: 0.5rem auto; background: #fff3ee; border-radius: 16px; }
.rec-time { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-status { color: var(--brand-dark); font-weight: 700; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 8px solid #f1e3cd; border-top-color: var(--brand); margin: 1rem auto; animation: spin 0.9s linear infinite; }
.revise-list { list-style: none; padding: 0; margin: 1rem auto; max-width: 420px; display: grid; gap: 0.5rem; }
.revise-row { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1rem; border-radius: 14px; background: #fff; border: 2px solid var(--line); font-size: 1.3rem; cursor: pointer; min-height: 52px; }
.revise-row.lit { background: var(--good-bg); border-color: var(--good); transform: scale(1.03); }

/* ----- Résultats ----- */
.result { text-align: center; }
.result-emoji { font-size: 4rem; line-height: 1; }
.score-big { font-size: 2.6rem; font-weight: 800; margin: 0.2rem 0 0.4rem; color: var(--teal-dark); }
.result-stars { margin: 0.5rem 0; }
.unlock { display: flex; align-items: center; gap: 0.9rem; text-align: left; margin: 0.7rem auto; max-width: 440px; padding: 0.8rem 1rem; border-radius: 16px; background: #fff3c4; border: 2px solid var(--sun); animation: pop 0.5s ease backwards; }
.unlock p { margin: 0; font-size: 0.9rem; }
.badge-ico { font-size: 2.2rem; line-height: 1; }
.mistakes { max-width: 460px; margin: 1rem auto 0; text-align: left; }
.mistakes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.mistakes li { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.4rem 0.4rem 0.9rem; border-radius: 12px; background: var(--bad-bg); font-size: 1.15rem; }
.recap { text-align: left; max-width: 560px; margin: 1rem auto 0; }
.lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.line { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 14px; font-size: 1.1rem; }
.line.ok { background: var(--good-bg); color: var(--good); font-weight: 700; }
.line.bad { background: var(--bad-bg); }
.line.skip { background: var(--skip-bg); }
.line .mark { font-size: 1.3rem; flex: none; }
.line .fix { display: flex; flex-direction: column; flex: 1; gap: 0.1rem; }
.line.bad .said { color: var(--bad); font-weight: 700; }
.line.skip .said { color: var(--skip); font-weight: 700; }
.line .right { color: var(--good); font-weight: 700; }
.recap-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.8rem; }
.heard { margin-top: 0.8rem; color: var(--muted); font-size: 0.9rem; }
.listen { background: #fff; flex: none; }

/* ----- Éclair / À trous ----- */
.quiz { text-align: center; max-width: 620px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; font-weight: 700; color: var(--muted); }
.streak { color: var(--brand-dark); }
.progress-line { height: 10px; border-radius: 999px; background: #eee3d0; margin: 0.4rem 0; overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--teal); transition: width 0.3s; }
.timerbar { height: 16px; border-radius: 999px; background: #eee3d0; overflow: hidden; margin: 0.4rem 0 0.8rem; }
.timerbar.none { background: transparent; }
.timerbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--sun)); transform-origin: left; animation: shrink linear forwards; }
.question { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0.6rem; font-size: clamp(2.6rem, 11vw, 4.4rem); font-weight: 800; padding: 1rem 0 1.2rem; }
.question .hole { min-width: 1.6em; border-bottom: 5px dashed var(--brand); color: var(--brand-dark); }
.question.good .hole { color: var(--good); border-color: var(--good); border-bottom-style: solid; }
.question.bad .hole { color: var(--bad); border-color: var(--bad); border-bottom-style: solid; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.answer { position: relative; min-height: 84px; border-radius: 20px; border: 3px solid var(--line); background: #fff; font-size: 2.2rem; font-weight: 800; box-shadow: var(--shadow); }
.answer small { position: absolute; top: 6px; left: 12px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.answer:active:not(:disabled) { transform: translateY(2px); }
.answer.right { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.answer.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.answer:disabled { cursor: default; }
.feedback { min-height: 2rem; margin-top: 0.8rem; font-size: 1.25rem; font-weight: 800; }
.feedback.good { color: var(--good); } .feedback.bad { color: var(--bad); }
.keypad-wrap { max-width: 340px; margin: 0 auto; }
.typed { font-size: 2.6rem; font-weight: 800; min-height: 3.6rem; border-bottom: 4px solid var(--line); margin-bottom: 0.7rem; }
.typed.good { color: var(--good); } .typed.bad { color: var(--bad); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.keypad.done { opacity: 0.5; pointer-events: none; }
.key { min-height: 66px; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-size: 1.8rem; font-weight: 800; box-shadow: var(--shadow); }
.key.ok { background: var(--teal); color: #fff; border-color: var(--teal-dark); }

/* ----- Duel ----- */
.duel { display: flex; flex-direction: column; height: calc(100dvh - 76px); min-height: 520px; margin: -0.4rem -0.4rem 0; gap: 0.4rem; }
.duel-half { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem; padding: 0.6rem 0.8rem; border-radius: 22px; border: 4px solid; transition: background 0.2s; min-height: 0; }
.duel-half.p1 { background: #e3f0ff; border-color: #3a86ff; } .duel-half.p2 { background: #ffe9d6; border-color: #ff8c1a; }
.duel.flip .duel-half.p2 { transform: rotate(180deg); }
.duel-half.won { background: var(--good-bg); border-color: var(--good); } .duel-half.lost { opacity: 0.8; }
.duel-head { display: flex; align-items: center; justify-content: space-between; }
.pips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.pips i { width: 14px; height: 14px; border-radius: 50%; background: rgba(0, 0, 0, 0.15); }
.pips i.on { background: var(--sun); box-shadow: 0 0 0 2px #b88400 inset; }
.duel-q { text-align: center; font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; line-height: 1.1; }
.duel-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.duel-answers .answer { min-height: 0; height: 100%; padding: 0.4rem 0; font-size: clamp(1.6rem, 5vw, 2.4rem); touch-action: none; }
.duel-msg { text-align: center; min-height: 1.4rem; font-weight: 700; }
.duel-end { grid-column: 1 / -1; text-align: center; font-size: 1.4rem; font-weight: 800; }
.duel-mid { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.duel-target { font-weight: 700; color: var(--muted); }

/* ----- Vaisseau ----- */
.runner { max-width: 820px; margin: 0 auto; }
.hud { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 800; padding: 0 0.3rem 0.4rem; }
.game-canvas { width: 100%; height: auto; display: block; border-radius: 20px; border: 3px solid #2b1b5e; background: #10173a; }
.formulas { margin-top: 0.8rem; }
.formulas .answer { font-size: 1.9rem; min-height: 76px; }
/* Sauve le vaisseau : habillage « nébuleuse » (HUD en pastilles crème, boutons-bonbons colorés, aide sur bandeau sombre) */
.runner .hud { gap: 0.6rem; padding: 0 0 0.6rem; }
.runner .hud span { display: inline-flex; align-items: center; padding: 0.2rem 1rem; border-radius: 999px; background: #fff6e8; color: #2a1f5e; border: 3px solid #c9b6f0; box-shadow: 0 4px 0 #a48cd6; }
.runner .hud .pause-btn, .climb .hud .pause-btn { margin-left: auto; padding: 0.35rem 1.1rem; border-radius: 999px; border: 3px solid #c9b6f0; background: #2a1f5e; color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #a48cd6; }
.runner .hud .pause-btn[aria-pressed="true"], .climb .hud .pause-btn[aria-pressed="true"] { background: #1f8f4a; border-color: #7fe39a; box-shadow: 0 4px 0 #1b6b3a; }
.runner .hud, .climb .hud { flex-wrap: wrap; row-gap: 0.5rem; }
.runner .hud span, .runner .hud .pause-btn, .climb .hud span, .climb .hud .pause-btn { white-space: nowrap; }
@media (max-width: 480px) { .runner .hud { font-size: 1.05rem; } .runner .hud span { padding: 0.15rem 0.6rem; } .runner .hud .pause-btn { padding: 0.25rem 0.7rem; } }
.runner .game-canvas { border-color: #6b4fb0; box-shadow: 0 8px 22px rgba(42, 26, 94, 0.35); }
.runner .answers.formulas { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 0.6rem; margin-top: 0.9rem; }
.runner .formulas .answer { --b1: #6fa8ff; --b2: #1f56c9; min-height: 82px; border: 0; border-radius: 20px; color: #fff; text-shadow: 0 2px 0 rgba(20, 10, 70, 0.55), 0 0 6px rgba(20, 10, 70, 0.35); background: linear-gradient(180deg, var(--b1), var(--b2)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 5px 0 rgba(20, 10, 70, 0.35); }
.runner .formulas .answer:nth-child(6n + 2) { --b1: #7fe39a; --b2: #1f8f4a; }
.runner .formulas .answer:nth-child(6n + 3) { --b1: #c196f5; --b2: #6a2fb5; }
.runner .formulas .answer:nth-child(6n + 4) { --b1: #ffc266; --b2: #e07a10; }
.runner .formulas .answer:nth-child(6n + 5) { --b1: #ff8cc0; --b2: #d83a85; }
.runner .formulas .answer:nth-child(6n) { --b1: #6fe6e6; --b2: #1496a8; }
.runner .formulas .answer small { top: 7px; left: 9px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #2a1f5e; font-weight: 800; text-shadow: none; }
.runner .formulas .answer:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 2px 0 rgba(20, 10, 70, 0.35); }
.runner .formulas .answer.wrong, .runner .formulas .answer:disabled { filter: grayscale(0.85) brightness(0.8); opacity: 0.75; }
@media (max-width: 480px) { .runner .answers.formulas { grid-template-columns: 1fr 1fr; } }
.runner > p.muted { margin: 0.9rem 0 0; padding: 0.7rem 1.2rem 0.7rem 3rem; position: relative; border-radius: 999px; background: #2a1f5e; color: #fff; text-align: left; font-weight: 600; line-height: 1.3; }
.runner > p.muted::before { content: '⭐'; position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; }
/* Le pont de 10 : habillage « canyon » (pastilles et panneau crème à bordure dorée, ruban bleu pour l'aide) */
.bridge .hud span { border-color: #e0a82e; box-shadow: 0 4px 0 #b9831a; }
.bridge .climb-q { text-align: center; font-size: clamp(2rem, 9vw, 3rem); font-weight: 800; letter-spacing: 0.02em; margin: 0 0 0.6rem; padding: 0.1rem 0.5rem 0.2rem; background: #fff6e0; color: #4a3320; border: 4px solid #f5b83d; border-radius: 22px; box-shadow: 0 5px 0 #d99a1e, 0 10px 18px rgba(74, 51, 32, 0.2); }
.bridge .game-canvas { border-color: #e0a82e; box-shadow: 0 8px 22px rgba(74, 51, 32, 0.3); }
.bridge > p.muted { padding: 0.7rem 1.2rem; border-radius: 14px; border: 3px solid #e0b040; background: linear-gradient(#3a63b5, #274a94); text-align: center; box-shadow: 0 4px 0 #1a3470; }
.bridge > p.muted::before { content: none; }
/* Tir aux cibles : habillage « fête foraine de jour » (mêmes pastilles et panneau crème dorés que le pont, barre de temps brune, aide sur cartouche à bordure rouge) */
.shoot .hud span { border-color: #e0a82e; box-shadow: 0 4px 0 #b9831a; }
.shoot .climb-q { margin: 0 0 0.5rem; padding: 0.1rem 0.5rem 0.2rem; background: #fff6e0; color: #4a3320; border: 4px solid #f5b83d; border-radius: 22px; box-shadow: 0 5px 0 #d99a1e, 0 10px 18px rgba(74, 51, 32, 0.2); }
.shoot .timerbar { height: 18px; margin: 0 0.2rem 0.7rem; background: #4a3320; border: 3px solid #e0a82e; box-shadow: 0 3px 0 #b9831a; }
.shoot .timerbar i { background: linear-gradient(90deg, #8fe05a, #ffc93c 60%, #ff7a3c); }
.shoot .game-canvas { border-color: #e0a82e; box-shadow: 0 8px 22px rgba(74, 51, 32, 0.3); }
.shoot > p.muted { padding: 0.7rem 1.2rem; border-radius: 16px; border: 3px solid #d84a3a; background: #fff6e0; color: #4a3320; text-align: center; box-shadow: 0 4px 0 #a8321f; }
.shoot > p.muted::before { content: none; }

/* ----- Progression ----- */
.belts { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.6rem; }
.belts li { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.6rem 0.3rem; border-radius: 14px; background: #f3ece0; opacity: 0.5; text-align: center; font-weight: 700; }
.belts li small { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.belts li.got { opacity: 1; background: #fff3c4; border: 2px solid var(--sun); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; padding: 0.7rem 0.5rem; border-radius: 14px; background: #f3ece0; opacity: 0.55; }
.badge.got { opacity: 1; background: #fff3c4; border: 2px solid var(--sun); }
.badge small { color: var(--muted); font-size: 0.75rem; line-height: 1.25; }
.weak { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.weak li { background: var(--bad-bg); border-radius: 12px; padding: 0.3rem 0.8rem; font-weight: 700; }

/* ----- Profils / dialogues ----- */
.welcome { text-align: center; max-width: 520px; margin: 1rem auto; }
.pform { display: grid; gap: 0.8rem; }
.pform input { font: inherit; font-size: 1.3rem; padding: 0.7rem 1rem; border-radius: 16px; border: 3px solid var(--line); text-align: center; letter-spacing: inherit; }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.4rem; }
.avatars button { aspect-ratio: 1; font-size: 1.7rem; border-radius: 14px; border: 3px solid var(--line); background: #fff; padding: 0; }
.avatars button.on { border-color: var(--teal); background: #d9f3f0; }
@media (max-width: 480px) { .avatars { grid-template-columns: repeat(4, 1fr); } }
dialog.dlg { border: 3px solid var(--line); border-radius: 24px; padding: 0; max-width: min(520px, 94vw); width: 100%; max-height: 90dvh; background: var(--bg); color: var(--ink); font-family: var(--font); }
dialog.dlg::backdrop { background: rgba(20, 30, 50, 0.55); }
.dlg-body { padding: 1.2rem; display: grid; gap: 0.7rem; }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.pbtn { width: 100%; display: flex; align-items: center; gap: 0.8rem; min-height: 56px; padding: 0.3rem 0.9rem; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-size: 1.15rem; font-weight: 700; text-align: left; }
.pbtn.on { border-color: var(--teal); background: #d9f3f0; }
.pav { font-size: 1.8rem; }
.settings h3 { margin-top: 0.5rem; color: var(--teal-dark); }

/* ----- Toasts, confettis, animations ----- */
#toasts { position: fixed; left: 0; right: 0; bottom: 1rem; display: grid; justify-items: center; gap: 0.4rem; z-index: 50; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 0.6rem 1.1rem; border-radius: 999px; font-weight: 600; animation: pop 0.25s ease; transition: opacity 0.4s; }
.toast.out { opacity: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-light { 0% { background: var(--sun); box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.9); } 100% { background: #e5dcc9; box-shadow: 0 0 0 36px rgba(255, 201, 60, 0); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ----- Choix de l'opération (multiplication / addition) ----- */
.opswitch { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0.6rem 0 1rem; }
.opswitch button { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 60px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: var(--shadow); }
.opswitch button.on { background: var(--teal); border-color: var(--teal-dark); color: #fff; }
.opswitch .op-sym { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(255, 201, 60, 0.9); color: #243b53; font-size: 1.3rem; line-height: 1; }
.op-tag { display: inline-block; vertical-align: middle; margin-left: 0.3rem; padding: 0.1rem 0.7rem; border-radius: 999px; background: #d9f3f0; color: var(--teal-dark); font-size: 0.85rem; font-weight: 700; }

/* ----- Grimpe l'immeuble / Tir aux cibles ----- */
.m-climb { --c: #ffd9e8; } .m-shoot { --c: #ffe6c7; }
.climb { max-width: 520px; margin: 0 auto; }
.climb-canvas { touch-action: none; cursor: pointer; }
.shoot-canvas { touch-action: none; cursor: crosshair; }
.climb-q { text-align: center; font-size: clamp(2rem, 9vw, 3rem); font-weight: 800; margin: 0 0 0.3rem; color: var(--ink); }
.shoot .climb-q, .climb .climb-q { letter-spacing: 0.02em; }
/* Grimpe l'immeuble : habillage « crépuscule » (HUD en pastilles, question sur panneau crème, barre de prise arrondie) */
.climb .hud { align-items: center; margin: 0 0 0.5rem; padding: 0.3rem 1rem; border-radius: 999px; background: linear-gradient(#2d2063, #1b1446); border: 3px solid #6b4fb0; color: #fff; box-shadow: 0 4px 0 #120c33; }
.climb .climb-q { margin: 0 0 0.5rem; padding: 0.1rem 0.5rem 0.2rem; background: #fff6e0; color: #2a1f5e; border: 4px solid #f5b83d; border-radius: 22px; box-shadow: 0 5px 0 #d99a1e, 0 10px 18px rgba(42, 26, 94, 0.2); }
.climb .timerbar { height: 18px; margin: 0 0.2rem 0.7rem; background: #2a1f5e; border: 3px solid #6b4fb0; box-shadow: 0 3px 0 #120c33; }
.climb .timerbar i { background: linear-gradient(90deg, #7ee08f, #ffc93c 55%, #ff7a3c); }
.climb .game-canvas { border-color: #6b4fb0; box-shadow: 0 8px 22px rgba(42, 26, 94, 0.35); }

/* ----- Compte et clé API ----- */
.gate { text-align: left; max-width: 520px; margin: 1rem auto 0; display: grid; gap: 0.7rem; }
.gate .btn.big { justify-self: center; }
.keysteps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.3rem; }
.keysteps a { color: var(--teal-dark); font-weight: 700; text-decoration: underline; }
.keyform { display: grid; gap: 0.5rem; }
.keyform input { font: inherit; padding: 0.7rem 1rem; border-radius: 14px; border: 3px solid var(--line); letter-spacing: inherit; width: 100%; }
.key-msg { min-height: 1.3rem; margin: 0; font-weight: 600; color: var(--muted); }
.key-msg.bad { color: var(--bad); }
.account-block { display: grid; gap: 0.5rem; justify-items: start; }
.account-block .key-slot { width: 100%; display: grid; gap: 0.5rem; }
.notice.ok { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.toast.bad { background: var(--bad); }

/* ----- Flash vocal ----- */
.flash-steps { text-align: left; max-width: 480px; margin: 0.8rem auto; padding-left: 1.4rem; display: grid; gap: 0.35rem; }
.flash { text-align: center; position: relative; max-width: 560px; margin: 0 auto; }
.flash-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-weight: 700; color: var(--muted); }
.fdots { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.fdot { width: 12px; height: 12px; border-radius: 50%; background: #e3d9c6; }
.fdot.now { background: var(--sun); box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.45); }
.fdot.ok { background: var(--good); } .fdot.ko { background: var(--bad); }
.flash-card { margin: 0.9rem 0 0.4rem; padding: 1.1rem 0.6rem; min-height: 11.5rem; border-radius: 22px; border: 4px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; transition: background 0.2s, border-color 0.2s; }
.flash-card.good { background: var(--good-bg); border-color: var(--good); }
.flash-card.bad { background: var(--bad-bg); border-color: var(--bad); }
.flash-q { font-size: clamp(2.8rem, 12vw, 4.6rem); font-weight: 800; line-height: 1.1; }
.flash-q.blank { color: #cfc4ad; letter-spacing: 0.2em; }
.flash-card.good .flash-q { color: var(--good); } .flash-card.bad .flash-q { color: var(--ink); }
.flash-fix p { margin: 0; font-weight: 700; }
.wrong-said { color: var(--bad); } .right-answer { color: var(--good); font-size: 1.25rem; }
.flash-status { min-height: 2rem; font-size: 1.3rem; font-weight: 800; margin: 0.4rem 0; }
.flash-status.go { color: var(--teal-dark); } .flash-status.busy { color: var(--muted); } .flash-status.good { color: var(--good); } .flash-status.bad, .flash-status.again { color: var(--bad); }
.orb { width: 92px; height: 92px; margin: 0.6rem auto; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; background: #e9e0cd; filter: grayscale(0.7); opacity: 0.6; transition: background 0.15s; }
.orb.on { background: #ffd9cf; filter: none; opacity: 1; transform: scale(calc(1 + var(--lvl, 0) * 0.3)); box-shadow: 0 0 0 calc(var(--lvl, 0) * 26px) rgba(255, 107, 74, 0.22); }
.flash-overlay { position: absolute; inset: 0; z-index: 5; background: rgba(255, 248, 236, 0.96); border-radius: var(--radius); padding: 1.2rem; display: grid; align-content: center; text-align: left; }
.flash-overlay[hidden] { display: none; }
.m-vflash { --c: #ffe6a8; }

/* ----- Le pont de 10 ----- */
.m-bridge { --c: #d3f0e4; }
.bridge-canvas { touch-action: none; cursor: pointer; }
.levels { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1rem 0; }
.level { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 1.1rem 0.8rem; border-radius: 20px; border: 3px solid var(--line); background: #fff; box-shadow: var(--shadow); text-align: center; }
.level:active { transform: translateY(2px); }
.level strong { font-size: 1.2rem; }
.level-ex { font-size: 1.8rem; font-weight: 800; color: var(--teal-dark); margin: 0.2rem 0; }
.level small { color: var(--muted); }

/* ---------- Doubles et moitiés : pâtisserie magique, memory des jumeaux, atelier du double ---------- */
.m-copier { --c: #d9ecff; } .m-memory { --c: #ecdcff; } .m-atelier { --c: #ffe9bf; }
.answers.n3 { grid-template-columns: repeat(3, 1fr); }
.answers.n3 .answer { min-height: 96px; }
.lives { letter-spacing: 0.12em; }
.copier-machine { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0.6rem auto; padding: 0.8rem 1rem; max-width: 440px; border-radius: 24px; background: linear-gradient(#e8eef5, #cfd9e6); border: 3px solid #9fb2c8; box-shadow: var(--shadow); }
.copier-machine.run { animation: copier-shake 0.5s; }
.copier-sign { font-size: 2.2rem; font-weight: 800; color: var(--brand-dark); background: #fff; border-radius: 14px; padding: 0.1rem 0.7rem; border: 3px solid var(--brand); }
.copier-ticket { display: flex; align-items: center; gap: 0.4rem; background: #fff; border-radius: 14px; border: 3px solid var(--line); padding: 0.2rem 0.8rem; }
.copier-n { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 800; line-height: 1.1; }
.copier-q { font-size: 1.5rem; font-weight: 700; margin: 0.4rem 0; }
.copier-board { min-height: 4.5rem; margin: 0.4rem 0 0.8rem; }
.cb-row { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.cb-sign { font-size: 2rem; font-weight: 800; color: var(--muted); }
.tokens { display: grid; gap: 4px; grid-template-columns: repeat(var(--cols, 10), 14px); }
.tok { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); }
.tokens.u10, .tokens.u100 { grid-template-columns: repeat(var(--cols, 6), 40px); gap: 6px; }
.tokens.u10 .tok, .tokens.u100 .tok { width: 40px; height: 40px; display: grid; place-items: center; font-size: 0.82rem; font-weight: 800; color: #5a4300; background: var(--sun); border: 2px solid #d9a400; }
.tokens.u100 .tok { background: #ffb347; border-color: #d98a00; }
.tokens.copy .tok { background: var(--brand); animation: tok-pop 0.3s ease-out; }
.tokens.u10.copy .tok, .tokens.u100.copy .tok { background: #ffd6c9; border-color: var(--brand); color: var(--brand-dark); }
.tokens.cut { padding-left: 1rem; border-left: 4px dashed var(--brand); }
.tokens.cut .tok { animation: tok-pop 0.3s ease-out; }
.copier-eq { font-size: 1.6rem; font-weight: 800; margin: 0.5rem 0 0; }
@keyframes tok-pop { from { transform: scale(0.2); } to { transform: scale(1); } }
@keyframes copier-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .copier-machine.run, .tokens .tok, .atelier-magic { animation: none !important; } }

.memory { max-width: 660px; margin: 0 auto; text-align: center; }
.memory-hud { display: flex; justify-content: space-between; gap: 0.6rem; font-weight: 700; margin-bottom: 0.4rem; }
.memory-player { padding: 0.3rem 0.9rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; }
.memory-player.on { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
.memory-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 0.6rem; margin: 0.8rem 0; }
.mcard { min-height: 78px; aspect-ratio: 1 / 1.05; border-radius: 16px; border: 3px solid #7d5fd0; background: linear-gradient(135deg, #b79af0, #8d6fe0); color: #fff; font-size: clamp(1.6rem, 7vw, 2.6rem); font-weight: 800; box-shadow: var(--shadow); }
.mcard:active:not(:disabled) { transform: translateY(2px); }
.mcard.up { background: #fff; color: var(--ink); border-color: var(--line); }
.mcard.done { background: var(--good-bg); border-color: var(--good); color: var(--good); opacity: 1; }
.mcard:disabled { opacity: 1; cursor: default; }
.memory-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin: 0.6rem 0; }
.family { padding: 0.2rem 0.8rem; border-radius: 999px; background: var(--good-bg); color: var(--good); font-weight: 800; }

.atelier h2 { font-size: 1.4rem; margin: 0.2rem 0 0.4rem; }
.atelier-step { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: 1.6rem; font-weight: 800; margin: 0.6rem 0; }
.atelier-stage { min-height: 11rem; display: grid; place-items: center; align-content: center; gap: 0.4rem; padding: 0.8rem; border-radius: 20px; background: #fff; border: 2px solid var(--line); margin: 0.6rem 0 1rem; }
.atelier-line { font-size: 2rem; font-weight: 800; margin: 0.1rem 0; }
.atelier-line.big { color: var(--teal-dark); font-size: 2.6rem; }
.atelier-line.sub { font-size: 1.2rem; color: var(--muted); }
.atelier-arrow { font-size: 1.6rem; color: var(--brand-dark); font-weight: 800; }
.atelier-magic { display: grid; place-items: center; animation: tok-pop 0.4s ease-out; }
.atelier-help { background: var(--skip-bg); border-radius: 14px; padding: 0.5rem 0.8rem; font-weight: 700; margin: 0.6rem 0; }
.atelier-why { font-weight: 700; color: var(--teal-dark); margin: 0.2rem 0 0.6rem; }
.level.trick { gap: 0.3rem; }
@media (max-width: 420px) { .answers.n3 { grid-template-columns: 1fr; } .answers.n3 .answer { min-height: 72px; } }

/* ---------- Doubles et moitiés en addition : presque-doubles, partage des billes, dominos jumeaux ---------- */
.m-presque { --c: #ffe3d1; } .m-partage { --c: #dff3d4; } .m-dominos { --c: #e0e4ff; }
.pq-piles { display: flex; align-items: center; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.4rem 0; }
.tokens.extra-last .tok:last-child, .tokens.extra .tok { background: var(--brand); box-shadow: 0 0 0 3px #ffd6c9; }

.partage-scene { display: grid; gap: 0.8rem; margin: 0.6rem 0; }
.partage-table { display: flex; align-items: center; justify-content: center; gap: 0.8rem; min-height: 4rem; flex-wrap: wrap; }
.partage-n { font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 800; background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 0 0.9rem; }
.marbles { display: grid; grid-template-columns: repeat(10, 16px); gap: 4px; justify-content: center; min-height: 20px; }
.marble { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe08a, #e0a100); border: 1px solid #b07b00; }
.partage-bags { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.bag { display: grid; justify-items: center; align-content: start; gap: 0.3rem; min-height: 8.5rem; padding: 0.5rem; border-radius: 20px; border: 3px dashed #c9b48a; background: #fffaf0; }
.bag-ico { font-size: 2.4rem; line-height: 1; }
.bag-count { font-size: 1.8rem; font-weight: 800; min-height: 2.2rem; }
.bag .marbles { grid-template-columns: repeat(5, 16px); }
.answers.n2 { grid-template-columns: 1fr 1fr; }

.domino-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin: 0.8rem 0; }
.domino-btn { padding: 0.5rem; border-radius: 18px; border: 3px solid var(--line); background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; min-height: 92px; }
.domino-btn:active:not(:disabled) { transform: translateY(2px); }
.domino-btn.right { background: var(--good-bg); border-color: var(--good); }
.domino-btn.wrong { background: var(--bad-bg); border-color: var(--bad); }
.domino-btn:disabled { cursor: default; }
.domino-solo { display: grid; place-items: center; margin: 0.6rem 0 1rem; }
.domino { display: inline-flex; align-items: stretch; background: #fdfdf6; border: 3px solid #243b53; border-radius: 12px; overflow: hidden; }
.dhalf { display: grid; place-items: center; width: 62px; height: 62px; }
.dsep { width: 3px; background: #243b53; }
.dpips { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 48px; height: 48px; }
.dpip { display: grid; place-items: center; background: none; border: 0; width: auto; height: auto; }
.dpip.on::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #243b53; }
.dq { font-size: 2rem; color: var(--brand-dark); }
.domino-solo .dhalf { width: 84px; height: 84px; }
.domino-solo .dpips { width: 66px; height: 66px; }
.domino-solo .dpip.on::after { width: 13px; height: 13px; }
@media (max-width: 420px) { .domino-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- La pâtisserie magique : cuisine pastel, four rose, petit pâtissier, cupcakes (images dans /img/patisserie) ---------- */
.pat, .pat-pick, .pat-result {
  --pat-plum: #6b3a8c; --pat-pink: #e0478a; --pat-cream: #fff6e3; --pat-rim: #f3b4cf;
}
.pat { max-width: 740px; padding: 0.7rem 0.7rem 1.1rem; border-radius: 28px; border: 4px solid var(--pat-rim); background: #fde9ef url(/img/patisserie/bg.webp) center 30% / cover no-repeat; box-shadow: var(--shadow); }
.pat .quiz-top { color: var(--pat-plum); background: rgba(255, 246, 227, 0.92); border-radius: 999px; padding: 0.2rem 1rem; }
.pat .progress-line { background: rgba(255, 246, 227, 0.92); border: 2px solid var(--pat-rim); height: 14px; }
.pat .progress-line i { background: linear-gradient(90deg, #ffd24d, #ff9ac1); }

.pat-stage { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 0.6rem; margin-top: 0.5rem; }
.pat-chefbox { display: flex; align-items: flex-end; gap: 0.3rem; flex: 1 1 300px; min-width: 0; justify-content: flex-end; }
.pat-chef { display: block; flex: none; height: clamp(120px, 24vw, 190px); width: auto; }
.pat-bubble { position: relative; align-self: flex-start; margin: 0.3rem 0 0 0.5rem; background: #fff; border: 3px solid #e8a6c4; border-radius: 22px; padding: 0.45rem 0.8rem; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08); text-align: center; }
.pat-bubble::after { content: ''; position: absolute; left: -11px; bottom: 16px; width: 16px; height: 16px; background: #fff; border-left: 3px solid #e8a6c4; border-bottom: 3px solid #e8a6c4; transform: rotate(45deg); }
.pat-bubble .copier-q { margin: 0; display: inline; font-size: clamp(1.15rem, 3.8vw, 1.6rem); color: var(--pat-plum); }
.pat-bubble .listen { margin-left: 0.3rem; vertical-align: middle; }

/* le four : l'écran du ventre affiche le nombre ; la bonne position de l'écran dépend de l'humeur (images de largeurs différentes) */
.copier-machine.pat-oven { position: relative; flex: none; height: clamp(150px, 27vw, 215px); display: flex; justify-content: center; align-items: flex-end; margin: 0; padding: 0; gap: 0; max-width: none; background: none; border: 0; box-shadow: none; }
.pat-oven-pic { position: relative; display: block; height: 100%; }
.pat-oven-img { display: block; height: 100%; width: auto; }
.pat-screen { position: absolute; display: grid; place-items: center; left: 22%; width: 40.1%; top: 61%; height: 18.1%; }
.pat-oven-pic[data-mood='worried'] .pat-screen { left: 22.4%; width: 39.9%; top: 61.9%; height: 18.3%; }
.pat-oven-pic[data-mood='cheer'] .pat-screen { left: 20.3%; width: 36.7%; top: 61.4%; height: 19%; }
.pat-screen .copier-n { font-size: clamp(1.5rem, 5.4vw, 2.5rem); color: var(--pat-plum); font-weight: 800; line-height: 1; }
.copier-sign.pat-sign { position: absolute; right: -4px; top: 14%; font-size: 1.3rem; padding: 0 0.55rem; background: #ffd24d; color: var(--pat-plum); border: 3px solid #fff; border-radius: 14px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); transform: rotate(8deg); }

/* les deux plateaux : de départ et d'arrivée */
.pat-board { min-height: 5.6rem; margin: 0.6rem 0 0.4rem; }
.pat .cb-row { flex-wrap: nowrap; gap: 0.5rem; align-items: stretch; }
.pat-tray { flex: 0 1 46%; min-width: 0; min-height: 5.4rem; display: flex; align-items: center; justify-content: center; padding: 0.5rem 0.6rem; background: linear-gradient(#fff6e3, #f9dfc0); border: 3px solid #e8a6c4; border-radius: 18px; box-shadow: 0 4px 0 #d78aae, inset 0 0 0 3px rgba(255, 255, 255, 0.6); }
.pat .cb-sign { align-self: center; flex: none; font-size: 2.2rem; color: #fff; text-shadow: 0 2px 0 #b34a7d, 0 0 8px rgba(179, 74, 125, 0.4); }
.pat-q { font-size: 2.8rem; font-weight: 800; color: #ffd24d; text-shadow: 0 2px 0 #c58a00, 0 0 12px #fff8; animation: pat-pulse 1.6s ease-in-out infinite; }
@keyframes pat-pulse { 50% { transform: scale(1.15); } }

/* les jetons deviennent des cupcakes (et des boîtes de 10 ou de 100 aux grands niveaux) */
.pat .tokens { width: 100%; grid-template-columns: repeat(var(--cols, 10), minmax(0, 34px)); justify-content: center; gap: 3px; justify-items: center; }
.pat .tok { width: 100%; max-width: 34px; height: auto; aspect-ratio: 1; border-radius: 0; background: url(/img/patisserie/cupcake.webp) center / contain no-repeat; font-size: 0; }
.pat .tokens.copy .tok, .pat .tokens.cut .tok { background: url(/img/patisserie/cupcake.webp) center / contain no-repeat; filter: drop-shadow(0 0 5px #ffd24d); animation: tok-pop 0.3s ease-out; }
.pat .tokens.cut { padding-left: 0; border-left: 0; }
.pat .tokens.u10, .pat .tokens.u100 { grid-template-columns: repeat(var(--cols, 6), minmax(0, 86px)); gap: 4px; }
.pat .tokens.u10 .tok, .pat .tokens.u100 .tok { max-width: 86px; aspect-ratio: 5 / 4; background: url(/img/patisserie/box10.webp) center / contain no-repeat; border: 0; display: grid; align-items: end; justify-items: center; padding-bottom: 9%; font-size: clamp(0.7rem, 2.6vw, 1rem); font-weight: 800; color: #a3345f; }
.pat .tokens.u100 .tok { background-image: url(/img/patisserie/box100.webp); }
.pat .tokens.u10.copy .tok, .pat .tokens.u10.cut .tok { background: url(/img/patisserie/box10.webp) center / contain no-repeat; border: 0; color: #a3345f; }
.pat .tokens.u100.copy .tok, .pat .tokens.u100.cut .tok { background: url(/img/patisserie/box100.webp) center / contain no-repeat; border: 0; color: #a3345f; }

/* les réponses : de gros biscuits glacés, en bas de l'écran */
.pat .answers { grid-template-columns: repeat(auto-fit, minmax(76px, 112px)); justify-content: center; gap: 0.8rem; margin-top: 0.5rem; }
.pat .answer { aspect-ratio: 1; min-height: 0; border-radius: 50%; border: 5px solid #f0c27d; background: radial-gradient(circle at 35% 30%, var(--b1, #ff8fbd), var(--b2, #e5457f)); color: #fff; text-shadow: 0 2px 0 rgba(90, 20, 60, 0.5); font-size: clamp(1.4rem, 5vw, 2.3rem); box-shadow: 0 5px 0 #c88f4c, inset 0 0 0 3px rgba(255, 255, 255, 0.45); }
.pat .answer:nth-child(4n + 2) { --b1: #6fdcf0; --b2: #1c9bbd; }
.pat .answer:nth-child(4n + 3) { --b1: #9be37a; --b2: #43a32a; }
.pat .answer:nth-child(4n + 4) { --b1: #ffd76a; --b2: #f09a12; }
.pat .answer.right { background: radial-gradient(circle at 35% 30%, #b6f59a, #2f9d2a); box-shadow: 0 0 0 6px #fff, 0 0 20px #9cf27a, 0 5px 0 #c88f4c; transform: scale(1.06); color: #fff; border-color: #f0c27d; }
.pat .answer.wrong { filter: grayscale(0.9) brightness(0.92); background: radial-gradient(circle at 35% 30%, #cfcfcf, #8f8f8f); color: #fff; border-color: #f0c27d; }
.pat .feedback { display: inline-block; min-width: 40%; padding: 0.2rem 0.9rem; background: rgba(255, 246, 227, 0.94); border-radius: 14px; color: var(--pat-plum); }
.pat .feedback.good { color: #2b8a2b; } .pat .feedback.bad { color: #b3365f; }
.pat .copier-eq { display: inline-block; margin-top: 0.5rem; padding: 0.1rem 1rem; background: #ffd24d; color: var(--pat-plum); border-radius: 18px; box-shadow: 0 3px 0 #c58a00; }
.pat-oven.run { animation: copier-shake 0.5s; }
@media (max-width: 560px) { .pat-chefbox { flex-basis: 100%; justify-content: center; } }

/* choix du niveau */
.pat-pick { max-width: 860px; margin: 0 auto; padding: 0.8rem; border-radius: 28px; border: 4px solid var(--pat-rim); background: #fde9ef url(/img/patisserie/bg.webp) center / cover no-repeat; }
.pat-pick h2 { width: fit-content; min-width: min(100%, 340px); margin: 0.2rem auto 0.4rem; padding: 1.7rem 2.6rem; text-align: center; color: var(--pat-plum); font-size: clamp(1.3rem, 4.6vw, 2rem); background: url(/img/patisserie/sign.webp) center / 100% 100% no-repeat; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8); }
.pat-pick .lead, .pat-pick > p.muted { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.2rem 1.1rem; text-align: center; background: rgba(255, 246, 227, 0.94); border-radius: 999px; color: var(--pat-plum); font-weight: 800; }
.pat-pick .level { background: #fff6e3; border: 5px solid #f08ab0; border-radius: 26px; box-shadow: 0 5px 0 #d4709a, inset 0 0 0 3px #fff; }
.pat-pick .lvl-img { height: 84px; width: auto; max-width: 100%; object-fit: contain; }
.pat-pick .level strong { color: var(--pat-plum); }
.pat-pick .level-ex { color: var(--pat-pink); }
.pat-pick .opts .opt { padding: 0.35rem 0.7rem; background: rgba(255, 246, 227, 0.94); border: 3px solid var(--pat-rim); border-radius: 20px; }
.pat-pick .opt-label { color: var(--pat-plum); font-weight: 800; }
.pat-pick .seg { gap: 0.4rem; border: 0; background: transparent; overflow: visible; }
.pat-pick .seg button { border: 3px solid #e6b974; border-radius: 999px; background: #f7d9a8; color: var(--pat-plum); font-weight: 800; box-shadow: 0 3px 0 #c88f4c; }
.pat-pick .seg button.on { background: linear-gradient(#9be37a, #43a32a); border-color: #2f7d1a; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }

/* fin de partie */
.pat-result { border: 4px solid #f08ab0; border-radius: 28px; background: #fff6e3 url(/img/patisserie/bg.webp) center 20% / cover no-repeat; }
.pat-result-deco { display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; margin-bottom: -0.4rem; }
.pat-result-deco .pat-chef { height: 130px; }
.pat-result-deco .pat-oven-img { height: 120px; width: auto; }
.pat-result h2 { color: var(--pat-plum); }
.pat-result .score-big { display: inline-block; padding: 0.1rem 1.4rem; color: var(--pat-plum); background: #ffd24d; border-radius: 26px; box-shadow: 0 4px 0 #c58a00; }
@media (prefers-reduced-motion: reduce) { .pat-q, .pat-oven.run { animation: none !important; } }

/* ---------- Accueil « L'ardoise magique » : tableau noir, titres à la craie, cartes de jeux illustrées (images dans /img/home) ---------- */
.home.board { --chalk: #f6f1e4; position: relative; padding: 0.4rem 0.2rem 0.6rem; color: var(--chalk); }
/* toute la page devient l'ardoise : fond d'ardoise fixe et cadre de bois fixe autour de la fenêtre (image du cadre découpée en bordure) */
body.home-on { background: #1c2b3a url(/img/home/board.webp) center / cover fixed; }
body.home-on::after { content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none; border: 20px solid transparent; border-image: url(/img/home/frame.webp) 22 / 20px stretch; filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.5)); }
body.home-on #topbar { background: rgba(18, 30, 44, 0.92); border-bottom: 2px solid rgba(231, 184, 120, 0.5); padding-top: calc(0.5rem + 14px); padding-left: calc(0.75rem + 14px); padding-right: calc(0.75rem + 14px); }
body.home-on .brand span { color: #fff; }
body.home-on #view { padding-left: calc(0.9rem + 14px); padding-right: calc(0.9rem + 14px); padding-bottom: calc(3rem + 14px); }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; }
.home.board h1 { margin: 0; font-size: clamp(1.7rem, 5.4vw, 2.5rem); color: var(--chalk); text-shadow: 0 0 1px #fff, 2px 2px 0 rgba(0, 0, 0, 0.35); }
.board-fox { height: clamp(86px, 17vw, 128px); width: auto; margin-top: -0.4rem; flex: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4)); }
.home.board .lead { margin: 0.7rem 0 0; font-size: 1.2rem; color: #ffd86b; text-decoration: underline wavy #ff8fbd; text-underline-offset: 6px; }
.home.board .opswitch button { background: #fffaf0; color: #243b53; border-color: #e7b878; }
.home.board .opswitch button.on { background: var(--teal); border-color: #7fe0d3; color: #fff; }
.home.board .modes { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; margin: 1.1rem 0; }
.home.board .mode { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; border: 3px solid #fffaf0; border-radius: 20px; background: #fffaf0; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.home.board .mode:hover { transform: translateY(-3px) rotate(-0.6deg); }
.home.board .mode.m-voice { border-color: #ff9d85; }
.mode-art { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #ddd; }
.home.board .mode-body { padding: 0.55rem 0.7rem 0.75rem; text-align: center; }
.home.board .mode-body strong { font-size: 1.1rem; color: var(--m-ink, #243b53); }
.home.board .mode-body small { color: #4c5c72; }
.m-voice { --m-ink: #8a2f9e; } .m-flash { --m-ink: #b87400; } .m-holes { --m-ink: #1c7d44; } .m-duel { --m-ink: #c23a1c; } .m-ship { --m-ink: #3a4bb3; } .m-climb { --m-ink: #6a35a8; } .m-bridge { --m-ink: #1d7c87; } .m-shoot { --m-ink: #c23a3a; } .m-copier { --m-ink: #d0477e; } .m-memory { --m-ink: #2d6fb5; } .m-presque { --m-ink: #7a4ab5; } .m-partage { --m-ink: #0e8a7c; } .m-dominos { --m-ink: #2f4a9a; } .m-atelier { --m-ink: #7a3fb0; }
.home.board .next-goal { margin: 0; background: rgba(20, 32, 46, 0.85); border: 2px solid #e7b878; color: var(--chalk); box-shadow: none; }
.home.board .next-goal .muted { color: #cfd8e3; }
.home.board .meter { background: rgba(255, 255, 255, 0.18); }
@media (max-width: 480px) { body.home-on::after { border-width: 12px; border-image-width: 12px; } .home.board .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; } .home.board .mode-body small { font-size: 0.78rem; } }
:root[data-contrast='high'] .home.board { background: #000; border-color: #fff; }
.home.board .opswitch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) { .home.board .opswitch button { min-width: 0; gap: 0.3rem; padding: 0 0.3rem; font-size: 0.98rem; } }

/* ---------- Activités relookées : Éclair (salle d'arcade) et À trous (puzzle) — images dans /img/act ---------- */
.act { position: relative; max-width: 760px; padding: 0.8rem 0.9rem 1.2rem; border-radius: 28px; border: 4px solid var(--act-rim, #fff); background: var(--act-bg) center / cover no-repeat; box-shadow: var(--shadow); isolation: isolate; }
.act .quiz-top { padding: 0.15rem 0.9rem; border-radius: 999px; background: var(--act-chip, rgba(255, 255, 255, 0.92)); color: var(--act-ink, #243b53); }
.act .feedback { display: inline-block; min-width: 40%; padding: 0.2rem 0.9rem; border-radius: 14px; background: var(--act-chip, rgba(255, 255, 255, 0.92)); }
.act .feedback:empty, .act .feedback:blank { display: none; }
.act-fox { position: absolute; left: 0.4rem; bottom: 0.4rem; height: clamp(120px, 22vw, 190px); width: auto; z-index: 1; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35)); }
.act > :not(.act-fox) { position: relative; z-index: 2; }
@media (max-width: 640px) { .act-fox { display: none; } }

/* Éclair : la borne d'arcade */
.act-arcade { --act-bg: #120a33 url(/img/act/bg-arcade.webp); --act-rim: #ff4fd8; --act-chip: rgba(18, 10, 51, 0.88); --act-ink: #ffe36b; box-shadow: 0 0 22px rgba(255, 79, 216, 0.55), 0 0 0 2px #2d7bff inset; }
.act-arcade .progress-line { height: 12px; background: rgba(18, 10, 51, 0.85); border: 2px solid #2d7bff; }
.act-arcade .progress-line i { background: linear-gradient(90deg, #ff4fd8, #ffe36b); }
.act-arcade .timerbar { height: 20px; background: rgba(18, 10, 51, 0.9); border: 3px solid #ff9c2d; box-shadow: 0 0 12px rgba(255, 156, 45, 0.6); }
.act-arcade .timerbar i { background: linear-gradient(90deg, #ff4fd8, #ff9c2d 55%, #ffe36b); }
.act-arcade .question { margin: 0.4rem auto 0.9rem; max-width: 560px; padding: 0.5rem 1rem 0.7rem; border-radius: 20px; border: 4px solid #2d7bff; background: radial-gradient(circle at 50% 30%, #1d3f9e, #0b1a52); box-shadow: 0 0 18px rgba(45, 123, 255, 0.65), inset 0 0 24px rgba(0, 0, 0, 0.5); color: #ffe36b; text-shadow: 0 0 10px rgba(255, 227, 107, 0.7), 0 3px 0 rgba(0, 0, 0, 0.35); }
.act-arcade .question .hole { color: #ff6fcf; border-bottom-color: #ff6fcf; text-shadow: 0 0 12px #ff4fd8; }
.act-arcade .question.good .hole { color: #8dff6a; border-color: #8dff6a; text-shadow: 0 0 12px #5aff2d; }
.act-arcade .question.bad .hole { color: #ff8a8a; border-color: #ff8a8a; }
.act-arcade .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; max-width: 640px; margin: 0 auto; }
.act-arcade .answer { min-height: 0; aspect-ratio: 1 / 1.05; border: 0; border-radius: 0; background: transparent url(/img/act/btn-blue.webp) center / contain no-repeat; box-shadow: none; color: #fff; font-size: clamp(1.5rem, 6vw, 2.6rem); padding-bottom: 22%; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.act-arcade .answer:nth-child(4n + 2) { background-image: url(/img/act/btn-green.webp); }
.act-arcade .answer:nth-child(4n + 3) { background-image: url(/img/act/btn-yellow.webp); color: #5a3a00; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.act-arcade .answer:nth-child(4n + 4) { background-image: url(/img/act/btn-red.webp); }
.act-arcade .answer small { top: 4%; left: 50%; transform: translateX(-50%); padding: 0 0.5rem; border-radius: 8px; background: rgba(18, 10, 51, 0.85); color: #ffe36b; font-size: 0.8rem; }
.act-arcade .answer:active:not(:disabled) { transform: translateY(3px) scale(0.97); }
.act-arcade .answer.right { background-color: transparent; filter: drop-shadow(0 0 14px #8dff6a) brightness(1.15); transform: scale(1.07); color: #fff; }
.act-arcade .answer.wrong { background-color: transparent; filter: grayscale(0.9) brightness(0.8); color: #ddd; }
.act-arcade .feedback.good { color: #1f8f3a; } .act-arcade .feedback.bad { color: #ffb3b3; }
.act-arcade .feedback { color: #ffe36b; }
@media (max-width: 480px) { .act-arcade .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 320px; } }

/* À trous : le puzzle */
.act-puzzle { --act-bg: #f7e9cf url(/img/act/bg-puzzle.webp); --act-rim: #f0c27d; --act-chip: rgba(255, 250, 238, 0.94); --act-ink: #5a3a8c; }
.act-puzzle .progress-line { height: 14px; background: rgba(255, 250, 238, 0.94); border: 2px solid #f0c27d; }
.act-puzzle .progress-line i { background: linear-gradient(90deg, #7ed957, #ffd24d); }
.act-puzzle .question { gap: 0.2rem; max-width: 600px; margin: 0.6rem auto 0.8rem; padding: 0.7rem 0.6rem; border-radius: 22px; background: rgba(255, 250, 238, 0.9); border: 3px solid #f0c27d; color: #2a4a8f; font-size: clamp(2.2rem, 9vw, 3.6rem); }
.act-puzzle .question > span { display: inline-grid; place-items: center; min-width: 1.2em; }
.act-puzzle .question .pz, .act-puzzle .question .hole { width: 1.9em; aspect-ratio: 1; background: url(/img/act/pz-blue.webp) center / contain no-repeat; color: #fff; text-shadow: 0 2px 0 rgba(10, 30, 90, 0.6); border: 0; padding: 0 0.15em 0 0.05em; }
.act-puzzle .question .pz.res { background-image: url(/img/act/pz-green.webp); color: #fff; text-shadow: 0 2px 0 rgba(10, 70, 20, 0.7); }
.act-puzzle .question .hole { background: url(/img/act/pz-slot.webp) center / contain no-repeat; color: #e0472a; min-width: 0; border: 0; }
.act-puzzle .question .hole.filled.good { background-image: url(/img/act/pz-yellow.webp); color: #5a3a00; }
.act-puzzle .question .hole.filled.bad { background-image: url(/img/act/pz-pink.webp); color: #7a1235; }
.act-puzzle .question.good .hole, .act-puzzle .question.bad .hole { border: 0; }
.act-puzzle .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; max-width: 640px; margin: 0 auto; }
.act-puzzle .answer { min-height: 0; aspect-ratio: 1; border: 0; border-radius: 0; box-shadow: none; background: transparent url(/img/act/pz-yellow.webp) center / contain no-repeat; color: #5a3a00; font-size: clamp(1.7rem, 6.5vw, 2.8rem); padding: 0 0.2em 0 0.05em; }
.act-puzzle .answer:nth-child(4n + 2) { background-image: url(/img/act/pz-pink.webp); color: #7a1235; }
.act-puzzle .answer:nth-child(4n + 3) { background-image: url(/img/act/pz-purple.webp); color: #fff; }
.act-puzzle .answer:nth-child(4n + 4) { background-image: url(/img/act/pz-blue.webp); color: #fff; }
.act-puzzle .answer small { top: 8%; left: 14%; color: rgba(0, 0, 0, 0.45); }
.act-puzzle .answer.right { background-color: transparent; filter: drop-shadow(0 0 10px #5aff2d) brightness(1.1); transform: scale(1.08); }
.act-puzzle .answer.wrong { background-color: transparent; filter: grayscale(0.9) brightness(0.9); }
.act-puzzle .feedback.good { color: #2b8a2b; } .act-puzzle .feedback.bad { color: #b3365f; }
@media (max-width: 480px) { .act-puzzle .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; } }
@media (min-width: 641px) { .act { padding-left: 150px; min-height: 400px; } .act-fox { height: 200px; } }

/* ---------- Récitation vocale (scène de théâtre) et Flash vocal (plateau de télé) : décor autour de la zone de jeu ---------- */
#view[class*='th-'] { position: relative; max-width: 960px; margin: 0.8rem auto 1.2rem; padding: 1rem 1rem 1.4rem; border-radius: 28px; background: var(--th-bg) center / cover no-repeat; border: 4px solid var(--th-rim); box-shadow: var(--shadow); isolation: isolate; overflow: hidden; min-height: 60vh; }
#view.th-stage { --th-bg: #14214d url(/img/act/bg-stage.webp); --th-rim: #c8321f; }
#view.th-tv { --th-bg: #1a1450 url(/img/act/bg-tv.webp); --th-rim: #6a4fd8; }
#view[class*='th-']::after { content: ''; position: absolute; left: 0.6rem; bottom: 0; width: 150px; height: 230px; z-index: 1; pointer-events: none; background: var(--th-fox) bottom left / contain no-repeat; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4)); }
#view.th-stage { --th-fox: url(/img/act/fox-teach.webp); }
#view.th-tv { --th-fox: url(/img/act/fox-host.webp); }
#view[class*='th-'] > section { position: relative; z-index: 2; background: rgba(255, 250, 238, 0.95); border: 3px solid #ffd24d; margin-bottom: 0; }
@media (min-width: 780px) { #view[class*='th-'] > section { margin-left: 150px; } }
@media (max-width: 779px) { #view[class*='th-']::after { display: none; } }

#view.th-stage .intro h2, #view.th-stage .record h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.8rem; color: #fff6dc; background: linear-gradient(#c8321f, #8c1c10); border: 4px solid #ffd24d; border-radius: 16px; box-shadow: 0 0 0 3px #8c1c10, 0 0 14px rgba(255, 210, 77, 0.75); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
#view.th-stage .demo-line { background: #efe9dc; border: 3px solid #d3c8b3; color: #6f6656; }
#view.th-stage .demo-line.lit { background: #cdf29a; border-color: #7ac142; color: #1d6b1d; box-shadow: 0 0 12px rgba(122, 193, 66, 0.6); }
#view.th-stage .btn.primary { background: radial-gradient(circle at 35% 30%, #5aa0ff, #1646b8); border-color: #ffd24d; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 20, 0.4); box-shadow: 0 4px 0 #0e2f7a, 0 0 16px rgba(80, 140, 255, 0.6); }
#view.th-stage .btn:not(.primary):not(.ghost) { background: #fffaf0; border-color: #c9a45b; color: #5a3a8c; }
#view.th-stage .rec-status { color: #1646b8; }
#view.th-stage .rhythm-light { box-shadow: 0 0 20px rgba(255, 210, 77, 0.8); }

#view.th-tv .flash-stage { display: flex; align-items: center; justify-content: center; gap: 0.8rem; }
#view.th-tv .flash-stage .flash-card { flex: 1 1 auto; margin: 0.9rem 0 0.4rem; border: 6px solid #ff9f1c; outline: 4px dotted #fff2a8; outline-offset: -12px; box-shadow: 0 0 0 4px #c8321f, 0 0 18px rgba(255, 170, 40, 0.8); background: #fffaf0; }
#view.th-tv .flash-card.good { background: #d5f6bf; } #view.th-tv .flash-card.bad { background: #ffe0dc; }
#view.th-tv .flash-q { color: #1b2d8a; }
#view.th-tv .hourglass { flex: none; width: clamp(64px, 12vw, 96px); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)); }
#view.th-tv .hourglass .glass { display: block; width: 100%; height: auto; }
#view.th-tv .timerbar { height: 14px; background: rgba(27, 45, 138, 0.15); border: 2px solid #ff9f1c; }
#view.th-tv .timerbar i { background: linear-gradient(90deg, #ff4f5a, #ffd24d); }
#view.th-tv .orb, #view.th-tv .orb.on { background-color: transparent; background-image: url(/img/act/mic-btn.webp); background-size: contain; background-repeat: no-repeat; background-position: center; color: transparent; border: 0; box-shadow: none; }
#view.th-tv .fdot { background: #d9d2c0; } #view.th-tv .fdot.ok { background: #5acb3a; } #view.th-tv .fdot.ko { background: #ff6b5a; } #view.th-tv .fdot.now { box-shadow: 0 0 0 3px #ffd24d; }
#view.th-tv .btn.primary { background: radial-gradient(circle at 35% 30%, #ff6b5a, #c8321f); border-color: #ffd24d; color: #fff; box-shadow: 0 4px 0 #8c1c10; }
#view.th-tv .flash-status { color: #1b2d8a; }
@media (max-width: 480px) { .act-puzzle .question { font-size: 1.9rem; gap: 0; } }

/* Pages de choix des tables des quatre activités relookées : même décor que le jeu */
#view.th-arcade { --th-bg: #120a33 url(/img/act/bg-arcade.webp); --th-rim: #ff4fd8; --th-fox: url(/img/act/fox-point.webp); box-shadow: 0 0 22px rgba(255, 79, 216, 0.5); }
#view.th-puzzle { --th-bg: #f7e9cf url(/img/act/bg-puzzle.webp); --th-rim: #f0c27d; --th-fox: url(/img/act/fox-point.webp); }
#view.th-arcade > section.pick { background: rgba(18, 10, 51, 0.9); border-color: #2d7bff; color: #fff; }
#view.th-arcade .pick h2 { color: #ffe36b; text-shadow: 0 0 10px rgba(255, 227, 107, 0.6); }
#view.th-arcade .pick .op-tag { background: #ff4fd8; color: #fff; }
#view.th-arcade .pick .muted, #view.th-arcade .pick .lead { color: #cfd8ff; }
#view.th-arcade .tile { background: radial-gradient(circle at 50% 25%, #1d3f9e, #0b1a52); border-color: #2d7bff; color: #ffe36b; box-shadow: 0 0 10px rgba(45, 123, 255, 0.5); }
#view.th-arcade .tile .stars { color: rgba(255, 255, 255, 0.3); } #view.th-arcade .tile .stars .on { color: #ffe36b; }
#view.th-arcade .tile.sel { background: radial-gradient(circle at 50% 25%, #ff4fd8, #8a1a9e); border-color: #fff; color: #fff; outline: 0; box-shadow: 0 0 18px #ff4fd8; transform: translateY(-2px); }
#view.th-arcade .opt-label { color: #ffe36b; }
#view.th-arcade .seg button { background: #0b1a52; border-color: #2d7bff; color: #cfd8ff; }
#view.th-arcade .seg button.on, #view.th-arcade .seg button[aria-checked='true'] { background: linear-gradient(#ffe36b, #ff9c2d); border-color: #fff; color: #3a2400; }
#view.th-arcade .btn.small { background: #0b1a52; border-color: #2d7bff; color: #ffe36b; }
#view.th-arcade .btn.primary { background: radial-gradient(circle at 35% 30%, #ff7a8a, #d6224a); border-color: #ffe36b; color: #fff; box-shadow: 0 4px 0 #7a0d28, 0 0 16px rgba(255, 79, 120, 0.6); }
#view.th-puzzle > section.pick { background: rgba(255, 250, 238, 0.94); }
#view.th-puzzle .tile { min-height: 0; aspect-ratio: 1; border: 0; background: transparent url(/img/act/pz-yellow.webp) center / contain no-repeat; box-shadow: none; color: #5a3a00; padding: 0 0.3em 0 0.1em; }
#view.th-puzzle .tile:nth-child(4n + 2) { background-image: url(/img/act/pz-pink.webp); color: #7a1235; }
#view.th-puzzle .tile:nth-child(4n + 3) { background-image: url(/img/act/pz-purple.webp); color: #fff; }
#view.th-puzzle .tile:nth-child(4n + 4) { background-image: url(/img/act/pz-blue.webp); color: #fff; }
#view.th-puzzle .tile .stars { color: rgba(0, 0, 0, 0.25); } #view.th-puzzle .tile .stars .on { color: #ffd24d; }
#view.th-puzzle .tile.s2, #view.th-puzzle .tile.s3, #view.th-puzzle .tile.s1 { background-color: transparent; }
#view.th-puzzle .tile.sel { background-color: transparent; outline: 0; filter: drop-shadow(0 0 10px #5aff2d) brightness(1.1); transform: scale(1.1); }
#view.th-puzzle .seg button[aria-checked='true'], #view.th-puzzle .seg button.on { background: linear-gradient(#9be37a, #43a32a); border-color: #2f7d1a; color: #fff; }
#view.th-puzzle .btn.primary { background: linear-gradient(#ffd24d, #f09a12); border-color: #c58a00; color: #3a2400; box-shadow: 0 4px 0 #c58a00; }
#view.th-stage .tile, #view.th-tv .tile { background: #fffaf0; border-color: #e6c27a; }
#view.th-stage .tile.sel, #view.th-tv .tile.sel { background: #d9f3f0; border-color: var(--teal); }
#view.th-stage .pick h2, #view.th-tv .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff6dc; background: linear-gradient(#c8321f, #8c1c10); border: 4px solid #ffd24d; border-radius: 16px; box-shadow: 0 0 0 3px #8c1c10, 0 0 14px rgba(255, 210, 77, 0.75); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
#view.th-tv .pick h2 { background: linear-gradient(#5a46d8, #2d1f94); box-shadow: 0 0 0 3px #2d1f94, 0 0 14px rgba(255, 210, 77, 0.75); }
#view.th-stage .pick .lead, #view.th-tv .pick .lead { text-align: center; font-weight: 800; }

/* Pages de choix de Duel, Sauve le vaisseau, Grimpe l'immeuble et Le pont de 10 */
#view.th-duel { --th-bg: #243a8a url(/img/act/bg-duel.webp); --th-rim: #e8b830; --th-fox: url(/img/act/fox-cheer.webp); }
#view.th-space { --th-bg: #0b0a2e url(/img/runner/space.webp); --th-rim: #7a5cff; --th-fox: url(/img/act/fox-point.webp); box-shadow: 0 0 22px rgba(122, 92, 255, 0.5); }
#view.th-climb { --th-bg: #3a1f6b url(/img/act/bg-climb.webp); --th-rim: #ff9c4a; --th-fox: url(/img/act/fox-point.webp); }
#view.th-bridge { --th-bg: #1f8a8f url(/img/bridge/canyon.webp); --th-rim: #c98a4b; --th-fox: url(/img/act/fox-teach.webp); }
#view.th-duel > section.pick, #view.th-bridge > section.pick { background: rgba(255, 250, 238, 0.95); border-color: #e8b830; }
#view.th-space > section.pick { background: rgba(11, 10, 46, 0.9); border-color: #7a5cff; color: #fff; }
#view.th-climb > section.pick { background: rgba(40, 20, 78, 0.9); border-color: #ff9c4a; color: #fff; }
#view.th-space .pick .muted, #view.th-space .pick .lead, #view.th-climb .pick .muted, #view.th-climb .pick .lead { color: #e0d8ff; }
#view.th-space .pick h2 { color: #8fe9ff; text-shadow: 0 0 10px rgba(143, 233, 255, 0.6); }
#view.th-climb .pick h2 { color: #ffd9a0; text-shadow: 0 0 10px rgba(255, 156, 74, 0.6); }
#view.th-duel .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff; background: linear-gradient(90deg, #2c5be0 49%, #d6322c 51%); border: 4px solid #ffd24d; border-radius: 16px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
#view.th-bridge .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff6dc; background: linear-gradient(#a8672c, #6e3f14); border: 4px solid #e8b830; border-radius: 16px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
#view.th-duel .pick .lead, #view.th-bridge .pick .lead { text-align: center; font-weight: 800; }
#view.th-space .tile { background: radial-gradient(circle at 50% 25%, #3a2a9e, #120c4a); border-color: #7a5cff; color: #8fe9ff; box-shadow: 0 0 10px rgba(122, 92, 255, 0.5); }
#view.th-space .tile .stars { color: rgba(255, 255, 255, 0.3); } #view.th-space .tile .stars .on { color: #ffe36b; }
#view.th-space .tile.sel { background: radial-gradient(circle at 50% 25%, #19c6e8, #0a5a9e); border-color: #fff; color: #fff; outline: 0; box-shadow: 0 0 18px #19c6e8; transform: translateY(-2px); }
#view.th-climb .tile { background: linear-gradient(#7a3a52, #4a2040); border-color: #ff9c4a; color: #ffd9a0; box-shadow: 0 3px 0 #2a1030; }
#view.th-climb .tile .stars { color: rgba(255, 255, 255, 0.3); } #view.th-climb .tile .stars .on { color: #ffe36b; }
#view.th-climb .tile.sel { background: linear-gradient(#ff9c4a, #d6602a); border-color: #fff; color: #fff; outline: 0; box-shadow: 0 0 16px #ff9c4a; transform: translateY(-2px); }
#view.th-duel .tile { background: #fffaf0; border-color: #e8b830; }
#view.th-duel .tile:nth-child(odd).sel { background: #cfe0ff; border-color: #2c5be0; outline: 0; }
#view.th-duel .tile:nth-child(even).sel { background: #ffd6d2; border-color: #d6322c; outline: 0; }
#view.th-space .opt-label, #view.th-climb .opt-label { color: #ffe36b; }
#view.th-space .seg button { background: #1a1560; border-color: #7a5cff; color: #e0d8ff; }
#view.th-climb .seg button { background: #4a2040; border-color: #ff9c4a; color: #ffd9a0; }
#view.th-space .seg button.on, #view.th-space .seg button[aria-checked='true'] { background: linear-gradient(#8fe9ff, #19c6e8); border-color: #fff; color: #04284a; }
#view.th-climb .seg button.on, #view.th-climb .seg button[aria-checked='true'] { background: linear-gradient(#ffd9a0, #ff9c4a); border-color: #fff; color: #4a2000; }
#view.th-space .btn.small, #view.th-climb .btn.small { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
#view.th-space .btn.primary { background: radial-gradient(circle at 35% 30%, #ff7a8a, #d6224a); border-color: #8fe9ff; color: #fff; box-shadow: 0 4px 0 #7a0d28, 0 0 16px rgba(255, 79, 120, 0.6); }
#view.th-climb .btn.primary { background: linear-gradient(#ff9c4a, #d6602a); border-color: #ffd9a0; color: #fff; box-shadow: 0 4px 0 #7a3410; }
#view.th-duel .btn.primary { background: linear-gradient(#ffd24d, #f09a12); border-color: #c58a00; color: #3a2400; box-shadow: 0 4px 0 #c58a00; }
#view.th-duel .seg button.on, #view.th-duel .seg button[aria-checked='true'] { background: linear-gradient(#5a8aff, #2c5be0); border-color: #1a3fa8; color: #fff; }
#view.th-bridge .level { background: #f6ead0; border: 4px solid #c98a4b; border-radius: 24px; box-shadow: 0 5px 0 #8a5a2a, inset 0 0 0 3px #fff6dc; }
#view.th-bridge .level strong { color: #6e3f14; } #view.th-bridge .level-ex { color: #1d7c87; }
#view.th-bridge .level:hover { background: #fff6dc; transform: translateY(-2px); }

/* Pages de choix de Tir aux cibles, Memory des jumeaux et L'atelier du double */
#view.th-shoot { --th-bg: #7ec8f0 url(/img/shoot/stand.webp); --th-rim: #c8321f; --th-fox: url(/img/act/fox-host.webp); }
#view.th-memory { --th-bg: #8fd3f5 url(/img/act/bg-memory.webp); --th-rim: #2c6fd0; --th-fox: url(/img/act/fox-cheer.webp); }
#view.th-atelier { --th-bg: #1d1050 url(/img/act/bg-atelier.webp); --th-rim: #d6a53a; --th-fox: url(/img/act/wiz-idle.webp); box-shadow: 0 0 22px rgba(214, 165, 58, 0.5); }
#view.th-shoot > section.pick, #view.th-memory > section.pick { background: rgba(255, 250, 238, 0.95); border-color: #ffd24d; }
#view.th-atelier > section.pick { background: rgba(29, 16, 80, 0.9); border-color: #d6a53a; color: #fff; }
#view.th-atelier .pick .muted, #view.th-atelier .pick .lead { color: #e6dcff; }
#view.th-shoot .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff; background: linear-gradient(#e0473a, #a8261c); border: 4px solid #ffd24d; border-radius: 16px; box-shadow: 0 0 0 3px #a8261c; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
#view.th-memory .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff; background: linear-gradient(#3b86e8, #1f4fa8); border: 4px solid #ffd24d; border-radius: 16px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
#view.th-atelier .pick h2 { color: #ffe08a; text-shadow: 0 0 12px rgba(255, 210, 90, 0.7); }
#view.th-shoot .pick .lead, #view.th-memory .pick .lead { text-align: center; font-weight: 800; }
#view.th-shoot .tile { background: #fffaf0; border-color: #e8a0a0; }
#view.th-shoot .tile:nth-child(odd) { border-color: #d6322c; }
#view.th-shoot .tile.sel { background: #ffe9a0; border-color: #d6322c; outline: 0; box-shadow: 0 0 0 3px #fff, 0 0 14px #ffb02e; transform: translateY(-2px); }
#view.th-shoot .btn.primary { background: linear-gradient(#ff6b5a, #c8321f); border-color: #ffd24d; color: #fff; box-shadow: 0 4px 0 #8c1c10; }
#view.th-shoot .seg button.on, #view.th-shoot .seg button[aria-checked='true'] { background: linear-gradient(#ff6b5a, #c8321f); border-color: #8c1c10; color: #fff; }
#view.th-memory .level { background: #fff; border: 4px solid #2c6fd0; border-radius: 18px; box-shadow: 0 5px 0 #1a4a9a; }
#view.th-memory .level:nth-child(odd) { transform: rotate(-1.2deg); } #view.th-memory .level:nth-child(even) { transform: rotate(1.2deg); }
#view.th-memory .level:hover { transform: translateY(-3px) rotate(0); }
#view.th-memory .level strong { color: #1f4fa8; } #view.th-memory .level-ex { color: #e0472a; }
#view.th-memory .seg button.on, #view.th-memory .seg button[aria-checked='true'] { background: linear-gradient(#3b86e8, #1f4fa8); border-color: #12347a; color: #fff; }
#view.th-memory .btn.primary { background: linear-gradient(#ffd24d, #f09a12); border-color: #c58a00; color: #3a2400; }
#view.th-atelier .level { background: linear-gradient(#3a2490, #20125e); border: 3px solid #d6a53a; border-radius: 20px; box-shadow: 0 0 12px rgba(214, 165, 58, 0.45); color: #fff; }
#view.th-atelier .level strong { color: #ffe08a; } #view.th-atelier .level-ex { color: #8fe9ff; } #view.th-atelier .level small { color: #d9ccff; }
#view.th-atelier .level:hover { box-shadow: 0 0 20px #d6a53a; transform: translateY(-2px); }
#view.th-atelier .opt-label { color: #ffe08a; }
#view.th-atelier .seg button { background: #20125e; border-color: #d6a53a; color: #e6dcff; }
#view.th-atelier .seg button.on, #view.th-atelier .seg button[aria-checked='true'] { background: linear-gradient(#ffe08a, #d6a53a); border-color: #fff; color: #3a2400; }

/* ---------- Duel : l'arène (bleu contre rouge) ---------- */
.duel { padding: 0.5rem; border-radius: 26px; border: 4px solid #e8b830; background: #14214d url(/img/act/bg-duel.webp) center / cover no-repeat; box-shadow: var(--shadow); margin: 0 -0.4rem; }
.duel-half { position: relative; color: #fff; border: 4px solid #ffd24d; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25), 0 4px 0 rgba(0, 0, 0, 0.3); }
.duel-half.p1 { background: linear-gradient(#3b73f0f2, #1b3fa8f2); border-color: #9fc0ff; }
.duel-half.p2 { background: linear-gradient(#ee5148f2, #a8261cf2); border-color: #ffb0a0; }
.duel-half.won { background: linear-gradient(#34c759f2, #1a8a3ef2); border-color: #ffd24d; box-shadow: 0 0 24px #ffd24d, inset 0 0 0 3px rgba(255, 255, 255, 0.35); }
.duel-half.lost { opacity: 0.75; filter: saturate(0.6); }
.duel-head strong { padding: 0.1rem 0.9rem; border-radius: 999px; background: #fff6dc; color: #14214d; border: 3px solid #ffd24d; }
.pips i { background: rgba(255, 255, 255, 0.25); box-shadow: none; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); width: 18px; height: 18px; border-radius: 0; }
.pips i.on { background: #ffd24d; box-shadow: none; filter: drop-shadow(0 0 4px #fff3a8); }
.duel-q { align-self: center; width: fit-content; min-width: 55%; margin: 0 auto; padding: 0.15rem 1.4rem; border-radius: 22px; background: #fff6dc; color: #14214d; border: 4px solid #ffd24d; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.duel-answers .answer { border: 3px solid #ffd24d; border-radius: 18px; background: linear-gradient(#ffffff, #f1e7d0); color: #14214d; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.duel-answers .answer.right { background: linear-gradient(#b6f59a, #34c759); border-color: #fff; color: #0d4a1c; box-shadow: 0 0 16px #b6f59a; }
.duel-answers .answer.wrong { background: #bdbdbd; color: #666; border-color: #888; }
.duel-msg { color: #fff6dc; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.duel-end { color: #fff; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.5); }
.duel-fox { display: block; height: clamp(70px, 14vh, 130px); width: auto; margin: 0 auto 0.2rem; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }
.duel-mid { padding: 0.25rem 0.8rem; border-radius: 999px; background: linear-gradient(#ffe27a, #e8b830); border: 3px solid #fff6dc; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.duel-target { color: #5a3a00; }
.duel-mid .btn { border-color: #b8821a; background: #fffaf0; color: #5a3a00; }
.duel-mid .btn.primary { background: linear-gradient(#5aa0ff, #1646b8); border-color: #fff; color: #fff; }

/* ---------- Memory des jumeaux : cartes sur la table, ciel bleu ---------- */
.act-memory { --act-bg: #8fd3f5 url(/img/act/bg-memory.webp); --act-rim: #2c6fd0; --act-chip: rgba(255, 255, 255, 0.93); --act-ink: #1f4fa8; }
.act-memory .memory-hud span { padding: 0.2rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.93); color: #1f4fa8; border: 3px solid #ffd24d; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }
.act-memory .memory-hud span.on { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; border-color: #fff; }
.act-memory > p.muted { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.15rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.9); color: #1f4fa8; font-weight: 700; }
.act-memory .memory-grid { gap: 0.7rem; margin: 0.9rem auto; max-width: 560px; }
.act-memory .mcard { border: 3px solid #ffd24d; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #3a6fe0, #14307a); color: #ffd24d; text-shadow: 0 0 8px rgba(255, 210, 77, 0.7); box-shadow: 0 5px 0 #0c1f55, inset 0 0 0 3px rgba(255, 255, 255, 0.2); transition: transform 0.15s; }
.act-memory .mcard:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); }
.act-memory .mcard.up { background: #fffdf6; border-color: #cdd6ee; color: #e0472a; text-shadow: none; animation: mflip 0.35s ease-out; box-shadow: 0 5px 0 #aab6d8; }
.act-memory .mcard.up[data-k='1'] { color: #2c6fd0; } .act-memory .mcard.up[data-k='2'] { color: #2b9a3a; } .act-memory .mcard.up[data-k='3'] { color: #8a3fc8; }
.act-memory .mcard.done { background: linear-gradient(#fff6c8, #ffe27a); border-color: #e8b830; box-shadow: 0 0 16px #ffd24d, 0 5px 0 #b8821a; }
@keyframes mflip { from { transform: perspective(500px) rotateY(90deg); } to { transform: perspective(500px) rotateY(0); } }
.act-memory .family { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.act-memory .feedback.good { color: #1f8f3a; } .act-memory .feedback.bad { color: #b3365f; }
@media (prefers-reduced-motion: reduce) { .act-memory .mcard.up { animation: none; } }

/* ---------- L'atelier du double : le renard apprenti magicien ---------- */
.act-atelier { --act-bg: #1d1050 url(/img/act/bg-atelier.webp); --act-rim: #d6a53a; --act-chip: rgba(29, 16, 80, 0.88); --act-ink: #ffe08a; box-shadow: 0 0 22px rgba(214, 165, 58, 0.45); color: #fff; }
.act-atelier h2 { text-align: center; color: #ffe08a; text-shadow: 0 0 12px rgba(255, 210, 90, 0.7); }
.act-atelier .lead { text-align: center; color: #e6dcff; font-weight: 700; }
.act-atelier .progress-line { height: 12px; background: rgba(29, 16, 80, 0.88); border: 2px solid #d6a53a; }
.act-atelier .progress-line i { background: linear-gradient(90deg, #8fe9ff, #ffe08a); }
.act-atelier .atelier-step { color: #ffe08a; text-shadow: 0 0 10px rgba(255, 210, 90, 0.6); }
.act-atelier .icon-btn { background: #20125e; border-color: #d6a53a; color: #ffe08a; }
.act-atelier .atelier-stage { position: relative; background: linear-gradient(#f6e7bd, #e8d49a); border: 4px solid #d6a53a; color: #3a2490; box-shadow: 0 0 18px rgba(255, 210, 90, 0.45), inset 0 0 22px rgba(120, 80, 20, 0.25); min-height: 12rem; }
.act-atelier .atelier-line { color: #3a2490; } .act-atelier .atelier-line.big { color: #7a2fc0; } .act-atelier .atelier-line.sub { color: #6a5a8a; }
.act-atelier .atelier-arrow { color: #d6602a; }
.atelier-cauldron { height: 70px; width: auto; margin-bottom: 0.2rem; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.act-atelier .atelier-magic { animation: tok-pop 0.4s ease-out; filter: drop-shadow(0 0 10px rgba(255, 210, 90, 0.9)); }
.act-atelier .atelier-help, .act-atelier .atelier-why { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.25rem 1rem; border-radius: 14px; background: #fff6dc; color: #3a2490; border: 3px solid #d6a53a; }
.act-atelier .atelier-why { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; }
.act-atelier .question { margin: 0.5rem auto; max-width: 540px; border-radius: 22px; background: linear-gradient(#f6e7bd, #e8d49a); border: 4px solid #d6a53a; box-shadow: 0 0 18px rgba(255, 210, 90, 0.45); color: #3a2490; }
.act-atelier .question .hole { color: #d6602a; border-bottom-color: #d6602a; }
.act-atelier .question.good .hole { color: #1f8f3a; border-color: #1f8f3a; } .act-atelier .question.bad .hole { color: #b3365f; border-color: #b3365f; }
.act-atelier .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; max-width: 620px; margin: 0 auto; }
.act-atelier .answer { min-height: 0; aspect-ratio: 1; border-radius: 22px 22px 40% 40%; border: 4px solid #d6a53a; background: radial-gradient(circle at 35% 28%, #b98cff, #5a2bb8 70%, #2c1170); color: #fff; font-size: clamp(1.6rem, 6vw, 2.6rem); text-shadow: 0 2px 0 rgba(0, 0, 40, 0.5); box-shadow: 0 0 14px rgba(150, 100, 255, 0.7), 0 4px 0 #20125e; }
.act-atelier .answer small { color: #ffe08a; }
.act-atelier .answer.right { background: radial-gradient(circle at 35% 28%, #c5ffb0, #34c759 70%, #17703a); border-color: #fff; box-shadow: 0 0 20px #b6f59a; transform: scale(1.07); }
.act-atelier .answer.wrong { background: #6a6580; border-color: #aaa; box-shadow: none; filter: grayscale(0.7); }
.act-atelier .key { background: #20125e; border-color: #d6a53a; color: #ffe08a; }
.act-atelier .key.ok { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; }
.act-atelier .typed { background: #fff6dc; color: #3a2490; border-color: #d6a53a; }
.act-atelier .feedback { color: #ffe08a; } .act-atelier .feedback.good { color: #1f8f3a; } .act-atelier .feedback.bad { color: #b3365f; }
.act-atelier .btn { background: #fffaf0; border-color: #c9a45b; color: #3a2490; }
.act-atelier .btn.primary { background: linear-gradient(#ffe27a, #e8b830); border-color: #fff; color: #5a3a00; box-shadow: 0 4px 0 #b8821a, 0 0 14px rgba(255, 210, 90, 0.7); }
#view.th-atelier > section.result { background: rgba(255, 250, 238, 0.95); }
@media (max-width: 480px) { .act-atelier .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 300px; } }
.act-atelier h2, .act-atelier .lead { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; padding: 0.15rem 1rem; border-radius: 16px; background: rgba(29, 16, 80, 0.88); }

/* ---------- L'atelier des presque-doubles, Le partage des billes, Les dominos jumeaux : pages de choix et d'activité ---------- */
#view.th-presque { --th-bg: #f3d9a4 url(/img/act/bg-presque.webp); --th-rim: #d89a3a; --th-fox: url(/img/act/fox-teach.webp); }
#view.th-partage { --th-bg: #5fc9bd url(/img/act/bg-partage.webp); --th-rim: #2aa59a; --th-fox: url(/img/act/fox-point.webp); }
#view.th-dominos { --th-bg: #101a40 url(/img/act/bg-dominos.webp); --th-rim: #d6a53a; --th-fox: url(/img/act/fox-host.webp); box-shadow: 0 0 22px rgba(214, 165, 58, 0.45); }
#view.th-presque > section.pick, #view.th-presque > section.result, #view.th-partage > section.pick, #view.th-partage > section.result, #view.th-dominos > section.result { background: rgba(255, 250, 238, 0.95); border-color: #ffd24d; }
#view.th-dominos > section.pick { background: rgba(16, 26, 64, 0.9); border-color: #d6a53a; color: #fff; }
#view.th-dominos .pick .muted, #view.th-dominos .pick .lead { color: #dfe6ff; }
#view.th-presque .pick h2, #view.th-partage .pick h2 { display: block; width: fit-content; margin: 0 auto 0.6rem; padding: 0.15rem 1.6rem; color: #fff; border: 4px solid #ffd24d; border-radius: 16px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
#view.th-presque .pick h2 { background: linear-gradient(#b86ad8, #7a35a8); } #view.th-partage .pick h2 { background: linear-gradient(#2aa59a, #137a70); }
#view.th-dominos .pick h2 { color: #ffe08a; text-shadow: 0 0 10px rgba(255, 210, 90, 0.6); }
#view.th-presque .pick .lead, #view.th-partage .pick .lead { text-align: center; font-weight: 800; }
#view.th-presque .level { background: #fff6e3; border: 4px solid #d89a3a; border-radius: 22px; box-shadow: 0 5px 0 #a8701a; }
#view.th-presque .level strong { color: #7a35a8; } #view.th-presque .level-ex { color: #e0472a; }
#view.th-partage .level { background: #fffaf0; border: 4px solid #2aa59a; border-radius: 22px; box-shadow: 0 5px 0 #137a70; }
#view.th-partage .level strong { color: #137a70; } #view.th-partage .level-ex { color: #e0472a; }
#view.th-dominos .level { background: linear-gradient(#ffffff, #efe6cf); border: 3px solid #d6a53a; border-radius: 14px; box-shadow: 0 4px 0 #8a6a1a; color: #14214d; }
#view.th-dominos .level strong { color: #2f4a9a; } #view.th-dominos .level-ex { color: #c23a1c; } #view.th-dominos .level small { color: #3a4a6a; }
#view.th-dominos .opt-label { color: #ffe08a; }
#view.th-dominos .seg button { background: #14214d; border-color: #d6a53a; color: #dfe6ff; }
#view.th-dominos .seg button.on, #view.th-dominos .seg button[aria-checked='true'] { background: linear-gradient(#ffe08a, #d6a53a); border-color: #fff; color: #3a2400; }
#view.th-presque .seg button.on, #view.th-presque .seg button[aria-checked='true'] { background: linear-gradient(#b86ad8, #7a35a8); border-color: #4a1a78; color: #fff; }
#view.th-partage .seg button.on, #view.th-partage .seg button[aria-checked='true'] { background: linear-gradient(#2aa59a, #137a70); border-color: #0a4a44; color: #fff; }
#view.th-presque .btn.primary, #view.th-partage .btn.primary { background: linear-gradient(#ffd24d, #f09a12); border-color: #c58a00; color: #3a2400; box-shadow: 0 4px 0 #c58a00; }
#view.th-dominos .btn.primary { background: linear-gradient(#ffe27a, #e8b830); border-color: #fff; color: #5a3a00; box-shadow: 0 4px 0 #b8821a; }

/* activités : le renard change de pose selon le retour (image de remplacement via content, navigateurs récents) */
.act:has(.feedback.good) .act-fox { content: url(/img/act/fox-cheer.webp); }
.act:has(.feedback.bad) .act-fox { content: url(/img/act/fox-sorry.webp); }

/* presque-doubles : atelier de jouets */
.act-presque { --act-bg: #f3d9a4 url(/img/act/bg-presque.webp); --act-rim: #d89a3a; }
.act-presque .atelier-stage { background: linear-gradient(#fffaf0, #f6e7bd); border: 4px solid #d89a3a; box-shadow: 0 0 12px rgba(216, 154, 58, 0.45); color: #3a2490; }
.act-presque .atelier-line { color: #3a2490; } .act-presque .atelier-line.big { color: #e0472a; } .act-presque .atelier-line.sub { color: #6a5a8a; }
.act-presque .atelier-step { color: #5a3a8c; } .act-presque .icon-btn { background: #fffaf0; border-color: #d89a3a; color: #5a3a8c; }
.act-presque h2, .act-presque .lead { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; padding: 0.15rem 1rem; border-radius: 16px; background: rgba(255, 250, 238, 0.92); color: #5a3a8c; text-align: center; }
.act-presque .atelier-help, .act-presque .atelier-why { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.25rem 1rem; border-radius: 14px; background: #fff6dc; color: #3a2490; border: 3px solid #d89a3a; }
.act-presque .atelier-why { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; }
.act-presque .btn { background: #fffaf0; border-color: #d89a3a; color: #5a3a8c; }
.act-presque .btn.primary { background: linear-gradient(#ffd24d, #f09a12); border-color: #c58a00; color: #3a2400; box-shadow: 0 4px 0 #c58a00; }
.act-presque .key { background: #fffaf0; border-color: #d89a3a; color: #5a3a8c; } .act-presque .key.ok { background: linear-gradient(#9be37a, #43a32a); color: #fff; }
.act-presque .seg { background: #fffaf0; }

/* partage des billes : salle de jeux turquoise */
.act-partage { --act-bg: #5fc9bd url(/img/act/bg-partage.webp); --act-rim: #2aa59a; --act-chip: rgba(255, 255, 255, 0.93); --act-ink: #137a70; }
.act-partage .progress-line { height: 14px; background: rgba(255, 255, 255, 0.93); border: 2px solid #2aa59a; }
.act-partage .progress-line i { background: linear-gradient(90deg, #7ed957, #ffd24d); }
.act-partage .partage-n { background: #fffaf0; border-color: #ffd24d; color: #137a70; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); }
.act-partage .marbles { grid-template-columns: repeat(10, 22px); gap: 3px; }
.act-partage .bag .marbles { grid-template-columns: repeat(5, 22px); }
.act-partage .marble { width: 22px; height: 22px; border: 0; border-radius: 0; background: url(/img/act/marble-red.webp) center / contain no-repeat; }
.act-partage .marble:nth-child(5n + 2) { background-image: url(/img/act/marble-blue.webp); } .act-partage .marble:nth-child(5n + 3) { background-image: url(/img/act/marble-green.webp); }
.act-partage .marble:nth-child(5n + 4) { background-image: url(/img/act/marble-yellow.webp); } .act-partage .marble:nth-child(5n + 5) { background-image: url(/img/act/marble-purple.webp); }
.act-partage .bag { background: rgba(255, 250, 238, 0.9); border: 3px solid #ffd24d; border-style: solid; }
.bag-ico { width: auto; height: 62px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3)); }
.act-partage .bag-count { color: #137a70; }
.act-partage .copier-q { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.2rem 1.1rem; border-radius: 16px; background: rgba(255, 250, 238, 0.94); color: #137a70; border: 3px solid #ffd24d; }
.act-partage .answers { max-width: 560px; margin: 0 auto; }
.act-partage .answer { border: 4px solid #ffd24d; border-radius: 22px; background: linear-gradient(#3bbfb2, #137a70); color: #fff; text-shadow: 0 2px 0 rgba(0, 40, 36, 0.5); box-shadow: 0 4px 0 #0a4a44; }
.act-partage .answer.right { background: linear-gradient(#b6f59a, #34c759); box-shadow: 0 0 18px #b6f59a; transform: scale(1.04); }
.act-partage .answer.wrong { background: #9a9a9a; box-shadow: none; filter: grayscale(0.7); }
.act-partage .key { background: #fffaf0; border-color: #2aa59a; color: #137a70; } .act-partage .key.ok { background: linear-gradient(#9be37a, #43a32a); color: #fff; }
.act-partage .feedback.good { color: #1f8f3a; } .act-partage .feedback.bad { color: #b3365f; }

/* dominos jumeaux : table de jeu feutrée */
.act-dominos { --act-bg: #101a40 url(/img/act/bg-dominos.webp); --act-rim: #d6a53a; --act-chip: rgba(16, 26, 64, 0.9); --act-ink: #ffe08a; box-shadow: 0 0 22px rgba(214, 165, 58, 0.45); }
.act-dominos .progress-line { height: 12px; background: rgba(16, 26, 64, 0.9); border: 2px solid #d6a53a; }
.act-dominos .progress-line i { background: linear-gradient(90deg, #8fe9ff, #ffe08a); }
.act-dominos .memory-player, .act-dominos .quiz-top span { color: #ffe08a; background: transparent; border: 0; }
.act-dominos .copier-q { width: fit-content; max-width: 100%; margin: 0.4rem auto; padding: 0.2rem 1.1rem; border-radius: 16px; background: #fff6dc; color: #14214d; border: 3px solid #d6a53a; }
.act-dominos .domino { background: linear-gradient(#ffffff, #efe6cf); border: 3px solid #d6a53a; border-radius: 14px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 224, 138, 0.35); }
.act-dominos .dsep { background: #d6a53a; width: 4px; }
.act-dominos .dpip.on::after { background: radial-gradient(circle at 35% 30%, #4a5a8a, #101a40); box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.4); }
.act-dominos .dq { color: #d6602a; }
.act-dominos .domino-btn { background: transparent; border: 0; box-shadow: none; transition: transform 0.15s, filter 0.15s; }
.act-dominos .domino-btn:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); }
.act-dominos .domino-btn.right { background: transparent; filter: drop-shadow(0 0 14px #b6f59a); transform: scale(1.06); }
.act-dominos .domino-btn.wrong { background: transparent; filter: grayscale(0.8) brightness(0.8); }
.act-dominos .answers { max-width: 600px; margin: 0 auto; }
.act-dominos .answer { border: 3px solid #d6a53a; border-radius: 16px; background: linear-gradient(#fffdf6, #e8dcc0); color: #14214d; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45); }
.act-dominos .answer.right { background: linear-gradient(#b6f59a, #34c759); box-shadow: 0 0 18px #b6f59a; } .act-dominos .answer.wrong { background: #aaa; filter: grayscale(0.7); }
.act-dominos .key { background: #14214d; border-color: #d6a53a; color: #ffe08a; } .act-dominos .key.ok { background: linear-gradient(#ffe27a, #e8b830); color: #5a3a00; }
.act-dominos .feedback { color: #ffe08a; } .act-dominos .feedback.good { color: #1f8f3a; } .act-dominos .feedback.bad { color: #b3365f; }

/* ---------- Téléphone en paysage (écran très bas) ----------
   Barre fine, cadre d'ardoise plus mince, accueil sur 4 colonnes sans les grandes images, décors masqués ; les jeux sont ensuite
   réduits à la hauteur de l'écran par js/landscape.js (ils tiennent entiers, sans défiler). */
@media (max-height: 520px) and (orientation: landscape) {
  #topbar { padding: 0.25rem 0.6rem; gap: 0.4rem; }
  .brand { font-size: 1rem; }
  .brand img { width: 28px; height: 28px; }
  .chip, .avatar-btn { min-height: 38px; padding: 0.1rem 0.6rem; }
  .icon-btn { min-width: 38px; min-height: 38px; font-size: 1.1rem; }
  #view { padding: 0.4rem 0.7rem 0.8rem; }
  body.home-on::after { border-width: 10px; border-image-width: 10px; }
  body.home-on #topbar { padding-top: calc(0.25rem + 10px); padding-left: calc(0.6rem + 10px); padding-right: calc(0.6rem + 10px); }
  body.home-on #view { padding: 0.4rem calc(0.7rem + 10px) calc(0.8rem + 10px); }
  .board-fox, .act-fox { display: none; }
  .home.board { padding: 0.1rem 0 0.3rem; }
  .home.board h1 { font-size: 1.5rem; }
  .home.board .lead { margin-top: 0.3rem; font-size: 1rem; }
  .home.board .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin: 0.6rem 0; }
  .home.board .mode-body { padding: 0.35rem 0.5rem 0.5rem; }
  .home.board .mode-body strong { font-size: 0.98rem; }
  .home.board .mode-body small { font-size: 0.78rem; }
  .mode-art { aspect-ratio: 16 / 7; }
  #view[class*='th-'] { margin: 0.3rem auto 0.4rem; padding: 0.5rem 0.7rem 0.7rem; }
  #view[class*='th-']::after { display: none; }
  #view[class*='th-'] > section { margin-left: 0; }
  .act { padding-left: 0.9rem; min-height: 0; }
  /* Jeux à scène dessinée (Grimpe l'immeuble, Pont de 10, Tir aux cibles, Course) : la scène à droite, le texte et les réponses à gauche */
  section.runner, section.climb { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); grid-auto-rows: min-content; column-gap: 0.8rem; align-items: start; }
  section.climb { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); }
  section.climb .hud { flex-wrap: nowrap; gap: 0.4rem; }
  section.runner > .game-canvas, section.climb > .game-canvas { grid-column: 2; grid-row: 1 / span 8; width: 100%; height: auto; align-self: center; }
  section.runner > :not(.game-canvas), section.climb > :not(.game-canvas) { grid-column: 1; }
  section.runner .answers.formulas { grid-template-columns: 1fr 1fr; }
}

/* ---------- Notice d'utilisation ---------- */
dialog.dlg.wide { max-width: min(720px, 96vw); }
.dlg-body.notice { max-height: 86dvh; overflow-y: auto; }
.nt-sec { border: 2px solid var(--line); border-radius: 16px; padding: 4px 14px 8px; margin: 0.6rem 0; background: #fff; }
.nt-sec > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 800; }
.nt-sec ul, .nt-sec ol { padding-left: 1.3em; margin: 0.4em 0; } .nt-sec li { margin: 0.35em 0; }
.nt-note { padding: 10px 14px; border-radius: 12px; background: #fff6dc; font-weight: 600; }

/* Audit responsive 2026-11-26 */
.pform { grid-template-columns: minmax(0, 1fr); }
.pform input { min-width: 0; width: 100%; box-sizing: border-box; }

/* Menu du lien « 🏫 Ardoisia » : retour à la plateforme + « Signaler un problème » (js/ard-menu.js) */
.ard-menu { position: relative; }
.ard-menu-btn .ard-caret { font-size: 0.7rem; opacity: 0.6; }
.ard-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 280px; max-width: calc(100vw - 24px); padding: 6px; border-radius: 14px; background: #fff; border: 2px solid var(--line); box-shadow: 0 12px 28px rgba(42, 31, 94, 0.18); color: var(--ink, #2a1f5e); }
.ard-menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.ard-menu-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.ard-menu-item:hover, .ard-menu-item:focus-visible { background: #f6efe2; outline: none; }
.ard-menu-item .ard-ico { width: 22px; text-align: center; flex: none; }
.ard-menu-item .ard-label { display: grid; line-height: 1.25; }
.ard-menu-item small { font-weight: 400; font-size: 0.78rem; opacity: 0.7; }
.ard-menu-item .ard-credit { margin-left: auto; flex: none; font-size: 0.75rem; font-weight: 700; color: #1f7a45; background: #e2f6e8; border-radius: 999px; padding: 2px 8px; }

/* ---------- Version indépendante (data-mode="solo") : essai, licence ---------- */
.solo-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem 1rem; margin: 0 0 0.8rem; padding: 0.7rem 1rem; text-decoration: none; color: inherit; border: 2px dashed var(--brand, #ff6b4a); }
.solo-banner strong { color: var(--brand-dark, #d94a2b); }
.solo-banner span { font-weight: 700; color: var(--teal-dark, #0d6b6b); }
.solo-licence { max-width: 560px; margin: 1rem auto; text-align: center; display: grid; gap: 0.6rem; justify-items: center; }
.solo-licence > div { display: grid; gap: 0.7rem; justify-items: center; width: 100%; }
.solo-perks { text-align: left; margin: 0; padding-left: 1.2rem; }
.solo-form { display: grid; gap: 0.7rem; width: 100%; max-width: 380px; text-align: left; }
.solo-form label { display: grid; gap: 0.25rem; font-weight: 600; }
.solo-form input { font: inherit; padding: 0.6rem 0.7rem; border: 2px solid #c9c2b5; border-radius: 10px; width: 100%; box-sizing: border-box; }
.solo-form input:focus { outline: 3px solid var(--brand, #ff6b4a); outline-offset: 1px; }
.solo-form details { display: grid; gap: 0.5rem; }
.solo-form summary { cursor: pointer; color: var(--teal-dark, #0d6b6b); font-weight: 600; }
.solo-form details[open] label { margin-top: 0.5rem; }
