/* Scoped pool desk. Ball choices stay local until the referee records a shot. */
body.pool-page {
    --pool-ink: #142839;
    --pool-muted: #697b87;
    --pool-felt: #176b59;
    --pool-felt-dark: #124d42;
    --pool-gold: #c2a568;
    --pool-line: #dde5e6;
    background: #eef2f2;
    color: var(--pool-ink);
    min-height: 100vh;
    margin: 0;
    font-family: Montserrat, "Noto Sans Devanagari", system-ui, sans-serif;
}
.pool-page *, .pool-modal-backdrop * { box-sizing: border-box; }
.pool-page .pace, .pool-page #page-loader { display: none !important; }
.pool-app { width: 100%; max-width: 1248px; margin: 0 auto; padding: 0 28px 24px; font-size: 14px; line-height: 1.5; }
.pool-app h1, .pool-app h2, .pool-app h3, .pool-app p { margin: 0; }
.pool-app h1, .pool-app h3 { color: var(--pool-ink); }
.pool-app a { color: inherit; text-decoration: none; }
.pool-app button, .pool-app input, .pool-app select, .pool-modal button, .pool-modal input, .pool-modal select { font: inherit; }
.pool-app button, .pool-app select, .pool-modal button, .pool-modal select { cursor: pointer; }
.pool-app button:disabled, .pool-app fieldset:disabled button, .pool-app fieldset:disabled select, .pool-app fieldset:disabled input { cursor: default; }
.pool-app :focus-visible, .pool-modal :focus-visible { outline: 3px solid #1986cb; outline-offset: 3px; }
.pool-topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 82px; border-bottom: 1px solid var(--pool-line); }
.pool-brand { display: inline-flex; align-items: center; gap: 11px; letter-spacing: -.4px; white-space: nowrap; font-size: 17px; font-weight: 500; }
.pool-brand b { font-weight: 800; }
.pool-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #162737; color: #162737; font-size: 13px; font-weight: 800; box-shadow: inset -3px -5px 8px #0004; position: relative; isolation: isolate; }
.pool-mark::before { content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%; background: #fff; z-index: -1; }
.pool-topbar-actions { display: flex; align-items: center; gap: 14px; }
.pool-control-link { margin-left: auto; min-height: 36px; font-size: 11px !important; }
.pool-language { max-width: 140px; min-height: 36px; padding: 5px 25px 5px 9px; border: 1px solid #ced9dc; border-radius: 7px; background: transparent; color: var(--pool-ink); font-size: 12px !important; }
.pool-connection { display: inline-flex; align-items: center; gap: 7px; color: var(--pool-muted); font-size: 11px; font-weight: 600; max-width: 220px; }
.pool-connection i, .pool-state-badge i { width: 6px; height: 6px; border-radius: 50%; background: #94a2aa; flex-shrink: 0; }
.pool-connection.online i, .pool-state-badge.live i { background: #2b9d78; box-shadow: 0 0 0 3px #2b9d7819; }
.pool-connection.pending i, .pool-connection.connecting i { background: #bc8e32; }
.pool-connection.offline { color: #a65339; }
.pool-connection.offline i { background: #bc543e; }
.pool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; min-height: 38px; padding: 8px 13px; color: var(--pool-ink); font-size: 12px !important; font-weight: 650; line-height: 1.35; background: transparent; text-align: center; transition: background .14s, border-color .14s; }
.pool-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.pool-btn:hover { background: #1428390a; }
.pool-btn-primary { background: var(--pool-felt); color: #fff; border-color: var(--pool-felt); }
.pool-btn-primary:hover { background: var(--pool-felt-dark); border-color: var(--pool-felt-dark); }
.pool-btn-secondary { border-color: #d2dfe0; background: #fff; }
.pool-btn-secondary:hover { background: #f3f7f6; border-color: #aebfc1; }
.pool-btn-quiet { color: #526774; }
.pool-btn-danger { color: #9e4237; }
.pool-btn-danger:hover { background: #a44a3f0b; }
.pool-btn-warning { color: #7c5a1d; border-color: #e5d6ae; background: #fcf7e9; }
.pool-icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 7px; position: relative; }
.pool-topbar .pool-icon-btn { font-size: 0 !important; border: 1px solid #ced9dc; border-radius: 50%; }
.pool-topbar .pool-icon-btn svg { width: 19px; height: 19px; }
.pool-btn:disabled, fieldset:disabled .pool-btn { opacity: .43; pointer-events: none; }
.pool-match-heading { display: flex; justify-content: space-between; align-items: end; padding: 25px 0 18px; gap: 15px; }
.pool-match-heading a { font-size: 11px; font-weight: 600; color: #627984; display: block; margin-bottom: 5px; }
.pool-match-heading a:hover { color: var(--pool-felt); }
.pool-match-heading h1 { font-size: 23px; font-weight: 750; letter-spacing: -.8px; line-height: 1.3; }
.pool-match-meta { display: flex; align-items: center; gap: 15px; font-size: 11px; color: var(--pool-muted); flex-wrap: wrap; justify-content: flex-end; }
.pool-state-badge { display: inline-flex; gap: 7px; align-items: center; border: 1px solid #d2dddf; border-radius: 6px; padding: 5px 9px; color: #536b78; font-size: 10px; font-weight: 650; }
.pool-state-badge.live { color: var(--pool-felt); border-color: #bcdbcf; background: #eff8f3; }
.pool-state-badge.finished { background: #f7f1e3; color: #80612d; border-color: #e3d8bd; }
.pool-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) 100px minmax(0,1fr); background: #132938; border-radius: 13px; padding: 23px 30px 22px; gap: 5px; color: #fff; box-shadow: 0 6px 20px #1b35440d; }
.pool-player { min-width: 0; padding: 0 12px; position: relative; }
.pool-player:first-child { padding-left: 0; }
.pool-player:last-child { padding-right: 0; }
.pool-player-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pool-avatar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #ffffff2e; background: #ffffff0a; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: #dce9e9; font-size: 12px; font-weight: 650; }
.pool-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pool-player-identity { min-width: 0; }
.pool-player h2 { color: #fff; font-size: 18px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.pool-player-meta { font-size: 10px; color: #9aadb6; margin-top: 3px; }
.pool-score { font-size: clamp(58px,6.8vw,92px); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -5px; line-height: 1.35; margin-top: 6px; }
.pool-score-digits-5, .pool-score-digits-6 { font-size: clamp(38px,5.6vw,76px); letter-spacing: -3px; }
.pool-player:last-child .pool-score { text-align: right; }
.pool-player:last-child .pool-player-top { flex-direction: row-reverse; text-align: right; }
.pool-player-bottom { display: flex; align-items: center; justify-content: space-between; min-height: 24px; gap: 8px; }
.pool-player:last-child .pool-player-bottom { flex-direction: row-reverse; }
.pool-player.is-active::after, .pool-player.is-winner::after { content: ""; position: absolute; bottom: -22px; height: 3px; width: 70px; background: var(--pool-gold); left: 0; border-radius: 3px 3px 0 0; }
.pool-player:last-child.is-active::after, .pool-player:last-child.is-winner::after { right: 0; left: auto; }
.pool-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 650; padding: 4px 7px; border-radius: 4px; background: #fff1; color: #cad9de; }
.pool-tag i { width: 5px; height: 5px; border-radius: 50%; background: #70c39f; }
.pool-tag.green { background: #6ccaa615; color: #92d2b7; }
.pool-tag.gold { background: #c2a5681a; color: #e7ce98; }
.pool-tag svg { width: 12px; height: 12px; }
.pool-breaker-dot { display: inline-flex; align-items: center; gap: 5px; color: #b5c4cb; font-size: 9px; font-weight: 600; }
.pool-breaker-dot::before { content: ""; width: 8px; height: 8px; background: #efeee6; border: 2px solid #ffffff49; border-radius: 50%; }
.pool-score-center { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 4px; text-align: center; min-width: 0; }
.pool-score-center span { border: 1px solid #ffffff24; border-radius: 5px; color: #c7d7dd; padding: 5px 9px; font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }
.pool-score-center b { color: #728996; font-size: 37px; line-height: 1.6; font-weight: 400; }
.pool-score-center small { font-size: 9px; color: #7f98a6; }
.pool-foul-meter { display: inline-flex; align-items: center; gap: 7px; border-radius: 4px; background: #ffffff09; color: #b9c6ca; font-size: 9px; margin-top: 9px; padding: 3px 7px; }
.pool-player:last-child .pool-foul-meter { float: right; }
.pool-foul-meter.is-warned { color: #edce8e; background: #b98e3026; }
.pool-foul-meter strong { font-size: 11px; }
.pool-live-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0 17px; font-size: 11px; color: #607784; }
.pool-live-strip > div { display: flex; align-items: center; gap: 10px; }
.pool-live-strip strong { color: #364f5c; font-weight: 650; }
.pool-small-tag { font-size: 9px; padding: 3px 6px; border-radius: 4px; background: #e6ecec; color: #607680; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pool-ball-in-hand { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #276a59 !important; }
.pool-cue-ball { width: 11px; height: 11px; border-radius: 50%; background: white; border: 1px solid #acbabf; display: inline-block; }
.pool-workspace { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; }
.pool-main-column, .pool-side-column { min-width: 0; display: grid; gap: 14px; }
.pool-panel { border: 1px solid var(--pool-line); border-radius: 10px; background: #fff; padding: 18px; min-width: 0; }
.pool-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.pool-panel h3 { font-size: 12px; font-weight: 750; }
.pool-control-fieldset, .pool-match-actions fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pool-ball-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.pool-ball-toolbar p { color: var(--pool-muted); font-size: 10px; max-width: 55%; line-height: 1.6; }
.pool-segment { padding: 3px; border-radius: 6px; background: #edf2f2; display: flex; flex-shrink: 0; }
.pool-segment button { border: 0; background: transparent; color: #6e818b; font-size: 9px; font-weight: 650; border-radius: 4px; padding: 5px 8px; min-height: 27px; }
.pool-segment button[aria-pressed="true"] { background: #fff; color: #234c46; box-shadow: 0 1px 4px #183e3410; }
.pool-balls { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 14px 9px; justify-items: center; padding: 4px 0 10px; }
.pool-ball { --ball-color: #e4b327; position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #0000001a; background: radial-gradient(circle at 29% 21%,#ffffff60 0,#fff0 43%),var(--ball-color); box-shadow: inset -4px -5px 7px #0003,0 2px 3px #17282b13; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: #15222c; isolation: isolate; transition: transform .14s, opacity .14s; }
.pool-ball > span { display: flex; justify-content: center; align-items: center; width: 21px; height: 21px; border-radius: 50%; background: #fff; color: #1e2c34; font-size: 11px; font-weight: 750; box-shadow: inset -1px -1px 2px #0001; position: relative; z-index: 1; }
.pool-ball-2,.pool-ball-10 { --ball-color: #2463b9; }
.pool-ball-3,.pool-ball-11 { --ball-color: #ca4b42; }
.pool-ball-4,.pool-ball-12 { --ball-color: #7650a7; }
.pool-ball-5,.pool-ball-13 { --ball-color: #e17b28; }
.pool-ball-6,.pool-ball-14 { --ball-color: #2b8b61; }
.pool-ball-7,.pool-ball-15 { --ball-color: #813f43; }
.pool-ball-8 { --ball-color: #243440; }
.pool-ball.is-stripe { background: radial-gradient(circle at 29% 21%,#ffffff60 0,#fff0 43%),linear-gradient(to bottom,#fbfaf3 0 22%,var(--ball-color) 23% 77%,#fbfaf3 78% 100%); }
.pool-ball:not(:disabled):hover { transform: translateY(-2px); }
.pool-ball.is-selected { outline: 3px solid #358f76; outline-offset: 3px; transform: translateY(-2px); }
.pool-ball.is-off-table { outline: 3px solid #bd6a52; outline-offset: 3px; }
.pool-ball.is-off-table::after { content: ""; position: absolute; width: 47px; height: 2px; background: #d66247; transform: rotate(-45deg); box-shadow: 0 1px 0 #fff; z-index: 2; }
.pool-ball.is-gone { opacity: .14; box-shadow: none; filter: grayscale(1); }
.pool-selection-summary { min-height: 29px; margin: 11px 0 8px; color: #668077; font-size: 10px; }
.pool-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.pool-field { display: grid; gap: 6px; font-size: 10px; font-weight: 600; min-width: 0; color: #607682; margin: 0; }
.pool-field select, .pool-field input, .pool-code-form input, .pool-copy-field { width: 100%; border: 1px solid #cfdbdf; border-radius: 6px; min-height: 36px; padding: 7px 9px; background: #fff; color: #294858; font-size: 11px; line-height: 1.5; min-width: 0; }
.pool-shot-options { display: flex; align-items: start; flex-wrap: wrap; gap: 9px 18px; margin: 14px 0 17px; }
.pool-check { display: inline-flex; gap: 7px; align-items: center; font-size: 10px; color: #5b7380; margin: 0; min-height: 22px; cursor: pointer; }
.pool-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--pool-felt); flex-shrink: 0; }
.pool-shot-actions { display: flex; gap: 6px; padding-top: 15px; border-top: 1px solid #e7eded; align-items: stretch; flex-wrap: wrap; }
.pool-shot-actions .pool-btn-primary { flex-grow: 1; }
.pool-match-actions { padding: 13px 17px; }
.pool-match-actions h3 { color: #607782; font-size: 10px; margin-bottom: 6px; }
.pool-match-actions fieldset > div { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pool-match-actions .pool-btn { min-height: 33px; padding: 6px 10px; font-size: 10px !important; }
.pool-referee-actions { border-top: 1px solid #edf1f1; padding-top: 8px; margin-top: 9px; }
.pool-match-actions .pool-btn-danger { margin-left: auto; }
.pool-history { padding: 17px 18px 7px; }
.pool-revision { font-size: 8px; color: #82969e; }
.pool-history ol { list-style: none; padding: 0; margin: 0; max-height: 282px; overflow-y: auto; scrollbar-width: thin; }
.pool-history li { display: flex; gap: 9px; position: relative; align-items: start; padding: 0 0 15px; font-size: 10px; }
.pool-history-dot { width: 6px; height: 6px; background: #d0ddda; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.pool-history li:first-child .pool-history-dot { background: #3e9379; }
.pool-history li > div { flex: 1; display: grid; gap: 3px; }
.pool-history strong { font-size: 10px; font-weight: 600; color: #4b6471; }
.pool-history li span:not(.pool-history-dot), .pool-history small { color: #93a3aa; font-size: 8px; }
.pool-history small { white-space: nowrap; margin-top: 2px; }
.pool-empty { color: #80939c; font-size: 10px; padding: 0 0 14px; }
.pool-match-details { padding: 16px 18px; }
.pool-match-details dl { margin: 0; font-size: 9px; }
.pool-match-details dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 10px; }
.pool-match-details dt { font-weight: 500; color: #82949b; }
.pool-match-details dd { font-weight: 600; color: #54706f; text-align: right; margin: 0; }
.pool-match-details p { color: #98a5a9; font-size: 8px; margin-top: 17px; padding-top: 10px; border-top: 1px solid #edf1f1; }
.pool-bottom { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 18px 0 0; }
.pool-bottom > span { font-size: 9px; color: #8c9da4; }
.pool-bottom .pool-btn { font-size: 10px !important; min-height: 33px; }
.pool-boot { min-height: 60vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--pool-muted); font-size: 12px; }
.pool-load-error { margin: 50px auto; max-width: 550px; text-align: center; padding: 40px; }
.pool-load-error h1 { font-size: 20px; line-height: 1.5; margin-bottom: 20px; }
.pool-alert { display: flex; justify-content: space-between; align-items: center; gap: 15px; border: 1px solid #e8ccb9; background: #fff8f0; color: #915d3b; font-size: 11px; padding: 7px 10px 7px 14px; border-radius: 7px; margin-bottom: 15px; }
.pool-alert .pool-icon-btn { font-size: 0 !important; color: #8c694e; flex-shrink: 0; }
.pool-network-notice { background: #fff7eb; color: #916b37; border: 1px solid #e7d8be; padding: 8px 12px; border-radius: 7px; margin-bottom: 12px; font-size: 11px; }
.pool-network-notice.is-saving { background: #edf5f2; border-color: #cbded5; color: #4c7b67; }
.pool-start-panel { padding: 25px; }
.pool-eyebrow { color: #8c9ea4; font-size: 9px; display: block; margin-bottom: 8px; font-weight: 650; letter-spacing: .4px; }
.pool-start-panel h3 { font-size: 16px; margin-bottom: 20px; line-height: 1.5; }
.pool-first-breaker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 20px; }
.pool-first-breaker .pool-btn { padding: 14px; border: 1px solid #d6e1e1; background: #f7f9f8; }
.pool-first-breaker .pool-btn.is-selected { background: #edf7f2; color: #1d6e55; border-color: #70b39a; box-shadow: inset 0 0 0 1px #70b39a; }
.pool-pause-panel, .pool-finished-panel { text-align: center; padding: 20px; }
.pool-pause-panel > svg { width: 28px; height: 28px; color: #b4c1c5; margin-bottom: 12px; }
.pool-pause-panel h3, .pool-finished-panel h3 { font-size: 18px; margin-bottom: 18px; }
.pool-finished-panel p { color: #7d6b47; font-size: 15px; font-weight: 650; }
.pool-finish-medal { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; background: #f8f2e6; border-radius: 50%; color: #ae8740; margin-bottom: 15px; }
.pool-finish-medal svg { width: 24px; height: 24px; }
.pool-quick h3 { font-size: 16px; }
.pool-quick p, .pool-viewer-note p { color: #7d919b; font-size: 11px; margin: 10px 0 17px; line-height: 1.7; }
.pool-quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.pool-quick-player { min-height: 82px; color: #246854; border-color: #c4dfd2; background: #f3faf6; font-size: 14px !important; padding: 18px; }
.pool-quick-player:hover { background: #e4f3eb; }
.pool-viewer-note .pool-tag { color: #42655b; background: #e9f3ee; }
.pool-code-form { border-top: 1px solid #e8eeee; padding-top: 12px; }
.pool-code-form > label { font-size: 10px; color: #778e96; margin-bottom: 6px; }
.pool-code-form > div { display: flex; align-items: stretch; gap: 8px; }
.pool-code-form input { flex: 1; }
.pool-code-form .pool-btn { flex-shrink: 0; font-size: 10px !important; min-height: 36px; }
.pool-choice { border: 1px solid #e0d3ad; background: #fffcf4; border-radius: 8px; padding: 17px; }
.pool-choice h3 { font-size: 15px; margin-bottom: 4px; }
.pool-choice p { color: #887d5e; font-size: 11px; margin-bottom: 16px; }
.pool-choice .pool-eyebrow { color: #a48a51; }
.pool-choice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pool-choice .pool-form-grid { margin-bottom: 15px; }
.pool-spectator-balls .pool-choice { margin-top: 18px; }
.pool-placement-note { border: 1px solid #d2e0da; border-radius: 8px; padding: 13px 17px; background: #f0f8f3; }
.pool-placement-note h3 { font-size: 11px; margin: 0 0 6px; color: #3c7160; }
.pool-placement-note p { color: #6d8b7d; font-size: 10px; line-height: 1.7; }
.pool-modal-backdrop { position: fixed; inset: 0; background: #10233099; z-index: 20000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.pool-modal { width: 100%; max-width: 470px; border-radius: 12px; background: #fff; padding: 28px; position: relative; color: #203b49; font-family: Montserrat, "Noto Sans Devanagari", system-ui, sans-serif; box-shadow: 0 20px 100px #0018; max-height: calc(100dvh - 40px); overflow-y: auto; }
.pool-modal h2 { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 0 28px 16px 0; }
.pool-dialog-content p { font-size: 12px; color: #657e8a; line-height: 1.8; margin: 0 0 12px; }
.pool-dialog-content .pool-muted { font-size: 10px; color: #8da0a9; }
.pool-dialog-close { position: absolute; top: 18px; right: 18px; color: #8098a3; }
.pool-dialog-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 23px; }
.pool-copy-field { font-size: 12px !important; }
.pool-app.is-overlay { max-width: none; padding: 10px; }
.pool-app.is-overlay .pool-topbar, .pool-app.is-overlay .pool-match-heading, .pool-app.is-overlay .pool-workspace, .pool-app.is-overlay .pool-bottom { display: none; }
.pool-app.is-overlay .pool-scoreboard { max-width: 900px; margin: 0 auto; padding: 14px 22px; }
.pool-app.is-overlay .pool-live-strip { max-width: 900px; margin: 0 auto; }
.pool-app.is-overlay .pool-score { font-size: 58px; }
.pool-app.is-overlay .pool-player h2 { font-size: 15px; }
.pool-app.is-overlay .pool-player.is-active::after { bottom: -14px; }
.pool-app.is-overlay .pool-score-center b { line-height: 1.1; }

@media (min-width: 1440px) {
    .pool-app { padding-top: 10px; }
    .pool-scoreboard { padding-top: 26px; padding-bottom: 25px; }
    .pool-player.is-active::after, .pool-player.is-winner::after { bottom: -25px; }
}
@media (max-width: 1000px) {
    .pool-app { padding: 0 20px 20px; }
    .pool-workspace { grid-template-columns: minmax(0,1fr) 250px; gap: 14px; }
    .pool-scoreboard { padding-left: 23px; padding-right: 23px; }
    .pool-balls { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px 10px; }
    .pool-panel { padding: 15px; }
    .pool-player h2 { font-size: 15px; }
    .pool-ball-toolbar { align-items: start; }
    .pool-ball-toolbar p { max-width: 50%; }
    .pool-scoreboard { grid-template-columns: minmax(0,1fr) 90px minmax(0,1fr); }
    .pool-shot-actions .pool-btn-quiet { order: 2; }
    .pool-shot-actions .pool-btn-primary, .pool-shot-actions .pool-btn-secondary { flex: 1; }
}
@media (max-width: 767px) {
    .pool-app { padding: 0 16px 20px; }
    .pool-topbar { min-height: 70px; gap: 12px; }
    .pool-topbar.has-control { flex-wrap: wrap; gap: 4px 12px; padding-top: 12px; }
    .pool-topbar.has-control .pool-brand { order: 1; }
    .pool-topbar.has-control .pool-topbar-actions { order: 2; margin-left: auto; }
    .pool-topbar.has-control .pool-control-link { order: 3; flex-basis: 100%; margin: 0 0 5px; min-height: 30px; padding: 4px 0; justify-content: flex-end; background: transparent; border-color: transparent; }
    .pool-brand { font-size: 15px; gap: 8px; }
    .pool-mark { width: 32px; height: 32px; }
    .pool-topbar-actions { gap: 8px; }
    .pool-connection { width: 15px; overflow: hidden; flex-shrink: 0; max-width: 15px; gap: 20px; padding: 4px; }
    .pool-connection span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .pool-language { min-height: 38px; max-width: 105px; padding-left: 6px; font-size: 10px !important; }
    .pool-topbar .pool-icon-btn { width: 35px; min-height: 35px; height: 35px; }
    .pool-match-heading { padding: 20px 0 15px; align-items: start; }
    .pool-match-heading > div:first-child { min-width: 0; }
    .pool-match-heading a { font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
    .pool-match-heading h1 { font-size: 21px; }
    .pool-match-meta { font-size: 8px; gap: 5px 10px; max-width: 125px; flex-shrink: 0; }
    .pool-state-badge { font-size: 9px; padding: 4px 7px; }
    .pool-scoreboard { padding: 18px 17px 17px; grid-template-columns: minmax(0,1fr) 66px minmax(0,1fr); gap: 0; border-radius: 10px; }
    .pool-player { padding: 0 3px; }
    .pool-player-top, .pool-player:last-child .pool-player-top { display: block; }
    .pool-avatar { display: none; }
    .pool-player h2 { font-size: 13px; line-height: 1.45; min-height: 38px; }
    .pool-player-meta { font-size: 8px; min-height: 12px; }
    .pool-score { font-size: 58px; line-height: 1.35; margin-top: 3px; letter-spacing: -3px; }
    .pool-score-digits-4 { font-size: 43px; letter-spacing: -2px; line-height: 1.8; }
    .pool-score-digits-5, .pool-score-digits-6 { font-size: 34px; letter-spacing: -2px; line-height: 2.3; }
    .pool-score-center { padding: 0 3px; }
    .pool-score-center span { font-size: 8px; padding: 4px 5px; }
    .pool-score-center b { font-size: 27px; line-height: 1.6; }
    .pool-score-center small { font-size: 8px; }
    .pool-player-bottom { min-height: 24px; display: block; }
    .pool-player:last-child .pool-player-bottom { text-align: right; }
    .pool-tag { font-size: 8px; padding: 4px 5px; }
    .pool-breaker-dot { display: none; }
    .pool-player.is-active::after, .pool-player.is-winner::after { bottom: -17px; width: 50px; }
    .pool-foul-meter { font-size: 7px; gap: 4px; padding: 3px 5px; }
    .pool-live-strip { font-size: 9px; flex-wrap: wrap; padding: 11px 0 14px; gap: 7px; }
    .pool-live-strip > div { gap: 7px; }
    .pool-ball-in-hand { font-size: 9px; }
    .pool-workspace { display: block; }
    .pool-side-column { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; margin-top: 14px; align-items: start; }
    .pool-panel { padding: 16px; border-radius: 9px; }
    .pool-balls { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 16px 10px; padding: 4px 6px 9px; }
    .pool-ball { width: 45px; height: 45px; }
    .pool-ball-toolbar { gap: 8px; margin-bottom: 18px; }
    .pool-ball-toolbar p { font-size: 9px; max-width: 51%; }
    .pool-segment button { font-size: 8px; padding: 6px 7px; min-height: 32px; }
    .pool-form-grid { gap: 10px; }
    .pool-field { font-size: 10px; }
    .pool-field select, .pool-field input { min-height: 44px; font-size: 11px; padding-left: 8px; }
    .pool-check { min-height: 36px; font-size: 10px; }
    .pool-check input { width: 17px; height: 17px; }
    .pool-shot-options { margin: 11px 0 10px; gap: 3px 14px; }
    .pool-btn { min-height: 44px; padding: 10px 12px; font-size: 11px !important; }
    .pool-shot-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
    .pool-shot-actions .pool-btn-primary { grid-column: 1 / -1; }
    .pool-shot-actions .pool-btn-quiet { order: initial; }
    .pool-match-actions h3 { font-size: 10px; }
    .pool-match-actions .pool-btn { min-height: 42px; font-size: 9px !important; padding: 8px; }
    .pool-match-actions .pool-btn-danger { margin-left: 0; }
    .pool-referee-actions { display: grid !important; grid-template-columns: 1fr; }
    .pool-referee-actions .pool-btn { justify-content: start; }
    .pool-history { padding-bottom: 5px; }
    .pool-panel-heading { margin-bottom: 13px; }
    .pool-panel-heading h3 { font-size: 11px; }
    .pool-history .pool-revision { display: none; }
    .pool-match-details dl > div { display: grid; gap: 3px; margin-bottom: 10px; }
    .pool-match-details dd { text-align: left; }
    .pool-history ol { max-height: 180px; }
    .pool-history li { font-size: 9px; gap: 7px; padding-bottom: 13px; }
    .pool-history strong { font-size: 9px; }
    .pool-bottom { display: block; padding-top: 10px; }
    .pool-bottom > span { display: none; }
    .pool-bottom .pool-btn { width: 100%; min-height: 44px; }
    .pool-choice { padding: 14px; }
    .pool-choice h3 { font-size: 13px; }
    .pool-choice-actions { display: grid; grid-template-columns: 1fr; }
    .pool-choice .pool-form-grid { grid-template-columns: 1fr; }
    .pool-quick-actions { gap: 10px; }
    .pool-quick-player { min-height: 90px; padding: 16px 10px; font-size: 12px !important; }
    .pool-first-breaker .pool-btn { padding: 13px 10px; min-height: 65px; }
    .pool-start-panel h3 { font-size: 15px; }
    .pool-start-panel > .pool-btn-primary { width: 100%; }
    .pool-modal-backdrop { padding: 16px; }
    .pool-modal { padding: 25px 20px 20px; max-height: calc(100dvh - 32px); }
    .pool-modal h2 { font-size: 17px; }
    .pool-dialog-buttons .pool-btn { min-height: 44px; }
    .pool-code-form > div { flex-wrap: wrap; }
    .pool-code-form input { flex-basis: 100%; min-height: 44px; }
    .pool-code-form .pool-btn { flex: 1; }
    .pool-connection.offline::after { content: "!"; color: #a65339; }
    .pool-alert { font-size: 10px; line-height: 1.6; }
}
@media (max-width: 370px) {
    .pool-app { padding-left: 11px; padding-right: 11px; }
    .pool-topbar-actions { gap: 5px; }
    .pool-brand { font-size: 14px; gap: 6px; }
    .pool-language { max-width: 94px; }
    .pool-scoreboard { padding-left: 14px; padding-right: 14px; }
    .pool-player h2 { font-size: 12px; }
    .pool-score { font-size: 52px; }
    .pool-score-digits-4 { font-size: 40px; }
    .pool-score-digits-5, .pool-score-digits-6 { font-size: 30px; }
    .pool-ball-toolbar { flex-wrap: wrap; }
    .pool-ball-toolbar p { max-width: none; width: 100%; }
    .pool-balls { padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .pool-btn, .pool-ball { transition: none; }
}

/* Mouse control desk: view changes do not recreate the transport or scoring state. */
.pool-view-switch { display:flex; padding:3px; border:1px solid #c8d5d9; border-radius:7px; gap:3px; flex-shrink:0; }
.pool-view-switch button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:34px; border:0; border-radius:5px; padding:6px 12px; background:transparent; color:var(--pool-muted); font-size:11px; font-weight:650; }
.pool-view-switch svg { width:17px; height:17px; }
.pool-view-switch [aria-pressed="true"] { background:var(--pool-felt); color:#fff; }
.pool-shot-intro { margin-bottom:12px; }
.pool-shot-intro h3 { font-size:17px; line-height:1.4; margin-bottom:5px; }
.pool-shot-intro p { font-size:11px; color:var(--pool-muted); line-height:1.6; }
.pool-selection-summary { display:flex; gap:10px; justify-content:space-between; align-items:center; flex-wrap:wrap; border:1px solid var(--pool-line); padding:9px 11px; border-radius:6px; }
.pool-selection-summary strong { font-size:12px; color:var(--pool-ink); }
.pool-selection-summary span { font-size:10px; color:var(--pool-muted); }
.pool-ball.is-selected::after { content:"✓"; position:absolute; bottom:-3px; right:-3px; display:grid; place-items:center; width:20px; height:20px; font-size:13px; border:2px solid white; border-radius:50%; background:var(--pool-felt); color:white; z-index:3; }
.pool-ball.is-first-contact:not(.is-selected) { outline:2px dashed #788f9d; outline-offset:3px; }
.pool-context { padding:0; overflow:hidden; }
.pool-context-heading { padding:13px 16px; background:var(--pool-felt); color:#fff; }
.pool-context-heading span { font-size:10px; opacity:.8; }
.pool-context .pool-context-heading h3 { color:inherit; font-size:15px; }
.pool-context dl { margin:0; }
.pool-context dl>div { padding:9px 15px; display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid var(--pool-line); font-size:11px; }
.pool-context dt { color:var(--pool-muted); }
.pool-context dd { margin:0; text-align:right; font-weight:650; display:flex; align-items:center; gap:7px; }
.pool-context-ball { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; width:24px; height:24px; color:#fff; background:var(--ball-color,#d3a626); font-size:12px; }
.pool-history li p { font-size:10px; line-height:1.6; color:var(--pool-ink); margin:4px 0; overflow-wrap:anywhere; }
.pool-history li.is-undone { opacity:.5; }
.pool-history li.is-undone p { text-decoration:line-through; }
.pool-history em { font-size:8px; font-style:normal; border:1px solid var(--pool-line); border-radius:3px; padding:1px 3px; margin-left:5px; }
.pool-referee-menu { margin-top:10px; border-top:1px solid var(--pool-line); padding-top:9px; }
.pool-referee-menu summary { cursor:pointer; color:var(--pool-muted); font-size:11px; width:fit-content; padding:5px 0; }
.pool-referee-menu .pool-referee-actions { margin:4px 0 0; }
.pool-app.is-scoreboard-view .pool-scoreboard { min-height:245px; }
.pool-app.is-scoreboard-view.is-overlay .pool-scoreboard { min-height:0; }
@media (max-width:767px) {
    .pool-topbar { flex-wrap:wrap; padding:9px 0; gap:8px; }
    .pool-topbar-actions { flex-wrap:wrap; justify-content:flex-end; margin-left:auto; gap:7px; }
    .pool-topbar:has(.pool-view-switch) .pool-topbar-actions { width:100%; justify-content:space-between; }
    .pool-view-switch { order:5; width:100%; }
    .pool-view-switch button { min-height:40px; flex:1; }
    .pool-shot-intro h3 { font-size:15px; }
    .pool-shot-intro p { font-size:10px; }
    .pool-selection-summary { gap:5px; }
    .pool-context-heading { padding:10px 13px; }
    .pool-context dl>div { padding:8px 13px; }
    .pool-app.is-scoreboard-view .pool-scoreboard { min-height:0; }
}
@media (min-width:1024px) {
    body.pool-page { --pool-ink:#eef3fa; --pool-muted:#a9b7c7; --pool-felt:#287dff; --pool-felt-dark:#1d68db; --pool-line:#465264; background:#1d252f; color:var(--pool-ink); }
    .pool-app { max-width:1440px; padding:0 24px 18px; }
    .pool-topbar { min-height:66px; }
    .pool-brand { font-size:20px; color:#edf3ff; }
    .pool-topbar-actions { gap:10px; }
    .pool-topbar .pool-icon-btn,.pool-view-switch,.pool-language { border-color:#536176; color:#dce7f5; }
    .pool-view-switch { margin-left:7px; }
    .pool-view-switch button { min-height:34px; padding:6px 15px; font-size:12px; }
    .pool-language option { background:#28313e; color:#eef3fa; }
    .pool-match-heading { padding:13px 0 12px; align-items:center; }
    .pool-match-heading h1 { font-size:19px; letter-spacing:-.3px; }
    .pool-match-heading a,.pool-match-meta { color:#a8b8ca; font-size:10px; }
    .pool-match-heading a { margin-bottom:2px; }
    .pool-scoreboard { background:#222d3b; border:1px solid var(--pool-line); padding:13px; gap:18px; grid-template-columns:minmax(0,1fr) 125px minmax(0,1fr); }
    .pool-player { display:grid; grid-template-areas:"identity score" "status score"; grid-template-columns:minmax(0,1fr) 90px; gap:5px 10px; min-height:110px; border:1px solid #4b586a; border-radius:9px; padding:14px!important; background:#2c3847; }
    .pool-player.is-active { background:linear-gradient(115deg,#2678f0,#2365dc); border-color:#438dff; }
    .pool-player.is-active::after,.pool-player.is-winner::after { display:none; }
    .pool-player-top { grid-area:identity; gap:11px; }
    .pool-player h2 { font-size:17px; line-height:1.3; }
    .pool-player-meta { color:#c0cee0; font-size:10px; }
    .pool-avatar { width:43px; height:43px; background:#ecf2fc; color:#26394f; }
    .pool-score { grid-area:score; align-self:center; text-align:right; margin:0; font-size:52px; line-height:1; letter-spacing:-2px; }
    .pool-score-digits-3 { font-size:43px; }
    .pool-score-digits-4 { font-size:33px; }
    .pool-score-digits-5,.pool-score-digits-6 { font-size:23px; letter-spacing:-1px; }
    .pool-player-bottom { grid-area:status; gap:10px; justify-content:flex-start!important; }
    .pool-player .pool-foul-meter { grid-column:1/-1; margin:0; float:none; justify-self:start; }
    .pool-score-center { gap:3px; justify-content:center; }
    .pool-score-center b { font-size:35px; }
    .pool-score-center>span { color:#d0d9e7; font-size:12px; }
    .pool-score-center small { color:#aebfd2; }
    .pool-tag.green,.pool-state-badge.live { color:#80e3d1; border-color:#3a7168; background:#16514a; }
    .pool-player.is-active .pool-tag.green { background:#ffffff1c; color:#fff; }
    .pool-live-strip { padding:10px 1px 12px; font-size:11px; color:#bfcede; }
    .pool-live-strip strong { color:#eef5ff; }
    .pool-small-tag { background:#3b4859; color:#d1dceb; }
    .pool-workspace { grid-template-columns:minmax(0,1fr) 340px; gap:18px; }
    .pool-main-column,.pool-side-column { gap:13px; }
    .pool-panel { background:linear-gradient(125deg,#283340,#252f3a); padding:17px 19px; }
    .pool-panel-heading { margin-bottom:10px; }
    .pool-panel h3 { font-size:13px; }
    .pool-control-panel .pool-panel-heading { margin-bottom:8px; }
    .pool-shot-intro h3 { font-size:21px; }
    .pool-shot-intro p { font-size:12px; }
    .pool-ball-toolbar { margin-bottom:12px; }
    .pool-segment { background:#1e2834; }
    .pool-segment button { color:#b7c9db; min-height:30px; }
    .pool-segment button[aria-pressed="true"] { background:#42536a; color:#f5f9ff; }
    .pool-balls { gap:18px 12px; padding:9px 0 17px; }
    .pool-ball { width:68px; height:68px; }
    .pool-ball>span { width:31px; height:31px; font-size:19px; }
    .pool-app[data-discipline="9"] .pool-balls,.pool-app[data-discipline="10"] .pool-balls { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .pool-app[data-discipline="9"] .pool-ball,.pool-app[data-discipline="10"] .pool-ball { width:78px; height:78px; }
    .pool-ball.is-selected { outline-color:#3c8dff; outline-width:3px; }
    .pool-ball.is-first-contact:not(.is-selected) { outline-color:#adbdd2; }
    .pool-ball.is-gone { opacity:.25; }
    .pool-ball.is-selected::after { width:24px; height:24px; font-size:15px; }
    .pool-selection-summary { margin:3px 0 13px; padding:9px 11px; }
    .pool-selection-summary strong { font-size:13px; }
    .pool-selection-summary span { font-size:10px; }
    .pool-form-grid { gap:11px; }
    .pool-field>span { color:#c8d5e6; }
    .pool-field select,.pool-field input,.pool-code-form input { color:#e2eaf5; background:#222d3a; border-color:#647387; min-height:37px; }
    .pool-shot-options,.pool-check { color:#d2dcea; font-size:11px; }
    .pool-check input { accent-color:#287dff; }
    .pool-btn-secondary { color:#e0eaf7; background:#283544; border-color:#67758a; }
    .pool-btn-secondary:hover { background:#35465c; border-color:#8ca6c5; }
    .pool-btn-quiet { color:#bdcce0; }
    .pool-btn-warning { color:#f2d798; background:#65512744; border-color:#826c39; }
    .pool-btn-danger { color:#f5a79c; }
    .pool-shot-actions .pool-btn { min-height:40px; }
    .pool-match-actions { padding:12px 17px; }
    .pool-match-actions>h3 { display:none; }
    .pool-context { padding:0; }
    .pool-context-heading { padding:12px 17px; background:linear-gradient(110deg,#2679ef,#205ac7); }
    .pool-context .pool-context-heading h3 { font-size:18px; }
    .pool-context dl>div { padding:10px 17px; font-size:12px; }
    .pool-history { padding:16px 18px 4px; }
    .pool-history strong { color:#e2eaf4; font-size:11px; }
    .pool-history li p { color:#bccbda; font-size:10px; }
    .pool-history li span:not(.pool-history-dot),.pool-history small { color:#98aabd; font-size:9px; }
    .pool-match-details dl { color:#cbd8e8; }
    .pool-match-details dt { color:#adbed2; }
    .pool-match-details dd { color:#e1eaf7; }
    .pool-quick p,.pool-viewer-note p,.pool-empty { color:#adbed2; }
    .pool-match-details p,.pool-muted,.pool-bottom { color:#a6b7c9; }
    .pool-placement-note { color:#c1e8df; background:#244b4555; border-color:#50796e; }
    .pool-placement-note h3 { color:#dcfff3; }
    .pool-ball-in-hand { color:#87e2cf!important; }
    .pool-first-breaker .pool-btn { background:#2e4053; color:#dce7f4; border-color:#667c91; }
    .pool-first-breaker .pool-btn.is-selected { background:#1d65cd; color:#fff; border-color:#73aaff; box-shadow:none; }
    .pool-choice { background:#55482544; color:#eee4ce; border-color:#897545; }
    .pool-quick-player { background:#2b4056; border-color:#6082a3; color:#f0f6fe; }
    .pool-app.is-scoreboard-view .pool-scoreboard { padding:35px 25px; }
    .pool-app.is-scoreboard-view .pool-player { min-height:160px; grid-template-columns:minmax(0,1fr) 110px; }
    .pool-app.is-scoreboard-view .pool-score { font-size:76px; }
    .pool-app.is-scoreboard-view .pool-score-digits-3 { font-size:53px; }
    .pool-app.is-scoreboard-view .pool-score-digits-4 { font-size:40px; }
    .pool-app.is-scoreboard-view .pool-score-digits-5,.pool-app.is-scoreboard-view .pool-score-digits-6 { font-size:27px; }
    .pool-bottom { padding-top:14px; }
}

/* Broadcast overlays retain their compact read-only layout at desktop widths. */
@media (min-width:1024px) {
    .pool-app.is-overlay .pool-scoreboard { min-height:0; padding:14px 22px; }
    .pool-app.is-overlay .pool-player { display:block; min-height:0; padding:0 12px!important; border:0; background:transparent; }
    .pool-app.is-overlay .pool-player .pool-score { font-size:58px; margin-top:6px; text-align:left; }
    .pool-app.is-overlay .pool-player:last-child .pool-score { text-align:right; }
    .pool-app.is-overlay .pool-player:last-child .pool-player-bottom { justify-content:flex-end!important; }
}
