:root { --board-green:#246653; --stone-white:#f8fafc; --stone-black:#172033; --p1:#315dc8; --p2:#b84b25; }
html, body { overflow-x: clip; }
[hidden] { display:none !important; }
.board-app { max-width: 1260px; }
.board-logo { background: linear-gradient(135deg, var(--board-green), #174438); font-size: 22px; }
.board-layout { display:grid; grid-template-columns: 246px minmax(0, 1fr); gap:16px; align-items:start; }
.game-picker { padding:16px; position:sticky; top:14px; }
.game-picker h2, .rules h2 { font:800 1rem var(--font-display); margin:2px 4px 12px; }
.game-list { display:grid; gap:7px; }
.game-choice { display:flex; text-align:left; text-decoration:none; width:100%; min-height:54px; padding:9px 11px; align-items:center; gap:10px; border:1px solid var(--color-border-subtle); border-radius:12px; color:var(--text-secondary); background:rgba(255,255,255,.035); cursor:pointer; font:700 .87rem var(--font-body); }
.game-choice:hover, .game-choice:focus-visible { border-color:var(--board-green); color:var(--text-primary); }
.game-choice.active { color:#fff; background:linear-gradient(120deg, var(--board-green), #1c4d40); border-color:#448a76; }
.game-choice .choice-icon { width:25px; text-align:center; font-size:1.25rem; }
.game-choice small { display:block; color:inherit; opacity:.72; font-size:.68rem; font-weight:600; }
.game-stage { padding:clamp(15px, 3vw, 26px); min-height:660px; display:flex; flex-direction:column; }
.game-topbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-bottom:12px; }
.eyebrow { color:var(--text-muted); font-size:.68rem; letter-spacing:.11em; font-weight:800; }
.game-topbar h2 { font:800 clamp(1.45rem, 4vw, 2rem) var(--font-display); line-height:1.18; }
.scoreboard { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; }
.player-card { min-width:140px; border:1px solid var(--color-border); border-radius:12px; padding:8px 13px; display:flex; align-items:center; justify-content:space-between; color:var(--text-secondary); font-size:.8rem; font-weight:800; }
.player-card.current { border-color:currentColor; box-shadow:0 0 0 2px color-mix(in srgb, currentColor 18%, transparent); }
.player-card.p1 { color:var(--p1); }.player-card.p2 { color:var(--p2); }.player-card strong { color:var(--text-primary); font-size:1.1rem; }
.game-status { text-align:center; color:var(--text-primary); font-weight:800; min-height:28px; padding:12px 0 8px; }
.board-wrap { flex:1; min-height:420px; display:grid; place-items:center; overflow:auto; padding:10px; }
button:focus-visible { outline:3px solid #f7cb4d; outline-offset:2px; }
.grid-board { display:grid; background:var(--board-green); box-shadow:0 16px 34px rgba(0,0,0,.32); }
.cell { border:1px solid rgba(218,255,240,.25); background:transparent; cursor:pointer; display:grid; place-items:center; color:inherit; padding:0; aspect-ratio:1; }
.cell:hover:not(:disabled), .cell.legal { background:rgba(255,255,255,.11); }.cell:disabled { cursor:default; }
.cell.selected { box-shadow:inset 0 0 0 3px #f7cb4d; }
.cell.winning { box-shadow:inset 0 0 0 3px #f7cb4d; }
.forbidden-mark { color:#852f28; font:900 clamp(.8rem, 2.2vw, 1.25rem) var(--font-display); line-height:1; text-shadow:0 1px rgba(255,255,255,.42); }
.gomoku-board .cell.forbidden { background:rgba(115,32,24,.16); cursor:not-allowed; }
.stone { width:78%; height:78%; border-radius:50%; display:block; box-shadow:inset 3px 3px 7px rgba(255,255,255,.27), 2px 3px 4px rgba(0,0,0,.34); }
.stone.p1 { background:var(--stone-black); }.stone.p2 { background:var(--stone-white); border:1px solid #cbd5e1; }
.gomoku-board { width:min(610px, calc(100vw - 80px)); grid-template-columns:repeat(15, 1fr); background-color:#c79c52; background-image:linear-gradient(rgba(55,36,13,.64) 1px, transparent 1px),linear-gradient(90deg, rgba(55,36,13,.64) 1px, transparent 1px); background-size:6.666667% 6.666667%; background-position:3.333333% 3.333333%; }.gomoku-board .cell { border:0; }.gomoku-board .stone { width:88%; height:88%; z-index:1; }.reversi-board { width:min(510px, calc(100vw - 80px)); grid-template-columns:repeat(8, 1fr); }.ticTacToe-board { width:min(390px, calc(100vw - 80px)); grid-template-columns:repeat(3, 1fr); }.four-board { width:min(525px, calc(100vw - 80px)); grid-template-columns:repeat(7, 1fr); padding:8px; border-radius:18px; gap:5px; background:#d8ad36; }
.four-board .cell { border:0; border-radius:50%; background:#11382e; }.four-board .cell.legal:hover { background:#285f51; }
.four-board .stone { width:82%; height:82%; }.ttt-mark { font:800 clamp(2.8rem, 13vw, 6rem) var(--font-display); line-height:1; }.ttt-mark.p1 { color:var(--p1); }.ttt-mark.p2 { color:var(--p2); }
.gomoku-confirm { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; min-height:54px; color:var(--text-secondary); font-size:.85rem; font-weight:700; }.gomoku-confirm .btn { min-height:44px; }.forbidden-note { color:#a94335; font-size:.75rem; }
.mancala-board { width:min(680px, 100%); display:grid; grid-template-columns:1.05fr repeat(6, 1fr) 1.05fr; grid-template-rows:repeat(2, minmax(78px, 1fr)); gap:8px; padding:13px; border-radius:20px; background:#b97835; box-shadow:inset 0 0 0 3px rgba(78,40,15,.35),0 16px 34px rgba(0,0,0,.28); }
.pit, .store { border-radius:50%; background:#61391e; color:#fff; border:3px solid rgba(45,24,9,.48); display:grid; place-items:center; font:800 1rem var(--font-body); min-height:70px; }.pit { cursor:pointer; }.pit.legal { outline:3px solid #f7cb4d; }.pit:hover:not(:disabled) { filter:brightness(1.17); }.store { border-radius:36px; grid-row:1 / span 2; }.store.p2-store { grid-column:1; }.store.p1-store { grid-column:8; }
.dots-board { --dot-size:14px; width:min(500px, calc(100vw - 80px)); aspect-ratio:1; display:grid; grid-template-columns:repeat(9, 1fr); grid-template-rows:repeat(9, 1fr); align-items:center; justify-items:center; padding:6px; background:#174a3d; border-radius:16px; }.dot { width:var(--dot-size); height:var(--dot-size); background:#e5f3ec; border-radius:50%; z-index:3; }.line { position:relative; z-index:2; border:0; background:transparent; cursor:pointer; min-width:36px; min-height:36px; }.line::after { content:''; position:absolute; display:block; border-radius:99px; background:rgba(255,255,255,.3); }.line.h { width:100%; height:36px; }.line.h::after { width:100%; height:10px; left:0; top:50%; transform:translateY(-50%); }.line.v { width:36px; height:100%; }.line.v::after { width:10px; height:100%; top:0; left:50%; transform:translateX(-50%); }.line.legal:hover::after { background:#fff; }.line.p1::after { background:var(--p1); }.line.p2::after { background:var(--p2); }.box { width:100%; height:100%; display:grid; place-items:center; font-weight:900; font-size:clamp(1rem, 3vw, 1.7rem); }.box.p1 { background:color-mix(in srgb, var(--p1) 55%, transparent); color:#dce7ff; }.box.p2 { background:color-mix(in srgb, var(--p2) 55%, transparent); color:#ffe0d4; }
.hex-board { width:min(570px, calc(100vw - 80px)); box-sizing:border-box; display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; padding:12px calc(14px + 32%) 12px 14px; background:#235f51; box-shadow:0 16px 34px rgba(0,0,0,.32); transform:skewX(-7deg); }.hex-cell { aspect-ratio:1.15; clip-path:polygon(25% 4%,75% 4%,100% 50%,75% 96%,25% 96%,0 50%); border:0; background:#d3a75b; cursor:pointer; display:grid; place-items:center; padding:0; }.hex-cell.legal:hover { background:#ecc678; }.hex-cell.winning { filter:drop-shadow(0 0 4px #f7cb4d); }.hex-stone { width:69%; height:75%; border-radius:50%; display:block; transform:skewX(7deg); box-shadow:inset 3px 3px 7px rgba(255,255,255,.27),2px 3px 4px rgba(0,0,0,.34); }.hex-stone.p1 { background:var(--p1); }.hex-stone.p2 { background:var(--p2); }
.nim-board { width:min(620px, 100%); display:grid; gap:10px; }.nim-pile { display:grid; grid-template-columns:120px minmax(90px,1fr) auto; align-items:center; gap:12px; border:1px solid var(--color-border); border-radius:13px; padding:10px 12px; }.nim-pile h3 { font:800 .84rem var(--font-body); color:var(--text-secondary); }.nim-stones { display:flex; flex-wrap:wrap; gap:5px; }.nim-stone { width:18px; height:18px; border-radius:50%; background:var(--stone-black); box-shadow:inset 2px 2px 3px rgba(255,255,255,.25); }.nim-choices { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }.nim-choices .btn { min-height:34px; padding:6px 8px; font-size:.72rem; }
.domineering-board { width:min(470px, calc(100vw - 80px)); grid-template-columns:repeat(6, 1fr); background:#855f3d; padding:7px; gap:3px; border-radius:12px; }.domineering-board .cell { border:0; border-radius:4px; background:#ecd39b; }.domineering-board .cell.domino-hover { background:#f2dfac; box-shadow:inset 0 0 0 3px #f7cb4d; }.domineering-board .cell.legal { background:#f5e4b9; outline:2px dashed rgba(38,81,67,.62); outline-offset:-5px; }.domineering-board .cell.legal:hover,.domineering-board .cell.legal:focus-visible { background:#fff1ca; }.domino-cell.p1 { background:var(--p1); }.domino-cell.p2 { background:var(--p2); }.domino-piece { width:42%; height:42%; border-radius:50%; display:block; background:rgba(255,255,255,.6); }
.breakthrough-board { width:min(540px, calc(100vw - 80px)); grid-template-columns:repeat(8, 1fr); background:#214b3f; padding:7px; gap:0; }.breakthrough-board .cell { border-color:rgba(255,255,255,.14); background:#e6c783; }.breakthrough-board .cell:nth-child(16n+1),.breakthrough-board .cell:nth-child(16n+3),.breakthrough-board .cell:nth-child(16n+5),.breakthrough-board .cell:nth-child(16n+7),.breakthrough-board .cell:nth-child(16n+10),.breakthrough-board .cell:nth-child(16n+12),.breakthrough-board .cell:nth-child(16n+14),.breakthrough-board .cell:nth-child(16n+16) { background:#9d704b; }.breakthrough-board .cell.source { box-shadow:inset 0 0 0 3px #f7cb4d; cursor:pointer; }.breakthrough-board .cell.destination { box-shadow:inset 0 0 0 3px #4cd7a7; cursor:pointer; }.breakthrough-piece { width:67%; height:67%; border-radius:50% 50% 42% 42%; display:block; box-shadow:inset 3px 3px 6px rgba(255,255,255,.3),2px 3px 3px rgba(0,0,0,.3); }.breakthrough-piece.p1 { background:var(--p1); }.breakthrough-piece.p2 { background:var(--p2); }
.rules { padding:18px 22px; }.rules p { color:var(--text-secondary); font-size:.9rem; line-height:1.7; }
.board-guide { padding:clamp(24px,4vw,42px); }.board-guide h2 { font:800 clamp(1.4rem,3vw,2rem) var(--font-display); margin-bottom:12px; }.board-guide > p { max-width:75ch; color:var(--text-secondary); line-height:1.75; }.board-guide-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:26px 34px; margin:26px 0; }.board-guide-grid article { border-top:2px solid var(--color-border); padding-top:15px; }.board-guide-grid h3 { font:800 1.1rem var(--font-display); margin-bottom:9px; }.board-guide-grid p { color:var(--text-secondary); line-height:1.75; font-size:.9rem; }.board-guide-grid p + p { margin-top:9px; }.board-guide a { display:inline-block; margin-top:10px; color:var(--accent-blue); font-weight:800; }.board-guide a:focus-visible { outline:3px solid #f7cb4d; outline-offset:3px; }.board-guide-more { margin-top:8px; }
@media (max-width:800px) { .board-layout { grid-template-columns:1fr; }.game-picker { position:static; }.game-list { grid-template-columns:repeat(2, minmax(0,1fr)); }.game-choice { min-height:50px; }.game-choice small { display:none; }.game-stage { min-height:560px; }.board-wrap { min-height:370px; } }
@media (max-width:480px) { .app-container.board-app { padding:12px; }.game-list { gap:5px; }.game-choice { padding:7px; font-size:.78rem; gap:5px; }.game-choice .choice-icon { width:18px; }.game-topbar .btn { padding:9px 11px; min-height:44px; white-space:nowrap; }.player-card { min-width:calc(50% - 5px); padding:7px 9px; }.board-wrap { padding:5px; }.gomoku-board,.reversi-board,.ticTacToe-board,.four-board,.dots-board,.hex-board,.domineering-board,.breakthrough-board { width:calc(100vw - 52px); }.mancala-board { gap:4px; padding:7px; }.pit,.store { min-height:54px; font-size:.85rem; }.dots-board { --dot-size:10px; }.nim-pile { grid-template-columns:1fr; gap:7px; }.nim-choices { justify-content:flex-start; } }
@media (max-width:640px) { .board-guide-grid { grid-template-columns:1fr; gap:23px; } }

.online-sites-shortcut { display:block; margin-top:16px; padding-top:14px; border-top:1px solid var(--color-border); color:var(--accent-blue); font-weight:700; font-size:.85rem; line-height:1.5; }
.online-board-sites { margin-top:16px; padding:24px; scroll-margin-top:20px; }
.online-sites-heading { max-width:780px; margin-bottom:22px; }
.online-sites-heading h2 { font-size:1.35rem; margin:7px 0 10px; }
.online-sites-heading p,.online-board-sites article p,.online-sites-note,.online-sites-sources { line-height:1.75; color:var(--text-secondary); font-size:.9rem; }
.online-sites-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.online-sites-grid article { display:flex; flex-direction:column; min-width:0; padding:20px; border:1px solid var(--color-border); border-radius:16px; background:var(--color-surface); }
.site-number { font:800 .8rem var(--font-display); color:var(--board-green); letter-spacing:.1em; }
.online-sites-grid h3 { margin:10px 0; font-size:1.2rem; }
.online-board-sites article .site-fit { color:var(--text-primary); font-weight:700; margin-bottom:10px; }
.online-board-sites article .site-tip { font-size:.82rem; margin:14px 0 20px; }
.online-site-link { margin-top:auto; color:var(--accent-blue); font-weight:800; line-height:1.6; }
.online-sites-note { margin:22px 0 8px; }
.online-sites-sources { font-size:.78rem; }
.online-sites-sources a { color:var(--accent-blue); }
.online-board-sites a:focus-visible,.online-sites-shortcut:focus-visible { outline:3px solid #f7cb4d; outline-offset:4px; }
@media(max-width:800px) { .online-sites-grid { grid-template-columns:1fr; gap:14px; } .online-board-sites { padding:18px; } }

.gomoku-options { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px 18px; margin:0 0 10px; padding:8px 12px; border:1px solid var(--border-color, rgba(128,128,128,.35)); border-radius:12px; min-width:0; }
.gomoku-options[hidden] { display:none; }
.gomoku-options legend { padding:0 6px; font-size:.78rem; font-weight:800; color:var(--text-secondary); }
.option-toggle { display:inline-flex; align-items:center; gap:8px; min-height:44px; font-weight:700; font-size:.9rem; cursor:pointer; }
.option-toggle input { width:20px; height:20px; accent-color:#a94335; }
.option-toggle input:disabled + span { opacity:.6; }
.option-help { flex-basis:100%; margin:0; text-align:center; font-size:.75rem; color:var(--text-secondary); }

.board-rule-pages { padding: clamp(24px, 4vw, 42px); }
.board-rule-list { margin: 14px 0 0; padding-left: 1.3em; line-height: 2; color: var(--accent-blue); font-weight: 700; }
