/* Mile Pie tokens, as in the app's src/theme.ts. The site is dark only, like the app. */
:root {
  /* Website look (stage 2, 11 Nov): Mile Pie's site. html.look-classic (?look=classic) brings back the classic one. */
  --sky: #0d0f14;
  --accent: #f2633c;
  --on-accent: #0d0f14;
  --accent-glow: rgba(242, 99, 60, 0.6);
  --gold: #e5ab0b;
  --white: #fff;
  --muted: rgba(255, 255, 255, 0.75);
  --faint: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.12);
  --surface: #141821;
  --surface-strong: #141821;
  --seg-on: var(--accent);
  --seg-on-text: var(--on-accent);
  --rank-1: #e5ab0b;
  --rank-2: #c9cdd6;
  --rank-3: #c98a4b;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-btn: 4px;
  --f-display: "Barlow Condensed", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --f-sans: "IBM Plex Sans Condensed", system-ui, sans-serif;
  --btn-case: uppercase;
  --btn-track: 1.2px;
  --btn-size: 15px;
  /* Negative tracking only for the system font (1); the condensed fonts are already tight (0). */
  --tight: 0;
  color-scheme: dark;
}
html.look-classic {
  --sky: #05060b;
  --accent: #e5ab0b;
  --on-accent: #000;
  --accent-glow: var(--accent-glow);
  --line: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: #12141c;
  --seg-on: rgba(255, 255, 255, 0.32);
  --seg-on-text: var(--white);
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-btn: 999px;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: var(--f-display);
  --f-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --btn-case: none;
  --btn-track: 0;
  --btn-size: 17px;
  --tight: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sky);
  color: var(--white);
  font: 400 17px/1.4 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
html.embedded body { min-height: 0; border-radius: var(--r-lg); }
a { color: inherit; }
#sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#sky i { position: absolute; border-radius: 50%; background: var(--white); }
#sky i.gold { background: var(--gold); }

.wrap { position: relative; max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; text-align: center; }
.top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 44px; }
.example { margin: 12px auto 0; display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-family: var(--f-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.4px; }


/* Pre-launch, as the app's PrelaunchScreen. */
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 3px; font-family: var(--f-mono); font-weight: 600; font-size: 13px; margin: 28px 0 4px; }
.date { font-size: clamp(40px, 11vw, 56px); line-height: 1.05; letter-spacing: calc(var(--tight) * -1.5px); font-family: var(--f-display); font-weight: 800; margin: 0 0 20px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 480px; margin: 0 auto 20px; }
.tile { background: var(--surface-strong); border-radius: var(--r-md); padding: 18px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tile-n { color: var(--accent); font-size: 44px; line-height: 50px; font-family: var(--f-display); font-weight: 700; letter-spacing: calc(var(--tight) * -0.8px); }
.tile-w { color: var(--muted); font-size: 15px; }

/* The Journey: the track with the app's rocket, then four numbers. */
.made-it { color: var(--accent); font-size: clamp(28px, 8vw, 40px); font-family: var(--f-display); font-weight: 800; margin: 20px 0 0; }
.track { display: flex; align-items: center; max-width: 560px; margin: 32px auto 0; }
.earth { flex: none; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 16px rgba(111, 180, 245, 0.45), 0 0 3px rgba(160, 210, 255, 0.6); }
.moon { flex: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 16px rgba(240, 235, 218, 0.3); }
.rail { position: relative; flex: 1; height: 2px; margin: 0 34px 0 14px; background: rgba(255, 255, 255, 0.2); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
/* The rocket's nose points at the Moon; its middle sits on the share travelled. */
.rocket-at { position: absolute; top: 50%; width: 0; height: 0; }
.rocket { position: absolute; left: 0; top: 0; width: 46px; height: auto; transform: translate(-50%, -50%) rotate(90deg); filter: drop-shadow(0 0 2px rgba(255, 240, 200, 0.45)); overflow: visible; }

.track-labels { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 8px; max-width: 560px; margin: 10px auto 0; text-align: left; }
.track-labels .right { text-align: right; }
.track-labels .num { display: block; font-size: clamp(22px, 6.4vw, 30px); line-height: 1.15; font-family: var(--f-display); font-weight: 700; letter-spacing: calc(var(--tight) * -0.5px); }
.track-labels .cap { display: block; color: var(--muted); font-size: 16px; }

.raised { margin: 32px 0 0; }
.money { color: var(--accent); font-size: clamp(48px, 14vw, 72px); line-height: 1.05; font-family: var(--f-display); font-weight: 800; letter-spacing: calc(var(--tight) * -1.5px); margin: 0; }
.raised-for { font-size: 19px; margin: 6px auto 0; max-width: 30ch; }
.thanks { color: var(--muted); font-size: 17px; margin: 6px auto; max-width: 34ch; }

/* Boards, as the app's BoardsScreen. */
.boards { text-align: left; margin-top: 32px; }
.boards-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.boards-head .seg { margin: 0; width: 270px; max-width: 100%; }
.section-title { font-size: 26px; line-height: 32px; font-family: var(--f-display); font-weight: 700; margin: 0; }
.seg { display: flex; gap: 2px; padding: 2px; border-radius: calc(var(--r-sm) + 2px); background: var(--surface-strong); margin-bottom: 12px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--white); font: inherit; font-size: 15px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-text); font-weight: 600; }
.seg button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.podium { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; padding: 0; margin: 20px 0 8px; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.p-name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.p-val { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.p-val small, .val small { font-size: 1em; font-weight: inherit; }
.block { width: 100%; background: var(--surface-strong); border-radius: var(--r-sm) var(--r-sm) 0 0; border-top: 4px solid var(--rank-1); display: flex; justify-content: center; padding-top: 10px; }
.p-rank { font-size: 32px; font-family: var(--f-display); font-weight: 800; color: var(--rank-1); }
.step-1 .block { height: 96px; }
.step-2 .block { height: 72px; border-top-color: var(--rank-2); }
.step-2 .p-rank { color: var(--rank-2); }
.step-3 .block { height: 56px; border-top-color: var(--rank-3); }
.step-3 .p-rank { color: var(--rank-3); }
/* One entry: put it in the middle; two: second on the left, first in the middle. */
.podium:has(> li:only-child) .place-0 { grid-column: 2; }

.list { list-style: none; padding: 0; margin: 0; background: var(--surface-strong); border-radius: var(--r-md); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; }
.list li + li { border-top: 1px solid var(--line); }
.rank { width: 2.2em; color: var(--muted); font-weight: 600; flex: none; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { overflow-wrap: anywhere; }
.sub { color: var(--faint); font-size: 13px; }
.val { font-weight: 600; flex: none; }
.empty { background: var(--surface-strong); border-radius: var(--r-md); padding: 28px 16px; text-align: center; }
.empty-title { font-weight: 600; margin: 0 0 4px; }
.empty-body { color: var(--muted); margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; max-width: 560px; margin: 28px auto 0; }
.actions .btn { flex: 1 1 200px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: var(--r-btn); font-family: var(--f-mono); font-weight: 600; font-size: var(--btn-size); text-transform: var(--btn-case); letter-spacing: var(--btn-track); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--surface-strong); border: 1px solid var(--line); color: var(--white); }
.btn:active { opacity: 0.75; }
.foot { margin-top: 20px; color: var(--muted); font-size: 13px; }
.foot p { margin: 4px 0; }
.foot .faint { color: var(--faint); }
.loading { margin-top: 40px; }

@media (prefers-reduced-motion: no-preference) {
  .flame { transform-box: fill-box; transform-origin: 50% 0; animation: flicker 0.9s ease-in-out infinite alternate; }
  @keyframes flicker { from { transform: scaleY(0.88); } to { transform: scaleY(1.08); } }
}
