/* The game pages built the way Spelling Bee Revolt and Party Game Revolt build a
   screen (the house method, root CLAUDE.md "Game looks"): a deep, lit stage;
   glossy rounded panels floating on it with a coloured rim; one big hero piece;
   gold gradient buttons with a highlight and a soft shadow; heavy condensed
   headlines (Encode Sans Condensed) and Inter for reading.

   One stylesheet for /spellingbee and /partygame. Each page's <body> carries a
   theme class (t-sb, t-pg) that sets only the colours below.

   Spacing: a section's padding is the only space at its top and foot; the
   things inside a section are spaced by their container's gap, never by their
   own margins (so a last paragraph can't bring extra space). The sizes are the
   --s* variables. Check with tool/check_spacing.js before showing a change. */

:root {
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --sec: clamp(64px, 8vw, 104px);
  --nav-h: 64px;
  --wrap: 1160px;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --head: 'Encode Sans Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Themes ─────────────────────────────────────────────────────────────── */
.t-sb {
  --top: #0C5E69;
  --mid: #08414F;
  --bottom: #06323F;
  --nav: rgba(6, 50, 63, 0.94);
  --panel-top: rgba(7, 58, 70, 0.92);
  --panel-bottom: rgba(4, 38, 48, 0.94);
  --rim: #43D8C9;
  --rim-soft: rgba(67, 216, 201, 0.45);
  --glow: rgba(67, 216, 201, 0.22);
  --text: #F3FBFA;
  --dim: #BFE2DE;
  --faint: #8DBDB7;
  --accent: #4EDECD;
  --ink: #0B3440;
  --field: rgba(3, 30, 38, 0.75);
}
.t-pg {
  --top: #321F7C;
  --mid: #1E1C54;
  --bottom: #0F0D3B;
  --nav: rgba(30, 28, 84, 0.95);
  --panel-top: rgba(58, 42, 146, 0.9);
  --panel-bottom: rgba(30, 28, 84, 0.94);
  --rim: #28D6FF;
  --rim-soft: rgba(40, 214, 255, 0.45);
  --glow: rgba(40, 214, 255, 0.22);
  --text: #F9F8FF;
  --dim: #D3CEF6;
  --faint: #A9A3DD;
  --accent: #28D6FF;
  --pink: #FF5AAE;
  --cream: #FFF3DA;
  --ink: #1E1C54;
  --field: rgba(15, 13, 59, 0.72);
}
:root {
  --gold: #FFC84A;
  --gold-light: #FFE7A0;
  --gold-deep: #E89A12;
  --gold-shadow: #A86A06;
  --ok: #4FE08A;
  --error: #FF8FB8;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bottom);
  min-height: 100vh;
  overflow-x: hidden;
}
/* The stage: fixed behind everything, so long pages stay on it. */
.stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--top) 0%, transparent 70%),
    linear-gradient(180deg, var(--mid) 0%, var(--bottom) 100%);
}
.t-sb .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/spellingbee/stage.webp') center top / cover no-repeat;
  opacity: 0.85;
}
.t-pg .stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 30%, rgba(255, 90, 174, 0.14) 0, transparent 38%),
    radial-gradient(circle at 88% 62%, rgba(40, 214, 255, 0.12) 0, transparent 40%);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
strong { color: var(--text); font-weight: 700; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.wrap--narrow { width: min(820px, 100% - 48px); }

h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 4.6vw, 3.7rem); font-weight: 900; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: 1.5rem; }
.gold { color: var(--gold); }
.pink { color: var(--pink); }
.accent { color: var(--accent); }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 0 24px;
  background: var(--nav);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rim-soft);
}
.nav-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--head);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-home:hover { color: var(--text); }
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.2rem;
}
.nav-brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-right { display: flex; align-items: center; gap: var(--s2); }
.nav-link { color: var(--dim); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav-link:hover { color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  border: 0;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn--gold {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 46%, var(--gold-deep) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 5px 0 var(--gold-shadow), 0 12px 28px rgba(0, 0, 0, 0.35);
}
.btn--gold:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn--gold:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 2px 0 var(--gold-shadow), 0 6px 16px rgba(0, 0, 0, 0.3); }
.btn--glass {
  color: var(--text);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: inset 0 0 0 2px var(--rim-soft), 0 10px 24px rgba(0, 0, 0, 0.25);
}
.btn--glass:hover { box-shadow: inset 0 0 0 2px var(--rim), 0 10px 24px rgba(0, 0, 0, 0.25); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 1rem; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 3px 0 var(--gold-shadow); }

/* ── Chips and panels ───────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--gold);
  color: var(--gold);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  align-self: flex-start;
}
.chip--beta { border-color: var(--rim); color: var(--gold); background: var(--ink); box-shadow: 0 0 18px var(--glow); }
.chip--quiet { border-color: var(--rim-soft); color: var(--dim); }
.panel {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 2px solid var(--rim-soft);
  border-radius: var(--r);
  box-shadow: 0 0 40px var(--glow), 0 18px 40px rgba(0, 0, 0, 0.3);
}

.eyebrow {
  font-family: var(--head);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: 1.15rem; color: var(--dim); max-width: 680px; }
.fine { font-size: 0.9rem; color: var(--faint); }
.sec-head { display: flex; flex-direction: column; gap: 12px; }
.sec-head--center { align-items: center; text-align: center; }
.sec-head--center .lead { margin-inline: auto; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: calc(var(--nav-h) + 56px) 0 var(--sec); }
.hero-in {
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--s5);
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.hero-logo { width: min(340px, 78%); height: auto; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.35)); }
.hero-copy .lead { font-size: 1.2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s2); }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.95rem; color: var(--dim); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* The TV with a phone in front of it. The phone hangs over the TV's corner,
   inside the rig's own box (its padding is that room), so nothing below has
   to leave space for it. */
.rig { position: relative; padding: 0 13% 15% 0; }
.tv {
  position: relative;
  padding: 10px;
  border-radius: 18px;
  background: #070B10;
  box-shadow: 0 0 0 2px var(--rim-soft), 0 0 60px var(--glow), 0 30px 70px rgba(0, 0, 0, 0.5);
}
.tv img { border-radius: 10px; width: 100%; }
.phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 27%;
  padding: 7px;
  border-radius: 30px;
  background: #070B10;
  box-shadow: 0 0 0 2px var(--rim-soft), 0 24px 50px rgba(0, 0, 0, 0.55);
}
.phone img { border-radius: 24px; width: 100%; }
.rig--solo { padding: 0; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.sec { padding: var(--sec) 0; }
.sec--band { background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.12)); border-block: 1px solid rgba(255, 255, 255, 0.06); }

.setup-line { font-size: 1.1rem; color: var(--dim); max-width: 860px; }
.setup-line strong { color: var(--gold); }

/* Steps: picture on top, words below; the pictures share one height. */
.beats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.beats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.beat { display: flex; flex-direction: column; gap: var(--s2); }
.beat-shot {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid var(--rim-soft);
  overflow: hidden;
}
.beat-shot img { width: 100%; height: 100%; object-fit: cover; }
.beat-shot--phone { padding: 14px 0 0; align-items: flex-start; }
.beat-shot--phone img { width: 46%; height: auto; object-fit: contain; border-radius: 18px 18px 0 0; }
.beat-text { display: flex; flex-direction: column; gap: 6px; }
.beat-n { font-family: var(--head); font-weight: 800; font-size: 1.2rem; color: var(--gold); }
.beat-text p { color: var(--dim); font-size: 1rem; }

/* Cards in a grid (games, features). */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.card h3 { font-size: 1.45rem; }
.game h3, .mode h3 { font-size: 1.9rem; text-transform: uppercase; }
.card-sub { font-family: var(--head); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.card p { color: var(--dim); font-size: 1rem; }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.card-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--gold); color: var(--ink); }
.card-icon svg { width: 28px; height: 28px; }

/* A game card with its screenshot on top. */
.game { padding: 0; overflow: hidden; }
.game > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--rim-soft); }
.game-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; flex: 1; }
.game-pitch { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: var(--text); line-height: 1.25; }

/* Words beside a picture. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s5); align-items: center; }
.split--flip > :first-child { order: 2; }
.split-copy { display: flex; flex-direction: column; gap: var(--s3); }
.split-shot { border-radius: var(--r); overflow: hidden; border: 2px solid var(--rim-soft); box-shadow: 0 0 40px var(--glow), 0 18px 40px rgba(0, 0, 0, 0.35); }

.ticks { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.ticks li { position: relative; padding-left: 34px; color: var(--dim); }
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B3440' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.ticks strong { color: var(--text); }

/* Numbered how-to. */
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: var(--s2); padding: 32px; }
.steps li { counter-increment: step; position: relative; padding-left: 56px; color: var(--dim); min-height: 40px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--head);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 3px 0 var(--gold-shadow);
}
.steps strong { color: var(--text); }

/* A plain table in a panel. */
.table-wrap { overflow-x: auto; padding: 8px 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
.table th { font-family: var(--head); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.table td { color: var(--dim); }
.table td:first-child { font-family: var(--head); font-weight: 800; font-size: 1.1rem; color: var(--text); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

/* ── Sign-up ────────────────────────────────────────────────────────────── */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s4); padding: 36px; align-items: start; }
.signup-copy { display: flex; flex-direction: column; gap: var(--s2); }
.signup-copy p { color: var(--dim); }
.signup-form { display: flex; flex-direction: column; gap: 14px; }
.signup-label { font-family: var(--head); font-weight: 800; font-size: 1.25rem; }
.signup-row { display: flex; gap: 12px; }
.signup-input {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid var(--rim-soft);
  background: var(--field);
  color: var(--text);
  font: 500 1.05rem var(--body);
}
.signup-input::placeholder { color: var(--faint); }
.signup-input:focus { outline: none; border-color: var(--rim); box-shadow: 0 0 0 4px var(--glow); }
.signup-input--bad { border-color: var(--error); }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--dim); font-size: 1rem; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--rim-soft);
  background: var(--field);
  display: grid;
  place-items: center;
  color: transparent;
}
.check-box svg { width: 18px; height: 18px; }
.check input:checked + .check-box { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.check input:focus-visible + .check-box { outline: 3px solid var(--gold); outline-offset: 2px; }
.signup-msg { font-size: 0.92rem; color: var(--faint); min-height: 1.6em; }
.signup-msg--error { color: var(--error); }
.signup-msg--ok { color: var(--ok); font-weight: 600; }
.signup-msg:empty { display: none; }
.signup-done { font-family: var(--head); font-weight: 800; font-size: 1.4rem; color: var(--gold); line-height: 1.3; }

/* ── Questions ──────────────────────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { padding: 0; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 56px 20px 24px;
  position: relative;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--gold);
}
.faq details[open] summary::after { content: '–'; }
.faq-a { padding: 0 24px 22px; color: var(--dim); display: flex; flex-direction: column; gap: 10px; }

/* ── Cross-links ────────────────────────────────────────────────────────── */
.more { display: flex; gap: 20px; align-items: center; padding: 22px 24px; text-decoration: none; color: var(--text); transition: border-color 0.15s ease, transform 0.15s ease; }
.more:hover { border-color: var(--rim); transform: translateY(-2px); }
.more img { flex: none; width: 120px; height: auto; }
.more-copy { display: flex; flex-direction: column; gap: 4px; }
.more-name { font-family: var(--head); font-weight: 800; font-size: 1.35rem; }
.more-text { color: var(--dim); font-size: 0.98rem; }
.more-go { font-family: var(--head); font-weight: 800; color: var(--gold); }

/* ── Closing ────────────────────────────────────────────────────────────── */
.closing { text-align: center; align-items: center; }
.closing .hero-ctas { justify-content: center; }
.closing .lead { margin-inline: auto; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.foot {
  padding: 32px 24px;
  border-top: 1px solid var(--rim-soft);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  font-size: 0.9rem;
  color: var(--faint);
}
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ── Smaller screens ────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .hero-in, .split, .signup { grid-template-columns: minmax(0, 1fr); }
  .split--flip > :first-child { order: 0; }
  .beats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --nav-h: 58px; --s4: 32px; --s5: 40px; }
  body { font-size: 16px; }
  .nav { padding: 0 14px; }
  .nav-brand span, .nav-link { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 32px); }
  .wrap, .hero-in, .wrap--narrow { width: calc(100% - 32px); }
  .beats, .beats--3, .cards, .cards--2 { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; }
  .hero-ctas { width: 100%; }
  .btn--sm { width: auto; }
  .signup { padding: 24px 20px; }
  .signup-row { flex-direction: column; }
  .steps { padding: 24px 20px; }
  .card { padding: 22px; }
  .more { flex-direction: column; align-items: flex-start; }
  .foot { flex-direction: column; align-items: flex-start; }
  /* The picking table becomes one block per game: name, then the rest. */
  .table thead { display: none; }
  .table tr { display: block; padding: 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0; border: 0; }
  .table td:first-child { margin-bottom: 2px; }
  .table td:nth-child(2) { font-family: var(--head); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .more { transition: none; }
}
