/* Fire The AI. Sticker Chaos: a sunny ground, every object a cut-out sticker with a thick ink outline
   and a hard offset shadow, and the robot big enough to be the star of every clip. */

:root {
  --sun: #ffd84d;
  --ink: #1b1b1f;
  --paper: #ffffff;
  --red: #ff3b3b;
  --red-side: #a3001a;
  --sky: #8fd9ff;
  --floor: #ffb23f;
  --lime: #c6f36b;
  --pink: #ff9ecf;
  --muted: #4a4a52;

  --line: 3px solid var(--ink);
  --lift: 4px 4px 0 var(--ink);
  --lift-big: 6px 6px 0 var(--ink);

  --m: clamp(16px, 3.2vw, 44px);
  --gap: 24px;

  --step-small: 15px;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.3rem + 3.4vw, 4.5rem);
  --step-display: clamp(3.25rem, 1rem + 7.4vw, 8.5rem);

  --font: "Baloo 2", system-ui, "Hiragino Maru Gothic ProN", "Hiragino Sans", "PingFang SC", "Microsoft YaHei",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK SC", sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  font-weight: 500;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, p { margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
::selection { background: var(--ink); color: var(--sun); }

/* ---------- navigation ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px var(--m);
}
.mark {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--red); color: var(--paper); border: var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  padding: 2px 14px 0; font-weight: 800; font-size: 20px; letter-spacing: 0.01em; text-transform: uppercase; white-space: nowrap;
  rotate: -3deg; transition: rotate 200ms var(--ease-out);
}
.mark-dot { display: none; }
.tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lang { min-width: 0; }
.lang select {
  appearance: none; background: var(--paper); border: var(--line); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink);
  padding: 8px 34px 6px 16px; font-size: var(--step-small); font-weight: 700; min-height: 44px; max-width: 38vw;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
  background-position: right 18px top 52%, right 12px top 52%; background-size: 6px 6px; background-repeat: no-repeat;
}
.sound {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: var(--line); background: var(--paper); box-shadow: 2px 2px 0 var(--ink);
  display: grid; place-items: center; transition: transform 140ms var(--ease-out);
}
.sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sound svg path:first-child { fill: currentColor; }
.sound[aria-pressed="true"] .wave { opacity: 0.2; }
.sound:active, .lang select:active { transform: translate(2px, 2px); box-shadow: none; }

/* The analytics question, in the page flow above the nav so it never covers the button. */
.consent {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 12px var(--m) 0; padding: 12px 14px 12px 18px;
  background: var(--paper); border: var(--line); border-radius: 20px; box-shadow: var(--lift);
  font-size: var(--step-small); font-weight: 600; line-height: 1.3;
}
.consent p { flex: 1 1 260px; }
.consent-actions { display: flex; gap: 8px; }
.consent .btn { min-height: 40px; padding: 6px 16px 4px; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
  padding: 0 var(--m);
}
.hero-copy { grid-column: 1 / 6; grid-row: 1; padding-top: clamp(16px, 5vh, 72px); }
.hero-me { grid-column: 1 / 6; grid-row: 2; padding: 28px 0 40px; display: flex; flex-direction: column; align-items: flex-start; }
h1 {
  font-size: var(--step-display);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-wrap: balance;
  padding-top: 0.08em;
}
.lede { margin-top: 24px; font-size: var(--step-lead); line-height: 1.3; max-width: 26ch; }
/* The world total is the scoreboard: white digits on an ink plate. */
.world {
  margin-top: 28px; display: inline-flex; flex-direction: column; align-items: flex-start;
  background: var(--ink); color: var(--paper); border-radius: 20px; padding: 14px 22px 12px;
  font-size: var(--step-body); font-weight: 600; rotate: 1.5deg;
}
.world strong {
  display: block; font-size: var(--step-head); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--sun);
}
.hero-me #who { font-size: var(--step-lead); line-height: 1.25; }
.hero-me b { font-weight: 800; }
.who-tools { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.title {
  background: var(--lime); color: var(--ink); border: var(--line); box-shadow: 2px 2px 0 var(--ink);
  font-weight: 800; font-size: var(--step-small); padding: 3px 12px 1px; border-radius: 999px; rotate: -2deg;
}
.link {
  background: none; border: 0; padding: 8px 0; font-size: var(--step-small); font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px;
  min-height: 44px;
}
.share {
  margin-top: 24px;
  background: var(--paper); color: var(--ink); border: var(--line); border-radius: 999px; box-shadow: var(--lift);
  padding: 12px 28px 10px; font-weight: 800; font-size: var(--step-body);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.share:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }

/* The stage: one big sticker. Sky and office on top, the button standing on the yellow below. */
.stage {
  position: relative;
  grid-column: 6 / -1;
  grid-row: 1 / 3;
  margin-top: 8px;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  min-height: min(80svh, 860px);
}
.scene {
  position: relative; overflow: hidden;
  background: var(--sky); border: var(--line); border-radius: 28px; box-shadow: var(--lift-big);
}
.scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: var(--floor); border-top: var(--line); }
.window {
  position: absolute; left: 7%; top: 30%; width: 20%; aspect-ratio: 1;
  background: var(--paper); border: var(--line); border-radius: 16px;
}
.window::before, .window::after { content: ""; position: absolute; background: var(--ink); }
.window::before { left: calc(50% - 1.5px); top: 0; bottom: 0; width: 3px; }
.window::after { top: calc(50% - 1.5px); left: 0; right: 0; height: 3px; }
/* The door: an ink doorway behind a pink panel hinged on the right, which swings open when an AI is fired. */
.door {
  position: absolute; right: 7%; bottom: 22%; width: 17%; height: 50%;
  background: var(--ink); border: var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
}
.door::before {
  content: ""; position: absolute; inset: -3px -3px 0 -3px;
  background: var(--pink); border: var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
  transform-origin: right center; transition: transform 300ms var(--ease-out);
}
.door::after { content: ""; position: absolute; left: 14%; top: 52%; width: 14%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); transition: opacity 120ms ease; }
.door.open::before { transform: perspective(400px) rotateY(68deg); }
.door.open::after { opacity: 0; }
.desk {
  position: absolute; left: 30%; bottom: 14%; width: 40%; height: 11%;
  background: var(--paper); border: var(--line); border-radius: 12px; z-index: 1;
}
.robot {
  position: absolute; left: 50%; bottom: 17%; width: clamp(140px, 22%, 220px); margin-left: calc(clamp(140px, 22%, 220px) / -2);
  aspect-ratio: 200 / 260; transform-origin: 50% 100%; z-index: 2;
}
.robot svg { width: 100%; height: 100%; display: block; }
/* The player's clerk, by the window, pointing the AI to the door on every press. */
.hr {
  position: absolute; left: 5%; bottom: 17%; width: clamp(92px, 19%, 210px); aspect-ratio: 140 / 168; z-index: 2;
  transform-origin: 50% 100%;
}
.hr svg { width: 100%; height: 100%; display: block; }
.hr[data-act] { transform: translateY(-4%) rotate(3deg); }

/* Everyone else pressing right now: smaller clerks with their flag, standing behind the desk and by the door. */
.mate {
  position: absolute; bottom: 19%; width: clamp(54px, 10%, 120px); aspect-ratio: 140 / 168; translate: -50% 0; z-index: 1;
  animation: mate-in 360ms var(--ease-out);
  transition: opacity 260ms ease, transform 260ms var(--ease-out);
}
.mate.out { opacity: 0; transform: translateY(12px); }
@keyframes mate-in { from { opacity: 0; transform: translateY(16px); } }
.mate-body, .mate-body svg { width: 100%; height: 100%; display: block; }
/* Watchers sway a little on their feet; pressers stand firm and throw. */
.mate-body { transform-origin: 50% 100%; animation: sway 2.6s ease-in-out infinite alternate; }
.mate.busy .mate-body { animation: none; }
@keyframes sway { from { rotate: -2.5deg; } to { rotate: 2.5deg; } }
/* Everyone online who has no place in the office, counted on the case file. */
.more { position: relative; flex: none; font-variant-numeric: tabular-nums; }
/* Name tags: a flag and the nickname on a white pill over the head. */
.tag {
  position: absolute; left: 50%; top: -18px; translate: -50% 0; z-index: 1;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px 0;
  font-size: 12px; font-weight: 800; line-height: 1.3;
}
.mate[data-high] .tag { top: -40px; }
.mate.busy .tag { background: var(--sun); }
.mate[data-edge] .tag { left: auto; right: -6px; translate: none; }
.tag.mine { background: var(--ink); color: var(--paper); top: -10px; max-width: 150px; font-size: 13px; }
.paper {
  position: absolute; z-index: 4; width: 16px; height: 16px; pointer-events: none;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 40% 55% 45% 60%;
  box-shadow: inset -3px -3px 0 #d9d9de;
}
/* The combo: a lime sticker over the player's clerk that grows by tier. */
.combo {
  position: absolute; left: 4%; top: 34%; z-index: 4; pointer-events: none;
  background: var(--lime); color: var(--ink); border: var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 12px 1px; font-weight: 800; font-size: 22px; line-height: 1.1; rotate: -8deg;
  font-variant-numeric: tabular-nums;
}
.combo[data-tier="1"] { font-size: 28px; background: var(--sun); }
.combo[data-tier="2"] { font-size: 34px; background: var(--pink); }
.combo[data-tier="3"] { font-size: 40px; background: var(--red); color: var(--paper); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.combo.pop { animation: combo-pop 160ms var(--ease-out); }
@keyframes combo-pop { from { transform: scale(1.25); } }

/* The AI's case file: a pill on the floor that fills red as the world presses. */
.case {
  position: absolute; left: 14px; right: 14px; bottom: 14px; height: 38px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 16px 0;
  background: var(--paper); border: var(--line); border-radius: 999px; overflow: hidden;
  font-size: var(--step-small); font-weight: 800; line-height: 1;
}
.case-fill {
  position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
.case-name, .case-n { position: relative; white-space: nowrap; }
.case-name { flex: 1; }
.case-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.case-n { font-variant-numeric: tabular-nums; }

/* What the scene says when an AI is fired. Inside the scene, so it never covers the button. */
.verdict {
  position: absolute; left: 50%; top: 40%; translate: -50% -50%; z-index: 5; width: max-content; max-width: 88%;
  background: var(--red); color: var(--paper); border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  border-radius: 24px; padding: 12px 22px 10px; text-align: center; rotate: -3deg;
  font-size: var(--step-small); font-weight: 800; line-height: 1.2;
  animation: pop 420ms var(--ease-out);
}
.verdict b, .verdict span { display: block; }
.verdict strong {
  display: block; margin: 6px 0 4px; font-size: clamp(1.75rem, 1rem + 3vw, 3.25rem); line-height: 1;
  color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.bubble {
  position: absolute; left: 4%; right: 4%; top: 16px; margin-inline: auto; width: fit-content; max-width: 30ch;
  background: var(--paper); color: var(--ink); border: var(--line); border-radius: 20px;
  font-size: var(--step-body); font-weight: 700; line-height: 1.25; text-align: center;
  padding: 10px 16px 8px; z-index: 3;
  transition: opacity 160ms ease, transform 200ms var(--ease-out);
}
.bubble.gone { opacity: 0; transform: translateY(6px) scale(0.96); }

.robot.hit { animation: hit 180ms var(--ease-out); }
@keyframes hit { 40% { transform: translateX(-6px) rotate(-5deg); } }
.robot.fired { animation: fired 650ms var(--ease-in-out) forwards; }
@keyframes fired {
  0% { transform: none; }
  20% { transform: translateY(-10%) rotate(-8deg) scale(1.04); }
  100% { transform: translateX(240%) translateY(-30%) rotate(40deg); opacity: 0; }
}
.robot.enter { animation: enter 420ms var(--ease-out); }
/* Fired: hop by hop to the door with the box, then through it. --to is the distance, set by app.js. */
.robot.leave { animation: leave 1400ms var(--ease-in-out) forwards; z-index: 1; }
@keyframes leave {
  0% { transform: none; }
  12% { transform: translateY(-6%) rotate(-4deg); }
  28% { transform: translateX(calc(var(--to) * 0.25)) rotate(4deg); }
  44% { transform: translateX(calc(var(--to) * 0.5)) translateY(-6%) rotate(-4deg); }
  60% { transform: translateX(calc(var(--to) * 0.75)) rotate(4deg); }
  80% { transform: translateX(var(--to)) scale(0.9); opacity: 1; }
  100% { transform: translateX(var(--to)) scale(0.6); opacity: 0; }
}
@keyframes enter { 0% { transform: translateY(-130%); opacity: 0; } 70% { transform: translateY(3%) scaleY(0.94); opacity: 1; } }

.stamp {
  position: absolute; z-index: 4; pointer-events: none;
  font-weight: 800; font-size: var(--step-lead); letter-spacing: 0.01em; text-transform: uppercase;
  color: var(--paper); background: var(--red); border: var(--line); box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 14px 1px; border-radius: 12px; white-space: nowrap;
  animation: stamp 900ms var(--ease-out) forwards;
}
@keyframes stamp {
  0% { transform: translate(-50%, -50%) scale(1.8) rotate(var(--r)); opacity: 0; }
  16% { transform: translate(-50%, -50%) scale(1) rotate(var(--r)); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(var(--r)); opacity: 0; }
}
.scene.shake { animation: shake 140ms; }
@keyframes shake { 50% { transform: translate(3px, 2px) rotate(0.4deg); } }

/* The button: a red sticker with a dark red side underneath. Only the face moves. */
.press { display: grid; place-items: center; padding: 28px 0 48px; position: relative; z-index: 2; }
.fire-well { position: relative; width: clamp(190px, 18vw, 250px); aspect-ratio: 1; }
.fire-well::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--red-side); border: 4px solid var(--ink); transform: translateY(12px);
}
.fire {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 4px solid var(--ink); padding: 0; background: var(--red); color: var(--paper);
  font-weight: 800; letter-spacing: 0.01em;
  transition: transform 90ms var(--ease-out);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.fire::after {
  /* A sticker shine on the face, drawn as a flat crescent rather than a gradient. */
  content: ""; position: absolute; left: 18%; top: 12%; width: 26%; height: 14%;
  border-radius: 50%; background: rgb(255 255 255 / 0.55); rotate: -30deg;
}
.fire .cap {
  font-size: clamp(2.25rem, 1.4rem + 2vw, 3rem); text-transform: uppercase;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.fire.down { transform: translateY(10px); }
.plus {
  position: fixed; z-index: 5; pointer-events: none;
  font-weight: 800; font-size: var(--step-head); color: var(--red);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  animation: rise 800ms var(--ease-out) forwards;
}
@keyframes rise { to { transform: translateY(-100px) rotate(var(--r, 8deg)); opacity: 0; } }

.verify { position: absolute; left: 20px; top: 20px; font-size: var(--step-small); font-weight: 700; z-index: 5; background: var(--paper); border: var(--line); border-radius: 14px; padding: 6px 12px; }

/* ---------- right now: three stickers slapped on at different angles ---------- */
.now {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  padding: clamp(88px, 10vw, 160px) var(--m) 0;
}
.now h2, .board h2, .history h2 { font-size: var(--step-head); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.now h2 { grid-column: 1 / -1; padding-bottom: 40px; }
.tiles { display: contents; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: 28px; border: var(--line); border-radius: 28px; box-shadow: var(--lift-big);
}
.tile strong { font-size: var(--step-head); font-weight: 800; line-height: 0.95; font-variant-numeric: tabular-nums; }
.tile span { font-size: var(--step-lead); font-weight: 700; line-height: 1.2; max-width: 18ch; }
.tile-a { grid-column: 1 / 6; min-height: 280px; background: var(--paper); rotate: -1.5deg; }
.tile-a strong { font-size: var(--step-display); }
.tile-b { grid-column: 6 / 9; min-height: 230px; background: var(--lime); rotate: 2deg; margin-top: 48px; }
.tile-c { grid-column: 9 / -1; min-height: 250px; background: var(--pink); rotate: -1deg; margin-top: 12px; }

/* ---------- boards: two white cards, rows with round bullets ---------- */
.boards {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
  padding: clamp(88px, 10vw, 160px) var(--m) 0; align-items: start;
}
.board {
  grid-column: 1 / 7; background: var(--paper); border: var(--line); border-radius: 28px; box-shadow: var(--lift-big);
  padding: 28px 28px 20px;
}
.board + .board { grid-column: 7 / -1; background: var(--sky); }
.board h2 { font-size: var(--step-lead); margin-bottom: 20px; line-height: 1.15; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; column-gap: 12px;
  min-height: 48px; font-size: var(--step-body); font-weight: 600;
}
.rows li + li { border-top: 2px dashed rgb(27 27 31 / 0.18); }
.rows .bullet {
  width: 32px; height: 32px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink);
  display: grid; place-items: center; font-size: var(--step-small); line-height: 1; overflow: hidden;
}
.rows li.mine {
  background: var(--ink); color: var(--paper); border-radius: 999px; border-top-color: transparent;
  padding: 0 16px 0 8px; margin: 4px -16px 4px -8px;
}
.rows li.mine + li { border-top-color: transparent; }
.rows .n { font-size: var(--step-small); font-variant-numeric: tabular-nums; font-weight: 800; }
.rows li.gap { min-height: 24px; color: var(--muted); display: block; padding-left: 44px; border-top: 0; }
.rows .empty { display: block; color: var(--muted); }
.board .link { margin-top: 8px; }

/* ---------- history: the pictures as photo prints taped on ---------- */
.history {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px;
  padding: clamp(88px, 10vw, 160px) var(--m) 0;
}
.history h2 { grid-column: 1 / -1; }
.history figure { margin: 0; }
.history img {
  display: block; width: 100%; height: auto; background: var(--paper);
  border: var(--line); border-radius: 18px; box-shadow: var(--lift-big);
}
.history figcaption { margin-top: 16px; max-width: 46ch; }
.history figcaption b { display: block; font-size: var(--step-lead); font-weight: 800; line-height: 1.1; }
.h-big { grid-column: 1 / 6; rotate: -1.5deg; }
.h-list { grid-column: 7 / -1; display: grid; gap: 40px; }
.h-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.h-item:nth-child(odd) img { rotate: 1.5deg; }
.h-item:nth-child(even) img { rotate: -1.5deg; }
.h-item figcaption { margin-top: 0; }
.h-item img { aspect-ratio: 4 / 3; object-fit: cover; }
.h-end { grid-column: 1 / -1; font-size: var(--step-lead); font-weight: 800; max-width: 30ch; }
.credits { margin-top: 32px; font-size: var(--step-small); max-width: 110ch; opacity: 0.8; }

/* ---------- footer: ink ground, the name in sun yellow next to a big red button ---------- */
.foot {
  margin-top: clamp(88px, 10vw, 160px);
  background: var(--ink); color: var(--paper);
  padding: 0 var(--m) 40px; overflow: hidden;
}
.foot-mark { --dot: min(42vw, 360px); position: relative; display: flex; align-items: center; min-height: calc(var(--dot) + 64px); padding: 32px 0; }
.big-dot {
  position: absolute; left: calc(var(--dot) * -0.4); top: 50%; translate: 0 -50%;
  width: var(--dot); aspect-ratio: 1; border-radius: 50%; background: var(--red);
  border: 6px solid var(--paper); box-shadow: 0 14px 0 var(--red-side);
}
.big-word {
  position: relative; margin-left: calc(var(--dot) * 0.6 + clamp(24px, 4vw, 64px)); color: var(--sun);
  font-size: var(--step-display); font-weight: 800; line-height: 0.9; letter-spacing: -0.02em;
}
.foot-text { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); font-size: var(--step-body); }
.foot-text p { max-width: 60ch; }
.foot-text a { font-weight: 800; color: var(--sun); }
.foot .credits a { color: var(--paper); }

/* ---------- sheets, toast, banner ---------- */
.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: 86svh; border: var(--line); border-radius: 28px; box-shadow: var(--lift-big);
  background: var(--paper); color: var(--ink); padding: 28px;
  transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out), display 240ms allow-discrete, overlay 240ms allow-discrete;
}
.sheet[open] { opacity: 1; transform: none; }
@starting-style { .sheet[open] { opacity: 0; transform: translateY(16px) scale(0.98); } }
.sheet::backdrop { background: rgb(27 27 31 / 0.55); }
.sheet h2 { font-size: var(--step-lead); font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.sheet p { margin-bottom: 12px; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn {
  background: var(--red); color: var(--paper); border: var(--line); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 22px 8px; font-weight: 800; min-height: 44px; transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.field input {
  width: 100%; background: var(--paper); border: var(--line); border-radius: 16px; padding: 12px 18px 10px;
  font-size: var(--step-lead); font-weight: 800; color: var(--ink);
}
.hint { font-size: var(--step-small); color: var(--muted); margin-top: 10px; }
.hint.bad { color: var(--red-side); font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.grid button { background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 14px 6px; text-align: left; min-height: 44px; font-weight: 600; }
.grid button.on { background: var(--ink); color: var(--paper); font-weight: 800; }
.qr { background: #fff; border: var(--line); border-radius: 20px; padding: 16px; width: min(280px, 100%); margin: 0 auto 16px; }
.qr svg { display: block; width: 100%; height: auto; }

.toast {
  /* Top of the screen: the button lives in the bottom half and must never be covered. */
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); z-index: 10;
  width: min(440px, calc(100vw - 32px)); translate: -50% 0;
  background: var(--paper); color: var(--ink); border: var(--line); border-radius: 22px; box-shadow: var(--lift);
  padding: 10px 10px 10px 20px;
  display: flex; align-items: center; gap: 12px; font-size: var(--step-body); font-weight: 700;
  transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(-16px); } }
.toast button { margin-left: auto; background: var(--red); color: var(--paper); border: var(--line); border-radius: 999px; padding: 8px 16px 6px; font-weight: 800; white-space: nowrap; }

.banner { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; pointer-events: none; padding: 16px; }
.banner div {
  background: var(--red); color: var(--paper); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  border-radius: 32px; padding: 28px 32px; text-align: center; rotate: -2deg;
  font-size: var(--step-lead); font-weight: 800; max-width: 640px;
  animation: pop 420ms var(--ease-out);
}
.banner strong { display: block; font-size: var(--step-display); line-height: 1; margin: 8px 0; color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.confetti { position: fixed; top: -14px; width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--ink); z-index: 21; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) translateX(var(--dx, 0)) rotate(540deg); } }

/* ---------- entrances (only when script runs, so nothing stays hidden without it) ---------- */
.js .rv { opacity: 0; transform: translateY(24px); }
.js .rv.in {
  opacity: 1; transform: none;
  transition: opacity 500ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
/* The stage drops in like a sticker being slapped on. */
.js .stage .scene { transform: translateY(-24px) rotate(-3deg) scale(1.04); opacity: 0; }
.js .stage.open .scene { transform: none; opacity: 1; transition: transform 600ms var(--ease-out), opacity 300ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .share:hover, .btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
  .mark:hover { rotate: 3deg; }
  .link:hover { text-decoration-thickness: 4px; }
  .fire:hover:not(.down) { transform: translateY(-3px); }
  .rows li:not(.mine):not(.gap):hover .bullet { transform: scale(1.12) rotate(-8deg); }
  .rows .bullet { transition: transform 160ms var(--ease-out); }
}

/* ---------- tablet and phone ---------- */
@media (max-width: 959px) {
  /* On a phone the button comes straight after the title, so it is on the first screen. */
  .hero { display: flex; flex-direction: column; }
  .stage { order: 2; min-height: 0; grid-template-rows: 284px auto; margin-top: 4px; }
  .hero-me { order: 3; padding: 4px 0 0; }
  .hero-copy { padding: 0 0 16px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: end; }
  h1 { grid-column: 1 / -1; font-size: clamp(2.75rem, 12vw, 4.5rem); }
  .lede { grid-column: 1; margin-top: 8px; font-size: 18px; line-height: 1.3; }
  .world { grid-column: 2; margin: 0; padding: 8px 14px 6px; font-size: 13px; line-height: 1.15; max-width: 13ch; border-radius: 16px; }
  .world strong { font-size: clamp(1.5rem, 7vw, 2.25rem); }
  .share { margin-top: 20px; }
  .scene { border-radius: 24px; box-shadow: var(--lift); }
  .press { padding: 18px 0 28px; }
  .robot { width: 132px; margin-left: -66px; bottom: 16%; }
  .hr { width: 88px; left: 3%; bottom: 16%; }
  .mate { width: 52px; bottom: 18%; }
  .tag { font-size: 10px; max-width: 76px; padding: 1px 6px 0; top: -16px; }
  .mate[data-high] .tag { top: -34px; }
  .tag.mine { font-size: 11px; max-width: 96px; top: -8px; }
  .combo { font-size: 18px; top: 30%; }
  .combo[data-tier="1"] { font-size: 22px; }
  .combo[data-tier="2"] { font-size: 26px; }
  .combo[data-tier="3"] { font-size: 30px; }
  .case { left: 10px; right: 10px; bottom: 9px; height: 30px; padding: 2px 12px 0; font-size: 13px; }
  .verdict { padding: 10px 16px 8px; font-size: 13px; }
  .bubble { top: 12px; font-size: 16px; }
  .window { top: 44%; width: 22%; }
  .door { width: 18%; height: 40%; }
  .fire-well { width: min(48vw, 196px); }

  .now, .boards { display: block; padding-top: 88px; }
  .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; }
  .tile-a { grid-column: 1 / -1; min-height: 0; margin: 0; }
  .tile-b, .tile-c { min-height: 0; margin: 0; }
  .tile-b { grid-column: 1; margin-top: 12px; }
  .tile-c { grid-column: 2; }
  .tile { padding: 20px; gap: 16px; }
  .tile span { font-size: var(--step-body); }
  .board { padding: 22px 20px 14px; }
  .board + .board { margin-top: 32px; }
  .history { display: block; padding-top: 88px; }
  .history h2 { margin-bottom: 28px; }
  .h-list { margin-top: 40px; }
  .h-item { grid-template-columns: 1fr; gap: 14px; }
  .h-end { margin-top: 40px; }
  .foot-text { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav { padding: 14px var(--m); }
  .mark { font-size: 16px; padding: 2px 10px 0; }
  .consent { margin-top: 10px; padding: 10px 12px; gap: 8px; font-size: 14px; }
  .consent .btn { min-height: 36px; padding: 4px 14px 2px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .stage .scene { opacity: 1; transform: none; transition: none; }
  .robot.fired, .robot.enter, .robot.hit, .robot.leave, .scene.shake, .confetti, .plus, .verdict, .mate, .combo.pop { animation-duration: 1ms; }
  .mate-body { animation: none; }
  .paper { display: none; }
  .door::before, .case-fill { transition: none; }
  .stamp { animation: fade 900ms forwards; transform: translate(-50%, -50%) rotate(var(--r)); }
  @keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
}
