/* Dark only: the game is only open at 3am. Palette and type: design/brand/README.md. */
:root {
  --night: #0c0e15;
  --panel: #13151e;
  --line: #262833;
  --ink: #ebe5d8;
  --ink-soft: #c9c3b6;
  --muted: #8b8798;
  --amber: #f2b65c;
  --amber-ink: #1a1408;
  --right: #7fc8a0;
  --right-bg: #16301f;
  --wrong: #e0705a;
  --wrong-bg: #33171a;
  --pending: #2a2c38;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--ink);
  font: 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

header, main, footer {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding-inline: max(20px, env(safe-area-inset-left));
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: max(24px, env(safe-area-inset-top));
}

.logo { height: 26px; width: auto; display: block; }

#clock {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#clock b { color: var(--amber); font-weight: 400; }

main { flex: 1; display: flex; flex-direction: column; padding-block: 32px; }
main > section { flex: 1; display: flex; flex-direction: column; gap: 28px; }

h1 {
  font: 700 2rem/1.12 var(--display);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.sub { font-size: 1.15rem; line-height: 1.4; color: var(--ink-soft); margin: 0; }
.faint { color: var(--muted); font-size: 0.92rem; margin: 0; }
.label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

a { color: var(--amber); }
a:hover { color: #ffd08a; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* Closed */
#closed { justify-content: center; }
.closed-eye { width: 160px; height: auto; color: var(--ink); }
#closed h1 { font-weight: 800; font-size: clamp(2.5rem, 12vw, 3.25rem); line-height: 1; letter-spacing: -0.03em; }
.closed-text { display: flex; flex-direction: column; gap: 12px; }
.countdown { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 18px; }
.countdown-time {
  font: 500 2.75rem/1.1 var(--display);
  letter-spacing: -0.01em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* Question */
.progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.progress span { height: 4px; border-radius: 2px; background: var(--pending); }
.progress .right { background: var(--right); }
.progress .wrong { background: var(--wrong); }
.progress .current { background: var(--ink-soft); }

.q-head { display: flex; flex-direction: column; gap: 12px; }

.choices { display: grid; gap: 10px; }

button {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
  min-height: 52px;
  text-align: left;
  cursor: pointer;
}
.choices button { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 1.08rem; }
.choices button:hover:not(:disabled) { border-color: var(--amber); }
.choices button:disabled { cursor: default; color: var(--muted); }
.choices button.right { color: var(--ink); background: var(--right-bg); border-color: var(--right); }
.choices button.wrong { color: var(--ink); background: var(--wrong-bg); border-color: var(--wrong); }
.choices .tag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; }
.choices .right .tag { color: var(--right); }
.choices .wrong .tag { color: var(--wrong); }

.after { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
#q-verdict { margin: 0; font: 700 1.25rem var(--display); }
.after-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

button.primary {
  background: var(--amber);
  color: var(--amber-ink);
  border: none;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
  padding: 14px 28px;
}
button.primary:hover { background: #ffc677; }

/* Results */
.r-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.open-eye { width: 190px; height: auto; color: var(--ink); margin-bottom: -40px; }
.open-eye .pupil { fill: var(--amber); }
.score { margin: 0; font: 800 5.5rem/0.9 var(--display); letter-spacing: -0.04em; }
.score span { color: var(--muted); }
#results h1 { font-size: 1.75rem; }

.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.grid span { height: 44px; border-radius: 10px; }
.grid .right { background: var(--right); }
.grid .wrong { background: var(--pending); border: 1.5px solid var(--wrong); }

.r-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.r-foot button { width: 100%; }

footer { padding-block: 8px max(24px, env(safe-area-inset-bottom)); line-height: 1.5; }
footer.faint { font-size: 0.8rem; color: #6f6c7a; }
footer p { margin: 0 0 6px; }

button.linklike {
  font: inherit;
  color: var(--amber);
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  text-decoration: underline;
}
button.linklike:hover { color: #ffd08a; }

/* Plain text pages (privacy.html) */
.prose { gap: 0; }
.prose h1 { margin-bottom: 20px; }
.prose h2 { font: 700 1.2rem/1.3 var(--display); margin: 28px 0 8px; }
.prose p, .prose ul { margin: 0 0 12px; color: var(--ink-soft); }
.prose li { margin-bottom: 6px; }

/* Past nights (server/archive.js) and the share sample on about.html */
.prose .label { margin: 0 0 8px; }
.past-q { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.past-q h2 { margin-top: 0; }
.past-q ol { padding-left: 1.5em; }
.past-q summary { cursor: pointer; color: var(--amber); }
.past-q details p { margin: 8px 0 0; color: var(--ink); }
.past-nav { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.past-list { list-style: none; padding: 0; }
.past-list .faint { display: inline; }
.nowrap { white-space: nowrap; }
.share-sample {
  font: 1rem/1.5 var(--body);
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 0 0 12px;
  white-space: pre-wrap;
}

@media (prefers-reduced-motion: no-preference) {
  .choices button, button.primary { transition: border-color 120ms, background-color 120ms; }
}
