.araf-board{position:relative;width:min(100%,430px);aspect-ratio:1;margin:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface);box-shadow:0 3px 12px rgba(15,23,42,.08);overflow:hidden}
#board{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));grid-template-rows:repeat(4,1fr);gap:0;width:100%;height:100%;border:0;outline:0}
.araf-cell{min-width:44px;min-height:44px;padding:0;border:1px solid var(--line);border-radius:0;font-size:1.35rem;font-weight:750;touch-action:manipulation;background:var(--surface);color:var(--text)}
.araf-cell.selected{box-shadow:inset 0 0 0 2px #2563eb;outline:0}
#lines{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.wall{stroke:var(--text);stroke-width:.6}.wall.error{stroke:var(--error)}
.unknown-mark,.open-mark{fill:var(--muted);font-size:clamp(2.5px,.7vw,3px);text-anchor:middle;dominant-baseline:central}.open-mark{fill:#2563eb}
.mark-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:min(100%,430px);margin:8px auto}
.mark-controls button{display:grid;grid-template-columns:20px max-content 20px;align-items:center;gap:4px;width:100%;min-width:44px;min-height:48px;padding:8px 4px;border-radius:11px;border-color:var(--line);background:var(--surface);font-size:.9rem;font-weight:650;box-shadow:0 1px 3px rgba(15,23,42,.06);text-align:left}.edge-label{white-space:nowrap}
.edge-direction,.edge-state{display:inline-flex;align-items:center;justify-content:center;font-size:1rem;font-weight:800;line-height:1}
.edge-direction{color:var(--muted)}
.mark-controls button[data-state="-1"] .edge-state{color:var(--muted)}
.mark-controls button[data-state="0"] .edge-state{color:#2563eb}
.mark-controls button[data-state="1"] .edge-state{color:var(--text)}
.mark-controls button[data-state="null"] .edge-state{color:var(--muted)}
.play-actions{display:grid;gap:8px;width:min(100%,430px);margin:8px auto 0}
body.classic-shell .play-actions{grid-template-columns:minmax(0,1fr)}
.play-actions button{justify-content:center;width:100%;min-height:52px}
body.classic-shell main{display:flex;flex-direction:column;justify-content:center;min-height:100svh;margin:0 auto;padding:8px 0 max(8px,env(safe-area-inset-bottom))}
body.classic-shell .game-header{min-height:52px;margin-bottom:4px}
body.classic-shell .game-header h1{font-size:1.25rem;font-weight:800;letter-spacing:-.035em}
body.classic-shell .metrics{min-height:30px;margin:0 auto 6px;padding:3px 10px;border:1px solid color-mix(in srgb,var(--line),transparent 35%);border-radius:12px;background:var(--surface);box-shadow:0 1px 3px rgba(15,23,42,.05);font-size:.8rem}
body.classic-shell .board-area{margin:4px 0 6px}
body.classic-shell .play-actions button{border-color:var(--line);border-radius:12px;background:var(--surface);box-shadow:0 2px 5px rgba(15,23,42,.07);font-weight:650;min-height:52px}
body.classic-shell #new-toggle{background:var(--text);color:var(--bg);border-color:var(--text);font-weight:750}
body.classic-shell .mark-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
body.classic-shell #status{margin-top:7px;color:var(--muted);font-size:.82rem;line-height:1.4}
body.classic-shell dialog{border-radius:16px;box-shadow:0 16px 36px rgba(15,23,42,.2)}
:root[data-theme=dark] body.classic-shell .araf-board,:root[data-theme=dark] body.classic-shell .metrics,:root[data-theme=dark] body.classic-shell .mark-controls button,:root[data-theme=dark] body.classic-shell .play-actions button{box-shadow:0 3px 12px rgba(0,0,0,.24)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body.classic-shell .araf-board,:root:not([data-theme=light]) body.classic-shell .metrics,:root:not([data-theme=light]) body.classic-shell .mark-controls button,:root:not([data-theme=light]) body.classic-shell .play-actions button{box-shadow:0 3px 12px rgba(0,0,0,.24)}}
@media(min-width:768px) and (min-height:720px){body.classic-shell main{width:min(430px,calc(100% - 24px));min-height:0;margin:auto}body.classic-shell .mark-controls{grid-template-columns:repeat(4,minmax(0,1fr))}body.classic-shell .play-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}
