.board-outer.enhanced-viewport { justify-content:flex-start; align-items:flex-start; overflow:auto; max-height:min(75vh,760px); }
.enhanced-grid { position:relative; gap:3px; flex-shrink:0; margin-inline:auto; max-width:none; }
.enhanced-grid .enhanced-cell { box-sizing:border-box; position:relative; width:48px; height:48px; padding:0; margin:0; border-radius:3px; font:700 21px/1 var(--font-family, sans-serif); cursor:pointer; overflow:visible; min-width:0; }
.enhanced-value { pointer-events:none; }
.enhanced-cell.enhanced-selected { outline:3px solid var(--primary); outline-offset:-3px; z-index:2; }
.enhanced-cell.enhanced-fixed .enhanced-value { font-weight:900; }
.enhanced-fixed { cursor:default!important; }
.given-lock { position:absolute; font-size:8px; right:2px; bottom:2px; pointer-events:none; }
.arcade-outer-clue { display:flex; justify-content:center; align-items:center; font-size:15px; font-weight:700; color:var(--text-main); }
.enhanced-label { display:block; margin:0 0 6px; font-weight:600; }
#arcadeSidebarPanel .enhanced-label + select { width:100%; margin-bottom:12px; }
.enhanced-action { width:100%; justify-content:center; margin-bottom:8px; }
.enhanced-guide { background:var(--bg-elevated); border-radius:12px; padding:14px; margin:10px 0 20px; font-size:.88rem; line-height:1.7; }
.enhanced-guide p { margin:0 0 12px; }
.enhanced-note { color:var(--text-muted); font-size:.85rem; }
.enhanced-tools { display:flex; flex-wrap:wrap; gap:6px; width:100%; margin-top:8px; }
.enhanced-tool.active { background:var(--primary); color:white; }
.enhanced-tools .enhanced-tool { padding:8px 12px; min-height:36px; }
.cage-sum { position:absolute; top:2px; left:3px; font-size:10px; line-height:1; pointer-events:none; }
.kakuro-down,.kakuro-right { position:absolute; font-size:13px; line-height:1; pointer-events:none; }
.kakuro-down { top:5px; right:3px; }.kakuro-right { bottom:5px; left:3px; }
.futo-sign { position:absolute; z-index:3; font-size:13px; color:var(--primary); background:var(--grid-bg); line-height:14px; pointer-events:none; }
.futo-sign.horizontal { right:-9px; top:17px; }.futo-sign.vertical { bottom:-8px; left:18px; }
.enhanced-slant { gap:0; }.enhanced-slant .enhanced-cell { font-size:40px; font-weight:400; }.slant-node { display:flex; justify-content:center; align-items:center; font-size:13px; font-weight:700; }
.enhanced-loop { gap:0; padding:12px; }.enhanced-loop .loop-edge { width:30px; height:30px; }
.masyu-node { width:24px; height:24px; justify-self:center; align-self:center; display:flex; align-items:center; justify-content:center; border-radius:50%; z-index:2; }
.masyu-node.black { background:#0f172a; border:2px solid #0f172a; }.masyu-node.white { background:white; border:2px solid #334155; }.masyu-node.empty { color:var(--text-main); font-size:24px; }
.locked-edge { cursor:default; opacity:.7; }.locked-edge.drawn::before { background:var(--text-muted)!important; }
.path-endpoint .enhanced-value { border-radius:50%; padding:7px; background:var(--text-main); color:var(--grid-bg); font-size:15px; }
.galaxy-overlay { position:absolute; left:3px; top:3px; pointer-events:none; }
.galaxy-core { position:absolute; transform:translate(-50%,-50%); width:22px; height:22px; border:2px solid #334155; border-radius:50%; background:white; color:#0f172a; font:bold 12px/18px sans-serif; text-align:center; z-index:4; box-shadow:0 0 0 2px white; }

.binairo-stone { width:28px;height:28px;border:2px solid #64748b;border-radius:50%;display:inline-block; } .binairo-stone.black { background:#0f172a; } .binairo-stone.white { background:white; }
.path-arm { position:absolute; background:#475569; pointer-events:none; z-index:1; } .path-arm.left,.path-arm.right { width:28px;height:5px;top:calc(50% - 2.5px); } .path-arm.left { right:50%; }.path-arm.right { left:50%; }.path-arm.up,.path-arm.down { width:5px;height:28px;left:calc(50% - 2.5px); }.path-arm.up { bottom:50%; }.path-arm.down { top:50%; }.enhanced-grid .enhanced-value { position:relative;z-index:2; }
.board-outer { justify-content:flex-start; } .yinyang-grid { flex-shrink:0; margin-inline:auto; }

.game-rules-section{margin:0 0 24px;min-width:0}.game-rules-section>.panel-section-title{margin-top:0}.game-rules-section .enhanced-guide{margin:10px 0 0;overflow-wrap:anywhere}.guide-subtitle{font-size:.9rem;color:var(--text-main);margin:18px 0 6px}.guide-subtitle:first-child{margin-top:0}.guide-list{padding-left:1.3em;margin:0 0 12px}.guide-list li{margin-bottom:7px}.game-rules-section .enhanced-guide p:last-child{margin-bottom:0}

/* Compact game guides: native disclosure works with keyboard and touch. */
.game-rules-section{margin-bottom:18px}.guide-quick{padding:12px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--bg-elevated);font-size:.86rem;line-height:1.55}.guide-quick-row{margin-bottom:9px}.guide-quick-label{font-weight:700;color:var(--text-main)}.guide-quick-row p{margin:3px 0 0}.guide-visual{margin:0;padding-top:8px;border-top:1px solid var(--border-subtle);font-weight:600;font-size:.82rem;color:var(--text-main);overflow-wrap:anywhere}.guide-level-note{font-size:.83rem;line-height:1.5;margin:9px 0}.guide-details{margin-top:8px}.guide-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;list-style:none;min-height:44px;padding:8px 12px;box-sizing:border-box;border:1px solid var(--border-subtle);border-radius:9px;font-size:.85rem;font-weight:600;color:var(--text-main);background:var(--bg-elevated)}.guide-toggle::-webkit-details-marker{display:none}.guide-toggle:hover{border-color:var(--primary)}.guide-toggle:focus-visible{outline:2px solid var(--primary);outline-offset:3px}.guide-toggle-open{display:none}.guide-details[open] .guide-toggle-open{display:inline}.guide-details[open] .guide-toggle-closed{display:none}.guide-chevron{font-size:.7rem;transition:transform .15s}.guide-details[open] .guide-chevron{transform:rotate(180deg)}.game-rules-section .enhanced-guide{padding:12px;font-size:.84rem;line-height:1.6}.guide-detail-block+.guide-detail-block{margin-top:14px;padding-top:12px;border-top:1px solid var(--border-subtle)}.guide-detail-block .guide-subtitle{margin:0 0 6px}.guide-detail-block .guide-list{margin-bottom:0}.guide-detail-block p{margin:0}.guide-list li{margin-bottom:5px}@media(prefers-reduced-motion:reduce){.guide-chevron{transition:none}}

/* Board proportions and legible pieces; larger boards scroll inside the board only. */
.enhanced-grid .enhanced-cell{width:var(--arcade-cell,48px);height:var(--arcade-cell,48px);font-size:calc(var(--arcade-cell,48px)*.42)}
.enhanced-symbol{font-size:calc(var(--arcade-cell,48px)*.62);line-height:1}.enhanced-mark{font-size:calc(var(--arcade-cell,48px)*.34);font-weight:500;color:var(--text-muted)}
.enhanced-grid[data-game="chess"] .enhanced-value{font-family:"Segoe UI Symbol","Arial Unicode MS",serif;font-size:calc(var(--arcade-cell,48px)*.78);line-height:1;font-weight:400}
.enhanced-grid .binairo-stone{width:calc(var(--arcade-cell,48px)*.62);height:calc(var(--arcade-cell,48px)*.62);box-sizing:border-box}
.enhanced-grid .arcade-outer-clue{font-size:clamp(15px,calc(var(--arcade-cell,48px)*.27),20px)}
.enhanced-grid .given-lock{font-size:9px;right:3px;bottom:3px;opacity:.65}.cage-sum{font-size:12px;top:3px;left:4px}.kakuro-down,.kakuro-right{font-size:clamp(13px,calc(var(--arcade-cell,48px)*.25),17px)}
.enhanced-slant .slant-node{font-size:15px}.enhanced-slant .slant-line{position:absolute;inset:4px;pointer-events:none;background:linear-gradient(to bottom right,transparent calc(50% - 1.7px),var(--text-main) calc(50% - 1.7px),var(--text-main) calc(50% + 1.7px),transparent calc(50% + 1.7px))}.enhanced-slant .slant-line.slash{transform:scaleX(-1)}
.enhanced-loop .loop-edge{width:var(--arcade-half,30px);height:var(--arcade-half,30px)}.enhanced-loop .masyu-node{width:calc(var(--arcade-half,30px)*.85);height:calc(var(--arcade-half,30px)*.85);box-sizing:border-box}
.futo-sign{font-size:16px;line-height:18px}.futo-sign.horizontal{top:calc(50% - 9px);right:-10px}.futo-sign.vertical{left:calc(50% - 9px);bottom:-10px}
.path-arm.left,.path-arm.right{width:calc(var(--arcade-cell,48px)/2 + 3px);height:6px;top:calc(50% - 3px)}.path-arm.up,.path-arm.down{height:calc(var(--arcade-cell,48px)/2 + 3px);width:6px;left:calc(50% - 3px)}.path-endpoint .enhanced-value{font-size:calc(var(--arcade-cell,48px)*.33);min-width:calc(var(--arcade-cell,48px)*.5);box-sizing:border-box;padding:6px;text-align:center}.galaxy-core{width:28px;height:28px;font-size:14px;line-height:24px}
.enhanced-tools .enhanced-tool{min-width:44px;min-height:44px;justify-content:center}.enhanced-grid .enhanced-cell:focus-visible{outline:3px solid var(--primary);outline-offset:-3px;z-index:5}
@media(max-width:767px){.board-outer.enhanced-viewport{padding:14px 6px;max-height:min(72vh,720px)}.enhanced-grid .given-lock{font-size:8px}.galaxy-core{width:25px;height:25px;font-size:13px;line-height:21px}}

.board-outer{width:100%;box-sizing:border-box}.nonogram-board-wrap{--cell-size:clamp(36px,calc((100vw - var(--nonogram-left) - 64px) / var(--nonogram-size) - 2px),var(--nonogram-max-cell))}.board-outer.nonogram-viewport{max-height:min(75vh,760px);overflow:auto;align-items:flex-start}.nonogram-grid .grid-cell{cursor:pointer}

/* Nurikabe: islands, river and undecided cells have distinct shapes/labels. */
.nuri-guide-diagram{margin:10px 0 0;padding-top:8px;border-top:1px solid var(--border-subtle)}.nuri-guide-diagram svg{display:block;width:100%;max-width:200px;height:auto;margin:0 auto}.nuri-guide-diagram figcaption{font-size:.8rem;line-height:1.5;margin-top:5px}.nuri-board-legend{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:.82rem;line-height:1.4;width:100%}.nuri-board-legend>span{display:flex;align-items:center;gap:6px}.nuri-swatch{width:17px;height:17px;border:1px solid #94a3b8;border-radius:3px;box-sizing:border-box}.nuri-swatch.island{background:#fff}.nuri-swatch.river{background:#142c42}.nuri-swatch.unknown{background:#e2e8f0}.nuri-white-label{font-size:calc(var(--arcade-cell,48px)*.25);font-weight:600;color:#475569}.nuri-river-mark{font-size:calc(var(--arcade-cell,48px)*.45);line-height:1;color:#93c5fd}.nuri-unknown-label{font-size:calc(var(--arcade-cell,48px)*.25);font-weight:400;color:#64748b}.enhanced-grid[data-game="nurikabe"] .enhanced-cell{border-color:#94a3b8!important}.enhanced-grid[data-game="nurikabe"] .given-lock{opacity:.6}
.arcade-card[data-id="nurikabe"] .card-visual-box{width:140px;height:140px}.arcade-card[data-id="nurikabe"] .card-visual-box svg{width:100%;height:100%;display:block}

.enhanced-grid[data-game="shikaku"] .enhanced-fixed{cursor:pointer!important}
