/* ==========================================================================
   October Chaos — design system
   Stadium-night palette, dark by default with a light theme.
   ========================================================================== */

:root {
  --bg: #070b12;
  --bg-2: #0b111b;
  --panel: #111a27;
  --panel-2: #16212f;
  --panel-3: #1c2a3a;
  --line: #253346;
  --line-soft: #1b2636;
  --text: #eaf0f7;
  --muted: #93a3b8;
  --muted-2: #6c7d93;
  --accent: #ffb300;
  --accent-2: #2fd08a;
  --accent-3: #4ea8ff;
  --danger: #ff5d63;
  --chalk: #f6f8fb;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --nav-h: 62px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}

[data-theme="light"] {
  --bg: #f3efe6;
  --bg-2: #fbf8f1;
  --panel: #ffffff;
  --panel-2: #f6f1e7;
  --panel-3: #ece4d6;
  --line: #ddd2bf;
  --line-soft: #e7ddcc;
  --text: #17202b;
  --muted: #5c6979;
  --muted-2: #7b8798;
  --accent: #c9790a;
  --accent-2: #0f8f5e;
  --accent-3: #1f6fd0;
  --danger: #c22f36;
  --chalk: #101822;
  --shadow: 0 18px 40px -24px rgba(40, 30, 10, 0.35);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 179, 0, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(78, 168, 255, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

[data-theme="light"] body {
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(201, 121, 10, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(31, 111, 208, 0.10), transparent 55%),
    var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--accent-3); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: "Anton", "Arial Narrow", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.02;
  margin: 0 0 0.4em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.3rem, 7.5vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2.6vw, 1.5rem); }
h4 { font-size: 1.02rem; letter-spacing: 0.06em; }

p { margin: 0 0 1rem; }
small { font-size: 0.82rem; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #10151d; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-family: "Anton", sans-serif; text-transform: uppercase;
  letter-spacing: 0.03em; font-size: 1.05rem; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), #ff7a00);
  display: grid; place-items: center; color: #14100a; font-size: 15px; font-weight: 900;
  font-family: "Inter", sans-serif;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.brand .tag { color: var(--muted); font-family: "Inter", sans-serif; text-transform: none; letter-spacing: 0; font-size: 0.72rem; font-weight: 600; display: none; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-links a {
  color: var(--muted); padding: 8px 11px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--panel-3); }
.nav-toggle-links { display: none; }

.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 780px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 14px;
    background: var(--bg-2); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 1rem; }
  .nav-toggle-links { display: grid; margin-left: auto; }
  .nav-inner .icon-btn.theme { margin-left: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: transform 0.08s ease, border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit; line-height: 1;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ff8a00); color: #171004; border-color: transparent; }
.btn.primary:hover { box-shadow: 0 10px 26px -12px var(--accent); }
.btn.ghost { background: transparent; }
.btn.green { background: var(--accent-2); color: #06231a; border-color: transparent; }
.btn.small { padding: 8px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Layout helpers ---------- */
section { padding: 46px 0; }
.section-head { margin-bottom: 22px; }
.section-head p { color: var(--muted); max-width: 62ch; margin-bottom: 0; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--accent); display: inline-block; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 66ch; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 520px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 860px) {
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card.flat { background: var(--panel); box-shadow: none; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
a.card { text-decoration: none; color: inherit; transition: transform 0.1s ease, border-color 0.15s; }
a.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 34px; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 0.25em; }
.hero .accent-word { color: var(--accent); }
.hero-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.stat {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 12px 16px; min-width: 132px; flex: 1 1 132px;
}
.stat .n { font-family: "Anton", sans-serif; font-size: 1.7rem; color: var(--accent); display: block; line-height: 1; }
.stat .l { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-top: 5px; display: block; }

.diamond-bg {
  position: absolute; right: -140px; top: 30px; width: 460px; height: 460px;
  border: 70px solid color-mix(in srgb, var(--accent) 8%, transparent);
  transform: rotate(45deg); border-radius: 40px; pointer-events: none;
}
@media (max-width: 700px){ .diamond-bg { display: none; } }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.hero h1, .hero .lede, .hero-actions, .hero-stats { animation: rise 0.5s ease both; }
.hero .lede { animation-delay: 0.06s; }
.hero-actions { animation-delay: 0.12s; }
.hero-stats { animation-delay: 0.18s; }

/* ---------- Ticker ---------- */
.ticker {
  border: 1px solid var(--line-soft); border-radius: 999px; background: var(--panel);
  padding: 10px 18px; display: flex; align-items: center; gap: 14px; margin-top: 8px;
  overflow: hidden;
}
.ticker .live {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--danger); flex: none;
}
.ticker .live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.ticker .items { display: flex; gap: 22px; overflow-x: auto; white-space: nowrap; color: var(--muted); font-size: 0.88rem; scrollbar-width: none; }
.ticker .items::-webkit-scrollbar { display: none; }
.ticker .items b { color: var(--text); }

/* ---------- Badges, chips, pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  background: var(--panel-3);
}
.badge.al { color: #ff9a8a; border-color: #5a2a2a; }
.badge.nl { color: #8ec2ff; border-color: #2a3f5a; }
.badge.seed { background: var(--accent); color: #171004; border-color: transparent; }
.badge.bye { background: var(--accent-2); color: #052018; border-color: transparent; }
.badge.out { color: var(--muted-2); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #171004; border-color: transparent; }

/* ---------- Team card ---------- */
.team-card {
  position: relative; border-radius: var(--radius); overflow: hidden; padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line-soft); box-shadow: var(--shadow);
}
.team-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: var(--team, var(--accent));
}
.team-card .top { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.team-card .abbr {
  width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-family: "Anton", sans-serif; font-size: 1.15rem; color: #fff; background: var(--team, var(--accent));
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.team-card .nm { font-family: "Anton", sans-serif; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.05; }
.team-card .sub { font-size: 0.78rem; color: var(--muted); }
.team-card .rec { font-family: var(--mono); font-size: 1.5rem; color: var(--text); }
.team-card .story { font-size: 0.9rem; color: var(--muted); }
.team-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.team-card .players { font-size: 0.82rem; color: var(--muted-2); margin-top: 10px; }
.team-card.eliminated { opacity: 0.68; }
.team-card.eliminated::before { background: var(--muted-2); }

/* ---------- Standings table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-weight: 800; background: var(--panel-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--panel-2); }
td .teamcell { display: inline-flex; align-items: center; gap: 9px; }
td .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--team, var(--accent)); flex: none; }

/* ---------- Bars (odds / drought) ---------- */
.bar-row { display: grid; grid-template-columns: 118px 1fr 58px; align-items: center; gap: 12px; margin-bottom: 9px; }
.bar-row .label { font-weight: 700; font-size: 0.86rem; display: flex; align-items: center; gap: 8px; }
.bar-track { height: 16px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--team, var(--accent)); background: linear-gradient(90deg, var(--team, var(--accent)), color-mix(in srgb, var(--team, var(--accent)) 60%, #000)); transition: width 0.5s ease; min-width: 2px; }
.bar-row .val { font-family: var(--mono); font-size: 0.86rem; text-align: right; color: var(--muted); }
.bar-row.hl .label { color: var(--accent); }

/* ---------- Bracket ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 10px; }
.bracket {
  display: grid; grid-template-columns: repeat(4, minmax(212px, 1fr));
  gap: 14px; min-width: 920px; align-items: start;
}
.round-col { display: flex; flex-direction: column; gap: 12px; }
.round-col > h4 { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.14em; margin-bottom: 2px; }
.round-col .round-sub { font-size: 0.72rem; color: var(--muted-2); margin-bottom: 8px; }
.series {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px;
  transition: border-color 0.15s, transform 0.1s;
}
.series.locked { opacity: 0.78; }
.series.pending { border-style: dashed; }
.series .series-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.series .series-head .status { font-size: 0.68rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
.pick {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 11px; cursor: pointer; font: inherit; margin-top: 6px;
  transition: border-color 0.12s, background 0.12s;
}
.pick:hover { border-color: var(--accent); }
.pick .seed { font-family: var(--mono); font-size: 0.72rem; color: var(--muted-2); flex: none; }
.pick .ab { font-family: "Anton", sans-serif; letter-spacing: 0.03em; }
.pick .rec { margin-left: auto; font-family: var(--mono); font-size: 0.74rem; color: var(--muted-2); }
.pick .go { color: var(--accent); font-weight: 800; display: none; }
.pick.chosen { border-color: var(--accent); background: var(--panel-3); background: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); }
.pick.chosen .go { display: inline; }
.pick.chosen .rec { color: var(--accent); }
.pick:disabled { cursor: default; }
.pick:disabled:hover { border-color: var(--line); }

/* ---------- Progress / meters ---------- */
.meter { height: 10px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.3s; }

/* ---------- Quiz ---------- */
.quiz-shell { max-width: 760px; margin-inline: auto; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 18px; margin-bottom: 10px; cursor: pointer; color: var(--text); font: inherit;
  transition: border-color 0.12s, transform 0.08s, background 0.12s;
}
.option:hover { border-color: var(--accent); transform: translateX(3px); }
.option .key { font-family: var(--mono); font-weight: 800; color: var(--muted-2); flex: none; }
.option.correct { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, var(--panel)); }
.option.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--panel)); }
.option:disabled { cursor: default; transform: none; }
.q-num { font-family: var(--mono); color: var(--muted-2); font-size: 0.85rem; }

/* ---------- Notices / callouts ---------- */
.callout {
  border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px; color: var(--muted); font-size: 0.9rem;
}
.callout.green { border-color: var(--accent-2); }
.callout.red { border-color: var(--danger); }

/* ---------- FAQ ---------- */
details.faq {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); margin-bottom: 10px; overflow: hidden;
}
details.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .body { padding: 0 18px 16px; color: var(--muted); font-size: 0.92rem; }

/* ---------- Timeline (how it works) ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .step { position: relative; margin-bottom: 20px; }
.timeline .step::before {
  content: ""; position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.timeline .step h3 { margin-bottom: 4px; font-size: 1.1rem; }
.timeline .step p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--chalk); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-weight: 700; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 300; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft); margin-top: 20px; padding: 34px 0 40px; color: var(--muted); font-size: 0.88rem;
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Utility ---------- */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap { gap: 12px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 10px; }
.mt { margin-top: 16px; } .mt-2 { margin-top: 28px; } .mb { margin-bottom: 16px; }
.muted-box { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }

/* ---------- Range slider ---------- */
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Focus & motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
