/* ===== amERICan Weekend — Tribal Retro Beach Scoreboard ===== */

:root {
  --retro-red: #c92a2a;
  --retro-red-dark: #7c2d12;
  --retro-coral: #e8590c;
  --retro-coral-light: #fb923c;
  --retro-pink: #f472b6;
  --tribal-teal: #0d9488;
  --tribal-blue: #2563eb;
  --tribal-purple: #7c3aed;
  --sunset: #f97316;
  --sunset-light: #fed7aa;
  --gold: #fbbf24;
  --gold-dark: #b45309;
  --sand: #fef3c7;
  --sand-warm: #fdf4e7;
  --peach: #ffedd5;
  --cream: #fffbf0;
  --white: #ffffff;
  --gray-50: #faf9f7;
  --gray-100: #f5f3f0;
  --gray-200: #e7e3de;
  --gray-300: #d6d0c8;
  --gray-400: #a8a29e;
  --gray-500: #78716c;
  --gray-600: #57534e;
  --gray-700: #44403c;
  --gray-800: #292524;
  --gray-900: #1c1917;
  --silver: #a8a29e;
  --bronze: #d97706;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(120,60,0,0.08), 0 1px 2px rgba(120,60,0,0.06);
  --shadow-md: 0 4px 6px rgba(120,60,0,0.1), 0 2px 4px rgba(120,60,0,0.06);
  --shadow-lg: 0 10px 25px rgba(120,60,0,0.12);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sand-warm);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--retro-coral); text-decoration: none; }
a:hover { color: var(--retro-red); }

img { max-width: 100%; }

/* ===== Container ===== */

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Brand ===== */

.brand {
  font-family: 'Bangers', cursive;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 2px;
  text-decoration: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.brand:hover { color: var(--white); }

.brand-highlight {
  color: var(--gold);
  font-size: 1.15em;
}

.brand--hero {
  font-size: 3rem;
  color: var(--retro-red);
  display: block;
  text-align: center;
  text-shadow:
    -2px -2px 0 var(--gold),
     2px -2px 0 var(--gold),
    -2px  2px 0 var(--gold),
     2px  2px 0 var(--gold),
     0 4px 0 var(--gold-dark);
  letter-spacing: 3px;
}

.brand--hero .brand-highlight {
  color: var(--white);
  text-shadow:
    -2px -2px 0 var(--retro-red),
     2px -2px 0 var(--retro-red),
    -2px  2px 0 var(--retro-red),
     2px  2px 0 var(--retro-red),
     0 4px 0 var(--retro-red-dark);
}

.brand--sm { font-size: 1.3rem; }

.brand--auth {
  font-size: 2.2rem;
  color: var(--retro-red);
  display: block;
  text-align: center;
  margin-bottom: 0.25rem;
  text-shadow:
    -1px -1px 0 var(--gold),
     1px -1px 0 var(--gold),
    -1px  1px 0 var(--gold),
     1px  1px 0 var(--gold);
}

/* ===== Papel Picado Banner ===== */

.tribal-stripe {
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='20' viewBox='0 0 180 20'%3E%3Crect width='180' height='3' fill='%23292524'/%3E%3Cpolygon points='0,3 36,3 18,19' fill='%23e8590c'/%3E%3Cpolygon points='36,3 72,3 54,19' fill='%230d9488'/%3E%3Cpolygon points='72,3 108,3 90,19' fill='%23fbbf24'/%3E%3Cpolygon points='108,3 144,3 126,19' fill='%237c3aed'/%3E%3Cpolygon points='144,3 180,3 162,19' fill='%23ec4899'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 180px 20px;
}

.tribal-stripe--small {
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='14' viewBox='0 0 150 14'%3E%3Crect width='150' height='2' fill='%23292524'/%3E%3Cpolygon points='0,2 30,2 15,13' fill='%23e8590c'/%3E%3Cpolygon points='30,2 60,2 45,13' fill='%230d9488'/%3E%3Cpolygon points='60,2 90,2 75,13' fill='%23fbbf24'/%3E%3Cpolygon points='90,2 120,2 105,13' fill='%237c3aed'/%3E%3Cpolygon points='120,2 150,2 135,13' fill='%23ec4899'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 150px 14px;
}

/* ===== Game Master ===== */

.game-master {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.game-master-photo {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.game-master-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--retro-red-dark);
  background: var(--sand);
  border: 2px solid var(--gold);
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
}

.tv-game-master {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--retro-red-dark);
  letter-spacing: 0.5px;
}

.tv-gm-photo {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--gold);
}

/* ===== Footer Eric ===== */

.footer-eric {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--gray-300);
  margin-bottom: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.3s;
}

.footer-eric:hover {
  opacity: 1;
  transform: scale(1.3) rotate(-5deg);
}

/* ===== Join Page Host Photo ===== */

.join-host-photo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  margin-bottom: 0.75rem;
}

/* ===== Header ===== */

.site-header {
  background: linear-gradient(135deg, #b91c1c 0%, var(--retro-coral) 60%, var(--sunset) 100%);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(185,28,28,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-link:hover {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

.nav-link--admin {
  background: var(--gold);
  color: var(--gray-900);
  font-weight: 700;
}

.nav-link--admin:hover { background: #fcd34d; color: var(--gray-900); }

.nav-link--logout {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}

/* ===== Admin Header ===== */

.admin-header {
  background: linear-gradient(135deg, var(--gray-900) 0%, #3a1c0e 100%);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--gold);
  color: var(--gray-900);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.admin-body { background: var(--gray-100); }

/* ===== Hero ===== */

.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
  background: linear-gradient(180deg, #fecaca 0%, var(--peach) 40%, var(--sand-warm) 100%);
  margin: -0.01px -1rem 0;
  padding-left: 1rem;
  padding-right: 1rem;
  position: relative;
}

.hero::after {
  content: '';
  display: block;
  height: 14px;
  margin-top: 1.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='14' viewBox='0 0 150 14'%3E%3Crect width='150' height='2' fill='%23d6d0c8'/%3E%3Cpolygon points='0,2 30,2 15,13' fill='%23e8590c' opacity='0.3'/%3E%3Cpolygon points='30,2 60,2 45,13' fill='%230d9488' opacity='0.3'/%3E%3Cpolygon points='60,2 90,2 75,13' fill='%23fbbf24' opacity='0.3'/%3E%3Cpolygon points='90,2 120,2 105,13' fill='%237c3aed' opacity='0.3'/%3E%3Cpolygon points='120,2 150,2 135,13' fill='%23ec4899' opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 150px 14px;
}

.hero-tagline {
  color: var(--gray-500);
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

/* ===== Flash ===== */

.flash {
  padding: 0.65rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.flash--notice {
  background: #fef9ee;
  color: #92400e;
  border-bottom: 2px solid var(--gold);
}

.flash--alert {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 2px solid var(--danger);
}

/* ===== Main Content ===== */

.main-content { padding: 1.5rem 0 3rem; }

/* ===== Section ===== */

.section { margin-top: 2rem; }

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid var(--tribal-teal);
  display: inline-block;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.back-link:hover { color: var(--retro-coral); }

.empty-state {
  text-align: center;
  color: var(--gray-400);
  padding: 2rem 1rem;
  font-size: 1rem;
}

/* ===== Leaderboard ===== */

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}

.lb-row--top { box-shadow: var(--shadow-md); }

.lb-row--first {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid var(--gold);
  border-left: 5px solid var(--tribal-teal);
  position: relative;
}

.lb-rank {
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.lb-medal { font-size: 1.4rem; }

.lb-number {
  font-weight: 700;
  color: var(--gray-400);
  font-size: 0.95rem;
}

.lb-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.lb-avatar--sm { width: 2rem; height: 2rem; font-size: 0.7rem; }

.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--retro-red);
  flex-shrink: 0;
}

.lb-pts {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-400);
}

/* ===== Game Cards ===== */

.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.game-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--gray-800);
  border-top: 3px solid var(--gray-200);
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--gray-800);
  border-top-color: var(--tribal-teal);
}

.game-card:nth-child(3n+1) { border-top-color: var(--sunset); }
.game-card:nth-child(3n+1):hover { border-top-color: var(--retro-red); }
.game-card:nth-child(3n+2) { border-top-color: var(--tribal-teal); }
.game-card:nth-child(3n+2):hover { border-top-color: var(--tribal-blue); }
.game-card:nth-child(3n+3) { border-top-color: var(--gold); }
.game-card:nth-child(3n+3):hover { border-top-color: var(--retro-coral); }

.game-card-header { margin-bottom: 0.5rem; }

.game-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.game-card-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.game-card-time {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.game-card-winner {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bronze);
  margin-top: 0.5rem;
}

.game-card-podium {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
}

.podium-entry {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.game-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.game-description {
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.game-schedule {
  font-size: 0.9rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

/* ===== Badges ===== */

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
}

.badge--sm { font-size: 0.65rem; padding: 0.15rem 0.45rem; }
.badge--lg { font-size: 0.8rem; padding: 0.25rem 0.75rem; }

.badge--upcoming { background: var(--gray-100); color: var(--gray-500); }
.badge--live { background: #fef2f2; color: #dc2626; animation: pulse-live 2s ease-in-out infinite; }
.badge--done { background: #ecfdf5; color: #059669; }

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
  gap: 0.35rem;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: linear-gradient(135deg, var(--retro-coral) 0%, var(--sunset) 100%);
  color: var(--white);
  border-color: var(--retro-coral);
  box-shadow: 0 2px 8px rgba(232,89,12,0.3);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
  border-color: #c2410c;
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn--outline:hover { border-color: var(--gray-400); background: var(--cream); color: var(--gray-700); }

.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn--danger:hover { background: var(--danger); color: var(--white); }

.btn--sm { font-size: 0.78rem; padding: 0.3rem 0.65rem; }

.btn--lg { font-size: 1rem; padding: 0.75rem 1.5rem; }

.btn--full { width: 100%; }

/* ===== Forms ===== */

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  max-width: 500px;
}

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.3rem;
}

.form-input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--retro-coral-light);
  box-shadow: 0 0 0 3px rgba(251,146,60,0.2);
}

.form-textarea { resize: vertical; }

.form-color {
  width: 4rem;
  height: 2.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 1rem;
  color: #991b1b;
  font-size: 0.85rem;
}

/* ===== Auth ===== */

.auth-container {
  max-width: 380px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--gray-400);
  margin-bottom: 1.5rem;
}

.auth-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* ===== Stats Grid ===== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--retro-red);
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ===== Admin List ===== */

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.admin-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.admin-list-name {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-meta {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
}

.admin-list-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* ===== Quick Actions ===== */

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===== Score Entry ===== */

.scores-form { margin-top: 1rem; }

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  box-shadow: var(--shadow);
}

.score-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.score-player-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.score-input {
  width: 5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.score-unit {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* ===== Bonus Points ===== */

.bonus-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.bonus-form-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.bonus-form-player { flex: 1; min-width: 140px; }
.bonus-form-points { display: flex; align-items: center; gap: 0.25rem; width: 5.5rem; }
.bonus-form-reason { flex: 2; min-width: 160px; }

.bonus-form .form-group { margin-bottom: 0; }

.bonus-points-value {
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.bonus--positive { color: var(--tribal-teal); }
.bonus--negative { color: var(--danger); }

@media (max-width: 600px) {
  .bonus-form-row { flex-direction: column; }
  .bonus-form-player,
  .bonus-form-points,
  .bonus-form-reason { width: 100%; min-width: unset; }
  .bonus-form-points { width: 100%; }
}

/* ===== QR Code ===== */

.qr-page {
  text-align: center;
  padding: 2rem 0;
}

.qr-subtitle {
  color: var(--gray-500);
  font-size: 1.1rem;
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}

.qr-code-wrap {
  display: inline-block;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
}

.qr-code-wrap svg { display: block; max-width: 280px; height: auto; }

.qr-url {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--gray-500);
  word-break: break-all;
  margin-bottom: 1.5rem;
}

.qr-actions { margin-top: 1rem; }

/* ===== Footer ===== */

.site-footer {
  text-align: center;
  padding: 1.5rem 0 1rem;
  color: var(--gray-400);
  font-size: 0.8rem;
  margin-top: 2rem;
}

.site-footer::before {
  content: '';
  display: block;
  height: 14px;
  margin-bottom: 1.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='14' viewBox='0 0 150 14'%3E%3Crect width='150' height='2' fill='%23d6d0c8'/%3E%3Cpolygon points='0,2 30,2 15,13' fill='%23e8590c' opacity='0.25'/%3E%3Cpolygon points='30,2 60,2 45,13' fill='%230d9488' opacity='0.25'/%3E%3Cpolygon points='60,2 90,2 75,13' fill='%23fbbf24' opacity='0.25'/%3E%3Cpolygon points='90,2 120,2 105,13' fill='%237c3aed' opacity='0.25'/%3E%3Cpolygon points='120,2 150,2 135,13' fill='%23ec4899' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 150px 14px;
}

.site-footer .brand-highlight { color: var(--retro-coral); }

/* ===== TV Mode ===== */

.tv-mode {
  background: linear-gradient(180deg, #fecaca 0%, var(--peach) 20%, var(--sand-warm) 50%, var(--sand) 100%);
  color: var(--gray-900);
  min-height: 100vh;
  overflow: hidden;
}

.tv-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tv-header {
  text-align: center;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.brand--tv {
  font-size: 3.5rem;
  color: var(--retro-red);
  text-shadow:
    -2px -2px 0 var(--gold),
     2px -2px 0 var(--gold),
    -2px  2px 0 var(--gold),
     2px  2px 0 var(--gold),
     0 4px 0 var(--gold-dark);
}

.brand--tv .brand-highlight {
  color: var(--white);
  text-shadow:
    -2px -2px 0 var(--retro-red),
     2px -2px 0 var(--retro-red),
    -2px  2px 0 var(--retro-red),
     2px  2px 0 var(--retro-red),
     0 4px 0 var(--retro-red-dark);
}

.tv-tagline {
  color: var(--gray-500);
  font-size: 1.2rem;
  margin-top: 0.25rem;
}

.tv-tribal-stripe {
  height: 8px;
  margin-bottom: 1.5rem;
  background:
    linear-gradient(135deg, var(--gold) 25%, transparent 25%) -10px 0,
    linear-gradient(225deg, var(--gold) 25%, transparent 25%) -10px 0,
    linear-gradient(315deg, var(--gold) 25%, transparent 25%),
    linear-gradient(45deg, var(--gold) 25%, transparent 25%);
  background-size: 20px 8px;
  background-color: var(--retro-red);
  border-radius: 4px;
}

.tv-now-playing {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--retro-red);
  padding: 0.75rem;
  background: var(--white);
  border: 2px solid var(--retro-coral-light);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: pulse-live 2s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.tv-leaderboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.5rem;
  flex: 1;
  align-content: start;
}

.tv-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  box-shadow: var(--shadow);
}

.tv-row--top {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.tv-rank {
  width: 2.5rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-400);
  flex-shrink: 0;
}

.tv-row--top .tv-rank { color: var(--gray-800); }

.tv-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tv-name {
  flex: 1;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--gray-800);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-score {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  color: var(--retro-red);
  flex-shrink: 0;
  letter-spacing: 1px;
}

/* ===== TV Games Grid ===== */

.tv-games-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gray-200);
  flex-shrink: 0;
}

.tv-games-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  text-align: center;
}

.tv-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.tv-game-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--gray-200);
}

.tv-game-card--in_progress {
  border-left-color: var(--retro-coral);
  background: #fff5f5;
}

.tv-game-card--completed {
  border-left-color: var(--tribal-teal);
}

.tv-game-status { margin-bottom: 0.25rem; }

.tv-game-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gray-800);
}

.tv-game-winners {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.3rem;
}

.tv-game-winner {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.tv-game-live-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--retro-coral);
  margin-top: 0.25rem;
  animation: pulse-live 2s ease-in-out infinite;
}

@media (min-width: 1400px) {
  .tv-games-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .tv-game-name { font-size: 1.05rem; }
}

.tv-kids-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gray-200);
  flex-shrink: 0;
}

.tv-kids-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  text-align: center;
}

.tv-leaderboard--kids {
  gap: 0.4rem 1rem;
}

.tv-footer {
  flex-shrink: 0;
  margin-top: 1.5rem;
  text-align: center;
}

.tv-games-summary {
  font-size: 1rem;
  color: var(--gray-500);
  padding: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

/* ===== Nav Player Avatar ===== */

.nav-player {
  display: flex;
  align-items: center;
}

.nav-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 0.65rem;
  border: 2px solid rgba(255,255,255,0.5);
}

.nav-link--join {
  background: var(--gold);
  color: var(--gray-900);
  font-weight: 700;
}

.nav-link--join:hover { background: #fcd34d; color: var(--gray-900); }

/* ===== Hero CTA ===== */

.hero-cta { margin-top: 1rem; }

/* ===== Join Page ===== */

.join-page {
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
}

.join-subtitle {
  color: var(--gray-500);
  font-size: 1.1rem;
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}

.join-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.form-input--lg {
  font-size: 1.15rem;
  padding: 0.75rem 1rem;
}

.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.color-swatch {
  cursor: pointer;
  position: relative;
}

.color-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-dot {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}

.color-radio:checked + .color-dot {
  border-color: var(--gray-900);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--gray-400);
}

.color-dot:hover {
  transform: scale(1.1);
}

.join-footer {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--gray-400);
}

/* ===== Responsive: Tablet+ ===== */

@media (min-width: 640px) {
  .container { max-width: 800px; padding: 0 1.5rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .brand--hero { font-size: 3.5rem; }
  .hero { padding: 2.5rem 0 2rem; }
}

/* ===== Responsive: Desktop ===== */

@media (min-width: 1024px) {
  .container { max-width: 960px; }
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Responsive: Mobile tweaks ===== */

@media (max-width: 480px) {
  .brand { font-size: 1.2rem; }
  .nav-link { font-size: 0.78rem; padding: 0.3rem 0.5rem; }
  .lb-avatar { width: 2rem; height: 2rem; font-size: 0.7rem; }
  .lb-name { font-size: 0.88rem; }
  .lb-score { font-size: 1rem; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .stat-number { font-size: 1.5rem; }
  .admin-list-item { font-size: 0.85rem; }
  .form-row { grid-template-columns: 1fr; }
  .score-input { width: 4rem; }
  .brand--hero {
    font-size: 2.4rem;
    text-shadow:
      -1px -1px 0 var(--gold),
       1px -1px 0 var(--gold),
      -1px  1px 0 var(--gold),
       1px  1px 0 var(--gold),
       0 3px 0 var(--gold-dark);
  }
}

/* ===== TV Responsive ===== */

@media (max-width: 768px) {
  .tv-container { padding: 1rem; }
  .brand--tv { font-size: 2rem; }
  .tv-leaderboard { grid-template-columns: 1fr; }
  .tv-name { font-size: 1rem; }
  .tv-score { font-size: 1.4rem; }
  .tv-now-playing { font-size: 1rem; }
}

@media (min-width: 1400px) {
  .tv-container { padding: 2rem 4rem; }
  .brand--tv { font-size: 4.5rem; }
  .tv-name { font-size: 1.4rem; }
  .tv-score { font-size: 2.2rem; }
  .tv-avatar { width: 3rem; height: 3rem; font-size: 1rem; }
  .tv-row { padding: 0.75rem 1.25rem; }
}
