/* Shared night-arcade layout for both games; touch targets remain live HTML. */
:root{color-scheme:dark;--paper:#06152e;--ink:#fff1c7;--muted:#a5c9ec;--line:#35649a;--teal:#bcf95c;--teal-light:#bcf95c;--orange:#ffa342;--surface:#081b38;--arena-size:min(52svh,520px);--serif:"PingFang SC","Microsoft YaHei",sans-serif;--sans:"PingFang SC","Microsoft YaHei",sans-serif}
body{background:#06152e url('./assets/night-world.png') center top / cover fixed;color:var(--ink);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom)}
.shell{width:min(1200px,calc(100% - 48px))}.header{height:76px;gap:32px;border-color:#35649a;background:#06152ec9}.wordmark{flex-shrink:0;font-weight:800;color:#fff1c7}.brand-mark i{background:#ff9585;box-shadow:2px 2px #733f65}.header .game-nav{margin-left:auto;min-height:0;gap:28px;flex-wrap:nowrap}.game-nav a{font-size:15px;font-weight:700;white-space:nowrap;color:var(--muted)}.game-nav a[aria-current]{color:var(--ink)}.game-nav a[aria-current]:after{height:3px;background:var(--teal)}
.game-main{padding-top:20px}.game-surface{border:0;padding:0;background:none;box-shadow:none}.game-surface:before{display:none}.game-top{display:grid;grid-template-columns:minmax(200px,1fr) minmax(430px,1.8fr) 64px;gap:16px;align-items:center;margin-bottom:18px}.game-title h1{font:900 40px/1.15 var(--sans);letter-spacing:.055em;text-shadow:3px 3px #254b83;margin:0 0 6px}.game-title p{margin:0;color:var(--muted);font-size:16px;letter-spacing:.18em;font-weight:600}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:0;gap:12px}.stats>div,.pause-button{border:2px solid #548bc4!important;background:#06152eed;box-shadow:3px 3px #020d20;padding:9px 14px!important;min-height:70px}.stats span{font-size:12px;letter-spacing:.04em;margin-bottom:4px}.stats strong{font:800 27px/1.15 ui-monospace,Menlo,monospace;color:var(--ink);white-space:nowrap}.stats small{color:var(--muted);font-size:12px}.text-button{color:var(--muted);font-weight:600;min-height:44px}.text-button:hover:not(:disabled){color:var(--ink)}.pause-button{font-size:14px;color:var(--ink);padding:4px!important}.stage-heading{position:relative;border:2px solid #548bc4;background:#06152ef0;padding:9px 12px;min-height:66px;margin-bottom:14px;box-shadow:3px 3px #020d20}.stage-heading h2{font-weight:750;font-size:20px;line-height:1.45;margin:0}.stage-heading p{font-size:12px;color:var(--muted);margin:2px 0 0}.time-track{position:absolute;left:0;right:0;bottom:0;height:2px;background:#19375b}.time-track>div{background:var(--teal)}
.arena{display:flex;justify-content:center;align-items:center;position:relative;min-height:calc(var(--arena-size) + 24px);padding:10px;background:#0a2346eb;border:5px ridge #5281b4;box-shadow:0 0 0 3px #04132b,6px 6px #020b1e;margin:0 0 18px;overflow:hidden}.board-wrap{width:min(100%,var(--arena-size));max-width:none;margin:0}.memory-board{padding:7px;gap:6px;border:2px solid #82afd5;background:#06152e;box-shadow:0 0 0 3px #030e23}.tile{min-height:0;background:#234b7d;border:1px solid #4a7cad;box-shadow:inset 2px 2px #6595bc66,inset -3px -3px #07183388;color:#06152e;font-size:26px}.tile:not(:disabled):hover{background:#366395}.tile.is-lit,.tile.is-hit{background:#b6ee59;border-color:#e2ff9e;box-shadow:inset 2px 2px #f5ffae,inset -3px -3px #72a936,0 0 12px #b6ee5944}.tile.is-wrong{background:#f68d74}.tile.is-missed{background:#456b8b;outline-color:#c7def8}.color-wrap{width:min(100%,calc(var(--arena-size)*1.65));margin:0;max-width:none}.leaf-stage{border:0;background:transparent;min-height:0;padding:0}.direction-page .arena{padding:0}#leaf-field{width:100%;height:var(--arena-size);background:radial-gradient(ellipse at 50% 20%,#174f80,#0a2b55 75%);image-rendering:pixelated}#leaf-field image{image-rendering:pixelated}.leaf-stage .answer-feedback{bottom:6px;left:10px;right:10px;background:#06152edb;color:var(--muted);font-size:12px;padding:4px;border:1px solid #35649a;min-height:28px}.answer-feedback.is-correct{color:var(--teal)}.answer-feedback.is-incorrect,.urgent{color:#ffb09a!important}.pause-overlay{background:#071a36f5;border:2px solid #548bc4;color:var(--ink);z-index:2}.pause-overlay h2{font-weight:800}.pause-overlay .primary-button{margin-top:8px}.result{min-height:var(--arena-size);padding:20px}.result h2{font-weight:800}.result-score{color:var(--teal)}
.control-dock{display:flex;gap:20px;justify-content:space-between;align-items:center;padding:14px 20px;min-height:108px;border:2px solid #548bc4;background:#06152ef5;box-shadow:4px 4px #020d20}.stage-actions{min-height:0;padding:0;flex-shrink:0}.primary-button{border:2px solid #d6ff95;box-shadow:3px 3px #386c36;background:#bcf95c;color:#0c2342;padding:10px 20px;min-height:48px;font-weight:800;gap:12px;white-space:nowrap}.primary-button:disabled{opacity:1;background:#18385c;color:#bbd1e8;border-color:#48729d;box-shadow:3px 3px #020d20}.primary-button:hover:not(:disabled){background:#d6ff95}.memory-phases{display:flex;gap:12px;align-items:center;color:#8cb0d6;font-weight:700;font-size:16px}.memory-phases span{border:1px solid #35649a;padding:10px 18px;background:#0a2041}.memory-phases i{font-style:normal}body[data-phase="memorize"] [data-phase="memorize"],body[data-phase="recall"] [data-phase="recall"],body[data-phase="feedback"] [data-phase="feedback"]{border-color:var(--teal);color:var(--teal)}.rule-cue{display:flex;gap:10px;max-width:none;margin:0;flex-shrink:0}.rule-cue span{background:#0b2345;border:2px solid #35649a;color:#aac8e7;padding:10px}.rule-cue b{font-size:14px;white-space:nowrap}.rule-cue #rule-pointing[aria-current="true"]{background:#193623;color:#c9ff94;border-color:#bcf95c}.rule-cue #rule-moving[aria-current="true"]{background:#432b1c;color:#ffcc83;border-color:#ffa342}.color-controls{display:flex;align-items:center;justify-content:space-between;gap:24px;flex:1}.combo-meter{margin:0;color:var(--muted);font-size:12px;gap:5px;flex-wrap:nowrap}.combo-meter i{width:14px;height:14px;border:1px solid #4f82b7;background:#0a2345}.combo-meter i.filled{background:var(--teal)}.direction-buttons{grid-template-columns:repeat(3,48px);grid-template-rows:44px 44px;gap:4px;margin:0}.direction-buttons .answer-button{min-height:44px;background:#0b2345;color:var(--ink);border:2px solid #6396ca;box-shadow:2px 2px #020d20;font:700 26px/1 var(--sans)}.answer-button:hover:not(:disabled){background:#244977}.answer-button:active:not(:disabled){background:#426e9a;transform:translateY(1px)}.answer-button:disabled{opacity:.35}.game-bottom{display:flex;gap:16px;align-items:center;justify-content:space-between}.bottom-hint{margin:10px 0;color:var(--muted);font-size:12px;text-align:left}.game-help{font-size:13px;color:var(--muted);background:#06152ede;padding:0 12px;border:1px solid #25466b}.game-help summary{padding:12px 0;cursor:pointer;min-height:44px}.game-help p{max-width:700px;line-height:1.8}.footer{margin:0;padding:16px 0;color:var(--muted)}button:focus-visible,a:focus-visible{outline-color:#d4ff91}.cover-art{border-color:#35649a;box-shadow:5px 5px #020d20}.game-card{background:#071b39eb;border-color:#4679af;box-shadow:4px 4px #020d20}.game-card:hover{background:#142e50}.game-card p{color:var(--muted)}.section-heading span,.game-card .eyebrow,.card-arrow{color:var(--teal)}
@media(max-width:1000px){.shell{width:calc(100% - 32px)}.game-top{grid-template-columns:1fr minmax(340px,1.6fr) 54px;gap:10px}.game-title h1{font-size:32px}.stats{gap:8px}.stats>div{padding:8px!important}.stats strong{font-size:25px}.control-dock{gap:12px;padding:12px}.color-controls{gap:12px}.rule-cue{gap:6px}.rule-cue span{padding:8px}.rule-cue b{font-size:12px}.direction-page .control-dock:has(#primary:not([hidden])){flex-wrap:wrap}.direction-page .stage-actions{margin-left:auto}.memory-phases{gap:7px}.memory-phases span{padding:9px 12px}}
@media(max-width:680px){:root{--arena-size:min(43svh,calc(100vw - 52px))}body{background-attachment:scroll;background-size:auto 100svh}.shell{width:calc(100% - 24px)}.header{height:auto;min-height:86px;display:block;padding-top:max(8px,env(safe-area-inset-top))}.wordmark{font-size:16px;gap:10px;line-height:26px}.header .game-nav{display:flex;gap:24px;margin:0;min-height:44px}.game-nav a{padding:10px 0;font-size:13px}.game-nav a[aria-current]:after{bottom:2px}.game-main{padding-top:12px}.game-top{grid-template-columns:1fr 48px;gap:9px;margin-bottom:10px}.game-title{grid-column:1;display:flex;align-items:baseline;gap:12px}.game-title h1{font-size:26px;margin:0;text-shadow:2px 2px #254b83}.game-title p{font-size:12px;letter-spacing:.08em}.pause-button{grid-column:2;grid-row:1;min-height:44px!important}.stats{grid-column:1/-1;grid-row:2;gap:7px}.stats>div{min-height:62px;padding:7px 10px!important}.stats span{font-size:11px}.stats strong{font-size:23px}.stage-heading{min-height:60px;padding:7px;margin-bottom:10px}.stage-heading h2{font-size:16px}.stage-heading p{font-size:11px}.arena{min-height:calc(var(--arena-size) + 16px);border-width:4px;padding:6px;margin-bottom:12px;box-shadow:0 0 0 2px #04132b,3px 3px #020b1e}.memory-board{gap:4px;padding:5px}.tile{min-height:0}.color-wrap{width:100%}#leaf-field{height:var(--arena-size)}.control-dock{min-height:0;padding:10px;gap:10px;flex-wrap:wrap}.memory-phases{flex:1;gap:6px;font-size:12px}.memory-phases span{padding:6px;border:0;background:none}.memory-page .stage-actions{width:100%}.memory-page .primary-button{width:100%}.direction-page .rule-cue{width:100%;gap:8px}.rule-cue span{flex:1;padding:7px 4px}.rule-cue b{font-size:12px}.color-controls{width:100%;gap:8px}.direction-buttons{grid-template-columns:repeat(3,48px);grid-template-rows:44px 44px}.combo-meter{gap:4px;font-size:11px}.combo-meter i{width:12px;height:12px}.direction-page .stage-actions{width:100%;margin:0}.direction-page .stage-actions:has([hidden]){display:none}.direction-page .primary-button{width:100%}.game-bottom{gap:8px}.bottom-hint{font-size:10px}.game-bottom .text-button{font-size:11px;white-space:nowrap;padding:4px}.game-help{font-size:12px}.footer{font-size:10px;padding:12px 0}.cover-page .header{min-height:64px;display:flex}.cover-page .edition{display:none}.cover-main{padding-top:14px}.cover-start{min-height:0}.section-heading h2{font-size:20px}.game-card{padding:18px}.game-card h3{font-size:20px}}
@media(max-width:680px) and (max-height:740px){:root{--arena-size:min(36svh,calc(100vw - 52px))}.game-main{padding-top:8px}.header{min-height:80px}.game-top{gap:6px}.stats>div{min-height:56px}.stage-heading p{display:none}.stage-heading{min-height:44px}.control-dock{padding:8px}}
@media(orientation:landscape) and (max-height:540px){:root{--arena-size:300px}.game-top{grid-template-columns:1fr minmax(320px,1.4fr) 54px}.game-title h1{font-size:28px}.header{height:60px}.game-main{padding-top:12px}.arena{min-height:324px}.game-help{margin-top:8px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
@font-face{font-family:Arcade;src:url('./assets/fusion-pixel.woff2') format('woff2');font-display:swap;font-weight:100 900}
.game-title h1,.wordmark,.stage-heading h2,.primary-button,.memory-phases,.game-nav,.stats strong,.rule-cue b,.result h2{font-family:Arcade,"PingFang SC",sans-serif;font-weight:400}.game-title h1{font-size:48px}.stats strong{font-size:30px}.stage-heading h2{font-size:24px}.wordmark{font-size:24px}.game-nav a{font-size:18px}.arena{border:16px solid #365e89;border-image:url('./assets/stone-frame.png') 16% / 16px / 0 round;background:#0b2243;padding:8px;min-height:calc(var(--arena-size) + 48px)}.direction-page .arena{padding:0}.memory-board{background:#081b38}.tile{background-image:linear-gradient(135deg,#ffffff08 25%,transparent 25%,transparent 75%,#0000000d 75%);background-size:12px 12px}.control-dock,.stage-heading,.stats>div{outline:1px solid #08172f;outline-offset:2px}
@media(max-width:1000px){.game-title h1{font-size:36px}}
@media(max-width:680px){.game-title h1{font-size:30px}.wordmark{font-size:20px}.game-nav a{font-size:15px}.stats strong{font-size:24px}.stage-heading h2{font-size:18px}.arena{border-width:8px;border-image-width:8px;padding:4px;min-height:calc(var(--arena-size) + 24px)}.memory-phases{font-family:var(--sans)}.rule-cue b{font-size:14px}}
@media(max-width:680px){.memory-page{--arena-size:min(calc(100vw - 52px),380px)}.direction-page{--arena-size:clamp(220px,30svh,290px)}.direction-page .stage-heading p{display:none}.direction-page .stage-heading{min-height:44px}.pause-overlay .primary-button{width:auto;min-width:160px}.memory-page .tile{min-width:0}}
.stage-heading h2{line-height:1.2}.stage-heading p{line-height:1.3}
@media(min-width:681px) and (orientation:landscape){:root{--arena-size:clamp(300px,calc(100svh - 420px),520px)}.header{height:60px}.game-main{padding-top:12px}.game-top{margin-bottom:12px}.game-title h1{font-size:36px}.game-title p{font-size:14px}.stage-heading{min-height:60px;margin-bottom:12px;padding:6px 12px}.arena{min-height:calc(var(--arena-size) + 32px);padding:0;margin-bottom:12px}.control-dock{padding:10px 16px}}
@media(max-width:680px) and (max-height:740px){.direction-page{--arena-size:200px}.header{min-height:74px}.header .game-nav{min-height:40px}.game-nav a{padding:8px 0}}
#leaf-field{background:#0a2850 url('./assets/night-water.png') center / cover}.arena{border-image-slice:13%}.direction-page .arena{background:#0a2850}
.direction-page .color-wrap{width:100%}
@media(max-width:680px) and (max-height:740px){.direction-page{--arena-size:190px}}
@media(max-width:680px) and (max-height:740px){.memory-page .memory-phases{display:none}.memory-page{--arena-size:calc(100vw - 64px)}.memory-page .game-main{padding-top:4px}.memory-page .game-top{margin-bottom:6px}.memory-page .arena{margin-bottom:8px}.memory-page .control-dock{padding:8px}}
@media(max-width:680px) and (max-height:740px){.memory-page .header{min-height:68px}.memory-page .game-main{padding-top:0}}
