:root {
  color-scheme: dark;
  --tv-bg: #0c1514;
  --tv-surface: #12201d;
  --tv-card: #172825;
  --tv-card-hover: #1c302d;
  --tv-card-border: rgba(255, 255, 255, 0.08);
  --tv-card-live: #1a2d29;
  --tv-card-border-live: rgba(145, 214, 184, 0.25);
  --tv-text: #ffffff;
  --tv-text-muted: #95aaa2;
  --tv-text-dim: #60756d;
  --tv-green: #91d6b8;
  --tv-accent: #c5ef78;
  --tv-live-red: #ef4444;
  --tv-live-red-bg: rgba(239, 68, 68, 0.16);
  --tv-live-red-border: rgba(239, 68, 68, 0.35);
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--tv-bg);
  color: var(--tv-text);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Fallback for smaller screens during testing */
@media (max-height: 700px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }
}

.tv-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  padding: 24px 36px 16px;
  gap: 20px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(145, 214, 184, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(197, 239, 120, 0.04) 0%, transparent 50%),
    var(--tv-bg);
}

/* ─── Modern Broadcast Header ───────────────────────────────────── */
.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tv-card-border);
  flex-shrink: 0;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tv-brand-title {
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.6px;
  color: #ffffff;
}

.tv-brand-title span {
  color: var(--tv-accent);
}

.tv-brand-tag {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tv-green);
  padding: 4px 10px;
  background: rgba(145, 214, 184, 0.12);
  border-radius: 20px;
  border: 1px solid rgba(145, 214, 184, 0.2);
}

.tv-header-center {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tv-mode-badge {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--tv-card-border);
  border-radius: 24px;
  padding: 3px;
}

.tv-mode-btn {
  background: transparent;
  border: none;
  color: var(--tv-text-muted);
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 650;
  transition: all 0.2s ease;
}

.tv-mode-btn.is-active {
  background: #ffffff;
  color: #0c1514;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tv-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tv-text-muted);
}

.tv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--tv-green);
  transition: background-color 0.3s;
}

.tv-status-dot.is-offline {
  background-color: #f59e0b;
}

.tv-status-dot.is-updating {
  background-color: var(--tv-accent);
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
}

.tv-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tv-date-display {
  font-size: 16px;
  font-weight: 500;
  color: var(--tv-text-muted);
}

.tv-clock-display {
  font-size: 22px;
  font-weight: 750;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

.tv-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tv-card-border);
  color: var(--tv-text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tv-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ─── Main 3-Column Display Board ───────────────────────────────── */
.tv-board {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1280px) {
  .tv-board {
    grid-template-columns: 1.2fr 1fr;
  }
  .tv-column.later-column {
    display: none;
  }
}

.tv-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--tv-surface);
  border: 1px solid var(--tv-card-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  position: relative;
}

.tv-column.live-column {
  border-color: var(--tv-card-border-live);
  background: linear-gradient(180deg, rgba(26, 45, 41, 0.45) 0%, rgba(18, 32, 29, 0.75) 100%);
}

.tv-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--tv-card-border);
  flex-shrink: 0;
}

.tv-column-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.tv-column-count {
  font-size: 12px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--tv-text-muted);
}

.live-badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--tv-live-red);
  background: var(--tv-live-red-bg);
  border: 1px solid var(--tv-live-red-border);
  padding: 3px 8px;
  border-radius: 4px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--tv-live-red);
  animation: subtle-pulse 1.8s infinite ease-in-out;
}

@keyframes subtle-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.tv-pagination-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.tv-dot.is-active {
  background: #ffffff;
  transform: scale(1.25);
}

/* ─── Card Container & Carousel Pages ───────────────────────────── */
.tv-card-container {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.tv-card-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(6px);
}

.tv-card-page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─── Event Cards (Broadcast Card Design) ───────────────────────── */
.tv-card {
  background: var(--tv-card);
  border: 1px solid var(--tv-card-border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s, background-color 0.2s;
}

.tv-card.is-favorite {
  border-left: 3px solid var(--tv-accent);
}

.tv-card.is-live {
  background: var(--tv-card-live);
  border-color: var(--tv-card-border-live);
}

.tv-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-card-league {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.8px;
  color: var(--tv-green);
  text-transform: uppercase;
}

.tv-card-status-pill {
  font-size: 13px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--tv-text-muted);
}

.tv-card-status-pill.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 750;
  background: var(--tv-live-red-bg);
  color: #f87171;
  border: 1px solid var(--tv-live-red-border);
}

.tv-card-status-pill.time-pill {
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* ─── Matchup Teams & Scores ────────────────────────────────────── */
.tv-matchup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tv-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tv-team-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.tv-team-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.tv-team-name {
  font-size: 21px;
  font-weight: 650;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.tv-team-rank {
  font-size: 14px;
  font-weight: 750;
  color: var(--tv-green);
  margin-right: 6px;
}

.tv-team-score {
  font-size: 28px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  color: rgba(255, 255, 255, 0.65);
  min-width: 44px;
  text-align: right;
}

.tv-team-score.is-leading {
  color: #ffffff;
  font-weight: 850;
}

/* ─── Card Bottom Row ───────────────────────────────────────────── */
.tv-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: var(--tv-text-muted);
}

.tv-broadcast-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--tv-text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.tv-broadcast-icon {
  font-size: 12px;
  opacity: 0.8;
}

.tv-reason-tag {
  font-size: 12px;
  font-weight: 650;
  background: rgba(197, 239, 120, 0.12);
  color: var(--tv-accent);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ─── Clean Empty States (No dashed boxes) ──────────────────────── */
.tv-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 24px;
  text-align: center;
  color: var(--tv-text-dim);
  gap: 10px;
}

.tv-empty-icon {
  font-size: 28px;
  opacity: 0.5;
  margin-bottom: 2px;
}

.tv-empty-title {
  font-size: 18px;
  font-weight: 650;
  color: var(--tv-text-muted);
}

.tv-empty-desc {
  font-size: 14px;
  max-width: 280px;
  line-height: 1.45;
  color: var(--tv-text-dim);
}

/* ─── Broadcast Bottom Ticker ───────────────────────────────────── */
.tv-ticker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f1c1a;
  border: 1px solid var(--tv-card-border);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 14px;
  flex-shrink: 0;
  height: 46px;
}

.tv-ticker-left {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  flex: 1;
}

.tv-ticker-title {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #0c1514;
  background: var(--tv-accent);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tv-ticker-items {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
  overflow: hidden;
}

.tv-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tv-text-muted);
  font-size: 13px;
}

.tv-ticker-item strong {
  color: var(--tv-green);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.tv-ticker-item .final-score {
  color: #ffffff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tv-ticker-right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
}

.tv-help-trigger {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tv-text-dim);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tv-help-trigger:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ─── Remote Shortcuts Overlay ──────────────────────────────────── */
.tv-shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 21, 20, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tv-shortcuts-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.tv-shortcuts-modal {
  background: var(--tv-surface);
  border: 1px solid var(--tv-card-border);
  border-radius: var(--radius);
  padding: 28px 36px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.tv-shortcuts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tv-card-border);
}

.tv-shortcuts-head h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.tv-shortcuts-close {
  background: transparent;
  border: none;
  color: var(--tv-text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.tv-shortcuts-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 20px;
  align-items: center;
  font-size: 15px;
}

.tv-key-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  color: #ffffff;
  min-width: 32px;
  text-align: center;
}

.tv-card .prime-access{font-size:12px;color:#edce88}.tv-card .prime-access.is-included{color:#c5ef78}
