/* StatsFun site. Tokens mirror app/src/theme.ts: court blue surface, white cards, ink scoreboard with LED yellow. */

:root {
  --court: #2d5bd2;
  --court-deep: #2049b4;
  --ink: #13203f;
  --ink-raised: #22335f;
  --ink-soft: #5b6785;
  --wash: #eef2fb;
  --led: #ffd447;
  --white: #ffffff;
  --on-court-soft: #e3eafe;
  --on-ink-soft: #b9c3dd;
  --line: rgba(255, 255, 255, 0.28);
  --mark: #ffe58a;

  --tier-7: #ffc23d;
  --tier-5: #ff6f59;
  --tier-3: #1fc8a8;
  --tier-2: #a99bff;
  --tier-1: #d5dceb;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --measure: 40rem;
  --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--ink); }

body {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--court-deep); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }

/* Focus: yellow on blue and ink, deep blue on light surfaces. */
:focus-visible { outline: 3px solid var(--focus, var(--court-deep)); outline-offset: 3px; border-radius: 4px; }
.on-court, .on-ink { --focus: var(--led); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--white); color: var(--ink); padding: 0.6rem 1rem; border-radius: 10px; font-weight: 800;
}
.skip:focus { top: var(--gutter); }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

/* Surfaces */
.on-court { background: var(--court); color: var(--white); }
.on-court a { color: var(--white); }
.on-ink { background: var(--ink); color: var(--white); }
.on-ink a { color: var(--white); }
.on-wash { background: var(--wash); }

/* Header */
.site-header { padding-block: 14px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: inherit;
  font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; line-height: 1; letter-spacing: 0.005em;
}
.wordmark img { width: 30px; height: 30px; border-radius: 7px; }
.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-weight: 700; text-decoration: none; padding-block: 0.5rem; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 0.12em; text-underline-offset: 0.25em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.5rem;
  border-radius: 999px; border: 2px solid transparent; font: 800 1rem/1 var(--font-text); text-decoration: none; cursor: pointer;
}
.on-court a.btn--white, .btn--white { background: var(--white); color: var(--ink); }
.on-court a.btn--white:hover, .btn--white:hover { background: var(--wash); }
.on-court a.btn--line, .btn--line { border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.btn--line:hover { background: rgba(255, 255, 255, 0.14); }
.btn--ink { background: var(--ink); color: var(--white); }
a.btn--ink { color: var(--white); }
.btn--ink:hover { background: var(--ink-raised); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: 1.5rem 3.5rem; }
.hero::before {
  content: ""; position: absolute; right: -140px; bottom: -70px; width: 860px; height: 560px; pointer-events: none;
  background: url("/assets/court-lines.svg") no-repeat center / contain;
}
.hero .wrap { position: relative; display: grid; gap: 2.5rem; }
.hero h1 {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(3.1rem, 12.5vw, 5.75rem); line-height: 0.92; letter-spacing: -0.005em;
}
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--on-court-soft); max-width: 31rem; margin-top: 1.25rem; }
.hero .btn-row { margin-top: 1.75rem; }
.hero-note { margin-top: 1rem; color: var(--on-court-soft); font-weight: 700; }

/* Scoreboard: the one memorable element */
.sb {
  margin: 0; background: var(--ink); color: var(--white); border-radius: 22px; padding: 18px 18px 10px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.18), 0 30px 40px -26px rgba(5, 12, 35, 0.75);
  max-width: 30rem; width: 100%;
}
.sb-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.95rem; color: var(--on-ink-soft); font-weight: 700; }
.sb-final { color: var(--white); display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; }
.sb-final::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--led); box-shadow: 0 0 10px var(--led); }
.sb-tally { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 0.5rem; align-items: end; margin-top: 0.9rem; }
.sb-num {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(5rem, 22vw, 7rem); line-height: 0.82; color: var(--led);
  text-shadow: 0 0 22px rgba(255, 212, 71, 0.4); font-variant-numeric: tabular-nums;
}
.sb-num--you { text-align: left; }
.sb-num--them { text-align: right; }
.sb-dash { font-family: var(--font-display); font-weight: 900; font-size: 3rem; line-height: 0.9; color: var(--on-ink-soft); padding-bottom: 0.15rem; }
.sb-who { display: grid; grid-template-columns: 1fr 1fr; margin-top: 0.4rem; font-weight: 700; font-size: 0.95rem; color: var(--on-ink-soft); }
.sb-who span:last-child { text-align: right; }
.sb-lineup { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--ink-raised); }
.sb-lineup p { margin: 0 0.3rem 0 0; font-weight: 700; font-size: 0.95rem; color: var(--on-ink-soft); flex-basis: 100%; }
.chip { display: inline-block; min-width: 2.6rem; padding: 0.1rem 0.6rem 0; text-align: center; border-radius: 8px; color: var(--ink); font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; line-height: 1.4; }
.chip--7 { background: var(--tier-7); }
.chip--5 { background: var(--tier-5); }
.chip--3 { background: var(--tier-3); }
.chip--2 { background: var(--tier-2); }
.chip--1 { background: var(--tier-1); }

.sb table { width: 100%; border-collapse: collapse; margin-top: 0.9rem; }
.sb caption { text-align: left; }
.sb thead th { font-size: 0.85rem; font-weight: 700; color: var(--on-ink-soft); text-align: right; padding: 0.35rem 0; }
.sb thead th:first-child { text-align: left; }
.sb tbody tr + tr { border-top: 1px solid var(--ink-raised); }
.sb tbody th { text-align: left; font-weight: 700; font-size: 1rem; padding: 0.5rem 0; line-height: 1.2; }
.sb .note { display: block; font-size: 0.78rem; font-weight: 500; color: var(--on-ink-soft); }
.sb td { text-align: right; padding: 0.35rem 0; color: var(--on-ink-soft); font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb td::before { content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin-right: 0.45em; border-radius: 50%; border: 2px solid var(--ink-raised); vertical-align: 0.12em; }
.sb td.w { color: var(--led); text-shadow: 0 0 14px rgba(255, 212, 71, 0.35); }
.sb td.w::before { background: var(--led); border-color: var(--led); box-shadow: 0 0 8px var(--led); }
.sb-foot { margin: 0.5rem 0 0.4rem; font-size: 0.85rem; color: var(--on-ink-soft); }

@media (prefers-reduced-motion: no-preference) {
  .sb tbody tr:nth-child(1) { --d: 0.5s; }
  .sb tbody tr:nth-child(2) { --d: 0.68s; }
  .sb tbody tr:nth-child(3) { --d: 0.86s; }
  .sb tbody tr:nth-child(4) { --d: 1.04s; }
  .sb tbody tr:nth-child(5) { --d: 1.22s; }
  .sb tbody tr:nth-child(6) { --d: 1.4s; }
  .sb tbody tr:nth-child(7) { --d: 1.58s; }
  .sb tbody tr:nth-child(8) { --d: 1.76s; }
  .sb tbody tr:nth-child(9) { --d: 1.94s; }
  .sb tbody tr { animation: sb-row 0.35s ease-out var(--d) both; }
  .sb td.w { animation: sb-lit 0.35s ease-out var(--d) both; }
  @keyframes sb-row { from { opacity: 0.22; } to { opacity: 1; } }
  @keyframes sb-lit { from { color: var(--on-ink-soft); text-shadow: none; } to { color: var(--led); text-shadow: 0 0 14px rgba(255, 212, 71, 0.35); } }
}

/* Sections */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; }
.section-intro { margin-top: 0.9rem; max-width: 36rem; }
.on-court .section-intro { color: var(--on-court-soft); }

.steps { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; gap: 2.75rem; }
.steps li { position: relative; border-top: 3px solid var(--court); padding-top: 1.6rem; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1.3rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border-radius: 50%; background: var(--court); color: var(--white); font-family: var(--font-display); font-weight: 900; font-size: 1.65rem; line-height: 1; padding-top: 0.12rem;
}
.steps { counter-reset: step; }
.steps h3 { font-weight: 800; font-size: 1.3rem; line-height: 1.25; margin-bottom: 0.4rem; }

.prices { margin: 3.25rem 0 0; }
.prices h3 { font-weight: 800; font-size: 1.3rem; margin-bottom: 0.4rem; }
.price-strip { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; border-radius: 16px; overflow: hidden; }
.price-strip li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 1rem 0.5rem; color: var(--ink); }
.price-strip b { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1; }
.price-strip span { font-weight: 700; }
.price-strip .p7 { background: var(--tier-7); }
.price-strip .p5 { background: var(--tier-5); }
.price-strip .p3 { background: var(--tier-3); }
.price-strip .p2 { background: var(--tier-2); }
.price-strip .p1 { background: var(--tier-1); }

.modes { display: grid; gap: 3rem; margin-top: 2.75rem; }
.mode h3 { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; margin: 1.25rem 0 0.5rem; }
.mode > p { color: var(--on-court-soft); max-width: 28rem; }
.mode figure { margin: 0; max-width: 22rem; }
.mode figcaption { font-size: 0.9rem; color: var(--on-court-soft); margin-top: 0.6rem; }
.demo-card { border-radius: 16px; overflow: hidden; background: var(--white); color: var(--ink); }
.demo-card--blind { background: var(--ink); color: var(--white); }
.demo-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 1rem 0.4rem; color: var(--ink); }
.demo-bar b { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; line-height: 1; }
.demo-bar span { font-weight: 700; font-size: 0.9rem; }
.demo-bar--5 { background: var(--tier-5); }
.demo-bar--3 { background: var(--tier-3); }
.demo-body { padding: 1rem 1rem 1.1rem; }
.demo-name { margin: 0; font-weight: 800; font-size: 1.1rem; color: var(--ink-soft); }
.demo-card--blind .demo-name { color: var(--on-ink-soft); }
.demo-meta { margin: 0.1rem 0 0.9rem; font-size: 0.95rem; color: var(--ink-soft); }
.demo-card--blind .demo-meta { color: var(--on-ink-soft); }
.demo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0; }
.demo-stats div { background: var(--wash); border-radius: 10px; padding: 0.4rem 0.7rem 0.5rem; }
.demo-card--blind .demo-stats div { background: var(--ink-raised); }
.demo-stats dt { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); order: 2; }
.demo-card--blind .demo-stats dt { color: var(--on-ink-soft); }
.demo-stats dd { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1.05; }
.demo-stats div { display: flex; flex-direction: column; }
.modes-note { margin-top: 2.5rem; color: var(--on-court-soft); max-width: 36rem; }

.coming .wrap { max-width: 46rem; }
.coming p { margin-top: 1rem; }
.coming .btn-row { margin-top: 1.5rem; }
.fine { font-size: 0.95rem; color: var(--ink-soft); }
.coming .fine { margin-top: 1rem; }

/* Pages with long text */
.page-title { padding-block: 1.25rem 3rem; }
.page-title h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(3rem, 11vw, 5rem); line-height: 0.95; }
.page-title p { margin-top: 1rem; max-width: 36rem; color: var(--on-court-soft); font-size: 1.15rem; }
.prose-wrap { padding-block: 2.5rem 4.5rem; }
.prose { max-width: var(--measure); }
.prose h2 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.05; margin: 2.75rem 0 0.7rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-weight: 800; font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--court-deep); }

mark.ph { background: var(--mark); color: var(--ink); padding: 0.05em 0.35em; border-radius: 5px; font-weight: 700; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.draft {
  max-width: var(--measure); margin: 0 0 2.5rem; padding: 1rem 1.25rem; background: #fff4cc; color: var(--ink);
  border-left: 6px solid var(--ink); border-radius: 4px 12px 12px 4px;
}
.draft strong { display: block; font-weight: 800; font-size: 1.05rem; margin-bottom: 0.25rem; }

.meta-line { color: var(--ink-soft); margin-bottom: 2rem; }

/* FAQ */
.faq { max-width: var(--measure); margin-top: 1.5rem; border-top: 1px solid #cfd8ee; }
.faq details { border-bottom: 1px solid #cfd8ee; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2.25rem 1rem 0; position: relative; font-weight: 800; font-size: 1.1rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.25rem; top: 1.35rem; width: 0.6rem; height: 0.6rem;
  border-right: 3px solid var(--court-deep); border-bottom: 3px solid var(--court-deep); transform: rotate(45deg); transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.55rem; }
.faq .answer { padding: 0 0 1.25rem; max-width: 36rem; }
.faq .answer p { margin-bottom: 0.8em; }

.contact-box { max-width: var(--measure); margin-top: 1.5rem; padding: 1.25rem 1.4rem; background: var(--wash); border-radius: 16px; }
.contact-box p { margin: 0 0 0.4em; }
.after-box { margin-top: 1.25rem; }
.contact-box .big { font-weight: 800; font-size: 1.3rem; overflow-wrap: anywhere; }

/* Data table in the privacy policy */
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.98rem; line-height: 1.5; }
.data-table caption { text-align: left; font-weight: 800; margin-bottom: 0.5rem; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-top: 1px solid #cfd8ee; }
.data-table thead th { border-top: 0; color: var(--ink-soft); font-weight: 700; }
.data-table tbody th { font-weight: 800; width: 24%; }

/* 404 and challenge placeholder */
.centered { min-height: 50vh; display: flex; align-items: center; }
.centered h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(3rem, 11vw, 5rem); line-height: 0.95; }
.centered p { margin-top: 1rem; max-width: 32rem; font-size: 1.15rem; color: var(--on-court-soft); }
.centered .btn-row { margin-top: 1.75rem; }

/* Footer */
.site-footer { padding-block: 2.5rem 3rem; font-size: 0.98rem; }
.footer-grid { display: grid; gap: 1.75rem; }
.site-footer .wordmark { font-size: 1.6rem; }
.site-footer .disclaimer { margin-top: 0.9rem; max-width: 30rem; color: var(--on-ink-soft); }
.site-footer .legal { margin-top: 0.6rem; color: var(--on-ink-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.site-footer li a { display: inline-block; padding-block: 0.3rem; }

@media (min-width: 40rem) {
  :root { --gutter: 28px; }
  .price-strip { grid-template-columns: repeat(5, 1fr); }
  .price-strip li { flex-direction: column; justify-content: flex-start; gap: 0.1rem; padding: 0.9rem 0.9rem 1rem; }
  .price-strip b { font-size: 2.6rem; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
}

@media (max-width: 39.99rem) {
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; width: auto; }
  .data-table tr { border-top: 1px solid #cfd8ee; padding: 0.7rem 0; }
  .data-table th, .data-table td { border: 0; padding: 0.1rem 0; }
  .data-table tbody th { width: auto; }
  .data-table td::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink-soft); }
}

@media (min-width: 56rem) {
  .hero { padding-block: 2rem 5rem; }
  .hero .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 3rem; }
  .hero .sb { justify-self: end; }
  .sb-num { font-size: 5.5rem; }
  .sb-lineup { margin-top: 0.8rem; padding-top: 0.75rem; }
  .sb tbody th { padding-block: 0.3rem; }
  .sb td { padding-block: 0.14rem; font-size: 1.45rem; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .modes { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
