:root {
  --ink: #f4ecdd;
  --muted: rgba(244, 236, 221, .62);
  --faint: rgba(244, 236, 221, .38);
  --glass: rgba(22, 17, 13, .66);
  --glass-strong: rgba(18, 14, 11, .86);
  --line: rgba(255, 240, 215, .1);
  --gold: #e2bd77;
  --lime: #dfff63;
  --danger: #ff6a55;
  --radius: 18px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0a08; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
body > * { transition: opacity .8s ease; }
body:not(.is-ready) > *:not(#scene):not(.vignette) { opacity: 0; }

/* ---------- Top bar ---------- */
.topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 20px 14px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.back { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px 9px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background .2s; }
.back:hover { background: rgba(40, 31, 24, .8); }
.mark { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--serif); font-size: 26px; letter-spacing: .01em; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.mark sup { font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--gold); margin-left: 3px; vertical-align: top; position: relative; top: 4px; }
.top-actions { display: flex; gap: 8px; }
.top-actions button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: background .2s, transform .2s; }
.top-actions button:hover { background: rgba(40, 31, 24, .85); transform: translateY(-1px); }
.top-actions .menu { width: auto; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 800; display: none; }
body.is-playing .top-actions .menu { display: block; }
#btn-theme .fill { fill: currentColor; stroke: none; opacity: .55; }
#btn-sound .mute { display: none; }
#btn-sound.is-off .mute { display: block; }
#btn-sound.is-off .wave { display: none; }

/* ---------- Player cards ---------- */
.card { position: fixed; z-index: 10; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.player { left: 20px; width: 290px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: border-color .3s, box-shadow .3s, transform .4s, opacity .4s; }
.player.top { top: 76px; }
.player.bottom { bottom: 20px; }
body:not(.is-playing) .player, body:not(.is-playing) .side { opacity: 0; pointer-events: none; transform: translateY(8px); }
.player.is-turn { border-color: rgba(223, 255, 99, .55); box-shadow: 0 0 0 1px rgba(223, 255, 99, .2), 0 18px 50px rgba(0, 0, 0, .35), 0 0 34px rgba(223, 255, 99, .12); }
.avatar { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 28px; line-height: 1; }
.avatar[data-color="w"] { background: linear-gradient(160deg, #fbf3e3, #d9c9a8); color: #2a201c; }
.avatar[data-color="b"] { background: linear-gradient(160deg, #3a302b, #16110e); color: #f1e6cf; border: 1px solid rgba(255, 255, 255, .1); }
.player.is-thinking .avatar { animation: think 1.1s ease-in-out infinite; }
@keyframes think { 50% { transform: scale(.92); box-shadow: 0 0 0 6px rgba(223, 255, 99, .14); } }
.who { flex: 1; min-width: 0; }
.who .name { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.caps { display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-height: 18px; margin-top: 4px; font-size: 16px; line-height: 1; }
.caps i { font-style: normal; margin-right: -3px; }
.caps i[data-c="w"] { color: #f4ead6; text-shadow: 0 0 1px #000, 0 1px 2px rgba(0, 0, 0, .8); }
.caps i[data-c="b"] { color: #1b1512; text-shadow: 0 0 1px rgba(255, 255, 255, .65), 0 0 2px rgba(255, 255, 255, .35); }
.caps b { margin-left: 8px; font-size: 12px; color: var(--muted); }
.clock { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); color: var(--muted); min-width: 78px; text-align: center; }
.clock.is-running { background: var(--ink); color: #15110e; }
.clock.is-low.is-running { background: var(--danger); color: #fff; animation: low 1s steps(2) infinite; }
@keyframes low { 50% { opacity: .75; } }

/* ---------- Side panel ---------- */
.side { position: fixed; z-index: 10; right: 20px; top: 76px; bottom: 20px; width: 300px; display: flex; flex-direction: column; padding: 16px; gap: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); transition: opacity .4s, transform .4s; max-height: 640px; }
.status { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; min-height: 38px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.moves { flex: 1; margin: 0; padding: 0; list-style: none; overflow: auto; font-variant-numeric: tabular-nums; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.moves li { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 4px; padding: 4px 6px; border-radius: 8px; font-size: 13.5px; }
.moves li:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.moves li span { color: var(--faint); font-weight: 600; }
.moves li b { font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.moves li b.is-last { background: rgba(223, 255, 99, .16); color: var(--lime); }
.moves li.is-empty { display: block; color: var(--faint); font-size: 13px; padding: 14px 6px; background: none; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 12px; font-weight: 700; transition: background .2s, transform .15s, opacity .2s; }
.actions button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.actions button:disabled { opacity: .35; cursor: default; }
.actions button.accent { background: var(--lime); color: #17200a; border-color: transparent; }
.actions button.accent:hover:not(:disabled) { background: #eaff8f; }
.room-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(223, 255, 99, .08); font-size: 13px; color: var(--muted); }
.room-bar b { color: var(--ink); letter-spacing: .14em; margin-left: 4px; }
.room-bar button { border: 0; background: none; color: var(--lime); font-weight: 800; font-size: 12.5px; }

/* ---------- Start screen ---------- */
.start { position: fixed; z-index: 15; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 48px; padding: 96px clamp(24px, 6vw, 96px) 40px; background: linear-gradient(90deg, rgba(10, 8, 6, .9) 0%, rgba(10, 8, 6, .45) 45%, rgba(10, 8, 6, .2) 62%, rgba(10, 8, 6, .82) 100%); overflow: auto; }
.start-copy { max-width: 520px; }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.start h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(72px, 11vw, 150px); line-height: .9; letter-spacing: -.02em; }
.start h1 em { font-style: normal; color: var(--lime); }
.lede { margin: 22px 0 0; max-width: 430px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.facts li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 13px; color: var(--muted); font-weight: 600; }
.facts b { color: var(--ink); }
.start-card { display: flex; flex-direction: column; gap: 18px; padding: 22px; border-radius: 26px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 6px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 800; transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #17120e; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(223, 255, 99, .2); animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 7px rgba(223, 255, 99, 0); } }
.tab-body { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.field input, .join input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .28); outline: none; font-weight: 600; transition: border-color .2s; }
.field input:focus, .join input:focus { border-color: rgba(223, 255, 99, .6); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; padding: 10px 8px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; transition: all .2s; }
.seg button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .2); }
.seg button[aria-pressed="true"] { color: var(--ink); border-color: rgba(223, 255, 99, .7); background: rgba(223, 255, 99, .1); box-shadow: inset 0 0 0 1px rgba(223, 255, 99, .3); }
.chip { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip.w { background: #f1e6cf; }
.chip.b { background: #2a201c; border: 1px solid rgba(255, 255, 255, .35); }
.chip.r { background: linear-gradient(90deg, #f1e6cf 50%, #2a201c 50%); border: 1px solid rgba(255, 255, 255, .35); }
.sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.sw.walnut { background: conic-gradient(#e6cb9d 0 25%, #6e4327 0 50%, #e6cb9d 0 75%, #6e4327 0); }
.sw.marble { background: conic-gradient(#efece6 0 25%, #33403b 0 50%, #efece6 0 75%, #33403b 0); }
.sw.tournament { background: conic-gradient(#ecebd0 0 25%, #6f9450 0 50%, #ecebd0 0 75%, #6f9450 0); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--lime); color: #17200a; font-size: 15px; font-weight: 800; transition: transform .15s, background .2s, box-shadow .2s; box-shadow: 0 10px 30px rgba(223, 255, 99, .18); }
.primary:hover { background: #eaff8f; transform: translateY(-1px); box-shadow: 0 14px 34px rgba(223, 255, 99, .26); }
.join { display: flex; gap: 8px; }
.join input { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.join button { padding: 0 20px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); font-weight: 800; }
.join button:hover { background: rgba(255, 255, 255, .14); }
.note { margin: 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.note.is-error { color: var(--danger); }

/* ---------- Overlays ---------- */
.waiting, .result, .promo { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 5, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.waiting-card, .result-card, .promo-card { width: min(420px, 100%); padding: 30px 26px; border-radius: 26px; text-align: center; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, .55); animation: rise .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rise { from { transform: translateY(18px) scale(.96); opacity: 0; } }
.waiting-card h2, .result-card h2 { margin: 6px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; }
.waiting-card p, .result-card p { margin: 0 auto; max-width: 320px; color: var(--muted); line-height: 1.5; font-size: 14.5px; }
.pulse { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); animation: live 1.4s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(223, 255, 99, .2); }
.code { display: block; margin: 22px 0; font-size: 40px; letter-spacing: .28em; font-weight: 800; padding-left: .28em; color: var(--lime); }
.waiting-actions, .result-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.waiting-actions .primary, .result-actions .primary { grid-column: 1 / -1; }
.waiting-actions button:not(.primary), .result-actions button:not(.primary) { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-weight: 700; font-size: 13.5px; }
.waiting-actions button:not(.primary):hover, .result-actions button:not(.primary):hover { background: rgba(255, 255, 255, .1); }
.result-card small { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.result-card p { margin-bottom: 24px; }
.promo-card p { margin: 0 0 16px; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.promo-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.promo-row button { aspect-ratio: 1; border-radius: 18px; border: 1px solid var(--line); font-size: 46px; line-height: 1; display: grid; place-items: center; transition: transform .15s, border-color .2s; }
.promo-row button[data-c="w"] { background: linear-gradient(160deg, #fbf3e3, #d9c9a8); color: #2a201c; }
.promo-row button[data-c="b"] { background: linear-gradient(160deg, #3a302b, #16110e); color: #f1e6cf; }
.promo-row button:hover { transform: translateY(-3px) scale(1.04); border-color: var(--lime); }
.offer { position: fixed; z-index: 25; left: 50%; top: 76px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--glass-strong); border: 1px solid rgba(223, 255, 99, .4); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); font-size: 14px; font-weight: 700; white-space: nowrap; animation: rise .35s ease; }
.offer button { padding: 8px 14px; border-radius: 999px; border: 0; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, .08); }
.offer #offer-accept { background: var(--lime); color: #17200a; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #15110e; font-size: 13.5px; font-weight: 800; opacity: 0 !important; pointer-events: none; transition: opacity .3s, transform .3s; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.toast.is-on { opacity: 1 !important; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

/* ---------- Medium screens ---------- */
@media (max-width: 1180px) {
  .player { width: 250px; }
  .side { width: 260px; }
}
@media (max-width: 980px) {
  .start { grid-template-columns: 1fr; align-content: start; gap: 26px; padding-top: 84px; background: linear-gradient(180deg, rgba(10, 8, 6, .82), rgba(10, 8, 6, .55) 40%, rgba(10, 8, 6, .9)); }
  .start-copy { max-width: none; }
  .start h1 { font-size: 76px; }
  .lede { font-size: 15.5px; margin-top: 12px; }
  .facts { margin-top: 16px; }
  .start-card { max-width: 520px; width: 100%; }
}

/* ---------- Phones and tablets: cards top and bottom, panel docked ---------- */
@media (max-width: 900px) and (orientation: portrait), (max-width: 600px) {
  .topbar { padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
  .back span { display: none; }
  .back { padding: 9px; }
  .mark { font-size: 22px; }
  .top-actions { gap: 6px; }
  .top-actions button { width: 38px; height: 38px; }
  .player { left: 12px; right: 12px; width: auto; padding: 9px 10px; gap: 10px; border-radius: 16px; }
  .player.top { top: 62px; }
  .player.bottom { bottom: calc(118px + env(safe-area-inset-bottom)); }
  body[data-mode="online"] .player.bottom { bottom: calc(158px + env(safe-area-inset-bottom)); }
  .avatar { width: 38px; height: 38px; font-size: 24px; border-radius: 12px; }
  .caps { margin-top: 2px; font-size: 14px; min-height: 0; }
  .clock { font-size: 17px; min-width: 64px; padding: 6px 10px; }
  .side { left: 12px; right: 12px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-height: none; padding: 10px; gap: 8px; border-radius: 18px; }
  .status { min-height: 0; padding: 0 4px; background: none; font-size: 12.5px; text-align: center; color: var(--muted); }
  .moves { flex: none; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; }
  .moves::-webkit-scrollbar { display: none; }
  .moves li { display: flex; flex: none; gap: 2px; padding: 3px 4px; font-size: 12.5px; background: none !important; }
  .moves li span { margin-right: 1px; }
  .moves li b { padding: 1px 4px; }
  .moves li.is-empty { padding: 3px 4px; }
  .actions { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .actions button { flex-direction: row; justify-content: center; padding: 10px 4px; font-size: 0; gap: 0; }
  .actions button svg { width: 20px; height: 20px; }
  .room-bar { padding: 6px 10px; font-size: 12px; }
  .offer { top: 120px; font-size: 13px; }
  .toast { bottom: calc(190px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .start { padding: 76px 14px 20px; }
  .start h1 { font-size: 64px; }
  .eyebrow { margin-bottom: 8px; font-size: 11px; }
  .facts { display: none; }
  .start-card { padding: 16px; gap: 14px; border-radius: 22px; }
  .seg button { padding: 9px 4px; font-size: 12.5px; gap: 5px; }
  .tabs button svg { display: none; }
  .waiting-card h2, .result-card h2 { font-size: 34px; }
  .code { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 520px) { .mark { display: none; } }
@media (max-width: 980px) and (orientation: landscape) {
  .player { left: auto; right: 12px; width: 236px; padding: 8px 10px; gap: 10px; }
  .player.top { top: 64px; }
  .player.bottom { bottom: 12px; }
  .avatar { width: 36px; height: 36px; font-size: 22px; border-radius: 11px; }
  .clock { font-size: 16px; min-width: 60px; padding: 6px 8px; }
  .side { width: 236px; top: 138px; bottom: 86px; right: 12px; padding: 10px; gap: 8px; }
  .status { min-height: 0; padding: 8px 10px; font-size: 13px; }
  .actions { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .actions button { padding: 7px 4px; font-size: 11px; gap: 3px; }
  .room-bar { padding: 7px 10px; }
}

/* ---------- Penalty HUD ---------- */
#trail { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.board { position: fixed; z-index: 10; top: 70px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); min-width: 280px; transition: opacity .4s; }
body:not(.is-playing) .board, body:not(.is-playing) .hint { opacity: 0; pointer-events: none; }
.sb-row { display: grid; grid-template-columns: 70px 1fr 26px; align-items: center; gap: 10px; padding: 3px 0; }
.sb-team { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.sb-team i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); }
.sb-dots { display: flex; gap: 6px; }
.sb-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.sb-dots i.is-goal { background: #2bd17e; border-color: #2bd17e; box-shadow: 0 0 10px rgba(43,209,126,.6); }
.sb-dots i.is-miss { background: #ff5a4a; border-color: #ff5a4a; }
.sb-row b { font-size: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.sb-practice { display: flex; align-items: baseline; gap: 12px; font-weight: 700; color: var(--muted); }
.sb-practice b { font-size: 26px; color: var(--ink); }
.hint { position: fixed; z-index: 10; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; white-space: nowrap; transition: opacity .4s; }
.hint:empty { opacity: 0; }
.banner { position: fixed; z-index: 12; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); font-family: var(--serif); font-size: clamp(56px, 12vw, 132px); letter-spacing: -.02em; opacity: 0 !important; pointer-events: none; text-shadow: 0 8px 40px rgba(0,0,0,.6); transition: opacity .25s, transform .45s cubic-bezier(.2,1.4,.3,1); white-space: nowrap; }
.banner.is-on { opacity: 1 !important; transform: translate(-50%, -50%) scale(1); }
.banner.is-good { color: var(--lime); }
.banner.is-bad { color: #ff8a7a; }
.aim { position: fixed; z-index: 11; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 3px solid var(--lime); pointer-events: none; opacity: 0; }
.aim.is-on { animation: aim 1.2s ease-out forwards; }
@keyframes aim { 0% { opacity: 1; transform: scale(1.6); } 30% { transform: scale(1); } 100% { opacity: 0; transform: scale(.9); } }
.modes { display: grid; gap: 10px; }
.mode-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.05); text-align: left; transition: background .2s, transform .15s; }
.mode-btn:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.mode-btn b { display: block; font-size: 16px; }
.mode-btn small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.mode-btn.primary { background: var(--lime); color: #17200a; }
.mode-btn.primary small { color: rgba(23,32,10,.7); }
@media (max-width: 600px) { .board { top: 60px; min-width: 0; width: calc(100% - 20px); } .sb-dots i { width: 11px; height: 11px; } .hint { white-space: normal; text-align: center; width: calc(100% - 24px); } }

.loading { position:fixed;inset:0;background:#080f19;z-index:100;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#f6f8ec;font-family:Manrope,sans-serif; }
.loading[hidden],.replay-skip[hidden] {display:none}
.loading-ball {font-size:48px;animation:loading-spin 2s linear infinite}.loading p{font-size:20px;font-weight:800;margin:24px 0 8px}.loading small{color:#a8b7c4}.loading button{margin-top:24px;padding:12px 24px}
@keyframes loading-spin{to{transform:rotate(360deg)}}
.replay-skip{position:fixed;right:20px;bottom:max(28px,env(safe-area-inset-bottom));z-index:20;background:#101c2ade;border:1px solid #83909e66;border-radius:24px;color:white;padding:12px 20px;font:700 12px Manrope,sans-serif;letter-spacing:.06em}

/* Match broadcast: keep the player and ball unobstructed. */
:root{--ink:#f4f7fa;--muted:rgba(232,241,247,.65);--glass:rgba(8,17,26,.74);--glass-strong:rgba(8,17,26,.88);--line:rgba(210,231,244,.15)}
body{user-select:none;-webkit-user-select:none}
.board{left:24px;top:80px;transform:none;min-width:244px;padding:12px 16px;border-radius:7px;border-top:2px solid #dfff63;box-shadow:0 8px 32px #0004}
.sb-heading{display:flex;justify-content:space-between;gap:16px;text-transform:uppercase;letter-spacing:.14em;font-size:9px;font-weight:800;color:#bdcbd6;margin-bottom:8px;padding-bottom:7px;border-bottom:1px solid #ffffff19}
.sb-row{grid-template-columns:60px 1fr 24px;gap:8px}.sb-row b{font-size:20px}.sb-dots{gap:5px}.sb-dots i{width:10px;height:10px;border-width:1px}.sb-team{font-size:12px}.sb-team i{width:8px;height:8px}
.sb-practice{font-size:11px}.sb-practice b{font-size:22px}
.banner{top:max(170px,23vh);font-family:var(--sans);font-size:clamp(26px,4vw,48px);font-weight:800;letter-spacing:.04em;background:#09131be8;border:1px solid #ffffff26;border-radius:6px;padding:10px 26px;box-shadow:0 8px 40px #0004}
.hint{font-size:12px;font-weight:500;background:#08111ac9;max-width:520px;bottom:max(20px,env(safe-area-inset-bottom));border-radius:7px}
@media(max-width:600px){.board{left:12px;top:64px;width:220px;min-width:0;padding:10px 12px}.sb-heading{font-size:8px}.sb-practice b{font-size:20px}.banner{top:182px}.hint{width:calc(100% - 32px);font-size:11px}.replay-skip{bottom:76px;right:16px}}
@media(max-height:480px) and (orientation:landscape){.board{left:16px;top:62px;padding:8px 12px;width:225px}.banner{top:92px;left:56%;font-size:25px}.hint{bottom:10px;padding:7px 14px}.start{grid-template-columns:1fr 1.15fr;gap:24px;padding:70px 24px 20px}.start h1{font-size:62px}.start .lede{font-size:13px;line-height:1.6}.start .facts{display:none}.start-card{padding:14px;gap:10px}.start-card .field{gap:5px}.mode-btn{padding:10px 12px}.mode-btn b{font-size:13px}.mode-btn small,.start .note{font-size:10px}}

/* Broadcast presentation */
:root{--lime:#c3e8c8;--gold:#b7cebd;--radius:10px}
.mark{font-family:var(--sans);font-size:18px;font-weight:800;font-style:italic;letter-spacing:-.04em;text-transform:uppercase}.mark sup{font-style:normal;font-size:8px;top:1px}
.back,.top-actions button,.top-actions .menu{border-radius:7px;background:#0b1722cf;border-color:#d4e2eb29}
.board{border-radius:3px;background:linear-gradient(110deg,#101d29ed,#162b3ae8);border-top-color:#b1d9bc;box-shadow:0 5px 18px #0003}
.sb-dots i.is-goal{box-shadow:none;background:#d5ead9;border-color:#d5ead9}.sb-dots i.is-miss{background:#cc6259;border-color:#cc6259}
.start{background:linear-gradient(90deg,#06121df5 0%,#071521b3 39%,#07152122 64%,#071521db 100%)}
.start h1{font-family:var(--sans);font-size:clamp(72px,10vw,140px);font-weight:800;font-style:italic;text-transform:uppercase;letter-spacing:-.065em;line-height:1}
.start .lede{max-width:390px;font-size:16px;color:#d8e2e9;line-height:1.75}.start .eyebrow{font-size:10px;letter-spacing:.2em;color:#bdd7c5}
.start-card{border-radius:10px;background:#0b1b28ed;box-shadow:0 24px 64px #0005;border-color:#adc5d329}.mode-btn,.seg{border-radius:7px}.mode-btn.primary{background:#c3e8c8;color:#10261a}.mode-btn.primary small{color:#2b4b38}.mode-btn:hover{transform:none}
.banner{border-radius:3px;font-size:clamp(24px,3vw,40px);font-style:italic;letter-spacing:-.02em;padding:10px 22px;background:#0b1c2bef;border-color:#b1d9bc40}.hint{font-size:11px;border-radius:4px;background:#0b1c2be0}
.vignette{background:radial-gradient(120% 100% at 50% 45%,transparent 65%,#00101d38 100%)}
@media(max-width:600px){.start{background:linear-gradient(180deg,#071521dc,#07152199 35%,#071521ed)}.start h1{font-size:72px}.start .lede{font-size:13px;max-width:340px}.start-card{border-radius:8px}.start .facts{font-size:10px}.mark{display:none}}
@media(max-height:480px) and (orientation:landscape){.start h1{font-size:62px}.start .lede{font-size:12px}}
.loading{opacity:1!important;transition:none}
