/* Quick quiz on the phones and the TV (web/games/quiz.js). The question sits on a paper card on the phones and big
   on the TV; the four answers are lettered tiles, A to D, in the same order everywhere. In the reveal the critters
   land on the answer they chose, the right tile lights up in the accent and the wrong ones go hollow. */

/* The phones. */
.page .qz-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.page .qz-line .timer { font-size: 14px; }
.qz-double {
  padding: 5px 12px; border-radius: 9999px; background: var(--accent); color: var(--accent-text);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.qz-card {
  padding: 16px 18px 20px; border-radius: var(--radius-tile); background: var(--paper); color: var(--background);
  display: flex; flex-direction: column; gap: 6px;
}
.qz-card .meta { color: var(--paper-muted); }
.qz-q { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: break-word; text-wrap: pretty; }
.qz-card.mini { padding: 12px 16px 14px; gap: 4px; }
.qz-card.mini .qz-q { font-size: 17px; }

/* The letters, A to D, the same on the phones and the TV. */
.qz-letter {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--background); font-family: var(--mono); font-size: 15px; font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.qz-letter svg { width: 18px; height: 18px; }

.qz-answers { display: flex; flex-direction: column; gap: 10px; }
.qz-ans {
  width: 100%; min-height: 62px; padding: 10px 12px 10px 10px; border-radius: var(--radius-card);
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit;
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.4, 1), background-color 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
}
.qz-ans:active:not(:disabled) { transform: scale(0.97); transition-duration: 0.08s; transition-timing-function: ease-out; }
.qz-ans:disabled { cursor: default; opacity: 0.38; }
.qz-ans.picked, .qz-ans.picked:disabled { opacity: 1; border-color: var(--accent); background: var(--accent-soft-bg); }
.qz-ans.picked .qz-letter { background: var(--accent); color: var(--accent-text); }
.qz-ans-text { flex: 1; min-width: 0; font-size: 18px; line-height: 1.2; font-weight: 700; overflow-wrap: break-word; hyphens: auto; }
.qz-answers.m .qz-ans-text { font-size: 16px; }
.qz-answers.s .qz-ans-text { font-size: 15px; }
.qz-tag {
  flex-shrink: 0; padding: 4px 9px; border-radius: 9999px; background: var(--accent); color: var(--accent-text);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Who has answered: small critters, faded until they have, then a check. A wide screen has the list beside. */
.qz-strip { display: flex; flex-direction: column; gap: 10px; }
.qz-strip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-mini { position: relative; display: block; transition: opacity 0.3s ease; }
.qz-mini:not(.done) { opacity: 0.4; }
.qz-mini-critter { display: block; width: 38px; }
.qz-mini-tick {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 9999px;
  background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--background);
}
.qz-mini-tick svg { width: 12px; height: 12px; }
@media (min-width: 820px) { .qz-strip { display: none; } }

/* The reveal on a phone: your round, then the four answers with who chose each, then who was fastest. */
.qz-you {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 14px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line);
}
.qz-you.right { background: var(--accent-soft-bg); border-color: var(--accent-soft-border); }
.qz-you .turn-critter { width: 62px; }
.qz-you .stack { flex: 1; min-width: 0; }
.qz-you h2 { margin: 0; }
.qz-you h2 .accent { color: var(--accent); }
.qz-you .lede { overflow-wrap: break-word; }
.qz-fast-me { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--crown); }

.qz-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qz-row {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px 8px 8px; border-radius: var(--radius-row);
  background: var(--surface); border: 2px solid transparent;
}
.qz-row.right { border-color: var(--accent); background: var(--accent-soft-bg); }
.qz-row.right .qz-letter { background: var(--accent); color: var(--accent-text); }
.qz-row:not(.right) .qz-letter { background: var(--line-strong); color: var(--text-soft); }
.qz-row-text { flex: 1; min-width: 0; font-size: 16px; line-height: 1.2; font-weight: 700; overflow-wrap: break-word; hyphens: auto; }
.qz-row:not(.right) .qz-row-text { color: var(--text-soft); font-weight: 600; }
.qz-yours { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.qz-heads { display: flex; align-items: center; flex-shrink: 0; padding-right: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; row-gap: 2px; }
.qz-head { display: block; margin-right: -6px; }
.qz-head-critter { display: block; width: 26px; box-shadow: 0 0 0 2px var(--surface); }
.qz-row.right .qz-head-critter { box-shadow: 0 0 0 2px var(--accent-soft-bg); }
.qz-fast { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text-soft); }
.qz-fast.none { color: var(--text-muted); font-weight: 400; }
.qz-bolt-icon { flex-shrink: 0; width: 18px; height: 18px; fill: var(--crown); }

/* The TV. */
.tv .timer.qz-timer { font-size: calc(24 * var(--u)); min-width: calc(100 * var(--u)); }
.tv .timer.qz-timer i { height: calc(5 * var(--u)); }
.qz-board { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: calc(16 * var(--u)); }
.qz-head { flex-shrink: 0; display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.qz-tv-q {
  margin: 0; max-width: calc(1120 * var(--u)); font-size: calc(48 * var(--u)); line-height: 1.1; font-weight: 800;
  letter-spacing: -0.02em; overflow-wrap: break-word; text-wrap: balance;
}
.qz-tv-q.m { font-size: calc(42 * var(--u)); }
.qz-tv-q.s { font-size: calc(36 * var(--u)); }

/* The four tiles, two by two. */
.qz-grid {
  flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: calc(18 * var(--u)) calc(24 * var(--u));
}
.qz-tile {
  position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; gap: calc(18 * var(--u));
  padding: calc(8 * var(--u)) calc(18 * var(--u)) calc(8 * var(--u)) calc(18 * var(--u)); border-radius: calc(28 * var(--u));
  background: var(--surface); border: calc(3 * var(--u)) solid var(--line-strong); color: var(--text);
  transition: transform 0.55s cubic-bezier(0.3, 1.6, 0.5, 1), background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.45s ease;
}
.qz-tile .qz-letter { width: calc(56 * var(--u)); height: calc(56 * var(--u)); font-size: calc(26 * var(--u)); }
.qz-tile-text {
  flex: 1; min-width: 0; font-size: calc(40 * var(--u)); line-height: 1.08; font-weight: 800; letter-spacing: -0.01em;
  overflow-wrap: break-word; hyphens: auto; transition: opacity 0.4s ease;
}
.qz-grid.m .qz-tile-text { font-size: calc(32 * var(--u)); }
.qz-grid.s .qz-tile-text { font-size: calc(26 * var(--u)); }

/* Lit: the right tile in the accent, glowing like the lamp; the wrong ones go hollow (their critters stay bright). */
.qz-tile.right {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text); transform: scale(1.03);
  box-shadow: 0 0 calc(80 * var(--u)) var(--glow-lamp), 0 0 calc(30 * var(--u)) var(--accent);
}
.qz-tile.right .qz-letter { background: var(--background); color: var(--accent); }
.qz-tile.wrong { background: transparent; border-color: var(--line); }
.qz-tile.wrong .qz-tile-text, .qz-tile.wrong .qz-letter { opacity: 0.4; }
.qz-check {
  position: absolute; z-index: 3; top: calc(-18 * var(--u)); right: calc(-14 * var(--u));
  width: calc(52 * var(--u)); height: calc(52 * var(--u)); border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--background); border: calc(4 * var(--u)) solid var(--background);
}
.qz-check svg { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }

/* The heap on a tile: the critters who chose it, up to six a row, the second row behind the first. */
.qz-heap {
  flex-shrink: 0; display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: flex-end;
  max-width: calc(6 * 46 * var(--u) + 12 * var(--u)); padding-left: calc(10 * var(--u));
}
.qz-heap:empty { display: none; }
.qz-pc { position: relative; display: block; margin: calc(-14 * var(--u)) 0 0 calc(-10 * var(--u)); }
.qz-pc-critter { display: block; width: calc(52 * var(--u)); box-shadow: 0 0 0 calc(3 * var(--u)) var(--surface); transition: box-shadow 0.35s ease; }
.qz-tile.right .qz-pc-critter { box-shadow: 0 0 0 calc(3 * var(--u)) var(--accent); }
.qz-tile.wrong .qz-pc-critter { box-shadow: 0 0 0 calc(3 * var(--u)) var(--background); }
.qz-tile.crowd .qz-pc-critter { width: calc(40 * var(--u)); }
.qz-pc.fast { z-index: 2; } /* its bolt over the critter beside it */
/* When the right tile lights, the critters on it cheer, one after another (an answer to what happened). */
.qz-tile.right .qz-pc { animation: qz-cheer 0.75s linear; }
.qz-tile.right .qz-pc:nth-child(2) { animation-delay: 0.07s; }
.qz-tile.right .qz-pc:nth-child(3) { animation-delay: 0.14s; }
.qz-tile.right .qz-pc:nth-child(4) { animation-delay: 0.21s; }
.qz-tile.right .qz-pc:nth-child(5) { animation-delay: 0.28s; }
.qz-tile.right .qz-pc:nth-child(6) { animation-delay: 0.35s; }
.qz-tile.right .qz-pc:nth-child(n+7) { animation-delay: 0.42s; }
@keyframes qz-cheer {
  0% { translate: 0 0; scale: 1 1; }
  15% { scale: 1.1 0.88; animation-timing-function: cubic-bezier(0.2, 0.8, 0.4, 1); }
  45% { translate: 0 -30%; scale: 0.94 1.08; animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  68% { translate: 0 0; scale: 1.08 0.92; }
  84% { scale: 0.98 1.03; }
  100% { translate: 0 0; scale: 1 1; }
}
.qz-bolt {
  position: absolute; z-index: 2; top: calc(-8 * var(--u)); right: calc(-6 * var(--u));
  width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  background: var(--crown); border: calc(3 * var(--u)) solid var(--background);
}
.qz-bolt .qz-bolt-icon { width: calc(17 * var(--u)); height: calc(17 * var(--u)); fill: var(--background); }

/* The line under the tiles. */
.qz-cap { flex-shrink: 0; min-height: calc(40 * var(--u)); display: flex; align-items: center; justify-content: center; text-align: center; }
.qz-cap-text {
  margin: 0; display: inline-flex; align-items: center; gap: calc(12 * var(--u));
  font-size: calc(30 * var(--u)); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em;
}
.qz-cap-text.quiet { font-size: calc(22 * var(--u)); font-weight: 400; color: var(--text-soft); letter-spacing: 0; }
.qz-cap-text .qz-bolt-icon { width: calc(30 * var(--u)); height: calc(30 * var(--u)); }

/* Along the bottom, always as tall as the couch, so nothing above it moves when the scores take its place. */
.qz-bottom { flex-shrink: 0; height: calc(138 * var(--u)); display: flex; align-items: center; justify-content: center; }
.qz-couch { width: 100%; align-self: flex-end; }
/* A critter that has landed on its answer has left its seat (it hops up and out). */
.couch .seat.qz-gone .seat-critter {
  opacity: 0; transform: translateY(calc(-60 * var(--u))) scale(0.6);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.8, 0.6), opacity 0.28s ease-in;
}
.couch .seat.qz-gone .badge { opacity: 0; }

.qz-scores {
  width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-content: center;
  gap: calc(10 * var(--u)) calc(12 * var(--u)); transition: opacity 0.5s ease;
}
.qz-scores.wait { opacity: 0.45; }
.qz-score {
  display: flex; align-items: center; gap: calc(10 * var(--u)); padding: calc(6 * var(--u)) calc(14 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u));
  border-radius: 9999px; background: var(--pc); color: var(--background);
}
.qz-score-critter { width: calc(40 * var(--u)); }
.qz-score-name { font-size: calc(20 * var(--u)); font-weight: 600; max-width: calc(140 * var(--u)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-score-n { font-size: calc(22 * var(--u)); font-weight: 800; font-variant-numeric: tabular-nums; }
.qz-score-plus {
  padding: calc(2 * var(--u)) calc(10 * var(--u)); border-radius: 9999px; background: var(--background); color: var(--pc);
  font-size: calc(18 * var(--u)); font-weight: 800;
}
/* Nine to twelve: smaller pills, three rows at most, still inside the band. */
.qz-scores.many { gap: calc(6 * var(--u)) calc(8 * var(--u)); }
.qz-scores.many .qz-score { gap: calc(7 * var(--u)); padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(4 * var(--u)) calc(4 * var(--u)); }
.qz-scores.many .qz-score-critter { width: calc(30 * var(--u)); }
.qz-scores.many .qz-score-name { font-size: calc(17 * var(--u)); max-width: calc(96 * var(--u)); }
.qz-scores.many .qz-score-n { font-size: calc(19 * var(--u)); }
.qz-scores.many .qz-score-plus { font-size: calc(15 * var(--u)); padding: calc(1 * var(--u)) calc(8 * var(--u)); }
