:root {
  color-scheme: dark;
}

html, body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  background-color: #f4f4f5;
}

/* Tabs */
.tab-btn {
  color: #64748b;
  transition: color 120ms ease;
}
.tab-btn.active {
  color: #0080c6;     /* BWF blue on the active tab */
}
.tab-btn:active {
  transform: scale(0.96);
}

/* Score input — hide spinner, big tap target */
input.score-input {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  width: 100%;
  padding: 0.9rem 0;
  background: #1a2340;
  border: 1px solid #273355;
  border-radius: 0;
  color: #f8fafc;
  -moz-appearance: textfield;
}
input.score-input::-webkit-outer-spin-button,
input.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.score-input:focus {
  outline: none;
  border-color: #0080c6;
}

/* Winner highlight — BWF broadcast gold/red */
.winner {
  box-shadow: inset 4px 0 0 0 #ffb020;
  background: rgba(255, 176, 32, 0.05);
}
.loser {
  opacity: 0.55;
  filter: grayscale(80%);
}

/* Rank highlights — gold / silver / bronze podium */
.rank-1 { border-color: #ffb020 !important; box-shadow: 0 0 0 1px #ffb020 inset; }
.rank-2 { border-color: #cbd5e1 !important; }
.rank-3 { border-color: #b87333 !important; }

/* Pulsing connection dot — court green = live */
.pulse-dot {
  animation: pulse-court 2s ease-in-out infinite;
}
@keyframes pulse-court {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 175, 111, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 175, 111, 0); }
}

/* Safe-area padding for notched devices in landscape */
@supports (padding: max(0px)) {
  header, main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}

/* Prevent zoom on focus (iOS) — inputs must be >=16px */
input, button, select, textarea { font-size: 16px; }
input.score-input { font-size: 2rem; } /* explicit override, safe because it's a >16 value */
