:root{color-scheme:dark;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans",sans-serif;background:#080c15;color:#f5f5fb;-webkit-text-size-adjust:100%}*{box-sizing:border-box}body{margin:0}button{font:inherit;color:inherit;border:1px solid #77879b;background:#1c293d;border-radius:8px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.45}button:focus-visible{outline:3px solid #ffe4a7;outline-offset:2px}[hidden]{display:none!important}.shell{max-width:450px;margin:auto;height:calc(100dvh - var(--nav-height,88px));min-height:460px;padding:3px 4px max(4px,env(safe-area-inset-bottom));display:flex}.stage{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;padding:10px;border:1px solid #b6a079;border-radius:16px;background:radial-gradient(ellipse at top,#20374a,#0b1524 75%);overflow:hidden}.hud{display:flex;align-items:center;justify-content:space-between;min-height:60px}.hud strong{font-size:36px;color:#ffdf9c;font-variant-numeric:tabular-nums}.hud button{min-height:44px;padding:0 12px}.stats{display:flex;justify-content:space-between;gap:6px;font-size:12px;min-height:32px;color:#c7d3e1;font-variant-numeric:tabular-nums}.board{flex:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(44px,1fr));gap:8px;min-height:220px}.buddy{display:flex;align-items:center;gap:10px;min-height:86px;padding-top:6px}.buddy img{object-fit:contain;align-self:flex-end}.buddy p{margin:0;font-size:13px;line-height:1.6}.buddy b{display:block;color:#ffdf9c;font-size:12px}.buddy span{display:block}.overlay{position:absolute;inset:0;background:#050912d9;backdrop-filter:blur(5px);display:grid;place-items:center;padding:16px;z-index:2}.panel{width:min(100%,320px);max-height:100%;overflow:auto;padding:20px 16px;display:flex;flex-direction:column;align-items:center;gap:12px;background:#152337;border:1px solid #b6a079;border-radius:12px;text-align:center}.panel img{object-fit:contain;max-height:24dvh}.panel h2{font-size:20px;margin:0;color:#ffe1a0}.panel p{font-size:13px;margin:0;line-height:1.6;white-space:pre-line}.primary{width:100%;min-height:48px;background:#f1d398;color:#1c2330;border:0;font-weight:800}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Design review 1: keep the solved number readable with a separate check. */
.number{position:relative}.number.done{color:#9ab5c1}.number.done::after{content:'✓';position:absolute;top:4px;right:6px;font-size:12px;color:#a5e4cc}.number:active:not(:disabled){border-color:#ffdf9c;background:#3a4d60}

/* Design review 2: board progress follows the existing slim gold meter. */
.meter{height:3px;flex-shrink:0;background:#293449;margin:0 0 9px}.meter span{height:100%;display:block;background:#f0cd82;transition:width .2s}.number.done{border-color:#548475}.hud strong{min-width:44px;text-align:center}

/* Design review 3: preserve touch area on compact portrait phones. */
.hud,.stats,.buddy{flex-shrink:0}.board{min-height:200px}@media(max-height:680px){.shell{min-height:420px}.stage{padding:6px}.hud{min-height:52px}.stats{min-height:28px;font-size:11px}.buddy{min-height:64px}.buddy img{width:64px;height:64px}.board{gap:6px}.panel{padding:12px;gap:9px}.panel>img{width:96px;height:96px}}

.panel small{font-size:12px;color:#c7d3e1}

.hud>span{font-size:14px}.hud strong{margin-left:8px}.instruction{font-size:12px;color:#c7d3e1;margin:0 0 10px;line-height:1.6}.board{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(54px,1fr));gap:10px;min-height:200px;max-height:390px}.light{position:relative;min-width:0;min-height:54px;background:#101c2a;border:2px solid #536275;display:grid;place-items:center;padding:0}.bulb{width:45%;aspect-ratio:1;border-radius:50%;background:#233347;border:2px solid #758396}.light.on{background:linear-gradient(135deg,#64522d,#2d2a24);border-color:#e9c77e}.light.on .bulb{background:#ffdf8c;border-color:#fff0bf;box-shadow:0 0 16px #ffc85b66}.light:disabled{opacity:1}.tools{display:flex;gap:8px;margin-top:12px}.tools button{flex:1;min-height:46px}.buddy{margin-top:auto;min-height:96px}.buddy b{color:#ffdf9c}.panel>button{min-height:46px;width:100%}.panel #result:empty{display:none}.panel{gap:10px} .light.hinted{outline:3px solid #fff;outline-offset:-7px}.hint-mark{position:absolute;right:8px;top:5px;font-size:12px;color:#fff;font-weight:800}.bulb::after{content:'−';display:block;color:#96a4b8;font-size:26px;line-height:1}.bulb{display:grid;place-items:center}.on .bulb::after{content:'●';font-size:17px;color:#695021}

@media(max-height:700px){.stage{padding:8px}.hud{min-height:48px}.stats{min-height:26px}.board{min-height:162px;gap:8px}.buddy{min-height:74px}.buddy img{width:70px;height:70px}.panel img{width:110px;height:110px}.panel{padding:12px;gap:8px}}

.hint-cost{font-size:11px;color:#c7d3e1;text-align:right;margin:6px 0 0}

.cast-name{font-size:12px;color:#d3dce5}
