/* One committed look: a TV game-show set. The page has no light theme. */
:root {
  color-scheme: dark;
  --ground: #150f4d;
  --ground-2: #2a1b8a;
  --ray: rgba(255, 200, 61, .10);
  --gold: #ffc83d;
  --gold-deep: #c98a00;
  --cyan: #22e6ff;
  --magenta: #ff2d95;
  --paper: #fff7e6;
  --paper-edge: #e8d9b8;
  --ink: #1a1240;
  --text: #fff4d6;
  --text-soft: #b9b0e0;
  --panel: rgba(8, 4, 40, .55);
  --focus: #ffffff;

  --display: "Bungee", "Arial Black", Impact, sans-serif;
  --reel: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --item-h: 132px;
  --lever-w: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; }

body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  padding-inline: 16px;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Set: sunburst and floor ---------- */

.set {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, var(--ground-2) 0%, var(--ground) 60%, #0b0730 100%);
}
.set::before {
  content: "";
  position: absolute;
  left: 50%; top: 34%;
  width: 240vmax; height: 240vmax;
  margin: -120vmax 0 0 -120vmax;
  background: repeating-conic-gradient(from 0deg, var(--ray) 0deg 9deg, transparent 9deg 18deg);
  animation: rays 90s linear infinite;
}
.set::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 34%, transparent 30%, rgba(8, 4, 40, .85) 100%);
}
@keyframes rays { to { transform: rotate(360deg); } }

/* ---------- Page ---------- */

.page {
  max-width: 800px;
  margin: 0 auto;
  padding-block: 40px 0;
  display: grid;
  gap: 28px;
  justify-items: center;
}

/* ---------- Head ---------- */

.head { text-align: center; display: grid; gap: 10px; }
.head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 8vw, 76px);
  line-height: .95;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow:
    0 1px 0 var(--gold-deep), 0 2px 0 var(--gold-deep), 0 3px 0 var(--gold-deep),
    0 4px 0 #8a5d00, 0 5px 0 #8a5d00, 0 6px 0 #6b4700,
    0 12px 24px rgba(0, 0, 0, .6),
    0 0 40px rgba(255, 200, 61, .35);
  text-wrap: balance;
}
.sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sub strong { color: var(--cyan); font-weight: 500; }
.sub em { color: var(--magenta); font-style: normal; }

/* ---------- Machine ---------- */

.machine {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr var(--lever-w);
  gap: 18px;
  align-items: start;
}

.cabinet {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2b1f8f, #1a1160);
  box-shadow:
    0 0 0 4px var(--gold),
    0 0 0 8px #0e0a3a,
    0 30px 60px rgba(0, 0, 0, .6),
    0 0 60px rgba(255, 200, 61, .25);
}
/* The light rim. It chases only while the reels spin. */
.cabinet::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 24px;
  padding: 2px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, transparent 10px 22px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .55;
  pointer-events: none;
}
.machine.spinning .cabinet::before {
  opacity: 1;
  animation: chase .5s linear infinite;
  filter: drop-shadow(0 0 6px var(--gold));
}
@keyframes chase { to { background-position: 22px 0; } }

.reels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.reel-col { display: grid; gap: 8px; }
.reel-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  min-height: 2.9em;
  align-self: end;
}

.reel {
  position: relative;
  height: calc(var(--item-h) * 1.7);
  overflow: hidden;
  background: var(--paper);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 3px #0e0a3a,
    inset 0 14px 30px rgba(0, 0, 0, .25),
    inset 0 -14px 30px rgba(0, 0, 0, .25);
}
/* Cylinder shading and glass glare. */
.reel::before {
  content: "";
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 10, 60, .7) 0%, transparent 30%, transparent 70%, rgba(20, 10, 60, .7) 100%),
    linear-gradient(105deg, transparent 60%, rgba(255, 255, 255, .22) 64%, transparent 68%);
}
/* Pay line markers */
.reel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 16px;
  margin-top: -8px;
  z-index: 3;
  pointer-events: none;
  background:
    conic-gradient(from 225deg at 100% 50%, var(--magenta) 0 90deg, transparent 0) left / 10px 100% no-repeat,
    conic-gradient(from 45deg at 0 50%, var(--magenta) 0 90deg, transparent 0) right / 10px 100% no-repeat;
}

.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.strip.blur { filter: url(#reel-blur); }

.item {
  height: var(--item-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  text-align: center;
  font-family: var(--reel);
  font-weight: 900;
  font-size: clamp(26px, 5vw, 42px);
  line-height: .95;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--paper-edge);
  text-wrap: balance;
  overflow: hidden;
}
.item.long { font-size: clamp(22px, 4vw, 32px); }
.item.xlong { font-size: clamp(17px, 3.2vw, 24px); font-weight: 700; line-height: 1.05; }
.reel-col:nth-child(2) .item { color: #c4126f; }

/* Lever */
.lever {
  align-self: stretch;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: end;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5));
}
.lever:active { cursor: grabbing; }
.lever svg { display: block; width: 100%; height: auto; overflow: visible; }
.lever-arm rect { fill: url(#chrome); }
.lever-base { fill: #0e0a3a; stroke: var(--gold); stroke-width: 2; }
.lever-ball circle { fill: url(#knob); }
.lever-arm { transform-origin: 24px 171px; transform-box: view-box; }
.lever-ball { transform-origin: 24px 26px; transform-box: view-box; }
.machine.spinning .lever { pointer-events: none; }

/* ---------- Play ---------- */

.play {
  width: 100%;
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}
.sentence {
  margin: 0;
  font-size: 17px;
  max-width: 60ch;
  text-wrap: balance;
}
.sentence mark {
  background: none;
  color: var(--gold);
  font-weight: 500;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: min(520px, 100%);
}
.choice {
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1;
  text-transform: uppercase;
  padding: 22px 12px 26px;
  border: 0;
  border-radius: 16px;
  color: #0b0730;
  cursor: pointer;
  transition: transform .08s ease-out, box-shadow .08s ease-out, filter .2s;
}
#choose-real {
  background: radial-gradient(circle at 35% 25%, #b8f6ff 0%, var(--cyan) 40%, #0a9db3 100%);
  box-shadow: 0 8px 0 #06626f, 0 16px 30px rgba(0, 0, 0, .5), 0 0 34px rgba(34, 230, 255, .45);
}
#choose-fake {
  background: radial-gradient(circle at 35% 25%, #ffb0d6 0%, var(--magenta) 40%, #b0135f 100%);
  box-shadow: 0 8px 0 #6d0a3b, 0 16px 30px rgba(0, 0, 0, .5), 0 0 34px rgba(255, 45, 149, .45);
}
.choice:hover { filter: brightness(1.1); }
.choice:active, .choice[aria-pressed="true"] { transform: translateY(6px); }
#choose-real:active, #choose-real[aria-pressed="true"] { box-shadow: 0 2px 0 #06626f, 0 6px 14px rgba(0, 0, 0, .5), 0 0 34px rgba(34, 230, 255, .6); }
#choose-fake:active, #choose-fake[aria-pressed="true"] { box-shadow: 0 2px 0 #6d0a3b, 0 6px 14px rgba(0, 0, 0, .5), 0 0 34px rgba(255, 45, 149, .6); }
.play[data-state="spinning"] .choice { filter: saturate(.3) brightness(.6); pointer-events: none; }
.play[data-state="right"] .choice,
.play[data-state="wrong"] .choice { pointer-events: none; }
.play[data-state="right"] .choice[aria-pressed="false"],
.play[data-state="wrong"] .choice[aria-pressed="false"] { filter: saturate(.3) brightness(.5); }

/* Reveal */
.reveal { display: grid; gap: 8px; justify-items: center; width: 100%; }
.verdict {
  margin: 0;
  pointer-events: none; /* The stamp scales up over the buttons for a moment. */
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 8vw, 64px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(34, 230, 255, .7), 0 4px 0 rgba(0, 0, 0, .4);
  animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.play[data-state="wrong"] .verdict {
  color: var(--magenta);
  text-shadow: 0 0 20px rgba(255, 45, 149, .7), 0 4px 0 rgba(0, 0, 0, .4);
}
@keyframes stamp {
  from { transform: scale(2.6) rotate(-6deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: scale(1) rotate(-2deg); opacity: 1; }
}
.detail { margin: 0; max-width: 60ch; }
.fda {
  margin: 4px 0 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-soft);
  max-width: 68ch;
  text-wrap: pretty;
  background: var(--panel);
  border-radius: 10px;
  border: 1px solid rgba(255, 200, 61, .25);
}

/* Full-screen wash on reveal */
.wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  background: var(--cyan);
}
.wash.go { animation: wash .7s ease-out; }
.wash.bad { background: var(--magenta); }
@keyframes wash { from { opacity: .5; } to { opacity: 0; } }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
  padding-top: 4px;
}
/* Share links appear after the answer, so the link never leaks it. */
.share { display: contents; }
.play[data-state="guess"] .share,
.play[data-state="spinning"] .share,
.play[data-state="loading"] .share { display: none; }
.pull {
  font: inherit;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .04em;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #0b0730;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--gold-deep), 0 10px 20px rgba(0, 0, 0, .5);
  transition: transform .08s, box-shadow .08s;
}
.pull:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-deep), 0 4px 10px rgba(0, 0, 0, .5); }
.pull:disabled { filter: saturate(.4) brightness(.7); cursor: progress; }
.link {
  font: inherit;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover, .link[aria-pressed="true"] { color: var(--gold); }

/* ---------- Scoreboard ---------- */

.score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(520px, 100%);
  margin: 0;
  padding: 0;
  list-style: none;
}
.score li {
  display: grid;
  gap: 2px;
  padding: 10px 8px 12px;
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255, 200, 61, .25);
  border-radius: 12px;
}
.score .n {
  font-family: var(--display);
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 200, 61, .5);
}
.score .l {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.score .n.bump { animation: bump .4s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes bump { 50% { transform: scale(1.35); color: #fff; } }

/* ---------- Footer ---------- */

.foot {
  max-width: 800px;
  margin: 56px auto 0;
  padding-block: 20px 40px;
  border-top: 1px solid rgba(255, 200, 61, .2);
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
}
.foot p { margin: 4px 0; }

/* Clam burst for the original recipe */
.burst {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

@media (max-width: 480px) {
  :root { --item-h: 124px; --lever-w: 40px; }
  .page { padding-block: 28px 0; gap: 22px; }
  .machine { gap: 10px; }
  .cabinet { padding: 12px; border-radius: 14px; }
  .reels { gap: 8px; }
  .item { padding: 6px 10px; font-size: 24px; }
  .item.long { font-size: 20px; }
  .item.xlong { font-size: 15px; }
  .choices { gap: 12px; }
  .choice { padding: 18px 8px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .set::before, .machine.spinning .cabinet::before, .verdict, .wash.go, .score .n.bump { animation: none; }
  .strip.blur { filter: none; }
}
