:root{font:16px/1.5 system-ui,sans-serif;color:#163e39;background:#f2f9f5}*{box-sizing:border-box}body{margin:0}header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px max(14px,env(safe-area-inset-left));background:#103f39;color:#fff}header a{color:#fff}main{max-width:1150px;margin:auto;padding:20px}h1{font-size:clamp(32px,6vw,55px);line-height:1.12;margin:16px 0}h2{margin:8px 0;font-size:22px}a{color:#087d70}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button,.sports a{border:1px solid #b9d5cc;border-radius:14px;padding:12px 16px;background:#fff;color:#174b43;cursor:pointer;min-height:44px}button:disabled{opacity:.48;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #eaa529;outline-offset:2px}.primary,button[aria-pressed=true]{background:#087d70;color:white;border-color:#087d70}.eyebrow{letter-spacing:.12em;font-size:12px;font-weight:800}.sports,.actions,.options,.game-top{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.sports{margin:24px 0}.sports a{text-decoration:none}.panel{background:#fff;border:1px solid #c8dcd3;border-radius:24px;padding:24px;margin:18px 0}.options{align-items:end;margin:18px 0}label{display:grid;gap:5px;margin:10px 0}input,select{padding:10px;border:1px solid #b9d5cc;border-radius:10px;max-width:100%;min-width:0;background:white;color:#143e36}.muted{color:#58756d;font-size:13px}.room-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #c8dcd3;padding:14px 0}.room-row span{overflow-wrap:anywhere}#notice{padding:8px;overflow-wrap:anywhere}footer{font-size:12px;padding:12px 0}dialog{width:min(480px,calc(100% - 28px));max-height:90dvh;overflow:auto;border:1px solid #b9d5cc;border-radius:22px;padding:24px;color:#143e36}dialog::backdrop{background:#001c23b8}[hidden]{display:none!important}
body.playing{background:#102d29;color:#e8f7ef}body.playing main{max-width:1300px;padding:10px}body.playing footer{display:none}body.playing #notice{margin:0;font-size:13px}body.playing header{padding-block:6px}body.playing a{color:#b3e3d5}.game-top{margin-bottom:8px}.game-top button{padding:7px 12px}.play-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,300px);gap:16px;align-items:start}#surface{min-width:0;display:flex;justify-content:center}#chess-table{width:min(100%,calc(100dvh - 220px));min-width:180px}#board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;touch-action:none;border:3px solid #abc6b3}#board button{position:relative;min-height:0;min-width:0;padding:0;border:0;border-radius:0;background:#ececde;aspect-ratio:1;display:grid;place-items:center;color:#153c30}#board button.dark{background:#367855}#board img{width:95%;height:95%;pointer-events:none}#board .selected{box-shadow:inset 0 0 0 4px #f1c952}#board .legal:after{content:'';position:absolute;width:23%;height:23%;border-radius:100%;background:#132e3880}#board .coordinate{position:absolute;left:2px;bottom:0;font-size:clamp(8px,1.1vw,12px);font-weight:bold}.player{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 0;font-size:14px}.clock{min-width:84px;font-variant-numeric:tabular-nums}.clock.running{background:#f5d269;color:#142e28;opacity:1}.history{display:grid;gap:4px;width:100%;text-align:left;margin-top:12px}.history span{font-size:12px}#press-clock{width:100%;font-weight:800;margin:10px 0}#court{width:min(100%,calc((100dvh - 165px)*.9));max-height:calc(100dvh - 165px);aspect-ratio:9/10;object-fit:contain;border:1px solid #72b09c;border-radius:16px;touch-action:none;background:#143d37}.dpad{display:grid;grid-template-columns:repeat(3,52px);gap:6px;justify-content:center;margin:10px 0}.dpad [data-move=up]{grid-column:2}.dpad [data-move=left]{grid-column:1}.dpad button,[data-shot],[data-lion]{touch-action:none;user-select:none}.dpad button.held{background:#e5bb53}#roster{font-size:13px}#score{font-variant-numeric:tabular-nums;font-size:19px;font-weight:700}#beat{font-size:14px}body.playing .muted{color:#abc7bf}aside button{padding:8px 12px}#history ol{padding-left:32px}
@media(max-width:700px) and (orientation:portrait){main{padding:16px}.panel{padding:18px}.play-layout{display:flex;flex-direction:column;gap:8px}#surface{width:100%}#chess-table{width:min(100%,calc(100dvh - 320px))}#court{width:min(100%,calc((100dvh - 335px)*.9));max-height:46dvh}aside{width:100%}aside h2{font-size:17px;margin:0}#roster{display:flex;gap:10px;flex-wrap:wrap}.dpad{float:left;margin:5px 14px 5px 0;grid-template-columns:repeat(3,44px)}#padel-controls .actions{padding-top:4px}#padel-controls label{margin:5px 0}.game-top{gap:5px;font-size:12px}.game-top button{font-size:12px;min-height:36px;padding:6px 9px}.history{margin:5px 0;padding:6px 12px}.history span{display:none}.options{display:block}.sports{gap:6px}.sports button,.sports a{padding:10px}#chess-actions .actions button{min-height:36px;font-size:12px;padding:5px 10px}#status{overflow-wrap:anywhere}#score{margin:3px 0}body.playing .muted{font-size:11px;margin:4px 0}}
@media(orientation:landscape) and (max-height:600px){header{font-size:12px}body.playing main{padding:5px 10px}.game-top{margin:0 0 4px}.game-top button{min-height:30px;font-size:12px;padding:4px 8px}.play-layout{grid-template-columns:minmax(0,1fr) 280px;gap:12px}#chess-table{width:calc(100dvh - 155px)}#court{width:calc((100dvh - 100px)*.9);max-height:calc(100dvh - 100px)}.player{padding:2px 0;font-size:12px}.clock{min-height:30px;padding:2px 8px}aside{max-height:calc(100dvh - 100px);overflow:auto}aside h2{font-size:16px}.muted{font-size:11px}.dpad{float:left;margin:4px 10px 4px 0;grid-template-columns:repeat(3,38px)}.dpad button{padding:2px;min-height:34px}.history{padding:6px}.history span{display:none}}
body{min-height:100dvh}
@media(max-width:700px) and (orientation:portrait){body.playing #court{width:min(100%,calc((100dvh - 420px)*.9));max-height:42dvh}body.playing #roster{font-size:11px}.game-top #mode-label{flex:1;min-width:150px}.game-top button{min-height:34px}#sound,#haptic{font-size:11px}}
@media(max-width:700px) and (orientation:portrait){body.playing[data-sport=padel] #court{width:min(100%,max(175px,calc((100dvh - 525px)*.9)));max-height:38dvh}body.playing[data-sport=padel] #score{font-size:15px}body.playing[data-sport=padel] .game-top{gap:4px}.game-top #mode-label{min-width:0;font-size:11px}body.playing header button{padding:6px 10px;font-size:12px}body.playing header{font-size:13px}}
.game-menu{position:relative;margin-left:auto;font-size:12px}.game-menu summary{cursor:pointer;padding:8px;border:1px solid #83aaa0;border-radius:10px}.game-menu>div{position:absolute;right:0;top:100%;z-index:5;width:200px;display:grid;gap:8px;background:#143e36;border:1px solid #8fbcac;padding:10px;border-radius:12px}.game-menu button{width:100%}
@media(orientation:landscape) and (max-height:600px){body.playing #score{font-size:14px;line-height:1.3;margin:4px 0}body.playing #roster{font-size:11px;margin:4px 0}aside button{font-size:12px;padding:5px 9px;min-height:32px}aside .muted{display:none}aside label{font-size:12px;line-height:1.2;margin:6px 0}aside input[type=range]{height:25px;padding:0}#padel-controls .actions{gap:5px;padding-top:5px}#padel-controls label{clear:both}#status{line-height:1.3;font-size:15px}}
@media(orientation:landscape) and (max-height:600px){#court{width:calc((100dvh - 130px)*.9);max-height:calc(100dvh - 130px)}#chess-table{width:calc(100dvh - 180px)}aside{max-height:calc(100dvh - 130px)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
