:root{--surface:#fff;--surface-soft:#f1f4ed;--accent:#5d7e35;--shadow:0 8px 30px #17200e0a}
html[data-theme=dark]{--paper:#0d1113;--ink:#e8f0ed;--muted:#9badb0;--line:#2b383e;--surface:#171e23;--surface-soft:#222d30;--accent:#b9f66a;--green:#b9f66a;--shadow:0 8px 32px #0003;color-scheme:dark}
body{transition:background-color .2s,color .2s;overflow-x:clip}button,a,select,input{touch-action:manipulation}.brand-mark{background:#1c2b20;color:#c6f67b}.brand-accent{color:var(--accent)}
.header-controls{display:flex;gap:8px;align-items:center}.preference-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 13px;min-height:44px;min-width:44px;border-radius:24px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-size:.875rem;font-weight:500}.preference-button>span:first-child{font-size:1.2rem;line-height:1}.preference-button[aria-pressed=true]{background:var(--surface-soft);border-color:#809868}.preference-button:disabled{opacity:.6}
.game-card,.play-surface,.settings-panel,.instructions-panel,.stat,.header-pill,select,.secondary-button{background:var(--surface);border-color:var(--line);color:var(--ink)}.game-card:hover{box-shadow:var(--shadow)}.game-card .tag,.small-play{background:var(--surface-soft);color:var(--muted)}.card-content p,.intro p,.header-note,.section-note,.level-description,.game-instructions,.options-label,.break-note,footer{color:var(--muted)}h1 span{color:var(--muted)}.secondary-button:hover{background:var(--surface-soft)}.primary-button{background:var(--green);color:#172517;border-color:var(--green)}select{font-size:.9375rem;min-height:44px;padding:10px 12px;max-width:100%}
.play-surface{position:relative}.new-badge{position:absolute;top:14px;right:14px;font:600 .75rem var(--display);letter-spacing:.7px;padding:5px 8px;background:#ffffff10;border:1px solid #ffffff22;border-radius:6px;color:#d7eee8}.vfx-preview,.sequence-preview{background:#09121c}.vfx-preview canvas{width:100%;height:100%;object-fit:cover;display:block}.vfx-card .tag{color:var(--accent)}.sequence-mini{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;transform:rotate(-6deg)}.sequence-mini span{width:62px;height:62px;border-radius:12px;display:grid;place-items:center;font:600 1.1rem var(--display);border:1px solid currentColor;background:color-mix(in srgb,currentColor 12%,#09121c)}.sequence-mini .cyan{color:#64e8df}.sequence-mini .pink{color:#fa8cc8}.sequence-mini .gold{color:#ffc86e}.sequence-mini .violet{color:#b29aff}.sequence-mini .lit{box-shadow:0 0 22px #fa8cc85c;background:#6a385c}
.arcade-stage{position:relative;margin:0 auto;width:100%;max-width:580px;border:1px solid #2b3d54;border-radius:15px;overflow:hidden;background:#09121c;isolation:isolate}.arcade-stage.portrait{max-width:390px}.arcade-canvas{display:block;width:100%;height:auto;touch-action:none}.arcade-overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;text-align:center;padding:24px;color:#eef7ff;background:#08111dd9;backdrop-filter:blur(3px)}.arcade-overlay b{font:600 clamp(1.4rem,4vw,2rem) var(--display);line-height:1.2}.arcade-overlay p{font-size:.9375rem;line-height:1.6;color:#abc2d6;margin:0;max-width:330px}.arcade-controls{max-width:580px;display:flex;align-items:center;justify-content:center;gap:14px;margin:18px auto 0}.arcade-controls.portrait{max-width:390px}.arcade-slider-label{flex:1;display:flex;flex-direction:column;gap:8px;font-size:.8125rem;color:var(--muted);min-width:0}.arcade-slider{width:100%;min-height:36px;accent-color:#7cd9c9;cursor:pointer}.arcade-controls .secondary-button{min-height:44px;white-space:nowrap}.arcade-stage .arcade-overlay .secondary-button{background:#202e40;color:#eef7ff;border-color:#3e536d}.mobile-level-row{display:none}
.sequence-stage{max-width:460px;margin:auto}.sequence-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:22px;background:#09121c;border-radius:14px}.sequence-pad{position:relative;aspect-ratio:1;border:2px solid var(--pad-color);border-radius:22px;background:color-mix(in srgb,var(--pad-color) 12%,#09121c);color:var(--pad-color);display:flex;align-items:center;justify-content:center;font:600 2.5rem var(--display);transition:background .12s,box-shadow .12s,transform .12s;touch-action:manipulation}.sequence-pad span{position:absolute;bottom:14px;font:500 .8125rem var(--font);letter-spacing:.5px}.sequence-pad.active{background:color-mix(in srgb,var(--pad-color) 75%,#09121c);color:#0a1624;box-shadow:0 0 26px color-mix(in srgb,var(--pad-color) 55%,transparent);transform:scale(.97)}.sequence-pad:disabled{cursor:default}.sequence-pad:not(:disabled):hover{background:color-mix(in srgb,var(--pad-color) 25%,#09121c)}.sequence-pad.active:not(:disabled):hover{background:var(--pad-color)}.sequence-pad.wrong{border-color:#ff766f;box-shadow:0 0 25px #ff766f55}.sequence-actions{display:flex;justify-content:center;margin-top:16px}
.mines-scroll{overflow-x:auto;max-width:100%;padding:4px 0 8px;overscroll-behavior-x:contain}.direction-pad button,.puzzle-controls button{background:var(--surface);border-color:var(--line);color:var(--ink)}.direction-pad{grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,44px)}.puzzle-controls button{width:48px;height:44px}.flag-toggle{min-height:44px}.game-screen-heading>.secondary-button{min-height:44px}.ttt-cell{touch-action:manipulation}
@keyframes winning-glow{0%,100%{box-shadow:0 0 0 transparent}50%{box-shadow:0 0 20px #99d66055}}@keyframes match-pop{0%{transform:scale(.92)}65%{transform:scale(1.04)}100%{transform:scale(1)}}@keyframes celebration-glow{0%{box-shadow:0 0 0 #b9f66a00}50%{box-shadow:0 0 30px #b9f66a25}100%{box-shadow:0 0 0 #b9f66a00}}
html[data-effects=on] .ttt-cell.winning,html[data-effects=on] .connect-cell.winning{animation:winning-glow 1.2s ease-in-out 2}html[data-effects=on] .memory-cell.matched{animation:match-pop .35s ease-out}html[data-effects=on] .level-completion:not([hidden]){animation:celebration-glow 1s ease-in-out 2;border-radius:12px}
html[data-theme=dark] .intro-stamp{background:#253328;border-color:#657958;color:#c9e6b1}html[data-theme=dark] .snake-preview{background-color:#223b28;color:#c7e8a6}html[data-theme=dark] .snake-piece{background:#84b965}html[data-theme=dark] .snake-head{background:#a2d884}html[data-theme=dark] .snake-head i{background:#253822}html[data-theme=dark] .ttt-preview{background:#2b2440;color:#d2b8fb}html[data-theme=dark] .ttt-mini span{border-color:#a98cce44}html[data-theme=dark] .mini-x{color:#c49ef9}html[data-theme=dark] .mini-o{color:#9c86c5}html[data-theme=dark] .ttt-mini .faded{color:#75648c}html[data-theme=dark] .numbers-preview{background:#342c22}html[data-theme=dark] .memory-preview{background:#3b272f}html[data-theme=dark] .connect-preview{background:#1d3342}html[data-theme=dark] .mines-preview{background:#29322b}html[data-theme=dark] .preview-number{opacity:.8}html[data-theme=dark] .preview-label{opacity:.95}
html[data-theme=dark] .ttt-cell{background:#2b2440;border-color:#4b3d60}html[data-theme=dark] .ttt-cell.x{color:#c8a5ff}html[data-theme=dark] .ttt-cell.o{color:#ffc68c}html[data-theme=dark] .ttt-cell:not(:disabled):hover{background:#39304f}html[data-theme=dark] .ttt-cell.oldest::after{color:#c4b1df}html[data-theme=dark] .ttt-cell.winning{background:#354b2a;border-color:#779c59}
html[data-theme=dark] .puzzle-board{background:#3d382f}html[data-theme=dark] .number-tile{background:#2b2925;color:#e4ecdf}html[data-theme=dark] .number-tile[data-value='2']{background:#3d4940}html[data-theme=dark] .number-tile[data-value='4']{background:#53634d}html[data-theme=dark] .number-tile[data-value='8']{background:#d8ac70;color:#211c13}html[data-theme=dark] .number-tile[data-value='16']{background:#d89561;color:#251a13}html[data-theme=dark] .number-tile[data-value='32']{background:#d67a60;color:#261613}html[data-theme=dark] .number-tile[data-value='64']{background:#b6523c;color:#fff}html[data-theme=dark] .number-tile[data-value='128']{background:#b39a3b;color:#161a10}html[data-theme=dark] .number-tile[data-value='256']{background:#c0a237;color:#161a10}html[data-theme=dark] .number-tile[data-value='512']{background:#b9911c;color:#14170b}html[data-theme=dark] .number-tile[data-value='1024'],html[data-theme=dark] .number-tile[data-value='2048']{background:#ceab34;color:#171c0c}html[data-theme=dark] .number-tile.large{background:#778d57;color:#111a0f}
html[data-theme=dark] .memory-cell{background:#68424b;border-color:#b76d7b;color:#f9d8de}html[data-theme=dark] .memory-cell.flipped{background:#392f3b;color:#f0b5c9}html[data-theme=dark] .memory-cell.matched{background:#30452d;border-color:#799b61;color:#bcde9f}html[data-theme=dark] .connect-board{background:#355e7a}html[data-theme=dark] .connect-cell{background:#172b3a}html[data-theme=dark] .connect-cell.red{background:#e89980}html[data-theme=dark] .connect-cell.yellow{background:#f4d16d}html[data-theme=dark] .mine-cell{background:#394a33;border-color:#617455;color:#d3edc4}html[data-theme=dark] .mine-cell.revealed{background:#242e26;border-color:#35433a}html[data-theme=dark] .mine-cell.n1{color:#97bdf9}html[data-theme=dark] .mine-cell.n2{color:#8edfa1}html[data-theme=dark] .mine-cell.n3{color:#ffa589}html[data-theme=dark] .mine-cell.n4{color:#d5a8f5}html[data-theme=dark] .mine-cell.bomb{background:#864c4a;color:#ffd7c4}html[data-theme=dark] .mine-cell.flagged{color:#c5eca7}html[data-theme=dark] .flag-toggle.active{background:#34482d;border-color:#718d51;color:#d6edc7}
@media(max-width:1000px){.header-note{display:none}.game-layout{grid-template-columns:minmax(0,1fr) 265px}.arcade-overlay{padding:20px}.sequence-pad{border-radius:17px}.sequence-board{gap:12px;padding:16px}}
@media(max-width:760px){.site-header{gap:12px}.game-layout{grid-template-columns:1fr}.mobile-level-row{display:flex;align-items:center;gap:12px;margin:0 0 16px;font-size:.875rem}.mobile-level-row select{flex:1;min-width:0}.settings-panel .level-label,.settings-panel>#level-select{display:none}.panel-heading{margin-bottom:12px}.play-surface{padding:18px}.arcade-stage{max-width:520px}.arcade-stage.portrait{max-width:340px}.game-screen-heading .eyebrow{font-size:.75rem;letter-spacing:.5px}}
@media(max-width:600px){.control-label{display:none}.preference-button{padding:10px;border-radius:50%}.header-controls{gap:7px}.brand{font-size:1.55rem;letter-spacing:-1px}.brand-mark{width:32px;height:32px}.game-screen-heading h1{font-size:1.8rem}.game-screen-heading{margin:20px 0}.sequence-pad{font-size:2.2rem}.sequence-pad span{bottom:10px}.game-screen .memory-board{grid-template-columns:repeat(4,minmax(0,1fr))!important}.game-screen .mines-board{width:max(100%,calc(var(--mine-columns,9)*32px));max-width:none}.game-screen .mine-cell{font-size:.875rem}.settings-panel,.instructions-panel{padding:18px}.game-screen .play-surface{padding:16px 12px}.arcade-overlay b{font-size:1.45rem}.arcade-overlay p{font-size:.875rem}.sequence-mini span{width:50px;height:50px}.arcade-controls{gap:10px}.game-screen .arcade-stage.portrait{max-width:320px}}
@media(max-width:380px){main{margin-left:12px;margin-right:12px}.site-header{padding-left:12px;padding-right:12px}.brand{gap:8px;font-size:1.4rem}.game-screen-heading h1{font-size:1.45rem}.game-screen-heading .eyebrow{font-size:.75rem;letter-spacing:0}.section-note{font-size:.75rem}.card-title-line h3,.featured .card-title-line h3{font-size:.9375rem}.new-badge{top:10px;right:10px;padding:3px 5px}.sequence-mini span{width:45px;height:45px}.arcade-stage.portrait{max-width:280px}.sequence-board{gap:10px;padding:12px}.arcade-controls .secondary-button{padding:9px 11px}}
html[data-effects=off] *,html[data-effects=off] *::before,html[data-effects=off] *::after{animation:none!important;transition:none!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

#level-badge{background:var(--surface-soft);color:var(--muted)}
