:root {
  --tv-bg-base: #f8fafc;
  --tv-bg-card: #ffffff;
  --tv-bg-row-even: #ffffff;
  --tv-bg-row-odd: #f8fafc;
  --tv-bg-hover: #f1f5f9;
  --tv-header-bg: #064e3b;
  --tv-table-header-bg: #04382a;
  --tv-gold: #b45309;
  --tv-gold-light: #ffd700;
  --tv-text-white: #ffffff;
  --tv-text-dark: #0f172a;
  --tv-text-muted: #64748b;
  --tv-border: #e2e8f0;
  --tv-border-subtle: #f1f5f9;

  /* Golf Score Colors */
  --color-under-par: #dc2626; /* Tour Red */
  --color-even-par: #047857;
  --color-over-par: #2563eb;
  --glow-flash: rgba(217, 119, 6, 0.4);
}

[data-theme="dark"] {
  --tv-bg-base: #04140c;
  --tv-bg-card: #072214;
  --tv-bg-row-even: #082617;
  --tv-bg-row-odd: #0a2d1c;
  --tv-bg-hover: #0f3d26;
  --tv-header-bg: linear-gradient(180deg, #0b2e1b 0%, #061e12 100%);
  --tv-table-header-bg: #061910;
  --tv-gold: #d4af37;
  --tv-gold-light: #fef08a;
  --tv-text-white: #ffffff;
  --tv-text-dark: #ffffff;
  --tv-text-muted: #8ba89b;
  --tv-border: rgba(212, 175, 55, 0.25);
  --tv-border-subtle: rgba(255, 255, 255, 0.05);
}

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

body.tv-mode {
  background-color: var(--tv-bg-base);
  color: var(--tv-text-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s, color 0.25s;
}

.tv-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  padding: 16px 24px 10px;
}

/* 4K TV Header with High-Def Karen Clubhouse Terrace Background */
.tv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.94) 0%, rgba(4, 56, 42, 0.96) 100%),
              url('https://strideanalytics.co.ke/stride_clubhouse_terrace.jpg') center/cover no-repeat;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

[data-theme="dark"] .tv-header {
  background: linear-gradient(135deg, rgba(11, 46, 27, 0.95) 0%, rgba(6, 30, 18, 0.97) 100%),
              url('https://strideanalytics.co.ke/stride_clubhouse_terrace.jpg') center/cover no-repeat;
  border: 1px solid var(--tv-border);
}

/* Sponsors & WhatsApp Ribbon */
.tv-sponsors-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tv-sponsors-ribbon {
  background: #072214;
  border-color: var(--tv-border);
}

.sponsors-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--tv-gold);
  margin-right: 12px;
}

.sponsors-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
}

.sponsor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: transform 0.2s;
}

[data-theme="dark"] .sponsor-pill {
  background: #0b2e1b;
  border-color: rgba(255, 255, 255, 0.1);
}

.sponsor-pill .sp-name {
  font-weight: 800;
  color: var(--tv-text-dark);
}

.sponsor-pill .sp-role {
  font-size: 0.68rem;
  color: var(--tv-text-muted);
}

.sponsor-pill.bounty {
  background: #fef3c7;
  border-color: #f59e0b;
}

.sponsor-pill.bounty .sp-name {
  color: #92400e;
}

.sponsor-pill.bounty .sp-role {
  color: #b45309;
  font-weight: 700;
}

.karen-watermark-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: 0.5px;
  padding-left: 12px;
}

[data-theme="dark"] .karen-watermark-badge {
  color: #34d399;
}

.whatsapp-btn {
  background: #25d366 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
  text-decoration: none;
}

.whatsapp-btn:hover {
  filter: brightness(1.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.trophy-mark {
  font-size: 2.6rem;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.tournament-title-wrap h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffd700;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.course-sub-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 500;
  margin-top: 4px;
}

.course-sub-line .sep {
  color: #ffd700;
  opacity: 0.8;
}

.round-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

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

/* Weather Widget */
.tv-weather-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 8px;
}

.weather-icon {
  font-size: 1.5rem;
}

.weather-info {
  display: flex;
  flex-direction: column;
}

.weather-temp {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.weather-cond {
  font-size: 0.72rem;
  color: #cbd5e1;
}

/* Connection Status Pill with Heartbeat */
.connection-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.connection-status-pill.connected {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.connection-status-pill.connected .pulse-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: tv-pulse-green 2s infinite ease-in-out;
}

@keyframes tv-pulse-green {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

.connection-status-pill.reconnecting {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.connection-status-pill.reconnecting .pulse-beacon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #ef4444;
  animation: tv-pulse-red 0.8s infinite;
}

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

.tv-controls {
  display: flex;
  gap: 6px;
}

.tv-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.link-btn {
  text-decoration: none;
}

/* Main Table */
.tv-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.leaderboard-card {
  flex: 1;
  background: var(--tv-bg-card);
  border: 1px solid var(--tv-border);
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
}

.tv-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tv-table thead tr {
  background: var(--tv-table-header-bg);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #ffd700;
}

.tv-table th {
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffd700;
  text-transform: uppercase;
}

.tv-table td {
  padding: 12px 18px;
  font-size: 1.15rem;
  border-bottom: 1px solid var(--tv-border-subtle);
  transition: all 0.25s ease;
  color: var(--tv-text-dark);
}

.tv-table tbody tr {
  transition: background-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.tv-table tbody tr:hover {
  background-color: var(--tv-bg-hover) !important;
}

.player-inspect-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tv-gold);
  background: rgba(180, 83, 9, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  opacity: 0.85;
}

[data-theme="dark"] .player-inspect-hint {
  background: rgba(212, 175, 55, 0.2);
  color: #fef08a;
}

.tv-table tbody tr:nth-child(even) {
  background: var(--tv-bg-row-even);
}

.tv-table tbody tr:nth-child(odd) {
  background: var(--tv-bg-row-odd);
}

/* Specific Columns */
.col-pos {
  width: 5%;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--tv-gold);
}

.col-player {
  width: 21%;
}

.col-form {
  width: 17%;
}

.col-pulse {
  width: 16%;
}

.mini-holes-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.mini-hole-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 30px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 0.78rem;
  line-height: 1;
  border: 1px solid transparent;
}

.mini-hole-pill .mh-num {
  font-size: 0.52rem;
  opacity: 0.75;
  font-weight: 700;
  margin-bottom: 2px;
}

.mh-eagle {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
}

.mh-birdie {
  background: #fee2e2;
  color: #dc2626;
  border-color: #f87171;
}

.mh-par {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.mh-bogey {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.mh-sub-meta {
  font-size: 0.68rem;
  color: var(--tv-text-muted);
  font-weight: 700;
  margin-top: 3px;
}

.win-prob-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 190px;
}

.win-prob-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 800;
}

.win-prob-pct {
  font-family: 'JetBrains Mono', monospace;
  color: #047857;
  font-weight: 900;
}

[data-theme="dark"] .win-prob-pct {
  color: #4ade80;
}

.win-prob-tag {
  font-size: 0.66rem;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 800;
}

[data-theme="dark"] .win-prob-tag {
  color: #fcd34d;
}

.win-prob-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.win-prob-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 999px;
}

.player-cell-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #059669;
}

.player-name-block {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tv-text-dark);
}

.player-country-meta {
  font-size: 0.8rem;
  color: var(--tv-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.col-total {
  width: 10%;
  text-align: center;
}

.to-par-pill {
  display: inline-block;
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 1.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.to-par-under {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #f87171;
  text-shadow: none;
}

.to-par-even {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #34d399;
}

.to-par-over {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #60a5fa;
}

.col-thru {
  width: 9%;
  text-align: center;
  font-weight: 800;
  font-size: 1.15rem;
}

.thru-badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--tv-gold);
  font-weight: 800;
}

.thru-finished {
  color: #047857;
  font-weight: 900;
}

.col-today {
  width: 9%;
  text-align: center;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--tv-text-dark);
}

.col-round {
  width: 6%;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: var(--tv-text-muted);
  font-weight: 600;
}

.col-strokes {
  width: 10%;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--tv-text-dark);
}

/* Live Flash Highlight Animation */
@keyframes rowFlashGold {
  0% {
    background-color: #fef3c7 !important;
    transform: scale(1.008);
  }
  50% {
    background-color: #d1fae5 !important;
  }
  100% {
    transform: scale(1);
  }
}

.row-live-flash {
  animation: rowFlashGold 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

.cell-live-flash {
  box-shadow: 0 0 16px #f59e0b;
  border-radius: 6px;
}

/* Live Event Banner Toast */
.live-event-banner {
  position: fixed;
  bottom: 60px;
  right: 32px;
  background: #ffffff;
  border: 2px solid #064e3b;
  border-radius: 12px;
  padding: 14px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(6, 78, 59, 0.2);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  animation: toastSlideIn 0.4s ease-out;
}

@keyframes toastSlideIn {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.alert-icon {
  font-size: 2.2rem;
}

.alert-headline {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 900;
  color: #064e3b;
}

.alert-sub {
  font-size: 0.9rem;
  color: #0f172a;
  font-weight: 700;
}

/* Footer & Ticker */
.tv-footer {
  display: flex;
  align-items: center;
  background: #064e3b;
  color: #ffffff;
  border-radius: 8px;
  height: 40px;
  margin-top: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ticker-label {
  background: #ffd700;
  color: #04382a;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 1px;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: tickerSlide 35s linear infinite;
}

@keyframes tickerSlide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ticker-item {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
}

.tv-clock {
  background: #04382a;
  padding: 0 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffd700;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Player Hole-by-Hole Scorecard Modal (4K TV & Mobile)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scorecard-modal-content {
  position: relative;
  z-index: 2001;
  background: var(--tv-bg-card);
  color: var(--tv-text-dark);
  border-radius: 16px;
  border: 1px solid var(--tv-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  max-width: 1060px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--tv-bg-base);
  border-bottom: 1px solid var(--tv-border);
}

.modal-player-bio {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #059669;
}

.modal-bio-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.modal-player-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-player-name {
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--tv-text-dark);
}

.modal-rank-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #d97706;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

[data-theme="dark"] .modal-rank-badge {
  background: rgba(212, 175, 55, 0.2);
  color: #fef08a;
  border-color: rgba(212, 175, 55, 0.4);
}

.modal-player-meta {
  font-size: 0.85rem;
  color: var(--tv-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  transition: transform 0.15s, background 0.15s;
}

.modal-wa-btn:hover {
  background: #1eb855;
  transform: translateY(-1px);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--tv-text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: var(--tv-text-dark);
}

/* Stats Ribbon */
.modal-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 14px 24px;
  background: var(--tv-bg-card);
  border-bottom: 1px solid var(--tv-border);
}

@media (max-width: 768px) {
  .modal-stats-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-pill {
  background: var(--tv-bg-base);
  border: 1px solid var(--tv-border);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--tv-text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--tv-text-dark);
  margin-top: 2px;
}

.stat-val.to-par-val {
  color: #dc2626;
}

/* Scorecard Table */
.scorecard-table-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.modal-scorecard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 0.92rem;
  text-align: center;
}

.modal-scorecard-table th,
.modal-scorecard-table td {
  padding: 8px 6px;
  border: 1px solid var(--tv-border);
}

.modal-scorecard-table th {
  background: var(--tv-table-header-bg);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
}

.cell-label {
  text-align: left !important;
  font-weight: 800;
  padding-left: 12px !important;
  width: 95px;
  background: var(--tv-bg-base);
  color: var(--tv-text-dark);
  position: sticky;
  left: 0;
  z-index: 2;
}

.subtotal-col {
  background: rgba(180, 83, 9, 0.08) !important;
  font-weight: 800 !important;
  color: var(--tv-gold) !important;
}

[data-theme="dark"] .subtotal-col {
  background: rgba(212, 175, 55, 0.15) !important;
  color: #fef08a !important;
}

.total-col {
  background: var(--tv-header-bg) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

.header-par td {
  font-weight: 700;
  color: #047857;
  background: var(--tv-bg-base);
}

[data-theme="dark"] .header-par td {
  color: #10b981;
}

.header-yds td,
.header-si td {
  font-size: 0.78rem;
  color: var(--tv-text-muted);
  background: var(--tv-bg-base);
}

.row-score td {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
}

.row-putts td,
.row-fairway td,
.row-gir td {
  font-size: 0.85rem;
  color: var(--tv-text-muted);
}

/* Score Visual Markers (Badges / Shapes) */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-weight: 900;
  font-size: 1.05rem;
}

.score-badge.badge-albatross {
  background: #7e22ce;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #a855f7;
}

.score-badge.badge-eagle {
  background: #b45309;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #f59e0b;
}

.score-badge.badge-birdie {
  background: #dc2626;
  color: #ffffff;
  border-radius: 50%;
}

.score-badge.badge-par {
  color: #047857;
  font-weight: 700;
}

[data-theme="dark"] .score-badge.badge-par {
  color: #34d399;
}

.score-badge.badge-bogey {
  background: #2563eb;
  color: #ffffff;
  border-radius: 4px;
}

.score-badge.badge-double {
  background: #334155;
  color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #64748b;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.legend-badge.badge-albatross { background: #f3e8ff; color: #6b21a8; border: 1px solid #c084fc; }
.legend-badge.badge-eagle { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.legend-badge.badge-birdie { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.legend-badge.badge-par { background: #ecfdf5; color: #065f46; border: 1px solid #34d399; }
.legend-badge.badge-bogey { background: #dbeafe; color: #1e40af; border: 1px solid #60a5fa; }
.legend-badge.badge-double { background: #f1f5f9; color: #334155; border: 1px solid #94a3b8; }

.score-legend-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--tv-bg-base);
  border-top: 1px solid var(--tv-border);
}

/* ============================================================================
   MULTI-CLUB GAME SWITCHER, FLIGHT PILLS & MOBILE-FRIENDLY SPECTATOR MODE
   ============================================================================ */
.tv-multigame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--tv-bg-card);
  border: 1px solid var(--tv-border);
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tv-game-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-game-label {
  font-size: 0.75rem;
  font-weight: 900;
  color: #064e3b;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

[data-theme="dark"] .tv-game-label {
  color: #34d399;
}

.tv-game-select {
  padding: 7px 12px;
  border-radius: 8px;
  border: 2px solid #064e3b;
  background: #ecfdf5;
  color: #064e3b;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  max-width: 380px;
}

[data-theme="dark"] .tv-game-select {
  background: #0b2e1b;
  color: #fef08a;
  border-color: #d4af37;
}

.tv-flight-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  padding: 2px 0;
}

.tv-flight-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--tv-border);
  background: var(--tv-bg-base);
  color: var(--tv-text-dark);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tv-flight-pill.active {
  background: #064e3b;
  color: #ffffff;
  border-color: #064e3b;
}

.tv-scorer-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.col-pts {
  width: 85px;
  text-align: center;
}

.pts-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 800;
}

/* Mobile & Tablet Spectator Responsiveness */
@media (max-width: 900px) {
  body.tv-mode {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    user-select: auto;
  }

  .tv-container {
    height: auto;
    min-height: 100vh;
    padding: 10px;
  }

  .tv-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .header-left {
    gap: 10px;
  }

  .trophy-mark {
    font-size: 1.8rem;
  }

  .tournament-title-wrap h1 {
    font-size: 1.15rem;
    letter-spacing: 0.5px;
  }

  .course-sub-line {
    font-size: 0.76rem;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tv-weather-widget {
    display: none;
  }

  .tv-sponsors-ribbon {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .karen-watermark-badge {
    display: none;
  }

  .tv-multigame-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 8px;
  }

  .tv-game-select-group {
    width: 100%;
  }

  .tv-game-select {
    flex: 1;
    max-width: 100%;
    font-size: 0.82rem;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .tv-board-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .tv-table {
    width: 100%;
    table-layout: fixed;
  }

  .tv-table th,
  .tv-table td {
    padding: 8px 4px !important;
    font-size: 0.78rem !important;
  }

  .col-pos {
    width: 34px !important;
    font-size: 0.85rem !important;
  }

  .col-player {
    width: auto !important;
    max-width: 0;
    overflow: hidden;
  }

  .col-total {
    width: 52px !important;
  }

  .col-pts {
    width: 46px !important;
  }

  .col-thru {
    width: 40px !important;
    font-size: 0.78rem !important;
  }

  .col-today {
    display: none !important;
  }

  .col-strokes {
    width: 46px !important;
    font-size: 0.84rem !important;
  }

  .player-cell-wrap {
    gap: 8px !important;
    min-width: 0;
    overflow: hidden;
  }

  .player-avatar {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0;
  }

  .player-name-block {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .player-name {
    font-size: 0.82rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .player-inspect-hint {
    display: none !important;
  }

  .player-country-meta {
    font-size: 0.64rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .to-par-pill,
  .pts-pill {
    font-size: 0.78rem !important;
    padding: 2px 5px !important;
    min-width: 38px !important;
  }

  .modal-overlay {
    padding: 8px !important;
  }

  .scorecard-modal-content {
    max-height: 95vh;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  .modal-avatar {
    width: 42px !important;
    height: 42px !important;
  }

  .modal-player-name {
    font-size: 1.05rem !important;
  }

  .modal-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .modal-stats-ribbon {
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  .stat-val {
    font-size: 0.95rem !important;
  }

  .scorecard-table-scroll {
    padding: 8px 10px !important;
  }

  .modal-scorecard-table {
    min-width: 620px !important;
    font-size: 0.76rem !important;
  }

  .cell-label {
    width: 60px !important;
    padding-left: 6px !important;
    font-size: 0.72rem !important;
  }
}

.hidden {
  display: none !important;
}
