/* Human Enough? — the warm 2D game show.
   Cream paper, ink outlines, and one job per colour:
   coral = you, pink = robots that predicted you, mint = robots you outsmarted, gold = jackpot only. */
/* Bricolage Grotesque (SIL Open Font License, fonts/OFL.txt), latin subset, hosted here so no player's
   browser calls a third party. Weights 500-800 and the optical-size axis are in the one variable file. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

:root {
  --paper: #FFF5E8;
  --paper-2: #F7E8D0;
  --card: #FFFDF8;
  --ink: #221E3D;
  --ink-2: #55507A;
  --ink-3: #7A7598;
  --you: #FF6A3D;
  --you-soft: #FFE0D2;
  --caught: #E5177B;
  --caught-dark: #A80E58;
  --mint: #7FDCC0;
  --mint-dark: #3DB493;
  --mint-ink: #136B56;
  --gold: #F7B500;
  --host: #6C4AD9;
  --night: #1B1730;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: "Bricolage Grotesque", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --line: 2.5px solid var(--ink);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--host); outline-offset: 2px; }

/* ------------------------------------------------------------------ shell */
.app {
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px))
           calc(12px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
  position: relative;
}

.topbar { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.015em; margin-right: auto; color: inherit; text-decoration: none; }
.brand-num { font-weight: 600; color: var(--ink-2); }
.streak {
  font-size: 13px; font-weight: 700; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 99px; background: var(--card);
}
.icon-btn {
  width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  border: var(--line); border-radius: 12px; background: var(--card);
  transition: transform 120ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg path:first-child { fill: var(--ink); }
.icon-btn .mute { display: none; }
.icon-btn[aria-pressed="false"] .wave { display: none; }
.icon-btn[aria-pressed="false"] .mute { display: block; }

/* ------------------------------------------------------------------ progress: stamped cards, the tally, the humanity meter */
.progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
}
/* The results strip reads as a small bar chart, not as letter tiles: thin bars standing on one shared baseline,
   numbered underneath, each filled to that prompt's points. */
.pcards {
  --bar-h: 30px;
  display: flex; align-items: flex-start;
  /* the baseline every bar stands on */
  background: linear-gradient(var(--ink), var(--ink)) 0 var(--bar-h) / 100% 2px no-repeat;
}
.pcard { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; row-gap: 4px; }
.pbar {
  position: relative; overflow: hidden;
  width: min(100%, 20px); height: var(--bar-h);
  border-radius: 6px 6px 0 0; background: var(--paper-2);
}
.pbar i {
  position: absolute; inset: 0; background: var(--mint);
  transform-origin: 50% 100%; transform: scaleY(0);
}
.pnum { font-size: 12px; font-weight: 700; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* the outline sits above the fill, so a full bar keeps its ink edge */
.pbar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--outline, transparent); }
.pcard.is-done .pbar { --outline: var(--ink); background: var(--card); }
.pcard.is-done .pnum { color: var(--ink-2); }
.pcard.is-jackpot .pbar i { background: var(--gold); }
.pcard.is-current .pbar { --outline: var(--you); background: var(--you-soft); }
.pcard.is-current .pnum { color: #C93F17; font-weight: 800; }
/* the bar just earned grows up from the baseline */
.pcard.is-pop .pbar i { animation: bar-grow 560ms var(--ease-out) 80ms both; }
@keyframes bar-grow { from { transform: scaleY(0); } }

.tally { display: flex; align-items: center; gap: 6px; }
.tally-num { font-weight: 800; font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.tally-of { font-size: 11.5px; font-weight: 600; line-height: 1.1; color: var(--ink-2); }

.meter {
  height: 11px; border: 2px solid var(--ink); border-radius: 99px; background: var(--card); overflow: hidden;
}
.meter i { display: block; height: 100%; width: 100%; background: var(--you); transform-origin: left; transform: scaleX(0); transition: transform 500ms var(--ease-out); }
.meter-label { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Dot, the host */
.hostrow { display: flex; align-items: flex-end; gap: 12px; }
.host { flex: none; width: 76px; }
.host svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 96%; transition: transform 320ms var(--ease-pop); }
.host .h-head { transform-origin: 60px 112px; transition: transform 320ms var(--ease-pop); animation: host-bob 4.2s ease-in-out infinite; }
.host .h-sparks { display: none; }
@keyframes host-bob { 50% { transform: translateY(1.6px); } }
.host[data-mood="typing"] .h-head { transform: rotate(3deg); animation: none; }
.host[data-mood="scanning"] .dots circle { animation: dot-wait 700ms ease-in-out infinite; }
.host[data-mood="scanning"] .dots circle:nth-child(2) { animation-delay: 120ms; }
.host[data-mood="scanning"] .dots circle:nth-child(3) { animation-delay: 240ms; }
@keyframes dot-wait { 50% { opacity: 0.25; } }
.host[data-mood="smug"] .h-head { transform: rotate(-5deg); animation: none; }
.host[data-mood="shocked"] svg { transform: scale(1.06) translateY(-3px); }
.host[data-mood="shocked"] .h-head { animation: none; }
.host[data-mood="puzzled"] .h-head { transform: rotate(9deg); animation: none; }
.host[data-mood="sulking"] svg { transform: scale(0.96, 0.93); }
.host[data-mood="sulking"] .h-head { transform: rotate(-4deg) translateY(3px); animation: none; }
.host[data-mood="proud"] .h-head { animation: host-proud 900ms ease-in-out infinite; }
@keyframes host-proud { 50% { transform: translateY(-4px) rotate(2deg); } }
.host[data-mood="short"] .h-head { animation: host-short 260ms steps(3) infinite; }
.host[data-mood="short"] .h-sparks { display: block; animation: dot-wait 300ms steps(2) infinite; }
@keyframes host-short { 33% { transform: translate(-1.5px, 1px) rotate(-3deg); } 66% { transform: translate(1.5px, -1px) rotate(3deg); } }

.bubble {
  flex: 1; min-width: 0;
  background: var(--card); border: var(--line); border-radius: 18px;
  padding: 11px 14px 12px; position: relative;
  box-shadow: 0 4px 0 var(--ink);
  margin-bottom: 8px;
}
.bubble::before { /* the tail, pointing at Dot */
  content: ""; position: absolute; left: -9px; bottom: 16px; width: 15px; height: 15px;
  background: var(--card); border-left: var(--line); border-bottom: var(--line); transform: rotate(45deg); border-radius: 0 0 0 4px;
}
.prompt { font-weight: 800; font-size: 25px; line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.quip { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-top: 5px; text-wrap: pretty; }
.quip:empty { display: none; }
.you-chip {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  margin-top: 7px; padding: 3px 11px 4px; border: 2px solid var(--ink); border-radius: 99px;
  background: var(--you); font-size: 15px; font-weight: 600;
  transition: transform 300ms var(--ease-pop);
}
.you-chip b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap-out { opacity: 0; filter: blur(2px); transition: opacity 130ms ease, filter 130ms ease; }
.swap-in { animation: swap-in 200ms var(--ease-out); }
@keyframes swap-in { from { opacity: 0; filter: blur(2px); } }

[data-screen="result"] .prompt, [data-screen="reveal"] .prompt { font-size: 17px; color: var(--ink-2); font-weight: 700; }
[data-screen="report"] .prompt, [data-screen="stunt"] .prompt { font-size: 21px; }

/* ------------------------------------------------------------------ the studio audience */
.stage { flex: 1 1 0; min-height: 0; container-type: size; display: grid; place-items: center; position: relative; }
.audience {
  width: min(100cqw, 100cqh * 0.8); aspect-ratio: 4 / 5;
  --cols: 10; --rows: 10;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  position: relative;
  /* benches: a soft band per row, so 100 robots read as seated rows rather than a grid of icons */
  background: repeating-linear-gradient(to bottom, transparent 0 7.6%, var(--paper-2) 7.6% 10%);
  border-radius: 10px;
}
.bot { position: relative; min-width: 0; min-height: 0; perspective: 240px; }
.bot[data-c="lilac"] { --b: #C9BDEC; --d: #9C8BD3; }
.bot[data-c="stone"] { --b: #D5CCBF; --d: #A69B8B; }
.bot[data-c="sage"] { --b: #BDD1B0; --d: #8BA67B; }
.bot[data-c="butter"] { --b: #F3E0A0; --d: #D2B75A; }
.bot-in { position: absolute; inset: 0; }
.bot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 90%; transition: transform 260ms var(--ease-out), opacity 260ms ease; }
.bot .e-rest { transform: translateX(calc(var(--look, 0) * 1.3px)); transition: transform 160ms var(--ease-out); }
.bot.blink .e-rest { transform: scaleY(0.12); transform-box: fill-box; transform-origin: center; transition: none; }
.bot .e-yes, .bot .e-no, .bot .m-yes, .bot .m-no { display: none; }
/* At rest the audience sits back: faded, no stickers. A robot comes to full strength when it gets a verdict. */
.bot svg { opacity: 0.62; }
.bot .x-st { display: none; }
.bot.is-caught svg, .bot.is-out svg, .bot.is-fried svg, .bot.is-almost svg, .bot.is-card svg { opacity: 1; }
.bot.is-caught .x-st, .bot.is-out .x-st, .bot.is-fried .x-st { display: inline; }

.bot.is-caught { --b: var(--caught); --d: var(--caught-dark); z-index: 1; }
.bot.is-caught .e-rest, .bot.is-caught .m-rest { display: none; }
.bot.is-caught .e-yes, .bot.is-caught .m-yes { display: inline; }
.bot.is-caught svg { transform: translateY(-4%) scale(1.07); animation: bot-stand 420ms var(--ease-pop); }
@keyframes bot-stand { 0% { transform: scale(0.9); } 55% { transform: translateY(-14%) scale(1.12); } }

.bot.is-out, .bot.is-fried { --b: var(--mint); --d: var(--mint-dark); }
.bot.is-out .e-rest, .bot.is-out .m-rest, .bot.is-fried .e-rest, .bot.is-fried .m-rest { display: none; }
.bot.is-out .e-no, .bot.is-out .m-no, .bot.is-fried .e-no, .bot.is-fried .m-no { display: inline; }
.bot.is-out svg { transform: translateY(3%) rotate(var(--tilt)); animation: bot-glitch 300ms steps(4, end); }
@keyframes bot-glitch { 0% { transform: translate(-7%, 0) skewX(9deg); } 50% { transform: translate(6%, -3%) skewX(-8deg); } 100% { transform: translate(-3%, 2%); } }
.bot.is-fried svg { transform: translateY(5%) rotate(calc(var(--tilt) * 2)); }
.bot.is-fried::after { /* one gold spark each */
  content: ""; position: absolute; left: 52%; top: -8%; width: 36%; aspect-ratio: 3 / 4; background: var(--gold);
  clip-path: polygon(45% 0, 100% 0, 62% 40%, 95% 40%, 20% 100%, 42% 55%, 8% 55%);
  animation: bot-zap 520ms steps(3, end) 3 both;
}
@keyframes bot-zap { 0% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; transform: scale(1.1) rotate(8deg); } 100% { opacity: 0; transform: scale(0.9); } }

.bot.is-almost::before { /* the ten that nearly had it */
  content: ""; position: absolute; inset: 4% 2% 0; border: 2px dashed var(--ink); border-radius: 30%; opacity: 0.55;
}
.bot.is-almost svg { animation: bot-nod 900ms ease-in-out 2; }
@keyframes bot-nod { 50% { transform: translateY(-7%); } }

.placard { display: none; }
.bot.is-card .placard {
  display: block; position: absolute; inset: 4% 3% 16%; background: var(--you); border: 2px solid var(--ink); border-radius: 22%;
  box-shadow: 0 2px 0 var(--ink);
}
.bot.is-dim svg { opacity: 0.4; }
.audience.is-stunt { background: none; }

/* ------------------------------------------------------------------ panels (one per screen) */
.panel, .report { display: none; }
[data-screen="intro"] .panel-intro,
[data-screen="answer"] .panel-answer,
[data-screen="reveal"] .panel-result,
[data-screen="result"] .panel-result,
[data-screen="stunt"] .panel-stunt { display: block; }
/* The running total and the humanity meter belong to the end of the day; a round shows one count and one reward. */
.tally, .meter, .meter-label { display: none; }
[data-screen="stunt"] .tally { display: flex; }
[data-screen="stunt"] .meter { display: block; }
[data-screen="stunt"] .meter-label { display: inline; }

.btn {
  display: block; width: 100%;
  padding: 13px 18px 14px; border: var(--line); border-radius: 16px;
  background: var(--you); color: var(--ink);
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; }
.btn-quiet { background: var(--card); }

.howto { display: grid; gap: 5px; margin-bottom: 14px; font-size: 16px; font-weight: 500; }
.howto li { padding-left: 20px; position: relative; }
.howto li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 9px; height: 9px; border-radius: 3px; background: var(--ink); }
.howto b { font-weight: 800; }
/* Intro: the promise and the rules come first, the audience sits under them as a backdrop, the button last
   (phone and laptop alike). */
[data-screen="intro"] .panel-intro { display: contents; }
[data-screen="intro"] .howto { order: 1; }
[data-screen="intro"] .stage { order: 2; }
[data-screen="intro"] #start-btn { order: 3; }
@media (max-width: 899px) {
  [data-screen="intro"] .prompt { font-size: 31px; }
  [data-screen="intro"] .quip { font-size: 16px; }
  [data-screen="intro"] .howto { font-size: 17.5px; gap: 8px; margin: 6px 0 0; }
}

.answer-row { display: flex; align-items: center; gap: 8px; }
.answer-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 14px;
  border: var(--line); border-radius: 16px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 19px; font-weight: 700; caret-color: var(--you);
  box-shadow: inset 0 -4px 0 var(--you-soft);
}
.answer-row input::placeholder { color: var(--ink-3); font-weight: 500; }
.answer-row input:focus { outline: none; box-shadow: inset 0 -4px 0 var(--you); }
.answer-row input:focus-visible { outline: none; }
.answer-row input:disabled { opacity: 0.6; }
.btn-go { width: auto; height: 48px; padding: 0 20px; align-self: flex-start; }
.is-shake { animation: shake 320ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }
.hint { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 6px; min-height: 1.3em; }


/* reveal + result: the points are the one number the round is about (playtest, 2026-11-29); the robot count
   beside them is the explanation, set clearly smaller */
.score { display: flex; align-items: center; gap: 18px; min-height: 104px; }
.count { display: flex; align-items: center; gap: 7px; min-width: 0; }
.count-num {
  font-weight: 800; font-size: 40px; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  color: var(--caught); min-width: 1.1ch; text-align: right;
}
.count-label { font-size: 14px; font-weight: 700; line-height: 1.15; color: var(--ink-2); white-space: nowrap; }
.count-num.is-land { animation: land 360ms var(--ease-pop); }
@keyframes land { from { transform: scale(1.25); } }
.gain {
  flex: none; display: grid; justify-items: center; gap: 2px; padding: 8px 18px 10px; min-width: 132px;
  background: var(--mint); border: var(--line); border-radius: 20px; box-shadow: 0 4px 0 var(--ink);
  transform: rotate(-2deg); visibility: hidden;
}
.gain-num { font-weight: 800; font-size: 62px; line-height: 0.9; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.gain-label { font-size: 15px; font-weight: 800; }
.note { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-2); margin-top: 10px; text-wrap: pretty; visibility: hidden; }
.panel-result.is-landed .note { visibility: visible; }
.panel-result .btn { margin-top: 12px; visibility: hidden; }
.panel-result.is-landed .gain { visibility: visible; animation: gain-in 380ms var(--ease-pop) both; }
.panel-result.is-landed .btn { visibility: visible; }
@keyframes gain-in { from { transform: scale(1.4) rotate(-10deg); opacity: 0; } }
.panel-result[data-kind="jackpot"] .count-num { color: var(--ink); }
.panel-result[data-kind="jackpot"] .gain { background: var(--gold); }
.panel-result[data-kind="timeout"] .count-num { line-height: 1; }
.panel-result[data-kind="timeout"] .gain { background: var(--card); }

/* jackpot: the lights go down, a spot lands on your answer */
.dim {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 320ms ease;
  --sx: 50%; --sy: 30%; --sr: 70px;
  background: radial-gradient(circle at var(--sx) var(--sy), rgba(27, 23, 48, 0) 0, rgba(27, 23, 48, 0) var(--sr), rgba(27, 23, 48, 0.88) calc(var(--sr) + 34px));
}
.dim .cone {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255, 232, 160, 0.02), rgba(255, 232, 160, 0.2));
  clip-path: polygon(calc(var(--sx) - 26px) 0, calc(var(--sx) + 26px) 0, calc(var(--sx) + var(--sr)) var(--sy), calc(var(--sx) - var(--sr)) var(--sy));
}
.app.is-blackout .dim { opacity: 1; }
.app.is-blackout .stage { z-index: 6; }
.app.is-blackout .audience { background: none; }
.app.is-blackout .you-chip { transform: scale(1.12); }
.app.is-halfdim .dim { opacity: 0.45; }
/* The reward for a very high score: Dot circles the points like a mark on a test paper (85 and up). */
.gain { position: relative; }
.gain .ring {
  position: absolute; left: -11px; top: -12px; width: calc(100% + 22px); height: calc(100% + 24px);
  overflow: visible; fill: none; stroke: var(--you); stroke-width: 3.2; stroke-linecap: round; pointer-events: none;
  display: none;
}
.gain .ring path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.panel-result.is-landed[data-reward] .ring { display: block; }
/* drawn once the +points chip has stamped in, with a pen's ease: quick start, careful finish */
.panel-result.is-landed[data-reward] .ring path { animation: ring-draw 620ms var(--ease-out) 300ms both; }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
.panel-result[data-reward="jackpot"] .ring { stroke: var(--ink); }

/* The jackpot: Dot's "Certified human" seal, pressed onto your answer while the spot is on it, and it stays. */
.you-chip { position: relative; }
.you-chip > span { white-space: nowrap; }
/* it hangs off the end of the chip like a stamp half on the page, so it never squeezes the answer */
.seal { display: none; position: absolute; right: -26px; top: calc(50% - 32px); width: 64px; height: 64px; transform: rotate(-9deg); pointer-events: none; }
.you-chip.is-certified { padding-right: 42px; }
.you-chip.is-certified .seal { display: block; }
.seal svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 0 var(--ink)); }
.seal-edge { fill: var(--gold); stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
.seal-ring { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 3 3.4; }
.seal text { font-family: var(--font); fill: var(--ink); text-anchor: middle; }
.seal-small { font-size: 13.5px; font-weight: 700; }
.seal-big { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

/* the house lights come back up warm: one slow swell from the seal, then gone */
.glow {
  position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  --sx: 50%; --sy: 30%;
  background: radial-gradient(circle at var(--sx) var(--sy), rgba(255, 214, 102, 0.42) 0, rgba(255, 226, 150, 0.2) 22%, rgba(255, 240, 200, 0) 58%);
}

/* end of day: the card stunt */
.panel-stunt { text-align: center; }
.stunt-score { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.stunt-pct, .stunt-sign { font-weight: 800; font-size: 84px; line-height: 0.9; letter-spacing: -0.05em; color: var(--you); font-variant-numeric: tabular-nums; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.stunt-sign { font-size: 52px; }
.stunt-human { font-weight: 800; font-size: 30px; margin-left: 8px; letter-spacing: -0.02em; }
.rank {
  display: inline-block; padding: 3px 12px 4px; border: 3px solid var(--you); border-radius: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.01em; color: #C93F17; transform: rotate(-3deg); background: var(--card);
}
.panel-stunt .rank { margin: 8px 0 14px; }
.rank.is-stamped { animation: gain-in 420ms var(--ease-pop) both; }

/* end of day: the verified-human slip */
[data-screen="report"] { height: auto; min-height: 100dvh; }
[data-screen="report"] .stage, [data-screen="report"] .progress { display: none; }
[data-screen="report"] .report { display: block; padding-bottom: 12px; }
.slip {
  --teeth: 9px;
  background: var(--card); color: var(--ink);
  padding: 22px 18px 24px; margin: 4px 2px 20px;
  filter: drop-shadow(0 5px 0 rgba(34, 30, 61, 0.16));
  transform: rotate(-0.7deg);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(2 * var(--teeth)) 51% repeat-x,
                conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / calc(2 * var(--teeth)) 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(2 * var(--teeth)) 51% repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / calc(2 * var(--teeth)) 51% repeat-x;
}
.slip-head { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; color: var(--ink-2); border-bottom: 2px dashed var(--ink-3); padding-bottom: 8px; }
.verify { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.verify h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.box { flex: none; width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 8px; position: relative; }
.box svg { position: absolute; left: -2px; top: -12px; width: 46px; height: 46px; fill: none; stroke: var(--you); stroke-width: 6.500; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.box.is-checked svg { stroke-dashoffset: 0; transition: stroke-dashoffset 380ms var(--ease-out); }
.slip-score { display: flex; align-items: flex-end; gap: 2px; margin-top: 10px; }
.slip-pct, .slip-sign { font-weight: 800; font-size: 104px; line-height: 0.84; letter-spacing: -0.055em; color: var(--you); font-variant-numeric: tabular-nums; -webkit-text-stroke: 2.500px var(--ink); paint-order: stroke fill; }
.slip-sign { font-size: 60px; line-height: 1; }
.slip-side { display: grid; justify-items: start; gap: 4px; margin-left: 10px; padding-bottom: 4px; }
.slip-human { font-weight: 800; font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.meter-big { height: 14px; margin-top: 14px; }
.slip-sub { font-size: 15.5px; font-weight: 600; color: var(--ink-2); margin-top: 9px; }
.slip-rows { margin-top: 14px; border-top: 2px dashed var(--ink-3); }
.slip-rows li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px dashed var(--ink-3); }
.slip-rows .e { font-size: 21px; text-align: center; }
.slip-rows .p { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.2; }
.slip-rows .a { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.slip-rows .s { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.slip-rows .s small { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.slip-total { margin-top: 12px; font-size: 16px; font-weight: 600; }
.slip-total b { font-weight: 800; font-size: 21px; }
#slip-streak { float: right; font-size: 13.5px; font-weight: 700; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 99px; }
#slip-streak:empty { display: none; }
.slip-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sig svg { display: block; width: 104px; height: 52px; fill: none; stroke: var(--host); stroke-width: 2.600; stroke-linecap: round; stroke-linejoin: round; }
.sig span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-top: 2px solid var(--ink); padding-top: 4px; }
.sig-host { width: 58px; flex: none; transform: rotate(5deg); }
.sig-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.sig-host .h-sparks { display: none; }

.actions { display: grid; gap: 12px; }
/* straight to a chat app: plain pills, no brand logos; the app's name is the label */
.share-to { margin-top: 16px; text-align: center; }
.share-to-title { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.share-app {
  display: inline-block; padding: 8px 14px 9px; border: 2px solid var(--ink); border-radius: 99px;
  background: var(--card); color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none;
  box-shadow: 0 2px 0 var(--ink); transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.share-app:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.share-whatsapp { background: #CFF3DC; }

/* today's board: a scoreboard card under the share buttons */
.board {
  margin-top: 22px; padding: 16px 16px 14px; background: var(--card); border: var(--line); border-radius: 20px;
  box-shadow: 0 4px 0 var(--ink);
}
.board-title { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.board-better { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--mint-ink); }
.board-better:empty { display: none; }
.board-list { margin-top: 10px; border-top: 2px dashed var(--ink-3); }
.board-list li {
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: baseline; gap: 8px;
  padding: 7px 4px; border-bottom: 2px dashed var(--ink-3); font-variant-numeric: tabular-nums;
}
.b-rank { font-weight: 800; color: var(--ink-3); }
.b-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-pts { font-weight: 800; }
.board-list li.is-me { background: var(--you-soft); border-radius: 10px; }
.board-list li.is-me .b-rank { color: #C93F17; }
.board-list .b-gap, .board-list .b-empty { display: block; color: var(--ink-2); font-weight: 600; text-align: center; }
.board-more { display: block; margin: 4px auto 0; }
.board-join-btn { margin-top: 12px; font-size: 17px; padding: 11px 16px 12px; }

/* ------------------------------------------------------------------ the account menu (top right)
   A round letter button; it opens an account card laid out like a familiar account switcher: where you're
   signed in, a big letter, a greeting, the name button, then the sign-in or sign-out row. */
.account { position: relative; }
.avatar-btn, .acct-big {
  display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; line-height: 1;
  border: 2px solid var(--ink); text-transform: uppercase;
}
.avatar-btn { width: 36px; height: 36px; padding: 0; font-size: 17px; box-shadow: 0 2px 0 var(--ink); }
.avatar-btn.is-empty, .acct-big.is-empty { color: var(--ink); }
.avatar-btn svg, .acct-big svg { width: 62%; height: 62%; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.avatar-btn[aria-expanded="true"] { outline: 3px solid var(--you-soft); outline-offset: 2px; }
.acct-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: min(360px, calc(100vw - 24px));
  display: grid; justify-items: center; gap: 10px; padding: 18px 18px 14px;
  background: var(--card); border: var(--line); border-radius: 28px; box-shadow: 0 6px 0 var(--ink);
  transform-origin: top right; animation: acct-in 180ms var(--ease-out);
}
@keyframes acct-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }
.acct-x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; }
.acct-x svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; }
.acct-where { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.acct-big { width: 76px; height: 76px; font-size: 34px; border-width: 2.5px; margin-top: 2px; }
.acct-hi { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-align: center; overflow-wrap: anywhere; }
.acct-name {
  padding: 8px 20px 9px; border: 2px solid var(--ink); border-radius: 99px; background: var(--card);
  font-weight: 800; font-size: 15px; color: var(--host);
}
.acct-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 4px;
  padding: 11px 16px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; color: var(--ink);
  font-weight: 800; font-size: 15.5px; text-decoration: none; box-shadow: 0 2px 0 var(--ink);
}
.acct-google svg { width: 20px; height: 20px; }
.acct-note { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.35; }
.acct-row { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; }
.acct-row:not(:has(button:not([hidden]))) { display: none; }
.acct-row button { padding: 11px 8px; border: 0; background: var(--paper); font-weight: 700; font-size: 14.5px; }
.acct-row button + button { border-left: 2px solid var(--ink); }
.acct-foot { font-size: 13px; font-weight: 600; }
.acct-foot a { color: var(--ink-2); text-underline-offset: 3px; }

/* the nickname dialog */
.name-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(27, 23, 48, 0.55); }
.name-dlg {
  width: min(420px, 100%); display: grid; gap: 10px; padding: 22px 20px 14px;
  background: var(--paper); border: var(--line); border-radius: 24px; box-shadow: 0 6px 0 var(--ink);
  animation: acct-in 220ms var(--ease-out);
}
.name-dlg h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.name-sub { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.name-dlg input {
  height: 52px; padding: 0 14px; border: var(--line); border-radius: 16px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 19px; font-weight: 700; box-shadow: inset 0 -4px 0 var(--you-soft);
}
.name-dlg input:focus { outline: none; box-shadow: inset 0 -4px 0 var(--you); }
.name-msg { font-size: 14px; font-weight: 700; color: var(--caught-dark); }
.name-msg:empty { display: none; }
.name-skip { justify-self: center; }
.rep-next { text-align: center; font-size: 15px; font-weight: 600; color: var(--ink-2); margin-top: 16px; font-variant-numeric: tabular-nums; }
.rep-next span { color: var(--ink); font-weight: 800; }
.rep-links { text-align: center; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 8px 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* the image-card sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(27, 23, 48, 0.55); display: grid; align-items: end; justify-items: center; }
.sheet {
  width: min(100%, 520px); max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border: var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  animation: sheet-in 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.seg { display: grid; grid-template-columns: 1fr 1fr; margin: 12px 0; border: var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 9px; font-weight: 700; font-size: 15px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.card-preview { display: grid; place-items: center; margin-bottom: 14px; }
.card-preview canvas, .card-preview img { display: block; max-width: 100%; max-height: 46dvh; width: auto; height: auto; border: var(--line); border-radius: 14px; }
.card-preview img { -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; }
.card-hint { text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-2); margin: -4px 0 12px; }
.share-box { width: 100%; margin-top: 12px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--card); border: var(--line); border-radius: 12px; resize: none; user-select: text; -webkit-user-select: text; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 12px;
  transition: transform 300ms var(--ease-out), opacity 200ms ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.flyer {
  position: fixed; left: 0; top: 0; z-index: 9; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 99px;
  background: var(--you); font-weight: 800; font-size: 17px; pointer-events: none; white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ pointer-only hover */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
  .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
  .icon-btn:hover { background: var(--paper-2); }
  .link-btn:hover { color: var(--ink); }
  .seg button:hover:not([aria-pressed="true"]) { background: var(--paper-2); }
}

/* ------------------------------------------------------------------ short screens (phone keyboard open) */
@media (max-height: 560px) {
  .app { gap: 6px; }
  .host { width: 54px; }
  .prompt { font-size: 21px; }
  .progress { row-gap: 3px; }
  .pcards { --bar-h: 18px; }
  .pnum { font-size: 10.5px; }
  .tally-num { font-size: 24px; }
  .meter, .meter-label { display: none; }
  .hint { min-height: 0; margin-top: 3px; }
  .hint:empty { display: none; }
}

/* ------------------------------------------------------------------ desktop: host and controls left, audience right */
/* A laptop keeps the phone's order (owner's call, 2026-11-30): Dot and the prompt on top, the audience in the
   middle, your answer at the bottom. What changes is the audience: the same 100 robots sit as a wide arena,
   20 seats by 5 tiers, the benches curving up at the ends, so the crowd fills the screen instead of a column. */
@media (min-width: 900px) and (min-height: 600px) {
  .app { max-width: 1280px; gap: clamp(10px, 1.6vh, 16px); padding: 16px clamp(28px, 3.4vw, 56px) 24px; }
  .topbar { min-height: 48px; padding-bottom: 12px; border-bottom: 2px dashed var(--ink-3); }
  .brand { font-size: 22px; }
  .icon-btn { width: 42px; height: 42px; }
  .avatar-btn { width: 42px; height: 42px; font-size: 19px; }
  .streak { font-size: 14px; padding: 4px 11px; }
  .progress { width: min(100%, 620px); margin: 0 auto; }
  .hostrow { width: min(100%, 900px); margin: 0 auto; gap: 18px; }
  .panel { width: min(100%, 680px); margin: 0 auto; }
  .stage { padding-top: 4px; }
  /* the arena floor: a soft pool of light under the tiers */
  .stage::before {
    content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 46%; pointer-events: none;
    background: radial-gradient(ellipse 50% 70% at 50% 100%, var(--paper-2), rgba(247, 232, 208, 0) 72%);
  }

  .host { width: clamp(96px, 8vw, 124px); }
  .bubble { padding: 14px 20px 16px; border-radius: 22px; }
  .prompt { font-size: clamp(32px, 2.8vw, 44px); }
  .quip { font-size: clamp(16.5px, 1.25vw, 18.5px); margin-top: 6px; }
  .you-chip { font-size: 17px; }
  [data-screen="result"] .prompt, [data-screen="reveal"] .prompt { font-size: clamp(20px, 1.6vw, 24px); }
  [data-screen="stunt"] .prompt { font-size: clamp(26px, 2.2vw, 32px); }
  [data-screen="intro"] .prompt { font-size: clamp(36px, 3.2vw, 48px); }
  [data-screen="intro"] .howto { font-size: clamp(17px, 1.3vw, 19.5px); gap: 8px; width: min(100%, 680px); margin: 2px auto 0; }
  [data-screen="intro"] #start-btn { width: min(100%, 680px); margin: 0 auto; }
  .btn { font-size: 20px; padding: 15px 22px 16px; border-radius: 18px; }
  .answer-row input { height: 60px; font-size: 22px; border-radius: 18px; padding: 0 18px; }
  .btn-go { height: 56px; padding: 0 28px; }
  .hint { font-size: 15px; }
  .score { justify-content: center; min-height: 120px; gap: 26px; }
  .gain { min-width: 160px; }
  .gain-num { font-size: clamp(68px, 5.4vw, 84px); }
  .count-num { font-size: clamp(44px, 3.4vw, 54px); }
  .count-label { font-size: 16px; }
  .note { font-size: 15.5px; text-align: center; }
  .pcards { --bar-h: clamp(30px, 4.4vh, 44px); }
  .pbar { width: min(100%, 28px); }
  .pnum { font-size: 13.5px; }
  .tally-num { font-size: 36px; }
  .panel-stunt .rank { margin: 6px 0 10px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-bottom: var(--line); border-radius: 22px; }

  /* the end of the day: Dot and what to do next on the left, the printed slip on the right */
  .app[data-screen="report"] {
    display: grid; max-width: 1180px; column-gap: clamp(32px, 4vw, 72px); row-gap: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "top top" "host slip" "side slip";
    align-content: start;
  }
  [data-screen="report"] .topbar { grid-area: top; margin-bottom: 28px; }
  [data-screen="report"] .hostrow { grid-area: host; width: auto; margin: 0; align-self: end; }
  [data-screen="report"] .report { display: contents; }
  [data-screen="report"] .slip { grid-area: slip; margin: 0 0 28px; }
  [data-screen="report"] .report-side { grid-area: side; margin-top: 28px; }
  [data-screen="report"] .prompt { font-size: clamp(30px, 2.6vw, 40px); }
  [data-screen="report"] .rep-next { font-size: 17px; }
  [data-screen="report"] .share-to, [data-screen="report"] .rep-next, [data-screen="report"] .rep-links { text-align: left; }
  [data-screen="report"] .share-row { justify-content: flex-start; }
  .share-app { font-size: 16px; padding: 9px 16px 10px; }
}
@media (min-width: 900px) and (min-height: 600px) and (hover: hover) and (pointer: fine) {
  .share-app:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--ink); }
}

/* the arena seating (set by Audience.setShape): wide, curved benches, back tiers a touch smaller */
.audience.is-arena {
  width: min(100cqw, 100cqh * 2.8); aspect-ratio: 2.8 / 1; background: none; border-radius: 0; margin-top: 3%;
}
.audience.is-arena .bot {
  translate: 0 calc(var(--u2, 0) * -72%);
  scale: calc(0.8 + 0.2 * var(--rr, 1));
  background: linear-gradient(transparent 80%, var(--paper-2) 80% 94%, transparent 94%);
}
.audience.is-arena.is-stunt .bot { background: none; }

/* ------------------------------------------------------------------ reduced motion: collapse the choreography, keep the states */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .host .h-head { animation: none !important; }
  .bot.is-fried::after { display: none; }
  .gain .ring path { animation: none !important; stroke-dashoffset: 0; }
}

/* the "where you stand" chart on the board card */
.spread { margin: 12px 0 4px; }
.spread svg { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; overflow: visible; }
.spread-bar { fill: var(--mint); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.spread-bar.is-me { fill: var(--you); }
.spread-base { stroke: var(--ink); stroke-width: 2; }
.spread-hit { fill: transparent; cursor: pointer; outline: none; }
.spread-hit:focus-visible { fill: rgba(108, 74, 217, 0.12); }
.spread-you { font: 800 12.5px var(--font); fill: var(--ink); text-anchor: middle; }
.spread-you-tip { fill: var(--ink); }
.spread-axis { font: 700 11px var(--font); fill: var(--ink-3); }
.spread-cap { margin-top: 6px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
