/* Theme: Full Screen. Two photos fill the phone edge to edge, text sits on the photo, controls float at the bottom.
   System fonts only: nothing to download before the first paint. */
:root {
  color-scheme: dark;
  --storm: #000;
  --panel: #131316;
  --panel-edge: #2c2c33;
  --ink: #fff;
  --muted: #b3b3bd;
  --lava: #d7ff3e;           /* the accent */
  --ice: #9fe8ff;
  --good: #5dff9b;
  --bad: #ff5d6c;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dock: 40px;              /* height the bottom strip takes over the lower photo; grows on the game-over screen */
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--storm);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lava); outline-offset: 2px; }

.shell { display: flex; justify-content: center; height: 100%; height: 100dvh; }
.app { position: relative; flex: 0 1 480px; width: 100%; max-width: 480px; height: 100%; height: 100dvh; margin: 0 auto; overflow: hidden; background: #000; }

/* Laptop and desktop: the game keeps its phone width in the middle; the space either side is kept for ads.
   Rails appear from 900px wide (160px skyscraper slots) and widen to 300px slots from 1180px.
   The slots are empty until AdSense approves the site and ad units are made. */
.ad-rail { display: none; }
@media (min-width: 900px) {
  body.game { background: #09090b; }
  .shell { width: 100%; }
  .app { flex: 0 0 480px; box-shadow: 0 0 0 1px var(--panel-edge), 0 0 60px rgba(0,0,0,0.6); }
  .ad-rail { display: flex; flex: 1 1 0; min-width: 160px; justify-content: center; align-items: flex-start; padding: 24px 16px; box-sizing: border-box; overflow: hidden; }
  .ad-slot { position: sticky; top: 24px; width: 160px; min-height: 600px; }
}
@media (min-width: 1180px) { .ad-slot { width: 300px; } }

.arena { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; }
.app.is-over { --dock: 168px; }
.card { position: relative; overflow: hidden; min-height: 0; background: linear-gradient(135deg, #1c3040, #0a1118); }
#cardB { background: linear-gradient(135deg, #33204a, #0c0a16); }
.card .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.28) 55%, rgba(0,0,0,0.42)); }
#cardB::after { background: linear-gradient(to top, rgba(0,0,0,0.9) 0, rgba(0,0,0,0.62) var(--dock), rgba(0,0,0,0.3) 75%, rgba(0,0,0,0.38)); }
.card .txt { position: absolute; left: 16px; right: 68px; bottom: 30px; z-index: 1; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 8px rgba(0,0,0,0.85); }
#cardB .txt { bottom: calc(var(--dock) + 10px); }
.card .label { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; opacity: 0.88; }
.card .name { font-weight: 800; font-size: clamp(24px, 7.2vw, 32px); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
.card .note { font-size: 13px; opacity: 0.85; }
.card .value { font-weight: 800; font-size: clamp(34px, 10.5vw, 44px); line-height: 1; letter-spacing: -0.02em; color: var(--lava); font-variant-numeric: tabular-nums; margin-top: 2px; }
.card .value .unit { font-size: 0.4em; font-weight: 600; margin-left: 6px; color: #fff; opacity: 0.9; letter-spacing: 0; }
.card.right .value { color: var(--good); }
.card.wrong .value { color: var(--bad); }
.app.is-live .card { cursor: pointer; }
.app.is-live .card:active .pic { transform: scale(1.03); }
.card .pic { transition: transform 0.15s; }
.card.picked::before { content: ""; position: absolute; inset: 0; z-index: 2; border: 4px solid var(--lava); pointer-events: none; }
.card.picked.right::before { border-color: var(--good); }
.card.picked.wrong::before { border-color: var(--bad); }
.card:focus-visible { outline-offset: -4px; }
.card .info[hidden] { display: none; }
.card .info { position: absolute; right: 12px; bottom: 30px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff;
  font: italic 700 21px Georgia, "Times New Roman", serif; display: grid; place-items: center; padding: 0; }
#cardB .info { bottom: calc(var(--dock) + 10px); }

.vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; padding: 10px 18px; border-radius: 999px;
  background: var(--lava); color: #000; font-weight: 800; font-size: 16px; white-space: nowrap; max-width: calc(100% - 24px); box-shadow: 0 4px 18px rgba(0,0,0,0.5); pointer-events: none; transition: background 0.2s; }
.vs.right { background: var(--good); }
.vs.wrong { background: var(--bad); }

.top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 0; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
/* Wordmark: Pacifico (SIL Open Font License, src/fonts/OFL.txt), self-hosted, only used for the site name. */
@font-face { font-family: "Pacifico"; src: url("/fonts/pacifico-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
.brand { font-family: "Pacifico", "Brush Script MT", cursive; font-weight: 400; font-size: 22px; line-height: 1.2; letter-spacing: 0; margin: 0; color: var(--lava); }
.brand a { text-decoration: none; color: var(--lava); }
.scores { display: flex; gap: 14px; font-size: 14px; font-weight: 600; }
.score small { font-size: 12px; opacity: 0.85; font-weight: 600; }
.score b { color: var(--lava); font-weight: 800; font-variant-numeric: tabular-nums; }

.modebar { position: absolute; top: calc(max(14px, env(safe-area-inset-top)) + 44px); left: 16px; right: 16px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12px; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,0.85); min-height: 26px; }
.modebar a { color: var(--lava); }
.modebar .mode { padding: 5px 10px; border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; background: rgba(0,0,0,0.3); color: #fff; font-size: 12px; font-weight: 700; }
.modebar .mode[aria-pressed="true"] { background: #fff; border-color: #fff; color: #000; }
.modebar .who { margin-left: auto; font-variant-numeric: tabular-nums; }

.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 12px max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.prompt:empty { display: none; }
.prompt { font-size: 15px; font-weight: 600; line-height: 1.25; margin: 0 4px; text-shadow: 0 1px 6px #000; text-wrap: balance; }
.prompt b { font-weight: 800; }
.price { font-size: 13px; font-weight: 700; color: var(--lava); margin: -4px 4px 0; min-height: 0; text-shadow: 0 1px 5px #000; }
.price:empty { display: none; }
.more { font-size: 13px; margin: -4px 4px 0; text-shadow: 0 1px 5px #000; }
.more a { color: var(--lava); }
.controls, .over { gap: 10px; }
.controls { display: flex; }
.controls.hide { display: none; }
.over { display: none; }
.over.show { display: flex; }
.big { flex: 1; min-width: 0; padding: 15px 8px; border: 0; border-radius: 14px; font-weight: 800; font-size: 17px; color: #000; transition: transform 0.08s, opacity 0.2s; }
.big:active { transform: scale(0.97); }
.controls .big { text-transform: capitalize; }
.big.higher, .big.again { background: var(--lava); }
.big.lower, .big.share { background: rgba(255,255,255,0.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.big[disabled] { opacity: 0.4; cursor: default; }
.big .arrow { display: inline-block; margin-right: 7px; font-size: 0.8em; }
.foot { text-align: center; font-size: 10.5px; font-weight: 400; color: rgba(255,255,255,0.7); margin: 0; }

@media (max-height: 640px) {
  .app.is-over { --dock: 150px; }
  .card .name { font-size: 22px; } .card .value { font-size: 30px; } .big { padding: 12px 8px; }
  .card .note { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (prefers-reduced-transparency: reduce) { .big.lower, .big.share, .card .info { background: #3a3a40; -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* Plain pages: sources, admin */
.page { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
.page h1 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; font-size: 32px; line-height: 1; margin: 0 0 12px; }
.page h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; font-size: 22px; margin: 24px 0 8px; }
.page p, .page li { color: var(--muted); }
.page a { color: var(--ice); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--panel-edge); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.tile { background: var(--panel); border: 1.5px solid var(--panel-edge); border-radius: 12px; padding: 10px 14px; min-width: 130px; }
.tile b { display: block; font-family: var(--display); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row input, .row select, .row button {
  background: var(--panel); color: var(--ink); border: 1.5px solid var(--panel-edge); border-radius: 10px; padding: 9px 12px; font: inherit;
}
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--panel-edge); color: var(--muted); }
.tag.crowd { border-color: var(--good); color: var(--good); }

/* Content pages: one per fact, one ranking per category, sources */
body.doc { height: auto; font-size: 17px; line-height: 1.55; }
.doc-top, .doc-main, .doc-foot { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.doc-top { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.doc-top .cats { margin: 0 -16px; }
.doc-main { padding-top: 14px; padding-bottom: 32px; }
.doc-foot { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--panel-edge); font-size: 14px; color: var(--muted); }
.doc a { color: var(--ice); text-underline-offset: 2px; }
.doc .cat { color: inherit; }
.doc .brand a { color: var(--lava); }
.doc .brand { font-size: 26px; }
.doc .cat { color: var(--muted); }
.doc .cat[aria-current="true"] { border-color: var(--ink); color: var(--ink); }

.crumbs ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.crumbs li + li::before { content: "/"; content: "/" / ""; margin-right: 8px; color: var(--panel-edge); }
.crumbs a { color: var(--muted); }
.crumbs a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }

.doc .kicker { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.doc h1 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: clamp(34px, 9vw, 52px); line-height: 0.95; text-wrap: balance; margin: 0 0 10px; }
.doc h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; font-size: 24px; line-height: 1.05; margin: 32px 0 10px; }
.doc p, .doc li, .doc dd { color: #c9d8dc; }
.doc p { margin: 0 0 12px; max-width: 62ch; }
.doc b { color: var(--ink); }
.figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 14px; }
.figure-n { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 17vw, 88px); line-height: 0.9; color: var(--lava); font-variant-numeric: tabular-nums; }
.figure-u { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--ink); }
.figure-alt { flex-basis: 100%; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc .lede { font-size: 18px; color: var(--ink); }

.scale { margin: 18px 0 20px; }
.scale-track { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #3a3a44, var(--lava)); }
.scale-dot { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid #000; transform: translate(-50%, -50%); }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.scale-ends span:last-child { text-align: right; }

.doc .tablewrap { margin: 0 -16px 12px; padding: 0 16px; }
.doc caption { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px; }
.doc th { cursor: default; }
.doc tbody th { color: var(--ink); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 500; white-space: normal; min-width: 9em; }
.doc table.wrap td { white-space: normal; min-width: 8em; }
.doc tr.me th, .doc tr.me td { color: var(--lava); font-weight: 700; }
.doc tr.me { background: var(--panel); }

.tough { background: var(--panel); border: 1.5px solid var(--panel-edge); border-radius: 14px; padding: 14px 16px; margin: 22px 0 14px; }
.cta { margin: 18px 0; }
.play { display: block; text-align: center; padding: 16px 12px; border-radius: 16px; background: var(--lava); color: var(--storm) !important; font-weight: 800; font-size: 19px; text-decoration: none; }
.source { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.source dt { color: var(--muted); }
.source dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .source { grid-template-columns: 1fr; gap: 0; } .source dd { margin-bottom: 8px; } }
@media (forced-colors: active) { .crumbs a[aria-current="page"] { text-decoration: underline; } .scale-dot { border-color: CanvasText; } }

.sheet { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0 18px 16px; border: 1.5px solid var(--panel-edge); border-radius: 18px; background: var(--panel); color: var(--ink); }
.sheet::backdrop { background: rgba(8, 16, 22, 0.75); }
.sheet img { display: block; width: calc(100% + 36px); margin: 0 -18px; aspect-ratio: 16 / 9; object-fit: cover; }
.sheet h2 { font-weight: 800; letter-spacing: -0.02em; font-size: 26px; line-height: 1; margin: 16px 0 6px; }
.sheet p { margin: 0 0 10px; color: #c9d8dc; }
.sheet #sheet-warn { color: var(--ice); font-size: 14px; }
.sheet-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sheet-row .big { flex: 1 1 140px; font-size: 17px; padding: 13px 8px; text-align: center; text-decoration: none; }
.sheet .credit { font-size: 11px; color: var(--muted); margin: 12px 0 0; overflow-wrap: anywhere; }
.sheet .credit a { color: var(--muted); }
.hero { margin: 0 0 16px; }
.hero img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; border-radius: 14px; background: var(--panel); }
.hero figcaption { font-size: 11px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.hero figcaption a { color: var(--muted); }
/* Player terminal (admin) */
tr.pick { cursor: pointer; }
tr.pick:hover td { background: var(--panel); }
.tag.you { border-color: var(--lava); color: var(--lava); }
.tag.ok { border-color: var(--good); color: var(--good); }
.tag.no { border-color: var(--bad); color: var(--bad); }

/* Mode bar and account page */
.form { display: grid; gap: 10px; max-width: 360px; margin: 14px 0 26px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form input { background: var(--panel); color: var(--ink); border: 1.5px solid var(--panel-edge); border-radius: 10px; padding: 12px; font: inherit; font-size: 16px; }
.form .big { font-size: 20px; padding: 13px 8px; }
.form .err { color: var(--bad); min-height: 1.4em; margin: 0; }

.doc small.credit { font-size: 11px; color: var(--muted); }
.doc small.credit a { color: var(--muted); }

/* Category pills on content pages */
.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--panel-edge); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; }
.doc .cat[aria-current="true"] { background: #fff; border-color: #fff; color: #000; }

/* Menu button and side drawer */
.lead { display: flex; align-items: center; gap: 10px; }
.menu-btn { width: 40px; height: 40px; margin-left: -6px; border: 0; border-radius: 50%; background: rgba(0,0,0,0.28); display: grid; place-content: center; gap: 4px; padding: 0; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #fff; }
.drawer { margin: 0; height: 100dvh; max-height: none; width: min(300px, 84vw); border: 0; border-right: 1px solid var(--panel-edge); background: #0d0d10; color: #fff; padding: 18px 18px 24px; inset: 0 auto 0 0; }
.drawer::backdrop { background: rgba(0,0,0,0.6); }
.drawer[open] { animation: drawer-in 0.18s ease-out; }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; font-size: 18px; margin-bottom: 18px; }
.drawer-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #1e1e24; color: #fff; font-size: 24px; line-height: 1; }
.units { border: 0; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.units legend { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding: 0; }
.units label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--panel-edge); border-radius: 14px; cursor: pointer; }
.units label:has(input:checked) { border-color: var(--lava); background: rgba(215,255,62,0.08); }
.units input { width: 20px; height: 20px; accent-color: var(--lava); margin: 0; }
.units span { display: grid; }
.units small { color: var(--muted); font-size: 12px; }
.drawer-links { display: grid; gap: 4px; border-top: 1px solid var(--panel-edge); padding-top: 14px; }
.drawer-links a { padding: 12px 4px; color: #fff; text-decoration: none; font-weight: 600; }
