/* Kwiz Rocket home page. The game's own night sky, gold and four answer colours (with their
   shapes: star, heart, moon, bolt) are the whole visual system. */
:root {
  --night: #1b1250;
  --night-2: #2c1a6e;
  --gold: #ffc83d;
  --paper: #f4f0ff;
  --ink: #1d1b2f;
  --muted: #5a5675;
  --tangerine: #e8590c;
  --pink: #db2777;
  --teal: #0f8b8d;
  --violet: #7c3aed;
  --display: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --step: clamp(16px, 1.05rem + .15vw, 19px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--text); font-size: var(--step); line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; }
.defs { position: absolute; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; }
h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; }

/* ---------- top bar ---------- */
.top { position: absolute; inset: 0 0 auto; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(18px, 4vw, 56px); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 26px; }
.brand b { color: var(--gold); }
.brand.small { font-size: 20px; }
.top nav { display: flex; gap: clamp(12px, 2.4vw, 30px); align-items: center; font-weight: 700; }
.top nav a { text-decoration: none; opacity: .9; }
.top nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.top .join-link { border: 2px solid rgba(255, 255, 255, .55); padding: 6px 14px; border-radius: 999px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 20px;
  padding: 12px 24px 10px; border-radius: 14px; border: 0; cursor: pointer; text-decoration: none; transition: transform .1s; }
.btn:active { transform: translateY(2px); }
.btn.gold { background: var(--gold); color: var(--night); box-shadow: 0 5px 0 #c9921a; }
.btn.outline { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.btn.outline:hover { box-shadow: inset 0 0 0 2px #fff; }

/* ---------- hero: the game, playable ---------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: clamp(110px, 14vh, 150px) clamp(18px, 4vw, 56px) clamp(56px, 8vw, 96px);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  background: radial-gradient(ellipse at 15% 0%, #4c2a9e, transparent 55%), radial-gradient(ellipse at 95% 100%, #0d3b66, transparent 55%), var(--night); }
/* a sprinkle of stars */
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 32% 78%, #fff, transparent),
    radial-gradient(2px 2px at 48% 14%, #fff, transparent), radial-gradient(1.5px 1.5px at 66% 62%, #fff, transparent),
    radial-gradient(2px 2px at 84% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 92% 72%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 6% 88%, #fff, transparent), radial-gradient(1.5px 1.5px at 56% 92%, #fff, transparent); }
.hero > * { position: relative; }
/* The 3D sky (hero-3d.js) sits behind everything; with it, the CSS stars aren't needed. */
.hero > .hero-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero.has-3d::before { display: none; }
.hero h1 { font-size: clamp(42px, 5.6vw, 76px); font-weight: 800; max-width: 14ch; }
.lede { font-size: clamp(18px, 1.4vw, 21px); max-width: 34em; color: #e4defb; margin: 20px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.demo { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 0 18px; align-items: end; }
.demo-hint { grid-column: 1 / -1; margin: 0 0 12px; font-weight: 700; color: var(--gold); }

.tv { background: linear-gradient(180deg, #2c1a6e, #1b1250); border: 10px solid #0c0826; border-radius: 22px; box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
  padding: 0 0 14px; overflow: hidden; }
.tv-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: rgba(0, 0, 0, .3); font-family: var(--display); font-weight: 800; font-size: 14px; }
.tv-logo b { color: var(--gold); }
.tv-code { color: #c9c1f2; }
.tv-q { margin: 12px 14px 8px; padding: 8px 14px; background: #fff; color: var(--ink); border-radius: 12px; font-family: var(--display); font-weight: 800;
  font-size: clamp(16px, 1.6vw, 22px); text-align: center; }
.tv-middle { display: grid; place-items: center; gap: 8px; padding: 4px 14px 10px; min-height: 150px; }
.tv-flag { width: min(260px, 70%); border-radius: 10px; transition: filter 1.4s ease-out; }
.tv-flag.grey { filter: grayscale(1) contrast(1.05); }
.tv-result { display: flex; gap: 8px; }
.chip, .tv-palette span, .swatch { background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12); }
.chip.ink, .tv-palette span.ink, .swatch.ink { color: var(--night); }
.chip { padding: 4px 14px 2px; border-radius: 999px; font-size: 17px; }
.tv-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 0 14px; }
.tv-palette span { text-align: center; border-radius: 8px; padding: 6px 0 4px; font-size: clamp(11px, 1vw, 14px); }
.tv.revealed .tv-palette span.wrong { opacity: .25; }

.phone { width: clamp(170px, 15vw, 210px); background: #0c0826; border-radius: 30px; padding: 10px; box-shadow: 0 22px 50px rgba(0, 0, 0, .5); margin-bottom: -26px; }
.phone-notch { width: 60px; height: 8px; margin: 2px auto 8px; border-radius: 8px; background: #2a2450; }
.phone-screen { background: linear-gradient(180deg, #3a1d7a, #1b1250); border-radius: 22px; padding: 12px 10px 14px; min-height: 300px; display: flex; flex-direction: column; gap: 10px; }
.phone-q { margin: 0; font-family: var(--display); font-weight: 800; font-size: 15px; text-align: center; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.swatch { position: relative; border: 0; border-radius: 10px; padding: 12px 4px 9px; font-size: 15px; cursor: pointer; }
.swatch::after { content: ''; position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 4px; border: 2px solid currentColor; }
.swatch[aria-pressed="true"] { outline: 3px solid #fff; outline-offset: 1px; }
.swatch[aria-pressed="true"]::after { background: currentColor; }
.phone-submit { border: 0; border-radius: 12px; padding: 10px 0 8px; font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; background: #16a34a; cursor: pointer; box-shadow: 0 4px 0 #0e6b31; }
.phone-submit:disabled { opacity: .45; cursor: default; }
.phone-result { font-family: var(--display); font-weight: 800; text-align: center; font-size: 16px; line-height: 1.2; }
.phone-result button { margin-top: 6px; background: none; color: var(--gold); border: 0; font: inherit; text-decoration: underline; cursor: pointer; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
}
@media (max-width: 560px) {
  .demo { grid-template-columns: 1fr; }
  .phone { justify-self: center; margin: 18px 0 0; width: 220px; }
  .tv-palette { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- sections ---------- */
main > section:not(.hero) { padding: clamp(64px, 9vw, 120px) clamp(18px, 4vw, 56px); max-width: 1240px; margin: 0 auto; }
.how h2, .games h2, .faq h2 { margin-bottom: clamp(28px, 4vw, 48px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding-top: 74px; }
.steps .mark { position: absolute; top: 0; left: 0; width: 56px; height: 56px; color: var(--accent); }
.steps li::before { content: counter(step); position: absolute; top: 12px; left: 66px; font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--accent); }
.steps h3 { margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted); max-width: 30em; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.game { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 72px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.game.flip .game-art { order: 2; }
.game-copy h3 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 10px; }
.game-copy > p { margin: 0 0 16px; max-width: 36em; }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 38em; }
.ticks li { position: relative; padding-left: 30px; color: var(--muted); }
.ticks li::before { content: ''; position: absolute; left: 4px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--violet); }
.flip .ticks li::before { background: #f472b6; }
.game-art { border-radius: 28px; min-height: 280px; display: grid; place-items: center; padding: 28px; }
.rocket-art { background: radial-gradient(ellipse at 30% 0%, #4c2a9e, transparent 60%), var(--night); }
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(420px, 100%); }
.mini-tiles span { display: flex; align-items: center; gap: 10px; background: var(--c); color: #fff; border-radius: 14px; padding: 18px 16px 14px; font-family: var(--display); font-weight: 800; font-size: 22px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); }
.mini-tiles svg { width: 28px; height: 28px; flex: none; }
.flock-art { background: linear-gradient(180deg, #8fd3ff 0%, #c4ecff 55%, #6dbb5a 55%, #4f9d42 100%); grid-auto-flow: column; justify-content: center; align-items: end; gap: 6px; }
.sheep { width: clamp(90px, 10vw, 130px); }
@media (max-width: 820px) {
  .game { grid-template-columns: 1fr; }
  .game.flip .game-art { order: 0; }
}

/* ---------- the shop ---------- */
.packs { max-width: none !important; background: #fff; }
.packs > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.packs-intro { margin: 14px auto clamp(28px, 4vw, 48px); max-width: 1240px; color: var(--muted); }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 34px); }
@media (max-width: 900px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .shelf { grid-template-columns: 1fr; } }
.pack { display: flex; flex-direction: column; }
/* Box art: a tilted lid with the pack's colours, like a game on a shelf. */
.cover { position: relative; aspect-ratio: 4 / 3; border-radius: 10px 10px 4px 4px; background: var(--cover); color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; box-shadow: 8px 8px 0 rgba(27, 18, 80, .14); }
.cover-emoji { position: absolute; top: 10px; right: 14px; font-size: clamp(54px, 6vw, 76px); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .2)); }
/* A soft light in the top corner and a sheen across the lid, so the colours read as a box, not a flat panel. */
.cover::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 82% 18%, rgba(255, 255, 255, .32), transparent 46%), linear-gradient(115deg, rgba(255, 255, 255, .12) 0 38%, transparent 38%); }
img.cover-emoji { top: 6%; right: 6%; width: 36%; height: auto; aspect-ratio: 1; font-size: 0; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .28)); }
.pack:hover img.cover-emoji { transform: rotate(-6deg) scale(1.05); }
img.cover-emoji { transition: transform .3s ease; }
/* The admin's own cover picture fills the lid, darkened at the bottom so the title stays readable. */
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img::before { background: linear-gradient(to top, rgba(10, 6, 30, .72), rgba(10, 6, 30, .25) 45%, transparent 70%); }
.cover-title { position: relative; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.4vw, 32px); line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); max-width: 9ch; }
.pack-body { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
.pack-body h3 { font-size: 24px; margin-bottom: 6px; }
.pack-body > p { margin: 0 0 8px; }
.contents { color: var(--muted); font-size: .9em; }
.only-size { font-size: .85em; font-weight: 700; color: #b45309; margin: 0; }
.only-size[hidden] { display: none; }
.buy-row { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-family: var(--display); font-weight: 800; font-size: 26px; }
.btn.buy { background: var(--violet); color: #fff; font-size: 18px; box-shadow: 0 4px 0 #4c1d95; }
.btn.buy:disabled { background: #e7e2f7; color: var(--muted); box-shadow: none; cursor: default; }
.bundle { margin-top: clamp(28px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--night); color: #fff; border-radius: 22px; padding: 24px clamp(20px, 3vw, 36px); }
.bundle p { margin: 4px 0 0; color: #d6cff5; }
.bundle .buy-row { margin: 0; padding: 0; gap: 18px; }
.bundle .btn.buy:disabled { background: rgba(255, 255, 255, .14); color: #d6cff5; }

/* ---------- questions people ask ---------- */
.faq { max-width: 860px !important; }
.faq details { border-top: 2px solid #ddd5f5; padding: 16px 0; }
.faq details:last-of-type { border-bottom: 2px solid #ddd5f5; }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 22px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--violet); font-size: 28px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; color: var(--muted); max-width: 40em; }

/* ---------- footer ---------- */
.foot { background: var(--night); color: #d6cff5; padding: 36px clamp(18px, 4vw, 56px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.foot .brand { color: #fff; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; font-weight: 700; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.small-print { margin: 0; width: 100%; font-size: 14px; opacity: .8; }

/* ---------- legal pages ---------- */
.legal-top { position: static; background: var(--night); }
.legal { max-width: 760px; margin: 0 auto; padding: 48px clamp(18px, 4vw, 40px) 80px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 8px; }
.legal h2 { font-size: 26px; margin: 36px 0 8px; }
.legal p, .legal li { color: #34314d; }
.legal .note { background: #fff4d1; border-left: 6px solid var(--gold); padding: 12px 16px; border-radius: 8px; }

/* ---------- the demo playing itself: a little "tap" on each swatch it ticks ---------- */
.swatch.tapped { animation: tap .35s ease-out; }
@keyframes tap { 45% { transform: scale(.86); } }

/* ---------- the looping gameplay scenes (reels.js) ---------- */
.game-art { padding: clamp(14px, 2.4vw, 28px); }
.reel { width: 100%; max-width: 520px; }
.r-tv { position: relative; background: linear-gradient(180deg, #2c1a6e, #1b1250); border: 8px solid #0c0826; border-radius: 18px; padding: 10px 12px 12px; color: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .35); font-family: var(--display); font-weight: 800; overflow: hidden; min-height: 300px; }
.r-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #c9c1f2; }
.r-timer { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--gold); display: grid; place-items: center; color: #fff; font-size: 15px; }
.r-q { margin: 8px 0 10px; background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 12px 6px; text-align: center; font-size: clamp(16px, 1.6vw, 20px); }
.r-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.r-tile { position: relative; display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 12px 10px 10px; font-size: 17px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
  transition: opacity .4s, transform .4s; }
.r-tile svg { width: 22px; height: 22px; flex: none; }
.r-tile.a0 { background: var(--tangerine); } .r-tile.a1 { background: var(--pink); } .r-tile.a2 { background: var(--teal); } .r-tile.a3 { background: var(--violet); }
.r-tile::after { content: attr(data-n); position: absolute; right: 10px; font-size: 18px; opacity: 0; transition: opacity .4s; }
.revealed .r-tile::after { opacity: 1; }
.r-tile.dim { opacity: .35; }
.r-tile.right { transform: scale(1.05); }
.r-tile.right span::after { content: ' ✔'; }
.r-foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.r-av { font-size: 20px; opacity: .25; filter: grayscale(1); transition: opacity .25s, filter .25s, transform .25s; }
.r-av.in { opacity: 1; filter: none; transform: translateY(-3px); }
.r-count { margin-left: auto; font-size: 13px; color: #c9c1f2; }
.r-got { text-align: center; margin-top: 6px; font-size: 15px; color: var(--gold); opacity: 0; transition: opacity .4s; }
.revealed .r-got { opacity: 1; }
/* the league table slides in over the question */
.r-board { position: absolute; inset: 0; background: linear-gradient(180deg, #2c1a6e, #1b1250); padding: 14px 16px; transform: translateX(105%); transition: transform .6s cubic-bezier(.3, 1.2, .5, 1); }
.show-board .r-board { transform: none; }
.r-board-title { font-size: 20px; margin-bottom: 8px; }
.r-board { --row: 46px; }
.r-row { position: absolute; left: 16px; right: 16px; top: 52px; height: calc(var(--row) - 6px); display: grid; grid-template-columns: 26px 30px 1fr auto 34px; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 0 10px; font-size: 16px; transition: transform .9s cubic-bezier(.3, 1.3, .5, 1), background .4s; }
.r-row { transform: translateY(calc(var(--pos, 0) * var(--row))); }
.r-rank { color: var(--gold); }
.r-row-av { font-size: 20px; }
.r-up { font-style: normal; color: #86efac; font-size: 14px; }
.r-row.climber { background: rgba(34, 197, 94, .3); }

/* Flock Together: answers pop up over the players, then they're sorted into pens */
.r-tv.flock .r-q { margin-top: 4px; }
.r-crowd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; padding-top: 30px; transition: opacity .4s; }
.r-player { position: relative; display: flex; flex-direction: column; align-items: center; }
.r-pav { font-size: 30px; line-height: 1; }
.r-pname { font-size: 13px; color: #c9c1f2; }
.r-bubble { position: absolute; bottom: 100%; margin-bottom: 4px; background: #fff; color: var(--ink); border-radius: 10px; padding: 3px 10px 1px; font-size: 14px; white-space: nowrap;
  opacity: 0; transform: translateY(6px) scale(.6); transition: opacity .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.r-bubble::after { content: ''; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 5px solid transparent; border-top-color: #fff; }
.r-player.said .r-bubble { opacity: 1; transform: none; }
.r-pens { position: absolute; inset: 62px 12px 12px; display: grid; gap: 8px; align-content: start; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; pointer-events: none; }
.show-pens .r-crowd { opacity: 0; }
.show-pens .r-pens { opacity: 1; transform: none; }
.r-pen { background: #fff; color: var(--ink); border-radius: 10px; padding: 6px 10px; border: 3px solid transparent; }
.r-pen.flock { border-color: #16a34a; background: #f0fdf4; }
.r-pen.lone { border-color: #f59e0b; }
.r-pen-head { display: flex; justify-content: space-between; font-size: 17px; }
.r-pen-head span { background: var(--violet); color: #fff; border-radius: 999px; min-width: 26px; text-align: center; font-size: 14px; padding: 1px 8px 0; }
.r-pen.flock .r-pen-head span { background: #16a34a; }
.r-pen-who { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; }
.r-pen-who span { background: #f1eefb; border-radius: 999px; padding: 1px 8px 0; }
.r-pen-win { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #15803d; }
.r-sheep { width: 30px; height: auto; }
.r-banner { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #d97706; border-radius: 12px;
  padding: 6px 10px 4px; font-size: 17px; opacity: 0; transform: translateY(20px) scale(.9); transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.r-banner .r-sheep { width: 40px; }
.r-banner { overflow: hidden; }
/* the lost sheep trots off out of the picture, glancing back once */
.show-banner .r-sheep.wander { animation: rWander 3.2s .8s ease-in forwards; }
@keyframes rWander {
  0% { transform: none; } 15% { transform: translateY(-6px); } 25% { transform: scaleX(-1); } 35% { transform: none; }
  45% { transform: translate(30px, -5px); } 55% { transform: translate(60px, 0); } 65% { transform: translate(90px, -5px); }
  100% { transform: translate(220px, 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .show-banner .r-sheep.wander { animation: none; } }
.show-banner .r-banner { opacity: 1; transform: none; }

/* ---------- fading in as you scroll (reels.js adds these only when motion is welcome) ---------- */
main > section.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .8s ease-out, transform .8s ease-out; }
main > section.fade-in.faded-in { opacity: 1; transform: none; }
/* The scenes fill their panel (the Flock panel used to lay out three still sheep in a row). */
.flock-art { grid-auto-flow: row; justify-content: stretch; justify-items: center; align-items: center; }
.r-tv.flock { min-height: 330px; }
.r-pens { gap: 6px; }
.r-pen { padding: 4px 10px; }
.r-pens { grid-template-columns: 1fr 1fr; }
.r-pen.flock { grid-column: 1 / -1; }

/* The demo keeps exactly the same size all the way through a round (so the hero never jumps):
   fixed spaces for the flag, the answer, the swatches, the phone and the hint. */
.demo-hint { min-height: calc(2 * 1.55em); }
.tv-middle { height: clamp(176px, 21vw, 236px); grid-template-rows: minmax(0, 1fr) 34px; }
.tv-flag { width: auto; max-width: 70%; height: 100%; object-fit: contain; }
.tv-result[hidden] { display: flex !important; visibility: hidden; }
.phone-screen { height: 344px; min-height: 0; }
.swatches { height: 156px; grid-auto-rows: minmax(0, 1fr); }
.phone-submit[hidden] { display: block !important; visibility: hidden; }
.phone-result { min-height: 64px; margin-top: -48px; }
.phone-result:empty { visibility: hidden; }
.tv-q { min-height: calc(2.5em + 16px); line-height: 1.25; display: grid; place-items: center; }

/* ---------- "Three steps": a little picture for each step, linked by a dotted rocket trail ---------- */
.how { padding-bottom: clamp(36px, 5vw, 64px) !important; }
.how + .games { padding-top: clamp(36px, 5vw, 64px) !important; }
.how h2 { margin-bottom: clamp(22px, 3vw, 36px) !important; }
.steps { position: relative; }
.steps li { padding-top: 0; }
.steps li::before { content: none; }
/* the trail runs behind the three pictures and ends in a rocket */
.steps::before { content: ''; position: absolute; left: 8%; right: 4%; top: 86px; border-top: 4px dotted rgba(124, 58, 237, .35); }
.steps::after { content: '🚀'; position: absolute; right: -4px; top: 64px; font-size: 34px; transform: rotate(45deg); }
.step-pic { position: relative; z-index: 1; height: 172px; border-radius: 26px; background: var(--tint); display: grid; place-items: center; margin-bottom: 16px;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.steps .mark { position: static; width: 30px; height: 30px; color: var(--accent); }
.step-num { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--accent); line-height: 1; padding-top: 4px; }

/* 1: the TV with the game code */
.mini-tv { display: flex; flex-direction: column; align-items: center; }
.mini-tv-screen { width: 190px; height: 112px; border-radius: 12px; border: 6px solid #0c0826; background: linear-gradient(160deg, #3a1d7a, #1b1250); color: #fff;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; padding: 8px 10px; column-gap: 8px; font-family: var(--display); font-weight: 800; }
.mini-label { font-size: 11px; color: #c9c1f2; font-family: var(--display); font-weight: 800; }
.mini-code { grid-row: 2; font-size: 26px; letter-spacing: .02em; align-self: center; }
.mini-qr { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 52px; height: 52px; border-radius: 6px; border: 4px solid #fff;
  background: conic-gradient(#000 25%, #fff 0 50%, #000 0 75%, #fff 0) 0 0 / 11px 11px, #fff; }
.mini-tv-stand { width: 60px; height: 10px; border-radius: 0 0 8px 8px; background: #0c0826; }

/* 2: the phone joining */
.mini-phone { width: 118px; height: 150px; border-radius: 20px; border: 6px solid #0c0826; background: linear-gradient(180deg, #3a1d7a, #1b1250); color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; }
.mini-input { width: 100%; background: #fff; color: var(--ink); border-radius: 8px; text-align: center; font-family: var(--display); font-weight: 800; padding: 3px 0 1px; }
.mini-buddies { display: flex; gap: 3px; font-size: 18px; }
.mini-buddies i { font-style: normal; border-radius: 8px; padding: 1px 2px; }
.mini-buddies i.on { background: var(--gold); }
.mini-join { margin-top: auto; width: 100%; text-align: center; background: #16a34a; border-radius: 8px; font-family: var(--display); font-weight: 800; font-size: 14px; padding: 3px 0 1px; }

/* 3: the podium */
.mini-podium { display: flex; align-items: flex-end; gap: 6px; height: 132px; }
.mini-place { width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 26px; line-height: 1; }
.mini-place em { font-style: normal; font-size: 20px; animation: bob 1.6s ease-in-out infinite; }
.mini-place b { width: 100%; margin-top: 4px; border-radius: 8px 8px 0 0; display: grid; place-items: center; font-family: var(--display); font-size: 20px; color: rgba(0, 0, 0, .35); }
.mini-place.p1 b { height: 64px; background: var(--gold); }
.mini-place.p2 b { height: 44px; background: #c9d3e0; }
.mini-place.p3 b { height: 30px; background: #e08a4f; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .mini-place em { animation: none; } }

@media (max-width: 820px) {
  .steps::before, .steps::after { display: none; }
  .step-pic { height: 150px; }
}
.steps::after { z-index: 2; top: -26px; right: -12px; font-size: 38px; filter: drop-shadow(0 4px 4px rgba(27, 18, 80, .25)); }

/* The race for the lead (quiz scene): rockets through the stars, the new leader boosting past */
.r-race { position: absolute; inset: 0; padding: 14px 16px; overflow: hidden; transform: translateX(105%); transition: transform .6s cubic-bezier(.3, 1.2, .5, 1);
  background: radial-gradient(1.5px 1.5px at 12% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 38% 72%, #fff, transparent),
    radial-gradient(2px 2px at 64% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 82% 64%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 92% 34%, #fff, transparent), radial-gradient(ellipse at 30% 0%, #4c2a9e, transparent 60%), #140c3d; }
.show-race .r-race { transform: none; }
.r-race-title { font-size: 20px; }
.r-lane { position: absolute; left: 0; right: 0; height: 64px; }
.r-lane.ava { top: 30%; }
.r-lane.cal { top: 56%; }
.r-rocket { position: absolute; width: 112px; left: var(--x); top: 0; transition: left 1.3s cubic-bezier(.4, 0, .2, 1); }
.r-lane.ava { --x: 46%; }
.r-lane.cal { --x: 4%; }
.boost .r-lane.ava { --x: 24%; }
.boost .r-lane.cal { --x: 60%; }
.r-lane-tag { position: absolute; left: calc(var(--x) + 18px); top: 50px; background: #fff; color: var(--ink); border-radius: 999px; padding: 1px 10px 0; font-size: 14px;
  white-space: nowrap; transition: left 1.3s cubic-bezier(.4, 0, .2, 1), background .3s; }
.lead .r-lane.cal .r-lane-tag { background: var(--gold); }
.r-flame { transform-origin: 22px 25px; animation: flicker .12s infinite alternate; }
.boost .r-lane.cal .r-flame { transform: scaleX(1.8); animation: none; }
@keyframes flicker { to { transform: scaleX(.75); } }
/* a streak of sparks behind the boosting rocket */
.r-lane.cal::before { content: ''; position: absolute; top: 22px; left: 0; width: var(--x); height: 6px; border-radius: 6px; opacity: 0;
  background: linear-gradient(90deg, transparent, #fde047 60%, #fb923c); transition: width 1.3s cubic-bezier(.4, 0, .2, 1), opacity .3s; }
.boost .r-lane.cal::before { opacity: .9; }
.r-race-banner { position: absolute; left: 16px; right: 16px; bottom: 14px; text-align: center; background: var(--gold); color: var(--night); border-radius: 12px;
  padding: 6px 10px 4px; font-size: 19px; opacity: 0; transform: translateY(20px) scale(.9); transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.lead .r-race-banner { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .r-flame { animation: none; } }

/* The hero demo's race for the lead and league table: over the TV's picture, below its top bar */
.tv { position: relative; }
.tv > .tv-over { top: 33px; border-radius: 0 0 12px 12px; }
.tv > .r-board { padding-top: 12px; }
/* while they're on, the phone says to look at the big screen (as in the real game) */
.phone { position: relative; }
.phone-wait { position: absolute; inset: 28px 10px 10px; border-radius: 22px; background: linear-gradient(180deg, #3a1d7a, #1b1250); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px;
  font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.2; opacity: 0; transition: opacity .35s; pointer-events: none; cursor: pointer; }
.phone.waiting .phone-wait { pointer-events: auto; }
.phone-wait span { font-size: 44px; }
.phone.waiting .phone-wait { opacity: 1; }

/* ---------- the shop's size switch: up to 8 players, or Mega-host up to 60 ---------- */
.size-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 auto clamp(24px, 3vw, 36px); max-width: 1240px; }
.size-switch { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 5px; box-shadow: inset 0 0 0 2px #ddd5f5; }
.size-switch button { border: 0; background: none; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--muted); padding: 9px 20px 7px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.size-switch button[aria-checked="true"] { background: var(--violet); color: #fff; box-shadow: 0 3px 0 #4c1d95; }
.size-switch button[data-size="mega"][aria-checked="true"] { background: var(--tangerine); box-shadow: 0 3px 0 #9a3a07; }
.size-note { margin: 0; color: var(--muted); }
.size-switch button { white-space: nowrap; }
@media (max-width: 440px) { .size-switch button { font-size: 15px; padding: 8px 12px 6px; } }
/* the packs page: a section for each game */
.shelves:empty { display: none; }
.shelf-jump { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: clamp(28px, 4vw, 44px); }
.shelf-jump a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border-radius: 999px; background: var(--paper);
  font-family: var(--display); font-weight: 800; font-size: 20px; text-decoration: none; color: var(--night); box-shadow: inset 0 0 0 2px #e2dbf7; }
.shelf-jump a:hover { box-shadow: inset 0 0 0 2px var(--violet); }
.shelf-jump img { width: 34px; height: 34px; }
.shelf-section { margin-bottom: clamp(44px, 6vw, 72px); scroll-margin-top: 24px; }
.shelf-head { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 28px); padding: clamp(18px, 2.4vw, 28px) clamp(20px, 3vw, 34px); border-radius: 26px;
  color: #fff; margin-bottom: clamp(22px, 3vw, 34px); background: var(--head); box-shadow: 0 10px 30px rgba(27, 18, 80, .16); }
.kind-quiz { --head: linear-gradient(120deg, #4c1d95, #7c3aed 60%, #a855f7); }
.kind-flock { --head: linear-gradient(120deg, #9d174d, #db2777 60%, #f472b6); }
.kind-whowrote { --head: linear-gradient(120deg, #0b5f61, #0f8b8d 60%, #2dd4bf); }
.shelf-head img { width: clamp(70px, 9vw, 110px); height: auto; flex: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .3)); }
.shelf-head h2 { font-size: clamp(30px, 3.6vw, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.shelf-count { font-family: var(--text); font-size: 15px; font-weight: 700; background: rgba(255, 255, 255, .2); padding: 4px 12px; border-radius: 999px; letter-spacing: 0; }
.shelf-head p { margin: 6px 0 0; max-width: 70ch; }
.shelf-head .shelf-who { font-weight: 700; opacity: .95; }
.shelf-soon { margin: 0; padding: 28px; border: 2px dashed #d9d1f3; border-radius: 20px; color: var(--muted); font-weight: 700; text-align: center; }
@media (max-width: 560px) { .shelf-head { flex-direction: column; text-align: center; } .shelf-head h2 { justify-content: center; } }
.shelf-empty { color: var(--muted); font-weight: 700; margin: 0 auto 24px; max-width: 1240px; }
.shelf:empty { display: none; }

/* ---------- the basket ---------- */
.btn.buy.added { background: var(--teal); box-shadow: 0 4px 0 #075e60; }
.top .basket-link { background: var(--gold); color: var(--night); padding: 6px 14px; border-radius: 999px; opacity: 1; }
.basket-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 18px;
  background: var(--night); color: #fff; padding: 10px 10px 10px 22px; border-radius: 999px; box-shadow: 0 10px 30px rgba(27, 18, 80, .35);
  width: max-content; max-width: calc(100% - 24px); }
.basket-bar[hidden] { display: none; }
.basket-summary { font-weight: 700; white-space: nowrap; }
.basket-bar .btn { font-size: 18px; padding: 8px 20px; }
body.has-basket .foot { padding-bottom: 96px; }

/* Host login beside Join a game: both stay on one line on a phone. */
@media (max-width: 760px) {
  .top nav { gap: 10px; }
  .top nav a, .brand span { white-space: nowrap; }
}
@media (max-width: 400px) {
  .top { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .brand { font-size: 19px; gap: 5px; }
  .brand img { width: 28px; height: 28px; }
  .top nav { font-size: 15px; gap: 8px; }
  .top .join-link { padding: 5px 9px; }
}
@media (max-width: 430px) { .top .brand span { display: none; } } /* phones: just the rocket, to leave room for Host login, Join and the menu */

/* ---------- the shop's own pages: packs, bundles, good to know ---------- */
.top nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 6px; }
main.sub > section { padding-top: clamp(40px, 6vw, 72px) !important; }
main.sub h1 { font-size: clamp(40px, 5.4vw, 64px); font-weight: 800; }

/* The home page's way into the shop: two doors. */
.shop-doors { text-align: center; }
.shop-doors .packs-intro { max-width: 40em; }
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 34px); max-width: 980px; margin: 0 auto; }
@media (max-width: 680px) { .doors { grid-template-columns: 1fr; } }
.door { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; background: #fff; border-radius: 26px; padding: 30px 24px 26px;
  box-shadow: 8px 8px 0 rgba(27, 18, 80, .12); transition: transform .2s, box-shadow .2s; }
.door:hover { transform: translateY(-4px); box-shadow: 10px 12px 0 rgba(27, 18, 80, .16); }
.door.bundles { background: var(--night); color: #fff; }
.door.bundles p { color: #d6cff5; }
.door-emoji { font-size: 60px; line-height: 1; }
.door p { margin: 0; color: var(--muted); max-width: 26em; }
.door .door-live { font-weight: 700; color: var(--violet); min-height: 1.5em; }
.door.bundles .door-live { color: var(--gold); }
.door .btn { margin-top: 8px; }
.faq-door { text-align: center; max-width: 760px !important; }
.faq-door h2 { margin-bottom: 14px; }
.faq-door a { color: var(--violet); font-weight: 700; }

/* Under the packs: a way to the bundles. */
.bundle-strip { margin-top: clamp(28px, 4vw, 48px); display: flex; align-items: center; gap: 18px; text-decoration: none; background: var(--night); color: #fff; border-radius: 22px; padding: 20px clamp(20px, 3vw, 32px); }
.bundle-strip span span { color: #d6cff5; }
.strip-emoji { font-size: 44px; line-height: 1; }
.strip-go { margin-left: auto; font-size: 30px; color: var(--gold); transition: transform .2s; }
.bundle-strip:hover .strip-go { transform: translateX(6px); }

/* The bundles. */
.bundle-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: clamp(20px, 2.6vw, 34px); }
.bundle-shelf:empty { display: none; }
.bundle-card { display: flex; flex-direction: column; gap: 12px; background: var(--paper); border-radius: 24px; padding: 24px; box-shadow: 8px 8px 0 rgba(27, 18, 80, .12); }
.bundle-card.every { background: var(--night); color: #fff; }
.bundle-card.every .bc-text, .bundle-card.every .bc-count, .bundle-card.every .bc-worth s { color: #d6cff5; }
.bundle-card.every .btn.buy:disabled { background: rgba(255, 255, 255, .14); color: #d6cff5; }
.bc-head { display: flex; align-items: center; gap: 14px; }
.bc-pic { flex: none; width: 64px; height: 64px; display: grid; place-items: center; font-size: 48px; }
.bc-pic img { width: 64px; height: 64px; }
.bc-count { margin: 2px 0 0; color: var(--muted); font-weight: 700; font-size: .9em; }
.bc-text { margin: 0; color: var(--muted); }
.bc-packs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.bc-packs li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.bc-packs li img, .bc-packs li > span:first-child { width: 28px; height: 28px; flex: none; font-size: 22px; line-height: 28px; text-align: center; }
.bc-worth { margin: 0; min-height: 1.5em; }
.bc-worth s { color: var(--muted); }
.bc-worth b { background: var(--gold); color: var(--night); border-radius: 999px; padding: 1px 10px; margin-left: 6px; font-size: .9em; }
.bundle-card .buy-row { margin-top: auto; }

.top nav a { white-space: nowrap; }

/* ---------- the Who wrote that? scene ---------- */
.ww-art { background: linear-gradient(150deg, #ff5f6d, #ffc371 45%, #3ec7a6); }
.r-tv.ww { min-height: 330px; overflow: hidden; }
.r-note { margin: 4px auto 0; width: max-content; max-width: 90%; background: #fffbea; color: #1f2937; border-radius: 6px; padding: 10px 20px 8px; rotate: -2deg;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Segoe Print', cursive; font-weight: 700; font-size: clamp(22px, 2.6vw, 30px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25); opacity: 0; transform: scale(.6); transition: opacity .35s, transform .45s cubic-bezier(.2, 1.6, .4, 1); }
.show-note .r-note { opacity: 1; transform: none; }
.r-ask { text-align: center; font-family: var(--display); font-weight: 800; font-size: 20px; margin: 14px 0 8px; }
.r-ask small { display: block; font-family: var(--text); font-weight: 400; font-size: 13px; color: #c9c1f2; }
.r-guessers { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.r-guesser { position: relative; display: flex; flex-direction: column; align-items: center; opacity: .45; transition: opacity .25s; }
.r-guesser.tapped { opacity: 1; }
.r-guesser.tapped::after { content: '✓'; position: absolute; top: -4px; right: -6px; background: #16a34a; color: #fff; border-radius: 999px; width: 18px; height: 18px;
  font-size: 12px; line-height: 18px; text-align: center; animation: r-tick .3s ease-out; }
@keyframes r-tick { from { transform: scale(0); } }
.r-gav { font-size: 28px; line-height: 1; }
.r-gname { font-size: 12px; color: #c9c1f2; }
.r-reveal { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(20px); transition: opacity .45s, transform .45s; }
.show-reveal .r-reveal { opacity: 1; transform: none; }
.show-reveal .r-ask, .show-reveal .r-guessers { opacity: 0; transition: opacity .3s; }
.r-it { background: linear-gradient(180deg, #ffe08a, #ffc83d); color: var(--night); border-radius: 14px; padding: 6px 22px 4px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 24px; box-shadow: 0 5px 0 #b7791f; }
.r-it small { display: block; font-size: 13px; line-height: 1; }
.r-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; }
.r-points span { background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px 1px; }
.r-points .right { background: #dcfce7; color: #166534; }

/* Less empty space between the home page sections. */
main > section:not(.hero) { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(40px, 5vw, 72px); }
.game:last-child { margin-bottom: 0; }

/* ---------- Good to know: putting Kwiz Rocket on a phone's home screen ---------- */
/* One 15-second loop of five 3-second scenes (the page, then a scene per tap, then the home screen): each layer and step uses a shared keyframe with a delay of 0, 3, 6, 9 or 12s. */
/* Same width as the questions above it, and close under them; the two phones stack. */
main.sub > section.homescreen { max-width: 860px; padding-top: 8px !important; }
.homescreen h2 { font-size: clamp(30px, 3.6vw, 44px); }
.hs-intro { color: var(--muted); max-width: 46em; margin: 12px 0 clamp(24px, 3vw, 36px); }
.device-switch { margin-bottom: clamp(18px, 2.4vw, 26px); }
.device-switch[hidden], .hs-card[hidden] { display: none; }
.hs-wrap { display: grid; gap: clamp(20px, 3vw, 32px); }
.hs-card { --t: 15s; background: #fff; border-radius: 28px; padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 48px); box-shadow: 8px 8px 0 rgba(27, 18, 80, .08);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 24px clamp(24px, 5vw, 56px); }
.hs-text { flex: 1 1 220px; }
.hs-text h3 { font-size: 26px; margin-bottom: 10px; }
.hs-steps { list-style: none; margin: 0; padding: 0; counter-reset: hs; display: grid; gap: 6px; }
.hs-steps { font-size: .92em; }
.hs-steps li { counter-increment: hs; position: relative; padding: 8px 10px 8px 44px; border-radius: 12px; color: var(--muted); animation: hs-lit var(--t) infinite; }
.hs-steps li::before { content: counter(hs); position: absolute; left: 10px; top: 7px; width: 24px; height: 24px; border-radius: 50%; background: var(--violet); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 26px; text-align: center; }
.hs-steps li strong { color: var(--ink); }
.hs-steps li:nth-child(2) { animation-delay: 3s; }
.hs-steps li:nth-child(3) { animation-delay: 6s; }
.hs-steps li:nth-child(4) { animation-delay: 9s; animation-name: hs-lit2; }
@keyframes hs-lit { 0%, 19% { background: #f1eafe; color: var(--ink); } 22%, 100% { background: transparent; color: var(--muted); } }
@keyframes hs-lit2 { 0%, 39% { background: #f1eafe; color: var(--ink); } 42%, 100% { background: transparent; color: var(--muted); } }

/* The phone. */
.hs-phone { flex: 0 0 auto; width: 196px; aspect-ratio: 9 / 19.5; background: #0c0826; border-radius: 34px; padding: 8px; box-shadow: 0 18px 40px rgba(27, 18, 80, .3); }
.hs-screen { position: relative; height: 100%; border-radius: 27px; overflow: hidden; background: linear-gradient(180deg, #3a1d7a, #1b1250); color: #fff; font-size: 10px; line-height: 1.2; }
.hs-phone.android { border-radius: 26px; }
.hs-phone.android .hs-screen { border-radius: 19px; }
.hs-screen img { display: block; }
.hs-status { position: absolute; z-index: 6; top: 0; left: 0; right: 0; height: 24px; display: flex; justify-content: space-between; align-items: center; padding: 2px 18px 0; font-weight: 700; font-size: 9px; }
.ios .hs-status::after { content: ''; position: absolute; left: 50%; top: 6px; width: 54px; height: 15px; margin-left: -27px; border-radius: 10px; background: #000; }
.android .hs-status { padding: 0 14px; }
.android .hs-status::after { content: ''; position: absolute; left: 50%; top: 7px; width: 9px; height: 9px; margin-left: -4px; border-radius: 50%; background: #000; }
.hs-app { position: absolute; left: 0; right: 0; top: 24px; bottom: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.android .hs-app { top: 56px; bottom: 0; }
.hs-app img { width: 44px; height: 44px; border-radius: 11px; }
.hs-app b { font-family: var(--display); font-weight: 800; font-size: 17px; }
.hs-app b i { font-style: normal; color: var(--gold); }
.hs-input { align-self: stretch; background: #fff; color: #9a95b5; border-radius: 8px; text-align: center; padding: 7px 0; font-weight: 700; }
.hs-join { align-self: stretch; background: #16a34a; border-radius: 8px; text-align: center; padding: 6px 0; font-family: var(--display); font-weight: 800; font-size: 12px; box-shadow: 0 3px 0 #0e6b31; }
.hs-url { display: block; background: #fff; color: #333; border-radius: 9px; padding: 5px 8px; text-align: center; font-size: 9px; white-space: nowrap; overflow: hidden; }
.hs-safari { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; background: #f2f2f7; color: #0a84ff; padding: 7px 10px 0; }
.hs-tools { display: flex; justify-content: space-between; align-items: center; padding: 7px 6px 0; font-size: 14px; line-height: 1; }
.hs-chrome { position: absolute; left: 0; right: 0; top: 24px; height: 32px; background: #fff; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 8px; }
.hs-chrome .hs-url { flex: 1; background: #eef0f3; text-align: left; border-radius: 14px; }
.hs-dots { position: relative; color: #444; font-size: 16px; font-weight: 700; padding: 0 6px; }
.hs-share, .hs-hit, .hs-bold { position: relative; }
.hs-share svg { display: block; }
.hs-rows { list-style: none; margin: 0; padding: 0; }

/* A tap: a gold ring that presses in. */
.hs-tap { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(255, 200, 61, .5);
  border: 2px solid var(--gold); opacity: 0; pointer-events: none; animation: hs-tap var(--t) 3s infinite; }
.hs-hit .hs-tap { left: 70%; }
.hs-tap.t2 { animation-delay: 6s; }
.hs-tap.t3 { animation-delay: 9s; }
@keyframes hs-tap { 0%, 5% { opacity: 0; transform: scale(1.6); } 8% { opacity: 1; transform: scale(1); } 11% { transform: scale(.7); } 14% { opacity: 1; transform: scale(1); } 18%, 100% { opacity: 0; transform: scale(1.4); } }

/* Layers that come and go. */
.hs-dim { position: absolute; inset: 0; z-index: 2; background: rgba(0, 0, 0, .35); opacity: 0; animation: hs-dim var(--t) 6s infinite; }
.hs-dim.late { animation-name: hs-fade; animation-delay: 9s; }
@keyframes hs-dim { 0% { opacity: 0; } 3%, 38% { opacity: 1; } 41%, 100% { opacity: 0; } }
@keyframes hs-fade { 0% { opacity: 0; } 3%, 19% { opacity: 1; } 22%, 100% { opacity: 0; } }
.hs-sheet, .hs-add { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; background: #f2f2f7; color: #111; border-radius: 16px 16px 0 0; padding: 12px 10px 16px;
  transform: translateY(105%); animation: hs-up var(--t) 6s infinite; }
.hs-add { z-index: 4; top: 30px; animation-delay: 9s; }
@keyframes hs-up { 0% { transform: translateY(105%); } 4%, 19% { transform: none; } 22%, 100% { transform: translateY(105%); } }
.hs-sheet-head, .hs-add-body { display: flex; align-items: center; gap: 8px; }
.hs-sheet-head { margin-bottom: 10px; }
.hs-sheet-head img { width: 28px; height: 28px; border-radius: 7px; }
.hs-add-body img { width: 38px; height: 38px; border-radius: 9px; }
.hs-sheet-head small, .hs-add-body small { display: block; color: #888; font-size: 8px; }
.hs-sheet .hs-rows { background: #fff; border-radius: 10px; }
.hs-sheet li { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #e5e5ea; }
.hs-sheet li:last-child { border: 0; }
.hs-add-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 9px; }
.hs-blue { color: #0a84ff; }
.hs-bold { font-weight: 700; }
.hs-add .hs-add-body { background: #fff; border-radius: 10px; padding: 8px; }
.hs-note { margin: 8px 2px 0; color: #888; font-size: 8px; }
.hs-menu { position: absolute; z-index: 3; top: 28px; right: 4px; width: 64%; background: #fff; color: #222; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); padding: 4px 0;
  transform-origin: top right; transform: scale(.2); opacity: 0; animation: hs-drop var(--t) 6s infinite; }
.hs-menu li { padding: 7px 12px; }
.hs-menu .hs-hit { background: #eef0f3; }
.hs-dlg { position: absolute; z-index: 4; left: 9%; right: 9%; top: 34%; background: #fff; color: #222; border-radius: 16px; padding: 12px; display: grid; gap: 10px;
  transform: scale(.2); opacity: 0; animation: hs-drop var(--t) 9s infinite; }
.hs-dlg > b { font-size: 12px; }
.hs-dlg-btns { display: flex; justify-content: flex-end; gap: 14px; color: #1a73e8; }
@keyframes hs-drop { 0% { transform: scale(.2); opacity: 0; } 3%, 19% { transform: none; opacity: 1; } 22%, 100% { transform: scale(.2); opacity: 0; } }
.hs-home { position: absolute; inset: 0; z-index: 5; background: linear-gradient(160deg, #ff9a8b, #7c3aed 55%, #0d3b66); opacity: 0; animation: hs-fade var(--t) 12s infinite; }
.hs-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 10px; padding: 40px 14px 0; justify-items: center; }
.hs-apps i { width: 30px; height: 30px; border-radius: 8px; background: var(--c); opacity: .9; }
.android .hs-apps i { border-radius: 50%; }
.hs-new { display: flex; flex-direction: column; align-items: center; gap: 3px; transform: scale(0); opacity: 0; animation: hs-pop var(--t) 12s infinite; }
.hs-new img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 2px var(--gold); }
.android .hs-new img { border-radius: 50%; }
.hs-new small { font-size: 7px; font-weight: 700; white-space: nowrap; }
@keyframes hs-pop { 0%, 5% { transform: scale(0); opacity: 0; } 10% { transform: scale(1.3); opacity: 1; } 13%, 19% { transform: scale(1); opacity: 1; } 22%, 100% { transform: scale(0); opacity: 0; } }

/* Without motion: no loop, just the finished home screen. */
@media (prefers-reduced-motion: reduce) {
  .hs-card * { animation: none !important; }
  .hs-home, .hs-new { opacity: 1; transform: none; }
}

/* ---------- Home page: what hosts say (reviews from the app) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reviews-home[hidden] { display: none; }
.reviews-home { text-align: center; }
.rv-average { margin: 10px 0 clamp(22px, 3vw, 34px); color: var(--muted); }
.rv-average b { font-family: var(--display); font-weight: 800; font-size: 1.5em; color: var(--ink); }
.rv-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(16px, 2.4vw, 28px); text-align: left; }
.rv-quote { margin: 0; background: #fff; border-radius: 22px; padding: 22px 24px; box-shadow: 8px 8px 0 rgba(27, 18, 80, .08); display: flex; flex-direction: column; gap: 10px; }
.rv-stars { color: var(--gold); font-size: 22px; letter-spacing: 2px; text-shadow: 0 2px 0 #c9921a; }
.rv-stars span { color: #ddd5f5; text-shadow: none; }
.rv-quote blockquote { margin: 0; font-size: 1.05em; color: var(--ink); }
.rv-quote figcaption { margin-top: auto; font-family: var(--display); font-weight: 800; color: var(--violet); }
.rv-how { margin: 18px 0 0; font-size: .9em; }
.rv-how a { color: var(--muted); }

/* ---------- Gift vouchers page ---------- */
/* The form on the left, a live preview of the gift card on the right; stacked on a phone. */
.gift-layout, .gifts-page > .gift-small { width: min(1080px, 100%); margin-left: max(0px, calc((100% - 1240px) / 2)); }
.gift-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .gift-layout { grid-template-columns: 1fr; } }
.gift-side { position: sticky; top: 24px; display: grid; gap: 22px; }
.gift-preview { background: #fff; border-radius: 24px; overflow: hidden; text-align: center; box-shadow: 0 22px 50px rgba(27, 18, 80, .22); transform: rotate(-1.5deg); }
.gp-top { background: linear-gradient(160deg, #2c1a6e, #1b1250 60%, #0d3b66); color: #fff; padding: 22px 20px; }
.gp-logo { font-weight: 800; font-size: 20px; }
.gp-logo b { color: var(--gold); }
.gp-bow { font-size: 46px; line-height: 1; margin: 8px 0 2px; }
.gp-head { color: #d6cff5; font-weight: 700; }
.gp-amount { font-family: var(--display); font-weight: 800; font-size: clamp(54px, 7vw, 72px); line-height: 1; color: var(--gold); margin-top: 6px; text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.gp-body { padding: 18px 22px 22px; display: grid; gap: 10px; }
.gp-to { font-weight: 800; font-size: 20px; color: var(--night); overflow-wrap: anywhere; }
.gp-msg { margin: 0; font-style: italic; color: #4a4566; overflow-wrap: anywhere; }
.gp-code { justify-self: center; font: 800 18px/1 ui-monospace, Consolas, monospace; letter-spacing: 2px; background: #f4f0ff; border: 2px dashed #b9a6f5; border-radius: 12px; padding: 10px 14px; color: var(--night); }
.gp-valid { margin: 0; color: var(--muted); font-size: .85em; }
.gift-steps { margin: 0; padding: 0; list-style: none; counter-reset: gs; display: grid; gap: 12px; }
.gift-steps li { counter-increment: gs; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; color: var(--muted); }
.gift-steps li::before { content: counter(gs); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; font-weight: 800; }
.gift-steps b { color: var(--ink); }
@media (max-width: 900px) { .gift-side { position: static; } .gift-preview { transform: none; max-width: 420px; margin: 0 auto; width: 100%; } }
.gift-form { background: var(--paper); border-radius: 28px; padding: clamp(20px, 3vw, 32px); box-shadow: 8px 8px 0 rgba(27, 18, 80, .08); display: grid; gap: 18px; }
.gift-amounts { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gift-amounts legend { font-family: var(--display); font-weight: 800; font-size: 22px; margin-bottom: 10px; padding: 0; }
.gift-amount { position: relative; cursor: pointer; }
.gift-amount input { position: absolute; opacity: 0; }
.gift-amount span { display: grid; gap: 2px; text-align: center; border-radius: 18px; padding: 16px 8px 12px; border: 3px solid #ddd5f5; background: var(--paper); transition: border-color .15s, background .15s, transform .1s; }
.gift-amount b { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4vw, 40px); line-height: 1; color: var(--night); }
.gift-amount small { color: var(--muted); font-size: .85em; }
.gift-amount input:checked + span { border-color: var(--violet); background: #f1eafe; transform: translateY(-2px); }
.gift-amount input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
.gift-field { display: grid; gap: 6px; font-weight: 700; }
.gift-field small { font-weight: 400; color: var(--muted); }
.gift-field input, .gift-field textarea { font: inherit; font-weight: 400; border: 2px solid #ddd5f5; border-radius: 12px; padding: 10px 12px; resize: vertical; }
.gift-form .btn { justify-self: start; }
.gift-added { margin: 0; color: #15803d; font-weight: 700; }
.gift-added:empty { display: none; }
.gift-small { color: var(--muted); font-size: .9em; margin-top: 18px; }
/* Six menu links now: keep the name on one line, and the links a little closer on middling screens. */
.top .brand span { white-space: nowrap; }

/* ---------- the menu: page links on a wide screen, a ☰ menu on a narrower one ----------
   Host login, Join a game (and the basket) always stay on the bar. Opened by menu.js. */
.legal-top { position: relative; }
.nav-links { display: contents; }
.menu-btn { display: none; width: 44px; height: 40px; border: 2px solid rgba(255, 255, 255, .55); border-radius: 12px; background: none; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; color: #fff; }
.menu-btn span { display: block; width: 20px; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
nav.open .menu-btn span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
nav.open .menu-btn span:nth-child(2) { opacity: 0; }
nav.open .menu-btn span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; }
  .nav-links { display: none; position: absolute; z-index: 30; top: calc(100% - 6px); right: clamp(12px, 4vw, 56px); min-width: 230px;
    flex-direction: column; padding: 8px; border-radius: 18px; background: var(--night); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }
  nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 16px; border-radius: 12px; font-size: 18px; }
  .nav-links a:hover, .nav-links a:focus-visible { background: rgba(255, 255, 255, .1); text-decoration: none; }
  .nav-links a[aria-current="page"] { background: rgba(255, 255, 255, .12); text-decoration: none; }
}
@media (max-width: 400px) { .menu-btn { width: 38px; height: 34px; } }
