/* Global utility */
.hidden { display: none !important; }

:root {
  --orange: #ff6b1a;
  --orange-dark: #e0560a;
  --ink: #0f1419;
  --ink-2: #2a3038;
  --muted: #6b7480;
  --line: #e6e8ec;
  --bg: #fafafa;
  --card: #ffffff;
  --green: #2e9a4a;
  --red: #d63a3a;
  --yellow: #e0a800;
  --blue: #2b6cb0;
  --shadow: 0 1px 2px rgba(15, 20, 25, 0.04), 0 4px 16px rgba(15, 20, 25, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--orange);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 12px;
  color: var(--muted);
}
.site-nav {
  display: flex;
  gap: 24px;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--orange); }

/* Hero */
.hero {
  padding: 56px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 16px;
}
.hero .lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Predictor */
.match-selector {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 16px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7480' d='M6 8L0 0h12z'/></svg>") no-repeat right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.vs {
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 12px;
  font-size: 14px;
}
button {
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  transition: transform 0.05s, background 0.15s;
}
button:active { transform: translateY(1px); }
.primary {
  background: var(--orange);
  color: white;
}
.primary:hover { background: var(--orange-dark); }
.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 13px;
}
.ghost:hover { background: var(--bg); border-color: var(--ink-2); }

/* Result */
.result { margin-top: 32px; }
.result.hidden { display: none; }

.result-headline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #fff8f3 0%, #ffffff 100%);
  border: 1px solid #ffe1ce;
  border-radius: 12px;
}
.team-block { text-align: center; }
.team-block:last-child { text-align: center; }
.team-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.team-form {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.score-block { text-align: center; }
.score-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.score {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

/* Probabilities */
.prob-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.prob { }
.prob-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.prob-bar {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.prob-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
.prob-fill.home { background: var(--orange); }
.prob-fill.draw { background: var(--yellow); }
.prob-fill.away { background: var(--blue); }
.prob-val {
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Reasoning */
.reasoning {
  margin-top: 28px;
  padding: 20px;
  background: var(--bg);
  border-radius: 12px;
}
.reasoning h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.reasoning ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-2);
}
.reasoning li { margin-bottom: 4px; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.stat-card h4 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.stat-row.total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 600;
}
.form-pills {
  display: inline-flex;
  gap: 4px;
}
.pill {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.pill.W { background: var(--green); }
.pill.D { background: var(--muted); }
.pill.L { background: var(--red); }

.h2h-list { font-size: 13px; }
.h2h-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.h2h-row:last-child { border-bottom: 0; }
.h2h-result {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.confidence-meter {
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
.confidence-text {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}

/* Info sections */
.info h2 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.info > p {
  color: var(--muted);
  margin: 0 0 24px;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.how-grid h3 {
  margin: 8px 0 6px;
  font-size: 15px;
}
.how-grid p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.how-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff1e7;
  color: var(--orange);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 13px;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
details:last-of-type { border-bottom: 0; }
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  color: var(--muted);
  font-weight: 400;
  font-size: 20px;
}
details[open] summary::after { content: "−"; }
details p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Responsive */
@media (max-width: 720px) {
  .hero h1 { font-size: 32px; }
  .hero .lead { font-size: 16px; }
  .match-selector {
    grid-template-columns: 1fr;
  }
  .vs { padding: 0; text-align: center; }
  .result-headline {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .score { font-size: 44px; }
  .prob-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Cookie banner ─────────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--card);
  border-top: 2px solid var(--orange);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  padding: 16px;
}
.cookie-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  margin: 0;
  min-width: 200px;
}
.cookie-text a { color: var(--orange); }
.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
button.small { padding: 8px 16px; font-size: 13px; }

/* ── League tabs ───────────────────────────────────────────────────────────── */
.league-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.league-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.league-tab:hover:not(.disabled) {
  border-color: var(--orange);
  color: var(--orange);
}
.league-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.league-tab.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.badge-new {
  background: #10b981;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-soon {
  background: var(--muted);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ── F1 selector ───────────────────────────────────────────────────────────── */
.f1-selector {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ── F1 podium ─────────────────────────────────────────────────────────────── */
.f1-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 24px 0;
}
.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 3px solid #ccc;
  border-radius: 12px;
  padding: 16px 20px;
  background: var(--card);
  min-width: 120px;
  text-align: center;
  transition: border-color 0.3s;
}
.podium-step.p1 {
  padding-bottom: 32px;
  transform: translateY(-16px);
}
.podium-step.p2 { padding-bottom: 16px; }
.podium-step.p3 { padding-bottom: 8px; }
.podium-pos {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.podium-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.podium-team {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.f1-copy-row {
  text-align: center;
  margin-bottom: 16px;
}

/* Footer links */
.footer-sep { margin: 0 8px; }
.footer-link { color: var(--muted); text-decoration: none; }
.footer-link:hover { color: var(--orange); }

@media (max-width: 720px) {
  .cookie-inner { flex-direction: column; gap: 12px; }
  .f1-podium { gap: 4px; }
  .podium-step { min-width: 90px; padding: 12px 10px; }
}
