:root{color-scheme:dark;font-family:system-ui,sans-serif;background:#101721;color:#e8f0f6}*{box-sizing:border-box}body{margin:0}main{max-width:860px;margin:auto;padding:24px}a{color:#b5c8da}header{display:flex;justify-content:space-between;align-items:center}h1{font-size:38px;letter-spacing:-1.5px}.tools,.actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}button{font:inherit;min-height:44px;padding:10px 14px;border:1px solid #66819a;border-radius:8px;background:#223549;color:inherit;cursor:pointer}button[aria-pressed=true],#fire,#retry{background:#ecc276;color:#162330}button:disabled{opacity:.45;cursor:default}button:focus-visible{outline:3px solid #fff;outline-offset:3px}#board{position:relative;aspect-ratio:720/460;background:radial-gradient(#344555 1px,transparent 1px) 0 0/20px 20px,#182635;border:1px solid #536b80;border-radius:16px;overflow:hidden;touch-action:none}#drawing,#nodes{position:absolute;width:100%;height:100%;inset:0;pointer-events:none}.node{pointer-events:auto;position:absolute;transform:translate(-50%,-50%);width:46px;height:46px;padding:0;font-size:24px;border:2px solid #ecc276;background:#263646;border-radius:50%}.node.beam{border-radius:6px}.node.lamp{border-color:#91a8bb;pointer-events:none;font-size:20px}.node.fixed{border-style:double;border-width:4px}.node.selected{outline:3px solid #f2f6ff;outline-offset:4px}.node.lit{background:#ffe3a0;color:#172331;box-shadow:0 0 28px #ffdc7777}#message{min-height:26px;color:#c8d6e4}details{margin-top:18px;color:#aebfd0;line-height:1.6}svg circle,svg polygon{fill:#ecc27609;stroke:#ecc27677;stroke-width:2;stroke-dasharray:6 6}[hidden]{display:none!important}@media(max-width:500px){main{padding:12px}.node{width:38px;height:38px;font-size:18px}h1{font-size:30px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
/* Desktop layout and direct manipulation. */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
select{font:inherit;color:inherit;background:#223549;border:1px solid #66819a;border-radius:8px;padding:6px 10px;min-height:36px;max-width:75%}
select:focus-visible{outline:3px solid white;outline-offset:3px}
main{padding:16px;width:min(860px,100%)}
header{gap:16px;margin:8px 0 12px}h1{font-size:32px;margin:0}header strong{white-space:nowrap}
.tools,.actions{margin:10px 0}#message{margin:8px 0;min-height:24px;line-height:24px}
details{margin-top:8px}summary{cursor:pointer}#board{user-select:none}
.node.circle:not(.fixed),.node.beam{cursor:grab}.node.dragging{cursor:grabbing}
#board.dragging,#board.dragging .node{cursor:grabbing}
@media(min-width:760px) and (min-height:500px){
 main{width:min(860px,100%,max(560px,calc((100dvh - 320px)*720/460 + 32px)))}
 #board{width:min(100%,calc((100dvh - 320px)*720/460));margin-inline:auto}
 .node{width:6.4%;height:auto;min-height:0;aspect-ratio:1;font-size:clamp(14px,3.2dvh,24px)}
 .node.lamp{font-size:clamp(13px,2.7dvh,20px)}
}
