:root {
  color-scheme: dark;
  --bg: #101214;
  --card: #1b1e22;
  --text: #f2f2f2;
  --muted: #9aa0a6;
  --accent: #3d8bfd;
  --danger: #ff5555;
  --ok: #2ecc71;
  --warn: #f1c40f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.page {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin: 8px 0 0;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"], input[type="tel"] {
  width: 100%;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #0d0f11;
  color: var(--text);
}

button {
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #333;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.swatch.selected {
  border-color: var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-row {
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s ease;
}

.team-row.active {
  transform: scale(1.03);
}

.team-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.team-score {
  font-size: 2rem;
  font-weight: 700;
}

.score-controls {
  display: flex;
  gap: 8px;
}

.score-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.3rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.ratio-badge {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.clock {
  text-align: center;
}

.clock .label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.clock .value {
  font-size: 1.3rem;
  font-weight: 600;
}

.freshness-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.freshness-dot.ok { background: var(--ok); }
.freshness-dot.warn { background: var(--warn); }
.freshness-dot.stale { background: var(--danger); }

.code-display {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

a {
  color: var(--accent);
}
