/* mylastgta.com — sunset over Vice City, dark only. Palette mirrors src/palette.js. */
@font-face { font-family: "Lilita One"; src: url("/fonts/lilita-one-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/space-grotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --night: #14092a;
  --violet: #2b1458;
  --purple-deep: #3a1a6e;
  --purple: #7b3fbf;
  --magenta: #d0248a;
  --pink: #ff5d8f;
  --coral: #ff7b5c;
  --orange: #ff9b3d;
  --yellow: #ffd05a;
  --cyan: #38c6ff;

  --bg: var(--night);
  --panel: #1f1040;
  --panel-2: #29164f;
  --line: #3d2670;
  --text: #f6efff;
  --muted: #b9a8dc;
  --sunset: linear-gradient(180deg, var(--yellow) 10%, var(--orange) 45%, var(--pink) 85%);
  --sunset-x: linear-gradient(90deg, var(--yellow), var(--orange) 35%, var(--pink) 70%, var(--magenta));

  --font-display: "Lilita One", "Arial Rounded MT Bold", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: var(--pink); }
::selection { background: var(--pink); color: var(--night); }

/* ---------- Sky + sun hero backdrop ---------- */
.sky {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, var(--night) 0%, var(--violet) 45%, var(--purple) 82%, var(--magenta) 100%);
  overflow: hidden;
  border-bottom: 3px solid var(--night);
}
.sky::after { /* horizon band */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; z-index: -1;
  background: linear-gradient(180deg, var(--purple-deep), var(--night));
}
.sun {
  position: absolute; z-index: -2;
  width: min(520px, 92vw); aspect-ratio: 1; border-radius: 50%;
  right: max(-80px, calc(50% - 600px)); bottom: -38%;
  background: linear-gradient(180deg, var(--yellow) 0%, var(--orange) 35%, var(--coral) 60%, var(--magenta) 100%);
  -webkit-mask: linear-gradient(180deg, #000 52%, transparent 52% 54.5%, #000 54.5% 62%, transparent 62% 65%, #000 65% 71%, transparent 71% 75%, #000 75% 80%, transparent 80% 85%, #000 85%);
          mask: linear-gradient(180deg, #000 52%, transparent 52% 54.5%, #000 54.5% 62%, transparent 62% 65%, #000 65% 71%, transparent 71% 75%, #000 75% 80%, transparent 80% 85%, #000 85%);
  opacity: .92;
}
.palms { position: absolute; z-index: -1; right: max(-30px, calc(50% - 560px)); bottom: 0; height: 88%; max-height: 380px; width: auto; fill: var(--night); pointer-events: none; }
@media (max-width: 720px) {
  .sun { width: 340px; right: -110px; bottom: auto; top: 18px; opacity: .55; }
  .palms { height: 62%; right: -60px; opacity: .8; }
}

.wrap { max-width: 880px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-block: 18px;
  font: 500 12px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.wordmark { font: 400 22px/1 var(--font-display); letter-spacing: .01em; text-transform: none; color: var(--text); text-decoration: none; }
.wordmark b { font-weight: 400; color: var(--yellow); }
.wordmark:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(28px, 7vw, 72px) clamp(48px, 9vw, 96px); }
.kicker {
  display: inline-block; font: 600 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase;
  background: var(--yellow); color: var(--night); padding: 8px 12px; border-radius: 999px; margin: 0 0 18px;
}
.kicker.pink { background: var(--pink); }
.display {
  font: 400 clamp(46px, 10.5vw, 96px)/.92 var(--font-display);
  margin: 0; letter-spacing: .005em; color: #fff; text-wrap: balance;
  -webkit-text-stroke: .06em var(--night); paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--night);
  max-width: 13ch;
}
/* Gradient word: the element itself draws the dark outline + drop shadow,
   ::after lays the clean sunset gradient on top. */
.glow {
  position: relative; display: inline-block; white-space: nowrap;
  color: var(--night); -webkit-text-stroke: .12em var(--night); paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--night);
}
.glow::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute; inset: 0;
  background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0; text-shadow: none;
}
.lede { max-width: 46ch; margin: 18px 0 0; font-size: clamp(17px, 2.4vw, 20px); color: #ecdfff; text-shadow: 0 1px 0 var(--night); }
.lede i { color: #fff; }

/* ---------- Year form ---------- */
.yearform {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch;
  background: rgba(20, 9, 42, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--night); border-radius: 18px; padding: 14px; width: fit-content; max-width: 100%;
  box-shadow: 0 6px 0 var(--night);
}
.yearform label { flex-basis: 100%; margin-bottom: -4px; font: 600 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.yearform input {
  font: 600 30px/1 var(--font-mono); color: var(--text); background: var(--night);
  border: 2px solid var(--line); border-radius: 10px; padding: 0 14px; height: 58px; width: 150px;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.yearform input::placeholder { color: #5b4690; }
.yearform input:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 208, 90, .25); }
.yearform .msg { flex-basis: 100%; margin: 0; min-height: 0; font: 500 14px/1.4 var(--font-body); color: var(--yellow); }
.yearform .msg:empty { display: none; }
.yearform.big {
  margin-top: 34px; padding: 20px; gap: 14px;
  border: 2px solid rgba(255, 208, 90, .6);
  box-shadow: 0 6px 0 var(--night), 0 22px 60px -12px rgba(255, 93, 143, .6);
}
.yearform.big label { font-size: 13px; color: var(--yellow); }
.yearform.big input { height: 76px; width: 196px; font-size: 44px; padding: 0 16px; border-color: #5a3d9a; }
.yearform.big .btn { height: 76px; font-size: 30px; padding: 0 30px; }
.yearform.compact { margin-top: 0; background: var(--panel); }
.yearform.compact input { height: 50px; font-size: 24px; width: 120px; }
.yearform.compact .btn { height: 50px; font-size: 20px; }

.btn {
  font: 400 24px/1 var(--font-display); letter-spacing: .02em; cursor: pointer;
  color: var(--night); background: var(--yellow); border: 2px solid var(--night); border-radius: 10px;
  padding: 0 22px; height: 58px;
  box-shadow: 0 4px 0 var(--night); transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: #ffdd80; color: var(--night); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--night); }
.btn:focus-visible, .ghost:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.ghost {
  font: 600 14px/1 var(--font-mono); letter-spacing: .04em; cursor: pointer;
  color: var(--text); background: transparent; border: 2px solid var(--line); border-radius: 10px; padding: 0 16px; height: 44px;
}
.ghost:hover { border-color: var(--yellow); color: var(--yellow); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- Main content ---------- */
main { padding-block: 40px 24px; display: grid; gap: 28px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3.5vw, 28px); }
.card h2, .section-title {
  font: 400 26px/1.1 var(--font-display); margin: 0 0 14px; letter-spacing: .01em;
}

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 4px solid var(--c, var(--yellow)); }
.fact b { display: block; font: 400 38px/1 var(--font-display); color: var(--c, var(--yellow)); font-variant-numeric: tabular-nums; }
.fact span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* ---------- Result hero ---------- */
.result-hero .display { max-width: none; }
.verdict-label { font: 400 clamp(30px, 6vw, 52px)/1 var(--font-display); margin: 0 0 6px; color: #fff; -webkit-text-stroke: .06em var(--night); paint-order: stroke fill; text-shadow: 0 .07em 0 var(--night); }
.game { display: flex; align-items: flex-end; gap: .22em; font: 400 clamp(84px, 21vw, 190px)/.85 var(--font-display); margin: 0; }
.game .gta { font-size: .52em; color: #fff; -webkit-text-stroke: .1em var(--night); paint-order: stroke fill; text-shadow: 0 .12em 0 var(--night); margin-bottom: .1em; }
.verdict { margin: 22px 0 0; max-width: 46ch; font-size: clamp(17px, 2.4vw, 21px); color: #fff; text-shadow: 0 1px 0 var(--night); }
.verdict strong { color: var(--yellow); font-weight: 700; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.badges .kicker { margin: 0; }

.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

/* ---------- Odds table ---------- */
.scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font: 400 15px/1.35 var(--font-mono); font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
td.title { font: 400 22px/1 var(--font-display); white-space: nowrap; }
tr.is-last td.title { color: var(--yellow); }
tr.is-past td { color: var(--muted); }
.prob { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.bar { width: 76px; height: 10px; background: var(--night); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; background: var(--sunset-x); border-radius: 6px; }
.pill { display: inline-block; vertical-align: middle; font: 600 10px/1 var(--font-mono); padding: 4px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; margin-left: 8px; }
.pill.likely { background: var(--yellow); color: var(--night); }
.pill.long { border: 1px solid var(--pink); color: var(--pink); }
.pill.out { border: 1px solid var(--muted); color: var(--muted); }
@media (max-width: 560px) {
  table { font-size: 13px; }
  td.title { font-size: 19px; }
  .pill { display: block; width: fit-content; margin: 6px 0 0; }
  .bar { width: 44px; }
  .col-age { display: none; }
}

/* ---------- Share (lives in the result hero) ---------- */
.share-panel {
  margin-top: 28px; max-width: 560px; padding: 20px;
  background: rgba(20, 9, 42, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 208, 90, .6); border-radius: 18px;
  box-shadow: 0 6px 0 var(--night), 0 22px 60px -12px rgba(255, 93, 143, .6);
}
.share-panel h2 { margin: 0 0 10px; font: 600 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); }
.share-line { margin: 0 0 16px; font: 700 clamp(18px, 2.6vw, 21px)/1.35 var(--font-body); color: #fff; }
.share-line .url { display: block; margin-top: 6px; font: 400 14px/1.3 var(--font-mono); color: var(--muted); word-break: break-all; }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.share-actions .btn { height: 54px; font-size: 22px; align-self: auto; }
.share-actions .ghost { height: 54px; }
.status { font: 500 13px/1.3 var(--font-mono); color: var(--cyan); margin: 10px 0 0; }
.status:empty { display: none; }

.aside-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 720px) { .aside-row { grid-template-columns: 1fr; } }
.hl3 { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; border-color: var(--coral); background: linear-gradient(160deg, var(--panel) 40%, #3a1640); }
.hl3 p { margin: 0; color: var(--muted); }
.hl3 a { font: 400 22px/1.1 var(--font-display); text-decoration: none; }

/* ---------- The paper ---------- */
details.paper { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
details.paper > summary {
  list-style: none; cursor: pointer; padding: 18px clamp(18px, 3.5vw, 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 400 24px/1.1 var(--font-display);
}
details.paper > summary::-webkit-details-marker { display: none; }
details.paper > summary small { display: block; margin-top: 4px; font: 400 13px/1.3 var(--font-mono); color: var(--muted); }
details.paper > summary::after {
  content: "+"; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--night); font: 400 26px/1 var(--font-display); transition: transform .2s ease;
}
details.paper[open] > summary::after { transform: rotate(45deg); }
details.paper[open] > summary { border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { details.paper > summary::after { transition: none; } }

.paper-body { padding: 8px clamp(18px, 3.5vw, 28px) 28px; display: grid; gap: 30px; font-size: 16px; }
.paper-head { padding-top: 16px; font: 400 13px/1.5 var(--font-mono); color: var(--muted); }
.paper-head strong { display: block; font: 400 24px/1.15 var(--font-display); color: var(--text); margin-bottom: 4px; }
.paper section { display: grid; gap: 6px; }
.paper h3 { font: 600 12px/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.paper h3 span { color: var(--pink); margin-right: 6px; }
.paper p { margin: 0 0 10px; max-width: 68ch; }
.abstract { border-left: 3px solid var(--pink); padding-left: 16px; font-style: italic; color: #e2d4fb; }
.eq {
  font: 400 15px/1.7 var(--font-mono); background: var(--night); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: nowrap; margin: 4px 0 12px;
}
.eq small { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 12px; }
.stat { border-top: 2px solid var(--yellow); padding-top: 8px; }
.stat b { display: block; font: 600 24px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.stat span { font: 400 12px/1.35 var(--font-mono); color: var(--muted); }
figure { margin: 6px 0 12px; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-mono); }
ol.lim { margin: 0; padding-left: 22px; max-width: 68ch; }
ol.lim li { margin-bottom: 8px; }
.paper table td.title { font: inherit; }

/* ---------- Footer ---------- */
footer { padding-block: 28px 48px; font: 400 12px/1.6 var(--font-mono); color: var(--muted); display: grid; gap: 8px; }
footer p { margin: 0; max-width: 80ch; }

/* ---------- Joke pages ---------- */
.joke .display { max-width: 15ch; }
.joke .actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.joke .actions .btn { align-self: auto; }
[hidden] { display: none !important; }
@media (max-width: 420px) {
  .yearform input { width: 118px; font-size: 26px; padding: 0 12px; }
  .yearform .btn { padding: 0 16px; font-size: 22px; }
  .yearform.big { padding: 16px; gap: 12px; }
  .yearform.big { width: 100%; }
  .yearform.big input { flex: 1 1 0; min-width: 0; width: auto; height: 66px; font-size: 34px; }
  .yearform.big .btn { height: 66px; font-size: 25px; padding: 0 18px; }
  .share-panel { padding: 16px; }
}
