/* ProMixTra Arena — the board owns the screen. */
:root{--arena:#071e2c;--arena-line:#8bdddc24;--board-size:min(calc(100vw - 20px),calc(100dvh - 190px))}
body{background:var(--arena);color:#eaf5f7;min-height:100dvh;overflow-x:hidden}
.arena-background{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden;background:radial-gradient(ellipse at 12% 15%,#008e8d38,transparent 50%),radial-gradient(ellipse at 85% 90%,#42d3cc16,transparent 45%),linear-gradient(130deg,#061924,#102e42 65%,#09242e)}
.arena-background:before{content:'';position:absolute;inset:0;opacity:.18;background-image:linear-gradient(#96e9e512 1px,transparent 1px),linear-gradient(90deg,#96e9e512 1px,transparent 1px);background-size:70px 70px;mask-image:linear-gradient(90deg,black,transparent 50%,black)}
.arena-background:after{content:'';position:absolute;right:-4vw;bottom:-6vh;width:40vw;height:85vh;background:url('assets/nw.webp') no-repeat center/contain;opacity:.065;filter:grayscale(1)}
.arena-wordmark{position:absolute;left:4vw;top:42%;font-size:clamp(48px,9vw,160px);font-weight:800;letter-spacing:-.065em;color:#d9eeef0a;transform:rotate(-90deg);transform-origin:center;white-space:nowrap;left:-13vw;user-select:none}
.arena-wordmark span{color:#42d3cc18}.arena-line{position:absolute;left:25px;bottom:22px;color:#8baab950;font-size:9px;letter-spacing:4px}
header{height:64px;padding:0 24px;gap:28px;background:#f8fcfafa;border-bottom:1px solid #c4dfe1;box-shadow:0 4px 28px #0002;color:var(--ink)}
.brand>img{width:150px;height:auto}.brand small{font-size:7px;letter-spacing:2px;margin-top:4px}
.live-status{font-size:11px;color:#466a7c;display:flex;align-items:center;gap:8px}.live-status i{width:6px;height:6px;background:var(--teal);border-radius:50%}
.arena-nav{margin-left:auto;display:flex;gap:9px}.arena-nav button{height:40px;min-height:40px;border-radius:11px;padding:8px 14px;font-size:11px}.arena-nav .primary{min-width:130px;box-shadow:0 4px 12px #007f8724}.icon-button{display:flex;align-items:center;justify-content:center;gap:7px;border:1px solid #d6e6e8;background:white}.arena-nav #legend-open{font-size:19px}.icon-button span{font-size:10px}.arena-nav #fullscreen{font-size:23px;padding:2px 11px}.arena-nav .gear{width:43px;padding:9px}.gear svg{width:22px;height:22px;flex:none}.icon-button:hover{border-color:var(--teal);background:#e4f7f3}
main{max-width:none;margin:0;padding:8px 10px 6px;min-height:calc(100dvh - 64px);display:flex;align-items:center;justify-content:center}
.intro,footer,.quote-card{display:none!important}
.workspace{display:block;width:auto;margin:0;max-width:none}
.play-area{max-width:none;width:var(--board-size);position:relative;display:grid;grid-template-rows:42px auto 42px 36px;gap:2px;margin:auto}
.board-frame{width:var(--board-size);height:var(--board-size);padding:20px;border-radius:15px;background:linear-gradient(135deg,#1f4656,#0c293a);border:1px solid #60929560;box-shadow:0 24px 70px #0005,0 0 40px #42d3cc09,inset 0 1px 0 #a3eeec36}
.board{width:100%;height:100%;border:1px solid #72999d;aspect-ratio:1;box-shadow:0 0 0 2px #061e2a;overflow:visible}
.square{background:#e3edea}.square.dark{background:#6b969e}.board.preview .square:hover{background:#e3edea}.board.preview .square.dark:hover{background:#6b969e}.square:hover{background:#c3e9db}.square.last{background:#b6ddc7}.square.dark.last{background:#5eb7a9}.square.selected{background:#55d6bc}.square.check{background:#e59891}.square:focus-visible{outline:3px solid #ffe28d;outline-offset:-3px;z-index:4}
.piece{width:91%;height:93%}.piece img{filter:drop-shadow(0 3px 2px #07192766)}.piece:before{height:11%;bottom:1%;width:60%}.piece .piece-letter{font-size:10px;line-height:15px;min-width:15px;right:0;bottom:0;border-radius:4px;box-shadow:0 1px 3px #0003}.piece.black:before{border-color:#83e8dc}
.square .rank,.square .file{color:#b9d7dc;font-size:10px}.square .rank{left:-15px}.square .file{bottom:-18px}
.player-row{height:42px;gap:9px;margin:0;padding:0 3px;min-width:0}.avatar{height:31px;width:31px;font-size:17px;border-radius:9px;background:#eff8f3;color:#284d59;border-color:#a9d8d455}.avatar.black{background:#14293b;border-color:#80c1c77d;color:#c6edea}.player-info{line-height:1.25;min-width:0}.player-name{font-size:11px;color:#eaf4f3;max-width:210px}.player-meta{font-size:8px;color:#95b7c3;height:16px}.captured-small{width:12px;height:15px}.active-dot{background:#55e4c3;box-shadow:0 0 12px #55e4c366}.clock{min-width:92px;padding:5px 12px;font-size:20px;border-color:#739b9f40;background:#123447;color:#aac8ce;border-radius:9px}.clock.active{background:#e8fff7;color:#075c62;border-color:#6ee4c7;box-shadow:0 0 17px #42d3cc15}.clock.low{color:#ffd3c9;background:#682f31;border-color:#ea9e8e}
.board-tools{height:36px;margin:0;gap:6px;flex-wrap:nowrap;justify-content:center}.board-tools button{color:#9bc4cc;min-height:34px;height:34px;padding:5px 9px;background:#d4fbfa07;border:1px solid #b2e5e719;border-radius:8px}.board-tools button:hover{color:white;background:#42d3cc18}.board-tools button span{font-size:9px;margin-left:4px}.board-tools>span{display:none}
dialog{color:var(--ink)}dialog::backdrop{background:#02131aa8;backdrop-filter:blur(7px)}
.settings-drawer{margin:0 0 0 auto;inset:0 0 0 auto;width:min(420px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;border-radius:22px 0 0 22px;padding:25px 23px 20px;background:#f5f9fa;border:0;border-left:1px solid #c6e5e8;overflow-y:auto;overscroll-behavior:contain;box-shadow:-20px 0 90px #00152266}
.drawer-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:21px}.drawer-heading .panel-kicker{font-size:8px;letter-spacing:1.6px}.drawer-heading h2{font-size:21px;margin:6px 0}.drawer-close{min-height:38px;width:38px;font-size:25px;line-height:1;padding:0;border-radius:50%;flex:none}.settings-drawer aside{display:block}.settings-drawer .panel{border:1px solid #d6e5e7;padding:21px;border-radius:17px;box-shadow:0 5px 20px #16324706}.settings-drawer .panel h2{font-size:22px}.settings-drawer .setup-note{font-size:9px}.drawer-links{display:flex;gap:18px;justify-content:center;margin-top:15px}.drawer-links button{font-size:10px}.settings-drawer .history{height:clamp(130px,25vh,260px)}
.legend-dialog{width:min(780px,calc(100vw - 24px));max-width:780px;max-height:calc(100dvh - 28px);padding:30px;border-radius:22px;background:#f6fafb;overflow-y:auto}.legend-dialog .collection{display:block;padding:0;margin:20px 0;border:0}.legend-dialog .collection-title{display:none}.legend-dialog .pieces-legend{grid-template-columns:repeat(3,1fr);gap:12px}.legend-dialog .legend-item{background:white;border:1px solid #d5e8e8;padding:15px 12px 12px;border-radius:13px}.legend-dialog .legend-item img{height:100px;width:100%;max-width:100%;margin-bottom:10px}.legend-dialog .legend-item strong{font-size:13px}.legend-dialog .value{font-size:9px;color:var(--teal);margin:4px 0}.legend-dialog .legend-item p{font-size:10px;line-height:1.6;margin:8px 0 0;color:#577080}.legend-dialog h2{font-size:26px}
#toast{background:#ecfff8;color:#154b52;border:1px solid #9adcca;box-shadow:0 8px 25px #0005}
@media(min-width:800px) and (min-aspect-ratio:6/5){
 :root{--board-size:min(calc(100vw - 330px),calc(100dvh - 86px))}
 main{padding:10px 160px 12px}.play-area{display:block}.board-frame{padding:20px}
 .player-row{position:absolute;right:-151px;width:135px;height:auto;display:grid;grid-template-columns:31px 1fr;gap:10px 7px;padding:13px 10px;background:#ffffff05;border:1px solid #9cdddb25;border-radius:14px;backdrop-filter:blur(10px)}
 #top-player{top:0}#bottom-player{bottom:0}.player-name{font-size:10px;max-width:79px;white-space:normal;overflow-wrap:anywhere}.player-meta{flex-wrap:wrap;height:auto;min-height:17px}.clock{grid-column:1/-1;width:100%;min-width:0;font-size:24px;padding:9px 5px;margin:0}.player-info{align-self:center}.active-dot{margin-right:4px}
 .board-tools{position:absolute;left:-147px;top:50%;transform:translateY(-50%);height:auto;width:130px;display:flex;flex-direction:column;gap:10px}.board-tools button{width:100%;height:43px;text-align:left;padding:8px 12px;background:#ffffff05}.board-tools button span{font-size:10px}
}
@media(min-width:1600px){header{padding:0 32px}.brand>img{width:174px}.arena-wordmark{left:-11vw}.piece .piece-letter{font-size:12px;line-height:18px;min-width:18px}}
@media(max-width:650px){header{height:58px;padding:0 10px;gap:7px}.brand>img{width:113px}.brand small{font-size:5.5px;letter-spacing:1.2px}.live-status{display:none}.arena-nav{gap:5px}.arena-nav button{height:38px;min-height:38px;padding:5px 9px;font-size:10px;border-radius:9px}.arena-nav .primary{min-width:0}.arena-nav .gear{width:36px;padding:7px}.icon-button span{display:none}.arena-nav #legend-open{font-size:20px;padding:3px 9px}.arena-nav #fullscreen{padding:1px 7px}.gear svg{height:21px;width:21px}main{min-height:calc(100dvh - 58px);padding:6px 10px}.arena-line{display:none}.board-frame{padding:16px;border-radius:12px}.square .rank{left:-12px;font-size:8px}.square .file{bottom:-15px;font-size:8px}.piece .piece-letter{font-size:8px;line-height:11px;min-width:11px}.legend-dialog{padding:25px 17px}.legend-dialog .pieces-legend{grid-template-columns:repeat(2,1fr)}.legend-dialog .legend-item img{height:94px}.legend-dialog h2{font-size:22px}.settings-drawer{padding:20px 16px}.arena-wordmark{display:none}.arena-background:after{width:85vw;height:65vh;right:-20vw}}
@media(max-width:370px){header{padding:0 7px}.brand>img{width:95px}.brand small{font-size:5px}.arena-nav{gap:4px}.arena-nav #fullscreen{display:none}.player-name{max-width:155px}}
@media(max-height:500px) and (min-aspect-ratio:6/5){header{height:48px}.brand>img{width:115px}.brand small{display:none}:root{--board-size:min(calc(100vw - 200px),calc(100dvh - 64px))}main{min-height:calc(100dvh - 48px);padding:6px 96px}.play-area{display:block}.board-frame{padding:14px}.square .rank{left:-11px;font-size:8px}.square .file{bottom:-13px;font-size:8px}.player-row{position:absolute;right:-89px;width:82px;height:auto;display:flex;flex-wrap:wrap;gap:5px;padding:5px}#top-player{top:0}#bottom-player{bottom:0}.player-row .avatar{display:none}.player-name{font-size:9px;max-width:80px;white-space:normal}.player-meta{font-size:7px}.clock{font-size:18px;min-width:76px;padding:6px;margin:0}.board-tools{position:absolute;left:-91px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;width:84px;height:auto;gap:5px}.board-tools button{padding:4px;width:84px;height:34px}.board-tools button span{font-size:8px}.piece .piece-letter{font-size:7px;line-height:10px;min-width:10px}}

body{isolation:isolate}
.drawer-preferences{display:flex;gap:9px;margin-top:16px}.drawer-preferences button{flex:1;font-size:12px;background:white;border:1px solid #d5e6e7;border-radius:10px}.drawer-preferences button span{font-size:10px;margin-left:5px}
.board-tools #history-open{font-size:10px}

.three-preview-link{display:block;margin:16px 0 5px;padding:13px 14px;border-radius:10px;background:#e4f6ef;border:1px solid #b1dcd2;font-size:11px;color:#006c70;text-align:center;text-decoration:none}
