:root {
  --bg: #15110e;
  --paper: #efe6d6;
  --ink: #f5ede0;
  --muted: #a99c88;
  --line: #3a3029;
  --gold: #d8b06a;
  --good: #8fcf9a;
  --bad: #e58a7a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(80% 60% at 30% 20%, #241c16, var(--bg));
  color: var(--ink);
  font: 400 15px/1.5 Inter, system-ui, sans-serif;
}

button {
  font: inherit;
  color: inherit;
}

kbd {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 500 10px/1.4 Inter, sans-serif;
  opacity: 0.6;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 10px;
}

h1 {
  margin: 0;
  font: 500 clamp(26px, 3.2vw, 40px) / 1.05 'Cormorant Garamond', Georgia, serif;
}

.score {
  text-align: right;
}

.score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.score strong {
  font: 700 34px/1 'Cormorant Garamond', Georgia, serif;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 36px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 28px 40px;
}

.frame {
  position: relative;
  height: min(70vh, 720px);
  overflow: hidden;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.8);
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.9s ease, opacity 0.9s ease;
}

/* Stage 1: only the palette. Stage 2: a blurred silhouette. Stage 3: the piece. */
.frame[data-stage='0'] img {
  opacity: 0;
}

.frame[data-stage='1'] img {
  filter: blur(26px) saturate(0.6);
}

.bands {
  position: absolute;
  inset: 0;
  display: flex;
  transition: opacity 0.9s ease;
}

.bands span {
  flex: 1;
}

.frame[data-stage='1'] .bands,
.frame[data-stage='2'] .bands {
  opacity: 0;
}

.steps {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.steps .on {
  color: var(--gold);
}

.ask {
  margin: 0 0 16px;
  font: 500 26px/1.15 'Cormorant Garamond', Georgia, serif;
}

.decades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.decades button {
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.02);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.decades button:hover {
  border-color: var(--muted);
}

.decades button[aria-checked='true'] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

.decades button.answer {
  border-color: var(--good);
  box-shadow: inset 0 0 0 1px var(--good);
}

.decades button.wrong {
  border-color: var(--bad);
  background: var(--bad);
  color: var(--bg);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.primary,
.ghost {
  padding: 11px 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
}

.primary {
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

.ghost {
  background: transparent;
  color: var(--gold);
}

.ghost:disabled,
.primary:disabled {
  opacity: 0.35;
  cursor: default;
}

.reveal {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.verdict {
  margin: 0 0 8px;
  font-weight: 600;
}

.verdict.good {
  color: var(--good);
}

.verdict.bad {
  color: var(--bad);
}

.reveal h2 {
  margin: 0 0 4px;
  font: 500 26px/1.1 'Cormorant Garamond', Georgia, serif;
}

.reveal p {
  margin: 0 0 10px;
  color: var(--muted);
}

.reveal a {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--ink);
}

.done {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 28px 48px;
  text-align: center;
}

.final {
  margin: 0;
  font: 700 clamp(56px, 9vw, 104px) / 1 'Cormorant Garamond', Georgia, serif;
  color: var(--gold);
}

.sub {
  margin: 4px 0 28px;
  color: var(--muted);
}

/* Every piece in the archive: blurred until you've dated it right once. */
.mastery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  margin: 6px 0 28px;
}

.mastery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  object-fit: cover;
  background: var(--paper);
  filter: blur(6px) grayscale(1) brightness(0.6);
  transition: filter 0.6s;
}

.mastery img.known {
  filter: none;
}

.notice {
  position: fixed;
  inset: auto 16px 20px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: #241c16;
  text-align: center;
}

@media (max-width: 900px) {
  .play {
    grid-template-columns: 1fr;
  }

  .frame {
    height: 52vh;
  }
}
