:root{--bg:#0e1424;--panel:#161d33;--wire:#3a4670;--glow:#ffd24a;--text:#e8ecff;--muted:#8f9bc4}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}html,body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}#app{max-width:520px;margin:0 auto;padding:max(16px,env(safe-area-inset-top)) 16px 24px;display:flex;flex-direction:column;gap:14px}header{display:flex;align-items:baseline;justify-content:space-between}h1{font-size:22px;margin:0;letter-spacing:.5px}h1 span{color:var(--glow)}#meta{color:var(--muted);font-size:14px}#board{background:var(--panel);border-radius:18px;padding:10px;touch-action:manipulation;-webkit-user-select:none;user-select:none}#board svg{width:100%;height:auto;display:block}.cell{cursor:pointer}.cell.fixed{cursor:default}.rot{transition:transform .18s ease-out}.wire{stroke:var(--wire);stroke-width:14;stroke-linecap:round;fill:none;transition:stroke .25s}.on .wire{stroke:var(--glow);filter:drop-shadow(0 0 6px rgba(255,210,74,.7))}.hub{fill:var(--wire);transition:fill .25s}.on .hub,.src{fill:var(--glow)}.lamp-ring{fill:none;stroke:var(--wire);stroke-width:8;transition:stroke .25s}.lamp-core{fill:transparent;transition:fill .25s}.on .lamp-ring{stroke:var(--glow)}.on .lamp-core{fill:var(--glow);filter:drop-shadow(0 0 10px rgba(255,210,74,.9))}.slot{fill:#ffffff09}.slot.tap{fill:#ffffff1a}#stats{display:flex;align-items:center;gap:22px}#stats div{display:flex;flex-direction:column}#stats b{font-size:26px}#stats small{color:var(--muted)}button{margin-left:auto;background:#25305a;color:var(--text);border:0;border-radius:12px;padding:12px 18px;font-size:16px;min-height:44px}button:active{background:#2f3d72}#hint{color:var(--muted);margin:0;font-size:14px}#result{background:var(--panel);border-radius:18px;padding:16px}#result h2{margin:0 0 8px}#result pre{background:#0b101f;padding:12px;border-radius:12px;white-space:pre-wrap;margin:0 0 12px;font-family:inherit}#result button{margin-left:0;width:100%;background:var(--glow);color:#1a1400;font-weight:700}#result .next{margin:12px 0 0;color:var(--muted);text-align:center}#result .next b{color:var(--text);font-variant-numeric:tabular-nums}header button.ghost{margin-left:12px;min-height:44px;padding:6px 14px;font-size:14px}button.ghost{background:transparent;border:1px solid #2f3d72;color:var(--muted)}#stats button.ghost{margin-left:auto}#stats button#reset{margin-left:0}button:disabled{opacity:.4}.hint-ring{fill:#ffd24a1f;stroke:var(--glow);stroke-width:3;opacity:0;pointer-events:none}.hint-ring.show{opacity:1;animation:pulse 1.2s ease-in-out infinite}@keyframes pulse{50%{opacity:.35}}#stats-panel{background:var(--panel);border-radius:18px;padding:16px}#stats-panel h2{margin:0 0 8px}#stats-list{display:grid;grid-template-columns:1fr auto;gap:6px 12px;margin:0}#stats-list dt{color:var(--muted)}#stats-list dd{margin:0;font-weight:700;text-align:right}#practice{color:var(--muted);font-size:13px;text-align:center}#board-wrap{position:relative}#intro{position:absolute;top:0;right:0;bottom:0;left:0;background:#0e1424f5;border-radius:18px;display:flex;flex-direction:column;justify-content:center;gap:18px;padding:20px}#intro ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}#intro li{display:flex;align-items:center;gap:14px;font-size:17px}#intro svg{width:56px;height:56px;flex:none;background:var(--panel);border-radius:12px;padding:6px;color:var(--glow);overflow:visible}#intro .wire.lit,#intro .lamp-ring.lit{stroke:var(--glow)}#intro .lamp-core.lit{fill:var(--glow)}#intro .demo-turn{transform-origin:50px 50px;animation:demo-turn 2.4s ease-in-out infinite}@keyframes demo-turn{0%,35%{transform:rotate(0)}50%,85%{transform:rotate(90deg)}to{transform:rotate(90deg)}}#intro button{margin:0;background:var(--glow);color:#1a1400;font-weight:700;width:100%}header{gap:8px}header #meta{flex:1;text-align:right;font-size:13px;white-space:nowrap}header button.ghost{margin-left:0}header #help-btn{padding:6px 14px}@media(prefers-reduced-motion:reduce){#intro .demo-turn{animation:none}}#consent{position:fixed;left:0;right:0;bottom:0;background:#1a2342;padding:14px 16px max(14px,env(safe-area-inset-bottom));display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}#consent p{margin:0;font-size:14px;flex:1 1 220px}#consent a{color:var(--glow)}#consent div{display:flex;gap:8px}#consent button{margin:0}@media(prefers-reduced-motion:reduce){.rot{transition:none}.hint-ring.show{animation:none}}
