/* Scoped additions; keep the shared arcade shell intact. */
body[data-game]{color-scheme:dark;background:#101b25;color:#edf4f7;margin:0;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.5}
.arcade-header{max-width:940px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid #344754}
.arcade-header a{display:inline-flex;align-items:center;min-height:44px;color:#b6f4cf;text-decoration:none;font-weight:750}
.game-main{max-width:760px;margin:auto;padding:16px 18px 24px}.game-main h1{font-size:clamp(1.5rem,5vw,2.15rem);line-height:1.2;margin:0 0 8px}.instructions{color:#c6d6df;margin:0 0 12px;max-width:65ch;font-size:15px}
.game-panel{background:#172936;border:1px solid #3e5668;border-radius:16px;padding:14px}.game-meta{display:flex;flex-wrap:wrap;gap:8px 20px;font-size:14px;color:#c6d6df}.game-meta strong{color:#fff;font-variant-numeric:tabular-nums}#status{min-height:3em;margin:8px 0 12px;font-weight:650;line-height:1.5}
#board{margin:0 auto 14px;max-width:360px;touch-action:manipulation}#board button,.game-actions button{min-width:44px;min-height:44px;font:inherit;font-weight:750;cursor:pointer;border:2px solid #7493a7;color:#edf4f7;background:#233e51;border-radius:9px;touch-action:manipulation}#board button:disabled{cursor:default;opacity:1}#board button:focus-visible,.game-actions button:focus-visible{outline:3px solid #fff;outline-offset:2px}#board button:not(:disabled):hover{border-color:#b6f4cf;background:#33576c}
body[data-game="tic-tac-toe"] #board{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:330px}.cell{aspect-ratio:1;font-size:clamp(2rem,9vw,3.5rem)!important}.cell.player{background:#a5eebe!important;color:#103121!important}.cell.cpu{background:#ffe29a!important;color:#3f2c09!important}
body[data-game="connect-four"] #board{max-width:448px}.drop-controls,.discs{display:grid;grid-template-columns:repeat(7,minmax(44px,1fr));gap:4px}.drop-controls{margin-bottom:6px}.discs{background:#203b50;border-radius:10px;padding:0}.disc{display:grid;place-items:center;min-height:44px;aspect-ratio:1;background:#0e1e2a;border:2px solid #668296;border-radius:50%;font-size:clamp(15px,4vw,24px);font-weight:850}.disc.player{background:#a5eebe;color:#103121;border-color:#a5eebe}.disc.cpu{background:#ffe29a;color:#3f2c09;border-color:#ffe29a}
body[data-game="sequence-memory"] #board{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;max-width:330px}.pad{aspect-ratio:1.15;font-size:16px!important}.pad-0{background:#24523c!important}.pad-1{background:#65521d!important}.pad-2{background:#224969!important}.pad-3{background:#66394e!important}.pad.lit{outline:5px solid #fff;outline-offset:-7px;background:#f1f9fa!important;color:#10212c!important;box-shadow:0 0 0 3px #a5eebe}
body[data-game="whack-a-mole"] #board{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-width:330px}.hole{aspect-ratio:1.2;font-size:48px!important;background:#12212b!important}.hole.active{background:#a5eebe!important;color:#143323!important;border-color:#fff!important}
.game-actions{display:flex;gap:10px;flex-wrap:wrap}.game-actions button{padding:10px 18px;background:#a5eebe;color:#112b20;border-color:#a5eebe}.game-actions button.secondary{background:#223c4e;color:#edf4f7;border-color:#7493a7}.game-actions button:disabled{opacity:.6;cursor:default}.local-note{font-size:12px;color:#b8cbd6;margin:12px 0 0}.keyboard-note{font-size:13px;color:#c6d6df;margin:10px 0 0}
@media(max-width:480px){.game-main{padding:12px 12px 20px}.game-panel{padding:10px}.arcade-header{padding:6px 12px;font-size:14px}.game-main h1{font-size:26px}.instructions{font-size:14px}.disc{font-size:18px}.game-panel #status{min-height:3em;font-size:14px}.drop-controls,.discs{gap:2px}}
@media(max-width:360px){.game-main{padding:10px 6px}.game-panel{padding:6px 0;border-left:0;border-right:0}.game-panel>p,.game-meta,.game-actions,.keyboard-note{margin-left:6px;margin-right:6px}.drop-controls,.discs{gap:0}.game-main h1{font-size:24px}}
@media(prefers-reduced-motion:reduce){body[data-game] *,body[data-game] *::before,body[data-game] *::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

@media(max-width:480px) and (max-height:700px){.game-main{padding-top:8px}.game-main h1{font-size:24px;margin-bottom:6px}.instructions{font-size:13px;line-height:1.35;margin-bottom:8px}.game-panel{padding-top:8px;padding-bottom:8px}.game-panel #status{margin:6px 0 8px;min-height:2.5em}.game-meta{font-size:13px;gap:6px 12px}body[data-game="tic-tac-toe"] #board{max-width:280px}body[data-game="connect-four"] #board{max-width:320px}.game-actions button{padding-top:8px;padding-bottom:8px}}

/* Finite, state-entry motion only. No idle loops or simulation dependencies. */
body[data-game] .game-meta strong{display:inline-block;transform-origin:center}
body[data-game] #board button:not(:disabled):active{filter:brightness(1.2)}
body[data-game] .cell{position:relative;overflow:hidden}
body[data-game] .mark{display:inline-block;animation:jp-mark 340ms cubic-bezier(.16,1,.3,1)}
body[data-game] .cell.winning{border-color:#fff!important;box-shadow:inset 0 0 0 3px #143c2b,0 0 18px #a5eebe65;animation:jp-winner 650ms ease-out}
body[data-game] .disc{position:relative;isolation:isolate}
body[data-game] .disc.player,body[data-game] .disc.cpu{background:#0e1e2a;border-color:#668296}
body[data-game] .disc-token{position:absolute;inset:-1px;display:grid;place-items:center;border-radius:50%;background:#a5eebe;border:3px solid #d9ffe6;box-shadow:inset 0 -5px 0 #0002,0 3px 5px #0005;animation:jp-drop 460ms cubic-bezier(.35,.05,.65,1);z-index:1}
body[data-game] .disc.cpu .disc-token{background:#ffe29a;border-color:#fff0c4}
body[data-game] .disc.winning{box-shadow:0 0 0 3px #fff,0 0 18px #a5eebe;z-index:2;animation:jp-winner 650ms ease-out}
body[data-game] .pad.lit{animation:jp-glow 450ms ease-out}
body[data-game] .pad{box-shadow:inset 0 -6px 0 #0003}
body[data-game] .hole{position:relative;overflow:hidden;isolation:isolate;background:radial-gradient(ellipse at 50% 90%,#080e14 0 42%,#233a39 44% 58%,#12212b 60%)!important}
body[data-game] .hole.active{background:radial-gradient(ellipse at 50% 90%,#080e14 0 42%,#365648 44% 58%,#172c30 60%)!important;border-color:#a5eebe!important}
body[data-game] .mole-character{position:absolute;display:block;width:62%;height:76%;left:19%;bottom:-7%;border-radius:48% 48% 35% 35%;background:radial-gradient(ellipse at 50% 73%,#f3d5a5 0 28%,transparent 29%),linear-gradient(105deg,#8d583c,#ba8053 50%,#8d583c);border:2px solid #e5af73;box-sizing:border-box;transform:translateY(115%);opacity:0;pointer-events:none}
body[data-game] .mole-character::before{content:"";position:absolute;width:10%;height:12%;border-radius:50%;background:#17212a;top:28%;left:25%;box-shadow:27px 0 #17212a}
body[data-game] .mole-character::after{content:"";position:absolute;width:22%;height:16%;border-radius:45% 45% 60% 60%;background:#543a3b;left:39%;top:48%;box-shadow:0 3px 0 #f5c5a0}
body[data-game] .hole.active .mole-character{transform:translateY(0);opacity:1;animation:jp-mole 330ms cubic-bezier(.2,.8,.2,1)}
body[data-game] .hit-burst{position:absolute;inset:25% 0 auto;text-align:center;font-size:26px;font-weight:900;color:#d6ffe3;text-shadow:0 2px 3px #10251c;opacity:0;z-index:3;pointer-events:none}
body[data-game] #status[data-terminal="true"]{color:#d7ffe5;text-shadow:0 0 20px #a5eebe45}
body[data-game] #board[data-paused="true"] *{animation-play-state:paused!important}
@keyframes jp-mark{0%{transform:scale(.35) rotate(-14deg);opacity:0}65%{transform:scale(1.14) rotate(3deg);opacity:1}100%{transform:scale(1) rotate(0)}}
@keyframes jp-drop{0%{transform:translateY(calc(var(--drop-rows) * -106%));opacity:.55}72%{transform:translateY(0);opacity:1}84%{transform:translateY(-16%)}94%{transform:translateY(0)}98%{transform:translateY(-3%)}100%{transform:translateY(0)}}
@keyframes jp-winner{0%,100%{filter:brightness(1)}40%{filter:brightness(1.3)}}
@keyframes jp-glow{0%{transform:scale(.97);filter:brightness(1.4)}55%{transform:scale(1.025)}100%{transform:scale(1);filter:brightness(1)}}
@keyframes jp-mole{0%{transform:translateY(115%) scale(.8);opacity:0}65%{transform:translateY(-8%) scale(1.02);opacity:1}100%{transform:translateY(0) scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){body[data-game] *,body[data-game] *::before,body[data-game] *::after{animation:none!important;transition:none!important}}
