:root {
  --ground: #0B0D10;
  --surface: #14181D;
  --line: #232830;
  --line2: #3A414B;
  --text: #F2F0EB;
  --soft: #C9CCD1;
  --muted: #8E96A0;
  --accent: #FF8A3D;
  --bar: #D9D6CE;
  --track: #1C2128;
  --cell: #5B6572;
  --dim: #232830;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--soft); }
a:hover { color: var(--accent); }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
strong { color: var(--text); font-weight: 600; }
.accent { color: var(--accent); }

/* ---------- wordmark ---------- */
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.wordmark:hover { color: var(--text); }
.wordmark .dot { color: var(--accent); }
.wordmark.small { font-size: 18px; }

/* ---------- home ---------- */
.home {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.home-head .wordmark { font-size: 30px; }
.tagline { font-size: 13px; color: var(--muted); }

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 420px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
}
.card:hover { border-color: var(--accent); color: var(--text); }
.card-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.card-claim {
  font-family: var(--serif);
  font-size: clamp(36px, 11vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; }
.card-open { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

.queue h2 { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.queue ul { list-style: none; margin: 0; padding: 0; }
.queue li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.queue .q { font-family: var(--serif); font-size: 21px; line-height: 1.2; color: var(--soft); }
.queue .soon { flex: 0 0 auto; font-size: 13px; color: var(--muted); }

.home-signup h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- forms and buttons ---------- */
.signup, .home-form { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 13px; color: var(--muted); }
input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid #5A6675;
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
}
input::placeholder { color: #7A828C; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { opacity: 0.88; }
.btn-primary, .btn-primary:hover { min-height: 56px; background: var(--accent); color: #0B0D10; font-weight: 700; }
.btn-ghost, .btn-ghost:hover { background: transparent; border-color: var(--line2); color: var(--text); }
.btn-quiet, .btn-quiet:hover { min-height: 44px; background: transparent; color: #A3ADB8; font-size: 14px; font-weight: 500; }
.textlink { font-size: 15px; font-weight: 600; color: var(--text); }
.done-note { margin: 0; font-family: var(--serif); font-size: 24px; line-height: 1.15; }

/* ---------- story player ---------- */
.story {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.story-top { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 0; }
.progress { display: flex; gap: 4px; }
.seg { flex: 1 1 0; height: 3px; overflow: hidden; background: #2A2F37; border-radius: 2px; }
.seg > span { display: block; width: 0; height: 100%; background: var(--text); transition: width 0.25s ease; }
.seg.on > span { width: 100%; }
.story-bar { display: flex; justify-content: space-between; align-items: center; }
.close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--text); }
.close:hover { color: var(--accent); }

.mid { position: relative; flex: 1 1 auto; min-height: 0; }
.stage { display: flex; flex-direction: column; height: 100%; padding: 0 28px; overflow-y: auto; }
.frame { display: flex; flex-direction: column; gap: 20px; margin: auto 0; padding: 16px 0; }

.zones { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; display: flex; }
.zones[hidden] { display: none; }
.zone { padding: 0; background: transparent; border: 0; cursor: pointer; }
.zone-back { flex: 0 0 35%; }
.zone-next { flex: 1 1 auto; }

.story-bottom { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 20px; }
.nav-btn { min-height: 44px; padding: 0 12px; background: transparent; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; }
.nav-btn.strong { color: var(--text); font-weight: 600; }
.nav-btn:hover { color: var(--accent); }

/* ---------- frame typography ---------- */
.kicker { margin: 0; font-size: 13px; color: var(--muted); }
.h-xl { margin: 0; font-family: var(--serif); font-size: clamp(38px, 12vw, 50px); font-weight: 400; line-height: 1.02; letter-spacing: -0.025em; }
.h-lg { margin: 0; font-family: var(--serif); font-size: clamp(32px, 10vw, 40px); font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
.h-md { margin: 0; font-family: var(--serif); font-size: clamp(30px, 9.5vw, 38px); font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
.h-sm { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(28px, 9vw, 36px); font-weight: 400; line-height: 1.08; letter-spacing: -0.02em; }
.body { margin: 0; font-size: 17px; line-height: 1.5; color: var(--soft); }
.body-sm { margin: 0; font-size: 15px; line-height: 1.45; color: var(--soft); }
.fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

.statrow { display: flex; align-items: baseline; gap: 14px; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.stat-num { font-family: var(--serif); font-size: 88px; line-height: 0.9; letter-spacing: -0.04em; }
.stat-label { font-size: 16px; line-height: 1.35; color: var(--soft); }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.opt {
  min-height: 56px;
  padding: 0 18px;
  background: transparent;
  border: 1.5px solid var(--line2);
  border-radius: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { background: var(--text); border-color: var(--text); color: #0B0D10; }

.guessline { margin: 0; font-size: 15px; color: var(--soft); }
.big-num { margin: 0; font-family: var(--serif); font-size: clamp(96px, 34vw, 132px); line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.big-label { margin: 0; font-family: var(--serif); font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }

.bars { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.bar-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.track { height: 10px; overflow: hidden; background: var(--track); border-radius: 5px; }
.fill { width: var(--w); height: 100%; background: var(--bar); animation: grow 0.9s ease-out; }
.fill-accent { background: var(--accent); }
@keyframes grow { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fill { animation: none; }
  .seg > span { transition: none; }
}

.rows { display: flex; flex-direction: column; }
.row { margin: 0; padding: 16px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.row:last-child { border-bottom: 1px solid var(--line); }

.verdict-word { margin: 0; font-family: var(--serif); font-size: clamp(76px, 26vw, 104px); line-height: 0.95; letter-spacing: -0.035em; }
.verdict-line { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 15px; color: var(--muted); }
.scale span { display: block; padding-top: 10px; border-top: 5px solid var(--line2); border-radius: 3px; }
.scale .on { border-top-color: var(--accent); color: var(--text); font-weight: 600; }

.panel { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border-radius: 16px; }
.panel-title { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.1; }

/* ---------- plain documents (privacy, 404) ---------- */
.doc { max-width: 560px; margin: 0 auto; padding: 28px 20px 56px; }
.doc h1 { margin: 24px 0 16px; font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; }
.doc h2 { margin: 28px 0 8px; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.doc p, .doc li { font-size: 16px; color: var(--soft); }
.doc ul { padding-left: 20px; }

/* ---------- visuals ---------- */
.c-accent { fill: var(--accent); }
.c-muted { fill: var(--cell); }
.c-dim { fill: var(--dim); }
.cell, .pic { animation: pop 0.45s ease-out both; }
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cell, .pic { animation: none; } }

.fieldsvg { display: block; width: 100%; max-width: 330px; height: auto; margin-bottom: 8px; }

.gps { display: flex; gap: 18px; margin-top: 4px; }
.gp { flex: 1 1 0; min-width: 0; margin: 0; }
.gp-title { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.gp-big { margin: 0 0 8px; font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.gridsvg { display: block; width: 100%; height: auto; }
.gp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.3; color: var(--muted); }
.gp-legend li { display: flex; align-items: center; gap: 6px; }
.sw { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 2.5px; }
.sw-accent { background: var(--accent); }
.sw-muted { background: var(--cell); }

.mults { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.mrow-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; color: var(--soft); }
.mrow-val { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -0.02em; color: var(--accent); }
.multsvg { display: block; width: 100%; height: auto; max-height: 40px; }

.frame-reveal .big-num { font-size: clamp(72px, 24vw, 96px); }

.nextlink { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); }
.nextlink:hover { border-color: var(--accent); color: var(--text); }
.nextlink-k { font-size: 12px; color: var(--muted); }
.nextlink-t { font-family: var(--serif); font-size: 21px; line-height: 1.2; }

.card-art { display: block; width: 100%; max-width: 260px; height: auto; margin-bottom: 4px; }
.card.compact { min-height: 0; gap: 18px; }
.card.compact .card-claim { font-size: clamp(30px, 9vw, 36px); }

/* ---------- admin dashboard ---------- */
.admin { max-width: 720px; margin: 0 auto; padding: 28px 20px 56px; display: flex; flex-direction: column; gap: 24px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.admin-head .wordmark { font-size: 26px; }
.btn-link { margin-left: auto; padding: 8px 0; background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.btn-link:hover { color: var(--accent); }
.admin-login { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.acard { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--ground); border-radius: 12px; }
.tile-l { font-size: 12px; color: var(--muted); }
.tile-v { font-family: var(--serif); font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.tile-s { font-size: 12px; color: var(--muted); }
.ah { margin: 8px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.achart { display: flex; flex-direction: column; gap: 6px; }
.arow { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; color: var(--soft); }
.arow-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-t { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.arow-f { display: block; height: 100%; background: var(--cell); border-radius: 4px; }
.arow-f.accent { background: var(--accent); }
.arow-v { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.atake { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.2; }

[hidden] { display: none !important; }
#report { display: flex; flex-direction: column; gap: 24px; }
