/* CRL 2027 — public live results page (live/index.html), normal view + TV mode. Uses site.css tokens. */
.live-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 9999px; font: 700 0.72rem "Space Grotesk", sans-serif; letter-spacing: 0.12em; color: #fecaca; background: rgba(220, 38, 38, 0.16); border: 1px solid rgba(248, 113, 113, 0.45); }
.live-badge.off { color: #94a3b8; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); }
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); animation: livePulse 1.6s infinite; }
.live-badge.off .live-dot { background: #94a3b8; animation: none; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

.day-tabs { display: inline-flex; gap: 0.35rem; padding: 0.3rem; border-radius: 0.9rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); flex-wrap: wrap; }
.day-tabs [role="tab"] { padding: 0.55rem 1rem; border-radius: 0.65rem; font-weight: 600; font-size: 0.92rem; color: #94a3b8; }
.day-tabs [role="tab"][aria-selected="true"] { background: var(--orange); color: #0b1120; }
.day-tabs [role="tab"]:focus-visible, .lv-card .seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.lv-card { border: 1px solid var(--line); border-radius: 1.25rem; background: linear-gradient(180deg, rgba(17, 26, 46, 0.9), rgba(11, 17, 32, 0.92)); padding: 1.1rem; }
@media (min-width: 640px) { .lv-card { padding: 1.5rem; } }
.lv-pending { opacity: 0.65; }
.lv-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; }
.lv-ev-name { font-family: "Space Grotesk", sans-serif; font-size: 1.35rem; font-weight: 700; color: #fff; }
.lv-progress { margin-top: 0.15rem; font-size: 0.85rem; color: #94a3b8; }
.lv-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.7rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.lv-live { color: #fecaca; background: rgba(220, 38, 38, 0.14); border-color: rgba(248, 113, 113, 0.4); }
.lv-final { color: #bbf7d0; background: rgba(22, 163, 74, 0.16); border-color: rgba(74, 222, 128, 0.4); }
.lv-wait { color: #cbd5e1; background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); }
.lv-card .seg button .opacity-70 { font-weight: 500; }

.lv-podium { display: grid; gap: 0.6rem; margin-top: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.lv-pod { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border-radius: 0.9rem; border: 1px solid var(--line); background: rgba(7, 11, 20, 0.55); min-width: 0; }
.lv-pod.p1 { border-color: rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.08); }
.lv-pod-team { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-pod-school { font-size: 0.78rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-pod-score { margin-left: auto; font: 700 1.35rem "Space Grotesk", sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.lv-medal { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 9999px; font: 700 0.95rem "Space Grotesk", sans-serif; color: #0b1120; background: rgba(255, 255, 255, 0.12); }
.lv-medal.m1 { background: #fbbf24; }
.lv-medal.m2 { background: #cbd5e1; }
.lv-medal.m3 { background: #d97706; }
.lv-medal.m4 { color: #e2e8f0; background: rgba(255, 255, 255, 0.08); }

.lv-table-wrap { margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 0.9rem; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lv-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; font-weight: 600; padding: 0.6rem 0.75rem; background: rgba(7, 11, 20, 0.7); white-space: nowrap; }
.lv-table td { padding: 0.6rem 0.75rem; border-top: 1px solid var(--line); color: #cbd5e1; vertical-align: middle; }
.lv-table tr.top1 td { background: rgba(251, 191, 36, 0.06); }
.lv-table .lv-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-table .lv-score { color: #fff; font: 700 1rem "Space Grotesk", sans-serif; }
.lv-table .lv-rank { width: 3rem; }
.lv-team { color: #fff; font-weight: 600; }
.lv-school-sm { display: block; font-size: 0.75rem; font-weight: 400; color: #94a3b8; }
.lv-flag { font-size: 0.75rem; font-weight: 700; color: #fca5a5; }
.lv-empty { margin-top: 1rem; color: #64748b; font-size: 0.9rem; }
.lv-table .lv-school { display: none; }
@media (min-width: 768px) {
  .lv-table .lv-school { display: table-cell; color: #94a3b8; }
  .lv-school-sm { display: none; }
}
@media (max-width: 639px) { .lv-table .lv-round { display: none; } }

/* ---------------------------------------------------------------- TV mode (?tv=1) */
body.tv-on { overflow: hidden; }
body.tv-on .lv-header, body.tv-on main, body.tv-on .lv-footer { display: none; }
.tv { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; padding: 2.2vh 3vw; cursor: pointer;
  background: radial-gradient(ellipse at top right, rgba(247, 148, 29, 0.16), transparent 55%), radial-gradient(ellipse at bottom left, rgba(41, 169, 224, 0.12), transparent 50%), #070b14; }
.tv.hidden { display: none; }
.tv-top { display: flex; align-items: center; gap: 2vw; }
.tv-titles { min-width: 0; flex: 1; }
.tv-kicker { font: 700 clamp(0.8rem, 1.4vw, 1.4rem) "Space Grotesk", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange); }
.tv-title { font: 700 clamp(1.6rem, 3.6vw, 4rem) "Space Grotesk", sans-serif; color: #fff; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6vh; }
.tv-right .lv-chip { font-size: clamp(0.8rem, 1.3vw, 1.3rem); padding: 0.4em 0.9em; }
.tv-progress { display: block; text-align: right; color: #94a3b8; font-size: clamp(0.8rem, 1.2vw, 1.2rem); }
.tv-clock { font: 700 clamp(1.1rem, 2.2vw, 2.4rem) "Space Grotesk", sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.tv-body { flex: 1; min-height: 0; margin-top: 2.5vh; overflow: hidden; }
.tv .lv-podium { margin-top: 0; gap: 1.2vw; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv .lv-pod { padding: 1.4vh 1.2vw; gap: 1vw; }
.tv .lv-pod-team { font-size: clamp(1rem, 1.9vw, 2.1rem); }
.tv .lv-pod-school { font-size: clamp(0.75rem, 1.15vw, 1.3rem); }
.tv .lv-pod-score { font-size: clamp(1.4rem, 3vw, 3.4rem); }
.tv .lv-medal { width: clamp(2rem, 3.4vw, 4rem); height: clamp(2rem, 3.4vw, 4rem); font-size: clamp(1rem, 1.8vw, 2rem); }
.tv .lv-table-wrap { margin-top: 2vh; overflow: hidden; }
.tv .lv-table { font-size: clamp(0.9rem, 1.55vw, 1.8rem); }
.tv .lv-table th { font-size: clamp(0.7rem, 1vw, 1.1rem); padding: 1vh 1vw; }
.tv .lv-table td { padding: 0.9vh 1vw; }
.tv .lv-table .lv-score { font-size: clamp(1rem, 1.9vw, 2.2rem); }
.tv .lv-table .lv-school { display: table-cell; color: #94a3b8; }
.tv .lv-table .lv-round { display: table-cell; }
.tv .lv-school-sm { display: none; }
.tv-empty { display: grid; place-items: center; height: 100%; text-align: center; font: 600 clamp(1.2rem, 2.6vw, 3rem) "Space Grotesk", sans-serif; color: #94a3b8; }
.tv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5vh; color: #64748b; font-size: clamp(0.7rem, 1vw, 1.1rem); }
.tv-dots { display: flex; gap: 0.5vw; }
.tv-dots i { width: 0.7vw; height: 0.7vw; min-width: 8px; min-height: 8px; border-radius: 9999px; background: rgba(255, 255, 255, 0.18); }
.tv-dots i.on { background: var(--orange); }
#tv-hint { transition: opacity 1s; }
#tv-hint.fade { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* TV mode: day title slide + day colour accents (Day 1 orange, Day 2 blue) */
.tv[data-day="2"] .tv-kicker { color: #38bdf8; }
.tv[data-day="2"] .tv-dots i.on { background: #38bdf8; }
.tv-dots b { width: 1.2vw; }
.tv-day { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.5vh; }
.tv-day-num { font: 700 clamp(3rem, 12vw, 13rem) "Space Grotesk", sans-serif; line-height: 1; color: var(--orange); letter-spacing: 0.04em; }
.tv[data-day="2"] .tv-day-num { color: #38bdf8; }
.tv-day-date { font: 600 clamp(1.2rem, 3vw, 3.4rem) "Space Grotesk", sans-serif; color: #fff; }
.tv-day-list { font-size: clamp(1rem, 2vw, 2.2rem); color: #cbd5e1; }
.tv-day-note { margin-top: 2vh; font-size: clamp(0.9rem, 1.6vw, 1.8rem); color: #94a3b8; }
