/* ── Score Prediction Challenge — broadcast scoreboard theme ────────
   Charcoal studio backdrop, LED-red digits, condensed headlines,
   mono numerals, subtle scanlines. Hand-coded. */

:root {
  --studio: #101114;
  --studio-2: #17181d;
  --panel: #1d1f26;
  --panel-2: #24262f;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f3f5;
  --muted: #9aa0ab;
  --led: #ff3b3b;
  --led-glow: rgba(255, 59, 59, 0.4);
  --amber: #ffb02e;
  --err: #ff6b6b;
  --font-display: 'Oswald', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-body: 'Source Sans 3', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--studio);
  background-image:
    radial-gradient(80% 50% at 50% -10%, rgba(255, 59, 59, 0.08), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 60px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 70px 0 40px; }

.kicker {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.led {
  color: var(--led);
  text-shadow: 0 0 22px var(--led-glow);
}

.hero .sub { max-width: 480px; margin: 16px auto 0; color: var(--muted); font-size: 1.05rem; }

/* ── Countdown ────────────────────────────────────────────────────── */
.countdown-wrap { margin-top: 36px; }

.countdown-label {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.countdown { display: flex; justify-content: center; gap: 10px; }

.count-unit {
  min-width: 76px;
  padding: 12px 8px 10px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 0 18px rgba(255, 59, 59, 0.06);
}

.count-num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--led);
  text-shadow: 0 0 14px var(--led-glow);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.count-label {
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(255, 176, 46, 0.08);
  border: 1px solid rgba(255, 176, 46, 0.35);
  font-size: 0.95rem;
}

.note-warn { background: rgba(255, 59, 59, 0.08); border-color: rgba(255, 59, 59, 0.35); }

/* ── Scoreboard card ──────────────────────────────────────────────── */
.scoreboard-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px 34px;
  margin-top: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.scoreboard-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--led), var(--amber));
}

.board-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 26px;
}

/* ── Matchup / score inputs ───────────────────────────────────────── */
.matchup {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.team-col { flex: 1; max-width: 220px; text-align: center; }

.team-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  min-height: 1.4em;
}

.score-input {
  width: 100%;
  padding: 18px 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.6rem;
  text-align: center;
  color: var(--led);
  text-shadow: 0 0 12px var(--led-glow);
  background: #000;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.score-input:focus {
  outline: none;
  border-color: var(--led);
  box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.15);
}

.score-input::placeholder { color: rgba(255, 59, 59, 0.25); text-shadow: none; }

.score-input.error { border-color: var(--err); }

.at-divider { padding-bottom: 28px; }

.at {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--amber);
}

.winner-callout {
  text-align: center;
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--muted);
}

.winner-callout strong { color: var(--amber); font-weight: 600; }

/* ── Form ─────────────────────────────────────────────────────────── */
form { margin-top: 26px; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }

@media (min-width: 560px) { .field-grid { grid-template-columns: 1fr 1fr; } }

label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 176, 46, 0.14);
}

input::placeholder { color: var(--muted); opacity: 0.55; }

input.error { border-color: var(--err); }

.form-error { color: var(--err); font-size: 0.9rem; text-align: center; margin-top: 14px; font-weight: 600; }

.fine-print { text-align: center; font-size: 0.78rem; color: var(--muted); margin-top: 14px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 34px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  line-height: 1.2;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid rgba(255, 59, 59, 0.5); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--led), #d61f1f);
  color: #fff;
  box-shadow: 0 14px 36px rgba(255, 59, 59, 0.3);
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Done state ───────────────────────────────────────────────────── */
.done-card { text-align: center; }

.final-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 24px;
}

.final-team { min-width: 130px; }

.final-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 3.4rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.final-dash { font-size: 2rem; color: var(--muted); }

.done-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-sub { color: var(--muted); font-size: 0.98rem; max-width: 420px; margin: 10px auto 0; }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 600;
  z-index: 120;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  max-width: 92vw;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 28px 20px 24px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

#wbx-powered-by-slot { margin-top: 12px; }

@media (max-width: 520px) {
  .matchup { gap: 10px; }
  .at-divider { padding-bottom: 24px; }
  .final-call { gap: 12px; }
  .final-score { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
