:root {
  color-scheme: dark;
  --bg: #0e1316;
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.24);
  --ink: #f8fbfb;
  --muted: #b8c7cb;
  --gold: #ffd166;
  --teal: #65e4dc;
  --red: #ff6b5f;
  --radius: 18px;
  --tv-scale: 1;
  --tv-viewport-height: 100dvh;
  --tv-viewport-width: 100vw;
  --tv-gap: clamp(7px, calc(12px * var(--tv-scale)), 16px);
  --tv-pad: clamp(8px, calc(15px * var(--tv-scale)), 20px);
  --tv-ball-size: clamp(99px, 10.8vw, 153px);
  --tv-ball-gap: clamp(8px, calc(12px * var(--tv-scale)), 14px);
  --tv-runner-card-width: 176px;
  --tv-card-scale: 1;
  --tv-card-gap: 18px;
  --tv-header-row: clamp(52px, 10vh, 98px);
  --tv-live-row: 0px;
  --tv-called-row: clamp(167px, 27vh, 270px);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  width: var(--tv-viewport-width);
  height: var(--tv-viewport-height);
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 209, 102, 0.2), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(101, 228, 220, 0.14), transparent 28%),
    linear-gradient(135deg, #0e1518, #080d10 58%, #10191c);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

h1,
p {
  margin: 0;
}

.tv-stage {
  display: grid;
  grid-template-rows: var(--tv-header-row) var(--tv-called-row) minmax(0, 1fr);
  gap: var(--tv-gap);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: var(--tv-pad);
}

.tv-header,
.tv-live-grid,
.tv-called-section,
.tv-runner-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(9, 13, 16, 0.82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.tv-header {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) auto;
  gap: var(--tv-gap);
  align-items: center;
  min-height: clamp(64px, calc(86px * var(--tv-scale)), 98px);
  height: 100%;
  min-height: 0;
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at 5% 12%, rgba(255, 209, 102, 0.18), transparent 26%),
    radial-gradient(circle at 92% 20%, rgba(101, 228, 220, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(18, 25, 29, 0.96), rgba(8, 13, 16, 0.94));
  padding: clamp(9px, calc(13px * var(--tv-scale)), 16px) var(--tv-pad);
}

.tv-header-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: var(--tv-gap);
  min-width: 0;
}

.tv-brand {
  display: flex;
  min-width: 0;
  gap: clamp(10px, calc(14px * var(--tv-scale)), 16px);
  align-items: center;
}

.tv-logo {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(42px, calc(58px * var(--tv-scale)), 64px);
  height: clamp(42px, calc(58px * var(--tv-scale)), 64px);
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(73, 154, 255, 0.28), transparent 68%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 24px rgba(31, 115, 255, 0.46);
}

.tv-logo::before,
.tv-logo::after {
  content: none;
}

.tv-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

h1 {
  font-size: clamp(1.48rem, calc(2.7rem * var(--tv-scale)), 3.2rem);
  line-height: 0.94;
  font-weight: 1000;
}

p,
small,
label {
  color: var(--muted);
  font-weight: 850;
}

#roomLabel {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: clamp(0.81rem, calc(1.03rem * var(--tv-scale)), 1.15rem);
  padding: 3px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-code-form,
.tv-audio-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.tv-switch-room-button {
  min-height: clamp(36px, calc(43px * var(--tv-scale)), 49px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: var(--ink);
  cursor: pointer;
  padding: 0 clamp(13px, calc(18px * var(--tv-scale)), 22px);
  font-size: clamp(0.81rem, calc(0.94rem * var(--tv-scale)), 1.03rem);
  font-weight: 1000;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.tv-switch-room-button:hover {
  border-color: rgba(101, 228, 220, 0.46);
  background: rgba(101, 228, 220, 0.14);
  transform: translateY(-1px);
}

.tv-code-form {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  padding: 5px;
}

.tv-code-copy {
  display: grid;
  gap: 2px;
  min-width: clamp(135px, calc(196px * var(--tv-scale)), 225px);
  padding-left: clamp(7px, calc(11px * var(--tv-scale)), 13px);
}

.tv-code-form label {
  color: #eefbfb;
  font-size: clamp(0.81rem, calc(0.9rem * var(--tv-scale)), 1rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.tv-code-form small {
  color: rgba(198, 216, 223, 0.86);
  font-size: clamp(0.6rem, calc(0.7rem * var(--tv-scale)), 0.8rem);
  font-weight: 850;
  line-height: 1.05;
}

.tv-code-form input,
.tv-code-form button,
.tv-audio-controls button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 1000;
}

.tv-code-form input,
.tv-code-form button,
.tv-audio-controls button {
  min-height: clamp(36px, calc(43px * var(--tv-scale)), 49px);
  font-size: clamp(0.81rem, calc(0.94rem * var(--tv-scale)), 1.03rem);
}

.tv-code-form input {
  width: clamp(86px, calc(112px * var(--tv-scale)), 122px);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 0 clamp(9px, calc(14px * var(--tv-scale)), 16px);
  text-align: center;
  text-transform: uppercase;
}

.tv-code-form button,
.tv-audio-controls button.active {
  background: var(--teal);
  color: #041112;
}

.tv-code-form button,
.tv-audio-controls button {
  cursor: pointer;
  padding: 0 clamp(13px, calc(18px * var(--tv-scale)), 22px);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.tv-audio-controls button {
  background: rgba(255, 255, 255, 0.11);
  color: var(--ink);
  min-width: clamp(112px, calc(142px * var(--tv-scale)), 164px);
}

.tv-code-form button:hover,
.tv-audio-controls button:hover {
  border-color: rgba(101, 228, 220, 0.46);
  transform: translateY(-1px);
}

.tv-audio-controls button:disabled {
  cursor: default;
  opacity: 0.56;
}

.tv-room-dialog-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 72px);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 209, 102, 0.18), transparent 32%),
    radial-gradient(circle at 50% 62%, rgba(101, 228, 220, 0.14), transparent 34%),
    rgba(5, 9, 11, 0.74);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.tv-room-dialog-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.tv-room-dialog-card.tv-code-form {
  display: grid;
  width: min(92vw, clamp(420px, 42vw, 640px));
  gap: clamp(14px, calc(19px * var(--tv-scale)), 24px);
  border: 1px solid rgba(101, 228, 220, 0.36);
  border-radius: clamp(22px, calc(28px * var(--tv-scale)), 34px);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 209, 102, 0.2), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(101, 228, 220, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(24, 34, 39, 0.98), rgba(8, 13, 16, 0.98));
  padding: clamp(24px, calc(35px * var(--tv-scale)), 46px);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 34px rgba(101, 228, 220, 0.14);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.tv-room-dialog-backdrop.is-visible .tv-room-dialog-card {
  transform: translateY(0) scale(1);
}

.tv-room-dialog-card .tv-code-copy {
  display: grid;
  gap: clamp(7px, calc(10px * var(--tv-scale)), 12px);
  min-width: 0;
  padding: 0;
  text-align: center;
}

.tv-room-dialog-card .tv-code-copy span {
  color: var(--teal);
  font-size: clamp(0.82rem, calc(1rem * var(--tv-scale)), 1.16rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.tv-room-dialog-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, calc(3.35rem * var(--tv-scale)), 4.1rem);
  font-weight: 1000;
  line-height: 0.94;
}

.tv-room-dialog-card p {
  max-width: 42ch;
  margin: 0 auto;
  color: rgba(215, 231, 234, 0.92);
  font-size: clamp(0.95rem, calc(1.2rem * var(--tv-scale)), 1.42rem);
  font-weight: 850;
  line-height: 1.22;
}

.tv-code-entry {
  display: grid;
  gap: 8px;
}

.tv-room-dialog-card .tv-code-entry label {
  color: rgba(238, 251, 251, 0.82);
  font-size: clamp(0.76rem, calc(0.94rem * var(--tv-scale)), 1.08rem);
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.tv-room-dialog-card input {
  width: 100%;
  min-height: clamp(64px, calc(82px * var(--tv-scale)), 96px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 0 22px;
  text-align: center;
  text-transform: uppercase;
  font-size: clamp(2rem, calc(3.4rem * var(--tv-scale)), 4.2rem);
  font-weight: 1000;
  outline: 0;
}

.tv-room-dialog-card input:focus {
  border-color: rgba(101, 228, 220, 0.86);
  box-shadow:
    0 0 0 4px rgba(101, 228, 220, 0.16),
    0 0 30px rgba(101, 228, 220, 0.16);
}

.tv-room-dialog-card button {
  width: 100%;
  min-height: clamp(52px, calc(68px * var(--tv-scale)), 82px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: linear-gradient(180deg, #83fff5, var(--teal));
  color: #041112;
  cursor: pointer;
  padding: 0 24px;
  font-size: clamp(1rem, calc(1.32rem * var(--tv-scale)), 1.58rem);
  font-weight: 1000;
  transition: transform 160ms ease, filter 160ms ease;
}

.tv-room-dialog-card button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.tv-live-grid {
  display: none;
  grid-template-columns: 1.12fr repeat(4, minmax(0, 0.9fr));
  gap: clamp(8px, calc(12px * var(--tv-scale)), 14px);
  padding: clamp(8px, calc(12px * var(--tv-scale)), 14px);
  min-height: 0;
}

.tv-current-ball,
.tv-room-panel {
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
  min-height: clamp(72px, calc(112px * var(--tv-scale)), 128px);
  min-height: 0;
  border-radius: clamp(10px, calc(14px * var(--tv-scale)), 16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.06);
  padding: clamp(10px, calc(16px * var(--tv-scale)), 18px) clamp(12px, calc(18px * var(--tv-scale)), 20px);
}

.tv-current-ball {
  grid-template-columns: minmax(0, 0.84fr) auto;
  gap: clamp(8px, calc(14px * var(--tv-scale)), 18px);
  align-items: center;
  background:
    radial-gradient(circle at 86% 52%, rgba(255, 255, 255, 0.24), transparent 33%),
    radial-gradient(circle at 22% 16%, rgba(255, 209, 102, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(255, 209, 102, 0.25), rgba(255, 107, 95, 0.16));
}

.tv-room-panel::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(101, 228, 220, 0.55);
  opacity: 0.75;
}

.tv-room-panel.jackpot::after {
  background: rgba(255, 209, 102, 0.75);
}

.tv-room-panel.rewards::after {
  background: rgba(255, 107, 95, 0.62);
}

.tv-current-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tv-current-ball span,
.tv-room-panel span,
.tv-called-header span,
.tv-runner-header span {
  color: #c6d8df;
  font-size: clamp(0.62rem, calc(0.76rem * var(--tv-scale)), 0.82rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.tv-current-ball small,
.tv-called-header small {
  color: rgba(198, 216, 223, 0.84);
  font-size: clamp(0.62rem, calc(0.76rem * var(--tv-scale)), 0.84rem);
  font-weight: 900;
}

.tv-current-ball-display {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.tv-current-ball-display.is-empty {
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(2.55rem, calc(5.4rem * var(--tv-scale)), 6.2rem);
  font-weight: 1000;
  line-height: 0.86;
}

.tv-current-ball-orb {
  width: clamp(64px, calc(106px * var(--tv-scale)), 122px);
}

.tv-room-panel strong {
  margin-top: 4px;
  font-size: clamp(1.16rem, calc(2.42rem * var(--tv-scale)), 3rem);
  line-height: 0.95;
  font-weight: 1000;
}

.tv-room-panel small {
  margin-top: 4px;
  font-size: clamp(0.62rem, calc(0.78rem * var(--tv-scale)), 0.84rem);
  line-height: 1.2;
}

.tv-room-panel.jackpot strong,
.tv-room-panel.rewards strong {
  color: var(--gold);
}

.tv-called-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(140px, calc(178px * var(--tv-scale)), 220px) minmax(86px, auto);
  gap: var(--tv-gap);
  align-items: center;
  min-height: clamp(132px, calc(214px * var(--tv-scale)), 244px);
  min-height: 0;
  padding: clamp(10px, calc(16px * var(--tv-scale)), 18px) clamp(12px, calc(18px * var(--tv-scale)), 20px);
}

.tv-called-header {
  order: 3;
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: clamp(92px, calc(128px * var(--tv-scale)), 150px);
  text-align: right;
}

.tv-called-header span {
  font-size: clamp(0.84rem, calc(1.04rem * var(--tv-scale)), 1.18rem);
}

.tv-called-header small {
  font-size: clamp(0.74rem, calc(0.9rem * var(--tv-scale)), 1rem);
}

.tv-called-header strong {
  color: var(--ink);
  font-size: clamp(1.5rem, calc(2.25rem * var(--tv-scale)), 2.64rem);
  line-height: 1;
}

.tv-called-balls {
  order: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--tv-ball-gap);
  min-height: calc(var(--tv-ball-size) * 1.5 + clamp(11px, calc(22px * var(--tv-scale)), 25px));
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(14px, calc(18px * var(--tv-scale)), 22px);
  background:
    linear-gradient(90deg, rgba(101, 228, 220, 0.11), transparent 16%, transparent 84%, rgba(255, 209, 102, 0.1)),
    rgba(255, 255, 255, 0.07);
  padding: clamp(8px, calc(13px * var(--tv-scale)), 16px) clamp(11px, calc(16px * var(--tv-scale)), 18px);
  contain: content;
}

.tv-called-join-slot {
  order: 2;
  align-self: stretch;
  display: grid;
  min-width: 0;
  height: 100%;
  place-items: center;
}

.tv-called-balls.is-announcement {
  align-items: stretch;
  justify-content: stretch;
  padding: clamp(10px, calc(16px * var(--tv-scale)), 20px);
}

.tv-called-announcement {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, calc(24px * var(--tv-scale)), 30px);
}

.tv-called-announcement-copy {
  display: grid;
  gap: clamp(4px, calc(7px * var(--tv-scale)), 9px);
  min-width: 0;
}

.tv-called-announcement-copy span,
.tv-called-announcement-copy small {
  color: rgba(215, 231, 234, 0.9);
  font-size: clamp(0.86rem, calc(1.14rem * var(--tv-scale)), 1.34rem);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.tv-called-announcement-copy strong {
  color: var(--ink);
  font-size: clamp(2.4rem, calc(5.2rem * var(--tv-scale)), 6.4rem);
  font-weight: 1000;
  line-height: 0.88;
  text-wrap: balance;
}

.tv-called-winner {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: clamp(9px, calc(13px * var(--tv-scale)), 16px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: clamp(7px, calc(10px * var(--tv-scale)), 12px) clamp(10px, calc(16px * var(--tv-scale)), 18px);
  color: var(--ink);
  font-size: clamp(1rem, calc(1.45rem * var(--tv-scale)), 1.8rem);
  font-weight: 1000;
}

.tv-ball,
.tv-called-empty {
  display: inline-grid;
  flex: 0 0 auto;
  width: var(--tv-ball-size);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  font-weight: 1000;
}

.tv-ball {
  position: relative;
  overflow: hidden;
  border: clamp(2px, calc(3px * var(--tv-scale)), 4px) solid rgba(255, 255, 255, 0.9);
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.92) 0 9%, rgba(255, 255, 255, 0.38) 10% 20%, transparent 21%),
    radial-gradient(circle at 64% 72%, rgba(0, 0, 0, 0.24), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--ball-color, var(--teal)) 82%, #fff), var(--ball-color, var(--teal)) 45%, var(--ball-shadow, #0f5455));
  color: var(--ink);
  box-shadow:
    inset -11px -12px 16px rgba(0, 0, 0, 0.25),
    inset 7px 8px 13px rgba(255, 255, 255, 0.28),
    0 8px 14px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  will-change: transform, opacity;
}

.tv-ball-face {
  position: relative;
  display: grid;
  grid-template-rows: 42% 58%;
  width: 66%;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--ball-color, var(--teal)) 78%, #fff);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    inset -2px -3px 5px rgba(29, 35, 41, 0.1),
    inset 2px 2px 4px rgba(255, 255, 255, 0.9);
}

.tv-ball-face small,
.tv-ball-face strong {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 0.86;
}

.tv-ball-face small {
  align-self: end;
  margin-top: 0;
  margin-bottom: 1px;
  color: #171b20;
  font-size: clamp(0.8rem, 1.4vw, 1.08rem);
  font-weight: 1000;
  transform: translateY(-0.22em);
}

.tv-ball-face strong {
  align-self: start;
  margin-top: -3px;
  color: #08090a;
  font-size: clamp(1.35rem, calc(2.18rem * var(--tv-scale)), 2.5rem);
  font-weight: 1000;
}

.tv-ball.current {
  width: calc(var(--tv-ball-size) * 1.5);
  border-color: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.94),
    0 0 0 6px rgba(101, 228, 220, 0.22),
    inset -10px -12px 16px rgba(0, 0, 0, 0.24),
    inset 6px 7px 11px rgba(255, 255, 255, 0.24),
    0 10px 22px rgba(0, 0, 0, 0.32);
}

.tv-ball.current .tv-ball-face small {
  font-size: clamp(1.15rem, calc(2rem * var(--tv-scale)), 2.2rem);
  transform: translateY(-0.2em);
}

.tv-ball.current .tv-ball-face strong {
  font-size: clamp(2rem, calc(3.25rem * var(--tv-scale)), 3.75rem);
  margin-top: -5px;
}

.tv-called-empty {
  width: auto;
  aspect-ratio: auto;
  color: var(--muted);
  font-size: clamp(0.74rem, calc(0.92rem * var(--tv-scale)), 1rem);
}

.tv-ball.roll-in {
  animation: tv-ball-roll-in 560ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
}

.tv-ball.push-slide {
  animation: tv-ball-push-slide 560ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
}

.tv-ball.exit-dissolve {
  animation: tv-ball-exit-dissolve 640ms cubic-bezier(0.2, 0.8, 0.22, 1) both;
  pointer-events: none;
}

@keyframes tv-ball-roll-in {
  from {
    opacity: 0;
    transform: translateX(calc(-1 * (var(--tv-ball-size) + var(--tv-ball-gap)))) rotate(-320deg) scale(0.78);
  }

  72% {
    opacity: 1;
    transform: translateX(2px) rotate(14deg) scale(1.04);
  }

  to {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes tv-ball-push-slide {
  from {
    transform: translateX(calc(-1 * (var(--tv-ball-size) + var(--tv-ball-gap))));
  }

  to {
    transform: translateX(0);
  }
}

@keyframes tv-ball-exit-dissolve {
  from {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: translateX(calc(-1 * (var(--tv-ball-size) + var(--tv-ball-gap)))) rotate(0deg) scale(1);
  }

  48% {
    opacity: 0.72;
    filter: blur(0.5px) saturate(1.12);
    transform: translateX(-12px) rotate(96deg) scale(0.92);
  }

  to {
    opacity: 0;
    filter: blur(5px) saturate(0.55);
    transform: translateX(38px) rotate(220deg) scale(0.62);
  }
}

@keyframes tv-runner-card-arrive {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tv-runner-board {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 245, 247, 0.72)),
    repeating-linear-gradient(45deg, rgba(24, 126, 127, 0.05) 0 12px, transparent 12px 24px);
  isolation: isolate;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 22px 46px rgba(0, 0, 0, 0.26);
}

.tv-runner-board::before,
.tv-runner-board::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  z-index: 0;
}

.tv-runner-board.table-theme-fiesta {
  border-color: rgba(217, 164, 35, 0.62);
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 212, 0, 0.14) 0 7%, transparent 21%),
    radial-gradient(circle at 84% 18%, rgba(255, 52, 70, 0.09) 0 6%, transparent 19%),
    radial-gradient(circle at 76% 76%, rgba(22, 119, 255, 0.07) 0 8%, transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.18)),
    url("assets/fiesta-table-1-scene.svg") center top / 100% 650px repeat-y,
    linear-gradient(180deg, #ffe1a2, #d7ead0);
}

.tv-runner-board.table-theme-fiesta::before {
  background-image: url("assets/fiesta-table-1-pattern.svg");
  background-size: 360px 240px;
  opacity: 0.5;
}

.tv-runner-board.table-theme-beach {
  border-color: rgba(0, 167, 255, 0.56);
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 212, 0, 0.12) 0 7%, transparent 21%),
    radial-gradient(circle at 84% 18%, rgba(255, 79, 137, 0.08) 0 6%, transparent 19%),
    radial-gradient(circle at 72% 78%, rgba(0, 209, 178, 0.08) 0 8%, transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.16)),
    url("assets/beach-table-2-scene.svg") center top / 100% 650px repeat-y,
    linear-gradient(180deg, #65dfff, #ffe46c);
}

.tv-runner-board.table-theme-beach::before {
  background-image: url("assets/beach-table-2-pattern.svg");
  background-size: 360px 240px;
  opacity: 0.5;
}

.tv-runner-board.table-theme-halloween {
  border-color: rgba(122, 44, 255, 0.54);
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 179, 26, 0.13) 0 7%, transparent 21%),
    radial-gradient(circle at 84% 18%, rgba(255, 79, 184, 0.08) 0 6%, transparent 19%),
    radial-gradient(circle at 72% 78%, rgba(0, 224, 196, 0.07) 0 8%, transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.17)),
    url("assets/halloween-table-3-scene.svg") center top / 100% 650px repeat-y,
    linear-gradient(180deg, #3a1d8f, #ff8a18);
}

.tv-runner-board.table-theme-halloween::before {
  background-image: url("assets/halloween-table-3-pattern.svg");
  background-size: 360px 240px;
  opacity: 0.5;
}

.tv-runner-board::after {
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.1), transparent 13%),
    radial-gradient(circle at 76% 34%, rgba(255, 245, 208, 0.08), transparent 16%),
    linear-gradient(180deg, rgba(255, 249, 233, 0.04), rgba(255, 255, 255, 0.16));
}

.tv-runner-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(8px, calc(12px * var(--tv-scale)), 14px);
  height: 100%;
  padding: clamp(9px, calc(14px * var(--tv-scale)), 16px) var(--tv-pad) clamp(12px, calc(18px * var(--tv-scale)), 20px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(9, 13, 16, 0.08), rgba(9, 13, 16, 0.32));
}

.tv-reaction-stage {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
}

.tv-floating-reaction {
  position: absolute;
  left: var(--reaction-x);
  bottom: clamp(8px, calc(14px * var(--tv-scale)), 19px);
  display: grid;
  width: clamp(35px, calc(50px * var(--tv-scale)), 62px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.2) 42%, rgba(7, 17, 18, 0.16) 72%),
    rgba(255, 255, 255, 0.18);
  font-size: clamp(1.56rem, calc(2.4rem * var(--tv-scale)), 2.88rem);
  filter: drop-shadow(0 10px 18px rgba(7, 17, 18, 0.34));
  opacity: 0;
  transform: translateX(-50%) translateY(26px) scale(0.72);
  animation: tv-reaction-rise 6.2s cubic-bezier(0.16, 0.72, 0.22, 1) both;
  animation-delay: var(--reaction-delay, 0ms);
  will-change: transform, opacity;
}

@keyframes tv-reaction-rise {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(28px) scale(0.68) rotate(-7deg);
  }

  14% {
    opacity: 1;
    transform: translateX(calc(-50% + var(--reaction-drift-start))) translateY(-14px) scale(1.02) rotate(4deg);
  }

  46% {
    opacity: 0.96;
    transform: translateX(calc(-50% + var(--reaction-drift-mid))) translateY(-31vh) scale(0.98) rotate(-2deg);
  }

  76% {
    opacity: 0.95;
    transform: translateX(calc(-50% + var(--reaction-drift-end))) translateY(-52vh) scale(0.9) rotate(5deg);
  }

  100% {
    opacity: 0;
    transform: translateX(calc(-50% + var(--reaction-drift-end))) translateY(-76vh) scale(0.7) rotate(9deg);
  }
}

.tv-runner-header {
  display: none;
  align-items: end;
  justify-content: space-between;
  gap: var(--tv-gap);
  color: #111719;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  padding: clamp(8px, calc(10px * var(--tv-scale)), 12px) clamp(10px, calc(14px * var(--tv-scale)), 16px);
  backdrop-filter: blur(8px);
}

.tv-runner-header strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1rem, calc(1.7rem * var(--tv-scale)), 2.05rem);
  font-weight: 1000;
}

.tv-runner-header small {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #171b20;
  padding: clamp(4px, calc(6px * var(--tv-scale)), 7px) clamp(8px, calc(12px * var(--tv-scale)), 14px);
  font-size: clamp(0.66rem, calc(0.82rem * var(--tv-scale)), 0.9rem);
  font-weight: 1000;
  backdrop-filter: blur(7px);
}

.tv-runner-cards {
  display: grid;
  align-content: start;
  justify-content: space-between;
  gap: var(--tv-card-gap, 18px);
  min-width: 0;
  overflow: hidden;
}

.tv-runner-empty {
  display: grid;
  min-height: clamp(180px, calc(240px * var(--tv-scale)), 280px);
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.44);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.32), transparent 46%),
    rgba(255, 255, 255, 0.48);
  color: #1d2329;
  font-size: clamp(0.88rem, calc(1.1rem * var(--tv-scale)), 1.2rem);
  font-weight: 950;
}

.tv-runner-countdown {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(8px, calc(15px * var(--tv-scale)), 20px);
  min-height: clamp(190px, calc(270px * var(--tv-scale)), 330px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: clamp(18px, calc(26px * var(--tv-scale)), 34px);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.72), transparent 26%),
    radial-gradient(circle at 80% 20%, rgba(101, 228, 220, 0.34), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(238, 251, 251, 0.42));
  color: #11181c;
  padding: clamp(16px, calc(30px * var(--tv-scale)), 42px);
  text-align: center;
  box-shadow:
    0 20px 38px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.tv-runner-countdown > span {
  max-width: 100%;
  overflow: hidden;
  color: rgba(24, 126, 127, 0.92);
  font-size: clamp(0.94rem, calc(1.35rem * var(--tv-scale)), 1.62rem);
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tv-runner-countdown > strong {
  color: #11181c;
  font-size: clamp(2.3rem, calc(5.6rem * var(--tv-scale)), 7rem);
  font-weight: 1000;
  line-height: 0.86;
  text-transform: uppercase;
  text-wrap: balance;
}

.tv-runner-status {
  gap: clamp(10px, calc(18px * var(--tv-scale)), 24px);
  min-height: clamp(190px, calc(270px * var(--tv-scale)), 330px);
}

.tv-runner-status > strong {
  font-size: clamp(2.5rem, calc(6.2rem * var(--tv-scale)), 7.8rem);
}

.tv-countdown-clock {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: clamp(8px, calc(14px * var(--tv-scale)), 18px);
  width: min(100%, clamp(430px, 62vw, 820px));
}

.tv-countdown-unit {
  display: grid;
  place-items: center;
  gap: clamp(3px, calc(6px * var(--tv-scale)), 8px);
  min-width: 0;
  border: 1px solid rgba(24, 126, 127, 0.28);
  border-radius: clamp(14px, calc(20px * var(--tv-scale)), 24px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.38)),
    rgba(24, 126, 127, 0.12);
  padding: clamp(9px, calc(17px * var(--tv-scale)), 22px) clamp(8px, calc(14px * var(--tv-scale)), 18px);
  box-shadow:
    inset 0 -5px 0 rgba(24, 126, 127, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.12);
}

.tv-countdown-unit strong {
  color: #11181c;
  font-size: clamp(2.1rem, calc(5.2rem * var(--tv-scale)), 6.5rem);
  font-weight: 1000;
  line-height: 0.88;
}

.tv-countdown-unit small {
  color: rgba(24, 126, 127, 0.9);
  font-size: clamp(0.68rem, calc(1.02rem * var(--tv-scale)), 1.22rem);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.tv-runner-countdown > small {
  max-width: min(68ch, 100%);
  overflow: hidden;
  color: rgba(29, 35, 41, 0.76);
  font-size: clamp(0.84rem, calc(1.18rem * var(--tv-scale)), 1.44rem);
  font-weight: 950;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-join-qr-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  justify-items: stretch;
  gap: calc(8px * var(--tv-card-scale));
  width: var(--tv-runner-card-width);
  aspect-ratio: 2.5 / 3.5;
  min-width: 0;
  order: 9999;
  justify-self: end;
  overflow: hidden;
  border: calc(5px * var(--tv-card-scale)) solid rgba(101, 228, 220, 0.86);
  border-radius: calc(8px * var(--tv-card-scale));
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.92), transparent 30%),
    linear-gradient(145deg, rgba(7, 17, 18, 0.88), rgba(24, 126, 127, 0.84));
  color: #ffffff;
  padding: calc(7px * var(--tv-card-scale));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 0 22px rgba(101, 228, 220, 0.36),
    0 10px 18px rgba(29, 35, 41, 0.22);
}

.tv-join-qr-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: calc(6px * var(--tv-card-scale));
  background: #ffffff;
  object-fit: contain;
  padding: calc(5px * var(--tv-card-scale));
  box-sizing: border-box;
}

.tv-join-qr-card img.is-loading {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(232, 246, 246, 0.95)),
    #ffffff;
}

.tv-join-qr-card img.is-broken {
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
}

.tv-join-qr-card.compact {
  --tv-card-scale: clamp(0.42, calc(0.58 * var(--tv-scale)), 0.7);
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100%, clamp(128px, calc(164px * var(--tv-scale)), 196px));
  height: 100%;
  max-height: calc(var(--tv-called-row) - clamp(20px, calc(30px * var(--tv-scale)), 38px));
  aspect-ratio: auto;
  gap: clamp(4px, calc(6px * var(--tv-scale)), 8px);
  align-self: center;
  justify-self: center;
  padding: clamp(4px, calc(6px * var(--tv-scale)), 8px);
}

.tv-join-qr-card.compact img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.tv-join-qr-card.compact .tv-join-code-panel {
  min-height: clamp(26px, calc(34px * var(--tv-scale)), 42px);
  padding: 3px 4px;
}

.tv-join-qr-card.compact .tv-join-code-label {
  font-size: clamp(0.42rem, calc(0.54rem * var(--tv-scale)), 0.64rem);
}

.tv-join-qr-card.compact .tv-join-code-value {
  font-size: clamp(1rem, calc(1.48rem * var(--tv-scale)), 1.82rem);
}

.tv-join-code-panel {
  display: grid;
  min-height: 0;
  align-content: center;
  justify-items: center;
  border-radius: calc(8px * var(--tv-card-scale));
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 209, 102, 0.22), transparent 58%),
    rgba(7, 17, 18, 0.45);
  padding: calc(4px * var(--tv-card-scale));
}

.tv-join-code-label,
.tv-join-code-value {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-join-code-label {
  color: rgba(238, 251, 251, 0.82);
  font-size: calc(0.52rem * var(--tv-card-scale));
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.tv-join-code-value {
  color: var(--gold);
  font-size: calc(2.25rem * var(--tv-card-scale));
  font-weight: 1000;
  line-height: 0.92;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 0 12px rgba(255, 209, 102, 0.36);
}

.tv-runner-card {
  position: relative;
  display: grid;
  gap: calc(7px * var(--tv-card-scale));
  width: var(--tv-runner-card-width);
  min-width: 0;
  order: var(--runner-order, 0);
  animation: tv-runner-card-arrive 260ms ease both;
  transition: filter 180ms ease, transform 180ms ease;
}

.tv-runner-card.near-bingo {
  filter: drop-shadow(0 0 16px rgba(255, 209, 102, 0.6));
}

.tv-runner-rank {
  position: absolute;
  z-index: 3;
  top: calc(50px * var(--tv-card-scale));
  left: calc(8px * var(--tv-card-scale));
  border-radius: 999px;
  background: rgba(9, 13, 16, 0.82);
  color: #ffffff;
  padding: calc(3px * var(--tv-card-scale)) calc(8px * var(--tv-card-scale));
  font-size: calc(0.72rem * var(--tv-card-scale));
  font-weight: 1000;
}

.tv-runner-owner {
  display: grid;
  grid-template-columns: calc(30px * var(--tv-card-scale)) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: calc(7px * var(--tv-card-scale));
  align-items: center;
  min-height: calc(40px * var(--tv-card-scale));
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: #111719;
  padding: calc(4px * var(--tv-card-scale)) calc(7px * var(--tv-card-scale));
  backdrop-filter: blur(7px);
}

.tv-runner-avatar {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: calc(30px * var(--tv-card-scale));
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--avatar-start), var(--avatar-end));
  color: #fff;
  font-size: calc(0.9rem * var(--tv-card-scale));
  font-weight: 1000;
  box-shadow: 0 4px 10px rgba(29, 35, 41, 0.18);
}

.tv-runner-owner strong,
.tv-runner-owner small {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-runner-owner strong {
  font-size: calc(0.84rem * var(--tv-card-scale));
  line-height: 1.02;
  font-weight: 1000;
}

.tv-runner-owner small {
  color: #4b5a60;
  font-size: calc(0.68rem * var(--tv-card-scale));
  font-weight: 950;
}

.tv-mini-card {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  grid-template-rows: 1fr 2fr;
  width: 100%;
  aspect-ratio: 5 / 7;
  overflow: hidden;
  border: calc(5px * var(--tv-card-scale)) solid #ffffff;
  border-radius: calc(8px * var(--tv-card-scale));
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(232, 244, 240, 0.6));
  box-shadow:
    0 0 0 1px rgba(29, 35, 41, 0.14),
    0 10px 18px rgba(29, 35, 41, 0.18);
}

.tv-mini-card.rarity-rare {
  border-color: #4895ef;
}

.tv-mini-card.rarity-epic {
  border-color: #9b5de5;
}

.tv-mini-card.rarity-legendary {
  border-color: #d69a19;
}

.tv-mini-card.rarity-mythic {
  border-color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 0 14px rgba(255, 86, 246, 0.6),
    0 0 24px rgba(48, 213, 200, 0.5),
    0 12px 22px rgba(29, 35, 41, 0.2);
}

.tv-card-winner-stamp {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: 78%;
  padding: calc(2px * var(--tv-card-scale)) calc(4px * var(--tv-card-scale));
  border: calc(3px * var(--tv-card-scale)) solid rgba(178, 33, 33, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #b21f1f;
  font-size: calc(1.42rem * var(--tv-card-scale));
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.76),
    0 0 8px rgba(255, 255, 255, 0.34);
  box-shadow:
    0 0 0 calc(1px * var(--tv-card-scale)) rgba(255, 255, 255, 0.76),
    0 6px 16px rgba(90, 18, 18, 0.2);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-18deg);
  mix-blend-mode: multiply;
}

.tv-mini-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}

.tv-mini-art img {
  width: 72%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(29, 35, 41, 0.24));
}

.tv-mini-art img.is-hidden {
  display: none;
}

.tv-mini-title {
  position: absolute;
  top: calc(5px * var(--tv-card-scale));
  left: calc(6px * var(--tv-card-scale));
  right: calc(38px * var(--tv-card-scale));
  overflow: hidden;
  color: #ffffff;
  font-size: calc(0.66rem * var(--tv-card-scale));
  font-weight: 1000;
  line-height: 1.04;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.tv-mini-grid-panel {
  display: grid;
  align-content: end;
  min-height: 0;
  padding: 0 clamp(3px, 2.6cqw, 9px) clamp(3px, 2.6cqw, 9px);
}

.tv-mini-grid {
  --tv-mini-grid-gap: clamp(1px, 1.25cqw, 3px);
  --tv-mini-header-row-height: clamp(7px, 5.2cqw, 18px);
  --tv-mini-panel-bottom-padding: clamp(3px, 2.6cqw, 9px);
  --tv-mini-number-row-height: calc((70cqw - var(--tv-mini-header-row-height) - var(--tv-mini-panel-bottom-padding) - (var(--tv-mini-grid-gap) * 5)) / 5);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: var(--tv-mini-header-row-height) repeat(5, var(--tv-mini-number-row-height));
  align-self: end;
  min-height: 0;
  gap: var(--tv-mini-grid-gap);
}

.tv-grid-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: clamp(2px, 1.6cqw, 4px);
  background: rgba(255, 255, 255, 0.86);
  color: #111719;
  font-size: clamp(0.48rem, 5.3cqw, 0.9rem);
  font-weight: 1000;
  line-height: 1;
}

.tv-grid-cell.header {
  background: #1d2329;
  color: #ffffff;
  font-size: clamp(0.36rem, 4.6cqw, 0.72rem);
}

.tv-grid-cell.free {
  background: rgba(132, 220, 194, 0.42);
  color: #187e7f;
  font-size: clamp(0.32rem, 4.1cqw, 0.66rem);
}

.tv-grid-cell.marked span:first-child {
  position: relative;
  z-index: 3;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 3px rgba(255, 255, 255, 0.86);
}

.tv-daub {
  position: absolute;
  z-index: 2;
  width: 92%;
  aspect-ratio: 1;
  border: clamp(1.2px, 0.7cqw, 2.8px) solid rgba(0, 0, 0, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.62), transparent 26%),
    radial-gradient(circle at 66% 70%, rgba(89, 10, 14, 0.42), transparent 38%),
    rgba(210, 32, 42, 0.9);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.34),
    0 0 0 clamp(0.5px, 0.25cqw, 1px) rgba(255, 255, 255, 0.38) inset;
  opacity: 0.94;
}

.tv-winner-celebration {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: var(--tv-pad);
  pointer-events: none;
}

.tv-winner-celebration.is-hidden {
  display: none;
}

.tv-status-spotlight {
  justify-content: center;
  text-align: center;
}

.tv-runner-board.celebrating .tv-runner-cards {
  opacity: 0.32;
  filter: saturate(0.9) blur(0.4px);
  transform: scale(0.985);
}

.tv-celebration-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.tv-confetti,
.tv-glitter {
  position: absolute;
  top: -10%;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.48);
  background: var(--color);
  opacity: 0.88;
  animation: tv-confetti-fall var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}

.tv-confetti {
  border-radius: 2px;
  box-shadow: 0 0 8px color-mix(in srgb, var(--color) 68%, transparent);
}

.tv-glitter {
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 18%, var(--color) 20% 56%, transparent 60%);
  box-shadow:
    0 0 10px var(--color),
    0 0 20px rgba(255, 255, 255, 0.42);
  animation-name: tv-glitter-fall;
}

.tv-winner-spotlight {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(230px, auto) auto;
  gap: clamp(18px, calc(30px * var(--tv-scale)), 38px);
  align-items: center;
  max-width: min(920px, 88%);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: clamp(18px, calc(26px * var(--tv-scale)), 30px);
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.42), transparent 22%),
    linear-gradient(135deg, rgba(255, 249, 220, 0.94), rgba(255, 209, 102, 0.84) 42%, rgba(101, 228, 220, 0.86));
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.14),
    0 0 46px rgba(255, 209, 102, 0.5),
    0 24px 70px rgba(0, 0, 0, 0.38);
  padding: clamp(18px, calc(30px * var(--tv-scale)), 36px);
  color: #071112;
  animation: tv-winner-pop 640ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

.tv-winner-copy {
  display: grid;
  gap: clamp(8px, calc(12px * var(--tv-scale)), 16px);
}

.tv-winner-kicker {
  color: rgba(7, 17, 18, 0.72);
  font-size: clamp(1.05rem, calc(1.45rem * var(--tv-scale)), 1.78rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.tv-winner-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(10px, calc(14px * var(--tv-scale)), 18px);
  align-items: center;
}

.tv-winner-avatar {
  grid-row: auto;
  width: clamp(46px, calc(64px * var(--tv-scale)), 76px);
  border-color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.2rem, calc(1.7rem * var(--tv-scale)), 2rem);
}

.tv-winner-name {
  overflow-wrap: anywhere;
  font-size: clamp(2.4rem, calc(4.5rem * var(--tv-scale)), 5.6rem);
  line-height: 0.92;
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
}

.tv-winner-details {
  width: fit-content;
  border-radius: 999px;
  background: rgba(7, 17, 18, 0.12);
  color: rgba(7, 17, 18, 0.78);
  padding: clamp(6px, calc(8px * var(--tv-scale)), 10px) clamp(10px, calc(14px * var(--tv-scale)), 18px);
  font-size: clamp(0.78rem, calc(1rem * var(--tv-scale)), 1.14rem);
  font-weight: 1000;
}

.tv-winner-card-wrap {
  --tv-card-scale: clamp(1.06, calc(var(--tv-scale) * 1.18), 1.68);
  width: clamp(210px, calc(280px * var(--tv-scale)), 350px);
  filter: drop-shadow(0 18px 26px rgba(29, 35, 41, 0.28));
  animation: tv-winner-card-float 2.8s ease-in-out infinite;
}

.tv-winner-card {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 26px rgba(255, 255, 255, 0.72),
    0 16px 34px rgba(29, 35, 41, 0.28);
}

@keyframes tv-winner-pop {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.9);
  }

  68% {
    opacity: 1;
    transform: translateY(-4px) scale(1.025);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tv-winner-card-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes tv-confetti-fall {
  from {
    opacity: 0;
    transform: translate3d(0, -12%, 0) rotate(0deg);
  }

  12% {
    opacity: 0.95;
  }

  to {
    opacity: 0;
    transform: translate3d(var(--drift), 124vh, 0) rotate(720deg);
  }
}

@keyframes tv-glitter-fall {
  from {
    opacity: 0;
    transform: translate3d(0, -12%, 0) scale(0.5);
  }

  14%,
  70% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate3d(var(--drift), 118vh, 0) scale(1.18);
  }
}

body[data-tv-fit="compact"] .tv-header {
  grid-template-columns: minmax(240px, 1fr) auto;
  grid-template-rows: auto;
  align-content: center;
}

body[data-tv-fit="compact"] .tv-stage {
  grid-template-rows: max(118px, var(--tv-header-row)) var(--tv-called-row) minmax(0, 1fr);
}

body[data-tv-fit="compact"] .tv-audio-controls {
  justify-content: end;
}

body[data-tv-fit="compact"] .tv-header-actions {
  justify-content: end;
}

body[data-tv-fit="compact"] .tv-room-dialog-card.tv-code-form {
  justify-self: center;
}

body[data-tv-fit="short"] .tv-stage {
  grid-template-rows: max(104px, var(--tv-header-row)) var(--tv-called-row) minmax(0, 1fr);
}

body[data-tv-fit="short"] .tv-header {
  grid-template-columns: minmax(220px, 1fr) auto;
}

body[data-tv-fit="short"] .tv-room-panel small {
  display: none;
}

body[data-tv-fit="short"] .tv-room-dialog-card .tv-code-copy {
  min-width: 0;
}

body[data-tv-fit="short"] .tv-live-grid {
  grid-template-columns: 1fr repeat(4, minmax(0, 0.82fr));
}

body[data-tv-fit="short"] .tv-winner-spotlight {
  grid-template-columns: minmax(180px, auto) auto;
  gap: 16px;
  max-width: 94%;
  padding: 16px;
}

body[data-tv-fit="short"] .tv-winner-card-wrap {
  width: clamp(170px, 22vw, 230px);
}

body[data-tv-fit="ultra-short"] .tv-stage {
  grid-template-rows: var(--tv-header-row) var(--tv-called-row) minmax(0, 1fr);
}

@media (max-width: 680px) {
  body {
    overflow: hidden;
  }

  .tv-stage {
    grid-template-rows: var(--tv-header-row) var(--tv-called-row) minmax(0, 1fr);
  }

  .tv-header,
  .tv-code-form,
  .tv-audio-controls {
    align-items: stretch;
  }

  .tv-header {
    grid-template-columns: 1fr;
  }

  .tv-code-form,
  .tv-audio-controls {
    flex-wrap: wrap;
  }

  .tv-live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tv-current-ball {
    grid-column: 1 / -1;
  }

  .tv-called-section {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 100px);
  }

  .tv-called-header {
    order: 1;
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .tv-called-header strong {
    justify-self: end;
  }

  .tv-called-balls {
    order: 2;
  }

  .tv-called-join-slot {
    order: 3;
  }

  .tv-runner-board {
    min-height: 0;
  }

  .tv-winner-spotlight {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .tv-winner-player {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-ball.roll-in,
  .tv-ball.push-slide,
  .tv-ball.exit-dissolve,
  .tv-runner-card,
  .tv-confetti,
  .tv-glitter,
  .tv-winner-spotlight,
  .tv-winner-card-wrap {
    animation: none;
  }
}
