@font-face{font-family:'PT Serif';src:url('../assets/fonts/PT_Serif-Web-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
:root{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#404030;background:#f2e8cf;font-synthesis:none;--ink:#404030;--accent:#943b29;--muted:#7b7563;--line:#55482b22;--surface:#ffffff66;--wood:#d19c54;--radius:10px;--font:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
*{box-sizing:border-box}body{margin:0;min-width:320px;font-size:15px;line-height:1.5;background:radial-gradient(ellipse at 5% 10%,#fff7e84d,transparent 65%),#f2e8cf}body,button,select,input{font-family:var(--font)}button,input,select{font-size:inherit}button{color:inherit;cursor:pointer}button:disabled{cursor:default}button,a,input,select,summary{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #943b29;outline-offset:4px}button{touch-action:manipulation}a{color:var(--accent)}h1,h2,h3,p{margin:0}h2{font-size:22px;line-height:1.3;font-weight:650;letter-spacing:-.5px}h3{font-size:14px;font-weight:650}p{line-height:1.6}button svg{flex-shrink:0}.icon{height:21px;width:21px;vertical-align:middle;flex-shrink:0}.site-header{max-width:1232px;margin:0 auto;min-height:100px;padding:20px 36px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{border:0;background:transparent;padding:0;display:flex;align-items:center}.brand img{width:170px;mix-blend-mode:multiply;display:block}.header-right{display:flex;align-items:center;gap:11px}.edition{font-size:11px;font-weight:550;letter-spacing:1.6px;text-transform:uppercase;margin-right:20px;color:var(--muted)}.icon-button{border:1px solid var(--line);border-radius:50%;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;background:transparent;transition:background .15s}.icon-button:hover:not(:disabled){background:#ffffff60}.icon-button:disabled{opacity:.28}.button{border:1px solid transparent;min-height:48px;padding:12px 19px;background:#e0cfab;border-radius:var(--radius);display:inline-flex;justify-content:center;align-items:center;gap:10px;font-weight:600;font-size:14px;line-height:1.35;transition:background .15s,transform .15s}.button:hover:not(:disabled){background:#d7c39a}.button:active:not(:disabled){transform:translateY(1px)}.button:disabled{opacity:.45}.button.primary{background:var(--accent);color:#fffaf0}.button.primary:hover:not(:disabled){background:#7d3021}.button.outline{border-color:#7b64413b;background:transparent}.button.outline:hover:not(:disabled){background:var(--surface)}.button.compact{min-height:40px;padding:9px 14px;font-size:13px;border-radius:8px}.text-button{padding:8px 0;background:transparent!important;color:var(--accent);min-height:36px;font-size:13px}.full-width{width:100%}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:650;color:var(--accent);text-transform:uppercase}.subtle{color:var(--muted);font-size:12px}.setup-layout{max-width:1132px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(370px,1fr);gap:80px;padding:47px 36px 36px;align-items:start}.welcome{padding-top:10px}.welcome h1{font-weight:450;font-size:43px;line-height:1.13;letter-spacing:-1.7px;max-width:440px;margin-top:16px}.intro{font-size:14px;color:var(--muted);max-width:330px;margin-top:17px;line-height:1.65}.preview-wrap{margin:33px 17px 0 0;position:relative;max-width:420px}.preview-wrap .go-board{transform:rotate(-3deg);box-shadow:0 15px 26px -8px #4c351d38,0 2px 3px #60472322}.preview-caption{display:block;text-align:center;color:var(--muted);font-size:11px;margin-top:24px;letter-spacing:.2px}.free-note{display:flex;gap:10px;align-items:center;margin:28px 0 0;color:#746950;font-size:12px}.free-note .icon{width:23px;height:23px}.setup-panel{padding-top:3px}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}.panel-heading h2{font-size:20px}.setup-card{border:1px solid #ffffff80;background:var(--surface);border-radius:12px;padding:17px 18px;margin-bottom:12px}.setup-card h3{margin-bottom:12px}.section-label{display:flex;justify-content:space-between;align-items:baseline}.section-label>span{font-size:11px;color:var(--muted)}.sizes{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.choice{background:transparent;border:1px solid #7262442e;border-radius:7px;min-height:43px;font-size:10px;font-weight:500;transition:background .15s,border-color .15s;padding:7px 4px}.choice:hover{background:#943b2908;border-color:#943b2955}.choice.selected{background:#943b290b;border:1.5px solid var(--accent);color:var(--accent);box-shadow:inset 0 0 0 .3px var(--accent)}.colors{display:flex;gap:8px}.color-choice{flex:1;display:flex;gap:8px;align-items:center;justify-content:center;flex-direction:column;min-height:69px}.sample-stone{width:23px;height:23px;display:inline-block;border-radius:50%;flex-shrink:0;box-shadow:0 2px 3px #28201528}.sample-stone.black,.stone.black{background:radial-gradient(circle at 34% 27%,#51514e 0%,#232321 42%,#090908 90%)}.sample-stone.white,.stone.white{background:radial-gradient(circle at 32% 23%,#fff 15%,#f9f8f1 45%,#d7d5ca 100%);border:1px solid #50472d24}.sample-stone.random{position:relative;overflow:hidden;background:radial-gradient(circle at 32% 23%,#fff 15%,#f9f8f1 45%,#d7d5ca 100%);box-shadow:inset 0 0 0 1px #50472d24,0 2px 3px #28201528}.sample-stone.random::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 34% 27%,#51514e 0%,#232321 42%,#090908 90%);clip-path:inset(0 50% 0 0)}.field-note{font-size:11px;color:var(--muted);line-height:1.55;margin-top:10px}.opponent-select{display:flex;align-items:center;gap:13px}.opponent-select img{width:58px;height:64px;object-fit:contain;mix-blend-mode:multiply}.opponent-copy{flex:1;min-width:0}.opponent-copy strong{font-size:14px;font-weight:650}.opponent-copy p{font-size:11px;color:var(--muted);margin-top:3px;line-height:1.45}.opponent-select select{max-width:127px;font-size:12px}select{border:1px solid #75603f35;border-radius:7px;padding:9px 26px 9px 10px;color:var(--ink);background-color:#fffaf247;min-height:38px;max-width:100%;cursor:pointer;accent-color:var(--accent)}.handicap-card{display:flex;align-items:center;justify-content:space-between;gap:20px}.handicap-card h3{margin:0}.handicap-card .field-note{margin-top:4px}.handicap-card select{width:68px;flex-shrink:0}.start-button{width:100%;min-height:53px;margin-top:5px;flex-direction:row-reverse;justify-content:space-between;padding:14px 21px;border-radius:9px;font-size:10px}.setup-bottom{text-align:center;font-size:11px;margin-top:11px;color:var(--muted)}.engine-notice{font-size:12px;color:var(--accent);margin:12px 0}.site-footer{max-width:1160px;margin:18px auto 0;min-height:70px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted);padding:18px 0}.site-footer button{color:var(--muted);font-size:11px;border:0;background:none;padding:10px}.site-footer>span:first-child{font-weight:600}.go-board{width:100%;aspect-ratio:1;position:relative;border-radius:8px;overflow:hidden;isolation:isolate;background:linear-gradient(#d19c54cc,#d19c54cc),url('../assets/board-wood.jpg') center/cover;box-shadow:0 6px 15px #50402120,0 1px 3px #58412330;container-type:inline-size}.board-grid{width:100%;height:100%;position:absolute;inset:0;pointer-events:none}.grid-lines{stroke:#403829;fill:none;opacity:.74}.hoshi{fill:#403829}.intersection{appearance:none;position:absolute;left:var(--x);top:var(--y);width:var(--cell);height:var(--cell);border:0;background:none;padding:0;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;outline-offset:-1px!important;border-radius:50%;margin:0;z-index:1}.intersection:disabled{opacity:1}.intersection:focus-visible{outline:2px solid #943b29;background:#fff5}.stone{display:flex;align-items:center;justify-content:center;width:93%;height:93%;border-radius:50%;position:relative;box-shadow:1px 2px 3px #211a1b45;pointer-events:none}.last-move{width:26%;height:26%;border-radius:50%;border:1.5px solid #fff9}.white .last-move{border-color:#3339}.dead .stone{opacity:.35}.dead-mark{color:#a03016;position:absolute;font-size:2.5cqw;line-height:1}.dim-stones .stone{opacity:.4}.hint-marker{width:84%;height:84%;border:2px solid var(--accent);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--accent);font-size:2.8cqw;background:#fffaea47;box-shadow:0 0 0 3px #fff4}.reviewed:after{content:'';width:78%;height:78%;border-radius:50%;border:2px solid var(--ink);position:absolute;pointer-events:none}.territory{width:23%;height:23%;pointer-events:none}.territory.black{background:#111a}.territory.white{background:#fff}.go-board.interactive[data-turn="1"] .intersection:not(.occupied):hover:before,.go-board.interactive[data-turn="1"] .drag-preview:before{background:#17171555}.go-board.interactive[data-turn="2"] .intersection:not(.occupied):hover:before,.go-board.interactive[data-turn="2"] .drag-preview:before{background:#fffc}.go-board.interactive .intersection:not(.occupied):hover:before,.go-board.interactive .drag-preview:before{content:'';width:93%;height:93%;position:absolute;border-radius:50%;pointer-events:none}.drag-mode{touch-action:none}.preview-board .intersection{pointer-events:none}.game-layout{max-width:1030px;margin:0 auto;padding:25px 32px 20px}.game-topline{display:flex;align-items:center;justify-content:flex-end;margin-bottom:20px;gap:12px}.turn-status{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:550}.status-dot{height:7px;width:7px;border-radius:50%;background:#8a8c58;flex-shrink:0}.status-dot.thinking{background:#ae8150;animation:pulse 1.5s infinite}.top-actions{display:flex;gap:8px}.play-area{display:grid;grid-template-columns:minmax(230px,1fr) minmax(0,630px);grid-template-areas:"opponent board";gap:36px;align-items:start}.board-column{min-width:0;grid-area:board}.board-action-bar{display:flex;gap:10px;margin-top:18px}.board-action-bar>.button{flex:1;min-height:50px}.board-action-bar .hint-button{background:#943b2912;border:1px solid #943b2935;color:var(--accent)}.board-action-bar .hint-button:hover:not(:disabled){background:#943b2920}.hint-button.loading .icon{animation:pulse 1.2s infinite}.board-footnote,.hint-substatus{display:flex;align-items:center;justify-content:center;gap:7px;min-height:37px;font-size:11px;color:var(--muted);text-align:center}.board-footnote .icon{width:17px}.game-sidebar{min-width:0;grid-area:opponent}.rival-card{display:grid;grid-template-columns:82px 1fr;gap:0 13px;align-items:center;min-height:158px}.rival-portrait{height:95px;width:82px;object-fit:contain;mix-blend-mode:multiply}.rival-name h2{font-size:21px;line-height:1.2}.rival-name>span{font-size:12px;color:var(--muted)}.rival-message{grid-column:1/-1;min-height:63px;padding:10px 0 18px;font-size:13px;display:flex;align-items:center}.rival-message p{line-height:1.6}.hint-message{display:flex;align-items:center;gap:8px;color:var(--accent);width:100%;font-size:13px}.hint-message .icon-button{width:29px;height:29px;margin-left:auto;flex-shrink:0;border:0}.hint-message .icon-button .icon{width:16px}.players{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0}.player-row{display:flex;gap:12px;align-items:center;padding:11px 8px;border-radius:7px}.player-row.active-player{background:#fff4}.player-row .sample-stone{height:27px;width:27px}.player-row>div{display:flex;flex-direction:column}.player-row strong{font-size:13px;font-weight:600}.player-row small{font-size:10px;color:var(--muted)}.player-row .capture-count{margin-left:auto;text-align:right}.capture-count strong{font-size:18px;font-weight:450;line-height:1.2}.game-meta{display:flex;justify-content:space-between;gap:6px;font-size:10px;color:var(--muted);margin:12px 4px 22px}.move-feedback{display:flex;align-items:center;width:100%;gap:10px;text-align:left;background:var(--surface);border:1px solid #fff8;border-radius:9px;padding:13px 10px}.move-feedback>span:nth-child(2){display:flex;flex-direction:column;gap:2px}.move-feedback strong{font-weight:600;font-size:12px}.move-feedback small{font-size:10px;color:var(--muted)}.move-feedback .icon{margin-left:auto;width:15px}.review-dot{width:7px;height:7px;border-radius:50%;background:#94825a;flex-shrink:0}.review-dot.good{background:#718959}.review-dot.poor{background:#a15640}.review-loading{padding:15px 0;font-size:11px}.help-link{display:flex;gap:7px;align-items:center;border:0;background:none;padding:17px 0;font-size:11px;color:var(--muted)}.help-link .icon{width:16px;height:16px}.error-card{padding:12px 14px;background:#943b290c;border:1px solid #943b2929;border-radius:9px;color:var(--accent);font-size:12px;margin:14px 0}.error-card .button{margin-right:12px}.score-card,.result-card{margin-top:18px;border-top:1px solid var(--line);padding-top:19px}.score-card>p,.result-card>p{font-size:12px;color:var(--muted);margin:9px 0}.result-card h2{font-size:24px;margin-top:8px;font-weight:550;color:var(--accent);letter-spacing:-.65px}.score-breakdown{font-size:12px;margin:15px 0}.score-columns{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:8px;margin-top:7px}.score-columns>:not(:first-child){text-align:right}.score-total{font-weight:650;border-top:1px solid var(--line);padding-top:10px;margin-top:10px}.score-card>.button:not(.text-button){width:100%}.result-card .result-details{margin:16px 0 6px}.result-card .result-details h3{font-size:12px;font-weight:600;padding:10px 0}.result-card .result-details .button:not(.text-button){width:100%}.replay-bar{display:flex;align-items:center;gap:6px;margin-top:18px;padding:13px 0;border-top:1px solid var(--line)}.replay-bar .icon-button{width:34px;height:34px;border:0;flex-shrink:0}.replay-bar .icon{height:17px;width:17px}.replay-progress{display:flex;flex:1;flex-direction:column;gap:5px;min-width:50px;margin:0 7px}.replay-progress>span{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.replay-progress strong{font-weight:500}.replay-progress input{width:100%;margin:0}input[type=range]{accent-color:var(--accent);cursor:pointer;min-height:24px}dialog{border:1px solid #8e745536;border-radius:17px;background:#f2e8cf;color:var(--ink);padding:0;width:min(550px,calc(100% - 32px));max-height:calc(100dvh - 48px);box-shadow:0 20px 100px #3b281447;overflow:auto}dialog::backdrop{background:#28261966;backdrop-filter:blur(3px)}.modal-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:19px 23px;background:#f2e8cffa;position:sticky;top:0;z-index:4;border-bottom:1px solid var(--line)}.modal-heading h2{font-size:20px}.modal-heading .icon-button{border:0;width:34px;height:34px}.modal-body{padding:23px}.modal-body.prose p{margin:0 0 18px;font-size:14px}.modal-body.prose h3{font-size:18px;margin:0 0 13px}.modal-body.prose .button{margin-top:10px}.settings-section{background:var(--surface);border:1px solid #fff7;border-radius:10px;padding:8px 16px;margin-bottom:15px}.settings-section h3{padding-top:10px;padding-bottom:4px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:55px;font-size:13px;position:relative}.setting-row+.setting-row{border-top:1px solid var(--line)}.setting-row>span:first-child{max-width:65%}.setting-row select{max-width:58%;font-size:12px;border:0;background:transparent;padding-right:20px;text-align:right;min-height:44px}.setting-row input[type=range]{width:130px;max-width:45%}.switch{position:absolute;right:0;width:37px;height:22px;opacity:0;z-index:1;cursor:pointer}.switch-track{width:37px;height:22px;border-radius:30px;background:#c6bea8;position:relative;flex-shrink:0;pointer-events:none;transition:background .2s}.switch-track:before{content:'';position:absolute;top:3px;left:3px;height:16px;width:16px;border-radius:50%;background:#fffdf5;box-shadow:0 1px 2px #0002;transition:transform .2s}.switch:checked+.switch-track{background:var(--accent)}.switch:checked+.switch-track:before{transform:translateX(15px)}.switch:focus-visible+.switch-track{outline:3px solid var(--accent);outline-offset:3px}.setting-link{display:flex;width:100%;text-align:left;justify-content:flex-start;background:transparent;font-weight:500;padding:13px 0;font-size:13px;min-height:49px}.setting-link+.setting-link{border-top:1px solid var(--line);border-radius:0}.settings-footer{font-size:11px;color:var(--muted);text-align:center;line-height:1.9;margin:20px 0 0}.dialog-actions{display:flex;gap:10px}.dialog-actions>.button{flex:1}.about-wordmark{width:220px;mix-blend-mode:multiply;display:block;margin:0 auto 23px}.review-board{margin-top:20px}.review-legend{display:flex;gap:15px;justify-content:space-between;font-size:12px;margin-top:18px}.review-legend>span:last-child{color:var(--accent)}
@keyframes pulse{50%{opacity:.35}}
@media(min-width:1100px) and (min-height:850px){.setup-layout{padding-top:60px;padding-bottom:40px}.setup-card{margin-bottom:15px;padding:18px 19px}.welcome h1{font-size:46px}.preview-wrap{margin-top:39px}.game-layout{padding-top:33px}}
@media(max-width:1000px){.setup-layout{gap:36px;padding:34px 28px}.site-header{padding:17px 28px;min-height:86px}.welcome h1{font-size:37px}.preview-wrap{margin-top:35px}.setup-card{padding:14px}.panel-heading .subtle{font-size:11px}.game-layout{padding:23px 24px}.play-area{gap:25px;grid-template-columns:225px minmax(0,1fr)}.site-footer{margin-left:28px;margin-right:28px}.rival-card{grid-template-columns:66px 1fr;gap:0 10px}.rival-portrait{width:66px;height:85px}.rival-name h2{font-size:19px}}
@media(max-width:760px){.site-header{min-height:77px;padding:14px 21px}.brand img{width:145px}.header-right{gap:6px}.edition{display:none}.icon-button{width:38px;height:38px}.setup-layout{display:block;padding:26px 20px 15px;max-width:530px}.welcome{padding:0}.welcome .eyebrow{font-size:9px;letter-spacing:1.7px}.welcome h1{font-size:35px;margin-top:10px;max-width:320px;letter-spacing:-1.2px}.welcome .intro{font-size:13px;margin-top:11px;max-width:none}.preview-wrap{display:none}.free-note{font-size:11px;margin-top:15px;margin-bottom:26px}.free-note .icon{height:19px}.panel-heading{margin-bottom:15px}.panel-heading h2{font-size:19px}.setup-card{padding:16px;margin-bottom:12px}.choice{min-height:46px}.color-choice{min-height:72px}.opponent-select img{width:65px;height:65px}.opponent-copy p{font-size:12px}.opponent-select select{max-width:138px}.start-button{margin-top:9px;min-height:54px}.site-footer{margin:15px 20px 0;padding:13px 0;min-height:60px;font-size:10px}.site-footer button{font-size:10px}.site-footer>span:last-child{font-size:10px}.game-layout{padding:17px 16px 5px;max-width:620px}.game-topline{margin-bottom:8px}.turn-status{font-size:12px;gap:7px}.top-actions{gap:6px}.top-actions .button{font-size:11px;padding:8px 10px;min-height:38px;gap:5px}.top-actions .button .icon{height:15px;width:15px}.play-area{display:flex;flex-direction:column;gap:0}.board-column{width:100%;order:2}.game-sidebar{display:contents}.rival-card{order:1;display:grid;width:100%;grid-template-columns:67px 1fr;grid-template-rows:auto auto;gap:0 12px;min-height:107px;padding:5px 6px 11px;align-items:center}.rival-portrait{grid-row:1/3;width:65px;height:85px}.rival-name{align-self:end}.rival-name h2{font-size:15px;display:inline}.rival-name>span{font-size:10px;margin-left:8px}.rival-message{grid-column:2;min-height:46px;font-size:12px;padding:5px 0 0;align-self:start}.rival-message p{line-height:1.45}.players{order:3;display:flex;width:100%;gap:14px;margin-top:8px;padding:8px 0}.player-row{flex:1;gap:9px;padding:8px}.player-row strong{font-size:12px}.player-row .capture-count strong{font-size:17px}.player-row .sample-stone{width:24px;height:24px}.game-meta{order:4;width:100%;justify-content:center;gap:25px;margin:12px 0}.board-action-bar{margin-top:15px;gap:9px}.board-action-bar>.button{font-size:13px;min-height:48px}.board-footnote{font-size:10px;min-height:33px}.help-link{order:10;margin:auto}.move-feedback,.review-loading{order:5;width:100%;margin:5px 0 10px}.error-card{order:6;width:100%}.score-card,.result-card{order:7;width:100%;margin-top:10px;padding:20px;background:var(--surface);border:0;border-radius:10px}.result-card h2{font-size:23px}.score-card .score-breakdown,.result-card .score-breakdown{font-size:13px}.game-sidebar>.field-note{order:8}.replay-bar{margin-top:10px}.modal-body{padding:19px}.modal-heading{padding:15px 19px}.setting-row{font-size:12px}.review-legend{font-size:11px}.hint-message{font-size:12px}}
@media(max-width:374px){.setup-layout{padding-left:14px;padding-right:14px}.welcome h1{font-size:32px}.setup-card{padding:13px}.opponent-select{gap:9px}.opponent-select img{width:52px}.opponent-select select{max-width:116px}.game-layout{padding-left:10px;padding-right:10px}.top-actions .button .icon{display:none}.site-footer>span:last-child{display:none}.setting-row{gap:8px}.settings-section{padding-left:12px;padding-right:12px}}
@media(hover:none){.go-board.interactive .intersection:not(.occupied):hover:before{display:none}.go-board.interactive .drag-preview:before{display:block!important}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Account for classic browser scrollbars at the smallest phone widths. */
/* Hide the text caret on the game page while preserving editable-field carets. */
body{caret-color:transparent}
input,textarea,[contenteditable=""],[contenteditable="true"],[contenteditable="plaintext-only"]{caret-color:auto}
body{min-width:280px}
.sizes .choice{white-space:nowrap}
@media(max-width:374px){.sizes .choice{font-size:10px}.panel-heading>.subtle{display:none}}

/* Quiet header and a single left edge for the opponent panel. */
.brand-group{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.brand-group .edition{display:block;margin:0;font-size:10px;letter-spacing:1.5px}
.header-right{gap:24px}
.header-tools{display:flex;align-items:center;gap:11px}
.rival-card{display:flex;flex-direction:column;align-items:flex-start;gap:10px;text-align:left;min-height:0;padding:0}
.rival-portrait{object-position:left center}
.rival-name{align-self:flex-start;text-align:left}
.rival-name h2{display:block}
.rival-name>span{display:block;margin-left:0}
.rival-message{align-self:stretch;text-align:left;padding:3px 0 18px;min-height:63px}
@media(max-width:760px){
  .site-header{display:grid;grid-template-columns:1fr auto;gap:12px 16px}
  .header-right{display:contents}
  .header-tools{grid-column:2;grid-row:1;gap:6px}
  .header-game-actions{grid-column:1/-1;grid-row:2;justify-content:flex-end}
  .brand-group .edition{font-size:9px;letter-spacing:1.1px}
  .rival-card{gap:6px;padding-bottom:9px}
  .rival-message{padding:2px 0 8px;min-height:0}
}
/* Desktop play uses all available space beside the opponent panel. */
@media(min-width:761px){
  .game-layout{width:100%;max-width:none}
  .play-area{grid-template-columns:clamp(225px,24vw,300px) minmax(0,1fr)}
  #app:has(.game-layout)>.site-header{width:100%;max-width:none}
}
/* Size the desktop board from the actual space below the header. */
@media(min-width:761px){
  #app:has(.game-layout){height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr)}
  .game-layout{height:100%;min-height:0}
  .play-area{height:100%;min-height:0}
  .board-column{height:100%;min-height:0;container-type:size;overflow-y:auto;scrollbar-gutter:stable both-edges;overscroll-behavior:contain}
  /* Reserve 18px action spacing, 50px buttons, and 22px engine status. */
  .board-frame,.board-column>.board-action-bar,.board-column>.score-card,.finished-summary{width:min(100%,max(320px,calc(100cqh - 90px)));margin-left:auto;margin-right:auto}
  .game-sidebar{max-height:100%;overflow-y:auto}
}

/* Follow the board edge even when its width is limited by window height. */
.site-header{position:relative}
.header-avatar{position:absolute;left:var(--board-left,0px);top:50%;transform:translateY(-50%);width:64px;height:76px;object-fit:contain;object-position:left center;mix-blend-mode:multiply;pointer-events:none}
@media(max-width:760px){
  .header-avatar{top:auto;bottom:10px;transform:none;width:38px;height:42px}
}

/* Keep the opponent's identity and speech with the portrait. */
.header-opponent{position:absolute;left:var(--board-left,0px);top:50%;transform:translateY(-50%);width:var(--opponent-width,320px);display:flex;align-items:center;gap:12px;min-width:0}
.header-opponent .header-avatar{position:static;transform:none;flex:0 0 88px;width:88px;height:104px}
.header-opponent .rival-card{flex:1;min-width:0;flex-direction:row;align-items:center;gap:16px;max-height:92px;overflow-y:auto;padding:0}
.header-opponent .rival-name{flex-shrink:0;align-self:center}
.header-opponent .rival-name h2{font-size:16px}
.header-opponent .rival-name>span{font-size:11px}
.header-opponent .rival-message{flex:1;min-width:0;min-height:0;align-self:center;padding:0;font-size:12px}
.header-opponent .rival-message p{line-height:1.4}
@media(min-width:761px){
  .site-header:has(.header-opponent){min-height:124px}
}
@media(max-width:760px){
  .header-opponent{position:static;transform:none;grid-column:1/-1;grid-row:2;width:auto;margin-left:calc(var(--board-left,21px) - 21px);gap:10px}
  .header-opponent .header-avatar{width:64px;height:80px;flex-basis:64px}
  .header-opponent .rival-card{max-height:none}
  .header-game-actions{grid-row:3}
}

/* Finished-game controls share the board alignment above the position. */
.finished-summary{margin-bottom:20px}
.finished-summary .replay-bar{margin-top:0}

/* Keep result actions compact and the score columns easy to scan. */
.result-card .result-details .button:not(.text-button){width:auto}
.result-card .score-columns{padding:3px 0;font-variant-numeric:tabular-nums}
.result-card .score-total{padding-top:12px}

/* Home page contains only the centered game setup. */
.setup-layout{display:block;max-width:560px;margin:0 auto}

/* Compact setup rows: labels in the first column, controls in the second. */
.setup-layout{max-width:740px;padding-top:18px}
.setup-panel{padding-top:0}
.setup-card{display:grid;grid-template-columns:120px minmax(0,1fr);gap:8px 20px;align-items:center}
.setup-card>h3,.setup-card>label h3{margin:0}
.setup-card>.field-note{grid-column:2;margin:0}
.handicap-card select{justify-self:start}
@media(max-width:760px){
  .setup-layout{padding-top:14px}
  .setup-card{grid-template-columns:88px minmax(0,1fr);gap:8px 12px;padding:14px}
  .setup-card>h3,.setup-card>label h3{font-size:12px}
  .setup-card .sizes{grid-template-columns:repeat(3,minmax(0,1fr))}
  .setup-card .colors{gap:5px}
  .setup-card .color-choice{font-size:10px}
  .setup-card .opponent-select{flex-wrap:wrap;gap:8px}
  .setup-card .opponent-select img{width:42px;height:50px}
  .setup-card .opponent-select select{width:100%;max-width:none}
}

.finished-new-game{min-height:53px;font-size:15px;justify-content:space-between;margin-bottom:18px}

/* Keep scoring progress visible over the board until results arrive. */
.board-frame{position:relative}
.scoring-overlay{position:absolute;inset:0;z-index:3;border-radius:8px;background:#f2e8cfe6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;color:var(--accent);font-size:16px;text-align:center;padding:24px}
.scoring-spinner{width:42px;height:42px;border:4px solid #943b2926;border-top-color:var(--accent);border-radius:50%;animation:scoring-spin .8s linear infinite}
@keyframes scoring-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.scoring-spinner{animation:none}}

/* Home branding follows the same centered column and gutters as setup cards. */
#app:has(.setup-layout)>.site-header{max-width:740px;padding-left:36px;padding-right:36px}
@media(max-width:1000px){#app:has(.setup-layout)>.site-header{padding-left:28px;padding-right:28px}}
@media(max-width:760px){#app:has(.setup-layout)>.site-header{padding-left:20px;padding-right:20px}}
@media(max-width:374px){#app:has(.setup-layout)>.site-header{padding-left:14px;padding-right:14px}}

/* Game header has opponent and controls only. */
#app:has(.game-layout)>.site-header{justify-content:flex-end}

/* Compact game actions: icon above a link-style label. */
.header-game-actions{gap:8px}
.header-game-actions .button{flex-direction:column;gap:4px;min-height:48px;min-width:44px;padding:4px 6px;border:0;border-radius:6px;background:transparent;font-size:11px;font-weight:500;line-height:1.25}
.header-game-actions .button:hover:not(:disabled){background:#943b290b;color:var(--accent)}
.header-game-actions .button .icon{display:block;width:21px;height:21px}
.header-game-actions .button span{white-space:nowrap}

/* Center gameplay now that the former left sidebar is gone. */
@media(min-width:761px){
  .play-area{grid-template-columns:minmax(0,1fr);grid-template-areas:"board";gap:0}
}

/* Keep the rank directly beneath the opponent portrait. */
.header-opponent .avatar-rank{display:flex;flex-direction:column;align-items:center;flex:0 0 88px;gap:2px;font-size:11px;line-height:1.3;color:var(--muted);text-align:center}
.header-opponent .avatar-rank .header-avatar{flex:none;height:88px;object-position:center}
@media(max-width:760px){.header-opponent .avatar-rank{flex-basis:64px}.header-opponent .avatar-rank .header-avatar{height:64px}}

.site-header{border-bottom:0}

/* Sound and settings use the same stacked treatment as game actions. */
.header-tools{gap:8px}
.header-tools .header-tool{flex-direction:column;gap:4px;min-height:48px;min-width:44px;padding:4px 6px;border:0;border-radius:6px;background:transparent;font-size:11px;font-weight:500;line-height:1.25}
.header-tools .header-tool:hover{background:#943b290b;color:var(--accent)}
.header-tools .header-tool .icon{width:21px;height:21px}
.header-tools .header-tool span{white-space:nowrap}

/* Treat all header controls as one evenly spaced row on desktop. */
@media(min-width:761px){
  .header-right{gap:8px}
  .header-game-actions,.header-tools{gap:8px}
}
.header-game-actions .button,.header-tools .header-tool{width:64px;min-width:64px;padding-left:0;padding-right:0}

/* Color choices place the label beside its stone. */
.color-choice{flex-direction:row;min-height:46px;gap:8px}
@media(max-width:760px){
  .setup-card .colors{flex-wrap:wrap}
  .setup-card .color-choice{flex:1 1 90px;min-height:44px;gap:6px}
}

.brand-group .edition{font-size:11px;letter-spacing:0;text-transform:none}

.board-action-bar>.hint-control{position:relative;display:flex;flex:1;min-width:0}
.hint-control>.hint-button{width:100%;min-height:50px}
.pass-hint-tooltip{position:absolute;bottom:calc(100% + 9px);left:50%;transform:translateX(-50%);width:max-content;max-width:100%;padding:8px 12px;border-radius:8px;background:var(--ink);color:#fffaf0;font-size:12px;text-align:center;box-shadow:0 3px 12px #28201526;z-index:5;pointer-events:none}
.pass-hint-tooltip::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--ink)}
@media(max-width:760px){.hint-control>.hint-button{min-height:48px;font-size:13px}}

/* Compact home-page buttons to match the 10px labels. */
.setup-panel .choice{min-height:32px;padding:5px 8px}
.setup-panel .sizes{max-width:390px}
.setup-panel .colors{max-width:340px}
.setup-panel .color-choice{min-height:32px;gap:6px}
.setup-panel .color-choice .sample-stone{width:18px;height:18px}
.setup-panel .start-button{min-height:40px;padding:9px 16px;font-size:14px;font-weight:700}

/* Mobile game header: controls first, opponent second. */
@media(max-width:760px){
  #app:has(.game-layout)>.site-header{grid-template-columns:minmax(0,1fr);gap:12px;padding-left:16px;padding-right:16px}
  #app:has(.game-layout) .header-right{display:flex;grid-column:1;grid-row:1;justify-content:flex-end;gap:8px;min-width:0}
  #app:has(.game-layout) .header-game-actions,#app:has(.game-layout) .header-tools{display:flex;gap:8px}
  #app:has(.game-layout) .header-right .button{width:auto;min-width:40px;padding:4px 0;font-size:10px}
  #app:has(.game-layout) .header-opponent{grid-column:1;grid-row:2;margin-left:0;width:100%}
}

.legal-footer{max-width:668px;gap:12px;flex-wrap:wrap;margin:18px auto;padding:18px 0}
.legal-footer nav{display:flex;align-items:center;gap:18px}
.legal-footer a{color:var(--muted);text-decoration:none;padding:8px 0}
.legal-footer a:hover{text-decoration:underline;color:var(--accent)}
.privacy-page .site-header{max-width:740px;padding-left:36px;padding-right:36px;gap:20px}
.privacy-page .site-header>a{font-size:13px;white-space:nowrap}
.privacy-content{max-width:740px;margin:0 auto;padding:20px 36px 28px;font-size:14px}
.privacy-content h1{font-size:32px;letter-spacing:-.7px}
.privacy-content .privacy-date{color:var(--muted);font-size:12px;margin:8px 0 24px}
.privacy-content h2{font-size:19px;margin:28px 0 10px}
.privacy-content p+p{margin-top:12px}
@media(max-width:740px){.legal-footer{margin-left:20px;margin-right:20px}.privacy-content,.privacy-page .site-header{padding-left:20px;padding-right:20px}}

.engine-progress{min-height:22px;font-size:12px;color:var(--muted);text-align:center;padding-top:4px}

/* Sound controls belong to the Stone sounds toggle above them. */
.sound-suboptions{margin:0 0 8px 16px;padding-left:12px}
.sound-suboptions .setting-row{min-height:48px;font-size:12px;border-top:0}
.sound-suboptions+.setting-row{border-top:1px solid var(--line)}

/* Move space above the board below it, preserving the available board height. */
.game-layout{padding-top:8px;padding-bottom:37px}
@media(min-width:1100px) and (min-height:850px){.game-layout{padding-bottom:45px}}
@media(max-width:1000px){.game-layout{padding-bottom:38px}}
@media(max-width:760px){.game-layout{padding-bottom:14px}}

/* Gently blink the suggested intersection without moving it. */
.hint-marker{animation:hint-blink 1.2s ease-in-out infinite}
@keyframes hint-blink{0%,100%{opacity:1}50%{opacity:.25}}
@media(prefers-reduced-motion:reduce){.hint-marker{animation:none}}


.hint-button.loading .icon{animation:hint-spin 1.2s linear infinite}
@keyframes hint-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.hint-button.loading .icon{animation:none}}
