/* Support the Dev. The website's palette and pieces (landing.css / mods.css) over the engine room's
   firebox (embers.js) — inspired by the death screen's engine room page, not a copy of it. */

:root {
  --bg: #151816;
  --panel: rgba(29, 33, 30, 0.9);
  --panel-2: #252a26;
  --line: #3a413b;
  --ink: #e4e8e1;
  --muted: #99a397;
  --accent: #8cc45e;
  --on-accent: #0f1a0b;
  --gold: #e0a23a;      /* Patreon */
  --cost: #e07b39;      /* costs, as the death screen tints them */
  --met: #7b93d8;       /* a settled goal turns blue, as in-game */
  --stripe: #8b8cf0;
  --revolut: #6fb6e0;
  --other: #99a397;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--accent); }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.hero, main, .foot { position: relative; z-index: 1; }

/* ---- Backdrop (embers.js): the firebox canvas, behind everything ---- */
.embers { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---- Hero ---- */
.hero { padding: 72px 16px 36px; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.6); }
.kicker { margin: 0 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
h1 { margin: 0 0 14px; font-size: 52px; font-weight: 700; line-height: 1.05; }
.lede {
  max-width: 64ch; margin: 0 0 24px; padding: 14px 18px; color: #dfe5dc; font-size: 19px;
  /* Its own dark glass, so the plea stays readable over the brightest part of the glow. */
  background: rgba(15, 18, 16, 0.68); border: 1px solid rgba(58, 65, 59, 0.7); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.lede .num { color: var(--accent); font-weight: 700; }
/* The plea, with this month's update count beside it. */
.hero-row { display: flex; align-items: center; gap: 20px; margin: 0 0 24px; }
.hero-row .lede { margin: 0; }
.hero-stat {
  flex: none; display: flex; flex-direction: column; align-items: center; margin: 0; padding: 16px 22px;
  background: rgba(15, 18, 16, 0.68); border: 1px solid rgba(58, 65, 59, 0.7); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-align: center;
}
.hero-stat .value { color: var(--accent); font-size: 48px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stat .label { margin-top: 6px; color: #dfe5dc; font-size: 14px; }
.cta { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 18px; border-radius: 8px; border: 1px solid var(--line); text-shadow: none;
  background: rgba(21, 24, 22, 0.75); color: var(--ink); font: inherit; text-decoration: none;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); outline: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn small { color: var(--muted); font-size: 13px; }

/* ---- Panels ---- */
main { display: flex; flex-direction: column; gap: 16px; padding-bottom: 24px; }
.status { margin: 0; color: var(--muted); font-size: 14px; text-shadow: 0 1px 8px #000; }
.status:empty { display: none; }
.panel {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
h2 { margin: 0 0 12px; font-size: 22px; }
h3 { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.aside { margin: 0; color: var(--muted); font-size: 14px; }

/* Goals: the support ladder, one progress bar per rung. */
.goals { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.goal-name { font-weight: 600; }
.goal-name .state { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.goal-fig { color: var(--muted); font-size: 15px; white-space: nowrap; }
.goal-fig b { color: var(--ink); }
.track { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: inherit; background: var(--cost); transition: width 0.8s ease-out; }
.goal.active .goal-name::before { content: "▸ "; color: var(--cost); }
.goal.met .track > span { background: var(--met); }
.goal.met .goal-name { color: var(--met); }
.goal.upcoming { opacity: 0.6; }

/* All time: every cost to date against everything raised. */
.life-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.life-fig .value { display: block; font-size: 32px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.life-fig .value.cost { color: var(--cost); }
.life-fig .value.gap { color: var(--gold); }
.life-fig .label { color: var(--muted); font-size: 14px; }
.track.big { height: 14px; margin-bottom: 8px; }
.track.big > span { background: var(--accent); }
#life-covered { margin-bottom: 14px; }

/* Money: costs on one side, this month's takings by source on the other. */
.money { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ledger { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.ledger dt { color: var(--muted); }
.ledger dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ledger .total { padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.ledger .cost { color: var(--cost); }
.ledger .unpriced { color: var(--ink); }
.ledger dt .dot { margin-right: 6px; }
.bar { display: flex; height: 10px; margin: 2px 0 10px; border-radius: 999px; overflow: hidden; background: var(--panel-2); }
.bar > span { height: 100%; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 1px; }
.dot.stripe, .bar .stripe { background: var(--stripe); }
.dot.patreon, .bar .patreon { background: var(--gold); }
.dot.revolut, .bar .revolut { background: var(--revolut); }
.dot.other, .bar .other { background: var(--other); }

/* Stats: every figure the death screen's cards can show, at once. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(37, 42, 38, 0.6); }
.stat .value { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .label { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.stat .note { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* Boards */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.tab:hover { border-color: var(--accent); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.board { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; counter-reset: rank; }
.board li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(58, 65, 59, 0.6); break-inside: avoid; counter-increment: rank; }
.board li::before { content: counter(rank); width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.board .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .amt { font-variant-numeric: tabular-nums; }
.board li.patreon .who, .board li.patreon .amt { color: var(--gold); }
.board .empty { grid-column: 1 / -1; color: var(--muted); border: 0; }
.board .empty::before { content: none; }
.legend .dot { margin-right: 4px; }

/* Contribute */
.contribute .sub { margin: -4px 0 16px; color: var(--muted); }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tier {
  display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tier:hover, .tier:focus-visible {
  filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); outline: none;
}
.tier.featured { border-color: #fff; }
.tier .amount { color: var(--on-accent); font-size: 30px; font-weight: 800; line-height: 1.1; }
.tier .name { font-weight: 700; }
.tier .what { margin-top: 4px; color: #2c4a1a; font-size: 14px; }

/* The same three price points again, closing the developer section: one line each. */
.tiers.compact { margin-top: 18px; }
.tiers.compact .tier { flex-direction: row; align-items: baseline; justify-content: center; gap: 10px; padding: 12px 14px; }
.tiers.compact .amount { font-size: 22px; }

/* Custom Amount and Recurring: solid too, in the colours the money breakdowns give their sources. */
.modes .btn { border: 0; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.modes .btn:hover, .modes .btn:focus-visible { filter: brightness(1.08); }
.modes .btn small { font-weight: 400; }
#link-payment { background: var(--revolut); color: #0b1a24; }
#link-payment small { color: #1f3e52; }
#link-patreon { background: var(--gold); color: #261a05; }
#link-patreon small { color: #4f3810; }
.modes { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }

/* Who you're supporting — the same note the update page's roadmap opens with. */
.dev-note { padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: #c9d0c6; max-width: 72ch; }
.dev-note p { margin: 0; }
.dev-note p + p { margin-top: 10px; }
.dev-note strong { color: var(--ink); }
.dev-note .sig { color: var(--muted); }

.foot { padding: 8px 16px 28px; font-size: 14px; }
.foot a { color: var(--muted); text-shadow: 0 1px 8px #000; }
.foot a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .hero { padding-top: 48px; }
  h1 { font-size: 38px; }
  .lede { font-size: 17px; }
  .hero-row { flex-direction: column; align-items: stretch; }
  .hero-stat { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; padding: 10px 16px; }
  .hero-stat .value { font-size: 32px; }
  .hero-stat .label { margin-top: 0; }
  .money { grid-template-columns: 1fr; }
  .life-figs { grid-template-columns: 1fr; }
  .life-fig .value { font-size: 26px; }
  .tiers { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track > span, .tier { transition: none; }
}
