/* Carry the opening scene into play while preserving the court's geometry. */
body[data-screen="game"],body[data-screen="entry"],body[data-screen="countdown"],body[data-screen="results"]{
 --play-surface:#edf7fb;--play-line:#bedce9;--play-blue:#154465;--play-glow:#c1eee9;--play-hud:#f4fbffed;
 background-color:#e6f1f8;background-image:url("/surface-grain.svg"),linear-gradient(#6e9cbd1c 1px,transparent 1px),linear-gradient(90deg,#6e9cbd1c 1px,transparent 1px),radial-gradient(ellipse at 82% 18%,#b4e9eb9c,transparent 58%),linear-gradient(145deg,#e8f1fa,#d8eaf2);
 background-size:64px 64px,36px 36px,36px 36px,100% 100%,100% 100%;
}
:root[data-theme="dark"] body[data-screen]{--play-surface:#123552;--play-line:#39748d;--play-blue:#e8f7ff;--play-glow:#157d8c;--play-hud:#0b2e4beb}
:root[data-theme="dark"] body[data-screen]:not([data-screen="start"]){background-color:#0a2945;background-image:url("/surface-grain.svg"),linear-gradient(#8ac7de12 1px,transparent 1px),linear-gradient(90deg,#8ac7de12 1px,transparent 1px),radial-gradient(ellipse at 85% 15%,#07657a9c,transparent 62%),linear-gradient(145deg,#0d2548,#083c52);background-size:64px 64px,36px 36px,36px 36px,100% 100%,100% 100%}
#game .hud{position:relative;border:1px solid var(--play-line);border-radius:16px;background:var(--play-hud);padding:7px 10px;box-shadow:0 3px 13px #123c5810;min-width:0}
#game .hud-stat{color:var(--play-blue)}#game .hud-stat small{font-size:11px;letter-spacing:.2px;color:var(--muted)}
#game .timer{background:#ffedaa;border:1px solid #dfbd50;border-radius:11px;color:#193c55;box-shadow:inset 0 1px 0 #fff7d4}
#game .timer.low{background:#e42546;border-color:#f14a63;color:#fff;box-shadow:none}
#game .timebar{margin-top:8px;margin-bottom:5px;background:#87a8bf33;height:7px;box-shadow:none}
#game .timebar i{background:linear-gradient(90deg,#23c3ba,#63d4d5 55%,#ffd026);background-size:100% 100%}
#game .chemy-court:before{content:'';position:absolute;inset:8% 2% 0;z-index:-1;border-bottom:1px solid var(--play-line);border-radius:45%;background:radial-gradient(ellipse at 28% 55%,var(--play-glow),transparent 50%);opacity:.5;pointer-events:none}
#game .card{background-color:#f4faff;background-image:url("/surface-grain.svg"),linear-gradient(150deg,#fbfdff,#eef7fc);background-size:64px 64px,auto;border-color:#c3deeb;border-width:2px;border-radius:25px;box-shadow:0 4px 0 #8cb4c026,0 14px 35px #12375317}
#game .card:before{content:'';position:absolute;top:19px;right:18px;width:26px;height:4px;border-radius:4px;background:#f4cd4e;pointer-events:none}
#game .card-cat{background:#deeff5;color:#215471;padding:6px 12px 6px 10px;border:1px solid #cbe3ed}
#game .card-prompt{color:#16354e;letter-spacing:-.025em}
#game .card.right{border-color:#11a16d;box-shadow:0 4px 0 #0f976c20,0 12px 32px #0f976c16}
#game .card.wrong{border-color:#e3495b;box-shadow:0 4px 0 #e3495b20,0 12px 32px #e3495b13}
#game .card.wrong:before{background:#e3495b}#game .card.right:before{background:#11a16d}
#game .reveal{background:#143b58;border-radius:14px;color:#edf8ff;border:1px solid #376883}
#game .reveal b{color:#ffe27a}
#game .choice{border:1px solid;border-radius:17px;box-shadow:inset 0 1px 0 #ffffffaa,0 5px 0 #8facb8;letter-spacing:-.015em}
#game .choice.L{background:linear-gradient(180deg,#fff2ed,#ffdfd7);color:#8c2b2a;border-color:#edb0a3;box-shadow:inset 0 1px 0 #fff,0 5px 0 #c88b80}
#game .choice.R{background:linear-gradient(180deg,#edfff5,#d3f3e4);color:#155c48;border-color:#9dd2bc;box-shadow:inset 0 1px 0 #fff,0 5px 0 #77b69c}
#game .choice:active,#game .choice.hit{transform:translateY(3px);box-shadow:0 2px 0 #87a9b6}
#game .choice[aria-busy="true"]{border-color:#c99e1c;box-shadow:0 3px 0 #b99a41,inset 0 0 0 1px #f4d86e}
#game .bubble{border:1px solid var(--play-line);background:var(--play-hud);color:var(--play-blue);box-shadow:0 4px 15px #0a304729}
#entry .form-card{border:1px solid var(--play-line);border-top:4px solid #f0ca3b;box-shadow:0 18px 50px #16374e1c}
#countdown .count-num{color:#ffce16;text-shadow:2px 3px 0 #e02b38,4px 6px 0 #9c233d,0 9px 22px #0a263a22}
#results .res-score{text-shadow:2px 3px 0 #f2d56b;color:var(--ink)}
#results .btn:not(.ghost){background:linear-gradient(180deg,#ffdf3c,#ffca0c);color:#2d2401;box-shadow:0 5px 0 #b77b06;border:1px solid #ffef9d;border-radius:16px}
#results .res-stat{border-color:var(--play-line);border-radius:16px;box-shadow:0 4px 15px #0d3b5510}
@media(max-width:380px){#game .hud{padding:6px 7px;gap:3px}#game .hud-stat small{font-size:10px}#game .timer{padding:4px 7px}#game .card-cat{font-size:12px}#game .card:before{width:17px;right:13px}}
@media(max-height:500px) and (min-width:500px){#game .hud{padding:2px 7px;border-radius:12px}#game .timebar{height:5px;margin-top:5px;margin-bottom:3px}#game .card{border-radius:18px}#game .card:before{top:14px;width:18px}#game .card-cat{padding:3px 9px}#game .choice{border-radius:13px}}
@media(prefers-reduced-motion:reduce){#game .choice{transition:none}}
/* Cache the moving surfaces; keep their animations on transform and opacity. */
#game .card{will-change:transform,opacity;backface-visibility:hidden}
#game .timebar i{will-change:transform}
#game .chemy-court{contain:layout paint}
#entry .form-actions .btn.go{background:#096a43;color:#fff;box-shadow:0 5px 0 #064a30;font-weight:700}
