/* Entry page and privacy page. Mobile first: most entrants are on a phone in a lounge. */
:root {
  --red: #a10c12;
  --red-dark: #7a090d;
  --red-soft: #fdecec;
  --ink: #16181d;
  --muted: #5b6270;
  --faint: #8a909c;
  --line: #e3e5ea;
  --field: #f6f7f9;
  --bg: #f2f3f5;
  --card: #ffffff;
  --ok: #157f3b;
  --ok-soft: #e8f6ed;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
a { color: var(--red); }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { max-width: 480px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- hero ---------- */
.hero {
  background: var(--red);
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,0.14), transparent 60%);
  color: #fff;
  margin: 0 -16px;
  padding: 22px 20px 64px;
  text-align: center;
}
.hero-crest { display: block; margin: 0 auto; width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.22); }
.hero-kicker { margin: 10px 0 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; opacity: 0.9; }
.hero h1 { margin: 2px 0 0; font-size: 1.9rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.hero p { margin: 6px auto 0; max-width: 34ch; opacity: 0.95; font-size: 0.98rem; }

/* ---------- match card ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.match { margin-top: -44px; padding: 18px 18px 16px; text-align: center; position: relative; }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.teams .team:first-child { text-align: right; }
.teams .team:last-child { text-align: left; }
.team { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.vs { color: var(--faint); font-weight: 600; font-size: 0.85rem; }
.when { margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; }
.countdown {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: var(--red-soft); color: var(--red-dark); font-weight: 600; font-size: 0.88rem;
  padding: 4px 12px; border-radius: 999px;
}
.countdown::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .countdown::before { animation: none; } }

/* ---------- form ---------- */
.form { margin-top: 14px; padding: 20px 18px 18px; }
.step { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.step-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; padding: 0; font-weight: 700; font-size: 1.02rem; }
.step-title .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.75rem; flex: none; transform: translateY(-1px); }
.hint { color: var(--muted); font-size: 0.86rem; margin: -4px 0 10px; }

.scores { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.score { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 12px; text-align: center; }
.score-team { font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 2px; max-width: 160px; margin: 0 auto; }
.stepper button {
  width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 1.4rem; line-height: 1; color: var(--ink); cursor: pointer; display: grid; place-items: center;
  touch-action: manipulation;
}
.stepper button:active { background: var(--red-soft); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper input {
  width: 100%; min-width: 0; height: 52px; text-align: center; font-size: 2rem; font-weight: 800; border: 0; background: transparent;
  color: var(--ink); padding: 0; -moz-appearance: textfield; font-variant-numeric: tabular-nums;
}
.stepper input:focus { outline: 2px solid var(--red); border-radius: 8px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.optional { color: var(--faint); font-weight: 400; }
input[type=text], input[type=email] {
  width: 100%; height: 50px; padding: 0 14px; font: inherit; font-size: 1.02rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}
input[type=text]:focus, input[type=email]:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(161, 12, 18, 0.18); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.attendance input { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.invalid input, input.invalid { border-color: var(--red); background: #fff; }
.err { color: var(--red-dark); font-size: 0.86rem; margin-top: 6px; }
.suggest { margin-top: 6px; font-size: 0.88rem; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; }
.suggest button { background: none; border: 0; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; cursor: pointer; font-weight: 400; font-size: 0.93rem; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--red); }
.check.invalid { border-color: var(--red); background: #fff8f8; }

.submit {
  width: 100%; height: 56px; border: 0; border-radius: 12px; background: var(--red); color: #fff;
  font-size: 1.1rem; font-weight: 700; cursor: pointer; margin-top: 6px; transition: background 0.15s, transform 0.05s;
}
.submit:hover { background: var(--red-dark); }
.submit:active { transform: scale(0.99); }
.submit:disabled { opacity: 0.7; cursor: progress; }
.form-error { background: var(--red-soft); color: var(--red-dark); border-radius: 10px; padding: 10px 12px; font-size: 0.92rem; margin-bottom: 14px; }
.remembered { font-size: 0.85rem; color: var(--muted); margin: -2px 0 12px; }
.remembered button { background: none; border: 0; padding: 0; color: var(--red); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- states ---------- */
.state { margin-top: 14px; padding: 26px 20px; text-align: center; }
.state h2 { margin: 8px 0 6px; font-size: 1.35rem; }
.state p { margin: 0 auto; color: var(--muted); max-width: 36ch; }
.state .icon { width: 52px; height: 52px; }
.state.ok .icon { color: var(--ok); }
.receipt { margin: 18px 0 0; background: var(--field); border-radius: 12px; padding: 14px; text-align: left; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.95rem; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 700; text-align: right; }
.skeleton { height: 120px; margin-top: -44px; position: relative; display: grid; place-items: center; color: var(--faint); }

/* ---------- terms & footer ---------- */
.terms { margin-top: 14px; padding: 0; }
.terms summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.terms summary::-webkit-details-marker { display: none; }
.terms summary::after { content: "+"; font-size: 1.3rem; color: var(--faint); line-height: 1; }
.terms[open] summary::after { content: "\2212"; }
.terms ul { margin: 0; padding: 0 18px 16px 36px; color: var(--muted); font-size: 0.9rem; }
.terms li { margin-bottom: 4px; }
.footer { text-align: center; color: var(--faint); font-size: 0.82rem; margin-top: 22px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--faint); }

/* ---------- privacy page ---------- */
.prose { padding: 22px 20px; margin-top: 16px; }
.prose h1 { color: var(--red); font-size: 1.5rem; line-height: 1.25; margin: 0 0 6px; }
.prose h2 { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.prose p, .prose li { color: #333a45; }
.back { display: inline-block; margin-top: 18px; }

@media (min-width: 600px) {
  .page { padding-top: 24px; }
  .hero { margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
}

@media (max-width: 359px) {
  .score { padding: 10px 4px 12px; }
  .stepper button { width: 34px; height: 34px; font-size: 1.2rem; }
  .stepper input { font-size: 1.7rem; }
}
