:root {
  color-scheme: dark;
  --bg: #0b1523;
  --panel: #122238;
  --panel-light: #1b3049;
  --line: #30445a;
  --text: #edf3fa;
  --muted: #b4c3d2;
  --teal: #5ee3cf;
  --focus: #ffe56f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; min-height: 100%; }
body { background: var(--bg); color: var(--text); overflow: hidden; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: wait; opacity: .48; }
:focus-visible, body[data-tv-input="remote"] [data-tv-focus]:focus { outline: 4px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 7px #07111ecc; }
.tv-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 88% -15%, #28415d88, transparent 55%), var(--bg); }
.topbar { flex: 0 0 55px; min-height: 55px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid #ffffff12; }
.brand { display: inline-flex; align-items: baseline; gap: 1px; font-size: 25px; letter-spacing: -1px; font-weight: 850; white-space: nowrap; }
.brand > span { color: var(--teal); }
.brand i { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); margin-left: 5px; align-self: center; }
.session-info { margin-left: auto; display: flex; align-items: center; gap: 13px; font-size: 14px; }
.session-status { color: var(--muted); }
.room-badge { color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; white-space: nowrap; }
.room-badge strong { color: var(--text); margin-left: 5px; letter-spacing: 2px; font-size: 15px; }
.game-title { margin: 0; font-size: 15px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.play-tools { display: flex; align-items: center; gap: 8px; }
.play-tools:empty { display: none; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 18px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-light); color: var(--text); font-size: 16px; font-weight: 700; white-space: nowrap; }
.button:hover { filter: brightness(1.15); }
.button-primary { background: var(--teal); color: #082b2a; border-color: var(--teal); }
.button-silver { background: #e1eaf3; color: #172a3e; border-color: #e1eaf3; }
.button-small { min-height: 42px; padding: 0 13px; font-size: 17px; gap: 8px; }
.button[aria-expanded="true"] { border-color: var(--teal); color: var(--teal); }
.home-view { flex: 1; min-height: 0; width: 100%; max-width: 1800px; margin: 0 auto; padding: 15px 28px 20px; display: flex; flex-direction: column; gap: 15px; }
.room-controls { flex: 0 0 63px; display: flex; gap: 18px; align-items: center; padding: 9px 15px; border: 1px solid var(--line); background: #13243a; border-radius: 9px; }
.room-label { margin-right: auto; display: flex; flex-direction: column; gap: 4px; }
.small-label { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: var(--teal); }
.room-label-detail { color: var(--muted); font-size: 16px; }
.room-divider { height: 29px; width: 1px; background: var(--line); }
.watch-form { display: flex; align-items: center; gap: 10px; }
.watch-form > label { font-size: 16px; font-weight: 700; }
.watch-form input { width: 143px; min-width: 0; height: 44px; padding: 0 10px; text-align: center; color: var(--text); border: 1px solid #52667c; border-radius: 6px; background: #091727; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 20px; font-weight: 750; letter-spacing: 3px; text-transform: uppercase; }
.watch-form input::placeholder { color: #a0b2c5; font-size: 14px; letter-spacing: .7px; font-weight: 500; }
.watch-form input[aria-invalid="true"] { border-color: #ffb092; }
.inline-error { margin: -10px 0 -6px; color: #ffb99e; font-size: 14px; }
.games-section { min-height: 170px; max-height: 410px; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.section-heading { flex: 0 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.35px; }
.section-heading > span { font-size: 12px; color: var(--muted); }
.games-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.game-card { display: block; position: relative; overflow: hidden; isolation: isolate; border-radius: 10px; background: #1d334c; border: 1px solid #65748b66; box-shadow: 0 9px 20px #0002; }
.game-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #02102040 0%, transparent 26%, #05132212 38%, #051322c9 74%, #051322f5 100%); z-index: -1; }
.game-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 39%; z-index: -2; transition: transform .18s ease-out; }
.game-card:hover > img, .game-card:focus-visible > img { transform: scale(1.025); }
.game-card:focus-visible { outline-offset: 4px; }
.trivia-card > img { object-position: center 39%; }
.game-category { position: absolute; top: 13px; left: 14px; color: #f4f7fb; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; padding: 5px 8px; border: 1px solid #ffffff36; border-radius: 4px; background: #091625aa; backdrop-filter: blur(6px); }
.game-card-bottom { position: absolute; left: 18px; bottom: 17px; right: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.game-card-bottom strong { display: block; font-size: clamp(22px, 2.15vw, 34px); font-weight: 800; line-height: 1.08; letter-spacing: -.7px; }
.game-card-bottom small { display: block; margin-top: 8px; color: #cfdae5; font-size: 16px; line-height: 1.35; }
.cartoons-section { flex: 0 0 102px; display: flex; flex-direction: column; gap: 8px; }
.cartoon-card { flex: 1; min-height: 0; max-width: 565px; display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #14253b; }
.cartoon-card:hover { border-color: #7b91a8; background: #1b2d44; }
.cartoon-card > img { flex: 0 0 124px; width: 124px; height: 100%; object-fit: cover; object-position: center 40%; }
.cartoon-title { display: flex; flex-direction: column; gap: 5px; }
.cartoon-title strong { font-size: 18px; letter-spacing: .5px; }
.cartoon-title > span { font-size: 13px; color: var(--muted); }
.cartoon-play { margin-left: auto; padding-right: 18px; display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.noscript { margin: 0; color: var(--muted); font-size: 12px; }
.lobby-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1500px; margin: 0 auto; padding: 16px 28px 20px; }
.lobby-heading { flex: 0 0 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lobby-heading h1 { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -.7px; }
.lobby-title { min-width: 0; display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
#lobbyMatchSummary { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.3; }
.lobby-tools { display: flex; align-items: center; gap: 8px; }
.lobby-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(380px, 1.3fr); gap: 18px; }
.lobby-join, .lobby-players { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: #13243a; }
.lobby-join { display: flex; flex-direction: column; justify-content: center; }
.lobby-join h2, .lobby-roster-heading h2 { margin: 0; font-size: 21px; font-weight: 750; }
.lobby-wifi { margin: 7px 0 16px; color: var(--muted); font-size: 16px; line-height: 1.35; }
.lobby-scan-row { display: flex; align-items: center; gap: 22px; }
.lobby-qr { display: grid; place-items: center; width: 160px; height: 160px; flex: 0 0 160px; padding: 8px; border-radius: 7px; background: #fff; }
.lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { display: block; width: 144px; max-width: 100%; height: auto; }
.lobby-code-group { display: flex; min-width: 0; flex-direction: column; gap: 9px; }
.lobby-code-group > span { color: var(--muted); font-size: 16px; }
.lobby-code-group strong { color: var(--teal); font-size: clamp(28px, 3vw, 39px); line-height: 1.1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; letter-spacing: 2px; white-space: nowrap; }
.lobby-manual-join { margin-top: 17px; min-width: 0; }
.lobby-manual-join p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.lobby-manual-join a { display: inline-block; font-size: 16px; font-weight: 650; line-height: 1.4; color: var(--text); text-decoration: underline; text-decoration-color: #91aabd; text-underline-offset: 4px; overflow-wrap: anywhere; }
.lobby-players { display: flex; flex-direction: column; }
.lobby-roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.lobby-roster-heading > span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lobby-roster-area { flex: 1; min-height: 0; overflow: auto; }
.lobby-player-list { display: grid; gap: 4px; padding: 0; margin: 0; list-style: none; }
.lobby-player { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; border: 1px solid #344a61; border-radius: 5px; padding: 1px 9px; background: #1b3048; }
.lobby-player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 650; }
.lobby-player-status { flex: 0 0 auto; color: var(--muted); font-size: 14px; }
.party-member-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.party-member-position { min-width: 24px; flex: 0 0 auto; color: var(--teal); font-size: 15px; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.party-member-copy { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.party-member-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.queue-action { min-height: 42px; padding: 0 11px; border: 1px solid #57708a; border-radius: 5px; background: #233e58; color: var(--text); font-size: 17px; font-weight: 650; }
.queue-action:disabled { cursor: default; opacity: .35; }
.party-member[data-member-state="playing"], .party-member[data-member-state="selected"] { border-color: #5ee3cf70; background: #1a3848; }
.party-member[data-connected="false"] .lobby-player-name { color: #aebdcb; }
.player-list .party-member { padding: 10px; flex-wrap: wrap; gap: 9px; }
.player-list .party-member-info { flex-basis: 100%; }
.player-list .party-member-copy { align-items: flex-start; flex-direction: column; gap: 4px; }
.player-list .party-member-actions { margin-left: 34px; }
.lobby-player[data-ready="true"] .lobby-player-status { color: var(--teal); }
.lobby-empty { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 20px 0; }
.lobby-start-area { flex-shrink: 0; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.lobby-status { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; max-width: 390px; }
#lobbyStartButton { min-width: 140px; }
#lobbyStartButton:disabled { cursor: default; }
.tv-app[data-view="lobby"] .status-banner { position: static; transform: none; width: 100%; max-width: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 7px 28px; }
.tv-app[data-view="lobby"] .session-status, .tv-app[data-view="lobby"] .room-badge { display: none; }
.play-view { flex: 1; min-height: 0; display: flex; overflow: hidden; background: #02070d; }
.game-stage { min-width: 0; flex: 1; position: relative; }
#gameFrame { display: block; width: 100%; height: 100%; border: 0; background: #02070d; }
.tv-app[data-view="play"] .topbar { flex-basis: 56px; min-height: 56px; padding: 0 12px; gap: 12px; }
.tv-app[data-view="play"] .brand { display: none; }
.tv-app[data-view="play"] .brand i { display: none; }
.info-panel { flex: 0 0 clamp(270px, 26vw, 350px); width: clamp(270px, 26vw, 350px); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #102035; min-height: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 15px 13px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 17px; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 6px; background: #24374e; color: var(--text); font-size: 27px; line-height: 1; }
.panel-content { overflow-y: auto; padding: 15px; min-height: 0; }
.panel-empty { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0; }
.scores-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.scores-table th { padding: 0 7px 10px; color: var(--muted); font-size: 14px; font-weight: 700; text-align: left; border-bottom: 1px solid var(--line); }
.scores-table td { padding: 13px 7px; border-bottom: 1px solid #ffffff12; }
.scores-table th:not(:first-child), .scores-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.scores-table tr[data-active="true"] td { color: var(--teal); background: #5ee3cf08; }
.scores-table tr[data-summary="true"] td { font-weight: 800; border-bottom-color: #8a9cb1; }
.panel-content:focus-visible, body[data-tv-input="remote"] .panel-content:focus { outline-offset: -4px; box-shadow: none; }
.player-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.player-item { display: block; width: 100%; text-align: left; color: var(--text); border: 1px solid var(--line); background: #182c44; border-radius: 7px; padding: 13px; font: inherit; }
.player-item strong { display: block; font-size: 16px; }
.player-item small { display: block; margin-top: 5px; font-size: 14px; color: var(--muted); }
.player-item[data-active="true"] { border-color: #5ee3cf90; }
.status-banner { position: fixed; z-index: 10; left: 50%; bottom: 12px; transform: translateX(-50%); max-width: min(660px, calc(100vw - 32px)); width: max-content; padding: 10px 16px; background: #1e354a; border: 1px solid #678197; border-radius: 7px; box-shadow: 0 4px 18px #0005; color: var(--text); font-size: 14px; line-height: 1.4; }
.status-banner[data-kind="error"] { background: #3a2624; border-color: #cb856c; }
.tv-app[data-view="play"] .status-banner { position: static; transform: none; width: 100%; max-width: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 7px 12px; }
.invite-dialog { width: min(470px, calc(100vw - 36px)); max-height: calc(100dvh - 28px); padding: 20px; overflow-y: auto; border: 1px solid #59718a; border-radius: 12px; background: #13253a; color: var(--text); box-shadow: 0 18px 90px #0009; }
.invite-dialog::backdrop { background: #020812b8; backdrop-filter: blur(4px); }
.invite-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.invite-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
#inviteDescription { font-size: 16px; line-height: 1.45; color: var(--muted); margin: 10px 0; }
.invite-qr { display: grid; place-items: center; width: 160px; min-height: 160px; margin: 10px auto; padding: 8px; background: #fff; border-radius: 8px; }
.invite-qr > svg, .invite-qr > canvas, .invite-qr > img { max-width: 144px; height: auto; display: block; }
.invite-code-row { margin: 12px 0; text-align: center; color: var(--muted); }
.invite-code-row strong { color: var(--text); font-size: 23px; letter-spacing: 4px; margin-left: 8px; }
.invite-link { display: flex; width: 100%; }
.invite-url { font-size: 14px; text-align: center; color: var(--muted); overflow-wrap: anywhere; margin: 10px 0 0; }
.party-options-dialog { width: min(660px, calc(100vw - 36px)); }
.settings-tabs { display: flex; gap: 8px; margin-top: 18px; }
.settings-tabs [aria-selected="true"] { color: var(--teal); border-color: var(--teal); background: #1a3b49; }
.option-choices { padding: 0; margin: 16px 0; border: 0; min-width: 0; }
.option-choices legend { color: var(--muted); margin-bottom: 9px; padding: 0; font-size: 16px; font-weight: 650; }
.option-choices > div { display: flex; gap: 8px; flex-wrap: wrap; }
.option-choices .button[aria-pressed="true"] { color: #082b2a; background: var(--teal); border-color: var(--teal); }
#managedQueueList { gap: 10px; }
#managedQueueList .lobby-player { min-height: 56px; padding: 6px 10px; }
.invite-dialog [data-tv-focus] { scroll-margin: 10px; }
.settings-tabs { position: sticky; top: -20px; z-index: 1; background: #13253a; padding: 9px 0; }
.tv-app[data-view="play"] .session-info { min-width: 0; }
.tv-app[data-view="play"] .session-status { max-width: 250px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tv-app[data-view="play"] .room-badge { display: none; }
#manageQueuePanel { margin-top: 17px; }
.settings-room-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 20px; }
.settings-room-actions:has(> :not([hidden])) { display: flex; }
.settings-room-actions:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
.party-options-dialog .lobby-player { min-height: 34px; padding-block: 3px; }
.option-field { display: grid; gap: 9px; margin-top: 22px; font-size: 16px; font-weight: 650; }
.option-field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #637f98; border-radius: 6px; background: #0e1c30; color: var(--text); font: inherit; }
.option-checkbox { margin-top: 22px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.option-checkbox input { width: 20px; height: 20px; accent-color: var(--teal); }
.option-hint { margin: 8px 0 22px 30px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.options-status { color: #ffc0a5; font-size: 14px; line-height: 1.5; }
#savePartyOptionsButton, #saveMatchOptionsButton { width: 100%; }
#matchOptionsLock { margin-left: 0; }
@media (min-width: 1700px) and (min-height: 900px) {
  .topbar { flex-basis: 75px; padding-inline: 45px; }
  .brand { font-size: 34px; }
  .home-view { padding-top: 25px; gap: 22px; }
  .room-controls { flex-basis: 84px; padding-inline: 22px; }
  .room-label-detail, .watch-form > label { font-size: 18px; }
  .small-label { font-size: 15px; }
  .button { min-height: 52px; font-size: 18px; }
  .button-small { min-height: 48px; font-size: 18px; }
  .tv-app[data-view="play"] .topbar { flex-basis: 64px; min-height: 64px; }
  .watch-form input { width: 175px; height: 52px; }
  .games-section { max-height: 490px; }
  .section-heading { flex-basis: 32px; }
  .section-heading h1, .section-heading h2 { font-size: 25px; }
  .section-heading > span { font-size: 16px; }
  .game-card-bottom { left: 25px; right: 25px; bottom: 25px; }
  .game-card-bottom strong { font-size: 37px; }
  .game-card-bottom small { font-size: 18px; }
  .cartoons-section { flex-basis: 130px; }
  .cartoon-card { max-width: 720px; }
  .cartoon-card > img { width: 158px; flex-basis: 158px; }
  .cartoon-title strong { font-size: 23px; }
  .cartoon-title > span, .cartoon-play { font-size: 17px; }
  .lobby-view { max-width: 1800px; padding-top: 25px; gap: 22px; }
  .lobby-heading { flex-basis: 50px; }
  .lobby-heading h1 { font-size: 36px; }
  .lobby-join, .lobby-players { padding: 30px; }
  .lobby-join h2, .lobby-roster-heading h2 { font-size: 27px; }
  .lobby-qr { width: 240px; height: 240px; flex-basis: 240px; padding: 10px; }
  .lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { width: 220px; }
  .lobby-code-group strong { font-size: 49px; }
  .lobby-player { min-height: 50px; }
  .lobby-player-name { font-size: 22px; }
  .lobby-player-status, .lobby-status, .lobby-wifi, .lobby-manual-join a { font-size: 19px; }
}
@media (max-height: 600px) and (min-width: 901px) {
  .topbar { flex-basis: 56px; min-height: 56px; }
  .home-view { padding-top: 11px; padding-bottom: 13px; gap: 12px; }
  .room-controls { flex-basis: 60px; }
  .cartoons-section { flex-basis: 95px; }
  .game-card-bottom { bottom: 14px; }
  .lobby-view { padding-top: 12px; padding-bottom: 14px; gap: 12px; }
  .lobby-join, .lobby-players { padding: 16px 18px; }
  .lobby-roster-heading { margin-bottom: 9px; }
  .lobby-start-area { gap: 14px; margin-top: 10px; padding-top: 10px; }
}
@media (max-width: 1100px) {
  .room-label-detail { display: none; }
  .room-controls { gap: 13px; }
  .watch-form { gap: 8px; }
  .game-card-bottom { left: 14px; right: 14px; }
  .game-card-bottom strong { font-size: 24px; }
  .game-card-bottom small { font-size: 16px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .tv-app { min-height: 100dvh; height: auto; }
  .topbar { padding-inline: 18px; }
  .home-view { padding: 15px 18px 22px; }
  .room-controls { flex-wrap: wrap; justify-content: space-between; }
  .room-label { flex: 1; }
  .room-divider { display: none; }
  .watch-form { flex: 1 0 100%; padding-top: 8px; border-top: 1px solid var(--line); }
  .watch-form > label { margin-right: auto; }
  .room-label-detail { display: inline; }
  .games-section { flex: none; height: clamp(200px, 33vw, 300px); }
  .games-grid { gap: 11px; }
  .game-card-bottom strong { font-size: 21px; }
  .game-card-bottom small { display: none; }
  .cartoons-section { min-height: 105px; }
  .tv-app[data-view="play"] { height: 100dvh; min-height: 0; }
  .tv-app[data-view="play"] .brand { display: none; }
  .tv-app[data-view="play"] .session-status { display: none; }
  .info-panel { flex-basis: 245px; width: 245px; }
  .lobby-view { padding-inline: 18px; }
  .lobby-grid { grid-template-columns: minmax(290px, .95fr) minmax(320px, 1.1fr); gap: 12px; }
  .lobby-join, .lobby-players { padding: 16px; }
  .lobby-scan-row { gap: 12px; }
  .lobby-qr { width: 140px; height: 140px; flex-basis: 140px; }
  .lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { width: 124px; }
  .lobby-code-group strong { font-size: 27px; letter-spacing: 1px; }
  .lobby-start-area { align-items: stretch; flex-direction: column; gap: 10px; }
}
@media (max-width: 700px) {
  .lobby-view { flex: none; }
  .lobby-grid { display: flex; flex-direction: column; }
  .lobby-join { min-height: 310px; }
  .lobby-players { min-height: 260px; }
  .lobby-scan-row { gap: 28px; }
  .lobby-code-group strong { font-size: 34px; }
  .lobby-start-area { flex-direction: row; align-items: center; }
  .lobby-heading { flex-wrap: wrap; }
  .lobby-tools { flex-wrap: wrap; }
  .lobby-player { flex-wrap: wrap; padding: 7px; }
  .lobby-player .party-member-info { flex-basis: 100%; }
  .lobby-player .party-member-actions { margin-left: 34px; }
}
@media (max-width: 580px) {
  .topbar { min-height: 51px; }
  .session-info { gap: 6px; }
  .session-status { font-size: 14px; }
  .room-badge { font-size: 10px; padding: 4px 6px; }
  .room-badge strong { font-size: 12px; letter-spacing: 1px; }
  .room-controls { padding: 12px; gap: 12px; }
  .room-label-detail { display: none; }
  .small-label { font-size: 10px; letter-spacing: .5px; }
  .button { min-height: 42px; padding-inline: 12px; font-size: 14px; gap: 8px; }
  .watch-form input { width: 126px; font-size: 18px; }
  .watch-form > label { font-size: 14px; }
  .games-section { height: auto; max-height: none; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { height: 160px; }
  .game-card > img { object-position: center 43%; }
  .game-card-bottom strong { font-size: 26px; }
  .game-card-bottom small { display: block; }
  .cartoon-card { gap: 12px; }
  .cartoon-card > img { flex-basis: 93px; width: 93px; }
  .cartoon-title strong { font-size: 16px; }
  .cartoon-title > span { font-size: 14px; }
  .cartoon-play { padding-right: 12px; font-size: 14px; }
  .section-heading > span { display: none; }
  .game-title { display: none !important; }
  .tv-app[data-view="play"] .topbar { padding-inline: 8px; gap: 6px; }
  .button-small { padding: 0 9px; min-height: 32px; font-size: 14px; }
  .play-tools { gap: 5px; }
  .play-view:has(.info-panel:not([hidden])) .game-stage { display: none; }
  .info-panel { flex: 1; width: 100%; border-left: none; }
  .invite-dialog { padding: 18px; }
  .invite-heading h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Public TV presentation: real action, shared scorecards, and the waiting line. */
.lobby-grid { grid-template-columns: minmax(430px, 1.05fr) minmax(390px, 1fr); gap: 18px; }
.lobby-join { background: radial-gradient(ellipse at 0 0, #254d5940, transparent 75%), #12253a; }
.lobby-scan-row { align-items: center; gap: 24px; }
.lobby-qr { width: 216px; height: 216px; flex-basis: 216px; padding: 10px; border-radius: 10px; }
.lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { width: 196px; }
.lobby-code-copy { min-width: 0; flex: 1; }
.lobby-code-group strong { font-size: clamp(33px, 3.1vw, 48px); letter-spacing: 2px; }
.lobby-manual-join { margin-top: 22px; }
.lobby-manual-join p { margin-bottom: 5px; font-size: 14px; }
.lobby-manual-join a { font-size: 16px; }
.lobby-host-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #ffffff16; color: #d6e4e9; font-size: 16px; line-height: 1.4; }
.lobby-roster-heading > span { color: var(--teal); font-size: 20px; font-weight: 800; white-space: nowrap; }
#lobbyPlayerList { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#lobbyPlayerList .lobby-player { min-height: 54px; padding: 7px 10px; border-color: #3b5369; background: #1b3046; }
#lobbyPlayerList .party-member-copy { flex-direction: column; align-items: flex-start; gap: 3px; }
#lobbyPlayerList .lobby-player-name { display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: 18px; }
.lobby-player-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobbyPlayerList .lobby-player-status { font-size: 13px; }
#lobbyPlayerList .party-member-position { min-width: 17px; font-size: 15px; }
.host-badge { flex: 0 0 auto; font-size: 10px; font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: .6px; padding: 4px 5px; border-radius: 3px; color: #082b2a; background: var(--teal); }
#lobbyEmpty { min-height: 170px; display: flex; flex-direction: column; justify-content: center; gap: 10px; margin: 0; font-size: 24px; font-weight: 650; color: var(--text); }
#lobbyEmpty > span { color: var(--muted); font-size: 16px; font-weight: 400; }
#lobbyStartButton { min-width: 110px; font-size: 21px; }
.play-view { position: relative; }
.broadcast-screen { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #101d2d; }
.broadcast-header { flex: 0 0 72px; display: flex; gap: 20px; align-items: center; padding: 7px 18px; border-bottom: 1px solid #6f877b3d; background: linear-gradient(100deg, #173b43 0, #132638 34%, #142131 100%); }
.broadcast-bowler { flex: 0 0 225px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.broadcast-phase { font-size: 10px; line-height: 1.2; letter-spacing: 1.6px; color: var(--teal); font-weight: 850; }
#broadcastName { font-size: 24px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.5px; }
.broadcast-turn { font-size: 14px; line-height: 1.2; color: #d4e2e7; font-variant-numeric: tabular-nums; }
.broadcast-scorecard { min-width: 0; flex: 1; }
.scorecard-label { display: block; margin-bottom: 4px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broadcast-frames { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 1px; border: 1px solid #5c73826b; border-radius: 5px; overflow: hidden; background: #5c73823d; }
.broadcast-frame { min-width: 0; display: grid; grid-template-rows: 11px 16px 18px; align-items: center; justify-items: center; background: #172b3d; padding: 3px; font-variant-numeric: tabular-nums; }
.frame-number { font-size: 10px; line-height: 1; color: #9eb4c4; }
.frame-rolls { min-height: 16px; font-size: 14px; font-weight: 650; letter-spacing: 2px; }
.frame-total { min-height: 18px; font-size: 16px; line-height: 1.1; }
.broadcast-frame[data-active="true"] { background: #255758; box-shadow: inset 0 -3px 0 var(--teal); }
.broadcast-frame[data-active="true"] .frame-number { color: #c5fff2; }
.broadcast-screen .game-stage { flex: 1; min-height: 0; background: #120d18; }
.broadcast-scores { flex-shrink: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; padding: 7px 12px; border-top: 1px solid #ffffff1a; background: #101d2d; }
.broadcast-player { min-height: 35px; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 6px 10px; background: #1c3044; border: 1px solid #41566b; border-radius: 4px; }
.broadcast-player-name { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 15px; line-height: 1.12; }
.broadcast-player-total { flex: 0 0 auto; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.broadcast-player[data-kind="computer"] { border-color: #876f4e; }
.broadcast-player[data-away="true"] { background: #172636; border-style: dashed; }
.broadcast-player[data-active="true"] { background: #255557; border-color: var(--teal); box-shadow: inset 3px 0 0 var(--teal); }
.broadcast-scores[data-count="1"] { grid-template-columns: minmax(220px, 320px); }
.broadcast-scores[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.broadcast-scores[data-count="3"], .broadcast-scores[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.broadcast-next { flex: 0 0 31px; min-width: 0; display: flex; align-items: center; gap: 22px; padding: 0 16px 3px; color: #b8cbd5; background: #101d2d; font-size: 14px; line-height: 1.2; }
.on-deck { color: #e1f2f0; font-weight: 700; white-space: nowrap; }
.waiting-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broadcast-teams { margin-left: auto; flex: 0 0 auto; display: flex; gap: 22px; font-size: 16px; }
.broadcast-teams strong { color: #ecf7f6; margin-left: 4px; font-size: 19px; font-variant-numeric: tabular-nums; }
.broadcast-teams [data-team="computers"] { color: #e6c68f; }
.play-view .info-panel { position: absolute; z-index: 5; inset: 0 0 0 auto; width: min(410px, 40vw); box-shadow: -14px 0 35px #0007; }
.tv-app[data-view="play"] .room-badge { display: inline-flex; align-items: center; font-size: 12px; }
.tv-app[data-view="play"] #roomLabel { display: none; }
.tv-app[data-view="play"] .room-badge strong { margin-left: 0; }
@media (min-width: 1700px) and (min-height: 900px) {
  .lobby-grid { gap: 28px; }
  .lobby-qr { width: 300px; height: 300px; flex-basis: 300px; padding: 14px; }
  .lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { width: 272px; }
  .lobby-code-group strong { font-size: 58px; }
  .lobby-manual-join a, .lobby-host-note { font-size: 21px; }
  #lobbyPlayerList { gap: 12px; }
  #lobbyPlayerList .lobby-player { min-height: 80px; padding: 12px; }
  #lobbyPlayerList .lobby-player-name { font-size: 25px; }
  #lobbyPlayerList .lobby-player-status { font-size: 17px; }
  .broadcast-header { flex-basis: 100px; gap: 28px; padding: 12px 28px; }
  .broadcast-bowler { flex-basis: 340px; gap: 5px; }
  .broadcast-phase { font-size: 13px; }
  #broadcastName { font-size: 36px; }
  .broadcast-turn { font-size: 19px; }
  .broadcast-frame { grid-template-rows: 15px 22px 25px; padding: 5px; }
  .frame-number { font-size: 13px; }
  .frame-rolls { font-size: 20px; }
  .frame-total { font-size: 23px; }
  .scorecard-label { font-size: 14px; }
  .broadcast-scores { padding: 12px 22px; gap: 9px; }
  .broadcast-player { min-height: 52px; padding: 9px 14px; }
  .broadcast-player-name { font-size: 23px; }
  .broadcast-player-total { font-size: 31px; }
  .broadcast-next { flex-basis: 42px; padding-inline: 24px; font-size: 19px; }
  .broadcast-teams { font-size: 21px; }
  .broadcast-teams strong { font-size: 25px; }
}
@media (max-width: 1000px) {
  .lobby-grid { grid-template-columns: minmax(350px, 1fr) minmax(320px, 1fr); gap: 12px; }
  .lobby-qr { width: 165px; height: 165px; flex-basis: 165px; padding: 8px; }
  .lobby-qr > img, .lobby-qr > svg, .lobby-qr > canvas { width: 149px; }
  .lobby-scan-row { gap: 16px; }
  .lobby-code-group strong { font-size: 29px; }
  .broadcast-bowler { flex-basis: 170px; }
  .broadcast-header { gap: 12px; padding-inline: 12px; }
  #broadcastName { font-size: 20px; }
  .broadcast-player { padding-inline: 6px; }
  .broadcast-player-name { font-size: 14px; }
  .broadcast-player-total { font-size: 19px; }
  .tv-app[data-view="play"] .room-badge { display: none; }
}

/* A single turn introduction occupies the lane only until the player acts. */
.game-stage{position:relative}
.turn-introduction{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:.3rem;padding:clamp(20px,4vw,64px);pointer-events:none;background:linear-gradient(90deg,#06121de8 0%,#06121db0 40%,#06121d00 80%);color:#fff;z-index:2;text-shadow:0 3px 20px #0009}
.turn-introduction[hidden]{display:none}
.turn-introduction-label{color:#86e3d8;font-size:clamp(14px,1.5vw,24px);font-weight:800;letter-spacing:.2em}
.turn-introduction strong{font-size:clamp(38px,6.5vw,104px);font-weight:850;line-height:1.02;letter-spacing:-.035em;max-width:90%;overflow-wrap:anywhere}
.turn-introduction-detail{font-size:clamp(16px,2vw,30px);color:#d4e1ed;margin-top:.5rem}
.sound-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 22px}
.voice-volume{display:flex;align-items:center;gap:18px;font-size:16px;margin:16px 0}
.voice-volume input{flex:1;min-width:100px;accent-color:#80dfd3}
@media(max-height:600px){.turn-introduction{padding:20px 36px}.turn-introduction strong{font-size:clamp(36px,5.5vw,72px)}}

/* One silent reaction yields immediately to the next live action. */
.bowling-reaction-video{position:absolute;z-index:8;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;background:#081322}
.bowling-reaction-video[hidden]{display:none}
.sister-link{white-space:nowrap;text-decoration:none}
@media(max-width:640px){.topbar{flex-wrap:wrap}.play-tools{flex-wrap:wrap}.room-controls{flex-wrap:wrap}.room-controls .room-label{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.bowling-reaction-video{display:none}}

/* Couch-distance hierarchy: the lane stays central; names and marks read at 720p too. */
.room-controls{flex-basis:auto;min-height:100px;padding:16px 20px;gap:16px;background:linear-gradient(110deg,#18353c,#14263b 55%)}
.room-controls>.button{min-height:64px;min-width:150px;font-size:20px;border-radius:10px;padding-inline:24px}
.room-label{gap:8px}.room-label-detail{font-size:clamp(17px,1.35vw,24px);max-width:30ch;line-height:1.35}
.small-label{font-size:14px;letter-spacing:.13em}
.watch-options{position:relative;align-self:flex-end;color:var(--muted);font-size:16px;margin-top:-5px}
.watch-options>summary{cursor:pointer;min-height:40px;display:flex;align-items:center;gap:10px;padding:4px 10px;list-style:none;border-radius:6px}
.watch-options>summary::after{content:'⌄';font-size:22px}.watch-options[open]>summary::after{content:'⌃'}
.watch-options>.watch-form{position:absolute;top:100%;right:0;z-index:12;padding:18px;background:#152a40;border:1px solid #62778a;border-radius:10px;box-shadow:0 12px 32px #0007;color:var(--text)}
.section-heading h1,.section-heading h2{font-size:clamp(22px,1.5vw,29px)}
.section-heading>span{font-size:16px}.games-grid{grid-template-columns:1.3fr 1fr 1fr}
.game-category{font-size:14px}.game-card-bottom small{font-size:18px}
.bowling-card{border-color:#80dfd37a}.cartoon-title>span{font-size:16px}
.broadcast-header{flex-basis:94px;padding:10px 20px;gap:20px}
.broadcast-bowler{flex-basis:240px;gap:4px}
.broadcast-phase{font-size:14px;letter-spacing:.13em}
#broadcastName{font-size:clamp(30px,2.4vw,46px)}
.broadcast-turn{font-size:clamp(18px,1.4vw,25px)}
.scorecard-label{font-size:14px}
.broadcast-frame{grid-template-rows:15px 22px 24px;padding:4px}
.frame-number{font-size:14px}.frame-rolls{font-size:20px;line-height:1.1}.frame-total{font-size:22px}
.broadcast-player{min-height:48px;padding:8px 10px}.broadcast-player-name{font-size:clamp(18px,1.35vw,26px)}
.broadcast-player-total{font-size:clamp(28px,2vw,36px)}
.broadcast-next{flex-basis:36px;font-size:18px}.broadcast-teams{font-size:18px}.broadcast-teams strong{font-size:24px}
.tv-app[data-view="play"] .game-title,.tv-app[data-view="play"] .session-status{display:none}
.sister-link{border-color:#6dbbb380;color:#bff8ec}
@media(min-width:1600px) and (min-height:850px){
 .topbar{min-height:68px}.brand{font-size:32px}.home-view{padding:24px 42px 28px;gap:18px}
 .room-controls>.button{min-height:78px;min-width:190px;font-size:24px}
 .games-section{max-height:520px}.cartoons-section{flex-basis:130px}.cartoon-card{max-width:720px}
 .broadcast-header{flex-basis:112px;padding:12px 28px}.broadcast-bowler{flex-basis:320px}
 .broadcast-player{min-height:60px}.broadcast-next{flex-basis:42px}
}
@media(max-width:1100px){
 .room-controls{flex-wrap:wrap}.room-controls .room-label{flex-basis:100%}.room-controls>.button{flex:1;min-width:0;min-height:54px;font-size:18px}
 .broadcast-header{flex-basis:86px;padding:8px 12px;gap:12px}.broadcast-bowler{flex-basis:190px}
 #broadcastName{font-size:27px}.broadcast-turn{font-size:17px}.broadcast-phase{font-size:12px}
 .broadcast-frame{grid-template-rows:12px 18px 20px;padding:3px}.frame-number{font-size:12px}.frame-rolls{font-size:17px}.frame-total{font-size:19px}
 .broadcast-player-name{font-size:16px}.broadcast-player-total{font-size:24px}.broadcast-next{font-size:16px}
}
@media(max-width:640px){
 .room-controls{padding:14px;gap:9px}.room-controls>.button{font-size:16px;padding-inline:10px}
 .watch-options>.watch-form{max-width:calc(100vw - 36px);flex-wrap:wrap}.watch-form>label{flex-basis:100%}
 .games-grid{grid-template-columns:1fr}.broadcast-scorecard{overflow:auto}.broadcast-frames{min-width:500px}
}
