:root {
  --bg: #07081a;
  --bg2: #0d1030;
  --card: #11143a;
  --card2: #181c4b;
  --line: rgba(150, 160, 255, .14);
  --line2: rgba(150, 160, 255, .28);
  --text: #f1f2ff;
  --dim: #a3a9d8;
  --mute: #6d74a6;
  --lime: #d7f53c;
  --pink: #ff3fa4;
  --cyan: #35c8ff;
  --live: #ff3b5c;
  --ok: #3ee08f;
  --display: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
  --body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at -10% -8%, rgba(255, 63, 164, .18), transparent 60%),
    radial-gradient(900px 520px at 110% -5%, rgba(53, 200, 255, .15), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }
b, .n, .pts, .lc-score, .mc-p, .tap-score, .timer { font-variant-numeric: tabular-nums; }

.boot { padding: 40vh 16px; text-align: center; color: var(--dim); }

/* ── Shared bits ── */
.dot { display: inline-block; width: .7em; height: .7em; min-width: .7em; max-width: .7em; background: var(--c); box-shadow: 0 0 10px var(--c); flex: 0 0 auto !important; transform: rotate(45deg); border-radius: 2px; }
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-k { font-size: 11px; font-weight: 800; letter-spacing: .28em; text-transform: uppercase; color: var(--cyan); }
.brand-n { font-family: var(--display); font-size: 24px; letter-spacing: .02em; text-transform: uppercase; }
.brand-n b { color: var(--lime); font-weight: 400; }
.brand.big .brand-n { font-size: 34px; }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line2); color: var(--dim); white-space: nowrap; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn.on { color: var(--ok); }
.conn.on i { animation: pulse 1.6s infinite; }
.conn.off { color: var(--live); }
.conn.demo { color: var(--lime); border-color: rgba(215, 245, 60, .35); }

.chip { font-size: 10px; font-weight: 800; letter-spacing: .14em; padding: 3px 7px; border-radius: 5px; background: var(--card2); color: var(--dim); }
.chip.live { background: var(--live); color: #fff; animation: glow 1.8s infinite; }
.chip.done { background: rgba(215, 245, 60, .14); color: var(--lime); }
.mini-live { font-size: 9px; font-weight: 800; letter-spacing: .12em; color: var(--live); margin-left: 6px; }
.wc { font-size: 9px; font-weight: 800; letter-spacing: .12em; color: #1a1300; background: var(--lime); padding: 2px 6px; border-radius: 4px; }
.srv { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); flex: none; }
.muted { color: var(--mute) !important; }

.sec-h { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; margin: 22px 0 10px; }
.sec-h.small { font-size: 17px; color: var(--dim); margin: 20px 0 8px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 59, 92, .7); animation: ring 1.6s infinite; }

.btn-primary, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 800; font-size: 14px; letter-spacing: .02em; text-decoration: none; }
.btn-primary { background: var(--lime); color: #111400; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }
.btn-ghost { border: 1px solid var(--line2); color: var(--text); background: rgba(255, 255, 255, .03); }
.btn-danger { background: rgba(255, 59, 92, .14); color: #ff8ea1; border: 1px solid rgba(255, 59, 92, .4); }
.sm { min-height: 36px; padding: 0 12px; font-size: 12px; border-radius: 10px; }

.timer { font-family: var(--display); letter-spacing: .04em; color: var(--lime); margin-left: 10px; }
.timer.urgent { color: var(--live); animation: glow 1s infinite; }
.timer.over { color: var(--live); }
.timer.idle { color: var(--mute); }

.bump { animation: bump .6s cubic-bezier(.2, 1.4, .4, 1); }

/* ── Audience ── */
.aud { max-width: 1080px; margin: 0 auto; padding-inline: 16px; padding-block: 14px 40px; }
.aud-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px 4px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, transparent); padding-top: max(8px, env(safe-area-inset-top)); }
.aud-foot { margin-top: 36px; text-align: center; font-size: 12px; color: var(--mute); }

.live-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lcard { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid var(--line); }
.lcard.is-live { border-color: rgba(255, 59, 92, .45); box-shadow: 0 0 0 1px rgba(255, 59, 92, .15), 0 10px 40px -18px rgba(255, 59, 92, .6); }
.lc-meta { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.lc-cat { font-weight: 800; font-size: 14px; color: var(--lime); display: flex; align-items: center; }
.lc-cat span { color: var(--mute); font-weight: 700; font-size: 12px; margin-left: 6px; }
.lc-row { display: flex; align-items: center; gap: 10px; }
.lc-team { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-score { font-family: var(--display); font-size: 40px; line-height: 1; min-width: 1.4em; text-align: right; }
.lc-foot { font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 8px; }
.lc-foot b { color: var(--text); }

.tabs { display: flex; gap: 4px; margin: 24px 0 6px; padding: 4px; background: var(--card); border-radius: 12px; border: 1px solid var(--line); position: sticky; top: 52px; z-index: 4; }
.tabs a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 9px; text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--dim); }
.tabs a.on { background: var(--lime); color: #111400; }

.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px 8px; overflow: hidden; }
.gcard-h { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 12px 6px; }
.gcard-h h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; text-transform: uppercase; letter-spacing: .03em; }
.gcard-h span { font-size: 11px; color: var(--mute); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.st { width: 100%; border-collapse: collapse; }
.st { table-layout: auto; }
.st th { font-size: 10px; letter-spacing: .12em; color: var(--mute); font-weight: 800; text-align: right; padding: 6px 8px; }
.st td { padding: 11px 8px; text-align: right; border-top: 1px solid var(--line); font-weight: 700; font-size: 14px; white-space: nowrap; }
.st .tm { text-align: left; width: 100%; max-width: 0; }
.tmw { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.st .mini-live { margin-left: 0; flex: none; }
.st .rk { color: var(--mute); text-align: center; width: 30px; }
.st tr.bye .rk, .st tr.q .rk { color: var(--lime); }
.st tr.bye td:first-child, .st tr.q td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.st tr.elim { opacity: .55; }
.tag { font-size: 9px; font-weight: 800; letter-spacing: .1em; padding: 2px 6px; border-radius: 5px; flex: none; }
.tag.bye { background: var(--lime); color: #111400; }
.st .pts { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--text); }
.st .n { color: var(--dim); }
.st .n.pts { color: var(--text); }

.how { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; font-size: 14px; color: var(--dim); line-height: 1.55; }
.how summary { font-weight: 800; color: var(--text); cursor: pointer; }
.how-grid { display: grid; grid-template-columns: auto auto auto auto auto auto auto auto; gap: 6px 14px; justify-content: start; margin: 8px 0; }
.how-grid b { color: var(--lime); }
@media (max-width: 480px) { .how-grid { grid-template-columns: auto auto; } }

.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; scroll-margin-top: 110px; }
.mcard.is-live { border-color: rgba(255, 59, 92, .45); }
.mc-head { width: 100%; text-align: left; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.mc-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mc-t { display: flex; align-items: center; gap: 10px; color: var(--dim); }
.mc-t.won { color: var(--text); }
.mc-n { flex: 1; font-weight: 700; font-size: 15px; }
.mc-p { font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--text); }
.mc-t:not(.won) .mc-p { color: var(--dim); }
.mc-plabel { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); text-align: right; margin-top: -4px; }
.mc-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mc-bar i { display: block; height: 100%; background: var(--lime); transition: width .5s; }
.mc-more { font-size: 11px; color: var(--mute); font-weight: 700; }
.bd-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.bd { width: 100%; border-collapse: collapse; font-size: 13px; }
.bd th { font-size: 10px; letter-spacing: .1em; color: var(--mute); text-align: right; padding: 8px 12px; font-weight: 800; }
.bd th:first-child { text-align: left; }
.bd td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: right; font-weight: 700; color: var(--dim); }
.bd td.g { text-align: left; color: var(--text); }
.bd td.g small { display: block; font-size: 10px; color: var(--mute); font-weight: 700; }
.bd td.sc { color: var(--text); white-space: nowrap; }
.bd td.w { color: var(--lime); }
.bd tr.cur { background: rgba(255, 59, 92, .08); }

/* Bracket */
.bracket3 { display: flex; flex-direction: column; gap: 22px; margin-top: 16px; }
.bstage-h { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; color: var(--dim); }
.bstage-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bfinal .bstage-row { grid-template-columns: minmax(220px, 360px); }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.bcard.is-live { border-color: rgba(255, 59, 92, .5); }
.bcard-h { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.bslot { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 700; }
.bslot:first-of-type { border-top: 0; }
.bslot.tbd { color: var(--mute); font-size: 13px; font-weight: 600; }
.bslot.bye { color: var(--dim); }
.bslot.bye .bn { color: var(--text); }
.bslot.bye small { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lime); flex: none; }
.bslot.won .bn { color: var(--lime); }
.bn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp { font-family: var(--display); font-weight: 400; font-size: 22px; }
.bfinal .bcard { border-color: rgba(215, 245, 60, .35); box-shadow: 0 10px 40px -20px rgba(215, 245, 60, .5); }
.champ { text-align: center; margin-top: 12px; padding: 14px; border-radius: var(--r); background: linear-gradient(135deg, rgba(215, 245, 60, .2), rgba(255, 63, 164, .15)); }
.champ span { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--lime); }
.champ b { font-family: var(--display); font-weight: 400; font-size: 34px; text-transform: uppercase; }

/* ── Scorer ── */
body[data-view="score"] { overscroll-behavior: none; }
.sc { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 10px 24px; min-height: 100vh; display: flex; flex-direction: column; }
.sc-top { display: flex; align-items: center; gap: 12px; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 8px; }
.sc-top .brand { flex: 1; }
.sc-top-r { display: flex; align-items: center; gap: 8px; }
.back { font-size: 34px; line-height: 1; text-decoration: none; width: 40px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.sc-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-title b { font-size: 15px; }
.sc-title span { font-size: 12px; color: var(--dim); font-weight: 700; }
.court { display: flex; flex-direction: column; align-items: center; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.court select { font: inherit; font-size: 16px; font-weight: 800; color: var(--text); background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; letter-spacing: 0; }

.slist { display: flex; flex-direction: column; gap: 10px; }
.srow { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.srow.is-live { border-color: rgba(255, 59, 92, .5); }
.srow:active { transform: scale(.99); }
.srow-meta { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.srow-t { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.srow-t > span:not(.dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-t b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.srow-t .live-num { color: var(--lime); font-size: 26px; }
.srow-t .srv-sp { width: 8px; height: 8px; flex: none; }
.srow-cat { font-size: 12px; font-weight: 800; color: var(--dim); }
.srow-cat span { color: var(--mute); font-weight: 700; margin-left: 4px; }
.srow-go { font-size: 12px; color: var(--lime); font-weight: 800; text-align: right; }
.srow:not(.is-live) .srow-go { color: var(--dim); }
.empty { color: var(--dim); text-align: center; padding: 40px 0; }

.pills { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 7px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.pill span { font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.pill small { font-size: 11px; color: var(--mute); font-weight: 700; }
.pill.started small { color: var(--live); }
.pill.done { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.pill.done small { color: var(--text); }
.pill.on { outline: 2px solid var(--lime); outline-offset: 1px; }

.board { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bd-cat { font-size: 15px; }
.bd-cat b { color: var(--lime); }
.bd-cat small { display: block; font-size: 11px; color: var(--mute); font-weight: 600; margin-top: 2px; }
.rapid { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--card); border-radius: 12px; border: 1px solid var(--line); }
.rapid .timer { font-size: 34px; margin: 0; }

.tap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 26vh; border-radius: 20px; padding: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, var(--card2)), color-mix(in srgb, var(--c) 10%, var(--card)));
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  user-select: none; -webkit-user-select: none; transition: transform .08s; }
.tap:active { transform: scale(.975); background: color-mix(in srgb, var(--c) 42%, var(--card2)); }
.tap.serving { box-shadow: 0 0 0 3px var(--lime), 0 0 34px -6px var(--c); }
.tap-name { font-weight: 800; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; }
.tap-score { font-family: var(--display); font-size: clamp(76px, 22vw, 128px); line-height: .95; }
.tap-hint { font-size: 11px; font-weight: 700; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.tap.serving .tap-hint { color: var(--lime); }

.mid { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.mid button { min-height: 48px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); font-weight: 800; }
.minus { font-size: 18px; color: var(--dim); }
.sideout { font-size: 14px; letter-spacing: .04em; color: var(--lime); }
.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wcb { min-height: 40px; border-radius: 10px; border: 1px dashed var(--line2); font-size: 12px; font-weight: 700; color: var(--dim); }
.wcb.on { background: var(--lime); color: #111400; border-style: solid; border-color: var(--lime); }
.finish { min-height: 40px; font-size: 13px; font-weight: 700; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.board-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.manual-cta { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 14px 18px; border-radius: 16px; text-align: left;
  background: linear-gradient(135deg, var(--lime), #b8e02a); color: #111400; border: 0;
  box-shadow: 0 10px 30px -12px rgba(215, 245, 60, .7); transition: transform .08s; }
.manual-cta:active { transform: scale(.98); }
.manual-cta-i { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(17, 20, 0, .12); }
.manual-cta-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.manual-cta-t b { font-size: 18px; font-weight: 800; }
.manual-cta-t small { font-size: 12px; font-weight: 700; opacity: .75; }
.manual-cta-go { flex: none; font-size: 30px; font-weight: 800; line-height: 1; }
.or-tap { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); display: flex; align-items: center; gap: 10px; }
.or-tap::before, .or-tap::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.manual-save { min-height: 60px; font-size: 18px; }

.manual { display: flex; flex-direction: column; gap: 10px; }
.manual-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.manual-row { min-height: 84px; }
.manual-row span { font-weight: 800; font-size: 17px; }
.manual-row input { width: 110px; font: inherit; font-family: var(--display); font-size: 44px; text-align: center; padding: 8px; border-radius: 12px; border: 2px solid var(--line2); background: var(--bg2); color: var(--text); }
.manual-row input:focus { border-color: var(--lime); outline: none; }

.result { text-align: center; padding: 26px 18px; border-radius: 20px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 26%, var(--card2)), var(--card)); border: 2px solid color-mix(in srgb, var(--c) 50%, transparent); display: flex; flex-direction: column; gap: 6px; }
.result-k { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.result-w { font-family: var(--display); font-size: 30px; text-transform: uppercase; }
.result-s { font-family: var(--display); font-size: 72px; line-height: 1; }
.result-p { font-weight: 700; color: var(--lime); }
.result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.mdone { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: center; font-weight: 700; }

.sm-total { position: sticky; bottom: 0; margin-top: 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 14px; background: rgba(13, 16, 48, .92); backdrop-filter: blur(10px); border: 1px solid var(--line2); }
.smt { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.smt.r { justify-content: flex-end; }
.smt b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.smt-mid { text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.smt-mid small { letter-spacing: .04em; }

.sheet-bg { position: fixed; inset: 0; background: rgba(4, 5, 16, .6); z-index: 20; animation: fade .2s; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); z-index: 21; background: var(--bg2); border: 1px solid var(--line2); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 22px 18px; padding-bottom: max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; text-align: center; animation: up .28s cubic-bezier(.2, 1.2, .4, 1); }
.sheet-k { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sheet-w { font-family: var(--display); font-size: 32px; text-transform: uppercase; }
.sheet-p { color: var(--dim); font-weight: 600; }
.sheet-p b { color: var(--lime); }
.sheet-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 12px; }
.sheet-btns button { min-height: 56px; font-size: 16px; }

.login { justify-content: center; gap: 18px; }
.login h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 28px; margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.login-form input { font: inherit; font-size: 18px; padding: 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--text); }
.err { color: #ff8ea1; font-weight: 600; margin: 0; }
.link { color: var(--dim); font-size: 13px; text-align: center; }

.admin .asec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.admin h2 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 20px; letter-spacing: .03em; }
.hint { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.5; }
.hint.warn { color: #ffcf6b; }
.notice { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(215, 245, 60, .08); border: 1px solid rgba(215, 245, 60, .3); font-size: 13px; line-height: 1.5; color: var(--lime); }
.linkrow { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }
.linkrow > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.linkrow code { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset { text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 2px; }
.preset b { font-size: 13px; }
.preset span { font-size: 12px; color: var(--dim); }
.preset em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--lime); }
.preset.on { border-color: var(--lime); background: rgba(215, 245, 60, .08); }
.fmt { display: flex; flex-direction: column; }
.fmt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.fmt-row span { flex: 1; }
.fmt-row input { width: 64px; font: inherit; font-weight: 800; font-size: 16px; text-align: center; padding: 7px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); }
.fmt-row em { font-style: normal; font-size: 12px; color: var(--mute); }
.fmt-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.fmt-foot b { color: var(--lime); font-size: 16px; }
.abtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger { border-color: rgba(255, 59, 92, .3) !important; }

/* ── TV ── */
body[data-view="tv"] { overflow: hidden; cursor: none; }
.tv { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; gap: 1.4vh; padding: 2vh 2vw 0; }
.tv-top { display: flex; align-items: center; gap: 2vw; }
.tv-brand { font-family: var(--display); font-size: 3.4vh; letter-spacing: .04em; flex: 1; }
.tv-brand b { color: var(--lime); font-weight: 400; }
.tv-clock { font-family: var(--display); font-size: 3.4vh; color: var(--dim); }
.tv .conn { font-size: 1.3vh; }
.tv-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.6vw; min-height: 0; }
.tv-courts, .tv-side { min-height: 0; }
.tv-side { display: flex; flex-direction: column; gap: 1.4vh; overflow: hidden; }
.tv-h { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2.6vh; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.tv-side .gcard { padding: .4vh .3vw .8vh; }
.tv-side .gcard-h h3 { font-size: 3vh; }
.tv-side .gcard-h span { font-size: 1.3vh; }
.tv-side .st th { font-size: 1.25vh; padding: .6vh .8vw; }
.tv-side .st td { font-size: 2vh; padding: 1.1vh .8vw; }
.tv-side .st .pts { font-size: 3.2vh; }
.tv-side .dot { width: 1.4vh; height: 1.4vh; }
.tv-side .bracket3 { gap: 1.6vh; margin: 0; }
.tv-side .bstage-h { font-size: 2vh; margin-bottom: .6vh; }
.tv-side .bstage-row { grid-template-columns: 1fr; gap: .8vh; }
.tv-side .bfinal .bstage-row { grid-template-columns: 1fr; }
.tv-side .bslot { font-size: 2vh; }
.tv-side .bp { font-size: 2.8vh; }

.tv-grid { display: grid; gap: 1.4vh; height: 100%; }
.tv-grid.n1 { grid-template-rows: 1fr; }
.tv-grid.n2 { grid-template-rows: 1fr 1fr; }
.tv-grid.n3 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr; }
.tv-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tvc { display: flex; flex-direction: column; justify-content: space-between; gap: 1vh; padding: 2vh 1.6vw; border-radius: 2vh; background: linear-gradient(160deg, var(--card2), var(--card)); border: 1px solid rgba(255, 59, 92, .35); min-height: 0; overflow: hidden; }
.tvc-meta { display: flex; align-items: center; gap: .8vw; font-size: 1.6vh; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tvc-meta .chip { font-size: 1.3vh; }
.tvc-cat { font-weight: 800; font-size: 2.6vh; color: var(--lime); display: flex; align-items: center; }
.tvc-cat > span { color: var(--mute); font-size: 1.8vh; margin-left: .8vw; }
.tvc-cat .timer { font-size: 3vh; }
.tvc-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.2vw; flex: 1; }
.tvc-team { display: flex; flex-direction: column; gap: .6vh; min-width: 0; }
.tvc-team.b { align-items: flex-end; text-align: right; }
.tvc-name { font-family: var(--display); font-size: 4.6vh; line-height: 1.02; text-transform: uppercase; color: var(--c); text-shadow: 0 0 30px color-mix(in srgb, var(--c) 45%, transparent); }
.tvc-mp { font-size: 1.8vh; font-weight: 700; color: var(--dim); }
.tvc-mp b { color: var(--text); font-size: 2.6vh; }
.wc.big { font-size: 1.5vh; align-self: flex-start; }
.tvc-team.b .wc.big { align-self: flex-end; }
.tvc-score { display: flex; align-items: center; gap: 1vw; font-family: var(--display); font-size: 14vh; line-height: 1; }
.tvc-score i { font-style: normal; color: var(--mute); font-size: .6em; }
.tvc-score span { position: relative; min-width: .9em; text-align: center; }
.tvc-score span.srv-on::after { content: ''; position: absolute; left: 50%; bottom: -1.2vh; width: 1.4vh; height: 1.4vh; margin-left: -.7vh; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.tv-grid.n3 .tvc-body { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; text-align: center; gap: .8vh; }
.tv-grid.n3 .tvc-team { align-items: center !important; text-align: center; }
.tv-grid.n3 .tvc-score { font-size: 11vh; order: 2; }
.tv-grid.n3 .tvc-team.a { order: 1; }
.tv-grid.n3 .tvc-team.b { order: 3; }
.tv-grid.n3 .tvc-name { font-size: 3.6vh; }
.tv-grid.n4 .tvc-score { font-size: 9vh; }
.tv-grid.n4 .tvc-name { font-size: 3vh; }
.tv-grid.n2 .tvc-score { font-size: 11vh; }
.tvc-games { display: flex; gap: .5vw; flex-wrap: wrap; }
.gp { font-size: 1.4vh; font-weight: 800; letter-spacing: .06em; padding: .5vh .6vw; border-radius: .8vh; background: var(--bg2); color: var(--mute); display: inline-flex; gap: .4vw; }
.gp.done { background: color-mix(in srgb, var(--c) 22%, var(--bg2)); color: var(--text); }
.gp b { font-weight: 800; }
.gp.cur { outline: 2px solid var(--live); color: var(--text); }
.tv-next { display: flex; flex-direction: column; gap: 1.4vh; padding: 3vh 2vw; border-radius: 2vh; background: var(--card); border: 1px solid var(--line); height: 100%; }
.tv-next.tv-fill { justify-content: center; align-items: center; }
.tv-next h2 { margin: 0 0 1vh; font-family: var(--display); font-weight: 400; font-size: 5vh; text-transform: uppercase; color: var(--lime); }
.tvn-row { display: flex; align-items: center; gap: 1vw; font-size: 3vh; font-weight: 800; padding-block: 1.6vh; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tvn-row i { color: var(--mute); font-style: normal; font-size: 2vh; }
.tvn-row em { margin-left: auto; font-style: normal; font-size: 1.7vh; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.tvn-row .dot { width: 2vh; height: 2vh; }

/* Live + Up-next split (both always visible on TV) */
.tv-split { display: flex; flex-direction: column; gap: 1.4vh; height: 100%; min-height: 0; }
.tv-split .tv-grid { flex: 1; min-height: 0; }
.tv-empty { flex: 1; display: flex; align-items: center; justify-content: center; gap: 1vw; border-radius: 2vh; background: var(--card); border: 1px dashed var(--line2); color: var(--mute); font-size: 2.4vh; font-weight: 700; letter-spacing: .04em; }
.pulse-dim { width: 1.6vh; height: 1.6vh; border-radius: 50%; background: var(--mute); flex: none; animation: pulse 1.6s infinite; }
.tv-next-strip { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 1.6vh; padding: 1.2vh 1.6vw; }
.tv-next-strip h3 { margin: 0 0 .6vh; font-family: var(--display); font-weight: 400; font-size: 1.9vh; text-transform: uppercase; letter-spacing: .08em; color: var(--lime); }
.tvn-row.sm { font-size: 1.9vh; padding-block: .7vh; gap: .7vw; }
.tvn-row.sm .dot { width: 1.3vh; height: 1.3vh; }
.tvn-row.sm em { font-size: 1.3vh; }
.tv-ticker { height: 6vh; overflow: hidden; display: flex; align-items: center; margin: 0 -2vw; background: rgba(13, 16, 48, .9); border-top: 1px solid var(--line2); }
.tk-track { display: inline-flex; white-space: nowrap; animation: ticker linear infinite; }
.tk { display: inline-flex; align-items: center; gap: .6vw; font-size: 2.2vh; font-weight: 600; color: var(--dim); padding-right: 5vw; }
.tk b { color: var(--text); }
.tk em { font-style: normal; font-family: var(--display); color: var(--lime); font-size: 2.6vh; }
.tv-fs { position: fixed; right: 2vw; top: 8vh; font-size: 12px; color: var(--mute); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
:fullscreen .tv-fs { display: none; }
@media (max-aspect-ratio: 1/1) {
  body[data-view="tv"] { overflow: auto; cursor: auto; }
  .tv { height: auto; }
  .tv-main { grid-template-columns: 1fr; }
}

/* ── Result pop-up (audience + TV) ── */
#pop { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; pointer-events: none; }
.pop-in { text-align: center; padding: 4vh 6vw; border-radius: 24px; background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--c) 40%, var(--bg2)), var(--bg2) 70%); border: 2px solid var(--c); box-shadow: 0 0 80px -10px var(--c); min-width: min(90vw, 460px); }
#pop.go .pop-in { animation: popin 4.2s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.pop-k { font-size: clamp(11px, 1.6vh, 18px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.pop-w { font-family: var(--display); font-size: clamp(34px, 7vh, 96px); line-height: 1.05; text-transform: uppercase; color: var(--c); }
.pop-s { font-family: var(--display); font-size: clamp(48px, 11vh, 150px); line-height: 1; }
.pop-p { font-weight: 800; font-size: clamp(14px, 2.4vh, 28px); color: var(--lime); margin-top: 6px; }

#toast { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; background: var(--lime); color: #111400; font-weight: 800; font-size: 14px; padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px); }
#toast.go { animation: toastin .25s ease-out; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .6); } 70% { box-shadow: 0 0 0 10px rgba(255, 59, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); } }
@keyframes glow { 50% { opacity: .65; } }
@keyframes bump { 0% { transform: scale(1); color: var(--lime); } 35% { transform: scale(1.28); color: var(--lime); } 100% { transform: scale(1); } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -10px); } }
@keyframes popin {
  0% { opacity: 0; transform: scale(.6); }
  10% { opacity: 1; transform: scale(1.04); }
  16% { transform: scale(1); }
  88% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.94); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .tk-track { animation: none; }
}
