/* TIDBITS — see BRAND.md. Editorial serif, data in mono, flat loud colour. */

:root {
  --ink: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1f1f25;
  --line: #2b2b33;
  --paper: #f3f1ea;
  --dim: #9d978c;
  --hot: #ffd23f;
  --right: #2fe39b;
  --wrong: #ff4d6d;
  --radius: 10px;

  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --ui: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  font-family: var(--ui);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
}

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1.15rem 7rem;
}

.boot {
  padding: 5rem 0;
  text-align: center;
  color: var(--dim);
  font-family: var(--display);
}

/* ── type ──────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.022em;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.wordmark::after {
  content: ".";
  color: var(--hot);
}

.eyebrow {
  font-family: var(--ui);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.big {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--dim);
}

.tiny {
  font-size: 0.8rem;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ── chrome ────────────────────────────────────────────────────────────── */

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0 1.4rem;
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
}

.tabs button {
  flex: 1;
  background: var(--ink);
  border: 0;
  color: var(--dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 1.05rem 0;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--hot);
}

/* ── blocks ────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 0.8rem;
}

.card.accent {
  border-left: 5px solid var(--accent, var(--hot));
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.15rem;
}

.card p {
  margin: 0.6rem 0 0;
  line-height: 1.55;
  font-size: 1rem;
  color: #ded9cf;
}

.chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 3px;
  background: var(--accent, var(--hot));
  color: #14120e;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.stack {
  display: grid;
  gap: 0.55rem;
}

/* The oversized index numeral that marks a fact card. */
.index {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 0.8;
  color: var(--accent, var(--hot));
  opacity: 0.55;
}

button.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--hot);
  color: #14120e;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 1.05rem;
  cursor: pointer;
}

button.btn.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}

button.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

input.field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  padding: 0.95rem 1rem;
  margin-bottom: 0.6rem;
}

input.field::placeholder {
  color: #6b655c;
}

.vote {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.vote[aria-pressed="true"] {
  background: var(--accent, var(--hot));
  border-color: transparent;
  color: #14120e;
}

.vote:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── landing ───────────────────────────────────────────────────────────── */

.hero {
  padding: 1.5rem 0 0.5rem;
}

.hero .mark {
  font-family: var(--display);
  font-size: clamp(3.2rem, 17vw, 5rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin: 0;
}

.hero .mark em {
  font-style: normal;
  color: var(--hot);
}

.pitch {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 0;
}

.pitch .hl {
  color: var(--hot);
}

.rail {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.8rem 1.15rem 0.2rem;
  margin: 0 -1.15rem;
}

.rail::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 3px;
  border: 1px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
}

/* ── draft ─────────────────────────────────────────────────────────────── */

.topic {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--paper);
  font: inherit;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.topic strong {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}

.topic[aria-pressed="true"] {
  background: var(--accent);
  color: #14120e;
  border-color: transparent;
}

.topic[aria-pressed="true"] .muted {
  color: rgba(20, 18, 14, 0.72);
}

/* ── table ─────────────────────────────────────────────────────────────── */

table.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 0 0.55rem;
  font-weight: 700;
}

.table td {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.table td.rank {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  width: 2ch;
  color: var(--dim);
}

.table tr.you td.rank,
.table tr:first-child td.rank {
  color: var(--hot);
}

.table td.stat {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.table .who {
  font-family: var(--display);
  font-size: 1.1rem;
}

.table tr.you .who {
  color: var(--hot);
}

/* ── quiz ──────────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--ink);
  overflow-y: auto;
}

.overlay .inner {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.15rem 3rem;
}

/* The topic takes the whole band — you know what you're being asked about
   before you read a word. */
.band {
  background: var(--accent, var(--hot));
  color: #14120e;
  margin: 0 -1.15rem 1.4rem;
  padding: 1rem 1.15rem 0.85rem;
}

.band .row {
  align-items: baseline;
}

.band .topic-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
}

.band .count-of {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.timer {
  height: 4px;
  background: rgba(20, 18, 14, 0.25);
  overflow: hidden;
  margin-top: 0.8rem;
}

.timer > i {
  display: block;
  height: 100%;
  background: #14120e;
  transform-origin: left;
}

.question {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1.3rem;
}

.option {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  padding: 1rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
}

.option.correct {
  background: var(--right);
  color: #08120d;
  border-color: transparent;
  font-weight: 700;
}

.option.wrong {
  background: var(--wrong);
  color: #1a0508;
  border-color: transparent;
  font-weight: 700;
}

.option:disabled {
  cursor: default;
}

.verdict {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}

.verdict .call {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.verdict .clock {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--dim);
  margin-left: 0.55rem;
}

.ready {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78dvh;
  text-align: center;
}

.count {
  font-family: var(--mono);
  font-size: 6.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--hot);
  margin: 1.2rem 0;
}

.count.pop {
  animation: pop 0.28s ease-out both;
}

@keyframes pop {
  from {
    transform: scale(1.3);
    opacity: 0.35;
  }
}

/* ── odds and ends ─────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  z-index: 40;
  max-width: calc(100% - 2rem);
  text-align: center;
}

.lock {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--dim);
}

.lock .big {
  color: var(--paper);
  margin-bottom: 0.5rem;
}

.dev {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.75rem;
}

.dev button {
  flex: 1;
  background: var(--surface-2);
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.7rem;
  padding: 0.5rem;
  cursor: pointer;
}

/* ── the weekly rhythm, explained on the landing page ──────────────────── */

.week-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.1rem;
  margin: 1.6rem 0 0;
}

.week-row {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.35;
  border-bottom: 1px solid rgba(43, 43, 51, 0.55);
}

.week-row:last-of-type {
  border-bottom: 0;
}

.week-row .when {
  flex: 0 0 4.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hot);
  letter-spacing: -0.02em;
}

/* ── recall ────────────────────────────────────────────────────────────── */

.tally {
  font-family: var(--mono);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--hot);
  margin: 0.3rem 0 0.1rem;
}
