/* Family Gathering Games — one stylesheet for the site and the party app.
   System fonts only. Large type and high contrast by default: players span
   ages 8 to 90 and read the TV from across a dining room. */

:root {
  --cream: #FFF7EC;
  --paper: #FFFFFF;
  --ink: #2B1D14;
  --ink-soft: #6B5646;
  --pumpkin: #D9611E;
  --pumpkin-dark: #A8460F;
  --cranberry: #A3233A;
  --sage: #5E7D4D;
  --gold: #F2B33D;
  --sky: #2F6690;
  --line: rgba(43, 29, 20, 0.14);
  --shadow: 0 6px 24px rgba(43, 29, 20, 0.12);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --opt-0: #D9611E; --opt-1: #2F6690; --opt-2: #5E7D4D; --opt-3: #A3233A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 20px; line-height: 1.5; color: var(--ink);
  background: var(--cream); min-height: 100vh;
}
h1, h2, h3, p { margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; font-weight: 850; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.2; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
a { color: var(--pumpkin-dark); }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.small { font-size: 0.85rem; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 110px; }
.wrap-wide { max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ brand + nav */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand .mark { font-size: 1.6rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; max-width: 1040px; margin: 0 auto; }
.topbar nav a { margin-left: 16px; font-weight: 700; text-decoration: none; color: var(--ink); font-size: 0.95rem; }
footer.site { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 20px 40px; color: var(--ink-soft); font-size: 0.9rem; }
footer.site .cols { max-width: 1040px; margin: 0 auto; display: flex; gap: 32px; flex-wrap: wrap; justify-content: space-between; }
footer.site a { color: var(--ink-soft); }

/* ------------------------------------------------------------ cards, forms, buttons */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }
.field label { display: block; font-weight: 800; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink-soft); }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-size: 1.2rem; color: var(--ink); background: var(--cream);
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 60px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--gold); border-color: var(--pumpkin); background: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 64px; padding: 14px 24px; font: inherit; font-size: 1.2rem; font-weight: 850; color: #fff;
  background: var(--pumpkin); border: none; border-radius: 18px; cursor: pointer; text-decoration: none;
  box-shadow: 0 3px 0 var(--pumpkin-dark); -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--pumpkin-dark); }
.btn:focus-visible { outline: 4px solid var(--gold); outline-offset: 2px; }
.btn.secondary { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.btn.green { background: var(--sage); box-shadow: 0 3px 0 #3f5634; }
.btn.red { background: var(--cranberry); box-shadow: 0 3px 0 #6e1726; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.small { min-height: 48px; font-size: 1rem; padding: 10px 18px; width: auto; }
.btn.auto { width: auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 800; background: var(--line); }
.pill.on { background: var(--sage); color: #fff; }
.error { background: #FCE8EA; color: var(--cranberry); border-radius: 14px; padding: 14px 16px; font-weight: 700; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.seg button { font: inherit; font-weight: 800; font-size: 1rem; padding: 10px 16px; background: #fff; border: 0; cursor: pointer; min-height: 48px; color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; }

/* ------------------------------------------------------------ phone play */
.choice-grid { display: grid; gap: 12px; }
.choice {
  width: 100%; min-height: 76px; padding: 16px 18px; text-align: left; font: inherit; font-size: 1.25rem; font-weight: 800;
  color: #fff; border: 4px solid transparent; border-radius: 18px; cursor: pointer; display: flex; align-items: center; gap: 14px;
}
.choice .shape { font-size: 1.4rem; width: 1.6em; text-align: center; flex: none; }
.choice.o0 { background: var(--opt-0); } .choice.o1 { background: var(--opt-1); }
.choice.o2 { background: var(--opt-2); } .choice.o3 { background: var(--opt-3); }
.choice.plain { background: #fff; color: var(--ink); border-color: var(--line); }
.choice.picked { border-color: var(--ink); box-shadow: 0 0 0 4px var(--gold); }
.choice.dim { opacity: 0.35; }
.big-word { font-size: clamp(2.4rem, 12vw, 4.5rem); font-weight: 900; line-height: 1.05; text-align: center; margin: 12px 0; word-break: break-word; }
.status-pill { position: fixed; top: 10px; right: 10px; background: rgba(255,255,255,.95); border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; box-shadow: var(--shadow); z-index: 30; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom, 0); }
.tabbar button { flex: 1; min-height: 64px; font: inherit; font-size: 0.9rem; font-weight: 800; background: none; border: 0; color: var(--ink-soft); cursor: pointer; }
.tabbar button.on { color: var(--pumpkin-dark); }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.emoji-grid button { min-height: 56px; font-size: 1.6rem; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.emoji-grid button.on { border-color: var(--pumpkin); background: #FFF0E3; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.team-grid button { min-height: 64px; font: inherit; font-weight: 850; font-size: 1.1rem; border-radius: 16px; border: 3px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.team-grid button.on { border-color: var(--pumpkin); background: #FFF0E3; }

/* bingo */
.bingo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bingo button {
  aspect-ratio: 1 / 1; font: inherit; font-size: clamp(0.62rem, 2.9vw, 0.95rem); font-weight: 750; line-height: 1.15;
  padding: 4px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; overflow: hidden; word-break: break-word;
}
.bingo button.on { background: var(--sage); color: #fff; border-color: var(--sage); }
.bingo button.free { background: var(--gold); border-color: var(--gold); }

/* leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 2em; font-weight: 900; color: var(--ink-soft); text-align: center; }
.lb-name { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 900; color: var(--pumpkin-dark); }

/* ------------------------------------------------------------ stage (TV) */
body.stage { background: #FFF3E2; overflow-x: hidden; }
.stage-grid { display: grid; grid-template-columns: 1fr minmax(260px, 24vw); gap: 2vw; min-height: 100vh; padding: 2vw 2vw 110px; }
.stage-main { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.stage-side { display: flex; flex-direction: column; gap: 1.2vw; }
.stage-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 1.6vw; }
.join-code { font-size: clamp(2.4rem, 5vw, 5.5rem); font-weight: 900; letter-spacing: 0.06em; color: var(--pumpkin-dark); line-height: 1; }
.join-url { font-size: clamp(0.9rem, 1.3vw, 1.4rem); font-weight: 800; word-break: break-all; }
.qr { background: #fff; padding: 8px; border-radius: 16px; display: inline-block; }
.qr canvas { width: 100%; height: auto; max-width: 280px; image-rendering: pixelated; display: block; }
.stage-kicker { font-size: clamp(1rem, 1.6vw, 1.8rem); font-weight: 850; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.stage-q { font-size: clamp(2rem, 4.4vw, 5rem); font-weight: 900; line-height: 1.1; margin: 0.4em 0; }
.stage-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vw; }
.stage-opt { display: flex; align-items: center; gap: 1vw; color: #fff; font-size: clamp(1.3rem, 2.4vw, 2.8rem); font-weight: 850; border-radius: 22px; padding: 1.2vw 1.6vw; min-height: 9vh; position: relative; overflow: hidden; }
.stage-opt.o0 { background: var(--opt-0); } .stage-opt.o1 { background: var(--opt-1); }
.stage-opt.o2 { background: var(--opt-2); } .stage-opt.o3 { background: var(--opt-3); }
.stage-opt.wrong { opacity: 0.3; }
.stage-opt.right { box-shadow: 0 0 0 8px var(--gold); }
.stage-opt .bar { position: absolute; left: 0; bottom: 0; height: 8px; background: rgba(255,255,255,.85); transition: width .6s ease; }
.stage-opt .count { margin-left: auto; font-size: 0.8em; opacity: 0.95; }
.stage-big { font-size: clamp(2.6rem, 7vw, 8rem); font-weight: 900; line-height: 1; }
.stage-fact { font-size: clamp(1.1rem, 2vw, 2.2rem); font-weight: 700; color: var(--ink); background: #fff; border-radius: 20px; padding: 1.2vw 1.6vw; margin-top: 1.4vw; }
.board { display: grid; gap: 1vw; }
.board-row { display: flex; align-items: center; gap: 1.4vw; background: var(--sky); color: #fff; border-radius: 18px; padding: 1vw 1.6vw; font-size: clamp(1.3rem, 2.6vw, 3rem); font-weight: 850; }
.board-row .n { margin-left: auto; background: #fff; color: var(--sky); border-radius: 12px; padding: 0 0.6em; }
.notes { columns: 3 280px; column-gap: 1.4vw; }
.note { break-inside: avoid; background: #FFF9C9; border-radius: 6px; padding: 1vw 1.2vw; margin-bottom: 1.4vw; font-size: clamp(1.1rem, 1.8vw, 2rem); font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.08); transform: rotate(-0.6deg); }
.note:nth-child(2n) { transform: rotate(0.8deg); background: #E8F4DF; }
.note .by { display: block; font-size: 0.75em; color: var(--ink-soft); margin-top: 0.4em; }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.players span { background: var(--cream); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: clamp(0.85rem, 1.1vw, 1.2rem); }
.players span.done { background: var(--sage); color: #fff; }
.timer { font-size: clamp(2rem, 4vw, 4.4rem); font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--cranberry); }
.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(43, 29, 20, 0.94); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0)); color: #fff;
}
.controls .btn { width: auto; min-height: 56px; font-size: 1.05rem; }
.controls .spacer { flex: 1; }
.controls .hint { font-size: 0.85rem; opacity: 0.85; }
.peek { background: var(--ink); color: #fff; border-radius: 22px; padding: 1.4vw; text-align: center; user-select: none; }
.modal { position: fixed; inset: 0; background: rgba(43,29,20,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal .card { max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pack { text-align: left; font: inherit; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 14px 16px; cursor: pointer; color: var(--ink); }
.pack:hover, .pack:focus-visible { border-color: var(--pumpkin); }
.pack .t { font-weight: 850; font-size: 1.1rem; display: block; }
.pack .d { font-size: 0.9rem; color: var(--ink-soft); display: block; margin-top: 4px; }
.pack[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 820px) {
  .stage-grid { grid-template-columns: 1fr; padding: 16px 16px 140px; }
  .stage-options { grid-template-columns: 1fr; }
  .stage-side { order: 2; }
}

/* ------------------------------------------------------------ site / SEO pages */
.hero { padding: 36px 0 12px; }
.hero p.lede { font-size: 1.25rem; color: var(--ink-soft); max-width: 40em; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.cta-row .btn { width: auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
.tile { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: block; }
.tile .e { font-size: 2rem; }
.tile strong { display: block; font-size: 1.15rem; margin-top: 6px; }
.tile span { color: var(--ink-soft); font-size: 0.95rem; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; background: #fff; border-radius: 16px; padding: 14px 16px 14px 64px; position: relative; box-shadow: var(--shadow); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--pumpkin); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.qa { list-style: none; padding: 0; margin: 0; }
.qa > li { background: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(43,29,20,.06); }
.qa .q { font-weight: 800; }
.qa ol { margin: 8px 0 0; padding-left: 1.4em; }
.qa ol li.ans { font-weight: 850; color: var(--sage); }
.qa .fact { font-size: 0.92rem; color: var(--ink-soft); margin-top: 6px; }
.qa .src { font-size: 0.8rem; }
details.reveal summary { cursor: pointer; font-weight: 800; color: var(--pumpkin-dark); }
.wordlist { columns: 3 180px; column-gap: 24px; padding-left: 1.2em; }
.faq dt { font-weight: 850; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }
.callout { background: #fff; border-left: 6px solid var(--pumpkin); border-radius: 12px; padding: 16px 18px; margin: 20px 0; }
.sticky-cta { position: sticky; bottom: 0; background: rgba(255,247,236,.97); padding: 12px 0; border-top: 1px solid var(--line); }
.prose { max-width: 760px; }
.prose p, .prose li { font-size: 1.05rem; }

/* ------------------------------------------------------------ print */
.print-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.print-card { border: 2px solid var(--ink); border-radius: 12px; padding: 10px; break-inside: avoid; background: #fff; }
.print-card h3 { text-align: center; margin: 0 0 8px; }
.print-card .bingo div { aspect-ratio: 1/1; border: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.7rem; font-weight: 700; padding: 2px; line-height: 1.1; }
.print-card .bingo div.free { background: #F7DB9A; }
.charade-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.charade-cards div { border: 1px dashed var(--ink-soft); min-height: 1.6in; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; font-weight: 850; font-size: 1.2rem; break-inside: avoid; }
.charade-cards div small { font-weight: 600; font-size: 0.7rem; color: var(--ink-soft); margin-top: 6px; }
@media print {
  .no-print, .topbar, footer.site, .controls, .tabbar, .sticky-cta { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .print-card { page-break-inside: avoid; }
  .wrap-wide { padding: 0; }
}

/* Reserve error styling only when checkout has an actual message. */
.modal .error:empty { display: none; }
