:root {
  /* Fenway Green Monster palette */
  --board-green: #1a472a;
  --board-dark: #112a1a;
  --board-deep: #0c1f12;
  --panel-bg: #0a1a0f;
  --panel-border: #2d5a3a;
  --cream: #f5e6c8;
  --cream-dim: #c4b08a;
  --amber: #ffc857;
  --amber-dim: rgba(255, 200, 87, 0.3);
  --red: #c23b22;
  --red-dim: rgba(194, 59, 34, 0.3);
  --rivet: #8b7355;
  --rivet-shadow: #5a4a38;
  --text-paint: #d4c9a8;
  --text-faded: #6b7c6b;
  --frame-brown: #3d2b1f;
  --frame-edge: #2a1d14;

  --font-title: 'Oswald', sans-serif;
  --font-number: 'Oswald', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
}

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

body {
  background: #0a0f0a;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(26, 71, 42, 0.3) 0%, transparent 60%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 12px 48px;
  font-family: var(--font-body);
}

/* ======= BOARD FRAME ======= */
.board-frame {
  width: 100%;
  max-width: 580px;
  background: var(--frame-brown);
  border-radius: 6px;
  padding: 8px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 2px 0 var(--frame-edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.board {
  position: relative;
  background: var(--board-green);
  border-radius: 3px;
  padding: 28px 24px 20px;
  overflow: hidden;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Aged paint texture */
.board-texture {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

/* ======= RIVETS ======= */
.rivet {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a8956e, var(--rivet) 50%, var(--rivet-shadow));
  box-shadow:
    inset 0 -1px 2px rgba(0, 0, 0, 0.4),
    0 1px 1px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.rivet.sm {
  width: 7px;
  height: 7px;
}

/* ======= HEADER ======= */
header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

h1 {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 3px;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(245, 230, 200, 0.08);
  line-height: 1.1;
}

.subtitle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.subtitle {
  font-family: var(--font-number);
  font-size: 16px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 4px;
  text-shadow: 0 0 12px rgba(255, 200, 87, 0.2);
}

/* ======= SCORE PANEL ======= */
.score-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  background: var(--board-dark);
  border-radius: 4px;
  padding: 16px 12px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.03);
}

.score-slot {
  text-align: center;
  flex: 1;
}

.slot-label {
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-paint);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: 6px;
}

.slot-number {
  font-family: var(--font-number);
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
  text-shadow:
    0 0 20px rgba(245, 230, 200, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.6);
  /* Number panel inset */
  background: var(--panel-bg);
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  padding: 8px 16px 4px;
  margin: 0 8px;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.score-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
}

/* Indicator lights (cosmetic BSO-style) */
.indicator-lights {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.light.on {
  background: var(--amber);
  border-color: rgba(255, 200, 87, 0.5);
  box-shadow:
    inset 0 1px 3px rgba(255, 220, 120, 0.6),
    0 0 8px rgba(255, 200, 87, 0.4),
    0 0 20px rgba(255, 200, 87, 0.15);
}

/* ======= SECTION HEADERS ======= */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-paint);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin: 28px 0 12px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--panel-border), transparent);
}

/* ======= BET CARDS (Scoreboard Rows) ======= */
.bet-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bet-card {
  background: var(--board-dark);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  padding: 12px 14px;
  border-left: 4px solid var(--panel-border);
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.02);
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 0.4s ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

.bet-card:hover {
  background: rgba(20, 50, 30, 0.8);
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(255, 200, 87, 0.05);
}

.bet-card.ryan { border-left-color: var(--cream); }
.bet-card.taylor { border-left-color: var(--red); }

.bet-card.won {
  border-left-color: var(--amber);
  background: rgba(255, 200, 87, 0.03);
}

.bet-card.lost {
  border-left-color: var(--red);
  background: rgba(194, 59, 34, 0.05);
}

.bet-card.awaiting {
  animation-name: cardInDim;
  border-left-color: var(--text-faded);
}

.bet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.bet-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-paint);
  flex: 1;
  line-height: 1.4;
}

.bet-label .bettor {
  font-family: var(--font-number);
  font-weight: 700;
  font-size: 11px;
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

.bet-label .bettor.ryan {
  color: var(--board-dark);
  background: var(--cream);
}

.bet-label .bettor.taylor {
  color: var(--cream);
  background: var(--red);
}

.bet-value {
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
  white-space: nowrap;
  letter-spacing: 1px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  padding: 2px 10px 0;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.2);
}

.bet-detail {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-faded);
  margin-bottom: 8px;
}

/* ======= PROGRESS BAR (LED bar style) ======= */
.progress-track {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  height: 8px;
  overflow: visible;
  position: relative;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.progress-fill {
  height: 100%;
  border-radius: 1px;
  position: relative;
  width: 0;
  animation: fillBar 0.8s ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

.progress-fill.ryan {
  background: linear-gradient(90deg, var(--cream-dim), var(--cream));
  box-shadow: 0 0 6px rgba(245, 230, 200, 0.2);
}

.progress-fill.taylor {
  background: linear-gradient(90deg, #8b2518, var(--red));
  box-shadow: 0 0 6px rgba(194, 59, 34, 0.3);
}

.threshold-marker {
  position: absolute;
  right: -1px;
  top: -4px;
  height: 16px;
  width: 3px;
  background: var(--amber);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(255, 200, 87, 0.4);
}

/* ======= STATUS BADGES ======= */
.status-badge {
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 12px 0;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.status-badge.won {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(255, 200, 87, 0.3);
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.3);
  animation: bulbGlow 2.5s ease-in-out infinite alternate;
}

.status-badge.lost {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(194, 59, 34, 0.3);
}

.status-badge.pending {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-faded);
  border: 1px solid rgba(0, 0, 0, 0.3);
  font-weight: 500;
  font-size: 10px;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  text-transform: none;
}

/* ======= LGM / NL EAST ======= */
.lgm {
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff5910;
  text-shadow: 0 0 8px rgba(255, 89, 16, 0.3);
}

.standings-table {
  background: var(--board-dark);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

.standings-row {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-paint);
  transition: background 0.15s;
}

.standings-row:last-child { border-bottom: none; }
.standings-row:hover { background: rgba(255, 255, 255, 0.02); }

.standings-row.mets-row {
  background: rgba(0, 45, 114, 0.15);
  color: #ff5910;
  font-weight: 600;
}

.standings-row.braves-row {
  opacity: 0.5;
}

.standings-team { flex: 1; }

.standings-record {
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 600;
  width: 70px;
  text-align: center;
  letter-spacing: 1px;
}

.standings-gb {
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 500;
  width: 50px;
  text-align: right;
  color: var(--text-faded);
}

.standings-gb.leader { color: var(--amber); }

/* ======= FOOTER ======= */
footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 12px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-faded);
  letter-spacing: 0.5px;
}

/* ======= LOADING ======= */
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-faded);
  font-family: var(--font-number);
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.loading::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

/* ======= ANIMATIONS ======= */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardInDim {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.45; transform: translateY(0); }
}

@keyframes fillBar {
  from { width: 0; }
}

@keyframes bulbGlow {
  from { box-shadow: 0 0 4px rgba(255, 200, 87, 0.1); }
  to { box-shadow: 0 0 12px rgba(255, 200, 87, 0.3); }
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ======= RESPONSIVE ======= */
@media (max-width: 420px) {
  h1 { font-size: 22px; letter-spacing: 2px; }
  .slot-number { font-size: 60px; padding: 6px 12px 2px; }
  .board { padding: 20px 14px 16px; }
  .board-frame { padding: 6px; }
  body { padding: 12px 8px 32px; }
  .bet-label { font-size: 13px; }
}
