.duel-host{--paper:#fffdf8;--ink:#253c38;--muted:#728076;--line:#e4e8db;--orange:#f56d3c;--green:#3b6651;--cream:#fffaf3}:where(.duel-host) *{box-sizing:border-box}:where(.duel-host) .duel-page{margin:0;background:var(--cream);color:var(--ink);font:14px system-ui,-apple-system,'Noto Sans KR',sans-serif}:where(.duel-host) button,:where(.duel-host) select{font:inherit;color:inherit}:where(.duel-host) button{cursor:pointer}:where(.duel-host) a{color:inherit;text-decoration:none}:where(.duel-host) button:focus-visible,:where(.duel-host) a:focus-visible,:where(.duel-host) select:focus-visible{outline:3px solid #f39f77;outline-offset:3px}:where(.duel-host) button:disabled{cursor:default;opacity:.5}:where(.duel-host) [hidden]{display:none!important}:where(.duel-host) .site-top{max-width:1220px;margin:auto;padding:20px 26px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:16px}:where(.duel-host) .brand{display:flex;align-items:center;gap:9px;font-size:21px;font-weight:900;letter-spacing:-1px}:where(.duel-host) .brand-mark{display:grid;place-items:center;background:var(--orange);color:white;border-radius:10px;width:34px;height:34px;transform:rotate(-6deg);font-size:26px}:where(.duel-host) .site-top>div{display:flex;align-items:center;gap:18px}:where(.duel-host) .test-badge{font-size:10px;font-weight:800;letter-spacing:1.6px;color:var(--orange)}:where(.duel-host) .home-link{font-size:12px;color:var(--muted)}:where(.duel-host) .duel-page{max-width:1180px;margin:auto;padding:0 26px 28px}:where(.duel-host) .intro{display:flex;justify-content:space-between;align-items:center;padding:27px 0 24px;gap:20px}:where(.duel-host) .eyebrow{margin:0 0 8px;color:var(--green);font-size:11px;font-weight:800;letter-spacing:1px}:where(.duel-host) .duel-title{font-size:36px;letter-spacing:-1.5px;margin:0;line-height:1.3}:where(.duel-host) .duel-title>span{vertical-align:middle;margin-left:12px;font-size:11px;letter-spacing:0;background:#f9e6d7;color:#ae5636;padding:5px 8px;border-radius:5px}:where(.duel-host) .lead{margin:10px 0 0;color:var(--muted);line-height:1.7;font-size:13px}:where(.duel-host) .hero-seconds{font-size:56px;line-height:1;font-weight:900;color:var(--orange);text-align:center;transform:rotate(-7deg);padding-right:15px}:where(.duel-host) .hero-seconds>span{display:block;margin-top:8px;font-size:8px;letter-spacing:2px}:where(.duel-host) .settings{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;padding:15px 17px;background:var(--paper);border:1px solid var(--line);border-radius:14px}:where(.duel-host) .settings label{display:grid;gap:6px;font-size:10px;color:var(--muted);font-weight:700}:where(.duel-host) .settings select{border:1px solid #dbe2d4;border-radius:7px;background:white;padding:8px 24px 8px 9px;font-size:12px;min-height:36px}:where(.duel-host) .main-actions{display:flex;gap:7px;margin-left:auto}:where(.duel-host) .main-actions button{padding:10px 15px;min-height:38px;border-radius:8px;font-size:12px;font-weight:800}:where(.duel-host) .primary{background:var(--orange);color:white;border:1px solid var(--orange)}:where(.duel-host) .primary>span{margin-left:14px}:where(.duel-host) .secondary{background:#eff3e8;border:1px solid #dfe5d6}:where(.duel-host) .sticky-panel{position:sticky;top:0;z-index:20;background:#fffaf3f5;backdrop-filter:blur(8px);padding:12px 0 8px}:where(.duel-host) .clock-pair{display:grid;grid-template-columns:1fr 1fr;gap:13px}:where(.duel-host) .clock-card{position:relative;display:flex;align-items:center;gap:10px;padding:10px 13px 13px;border-radius:10px;border:1px solid #dbe4d4;background:#eff4e9;overflow:hidden}:where(.duel-host) .clock-card>span{font-size:12px;font-weight:800}:where(.duel-host) .clock-card>b{font-size:26px;font-variant-numeric:tabular-nums;line-height:1;letter-spacing:-.5px}:where(.duel-host) .clock-card>b>span{font-size:10px;font-weight:500;margin-left:3px}:where(.duel-host) .clock-card>small{margin-left:auto;font-size:10px;color:var(--muted)}:where(.duel-host) .clock-track{position:absolute;bottom:0;left:0;right:0;height:4px;background:#d9e4d1}:where(.duel-host) .clock-track>i{display:block;height:100%;width:100%;background:#7a9b70;transition:background .15s}:where(.duel-host) .clock-card.urgent{background:#fff0e8;border-color:#efbea6}:where(.duel-host) .clock-card.urgent>b{color:#c24e32}:where(.duel-host) .clock-card.urgent .clock-track>i{background:var(--orange)}:where(.duel-host) .clock-card.thinking{background:#f3f2e9}:where(.duel-host) .session-message{min-height:20px;margin:2px 0 12px;font-size:12px;color:var(--muted);text-align:center}:where(.duel-host) .boards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px}:where(.duel-host) .board-card{min-width:0;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--paper);box-shadow:0 5px 20px #253c3806}:where(.duel-host) .board-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}:where(.duel-host) .board-heading p{font-size:8px;font-weight:800;letter-spacing:1.5px;color:#8a967f;margin:0 0 5px}:where(.duel-host) h2{margin:0;font-size:20px;letter-spacing:-.6px}:where(.duel-host) .side-badge{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--muted)}:where(.duel-host) .side-badge i{width:13px;height:13px;border-radius:50%;display:inline-block;border:1px solid #85967b}:where(.duel-host) .side-badge .white{background:#fff6df}:where(.duel-host) .side-badge .black{background:#25382e}:where(.duel-host) .board-caption{display:flex;justify-content:space-between;gap:8px;align-items:center;min-height:36px;margin:7px 0;font-size:10px;color:var(--muted)}:where(.duel-host) .board-caption>span{min-width:0;overflow-wrap:anywhere}:where(.duel-host) .board-caption>b{font-size:9px;white-space:nowrap;color:#87937a;font-weight:500}:where(.duel-host) .chess-frame,:where(.duel-host) .gomoku-frame{padding:7px;border-radius:9px;background:#3c5545;overflow:hidden}:where(.duel-host) .chess-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1}:where(.duel-host) .chess-square{position:relative;aspect-ratio:1;min-width:0;padding:4px;border:0;border-radius:0;display:grid;place-items:center;background:#f0eadb;touch-action:manipulation}:where(.duel-host) .chess-square.dark{background:#9db18f}:where(.duel-host) .chess-square svg{display:block;width:95%;height:95%;max-width:58px;filter:drop-shadow(0 2px 1px #203a3025);pointer-events:none}:where(.duel-host) .chess-square.last{background:#d9db9b}:where(.duel-host) .chess-square.dark.last{background:#a1b673}:where(.duel-host) .chess-square.selected{background:#efb979;box-shadow:inset 0 0 0 3px #f56d3c}:where(.duel-host) .chess-square.check{background:#f7b0a0}:where(.duel-host) .chess-square.legal:after{content:'';position:absolute;width:23%;height:23%;border-radius:50%;background:#325e4a60;pointer-events:none}:where(.duel-host) .chess-square.legal.occupied:after{inset:2px;width:auto;height:auto;border:3px solid #325e4a99;background:transparent}:where(.duel-host) .chess-square small{position:absolute;left:3px;bottom:1px;font-size:8px;color:#47634f;pointer-events:none}:where(.duel-host) .gomoku-frame{background:#947651}:where(.duel-host) .gomoku-board{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));aspect-ratio:1;background:#dfbd85}:where(.duel-host) .gomoku-cell{position:relative;min-width:0;aspect-ratio:1;padding:0;border:0;background:transparent;touch-action:manipulation;display:grid;place-items:center}:where(.duel-host) .gomoku-cell:before{content:'';position:absolute;top:0;bottom:0;left:calc(50% - .5px);width:1px;background:#836343}:where(.duel-host) .gomoku-cell:after{content:'';position:absolute;left:0;right:0;top:calc(50% - .5px);height:1px;background:#836343}:where(.duel-host) .gomoku-cell.top:before{top:50%}:where(.duel-host) .gomoku-cell.bottom:before{bottom:50%}:where(.duel-host) .gomoku-cell.left:after{left:50%}:where(.duel-host) .gomoku-cell.right:after{right:50%}:where(.duel-host) .gomoku-cell.star{background:radial-gradient(circle at center,#795937 0 2px,transparent 2.5px)}:where(.duel-host) .stone{position:relative;width:86%;height:86%;border-radius:50%;z-index:1;box-shadow:1px 2px 2px #6a492466;pointer-events:none}:where(.duel-host) .stone.black{background:radial-gradient(circle at 32% 28%,#606861,#1e2922 55%,#101a13)}:where(.duel-host) .stone.white{background:radial-gradient(circle at 32% 28%,#fffefa,#f2ecd8 60%,#c0b69a)}:where(.duel-host) .gomoku-cell.last .stone:after{content:'';position:absolute;inset:35%;border-radius:50%;background:#f56d3c}:where(.duel-host) .gomoku-cell.winning .stone{outline:2px solid #e77828;outline-offset:-2px}:where(.duel-host) .board-footer{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:9px;line-height:1.5;margin-top:11px}:where(.duel-host) .board-result{margin-top:10px;padding:11px;border-radius:8px;background:#e9f0dd;font-size:13px;font-weight:800;text-align:center}:where(.duel-host) .board-result.loss{background:#f8e6da;color:#a95135}:where(.duel-host) .rules{margin-top:22px;border:1px solid var(--line);border-radius:12px;background:var(--paper);font-size:12px;line-height:1.8;color:#5e735f}:where(.duel-host) .rules summary{cursor:pointer;padding:14px 18px;font-weight:800}:where(.duel-host) .rules>div{padding:0 18px 12px}:where(.duel-host) .lab-footer{display:flex;justify-content:space-between;gap:15px;padding:20px 0 0;font-size:10px;line-height:1.5;color:#8b967e}:where(.duel-host) .lab-footer a{text-decoration:underline}:where(.duel-host) .board-card.blocked .chess-square,:where(.duel-host) .board-card.blocked .gomoku-cell{cursor:default}:where(.duel-host) .board-card.blocked .chess-board,:where(.duel-host) .board-card.blocked .gomoku-board{opacity:.85}
@media(max-width:720px){:where(.duel-host) .duel-page{padding:0 12px 20px}:where(.duel-host) .site-top{padding:14px 12px}:where(.duel-host) .brand{font-size:17px}:where(.duel-host) .site-top>div{gap:10px}:where(.duel-host) .home-link{font-size:10px}:where(.duel-host) .intro{padding:20px 0 18px}:where(.duel-host) .hero-seconds{font-size:40px;padding-right:6px}:where(.duel-host) .duel-title{font-size:27px}:where(.duel-host) .duel-title>span{margin-left:7px;font-size:9px}:where(.duel-host) .lead{font-size:11px;max-width:260px}:where(.duel-host) .settings{padding:12px;gap:8px}:where(.duel-host) .settings label{flex:1 1 40%;font-size:9px}:where(.duel-host) .settings select{width:100%;font-size:11px}:where(.duel-host) .main-actions{width:100%;margin:2px 0 0}:where(.duel-host) .main-actions .primary{flex:1}:where(.duel-host) .clock-pair{gap:7px}:where(.duel-host) .clock-card{padding:9px 8px 12px;gap:6px;flex-wrap:wrap}:where(.duel-host) .clock-card>b{font-size:22px}:where(.duel-host) .clock-card>span{font-size:10px}:where(.duel-host) .clock-card>small{font-size:9px}:where(.duel-host) .boards{gap:8px}:where(.duel-host) .board-card{padding:8px;border-radius:11px}:where(.duel-host) .board-heading p{font-size:7px}:where(.duel-host) h2{font-size:16px}:where(.duel-host) .side-badge{font-size:8px}:where(.duel-host) .board-caption{font-size:8px;min-height:38px;gap:4px;align-items:start;margin:7px 0}:where(.duel-host) .board-caption>b{font-size:7px}:where(.duel-host) .chess-frame,:where(.duel-host) .gomoku-frame{padding:4px;border-radius:6px}:where(.duel-host) .chess-square{padding:1px}:where(.duel-host) .chess-square small{font-size:5px;left:1px}:where(.duel-host) .board-footer{font-size:8px;flex-wrap:wrap;gap:3px}:where(.duel-host) .board-result{font-size:11px;padding:7px}:where(.duel-host) .lab-footer{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){:where(.duel-host) *{scroll-behavior:auto!important;transition:none!important}}
/* One shared clock and an endless score challenge. */
:where(.duel-host) .shared-scorebar{display:grid;grid-template-columns:1fr minmax(140px,1.25fr) 1fr;gap:10px;align-items:stretch}:where(.duel-host) .score-card,:where(.duel-host) .level-card{display:flex;flex-direction:column;justify-content:center;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}:where(.duel-host) .score-card>span,:where(.duel-host) .level-card>span{font-size:10px;color:var(--muted)}:where(.duel-host) .score-card>b{font-size:28px;line-height:1.1;font-variant-numeric:tabular-nums;color:var(--orange)}:where(.duel-host) .level-card>b{font-size:18px;margin-top:2px}:where(.duel-host) .level-card>small{font-size:9px;color:var(--muted);margin-top:3px}:where(.duel-host) .shared-clock{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;border:1px solid #dbe4d4;border-radius:10px;background:#eff4e9;overflow:hidden;padding:10px 15px 14px}:where(.duel-host) .shared-clock>span{font-size:10px;color:var(--green);font-weight:700}:where(.duel-host) .shared-clock>b{font-size:34px;font-variant-numeric:tabular-nums;line-height:1}:where(.duel-host) .shared-clock>b small{font-size:11px;font-weight:500;margin-left:3px}:where(.duel-host) .shared-clock.urgent{background:#fff0e8;border-color:#efbea6}:where(.duel-host) .shared-clock.urgent>b{color:#c24e32}:where(.duel-host) .shared-clock.urgent .clock-track>i{background:var(--orange)}:where(.duel-host) .turn-checks{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:7px;font-size:10px;color:var(--muted)}:where(.duel-host) .turn-checks>span{padding:5px 8px;border-radius:6px;background:#f0f1e9}:where(.duel-host) .turn-checks>span.complete{background:#e3efda;color:#417048;font-weight:800}
@media(max-width:720px){:where(.duel-host) .shared-scorebar{grid-template-columns:minmax(0,1fr) minmax(125px,1.5fr) minmax(0,1fr);gap:6px}:where(.duel-host) .score-card,:where(.duel-host) .level-card{padding:9px}:where(.duel-host) .score-card>b{font-size:23px}:where(.duel-host) .level-card>b{font-size:15px}:where(.duel-host) .shared-clock{padding:8px 8px 12px;gap:7px}:where(.duel-host) .shared-clock>b{font-size:28px}:where(.duel-host) .shared-clock>span{font-size:9px}:where(.duel-host) .turn-checks{font-size:9px;gap:6px}:where(.duel-host) .main-actions{flex-wrap:wrap}:where(.duel-host) .main-actions button{flex:1}:where(.duel-host) .settings label{flex:1 1 38%}}
:where(.duel-host) .chess-board{grid-template-rows:repeat(8,minmax(0,1fr))}:where(.duel-host) .chess-square{min-height:0;overflow:hidden}

/* Smooth monochrome assets retain their source alpha and anti-aliased edges. */
:where(.duel-host) .chess-square .chess-piece{position:absolute;inset:5%;width:90%;height:90%;object-fit:contain;image-rendering:auto;pointer-events:none;filter:grayscale(1) drop-shadow(0 1px 1px #1114)}
:where(.duel-host) .chess-square .piece-white{filter:grayscale(1) invert(1) drop-shadow(0 1px 1px #1118)}
:where(.duel-host) .no-pause{margin:10px 0 8px;text-align:center;font-size:11px;line-height:1.65;color:#955a3c}
:where(.duel-host) .result-dialog,:where(.duel-host) .replay-dialog{border:1px solid var(--line);border-radius:20px;background:var(--paper);color:var(--ink);box-shadow:0 24px 90px #182f3840;max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;padding:0}
:where(.duel-host) dialog::backdrop{background:#1a292d99;backdrop-filter:blur(3px)}
:where(.duel-host) .result-dialog{width:min(440px,calc(100vw - 24px))}
:where(.duel-host) .result-content{position:relative;padding:34px 28px 24px;text-align:center}
:where(.duel-host) .dialog-close{position:absolute;right:12px;top:9px;background:transparent;border:0;font-size:26px;min-width:36px;min-height:36px;color:var(--muted)}
:where(.duel-host) .result-content h2{font-size:24px}:where(.duel-host) .final-total{display:flex;align-items:baseline;justify-content:center;gap:8px;margin:20px 0 12px}:where(.duel-host) .final-total b{font-size:64px;line-height:1;color:var(--orange);font-variant-numeric:tabular-nums}:where(.duel-host) .final-total span{color:var(--muted)}
:where(.duel-host) #gameover-reason{font-size:14px;line-height:1.65;overflow-wrap:anywhere}:where(.duel-host) .result-meta{color:var(--muted);font-size:12px}:where(.duel-host) .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:22px}:where(.duel-host) .result-actions button:first-child{grid-column:1/-1}:where(.duel-host) .result-actions button,:where(.duel-host) .replay-actions button,:where(.duel-host) .replay-heading button,:where(.duel-host) .result-reopen{border-radius:9px;padding:12px;font-size:12px;font-weight:800;min-height:42px}
:where(.duel-host) #share-status{font-size:11px;line-height:1.6;color:var(--green);white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0 0;user-select:text}:where(.duel-host) .result-reopen{display:block;margin:0 auto 14px}
:where(.duel-host) .replay-dialog{width:min(940px,calc(100vw - 24px));padding:22px}
:where(.duel-host) .replay-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}:where(.duel-host) .replay-heading h2{font-size:22px}:where(.duel-host) .replay-heading .eyebrow{margin-bottom:4px}:where(.duel-host) .replay-heading button{flex:none}
:where(.duel-host) #replay-label{font-size:13px;min-height:20px;overflow-wrap:anywhere}:where(.duel-host) .replay-stats{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:12px}
:where(.duel-host) .replay-boards{gap:12px}:where(.duel-host) .replay-boards h3{margin:0 0 10px;font-size:15px}:where(.duel-host) .replay-boards h3 small{float:right;color:var(--muted);font-size:10px;font-weight:400}:where(.duel-host) .replay-boards .chess-square,:where(.duel-host) .replay-boards .gomoku-cell{cursor:default}
:where(.duel-host) .replay-progress{display:flex;align-items:center;gap:10px;margin-top:18px;font-size:11px;white-space:nowrap}:where(.duel-host) .replay-progress input{width:100%;min-width:0;accent-color:var(--orange)}:where(.duel-host) .replay-actions{display:flex;justify-content:center;gap:8px;margin-top:12px}:where(.duel-host) .replay-actions button{flex:1;max-width:160px}:where(.duel-host) .replay-note{font-size:10px;text-align:center;color:var(--muted);line-height:1.6;margin-bottom:0}
@media(max-width:720px){:where(.duel-host) .no-pause{font-size:10px}:where(.duel-host) .result-content{padding:30px 20px 20px}:where(.duel-host) .replay-dialog{padding:14px}:where(.duel-host) .replay-heading h2{font-size:17px}:where(.duel-host) .replay-heading button{font-size:10px;padding:9px}:where(.duel-host) .replay-boards{gap:8px}:where(.duel-host) .replay-stats{font-size:10px}:where(.duel-host) .replay-progress{gap:7px}:where(.duel-host) .replay-actions button{font-size:11px;padding:10px 7px}}

/* Large square boards take their size from the width; the page may scroll. */
.duel-host{container-type:inline-size;container-name:duel-game}
:where(.duel-host) .pause-short{display:none}
:where(.duel-host) .intro{padding-top:10px;padding-bottom:10px}
:where(.duel-host) .rules{margin-top:10px}
@media(max-width:900px){
 body.duel-view .duel-host .duel-page{width:100%;max-width:none;height:auto;margin:0;padding:0;overflow:visible}
 body.duel-view .duel-host .intro{padding:0 6px 6px;min-height:0;gap:6px}
 body.duel-view .duel-host .intro .eyebrow,body.duel-view .duel-host .intro .lead,body.duel-view .duel-host .hero-seconds{display:none}
 body.duel-view .duel-host .duel-title{font-size:18px;line-height:24px;letter-spacing:-.5px;margin:0}
 body.duel-view .duel-host .settings{flex-wrap:nowrap;align-items:center;gap:6px;padding:4px;border-radius:6px}
 body.duel-view .duel-host .settings label{display:block;flex:1 1 60px;min-width:0;font-size:0;padding:0;margin:0}
 body.duel-view .duel-host .settings select{width:100%;min-height:32px;height:32px;padding:2px 16px 2px 4px;font-size:12px;border-radius:5px}
 body.duel-view .duel-host .main-actions{display:flex;flex:1.7 1 130px;min-width:0;width:auto;margin:0;flex-wrap:nowrap;gap:6px}
 body.duel-view .duel-host .main-actions button{flex:1;min-width:0;min-height:32px;padding:3px 5px;font-size:11px;line-height:20px;white-space:nowrap;border-radius:5px}
 body.duel-view .duel-host .sticky-panel{position:sticky;top:0;z-index:20;padding:4px 0;background:var(--cream);backdrop-filter:none}
 body.duel-view .duel-host .shared-scorebar{grid-template-columns:minmax(0,1fr) minmax(100px,1.25fr) minmax(0,1fr);gap:6px}
 body.duel-view .duel-host .score-card,body.duel-view .duel-host .level-card{padding:4px 6px;flex-direction:row;align-items:center;justify-content:center;gap:5px;border-radius:6px;overflow:hidden}
 body.duel-view .duel-host .score-card>span{font-size:10px}
 body.duel-view .duel-host .score-card>b{font-size:21px;line-height:25px}
 body.duel-view .duel-host .level-card>span,body.duel-view .duel-host .level-card>small{display:none}
 body.duel-view .duel-host .level-card>b{font-size:12px;line-height:25px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.duel-view .duel-host .shared-clock{padding:3px 5px 5px;gap:5px;flex-wrap:nowrap;border-radius:6px}
 body.duel-view .duel-host .shared-clock>span{font-size:10px;white-space:nowrap}
 body.duel-view .duel-host .shared-clock>b{font-size:25px;line-height:25px;flex:none}
 body.duel-view .duel-host .shared-clock>b small{font-size:10px;margin-left:2px}
 body.duel-view .duel-host .clock-track{height:2px}
 body.duel-view .duel-host .turn-checks{gap:6px;margin-top:3px;font-size:10px;line-height:16px}
 body.duel-view .duel-host .turn-checks>span{padding:1px 4px;border-radius:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.duel-view .duel-host .no-pause{font-size:10px;line-height:14px;margin:0 0 3px}
 body.duel-view .duel-host .pause-full{display:none}
 body.duel-view .duel-host .pause-short{display:inline}
 body.duel-view .duel-host .session-message{min-height:0;margin:0 4px 4px;font-size:10px;line-height:16px;overflow-wrap:anywhere}
 body.duel-view .duel-host .boards{display:grid;width:100%;grid-template-columns:minmax(0,1fr);grid-template-rows:auto;gap:8px;align-items:start;overflow:visible}
 body.duel-view .duel-host .board-card{display:block;min-width:0;width:100%;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
 body.duel-view .duel-host .board-heading{min-height:20px;margin:0 4px 3px;gap:8px}
 body.duel-view .duel-host .board-heading p{display:none}
 body.duel-view .duel-host .board-heading h2{font-size:13px;line-height:20px;letter-spacing:-.4px}
 body.duel-view .duel-host .side-badge{font-size:10px;line-height:20px;gap:4px;white-space:nowrap}
 body.duel-view .duel-host .side-badge i{height:10px;width:10px}
 body.duel-view .duel-host .board-caption,body.duel-view .duel-host .board-footer,body.duel-view .duel-host .board-result{display:none!important}
 body.duel-view .duel-host .chess-frame,body.duel-view .duel-host .gomoku-frame{display:block;width:100%;height:auto;aspect-ratio:1;padding:0;background:transparent;border-radius:0;overflow:hidden}
 body.duel-view .duel-host .chess-board,body.duel-view .duel-host .gomoku-board{width:100%;height:auto;max-width:none;max-height:none;aspect-ratio:1}
 body.duel-view .duel-host .chess-square small{font-size:8px;left:2px;bottom:0}
 body.duel-view .duel-host .rules{margin:8px 2px 0;border-radius:6px;font-size:11px;line-height:1.7}
 body.duel-view .duel-host .rules summary{padding:7px 8px}
 body.duel-view .duel-host .result-reopen{min-height:32px;font-size:11px;padding:4px 8px;margin:4px auto}
 body.duel-view .duel-host .replay-dialog{width:calc(100vw - 8px);max-height:calc(100dvh - 8px);padding:4px;overflow:auto;border-radius:8px}
 body.duel-view .duel-host .replay-heading{position:sticky;top:-4px;z-index:2;flex-wrap:nowrap;background:var(--paper);padding:4px 2px}
 body.duel-view .duel-host .replay-heading .eyebrow{display:none}
 body.duel-view .duel-host .replay-heading h2{font-size:16px}
 body.duel-view .duel-host .replay-heading button{min-height:32px;padding:4px 6px;font-size:10px}
 body.duel-view .duel-host #replay-label{min-height:16px;margin:3px 2px;font-size:11px;line-height:16px}
 body.duel-view .duel-host .replay-stats{margin:3px 2px;font-size:10px}
 body.duel-view .duel-host .replay-boards h3{font-size:13px;line-height:20px;margin:0 4px 3px}
 body.duel-view .duel-host .replay-boards h3 small{font-size:10px}
 body.duel-view .duel-host .replay-progress{margin:6px 2px;font-size:11px;gap:6px}
 body.duel-view .duel-host .replay-actions{margin:6px 2px;gap:6px}
 body.duel-view .duel-host .replay-actions button{min-height:34px;padding:5px 8px;font-size:11px}
}
@container duel-game (max-width:820px){
 :where(.duel-host) .boards{grid-template-columns:minmax(0,1fr)}
}

/* Desktop keeps a roomy board; mobile retains viewport width and height fitting. */
.duel-host .turn-boards{display:block;width:100%;min-width:0;overflow-anchor:none}
.duel-host .turn-boards>.board-card{width:min(100%,760px);max-width:100%;margin-inline:auto;animation:duel-board-reveal 140ms ease-out}
.duel-host .turn-boards>.board-card[hidden],.duel-host .turn-replay-boards>.board-card[hidden]{display:none!important}
.duel-host .turn-boards .chess-frame,.duel-host .turn-boards .gomoku-frame{width:100%;box-sizing:border-box;aspect-ratio:1}
.duel-host .turn-replay-boards{display:block}
.duel-host .turn-replay-boards>.board-card{width:min(100%,max(220px,calc(100svh - 280px)));margin-inline:auto}
.duel-host .replay-board-tabs{display:flex;justify-content:center;gap:8px;margin:8px 0}
.duel-host .replay-board-tabs button{border:1px solid var(--line);border-radius:7px;min-height:34px;padding:5px 15px;font-size:12px}
.duel-host .replay-board-tabs button[aria-pressed="true"]{background:var(--green);font-weight:800}
@keyframes duel-board-reveal{from{opacity:.86}to{opacity:1}}
@media(max-width:900px){body.duel-view .duel-host .turn-boards{display:block}body.duel-view .duel-host .turn-boards>.board-card{width:var(--board-width,100%);margin-inline:auto}}
@media(prefers-reduced-motion:reduce){.duel-host .turn-boards>.board-card{animation:none}}

/* Compact desktop score and clock cards leave more room for the active board. */
.duel-host .chess-board{position:relative}
.duel-host .ranking-button{margin-left:auto;border:1px solid #dbe2d4;border-radius:6px;padding:5px 8px;font-size:11px;background:#eff3e8;white-space:nowrap}
.duel-host .score-card{flex-wrap:wrap;gap:4px}
.duel-host .rank-connection{margin:2px 0;font-size:10px;line-height:1.4;color:var(--muted);text-align:center}
.duel-host .ranking-dialog{width:min(540px,calc(100vw - 16px));max-height:calc(100dvh - 24px);overflow:auto;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink)}
.duel-host .ranking-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.duel-host .ranking-heading button{font-size:24px;width:36px;min-height:36px;border-radius:7px}
.duel-host .ranking-dialog p{font-size:11px;color:var(--muted);line-height:1.6}
.duel-host .ranking-table-wrap{overflow:auto}
.duel-host .ranking-dialog table{width:100%;border-collapse:collapse;font-size:13px;text-align:left}
.duel-host .ranking-dialog th,.duel-host .ranking-dialog td{padding:9px 6px;border-bottom:1px solid var(--line)}
.duel-host .ranking-dialog td:nth-child(3){overflow-wrap:anywhere;max-width:160px}
.duel-host .ranking-dialog td:last-child{font-variant-numeric:tabular-nums;white-space:nowrap}
.duel-host .rank-entry{margin:16px 0 0;padding:12px;background:#edf3e7;border-radius:8px}
.duel-host .rank-entry h3{font-size:14px;margin:0 0 9px}
.duel-host .rank-entry form{display:flex;align-items:center;gap:7px}
.duel-host #rank-country{font-size:24px;flex-shrink:0}
.duel-host #ranking-name{min-width:0;width:100%;padding:8px;border:1px solid #cddac7;border-radius:6px}
.duel-host #rank-save{flex-shrink:0;padding:8px;border-radius:6px;font-size:11px}
.duel-host .rank-entry p{font-size:10px;margin:7px 0 0;color:var(--muted)}
@media(max-width:900px){body.duel-view .duel-host .score-card{flex-wrap:nowrap;gap:3px;padding:3px}.duel-host .ranking-button{padding:4px;font-size:9px;margin-left:1px}body.duel-view .duel-host .score-card>span{display:none}}
.duel-host .chess-board>.chess-move-arrow{position:absolute;inset:0;display:block;width:100%;height:100%;z-index:2;pointer-events:none;color:#b36a2e;opacity:.32}
@media(min-width:901px){
 .duel-host .sticky-panel{padding:6px 0}
 .duel-host .shared-scorebar{gap:8px}
 .duel-host .score-card,.duel-host .level-card{flex-direction:row;align-items:center;gap:10px;padding:6px 12px}
 .duel-host .score-card>b{font-size:24px}
 .duel-host .level-card>b{font-size:16px;margin:0}
 .duel-host .level-card>small{margin:0}
 .duel-host .shared-clock{gap:10px;padding:6px 12px 9px}
 .duel-host .shared-clock>b{font-size:28px}
}

.duel-host .ranking-mode{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:700;margin:12px 0}
.duel-host .ranking-mode select{padding:7px 26px 7px 10px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}

.duel-host #rank-check-status{padding:10px;border-radius:8px;background:#eff3e8;color:var(--green);font-size:12px;line-height:1.5}

.duel-host .turn-boards>.board-card>.chess-frame,.duel-host .turn-boards>.board-card>.gomoku-frame{position:relative;margin-top:10px}
/* The initial pieces occupy the outer two ranks; this box stays in ranks 3–6. */
.duel-host .chess-start-hint{position:absolute;left:6%;right:6%;top:45%;transform:translateY(-50%);max-height:40%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(2px,calc(var(--duel-main,320px)*.015),8px);margin:0;padding:clamp(2px,calc(var(--duel-main,320px)*.025),12px);border:1px solid #d5e1cd;border-radius:10px;background:#fffdf8ed;color:#2c5942;font-size:clamp(7px,calc(var(--duel-main,320px)*.06),18px);font-weight:700;line-height:1.4;text-align:center;overflow-wrap:anywhere;overflow:hidden;pointer-events:none;z-index:3;box-shadow:0 2px 10px #253c3812}
.duel-host .chess-start-hint>strong{display:block;font-size:clamp(7px,calc(var(--duel-main,320px)*.05),16px);font-weight:850;color:#b8431e}
.duel-host .session-message{min-height:0;margin:6px 0 10px;color:#b8431e;font-size:clamp(17px,2.2vw,23px);font-weight:850;line-height:1.45;overflow-wrap:anywhere}
@media(max-width:900px){body.duel-view .duel-host .session-message{margin:2px 4px 7px;font-size:16px;font-weight:850;line-height:1.45;color:#b8431e}.duel-host .chess-start-hint{border-radius:8px}}

.duel-host .session-rules{max-width:820px;margin:0 auto 10px;text-align:center;font-size:12px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.duel-host .session-rules>span{display:block}
.duel-host #session-win-points{margin-bottom:4px;font-size:13px;font-weight:800;color:var(--green)}
@media(max-width:900px){body.duel-view .duel-host .session-rules{margin:0 4px 7px;font-size:11px;line-height:1.55}.duel-host #session-win-points{font-size:12px}}

/* Fixed board slots; only desktop menus may scroll above the arena. */
body.duel-view{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}
body.duel-view .site-header{flex-shrink:0;width:100%;margin:0 auto}
body.duel-view .page{display:flex;flex-direction:column;flex:1 1 0;min-height:0;max-width:1200px;width:100%;margin:0 auto;padding:0 12px 8px;overflow:visible}
body.duel-view .game-picker-toggle,body.duel-view #game-picker{flex-shrink:0}
body.duel-view .game-guide{display:none!important}
body.duel-view .duel-host{display:flex;flex:1 1 0;min-height:0;margin:0;container-type:normal}
body.duel-view .duel-host .duel-page{display:flex;flex-direction:column;flex:1 1 0;min-height:0;width:100%;padding:0;margin:0}
body.duel-view .duel-host .duel-play-area{display:flex;flex-direction:column;flex:1 1 0;min-height:0}
body.duel-view .duel-host .settings,body.duel-view .duel-host .sticky-panel{flex-shrink:0}
body.duel-view .duel-host .sticky-panel{position:static}
body.duel-view .duel-host .shared-scorebar{height:48px;min-height:48px}
body.duel-view .duel-host .score-card,body.duel-view .duel-host .level-card,body.duel-view .duel-host .shared-clock{height:100%;min-height:0;min-width:0;overflow:hidden;flex-wrap:nowrap}
.duel-host #turn-boards{--duel-main:200px;--duel-preview:60px;--duel-main-width:218px;--duel-main-height:266px;--duel-preview-width:74px;--duel-preview-height:94px;--duel-gap:12px;position:relative;display:grid;flex:1 1 0;min-height:0;grid-template-columns:minmax(0,var(--duel-main-width)) minmax(0,var(--duel-preview-width));grid-template-rows:minmax(0,1fr);grid-template-areas:'main preview';justify-content:center;align-items:end;gap:var(--duel-gap);width:100%;margin:0;overflow-anchor:none}
.duel-host #turn-boards>.board-card{position:relative;display:grid;grid-template-rows:24px minmax(0,1fr) 16px;gap:4px;box-sizing:border-box;min-width:0;max-width:none;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--paper);margin:0;animation:none;transition:none;overflow:visible;box-shadow:0 3px 12px #253c3806}
.duel-host #turn-boards>.is-main{grid-area:main;width:var(--duel-main-width);height:var(--duel-main-height)}
.duel-host #turn-boards>.is-preview{grid-area:preview;grid-template-rows:16px minmax(0,1fr);padding:6px;gap:4px;width:var(--duel-preview-width);height:var(--duel-preview-height);pointer-events:none;user-select:none}
.duel-host #turn-boards .board-heading{display:flex;align-items:center;height:24px;min-height:0;margin:0;gap:6px}
.duel-host #turn-boards .board-heading p{display:none}
.duel-host #turn-boards .board-heading h2{font-size:14px;line-height:20px;white-space:nowrap}
.duel-host #turn-boards .side-badge{font-size:10px;line-height:20px;min-width:0;max-width:65%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.duel-host #turn-boards .board-footer{display:block!important;height:16px;line-height:16px;margin:0;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.duel-host #turn-boards .board-result{display:none!important}
.duel-host #turn-boards .chess-frame,.duel-host #turn-boards .gomoku-frame{display:block;width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:1;margin:0;padding:0;border-radius:4px;background:transparent;overflow:hidden}
.duel-host #turn-boards .chess-board,.duel-host #turn-boards .gomoku-board{width:100%;height:100%;max-width:none;max-height:none;aspect-ratio:1}
.duel-host #turn-boards .gomoku-board{grid-template-rows:repeat(15,minmax(0,1fr))}
.duel-host #turn-boards .is-preview .board-heading{height:16px}
.duel-host #turn-boards .is-preview .board-heading h2{font-size:10px;line-height:16px;color:var(--muted)}
.duel-host #turn-boards .is-preview .side-badge,.duel-host #turn-boards .is-preview .board-footer,.duel-host #turn-boards .is-preview .chess-square small,.duel-host #turn-boards .is-preview .chess-start-hint{display:none!important}
.duel-host #turn-boards .is-preview .chess-square{padding:0}
.duel-host #turn-boards .is-preview .chess-board,.duel-host #turn-boards .is-preview .gomoku-board{opacity:1}
/* Reserve the same mobile footer row; expanded details flow below the arena. */
.duel-host .duel-rules-area{position:relative;flex:0 0 38px;min-height:0;height:38px;margin-top:4px;overflow:visible}
body.duel-view .duel-host .duel-rules{margin:0;border-radius:8px;overflow-anchor:none}
body.duel-view .duel-host .duel-rules>summary{height:36px;padding:6px 140px 6px 12px;line-height:24px;cursor:pointer}
.duel-host .duel-rules>summary:focus-visible{outline:2px solid var(--green);outline-offset:-3px}
.duel-host .duel-rules[open]>summary{border-bottom:1px solid var(--line)}
.duel-host .duel-rules-area .result-reopen{position:absolute;right:6px;top:5px;z-index:1;margin:0;max-width:128px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;min-height:26px;padding:3px 10px;border-radius:7px}
.duel-host .duel-help-content{font-size:12px;line-height:1.7}
.duel-host .duel-help-content .session-message{font-size:16px;margin:12px 0}
@media(max-width:900px){
 body.duel-view .page{padding:0 4px 4px}
 body.duel-view .duel-host .shared-scorebar{height:38px;min-height:38px}
 body.duel-view .duel-host #turn-boards{--duel-main-width:210px;--duel-main-height:234px;--duel-preview-width:68px;--duel-preview-height:84px;--duel-gap:6px;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--duel-main-height) var(--duel-preview-height);grid-template-areas:'main' 'preview';justify-items:center;align-content:center;align-items:start}
 body.duel-view .duel-host #turn-boards>.board-card{grid-template-rows:20px minmax(0,1fr);padding:4px;gap:4px}
 body.duel-view .duel-host #turn-boards>.is-preview{grid-template-rows:14px minmax(0,1fr);padding:3px;gap:2px}
 body.duel-view .duel-host #turn-boards .board-heading{height:20px}
 body.duel-view .duel-host #turn-boards .is-preview .board-heading{height:14px}
 body.duel-view .duel-host #turn-boards .is-preview .board-heading h2{line-height:14px}
 body.duel-view .duel-host #turn-boards .board-footer{display:none!important}
 body.duel-view .duel-host .duel-rules-area{flex-basis:32px;height:32px;margin-top:2px}
 body.duel-view .duel-host .duel-rules>summary{height:30px;padding:2px 130px 2px 8px;line-height:26px;font-size:11px}
 body.duel-view .duel-host .duel-rules-area .result-reopen{top:2px;font-size:10px}
}
@media(max-width:900px) and (max-height:540px){
 body.duel-view .site-header{height:32px;min-height:32px;padding:2px 6px}
 body.duel-view .game-picker-toggle{height:22px;min-height:22px;margin:2px auto;padding:1px 8px;font-size:9px}
 body.duel-view #game-picker{margin:0 0 2px;gap:0}
 body.duel-view #game-picker .game-picker-row{padding:9px 2px 3px;gap:4px}
 body.duel-view #game-picker .game-tab{min-height:24px;padding:2px 6px}
 body.duel-view .duel-host .settings{padding:2px;gap:3px}
 body.duel-view .duel-host .settings select,body.duel-view .duel-host .main-actions button{height:26px;min-height:26px;font-size:10px}
 body.duel-view .duel-host .sticky-panel{padding:2px 0}
 body.duel-view .duel-host .shared-scorebar{height:32px;min-height:32px}
 body.duel-view .duel-host .shared-clock>b{font-size:22px}
}

@media(min-width:901px){
 body.duel-view{height:auto;min-height:100dvh}
 body.duel-view .page,body.duel-view .duel-host,body.duel-view .duel-host .duel-page,body.duel-view .duel-host .duel-play-area{flex:none}
 body.duel-view .duel-host #turn-boards{flex:none;height:var(--duel-main-height);grid-template-rows:var(--duel-main-height)}
 body.duel-view .duel-host .duel-rules-area{height:auto;flex:none;margin-top:10px}
 body.duel-view .duel-host .duel-rules>summary{height:auto;min-height:38px;padding-top:7px;padding-bottom:7px}
}

@media(max-width:900px){
 body.duel-view{height:auto;min-height:100dvh;scrollbar-gutter:stable}
 body.duel-view .page,body.duel-view .duel-host,body.duel-view .duel-host .duel-page,body.duel-view .duel-host .duel-play-area{flex:none}
 body.duel-view .duel-host #turn-boards{flex:none;height:calc(var(--duel-main-height) + var(--duel-preview-height) + var(--duel-gap));align-content:start}
 body.duel-view .duel-host .duel-rules-area{height:auto;flex:none}
}
