:root{--paper:#fff2d4;--green:#196653;--muted:#635638;--line:#bb914c}
body{padding-bottom:24px}.masthead{max-width:1400px;flex-wrap:wrap;padding:14px 24px;background:#fff2d4eb;border-bottom:2px solid #ba8945;gap:12px}.masthead a{color:#195e4d;text-decoration:none;font-weight:700}.masthead strong{font-family:Story,serif;font-size:26px}.masthead span{margin-left:auto;font-size:13px}main{display:block;max-width:1400px;padding:20px 24px}main>h1{display:inline-block;font-size:30px;white-space:normal}main>p,.clock-rules,#connection,#presence{background:#fff2d4ed;padding:9px 14px;border-radius:10px;line-height:1.6}#account:empty{display:none}#entry{background:#fff2d4f5;padding:20px;border-radius:16px;border:2px solid #bd914f;flex-wrap:wrap}#join{flex-wrap:wrap}#code{font:inherit;padding:12px;width:190px;border:1px solid #b7813d;border-radius:9px;background:#fffaf0}.pvp-heading{background:#fff2d4eb;padding:10px 16px;border-radius:12px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:20px}.play-area{min-width:0}#opponent,#self{margin:8px 25px;background:#fff2d4ed;padding:8px 14px;border-radius:10px;font-size:14px}.pvp-panel{align-self:start;background:#fff2d4f5;box-shadow:var(--shadow);border:2px solid #bc904b;border-radius:16px}.pvp-panel>p{font-size:13px;line-height:1.7}#pvp-board{position:absolute;inset:0}.square.last-move{outline:3px solid #d48e16;outline-offset:-4px;background:#fff0a955}.pvp-panel #ready{width:100%}.frame{transform:none}.piece{transition:opacity .15s}#match-banner{z-index:100}#status{margin:0}#phrases{display:flex;flex-wrap:wrap;gap:7px}#phrases button{font-size:13px;padding:8px 10px}dialog{max-width:min(440px,94vw);border:3px solid #bc904b;border-radius:18px;background:#fff2d4;color:#512f17;padding:24px}dialog::backdrop{background:#173d3466}dialog h2{font-size:24px}button:focus-visible{outline-offset:2px}
@media(max-width:720px){main{padding:12px 8px}.masthead{padding:12px}.masthead span{margin-left:0;width:100%}main>h1{font-size:25px}.game-layout{grid-template-columns:minmax(0,1fr);gap:12px}.pvp-heading{padding:10px;gap:8px}.pvp-heading h2{width:100%;font-size:19px}.pvp-heading button{padding:8px 10px}.play-area{overflow:visible}#opponent,#self{margin:8px 10px}.frame{padding:15px 13px 27px}.pvp-panel{padding:14px}#entry{padding:14px}#join label{display:flex;align-items:center;gap:8px}#match-banner{top:0}}
[hidden]{display:none!important}

/* Notices take their own space, so neither scrolling nor a taller rematch message can cover the board. */
#match-banner{position:static;scroll-margin-top:8px;border:1px solid var(--line);border-radius:12px}
.board-frame{scroll-margin-top:8px}
@media(max-width:720px){
 #match-banner{padding:8px 10px}
 #round-identity{padding:0 0 6px;margin-bottom:6px}
 #round-start{font-size:17px;line-height:1.3;margin:0 0 4px}
 .round-side{gap:8px}.round-side img{width:28px;height:32px}
 #round-color{font-size:16px}#round-guidance{font-size:12px;margin:0;line-height:1.4}
 #match-banner #status{font-size:14px;margin:0 0 2px}
 #match-banner #turn-clock{gap:2px 8px;padding:0}
 #clock-label{font-size:13px}#clock-time{font-size:25px;line-height:1.2}
 #clock-hint{font-size:12px;line-height:1.4}
 #match-banner #auto-note{font-size:13px;margin:5px 0 0;padding:5px 7px}
 #opponent,#self{font-size:12px;line-height:1.4;margin:5px 10px;padding:5px 8px}
 #rematch-controls{margin-top:6px;padding-top:6px}
 #rematch-status{font-size:14px;margin:0 0 6px}.rematch-help{margin:6px 0 0;font-size:12px}
 .square{touch-action:manipulation}.square.legal:after{inset:28%}
}
