﻿/* Night stepping stones. Fixed tracks and borders keep every state the same size. */
:root{color-scheme:dark;background:#0b1119;color:#f0f4f7;font-family:system-ui,sans-serif}
*{box-sizing:border-box}body{margin:0;min-height:100dvh;background:radial-gradient(ellipse at 50% 0%,#30445466,transparent 65%)}
main{width:min(calc(100% - 16px),480px);margin:8px auto;padding:12px;border:1px solid #536174;border-radius:22px;background:linear-gradient(145deg,#253140,#131e2a 70%);box-shadow:inset 0 2px 0 #d5e7fa20,0 14px 32px #0006}
header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}h1{margin:4px 0;font-size:clamp(1.15rem,5vw,1.8rem);letter-spacing:-.045em;text-wrap:balance}
button,select{min-height:44px;padding:6px 12px;border:1px solid #718399;border-radius:10px;background:linear-gradient(#303f51,#1c2939);color:#f4f7fa;font:inherit;font-weight:700;box-shadow:inset 0 1px 0 #ffffff18,0 3px 0 #0a121e}
button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:default}button:focus-visible,select:focus-visible{outline:3px solid #ffe1a4;outline-offset:2px}#reset{flex-shrink:0;font-size:.85rem}
#setup{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:.85rem}select{max-width:65%;min-width:0}
#status{display:flex;align-items:center;gap:10px;min-height:76px;margin:14px 0;padding:10px 12px;border:1px solid #65798d;border-radius:12px;background:linear-gradient(135deg,#1d2d3e,#14202e);box-shadow:inset 0 1px 0 #d5e7fa15,0 3px 8px #0003;color:#e4edf6;font-size:.9rem;line-height:1.5;text-wrap:pretty}
#status::before{content:'◎';flex:none;color:#ffe1a4;font-size:1.6rem}
main:has(.lit) #status{border-color:#e1c486;color:#fff0cf}main:has(#grid button:not(:disabled)) #status{border-left:4px solid #e1c486;font-weight:750}main:has(#grid button:not(:disabled)) #status::before{content:'↖'}main:has(.wrong) #status::before{content:'×';color:#ffd5d8}
#grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));aspect-ratio:1;width:100%;gap:5px;padding:9px;border:1px solid #71869a;border-radius:18px;background:linear-gradient(135deg,#233342,#101b28 65%);box-shadow:inset 0 3px 10px #000a,inset 0 -1px 0 #d6e7f530,0 5px 0 #080f19,0 10px 18px #0006;touch-action:manipulation}
#grid button{position:relative;isolation:isolate;aspect-ratio:1;min-width:0;min-height:0;padding:0;border:2px solid #879db0;border-bottom-color:#475e73;border-radius:11px;background:linear-gradient(145deg,#42586d,#293d50 75%);box-shadow:inset 0 2px 0 #ecf6ff35,inset 0 -3px 0 #172636,0 3px 0 #080f19;opacity:1;line-height:1;user-select:none;-webkit-tap-highlight-color:transparent}
#grid button:not(:disabled):hover{border-color:#d9c89f}#grid button:not(:disabled):active{animation:stone-tap 120ms ease-out}
#grid button.lit{border-color:#fff1c1;background:linear-gradient(145deg,#ffe5a0,#c79849);box-shadow:inset 0 2px 0 #fff9,inset 0 -3px 0 #89632c,0 3px 0 #080f19,0 0 14px #ffd98b88;animation:lantern-glow 1100ms ease-in-out infinite alternate}
#grid button.lit::before{content:'';position:absolute;inset:4px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='%23412f19' transform='rotate(-22 32 32)'%3E%3Cpath d='M25 28c-5 5-8 15-6 23 1 6 8 8 12 4 4-4 1-9 4-14 4-7 3-13-2-15-3-1-6 0-8 2Z'/%3E%3Cellipse cx='35' cy='16' rx='6' ry='8'/%3E%3Cellipse cx='23' cy='15' rx='4' ry='5'/%3E%3Cellipse cx='15' cy='20' rx='3.5' ry='4.5'/%3E%3Cellipse cx='11' cy='28' rx='3' ry='4'/%3E%3C/g%3E%3C/svg%3E");pointer-events:none}
.step-badge{position:absolute;z-index:1;right:4px;top:4px;display:grid;place-items:center;min-width:23px;height:23px;padding:0 3px;border:1px solid #ffe8af;border-radius:7px;background:#26303b;color:#fff2d0;font-size:.9rem;font-weight:900;font-variant-numeric:tabular-nums;box-shadow:0 2px 4px #0005}
#grid button.hit{border-color:#c5f7dd;background:linear-gradient(145deg,#4d917e,#245748);box-shadow:inset 0 3px 6px #102c27aa,inset 0 0 0 1px #a5efd15c,0 1px 0 #080f19;animation:stone-tap 120ms ease-out}
.hit .step-badge{inset:0;margin:auto;width:30px;height:30px;border-radius:50%;border-color:#c5f7dd;background:#153e34;color:#e3fff1;font-size:1.05rem}
#grid button.wrong{border-color:#ffd2d7;border-style:dashed;background:linear-gradient(145deg,#884c5c,#542d3c);box-shadow:inset 0 3px 6px #29121c99,0 1px 0 #080f19;animation:stone-tap 120ms ease-out}
.wrong .step-badge{inset:0;margin:auto;width:34px;height:34px;border:0;background:transparent;box-shadow:none;color:#fff1f2;font-size:2.2rem}
#action{width:100%;margin-top:16px;min-height:48px;border-color:#e6d19d;background:linear-gradient(#ffe8b6,#d9bc7d);color:#252719;box-shadow:inset 0 2px 0 #fff5,0 3px 0 #080f19}#action:disabled{opacity:.6}
#results{padding:12px 12px 12px 36px;border:1px solid #829bb4;border-radius:12px;background:linear-gradient(135deg,#2e4055,#192636);line-height:1.7;font-variant-numeric:tabular-nums}#results li:first-child{color:#ffe1a4;font-weight:850}
@keyframes stone-tap{50%{transform:scale(.96)}100%{transform:scale(1)}}
@keyframes lantern-glow{to{box-shadow:inset 0 2px 0 #fff9,inset 0 -3px 0 #89632c,0 3px 0 #080f19,0 0 19px #ffd98bb3}}
@media(min-width:420px){main{padding:18px}#grid{padding:12px;gap:7px}}
@media(prefers-reduced-motion:reduce){#grid button{animation:none!important;transition:none!important}}
