@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#eef4e8;background:#111b18;color-scheme:dark}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 45% 25%,#243a2e 0,transparent 65%)}button,input{font:inherit}button{border:1px solid #64766a55;background:#ffffff07;color:#edf4e8;border-radius:7px;padding:10px 17px;cursor:pointer}button:hover{background:#ffffff16}button:disabled{opacity:.4;cursor:default}button:focus-visible,summary:focus-visible{outline:2px solid #d6f095}header{display:flex;align-items:center;gap:15px;padding:24px 4vw;border-bottom:1px solid #ffffff12}.brand{font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:30px;letter-spacing:-1.5px;text-decoration:none;color:#f0f3e6}.brand span{font-weight:400;color:#aab9a9}.brand i{font-size:16px;margin-left:7px;color:#d6f095}.edition{font-size:12px;letter-spacing:2px;color:#9eafa2;flex:1;margin-left:20px}main{max-width:1480px;margin:auto;padding:32px 4vw}.top{display:flex;justify-content:space-between;gap:30px;align-items:center;margin-bottom:30px}.eyebrow{font-size:12px;letter-spacing:3px;color:#d6f095;margin:0 0 10px}h1{font-family:'Space Grotesk',sans-serif;font-size:clamp(25px,3vw,43px);letter-spacing:-1.5px;line-height:1.1;margin:0;font-weight:500}.pair{display:grid;grid-template-columns:1fr auto;gap:8px 25px;max-width:510px;padding:18px 22px;border:1px solid #657c6155;background:#0d171677;border-radius:10px}.pair strong{color:#d6f095;font-size:22px;letter-spacing:4px;grid-row:1/3;grid-column:2;align-self:center}.pair span{font-size:14px}.pair small{grid-column:1/3;color:#91a597;font-size:12px}.arena{background:#091411;border:1px solid #8aa58d33;padding:18px 26px;border-radius:14px;box-shadow:0 30px 70px #0004}.table-top,.table-bottom{display:flex;justify-content:space-between;gap:15px;color:#97ac9c;font-size:12px;letter-spacing:1px}.table-top{margin-bottom:12px}.table-bottom{margin-top:12px;letter-spacing:0;font-size:14px}.table-wrap{max-width:1100px;margin:auto}canvas{width:100%;display:block;touch-action:none}footer{display:flex;justify-content:space-between;gap:25px;margin-top:22px;align-items:flex-start}.controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}label{font-size:14px;color:#a7b8a9}input{accent-color:#d6f095;vertical-align:middle}.primary{background:#d6f095;color:#182518;font-weight:700}.primary:hover{background:#e4ffa6}details{max-width:450px;font-size:14px}summary{cursor:pointer}summary span{font-size:11px;color:#a1b294;margin-left:12px}details p,small{color:#96aa9e;line-height:1.6}.be-head-tracking{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.be-head-tracking small{width:100%}.be-head-tracking label,.be-head-tracking [data-head-center]{display:none}.calibration{position:fixed;inset:0;background:#101917f5;z-index:10;display:grid;place-items:center}.calibration[hidden]{display:none}.calibration .dot{position:absolute;width:24px;height:24px;border-radius:50%;background:#d6f095;box-shadow:0 0 0 12px #d6f09522;transform:translate(-50%,-50%)}.calibration .instructions{position:absolute;bottom:12px;text-align:center}#eye-controls>button{margin-top:8px}@media(max-width:800px){header{padding:16px}.edition{display:none}header .brand{flex:1}.top{align-items:stretch;flex-direction:column}main{padding:22px 12px}.pair{max-width:none}.arena{padding:12px 7px}.table-bottom{font-size:12px}footer{flex-direction:column}h1 br{display:none}header button{padding:8px;font-size:12px}}

#gaze-help{color:#e5f6bb;background:#d6f09510;border-left:3px solid #d6f095;padding:12px;line-height:1.5}#eye-panel[open]{border:1px solid #d6f09555;padding:14px;border-radius:8px}

main{max-width:none;padding:18px 3vw}.top{margin-bottom:16px}h1{font-size:30px}.table-wrap{max-width:none}canvas{height:clamp(430px,60vh,850px);width:100%;border-radius:8px}.view-controls{display:flex;gap:10px;align-items:center;margin-bottom:12px}.view-controls span{margin-left:auto;font-size:13px;color:#9fb1a3}.view-controls button{padding:8px 12px;font-size:14px}.arena{padding:14px 18px}.pair{padding:12px 18px}header{padding:16px 3vw}@media(max-width:800px){.view-controls span{display:none}.top h1{display:none}.top .eyebrow{display:none}.top{gap:0}canvas{height:55vh}.arena{padding:10px 6px}}

.pair{position:relative;padding-right:150px;min-height:138px;max-width:650px}#pair-qr{position:absolute;right:10px;top:10px;width:118px;height:118px;border-radius:6px}.view-controls{flex-wrap:wrap}.be-head-tracking [data-head-center]{display:block}@media(max-width:800px){.pair{padding-right:140px}.pair strong{letter-spacing:1px;font-size:18px}.view-controls button{font-size:12px;padding:7px}}

@media(max-width:800px){.view-controls #tracking-status{display:block;width:100%;margin-left:0;font-size:12px}}
.telemetry{margin:24px 0;padding:24px;background:#10262d;border:1px solid #31505a;border-radius:20px}.telemetry-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.telemetry h2{margin:5px 0 18px}.telemetry-heading>span{color:#b6f46a}.telemetry-visuals{display:grid;grid-template-columns:1fr 1fr;gap:20px}.telemetry canvas{width:100%;height:220px;display:block;border-radius:12px;background:#0b1d23}.telemetry p{font-size:12px;color:#a9c4c8}.telemetry-values{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin:20px 0}.telemetry-values div{background:#0b1d23;padding:12px;border-radius:8px}.telemetry-values span{display:block;color:#a9c4c8;font-size:11px;margin-bottom:7px}.telemetry-values strong{font-size:16px}.telemetry pre{max-height:360px;overflow:auto;font-size:12px}.telemetry details{margin-top:16px}@media(max-width:800px){.telemetry-visuals{grid-template-columns:1fr}.telemetry-values{grid-template-columns:repeat(2,1fr)}.telemetry-heading{display:block}}
.test-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0}.test-controls span{color:#b6f46a;font-size:14px}button:disabled{opacity:.45;cursor:default}#stroke-test .telemetry-visuals canvas{height:260px}#stroke-test{scroll-margin-top:20px}

.table-wrap{position:relative}.tip-preview{position:absolute;right:16px;bottom:16px;display:grid;justify-items:center;gap:8px;width:180px;padding:14px;background:#102631e8;border:1px solid #5ad9f366;border-radius:16px;pointer-events:none}.tip-ball{position:relative;width:104px;height:104px;border-radius:50%;background:radial-gradient(circle at 35% 25%,#fff 0%,#fdf6df 45%,#aeb8b8 100%);box-shadow:inset -5px -6px 12px #0004,0 3px 10px #0005}.tip-cross:before,.tip-cross:after{content:"";position:absolute;background:#24374440;left:50%;top:50%}.tip-cross:before{width:82px;height:1px;transform:translate(-50%,-50%)}.tip-cross:after{width:1px;height:82px;transform:translate(-50%,-50%)}#tip-dot{position:absolute;left:calc(50% - 6px);top:calc(50% - 6px);width:12px;height:12px;border-radius:50%;background:#ff4386;border:2px solid white;box-shadow:0 0 0 2px #6b123c}.tip-preview strong{font-size:13px;color:#fff;display:flex;align-items:center;justify-content:center;text-align:center;width:100%;height:36px;line-height:18px;overflow:hidden}.tip-preview small{font-size:11px;line-height:1.5;text-align:center;color:#bdd7e0}@media(max-width:650px){.tip-preview{transform:scale(.75);transform-origin:bottom right;right:8px;bottom:8px}}

#movement-diagnostics{margin-bottom:16px}#movement-diagnostics>summary{cursor:pointer;color:#a9c2c8;font-size:13px;padding:10px 0}#movement-diagnostics[open]>summary{margin-bottom:8px}

/* Let the table own the screen; pairing sits over its center. */
header{padding:8px 16px;gap:12px;height:58px}.brand{font-size:25px}.edition{font-size:10px;margin-left:8px}header button{padding:7px 12px}main{padding:6px 10px 12px;max-width:none}.arena{padding:8px;border-radius:10px}.table-top{margin-bottom:6px;font-size:11px}.view-controls{gap:7px;margin-bottom:7px}.view-controls button{padding:6px 10px;font-size:12px}#table{height:calc(100dvh - 210px);min-height:360px;max-height:none}.table-bottom{margin-top:7px;font-size:12px}footer{margin-top:10px;gap:12px}footer button{padding:7px 12px}#movement-diagnostics{max-width:none;margin:6px 0 0}#movement-diagnostics>summary{padding:5px 0;font-size:12px}
#pair-overlay{position:absolute;inset:0;z-index:3;display:grid;place-items:center;background:#06120d55;border-radius:8px;padding:14px}#pair-overlay[hidden]{display:none}#pair-overlay .pair{display:flex;flex-direction:column;align-items:center;gap:10px;position:static;max-width:560px;width:min(100%,560px);min-height:0;padding:22px 30px;border-radius:20px;background:#0c201df5;border:1px solid #c9ed9566;box-shadow:0 20px 80px #0008;text-align:center}#pair-overlay #pair-qr{position:static;width:clamp(160px,29vh,320px);height:clamp(160px,29vh,320px);border-radius:12px;order:1}#pair-overlay #connection{order:0;font-size:22px;font-weight:600}#pair-overlay .room-label{order:2;font-size:11px;letter-spacing:3px;color:#aac4b8}#pair-overlay #code{order:3;font:700 clamp(28px,4vw,46px)/1.1 'Space Grotesk',monospace;letter-spacing:6px;color:#d6f095}#pair-overlay #address{order:4;font-size:14px}#pair-overlay small{order:5;font-size:12px}#pair-dismiss{order:6;font-size:12px;padding:6px 12px;margin-top:2px}
@media(max-width:800px){header{height:auto;min-height:54px;gap:7px;padding:8px}.brand{font-size:21px}header button{font-size:11px;padding:7px}main{padding:4px}.arena{padding:5px}.view-controls{gap:5px}.view-controls #tracking-status{display:none}#table{height:calc(100dvh - 220px);min-height:340px}#pair-overlay .pair{padding:14px;gap:7px}#pair-overlay #pair-qr{width:180px;height:180px}#pair-overlay #code{font-size:30px}.tip-preview{transform:scale(.75);transform-origin:bottom right}}
@media(max-height:650px) and (min-width:801px){#pair-overlay .pair{display:grid;grid-template-columns:auto 1fr;column-gap:22px;width:auto;max-width:650px;padding:18px}#pair-overlay #pair-qr{grid-column:1;grid-row:1/7;width:210px;height:210px}#pair-overlay #connection,#pair-overlay .room-label,#pair-overlay #code,#pair-overlay #address,#pair-overlay small,#pair-dismiss{grid-column:2}#pair-overlay #code{font-size:32px}}

.phone-state-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;padding:10px 14px;margin-top:6px;background:#102b36;border:1px solid #36515b;border-radius:10px;color:#fff}.phone-state-bar strong{color:#b6f46a}.phone-state-bar span{font-size:13px;color:#c3d6dd}

.arena > .controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 12px}.arena > .controls label{display:flex;align-items:center;gap:10px}#table{touch-action:none}

.select-contact .tip-ball{pointer-events:auto;cursor:crosshair}.select-contact .tip-preview small{font-size:0}.select-contact .tip-preview small:after{content:'Click to choose spin · double-click to center';font-size:11px}#table:focus-visible{outline:2px solid #b6f46a;outline-offset:2px}

header select{background:#1d2a25;color:#f1edda;border:1px solid #536052;border-radius:7px;padding:6px}header label{font-size:12px;display:flex;align-items:center;gap:6px}#rules-note{color:#c9c1a8;font-size:11px}

/* The opening screen keeps the room visible behind a quiet invitation to play. */
#welcome{padding:0;width:min(900px,92vw);max-height:92vh;border:1px solid #61705b;border-radius:24px;background:#101e19;color:#f3f0e5;box-shadow:0 35px 120px #000b;overflow:auto}
#welcome[open]{display:grid;grid-template-columns:.8fr 1.2fr}
#welcome::backdrop{background:#020b08c9;backdrop-filter:blur(8px)}
.welcome-art{position:relative;min-height:530px;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#335c43,#12281f 65%)}
.welcome-ball{position:absolute;width:190px;height:190px;top:31%;left:calc(50% - 95px);border-radius:50%;background:radial-gradient(circle at 30% 22%,#ffffffb0,transparent 40%),linear-gradient(#f3eedc 20%,#e8b52d 22%,#d6a022 76%,#e9e3d0 78%);box-shadow:inset -20px -22px 32px #0007,0 40px 30px -18px #000b;display:grid;place-items:center;transform:rotate(-18deg)}
.welcome-ball span{display:grid;place-items:center;width:65px;height:65px;border-radius:50%;background:#fff8e7;color:#151e19;font:bold 45px Georgia}
.welcome-cue{position:absolute;width:9px;height:650px;left:28%;top:61%;background:linear-gradient(90deg,#96723f,#e2c99b,#98733f);transform:rotate(30deg);transform-origin:top;border-radius:3px}
.welcome-copy{padding:48px 42px}.welcome-eyebrow{font-size:10px;letter-spacing:.25em;color:#b9c69c;margin:0 0 22px}
#welcome h1{font:normal clamp(36px,4vw,54px)/1.05 Georgia,serif;letter-spacing:-.035em;margin:0 0 20px}#welcome h1 em{color:#cee79d;font-weight:normal}
.welcome-intro{font-size:16px;line-height:1.65;color:#b9c6bd;margin-bottom:25px}
.welcome-games{display:flex;gap:10px}.welcome-games button{flex:1;text-align:left;padding:16px 14px;border-radius:12px;background:#172a22;border:1px solid #455346}.welcome-games strong{display:block;font-size:18px;margin-bottom:7px}.welcome-games span{display:block;font-size:11px;color:#b6c2b7}.welcome-games button[aria-pressed=true]{border-color:#c9e49d;background:#2c4028}
.welcome-control{display:flex;justify-content:space-between;align-items:center;margin:24px 0 18px;font-size:13px;color:#c9d2c7}.welcome-control select{padding:10px;border-radius:8px;background:#172a22;color:#e7eadc;border:1px solid #455346}
#welcome-start{width:100%;padding:15px;border-radius:10px;font-size:16px}.welcome-hint{font-size:11px;color:#a6b4a7;line-height:1.6;margin:16px 0 0}
@media(max-width:650px){#welcome[open]{grid-template-columns:1fr}.welcome-art{display:none}.welcome-copy{padding:30px 24px}}

#welcome-voice{background:transparent;border:0;color:#c8d4bf;font-size:12px;padding:0 0 14px;text-align:left;display:block}
.seated-view .tip-preview{display:none}
.view-controls button[aria-pressed="true"]{background:#dce9a0;color:#17281f;border-color:#dce9a0}
.match-caption{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);max-width:80%;padding:10px 18px;border-radius:8px;background:rgba(9,19,16,.86);color:#f2eadb;font-size:14px;text-align:center;pointer-events:none;z-index:4}

.referee-mic{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);z-index:8;width:54px;height:54px;border-radius:50%;background:#183c31;font-size:25px;border:1px solid #d9edaa}.referee-mic[hidden]{display:none}.referee-mic.listening{background:#9b3939;box-shadow:0 0 0 7px #f6d7b533}
.broadcast-score{display:grid;grid-template-columns:minmax(0,1fr) 125px minmax(0,1fr);align-items:stretch;max-width:1000px;margin:0 auto 18px;background:linear-gradient(#162b30,#0b171d);border:1px solid #52676d;border-bottom:3px solid #b6a16b;border-radius:5px;color:#f5f4ed;overflow:hidden;box-shadow:0 8px 20px #0003;font-variant-numeric:tabular-nums}.score-player{display:flex;align-items:center;gap:10px;padding:12px 18px;border-top:3px solid transparent}.score-player.active{border-top-color:#cbdc95;background:#213a3c}.score-player input{min-width:0;width:100%;background:transparent;border:0;color:inherit;font-size:20px;font-weight:600;padding:5px}.score-points{font-size:34px;min-width:50px;text-align:center;color:#f4df98}.score-turn{font-size:12px;color:#d6ec9c}.score-frames{display:flex;flex-direction:column;justify-content:center;align-items:center;background:#080e14;border-left:1px solid #58645b;border-right:1px solid #58645b;gap:3px}.score-frames small{font-size:9px;letter-spacing:2px;color:#bbc4b9}.score-frames strong{font-size:25px;white-space:nowrap}@media(max-width:700px){.broadcast-score{grid-template-columns:minmax(0,1fr) 80px minmax(0,1fr)}.score-player{gap:3px;padding:8px 5px}.score-player input{font-size:13px}.score-points{font-size:23px;min-width:28px}.score-frames strong{font-size:20px}.score-frames small{letter-spacing:.5px}}
body.immersive-game{overflow:hidden;background:#080e0c}.immersive-game>header,.immersive-game footer[hidden]{display:none}.immersive-game main{padding:0;margin:0;width:100%;height:100dvh}.immersive-game .arena{padding:0;border:0;border-radius:0;height:100dvh;background:#080e0c}.immersive-game .table-wrap{position:absolute;inset:0;max-width:none;width:100%;margin:0}.immersive-game #table{width:100%;height:100dvh;min-height:0;outline:none}.immersive-game .broadcast-score{position:absolute;z-index:3;top:14px;left:50%;transform:translateX(-50%);width:min(760px,calc(100% - 150px));margin:0;pointer-events:auto;background:#101e23e8}.immersive-game .score-player{padding:6px 12px}.immersive-game .score-points{font-size:27px}.immersive-game .score-player input{font-size:17px}#game-menu-toggle{position:fixed;right:16px;top:16px;z-index:10;width:46px;height:44px;padding:0;border-radius:9px;background:#10211ce8;font-size:24px;color:#ebeedf}#game-menu{position:fixed;inset:0 0 0 auto;margin:0;padding:20px;width:min(430px,100vw);height:100dvh;max-height:none;border:0;border-left:1px solid #81957a55;background:#101d19;color:#eef4e8;overflow:auto;box-sizing:border-box}#game-menu::backdrop{background:#0005}#game-menu .game-menu-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;font-size:22px}#game-menu .game-menu-heading button{font-size:26px;padding:2px 14px}#game-menu section{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:22px}#game-menu h2{width:100%;font-size:11px;letter-spacing:.15em;text-transform:uppercase;color:#a8bb9e;margin:0 0 4px}#game-menu .view-controls,#game-menu .controls{display:flex;flex-wrap:wrap;gap:9px;margin:0}#game-menu button{min-height:40px}#game-menu .referee-mic{position:static;transform:none;width:auto;border-radius:8px;font-size:15px;padding:9px 14px}#game-menu details{max-width:100%;width:100%}#game-menu .table-top,#game-menu .table-bottom,#game-menu .phone-state-bar{display:flex;flex-wrap:wrap;font-size:12px;width:100%;margin:0}#game-menu .table-top{line-height:1.8}#game-menu .phone-state-bar{padding:9px}#game-menu #movement-diagnostics{width:100%;overflow:auto}#game-menu input[type=range]{max-width:180px}.immersive-game .tip-preview{bottom:14px;right:14px;transform:scale(.8);transform-origin:bottom right}@media(max-width:650px){.immersive-game .broadcast-score{left:8px;transform:none;width:calc(100% - 75px);top:8px;grid-template-columns:minmax(0,1fr) 65px minmax(0,1fr)}.immersive-game .score-player{padding:4px}.immersive-game .score-player input{font-size:12px}.immersive-game .score-points{font-size:21px;min-width:22px}#game-menu-toggle{top:8px;right:8px}}
#game-menu-toggle.referee-waiting{border-color:#d6ec9c;box-shadow:0 0 0 3px #d6ec9c33}.referee-connected #game-menu-toggle:after{content:'';position:absolute;right:4px;top:4px;width:7px;height:7px;border-radius:50%;background:#ed795b}.referee-library{width:100%}.referee-library audio{height:35px;margin:5px 0 12px}.referee-library label{display:block;width:100%}

#mouse-shot-controls{position:absolute;z-index:4;bottom:24px;left:50%;transform:translateX(-50%);padding:14px 18px;border:1px solid #b9ce9d55;border-radius:14px;background:#10211ced;box-shadow:0 8px 30px #0005;max-width:calc(100vw - 32px);backdrop-filter:blur(12px)}
#mouse-shot-controls[hidden]{display:none}#mouse-shot-controls .controls{flex-wrap:nowrap;gap:18px}#mouse-shot-controls label{display:flex;align-items:center;gap:10px;white-space:nowrap;color:#e4eddf}#mouse-shot-controls input{width:clamp(100px,16vw,240px)}#mouse-shot-controls output{min-width:4ch;font-variant-numeric:tabular-nums;color:#d6f095}#mouse-shot-controls #shoot{min-width:100px;min-height:44px}#mouse-shot-controls #gaze-lock{display:none}#mouse-shot-controls small{display:block;margin-top:9px;font-size:11px;text-align:center;color:#b0c0b4}#game-menu output{margin-left:6px}
@media(max-width:650px){#mouse-shot-controls{left:12px;right:12px;bottom:12px;transform:none;max-width:none;padding:10px}#mouse-shot-controls .controls{justify-content:space-between;gap:8px}#mouse-shot-controls label{gap:6px;font-size:12px}#mouse-shot-controls #shoot{min-width:75px}body.select-contact .tip-preview{bottom:110px}}

#game-menu #game-voice{display:block;margin-top:8px;width:100%;max-width:355px;padding:10px;background:#1b3027;color:#eef4e8;border:1px solid #64766a77;border-radius:8px}#game-menu section:has(#game-voice) label{width:100%}#game-menu section:has(#game-voice) small{width:100%}
/* Player-facing pause menu */
#welcome .welcome-control[hidden],#game-menu [hidden]{display:none!important}
#game-menu{width:min(460px,100vw);padding:28px;background:linear-gradient(155deg,#18362d,#0b1815 70%);border-left:1px solid #c5d19b44;box-shadow:-20px 0 80px #0006}
#game-menu .game-menu-heading{font-family:Georgia,serif;font-size:30px;color:#eef1dc;border-bottom:1px solid #c5d19b33;padding-bottom:20px}
#game-menu section{padding:16px;background:#ffffff04;border:1px solid #ffffff0c;border-radius:14px;gap:12px;margin-bottom:14px}
#game-menu h2{color:#c9d9a3;letter-spacing:.12em;font-size:11px;margin-bottom:4px}
#game-menu label{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;font-size:14px;color:#d4dfd5}
#game-menu select{padding:11px 12px;border:1px solid #739b8266;border-radius:8px;background:#10251e;color:#f0f4e7;max-width:240px}
#game-menu button{padding:10px 16px;border-radius:9px;background:#254536;border:1px solid #71927855;color:#edf5e8}
#game-menu #reset{width:100%;background:#cfdfa1;color:#14251d;font-weight:700}
#game-menu .player-controls-help{font-size:12px;line-height:1.9;color:#9eb5a7;padding:4px 12px}
#game-menu .advanced-settings{border-top:1px solid #ffffff18;padding-top:18px;color:#93ab9d;font-size:12px}
#game-menu .advanced-settings summary{cursor:pointer;padding:8px 0}
#game-menu .advanced-settings>div{margin-top:16px}
.snooker-controls{position:absolute;left:50%;top:86px;transform:translateX(-50%);z-index:5;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:7px;max-width:85vw;padding:9px 14px;border:1px solid #c9d9a333;border-radius:12px;background:#10251ee8;box-shadow:0 5px 25px #0004;font-size:12px;color:#e3edcf}
.snooker-controls[hidden]{display:none}.snooker-controls strong{font-weight:500}.snooker-controls button{font-size:12px;padding:7px 10px;min-height:32px;border-radius:7px}.snooker-controls small{display:block;width:100%;color:#f4c66c}

.cue-tools{display:flex;justify-content:center;gap:10px;margin-top:12px}.cue-tools button{min-height:42px;padding:9px 18px;border:1px solid #9bad9655;border-radius:9px;background:#23372e;color:#e7eddf;font:inherit;cursor:pointer}.cue-tools button[aria-pressed=true]{background:#d6e7a8;color:#17251e;border-color:#e6f4c6;box-shadow:0 0 0 2px #d6e7a822}

/* Equipment stays within reach, independently of the shot panel and menu. */
.cue-tools{position:absolute;z-index:5;bottom:max(18px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);margin:0;gap:8px;padding:7px;border:1px solid #b9ce9d44;border-radius:16px;background:#10211ced;box-shadow:0 6px 24px #0005;backdrop-filter:blur(12px)}
.cue-tools button{display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:8px;border-radius:11px}
.cue-tools svg{width:30px;height:30px;pointer-events:none}
.cue-tools button:hover{border-color:#d6e7a8}.cue-tools button:focus-visible{outline:2px solid #e6f4c6;outline-offset:3px}
#mouse-shot-controls{bottom:calc(max(18px,env(safe-area-inset-bottom)) + 78px)}

.first-play-guide{position:absolute;z-index:4;top:77px;left:50%;transform:translateX(-50%);max-width:calc(100% - 28px);padding:6px 12px;border-radius:8px;background:#10211cda;color:#e1e9d7;font-size:clamp(10px,1.25vw,13px);line-height:1.4;white-space:nowrap;text-align:center;pointer-events:none;box-sizing:border-box}
.first-play-guide[hidden]{display:none}.snooker-controls{top:116px}
@media(max-width:650px){.first-play-guide{top:67px;font-size:clamp(8px,2.3vw,12px);padding:5px 6px}.snooker-controls{top:100px}}

/* Keep the far cushion unobstructed: match information lives below play. */
.immersive-game .broadcast-score{top:auto;bottom:max(14px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(760px,calc(100% - 300px))}
.first-play-guide{top:auto;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 66px)}
.cue-tools{left:16px;bottom:max(14px,env(safe-area-inset-bottom));transform:none}
#mouse-shot-controls{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 108px)}
.snooker-controls{top:auto;left:16px;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 82px);transform:none;max-width:220px;justify-content:flex-start}
@media(max-width:850px){
 .cue-tools{left:8px;flex-direction:column;padding:5px;gap:5px}
 .cue-tools button{width:40px;height:40px;min-height:40px;padding:6px}
 .immersive-game .broadcast-score{width:calc(100% - 150px)}
 .snooker-controls{left:8px;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 112px);max-width:150px}
 #mouse-shot-controls{left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 170px)}
}
@media(max-width:650px){
 .first-play-guide{top:auto;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 58px)}
 #mouse-shot-controls{bottom:calc(max(14px,env(safe-area-inset-bottom)) + 92px)}
}

.touch-cue-controls{position:fixed;right:max(12px,env(safe-area-inset-right));top:35%;z-index:8;display:grid;gap:7px;width:150px;touch-action:none}.touch-cue-controls[hidden]{display:none}.touch-directions{display:grid;grid-template-areas:'. up .' 'left down right';grid-template-columns:repeat(3,1fr);gap:4px}.touch-cue-controls button{min-height:44px;border:1px solid #78998a;background:#102723ee;color:#fff;border-radius:10px;font-size:16px;touch-action:none;user-select:none}.touch-directions button{font-size:24px}.touch-cue-controls .touch-action{background:#d2e7a3;color:#14251a;font-weight:800}.touch-game #welcome{max-height:90dvh;overflow:auto}.touch-game .welcome-hint{font-size:14px}.touch-game .tip-preview{display:none}@media(max-width:650px){.touch-game .broadcast-score{width:calc(100% - 20px)}.touch-game .first-play-guide{max-width:calc(100% - 30px);font-size:11px}.touch-game #mouse-shot-controls{bottom:110px;left:12px;transform:none;max-width:calc(100% - 180px)}.touch-game #welcome .welcome-art{display:none}.touch-game #welcome{display:block;width:94vw}.touch-game #welcome:not([open]){display:none}}

/* Keep the welcome action visible on short phones and split-screen tablets. */
@media(max-height:600px){
 #welcome[open]{display:block}
 #welcome{width:min(780px,96vw);max-height:96dvh;overflow:auto}
 #welcome .welcome-art{display:none}
 #welcome .welcome-copy{padding:18px 24px;display:grid;grid-template-columns:1fr 1fr;gap:10px 18px;align-items:center}
 #welcome .welcome-eyebrow,#welcome .welcome-intro,#welcome .welcome-hint{display:none}
 #welcome h1{font-size:30px;line-height:1.05;margin:0;grid-column:1;grid-row:1/3}
 #welcome .welcome-games{margin:0;grid-column:2;grid-row:1/3;gap:8px}
 #welcome .welcome-games button{padding:10px;min-height:68px}
 #welcome .welcome-control{margin:0;gap:8px}
 #welcome #welcome-voice{margin:0;min-height:44px}
 #welcome #welcome-start{grid-column:1/-1;margin:0;min-height:48px}
}
/* Compact player actions, including tablet and phone menus. */
#game-menu button,#game-menu select,#welcome button,#mouse-shot-controls button,.snooker-controls button{min-height:44px;padding:7px 11px;font-size:14px;line-height:1.25;box-sizing:border-box}
#game-menu{padding:18px}#game-menu section{padding:11px;gap:8px;margin-bottom:10px}#game-menu .game-menu-heading{font-size:24px;padding-bottom:12px}
@media(max-width:1100px),(pointer:coarse){
 #welcome .welcome-games button{min-height:54px;padding:8px 10px}#welcome #welcome-start{min-height:44px;padding:9px 12px}
 #game-menu{width:min(380px,100vw);max-height:100dvh;overflow:auto}#game-menu select{max-width:60%;min-width:0}
 .touch-cue-controls{width:140px;gap:5px}.touch-cue-controls button{padding:6px;font-size:14px}.touch-directions button{font-size:20px}
 .cue-tools button{width:44px;height:44px;min-height:44px;padding:7px}
}
@media(pointer:coarse),(max-width:1100px){#welcome .welcome-games button{min-height:44px!important;height:44px;padding:7px 10px!important}#welcome .welcome-games button strong{font-size:15px;line-height:1.2}#welcome .welcome-games button span{display:none}}
