/* ==========================================================================
   Toto — design tokens
   Concept: a stadium scoreboard at night. Deep pitch-night background,
   chalk-white type, muted turf green for action, medal gold for standings,
   and a single vermillion-red reserved only for "locking soon" urgency.
   ========================================================================== */

:root {
  --bg: #0e1613;
  --surface: #16211c;
  --surface-raised: #1c2921;
  --line: #26332c;
  --text: #f1f5f1;
  --text-muted: #8fa396;
  --gold: #d8a847;
  --gold-soft: #d8a84722;
  --turf: #4c9a6a;
  --turf-soft: #4c9a6a22;
  --live: #e1543d;
  --live-soft: #e1543d22;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, #1c2921 0%, transparent 60%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.01em;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* Cards / tiles ------------------------------------------------------------ */

.card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.match-tile {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  transition: border-color 0.15s ease;
}

.match-tile.is-locking {
  border-color: #e1543d55;
}

.match-tile.is-live {
  border-color: var(--turf);
}

/* Countdown / lock chip ------------------------------------------------------ */

.lock-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background-color: var(--turf-soft);
  color: var(--turf);
  white-space: nowrap;
}

.lock-chip.is-urgent {
  background-color: var(--live-soft);
  color: var(--live);
  animation: pulse-urgent 1.6s ease-in-out infinite;
}

.lock-chip.is-locked {
  background-color: #ffffff10;
  color: var(--text-muted);
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.live-dot {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background-color: var(--live);
  animation: pulse-urgent 1.2s ease-in-out infinite;
}

/* Score input ---------------------------------------------------------------- */

.score-input {
  width: 3rem;
  height: 3rem;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  background-color: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--text);
}

.score-input:focus {
  outline: 2px solid var(--turf);
  outline-offset: 1px;
}

.score-input:disabled {
  opacity: 0.5;
}

/* Leaderboard ----------------------------------------------------------------- */

.rank-badge {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  width: 2rem;
  text-align: center;
}

.rank-1 { color: var(--gold); }
.rank-2 { color: #c9d4ce; }
.rank-3 { color: #b8825a; }

/* Bottom tab nav (mobile-first) ---------------------------------------------- */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}

.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tab-link.is-active {
  color: var(--turf);
}

/* Buttons ---------------------------------------------------------------------- */

.btn-primary {
  background-color: var(--turf);
  color: #08130d;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.6rem 1.1rem;
  transition: opacity 0.15s ease;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background-color: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.6rem 1.1rem;
}

/* Focus visibility (accessibility floor) ---------------------------------------- */

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--turf);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .lock-chip.is-urgent, .live-dot {
    animation: none;
  }
}
