/* Quiz 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; }
@media (max-width: 760px) { .top nav a:not(.join-link) { display: none; } }

/* ---------- 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); }
.sheep.pink { transform: translateY(-14px) rotate(-6deg); }
@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)); }
.cover-title { 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; }
.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: #f472b6; }
.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: #db2777; 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; }
.show-banner .r-banner { opacity: 1; transform: none; }

/* ---------- movement as you scroll (reels.js adds these only when motion is welcome) ---------- */
.steps li.will-arrive { opacity: 0; transform: translateY(18px); transition: opacity .5s ease-out, transform .5s ease-out; }
.steps li.will-arrive .mark { transform: scale(.4) rotate(-40deg); transition: transform .6s cubic-bezier(.3, 1.6, .5, 1); transition-delay: inherit; }
.steps li.arrived { opacity: 1; transform: none; }
.steps li.arrived .mark { transform: none; }
.pack.will-arrive { opacity: 0; transform: translateY(-46px) rotate(-5deg); transition: opacity .35s ease-out, transform .7s cubic-bezier(.3, 1.5, .5, 1); }
.pack.will-arrive:nth-child(even) { transform: translateY(-46px) rotate(4deg); }
.pack.arrived { 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; }
