:root {
  --cream: #fff2dc;
  --paper: #fffdf7;
  --ink: #181018;
  --pink: #ff4d97;
  --blue: #3f6fff;
  --yellow: #ffd23d;
  --lime: #9be814;
  --purple: #b15cff;
  --red: #ff5252;

  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --body: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --bd: 3px solid var(--ink);
  --sh: 5px 5px 0 var(--ink);
  --sh-lg: 8px 8px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at center, rgba(24,16,24,.10) 1.6px, transparent 1.7px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.vignette { display: none; }

#app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 44px 20px 24px;
}

/* ---------- screens ---------- */
.screen { display: none; animation: pop .35s cubic-bezier(.2,1.4,.4,1) both; }
.screen.active { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- intro ---------- */
.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 12px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--bd);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 0 0 16px;
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.title {
  font-family: var(--display);
  font-size: clamp(40px, 8.5vw, 76px);
  line-height: .92;
  text-transform: uppercase;
  margin: 0 0 18px;
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--pink);
  letter-spacing: -0.01em;
}

.subtitle { font-size: 19px; line-height: 1.55; font-weight: 500; margin: 0 0 18px; }
.subtitle em { font-style: normal; font-weight: 700; }

.pull {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(20px, 4.4vw, 28px);
  line-height: 1.18;
  color: var(--ink);
  background: var(--lime);
  border: var(--bd);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 12px 0 0;
  transform: rotate(-1deg);
  box-shadow: var(--sh);
  text-transform: uppercase;
}

.lede { font-size: 17px; line-height: 1.62; font-weight: 500; margin: 0 0 18px; }
.lede strong { font-weight: 700; background: var(--yellow); padding: 0 4px; border-radius: 4px; }

.fineprint {
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 500;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 12px;
  padding: 13px 15px 13px 42px;
  margin: 0 0 26px;
  position: relative;
}
.fineprint::before { content: "🚩"; position: absolute; left: 12px; top: 11px; font-size: 20px; }
.fineprint em { font-style: normal; font-weight: 700; background: var(--pink); color: #fff; padding: 0 4px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn-primary {
  appearance: none;
  cursor: pointer;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
  background: var(--pink);
  color: #fff;
  border: var(--bd);
  font-size: 18px;
  padding: 15px 28px;
  border-radius: 14px;
  box-shadow: var(--sh-lg);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-primary:hover { transform: translate(-2px,-2px); box-shadow: 10px 10px 0 var(--ink); }
.btn-primary:active { transform: translate(4px,4px); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- cover homage ---------- */
.cover-homage {
  max-width: 340px;
  margin: 4px auto 26px;
  border: 4px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  transform: rotate(-2.2deg);
  box-shadow: var(--sh-lg);
}
.cover-homage img { width: 100%; display: block; }
.cover-fallback { background: radial-gradient(125% 120% at 50% 0%, #e8c5c7 0%, #d7abae 100%); padding: 22px 20px 26px; text-align: center; }
.cover-cap { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6f4d50; margin-bottom: 4px; }
.cover-svg { width: 130px; height: auto; margin: 2px auto 6px; display: block; }
.cover-title { font-family: var(--display); font-size: 27px; line-height: 1.02; color: #fff; text-shadow: 3px 3px 0 #a05a5f; text-transform: uppercase; }

/* ---------- game head ---------- */
.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.progress { flex: 1; }
#progress-label { font-family: var(--mono); font-weight: 700; font-size: 12px; text-transform: uppercase; }
.progress-track { height: 16px; background: var(--paper); border: var(--bd); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--lime); transition: width .45s cubic-bezier(.2,1.3,.4,1); }
.score-chip {
  font-family: var(--mono); font-weight: 700; font-size: 13px; white-space: nowrap;
  background: var(--blue); color: #fff; border: var(--bd); border-radius: 10px;
  padding: 8px 12px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(2deg);
}
.score-chip span { font-size: 16px; }

/* ---------- exhibit ---------- */
.exhibit-card {
  background: var(--paper);
  border: var(--bd);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--sh-lg);
}

.exhibit-tag {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #fff;
  background: var(--blue);
  border: var(--bd);
  border-radius: 8px;
  padding: 5px 11px;
  margin-bottom: 16px;
  transform: rotate(-1.5deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.quote { font-family: var(--display); font-size: 22px; line-height: 1.32; margin: 0 0 8px; animation: mirageResolve .6s cubic-bezier(.2,.75,.25,1) both; }
.quote::before { content: "“"; color: var(--pink); }
.quote::after { content: "”"; color: var(--pink); }
.source { font-family: var(--mono); font-size: 12.5px; color: #6a5560; margin: 0 0 18px; }

.inference {
  background: #ffe0ec;
  border: var(--bd);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: var(--sh);
}
.inference .label {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--red);
  border: 2px solid var(--ink); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px;
}

.q-prompt { font-family: var(--display); font-size: 17px; margin: 0 0 14px; }

.options { display: flex; flex-direction: column; gap: 11px; }
.option {
  text-align: left;
  background: #fff;
  border: var(--bd);
  color: var(--ink);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: var(--sh);
  transition: transform .07s ease, box-shadow .07s ease, background .1s ease;
}
.option:hover:not(.locked) { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.option:active:not(.locked) { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--ink); }
.option .letter {
  display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
  font-family: var(--display); font-size: 13px; color: #fff; background: var(--ink);
  border-radius: 50%; margin-right: 10px; vertical-align: middle;
}
.option.locked { cursor: default; }
.option.correct { background: #d6ff9c; animation: focusPull .5s ease both; }
.option.correct .letter { background: #4ba300; }
.option.wrong { background: #ffd2dd; animation: glitchShake .42s ease both; }
.option.wrong .letter { background: var(--red); }
.option.dim { opacity: .45; box-shadow: 2px 2px 0 var(--ink); filter: blur(1.6px); transition: filter .5s ease, opacity .5s ease; }

/* ---------- mirage motion: fuzzy → clear ---------- */
@keyframes mirageResolve {
  0%   { filter: blur(13px) saturate(.25) brightness(1.15); opacity: 0; transform: translateY(10px) scale(1.02) skewX(-1.5deg); }
  55%  { filter: blur(4px) saturate(.7); opacity: 1; transform: translateY(0) scale(1) skewX(.6deg); }
  100% { filter: blur(0) saturate(1); transform: none; }
}
@keyframes hazeShimmer {
  0%   { filter: blur(7px); opacity: .3; transform: skewX(-7deg) translateX(-6px); letter-spacing: .06em; }
  100% { filter: blur(0); opacity: 1; transform: none; letter-spacing: 0; }
}
@keyframes focusPull {
  0%   { filter: blur(8px) brightness(1.5); }
  100% { filter: blur(0) brightness(1); }
}
@keyframes glitchShake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-7px) skewX(3deg); }
  30% { transform: translateX(6px) skewX(-2deg); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ---------- reveal ---------- */
.reveal { margin-top: 22px; animation: mirageResolve .7s cubic-bezier(.2,.75,.25,1) both; }
.reveal-head {
  display: inline-block; font-family: var(--display); font-size: 14px; text-transform: uppercase;
  border: var(--bd); border-radius: 8px; padding: 5px 12px; margin-bottom: 12px; box-shadow: 3px 3px 0 var(--ink);
}
.reveal-head.ok { background: var(--lime); color: var(--ink); }
.reveal-head.no { background: var(--red); color: #fff; }
.reveal-name { font-family: var(--display); font-size: 21px; margin: 0 0 12px; text-transform: uppercase; animation: hazeShimmer .65s ease both; }
.explain { font-size: 15.5px; line-height: 1.6; font-weight: 500; margin: 0; }
.explain strong { background: var(--yellow); padding: 0 3px; border-radius: 3px; }
.explain em { font-style: italic; }

/* data viz */
.viz { margin: 18px 0 4px; background: #fff; border: var(--bd); border-radius: 14px; padding: 18px; box-shadow: var(--sh); }
.viz-title { font-family: var(--mono); font-weight: 700; font-size: 13px; margin: 0 0 16px; text-align: center; text-transform: uppercase; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-label { width: 130px; font-size: 13px; font-weight: 700; text-align: right; flex-shrink: 0; }
.bar-wrap { flex: 1; background: var(--cream); border: var(--bd); border-radius: 99px; height: 28px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; transition: width 1s cubic-bezier(.2,.8,.2,1.05); display: flex; align-items: center; }
.bar-fill.gold { background: var(--pink); }
.bar-fill.green { background: var(--lime); }
.bar-fill.gray { background: var(--blue); }
.bar-val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); padding: 0 10px; white-space: nowrap; }
.bar-fill.gray .bar-val { color: #fff; }
.viz-note { font-size: 12.5px; font-weight: 500; text-align: center; margin: 12px 0 0; }

/* referent strip */
.ref-strip { display: flex; gap: 8px; }
.ref-cell { flex: 1; border-radius: 10px; padding: 14px 6px; text-align: center; border: var(--bd); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.ref-cell.struck { opacity: .7; }
.ref-cell.struck .ref-mark { color: var(--red); }
.ref-cell.hot { background: var(--yellow); transform: rotate(-2deg) scale(1.05); }
.ref-cell.hot .ref-mark { color: var(--ink); }
.ref-mark { display: block; font-family: var(--display); font-size: 22px; margin-bottom: 4px; }
.ref-name { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* then / now */
.thennow { display: flex; align-items: stretch; gap: 10px; }
.tn-col { flex: 1; border-radius: 12px; padding: 14px; border: var(--bd); box-shadow: 3px 3px 0 var(--ink); }
.tn-col p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.tn-col.old { background: #ffd2dd; }
.tn-col.now { background: #d6ff9c; }
.tn-label { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.tn-arrow { align-self: center; font-family: var(--display); color: var(--ink); font-size: 26px; }

/* source expander */
details.more { margin-top: 14px; border: var(--bd); border-radius: 10px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
details.more summary { cursor: pointer; padding: 10px 14px; font-family: var(--mono); font-weight: 700; font-size: 12.5px; text-transform: uppercase; list-style: none; user-select: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "🧾 "; }
details.more p { margin: 0; padding: 0 14px 14px; font-size: 13.5px; line-height: 1.58; font-weight: 500; }
details.more em { font-style: italic; }
details.more strong { background: var(--yellow); padding: 0 3px; border-radius: 3px; }
details.more a { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
details.more a:hover { background: var(--blue); color: #fff; text-decoration: none; border-radius: 3px; }

.next-row { margin-top: 22px; display: flex; justify-content: flex-end; }

/* ---------- verdict ---------- */
.scorebox { text-align: center; margin: 10px 0 26px; }
.bigscore { font-family: var(--display); font-size: 80px; line-height: 1; color: var(--ink); text-shadow: 5px 5px 0 var(--pink); }
.bigscore .slash { color: var(--blue); }
.rank { font-family: var(--display); font-size: 19px; margin: 12px 0 0; text-transform: uppercase; }
.verdict-body p { font-size: 16px; line-height: 1.65; font-weight: 500; }
.verdict-body strong { background: var(--yellow); padding: 0 3px; border-radius: 3px; }
.verdict-body em { font-style: italic; font-weight: 700; }
.verdict-body p.fineprint { font-weight: 500; }
.verdict-actions { margin-top: 22px; text-align: center; }

/* badge */
.badge {
  margin: 28px auto 0; max-width: 440px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  transform: rotate(-1.4deg);
  box-shadow: var(--sh-lg);
}
.badge-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.badge-score { font-family: var(--display); line-height: 1; }
.badge-score #badge-num { font-size: 86px; color: var(--ink); text-shadow: 4px 4px 0 var(--pink); }
.badge-den { font-size: 44px; color: var(--blue); }
.badge-rank { font-family: var(--display); font-size: 24px; text-transform: uppercase; margin: 8px 0 8px; }
.badge-tag { font-family: var(--mono); font-size: 12.5px; font-weight: 700; }

/* share */
.share-block { margin-top: 26px; text-align: center; }
.share-caption { font-family: var(--mono); font-weight: 700; font-size: 14px; margin: 0 0 14px; }
.share-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-share {
  cursor: pointer; font-family: var(--display); text-transform: uppercase; font-size: 14px;
  color: var(--ink); border: var(--bd); border-radius: 12px; padding: 12px 18px;
  box-shadow: var(--sh); transition: transform .07s ease, box-shadow .07s ease;
}
#share-x { background: var(--blue); color: #fff; }
#download-badge { background: var(--lime); }
#copy-link { background: var(--purple); color: #fff; }
.btn-share:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.btn-share:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--ink); }
.btn-share.copied { background: var(--lime); color: var(--ink); }
.copy-status { font-family: var(--mono); font-weight: 700; font-size: 13px; height: 16px; margin: 12px 0 0; }

/* footer */
.site-foot {
  position: relative; z-index: 1; max-width: 720px; margin: 30px auto 50px; padding: 0 20px;
  font-family: var(--mono); font-size: 12px; color: #7a6a72; text-align: center; line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-name, .quote, .option.correct, .option.wrong { animation: none !important; }
  .option.dim { filter: none; }
  .screen { animation: none; }
}

@media (max-width: 560px) {
  #app { padding-top: 28px; }
  .bar-label { width: 92px; font-size: 11px; }
  .quote { font-size: 19px; }
  .exhibit-card { padding: 18px; }
  .thennow { flex-direction: column; }
  .tn-arrow { transform: rotate(90deg); }
  .ref-strip { gap: 5px; }
  .ref-cell { padding: 10px 3px; }
  .ref-name { font-size: 10px; }
  .title { text-shadow: 3px 3px 0 var(--pink); }
}
