/* Roomful Trivia v2.0 content and setup pages (package P3): home, how to play, about, terms, feedback, high scores, quick
   play, solo / phone-hosted setup, and the trivia question pages (tools/build_site_pages.py). Built on the v2 design system
   in site.css (rf- tokens and components, reports/p1.md); this file only lays those pages out. Mobile-first: base rules
   are for a 360-420px phone, wider screens add min-width queries. No inline style anywhere (strict CSP). */

/* ---------- The page frame (cream) ---------- */
body.rf-site { overflow-x: hidden; color-scheme: light; }
.rf-site h1, .rf-site h2, .rf-site h3 { font-stretch: 100%; font-variation-settings: normal; letter-spacing: -0.02em; line-height: 1.1; color: inherit; }
.rf-site p { margin: 0; }
.rf-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.rf-main { display: flex; flex-direction: column; gap: 24px; padding: 8px 0 24px; }
.rf-narrow { max-width: 760px; }
@media (min-width: 760px) { .rf-wrap { padding-left: 32px; padding-right: 32px; } .rf-main { gap: 32px; } }

/* The top bar: the four-shape mark, "Roomful", a Trivia pill; links on wide screens, a menu on phones. */
@media (min-width: 900px) {
}

/* The footer (brand copies are stamped into it by tools/build_site_pages.py). */
.rf-site .site-foot {
  margin: 24px 0 0; padding: 20px 0 calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--rf-line-cream);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600;
}
.rf-site .site-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--rf-ink); font-weight: 700; }
.rf-site .site-foot a:hover { color: var(--rf-link-cream); }
.rf-site .site-foot .family { flex-basis: 100%; }
.rf-site .site-foot .family a { min-height: 0; }
.rf-site .site-foot .social { display: inline-flex; align-items: center; gap: 4px; }
.rf-site .site-foot .social a { justify-content: center; width: 44px; }
.rf-site .site-foot .tip-link { gap: 6px; }

/* Long text (how to play, about, terms, topic pages' "ways to use"). */
.rf-prose { max-width: 720px; font-size: 18px; line-height: 1.55; }
.rf-prose h2 { margin: 36px 0 10px; font-size: 26px; font-weight: 800; }
.rf-prose h3 { margin: 24px 0 6px; font-size: 21px; font-weight: 800; }
.rf-prose p { margin: 0 0 14px; }
.rf-prose ul, .rf-prose ol { margin: 0 0 14px; padding-left: 1.3em; }
.rf-prose li { margin: 6px 0; }
.rf-prose li::marker { color: var(--rf-muted-cream); font-weight: 800; }
.rf-prose a { color: var(--rf-link-cream); font-weight: 700; }
.rf-prose strong { font-weight: 800; }
.rf-lede { font-size: 19px; line-height: 1.5; color: var(--rf-muted-cream); font-weight: 600; max-width: 720px; }
.rf-pagehead { display: flex; flex-direction: column; gap: 10px; }
.rf-pagehead h1 { font-size: 40px; font-weight: 800; }
@media (min-width: 760px) { .rf-pagehead h1 { font-size: 52px; } }

/* Content-page ad spaces (filled by js/common.js; ads stay off until P8 turns them on). */
.rf-site .ad-slot { color: var(--rf-muted-cream); }
.rf-site .ad-slot .ad-label, .rf-site .ad-slot .ad-note, .rf-site .ad-slot.preview { color: var(--rf-muted-cream); }
.rf-site .ad-slot.preview { border: 2px dashed var(--rf-muted-cream); border-radius: 16px; min-height: 100px; }
.rf-site .ad-slot .house-ad { color: var(--rf-ink); }

/* ---------- Home (www/index.html): join first, then Host / Play solo, the four games, the Daily ---------- */
.rf-home { display: grid; gap: 24px; }
.rf-home-play { display: flex; flex-direction: column; gap: 16px; }
.rf-home-more { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 900px) {
  .rf-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
}
.rf-visually-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Join box: a blue card, a big code field and a square Go key. */
.rf-joincard {
  display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--rf-blue); color: var(--rf-white);
  border: var(--rf-line) solid var(--rf-outline); border-radius: var(--rf-r-card); box-shadow: var(--rf-press);
  --rf-fg: var(--rf-white); --rf-muted: var(--rf-muted-room); --rf-focus: var(--accent); --rf-error: #ffe0ea;
}
.rf-joincard > label { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.rf-joinrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.rf-joinrow .rf-code-input {
  min-height: 68px; border-color: var(--rf-ink); border-radius: 18px; background: var(--rf-cream); color: var(--rf-ink); font-size: 40px;
  letter-spacing: 0.32em; padding: 0 0 0 0.32em; text-transform: uppercase;
}
.rf-joinrow .rf-code-input:focus { border-color: var(--rf-yellow); background: var(--rf-white); outline: none; box-shadow: 0 0 0 3px var(--rf-yellow); }
.rf-joinrow .rf-code-input::placeholder { color: #b8b2a3; letter-spacing: 0.32em; }
.rf-joinrow .rf-btn--icon { width: 68px; min-height: 68px; border-radius: 18px; background: var(--rf-primary); }
.rf-joinrow .rf-btn--icon .rf-icon { width: 30px; height: 30px; stroke-width: 2.75; }
.rf-joinhint { display: flex; align-items: center; gap: 8px; color: var(--rf-muted-room); font-size: 16px; font-weight: 600; }
.rf-joinhint .rf-icon { width: 20px; height: 20px; }
/* The join box's fallback when the code lookup can't answer (js/landing.js, as the umbrella's join box): pick the game. */
.rf-join-pick { display: flex; flex-direction: column; gap: 10px; }
.rf-join-pick[hidden] { display: none; }
.rf-join-pick-q { margin: 0; font-weight: 800; }
.rf-join-pick .rf-gamestrip { margin-right: 0; flex-wrap: wrap; overflow: visible; padding: 0; }
.rf-joincard .rf-error { color: #ffe0ea; }
.rf-joincard .rf-error:empty { display: none; }

/* The two big choices: Host a game, Play solo. */
.rf-bigbtn {
  display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 12px 16px 12px 18px; border: var(--rf-line) solid var(--rf-outline);
  border-radius: 24px; background: var(--rf-white); color: var(--rf-ink); box-shadow: var(--rf-press); text-decoration: none;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
a.rf-bigbtn:hover { color: var(--rf-ink); }
.rf-bigbtn:active { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
.rf-bigbtn--primary { background: var(--rf-primary); }
.rf-bigbtn-icon {
  display: grid; place-items: center; width: 60px; height: 60px; flex: none; border: var(--rf-line) solid var(--rf-outline); border-radius: 16px;
  background: var(--rf-cream);
}
.rf-bigbtn-icon .rf-icon { width: 30px; height: 30px; }
.rf-bigbtn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rf-bigbtn-title { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.rf-bigbtn-sub { font-size: 16px; font-weight: 700; color: var(--rf-muted-cream); }
.rf-bigbtn--primary .rf-bigbtn-sub { color: var(--rf-ink); }
.rf-bigbtn > .rf-icon { width: 26px; height: 26px; flex: none; }
/* "Pick a topic": the small chip beside Play solo (quick.html, where the topic can be changed before starting). */
.rf-chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.rf-chiplink {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 2px solid var(--rf-line-cream);
  border-radius: var(--rf-r-pill); background: var(--rf-white); color: var(--rf-ink); font-size: 16px; font-weight: 700; text-decoration: none;
}
a.rf-chiplink:hover { color: var(--rf-ink); border-color: var(--rf-ink); }
.rf-chiplink .rf-icon { width: 20px; height: 20px; }

/* The four games as shape tiles. */
.rf-modes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rf-mode {
  display: flex; align-items: center; gap: 12px; min-height: 64px; height: 100%; padding: 10px 12px; border: 2px solid var(--rf-line-cream);
  border-radius: 20px; background: var(--rf-white); color: var(--rf-ink); font-size: 17px; font-weight: 800; line-height: 1.15; text-decoration: none;
}
a.rf-mode:hover { color: var(--rf-ink); border-color: var(--rf-ink); }
.rf-mode .rf-avatar { width: 28px; height: 28px; stroke-width: 3; }
@media (min-width: 760px) { .rf-modes--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* The Daily Trivia card (the page is /daily, package P7). */
.rf-dailycard {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 20px; border-radius: var(--rf-r-card);
  background: var(--rf-ink); color: var(--rf-white); text-decoration: none; box-shadow: var(--rf-press);
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
a.rf-dailycard:hover { color: var(--rf-white); }
.rf-dailycard:active { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
.rf-dailycard::after {   /* the big yellow circle in the corner */
  content: ""; position: absolute; right: -36px; top: -40px; width: 132px; height: 132px; border-radius: 50%; background: var(--rf-yellow); opacity: 0.9;
}
.rf-dailycard-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rf-dailycard-kicker { font-size: 15px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rf-muted-room); }
.rf-dailycard-title { position: relative; z-index: 1; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.rf-dailycard-title > span { display: block; }
.rf-dailycard-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.rf-dailycard-shapes { display: flex; gap: 10px; }
.rf-dailycard-shapes .rf-avatar { width: 30px; height: 30px; fill: none; stroke: var(--rf-tile); stroke-width: 3.5; }
.rf-dailycard-go { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 14px; background: var(--rf-yellow); color: var(--rf-ink); font-size: 17px; font-weight: 800; }
.rf-dailycard-go .rf-icon { width: 20px; height: 20px; }
.rf-dailycard.is-done .rf-dailycard-go { background: var(--rf-good); }
.rf-dailycard .rf-pill { min-height: 32px; background: var(--rf-blue); color: var(--rf-white); }

/* "How it works" in three pictures (home and how to play). */
.rf-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: how; }
.rf-how > li {
  counter-increment: how; display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 4px 16px; padding: 14px 16px;
  border: 2px solid var(--rf-line-cream); border-radius: 22px; background: var(--rf-white);
}
.rf-how-pic { grid-row: span 2; position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: var(--rf-line) solid var(--rf-ink); border-radius: 20px; background: var(--rf-tile, var(--rf-yellow)); color: var(--rf-ink); }
.rf-how-pic .rf-icon { width: 36px; height: 36px; stroke-width: 2.25; }
.rf-how-pic::after {
  content: counter(how); position: absolute; left: -8px; top: -8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--rf-ink); color: var(--rf-white); font-size: 14px; font-weight: 800;
}
.rf-how-title { font-size: 20px; font-weight: 800; line-height: 1.15; align-self: end; }
.rf-how-sub { font-size: 16px; font-weight: 600; color: var(--rf-muted-cream); align-self: start; }
.rf-how-code { display: inline-flex; gap: 2px; }
.rf-how-code b { display: inline-grid; place-items: center; width: 15px; height: 20px; border-radius: 4px; background: var(--rf-white); border: 2px solid var(--rf-ink); font-size: 12px; line-height: 1; }
/* v2.9 (A1): the other way to play, drawn as a split (a phone and a TV) and marked "or" instead of a number. */
.rf-how > li.rf-how-alt { border-style: dashed; }
.rf-how-pic--split { grid-template-columns: 1fr 1fr; place-items: stretch; background: var(--rf-white); }
.rf-how-pic--split > span { display: grid; place-items: center; background: var(--rf-tile); border-radius: 16px 0 0 16px; }
.rf-how-pic--split > span + span { border-left: var(--rf-line) solid var(--rf-ink); border-radius: 0 16px 16px 0; }
.rf-how-pic--split .rf-icon { width: 24px; height: 24px; }
.rf-how-alt .rf-how-pic::after { content: 'or'; width: 30px; }
@media (min-width: 760px) {
  .rf-how { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rf-how > li.rf-how-alt { grid-column: 1 / -1; grid-template-columns: 96px minmax(0, 1fr); justify-items: start; text-align: left; padding: 16px 22px; }
  .rf-how-alt .rf-how-pic { grid-row: span 2; margin-bottom: 0; }
  .rf-how-pic--split .rf-icon { width: 34px; height: 34px; }
  .rf-how > li { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 16px; }
  .rf-how-pic { grid-row: auto; width: 96px; height: 96px; margin-bottom: 8px; }
  .rf-how-pic .rf-icon { width: 46px; height: 46px; }
}

/* Small section heads, quiet link rows, the party colors row. */
.rf-site .rf-label { color: var(--rf-muted-cream); }
.rf-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rf-sechead h2 { font-size: 26px; font-weight: 800; }
.rf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.rf-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--rf-link-cream); font-weight: 700; }
.rf-colors { display: flex; flex-direction: column; gap: 10px; }
.rf-colors .theme-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-colors .theme-picker button { min-width: 44px; min-height: 44px; }

/* The season spotlight (drawn by js/common.js) on cream. */
.rf-site .season {
  margin: 0; display: grid; gap: 12px; padding: 18px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card);
  background: var(--rf-white); color: var(--rf-ink); box-shadow: var(--rf-press);
}
.rf-site .season h2 { font-size: 24px; font-weight: 800; }
.rf-site .season p { color: var(--rf-muted-cream); font-weight: 600; }
.rf-site .season .season-kicker { font-size: 14px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.rf-site .season .season-icon { display: none; }   /* an emoji in v1; the kicker and colors carry it (patch request to P4) */
.rf-site .season .season-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rf-site .season .btn {
  min-height: 52px; padding: 0 18px; border: var(--rf-line) solid var(--rf-ink); border-radius: 16px; background: var(--rf-white); color: var(--rf-ink);
  box-shadow: var(--rf-press-sm); font-size: 17px; font-weight: 800; font-stretch: 100%;
}
.rf-site .season .btn.go { background: var(--rf-primary); }
.rf-site .season.season-halloween { background: #ffe2c9; }
.rf-site .season.season-thanksgiving { background: #fff0c2; }
.rf-site .season.season-christmas { background: #d3f5e8; }
.rf-site .season.season-holidays { background: #e4dcff; }

/* The two videos and "Get it on your TV" (js/video.js, tools/tv_help.py) on cream. */
.rf-site .tutorial { margin: 0; display: grid; gap: 16px; align-items: center; }
.rf-site .tutorial h2, .rf-site .tv-help-text h2, .rf-site .tv-help-text h3 { font-size: 26px; font-weight: 800; line-height: 1.1; }
.rf-site .tutorial-text p, .rf-site .tv-help-text p { color: var(--rf-muted-cream); margin-top: 8px; font-weight: 600; }
.rf-site .tutorial-text .video-note, .rf-site .tv-help-text .video-note { font-size: 15px; color: var(--rf-muted-cream); font-weight: 500; }
.rf-site .tutorial-text .video-note a, .rf-site .tv-help-text .video-note a, .rf-site .video-block figcaption a { color: var(--rf-link-cream); }
.rf-site .video-facade, .rf-site .video-frame { border: var(--rf-line) solid var(--rf-ink); border-radius: 22px; box-shadow: var(--rf-press); }
.rf-site .tv-help { margin: 0; max-width: none; display: grid; gap: 16px; }
.rf-site .tv-help-steps { margin: 0; background: var(--rf-white); color: var(--rf-ink); border: 2px solid var(--rf-line-cream); border-radius: 18px; padding: 0 16px; }
.rf-site .tv-help-steps summary { display: flex; align-items: center; min-height: 52px; color: var(--rf-ink); font-weight: 800; cursor: pointer; }
.rf-site .tv-help-ways { padding-bottom: 4px; }
.rf-site .tv-help-ways li { color: var(--rf-muted-cream); font-weight: 500; }
.rf-site .tv-help-ways strong { color: var(--rf-ink); }
.rf-site .tv-help-steps .tv-help-small { color: var(--rf-muted-cream); padding-bottom: 14px; }
.rf-site .video-block { margin: 0; max-width: 720px; }
.rf-site .video-block figcaption { margin-top: 10px; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600; }
@media (min-width: 760px) {
  .rf-site .tutorial { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px 36px; }
}

/* ---------- How to play: three pictures first, the four games as cards, the text below ---------- */
.rf-gamecards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rf-gamecard {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 14px; align-items: center; padding: 14px 16px; border: var(--rf-line) solid var(--rf-ink);
  border-radius: 22px; background: var(--rf-tile); color: var(--rf-ink); text-decoration: none;
}
a.rf-gamecard:hover { color: var(--rf-ink); }
.rf-gamecard .rf-avatar { grid-row: span 2; width: 44px; height: 44px; fill: var(--rf-white); }
.rf-gamecard b { font-size: 21px; font-weight: 800; line-height: 1.1; }
.rf-gamecard span { font-size: 16px; font-weight: 700; }
@media (min-width: 760px) { .rf-gamecards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rf-cta {
  margin: 0; display: flex; flex-direction: column; gap: 14px; padding: 22px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card);
  background: var(--rf-white); box-shadow: var(--rf-press);
}
.rf-cta h2 { font-size: 28px; font-weight: 800; margin: 0; }
.rf-cta p { color: var(--rf-muted-cream); font-weight: 600; margin: 0; }
.rf-cta-row { display: grid; gap: 12px; }
@media (min-width: 600px) { .rf-cta-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- About, terms ---------- */
.rf-site .copyright { color: var(--rf-muted-cream); font-weight: 600; }
.rf-site .rf-prose .effective, .rf-site .rf-prose .updated { color: var(--rf-muted-cream); }

/* ---------- High scores ---------- */
.rf-scores { display: flex; flex-direction: column; gap: 12px; }
.rf-scores .rf-seg { width: 100%; }
.rf-scores .rf-seg > button { padding: 4px 6px; font-size: 15px; }
.rf-scorepicks { display: grid; gap: 10px; }
@media (min-width: 760px) { .rf-scorepicks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rf-board { padding: 6px; border: var(--rf-line) solid var(--rf-ink); border-radius: 24px; background: var(--rf-white); box-shadow: var(--rf-press); }
.rf-board .empty { padding: 28px 16px; text-align: center; color: var(--rf-muted-cream); font-weight: 700; }
.rf-site table.board { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 17px; }
.rf-site table.board th { padding: 6px 10px; color: var(--rf-muted-cream); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; }
.rf-site table.board td { padding: 10px; border: 0; background: var(--rf-cream); color: var(--rf-ink); font-weight: 700; }
.rf-site table.board td:first-child { border-radius: 14px 0 0 14px; width: 2.4em; text-align: center; font-weight: 800; }
.rf-site table.board td:last-child { border-radius: 0 14px 14px 0; color: var(--rf-muted-cream); font-size: 15px; white-space: nowrap; }
.rf-site table.board td.num { font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.rf-site table.board th.num { text-align: right; }   /* the Points header over its numbers (v2.0 integration) */
.rf-site table.board tbody tr:nth-child(1) td { background: var(--rf-yellow); }
.rf-site table.board tbody tr:nth-child(2) td { background: #d3f5e8; }
.rf-site table.board tbody tr:nth-child(3) td { background: #ffe2c9; }
.rf-site table.board tbody tr:nth-child(-n+3) td:last-child { color: var(--rf-ink); }
.rf-site table.board tr.house td { font-style: italic; }
.rf-site .house-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--rf-white); border: 2px solid var(--rf-line-cream); font-size: 12px; font-style: normal; font-weight: 800; vertical-align: middle; }
.rf-site .house-note { margin: 8px 10px 6px; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600; }
@media (max-width: 420px) { .rf-site table.board th:nth-child(4), .rf-site table.board td:nth-child(4):not(:last-child) { display: none; } }

/* ---------- Feedback ---------- */
.rf-form { display: flex; flex-direction: column; gap: 18px; padding: 20px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card); background: var(--rf-white); box-shadow: var(--rf-press); }
.rf-form fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rf-form legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 16px; }
.rf-form textarea.rf-input { min-height: 150px; padding: 12px 16px; line-height: 1.4; resize: vertical; }
.rf-form .rf-field-row { display: grid; gap: 18px; }
@media (min-width: 760px) { .rf-form .rf-field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rf-form .rf-hint, .rf-hint { margin: 0; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600; }
.rf-form .optional { color: var(--rf-muted-cream); font-weight: 600; }
.rf-form .count { align-self: flex-end; color: var(--rf-muted-cream); font-size: 14px; font-weight: 600; }
.rf-form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rf-form .rf-seg { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .rf-form .rf-seg { grid-auto-flow: column; grid-template-columns: none; } }
.rf-thanks { align-items: flex-start; }
.rf-thanks h2 { font-size: 32px; font-weight: 800; }

/* ---------- Trivia question pages (tools/build_site_pages.py) ---------- */
.rf-topichead {
  position: relative; overflow: hidden; display: grid; gap: 14px; padding: 22px 20px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card);
  background: var(--rf-tile, var(--rf-yellow)); color: var(--rf-ink); box-shadow: var(--rf-press);
}
.rf-topichead .crumbs { margin: 0; font-size: 15px; font-weight: 700; }
.rf-topichead .crumbs a { color: var(--rf-ink); font-weight: 800; }
.rf-topichead h1 { font-size: 34px; font-weight: 800; max-width: 22ch; }
.rf-topichead .lede { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.45; max-width: 60ch; }
.rf-topicicon {
  display: grid; place-items: center; width: 76px; height: 76px; border: var(--rf-line) solid var(--rf-ink); border-radius: 22px; background: var(--rf-white);
  box-shadow: var(--rf-press-sm);
}
.rf-topicicon .rf-icon { width: 42px; height: 42px; stroke-width: 2; }
.rf-topichead-deco { position: absolute; right: -30px; bottom: -36px; width: 150px; height: 150px; fill: var(--rf-white); opacity: 0.35; stroke: none; }
.rf-topichead > :not(.rf-topichead-deco) { position: relative; }
.rf-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-jump a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: var(--rf-line) solid var(--rf-ink); border-radius: 999px;
  background: var(--rf-white); color: var(--rf-ink); font-size: 16px; font-weight: 800; text-decoration: none;
}
.rf-jump a:hover { color: var(--rf-ink); background: var(--rf-cream); }
.rf-jump .rf-avatar { width: 18px; height: 18px; stroke-width: 3; }
@media (min-width: 760px) {
  .rf-topichead { grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; padding: 32px; }
  .rf-topichead > :not(.rf-topicicon):not(.rf-topichead-deco) { grid-column: 2; }
  .rf-topicicon { grid-row: 1 / span 4; width: 120px; height: 120px; border-radius: 30px; }
  .rf-topicicon .rf-icon { width: 64px; height: 64px; }
  .rf-topichead h1 { font-size: 46px; }
  .rf-topichead-deco { width: 260px; height: 260px; right: -50px; bottom: -70px; }
}
.rf-levelhead { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; font-size: 24px; font-weight: 800; scroll-margin-top: 16px; }
.rf-levelhead .rf-avatar { width: 30px; height: 30px; }
.rf-tip { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--rf-muted-cream); font-size: 16px; font-weight: 700; }
.rf-tip .rf-icon { width: 20px; height: 20px; }

/* Questions as tappable cards: a number tile, the question, a + that turns into the answer. */
.rf-site ol.qa { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .rf-site ol.qa { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.rf-site .qa details { border: var(--rf-line) solid var(--rf-ink); border-radius: 22px; background: var(--rf-white); box-shadow: var(--rf-press-sm); }
.rf-site .qa details[open] { background: var(--rf-white); box-shadow: var(--rf-press); }
.rf-site .qa summary {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 32px; gap: 12px; align-items: start; min-height: 64px; padding: 14px 14px 14px 12px;
  list-style: none; cursor: pointer; color: var(--rf-ink); font-size: 18px; font-weight: 700; line-height: 1.35; border-radius: 19px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.rf-site .qa summary::-webkit-details-marker { display: none; }
.rf-site .qa summary::after {   /* a round + that becomes a minus */
  content: "+"; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--rf-cream); border: 2px solid var(--rf-ink);
  font-size: 22px; font-weight: 800; line-height: 1;
}
.rf-site .qa details[open] summary::after { content: "\2212"; background: var(--rf-primary); }
.rf-site .qa .qa-n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--rf-tile, var(--rf-yellow)); border: 2px solid var(--rf-ink);
  color: var(--rf-ink); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 0;
}
.rf-site .qa details > p {
  margin: 0 12px 12px; padding: 12px 14px; border-radius: 16px; background: var(--rf-cream); color: var(--rf-ink); font-size: 17px; font-weight: 500; line-height: 1.45;
}
.rf-site .qa details > p strong { font-weight: 800; color: var(--rf-ink); }
.rf-site .qa details[open] summary { margin-bottom: 0; }
.rf-site .qa--easy .qa-n { --rf-tile: var(--rf-green); }
.rf-site .qa--medium .qa-n { --rf-tile: var(--rf-yellow); }
.rf-site .qa--hard .qa-n { --rf-tile: var(--rf-pink); }
@media (prefers-reduced-motion: no-preference) {
  .rf-site .qa details[open] > p { animation: rf-qa-open 160ms ease-out; }
  @keyframes rf-qa-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
.rf-site .uses { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 2px solid var(--rf-line-cream); border-radius: 22px; background: var(--rf-white); }
.rf-site .uses h2 { font-size: 24px; font-weight: 800; }
.rf-site .uses p { color: var(--rf-ink); font-weight: 500; line-height: 1.55; }
.rf-site .bingo-night { margin: 0; font-weight: 600; }
.rf-site .bingo-night a { color: var(--rf-link-cream); font-weight: 800; }
.rf-site .play-cta h2 { margin: 0; }
.rf-topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .rf-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rf-topics { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.rf-topics a {
  display: flex; align-items: center; gap: 10px; min-height: 56px; height: 100%; padding: 8px 12px; border: 2px solid var(--rf-line-cream); border-radius: 18px;
  background: var(--rf-white); color: var(--rf-ink); font-size: 16px; font-weight: 800; line-height: 1.15; text-decoration: none;
}
.rf-topics a:hover { color: var(--rf-ink); border-color: var(--rf-ink); }
.rf-topics .rf-icon { width: 24px; height: 24px; }
.rf-topics-head { font-size: 24px; font-weight: 800; }

/* The trivia index: a tile per topic. */
.rf-site .topic-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 600px) { .rf-site .topic-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rf-site .topic-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rf-site .topic-cards a {
  display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 2px 14px; align-items: center; height: 100%; padding: 14px; border: var(--rf-line) solid var(--rf-ink);
  border-radius: 22px; background: var(--rf-white); color: var(--rf-ink); text-decoration: none; box-shadow: var(--rf-press-sm);
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
.rf-site .topic-cards a:hover { color: var(--rf-ink); }
.rf-site .topic-cards a:active { transform: translateY(3px); box-shadow: var(--rf-pressed); }
.rf-site .topic-cards .rf-topicicon { grid-row: span 2; width: 60px; height: 60px; border-radius: 18px; box-shadow: none; background: var(--rf-tile, var(--rf-yellow)); }
.rf-site .topic-cards .rf-topicicon .rf-icon { width: 32px; height: 32px; }
.rf-site .topic-cards strong { font-size: 20px; font-weight: 800; line-height: 1.15; align-self: end; }
.rf-site .topic-cards span:not(.rf-topicicon) { font-size: 15px; font-weight: 600; color: var(--rf-muted-cream); line-height: 1.35; align-self: start; }

/* Topic tints (site-content/trivia-pages.json "tint"; the four shape colors plus lilac and teal). */
.rf-tint-orange { --rf-tile: var(--rf-orange); }
.rf-tint-yellow { --rf-tile: var(--rf-yellow); }
.rf-tint-green { --rf-tile: var(--rf-green); }
.rf-tint-pink { --rf-tile: var(--rf-pink); }
.rf-tint-lilac { --rf-tile: var(--rf-lilac); }
.rf-tint-teal { --rf-tile: var(--rf-teal); }

/* ---------- Setup screens: quick play (quick.html) and solo / phone-hosted setup (phone.html) ---------- */
.rf-setup { gap: 18px; }
.rf-setup .rf-topbar h1 { flex: 1; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.rf-setup .rf-topbar .rf-pill--game { min-height: 36px; font-size: 16px; }
.rf-setup .rf-label { margin: 0 0 8px; display: block; }
.rf-setup fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.rf-setup legend { padding: 0; }
.rf-setup .rf-error:empty { display: none; }
.rf-small-print { margin: 0; color: var(--rf-muted-cream); font-size: 14px; font-weight: 600; text-align: center; }
.rf-small-print a { color: var(--rf-link-cream); font-weight: 700; }

/* Quick play: the topic as a big card, a "Change" chip over a native picker, and Start. */
.rf-topiccard {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 20px 22px; text-align: center;
  border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card); background: var(--rf-tile, var(--rf-yellow)); box-shadow: var(--rf-press);
}
.rf-topiccard .rf-topicicon { width: 104px; height: 104px; border-radius: 28px; }
.rf-topiccard .rf-topicicon .rf-icon { width: 58px; height: 58px; }
.rf-topiccard-name { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.rf-topiccard-blurb { min-height: 1.4em; font-size: 17px; font-weight: 600; line-height: 1.35; }
.rf-change { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border: var(--rf-line) solid var(--rf-ink); border-radius: 999px; background: var(--rf-white); color: var(--rf-ink); font-size: 17px; font-weight: 800; box-shadow: var(--rf-press-sm); }
.rf-change .rf-icon { width: 20px; height: 20px; }
.rf-change select {   /* the real control: the native picker, invisible over the chip */
  position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); opacity: 0; cursor: pointer; font-size: 16px; border: 0; padding: 0; margin: 0; appearance: none;
}
.rf-change:focus-within { outline: 3px solid var(--rf-link-cream); outline-offset: 3px; }
.rf-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rf-facts .rf-pill { min-height: 36px; background: var(--rf-white); color: var(--rf-ink); border: 2px solid var(--rf-line-cream); }
.rf-facts .rf-pill .rf-avatar { width: 18px; height: 18px; }
.rf-rules { margin: 0; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600; text-align: center; }
.rf-starting { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 0; text-align: center; }
.rf-starting .rf-waiting-dots { display: inline-flex; gap: 8px; }

/* Solo / phone-hosted setup: game tiles, segmented rows, topic chips, name, Open. */
.rf-gamepick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rf-gamepick label {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 112px; padding: 14px 16px;
  border: var(--rf-line) solid var(--rf-ink); border-radius: 22px; background: var(--rf-white); color: var(--rf-ink); box-shadow: var(--rf-press-sm);
  cursor: pointer; font-size: 20px; font-weight: 800; line-height: 1.1; touch-action: manipulation;
}
.rf-gamepick label .rf-avatar { width: 34px; height: 34px; }
.rf-gamepick label small { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--rf-muted-cream); }
.rf-gamepick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.rf-gamepick label:has(input:checked) { background: var(--rf-tile); box-shadow: var(--rf-press-sm), 0 0 0 4px var(--rf-blue); }
.rf-gamepick label:has(input:checked) small { color: var(--rf-ink); }
.rf-gamepick label:has(input:checked) .rf-avatar { fill: var(--rf-ink); stroke: var(--rf-ink); }
.rf-gamepick label:has(input:focus-visible) { outline: 3px solid var(--rf-link-cream); outline-offset: 4px; }
.rf-catgroups { display: flex; flex-direction: column; gap: 10px; }
.rf-catgroups details { border: 2px solid var(--rf-line-cream); border-radius: 20px; background: var(--rf-white); }
.rf-catgroups details[open] { border-color: var(--rf-ink); }
.rf-catgroups summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 800;
}
.rf-catgroups summary::-webkit-details-marker { display: none; }
.rf-catgroups summary > span { font-size: 15px; font-weight: 700; color: var(--rf-muted-cream); }
.rf-catgroups summary > span.is-some { color: var(--rf-ink); background: var(--rf-primary); border-radius: 999px; padding: 2px 10px; }
.rf-catbody { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 14px; }
.rf-allnone { display: flex; gap: 8px; }
.rf-catlist { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-catlist button {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: var(--rf-line) solid var(--rf-ink);
  border-radius: 999px; background: var(--rf-white); color: var(--rf-ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.rf-catlist button .rf-icon { width: 20px; height: 20px; }
.rf-catlist button[aria-pressed="true"] { background: var(--rf-primary); font-weight: 800; }
.rf-check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; font-weight: 700; cursor: pointer; }
.rf-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--rf-blue); flex: none; }
.rf-modehint { margin: 8px 0 0; color: var(--rf-muted-cream); font-size: 15px; font-weight: 600; }
.rf-setup-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 calc(8px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, rgba(255, 246, 229, 0), var(--rf-cream) 22%); }
@media (min-width: 900px) {
  .rf-setup-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .rf-setup-cols > div { display: flex; flex-direction: column; gap: 18px; }
}
@media (max-width: 899px) { .rf-setup-cols, .rf-setup-cols > div { display: flex; flex-direction: column; gap: 18px; } }
.rf-topiccard .rf-label { color: var(--rf-ink); margin: 0; }
.rf-gamepick label > span { display: block; }
@media (min-width: 760px) { .rf-setup > .rf-push { margin-top: 32px; margin-bottom: auto; } }
/* v1's input rule (input[type=text] { background: paper }) outranks .rf-input: put the v2 field back on these pages. */
.rf-site input.rf-input, .rf-site textarea.rf-input { background: var(--rf-white); color: var(--rf-ink); border: var(--rf-line) solid var(--rf-outline); border-radius: 16px; font-size: 20px; padding: 0 16px; }
.rf-site textarea.rf-input { padding: 12px 16px; }
.rf-site .rf-joinrow input.rf-code-input { background: var(--rf-cream); border-color: var(--rf-ink); border-radius: 18px; font-size: 40px; padding: 0 0 0 0.32em; }
.rf-site .rf-joinrow input.rf-code-input:focus { background: var(--rf-white); border-color: var(--rf-yellow); }
.rf-scores #gameSeg .rf-avatar { width: 20px; height: 20px; }
@media (max-width: 459px) { .rf-scores #gameSeg { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rf-prose h1 { margin: 8px 0 16px; font-size: 40px; font-weight: 800; }
@media (min-width: 760px) { .rf-prose h1 { font-size: 52px; } }
.rf-prose .tv-help { margin: 28px 0; }
.rf-prose h3[id] { scroll-margin-top: 16px; }
.rf-topicicon { color: var(--rf-ink); }
.rf-site .topic-cards span.rf-topicicon { color: var(--rf-ink); align-self: center; }

/* Thumb-first on phones (P9, the viewport matrix): the solo topic picker's Start stays at the bottom of the screen. */
@media (max-width: 767px) {
  form.rf-push > .rf-stack:has(> #startBtn) { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to bottom, rgba(255, 246, 229, 0), var(--rf-cream) 30%); }
}
/* v2.1 (P12): a one-tap Play solo shows "Starting: <topic>" for 4 seconds (quick.js countDown): ring, Go, Change topic. */
.rf-quickcount { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card); background: var(--rf-white); }
.rf-quickcount-head { display: flex; align-items: center; gap: 16px; }
.rf-quickcount-title { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--rf-ink); min-width: 0; }
.rf-quickcount .rf-ring { color: var(--rf-ink); --rf-ring-track: var(--rf-line-cream); }
.rf-quickcount .rf-ring .rf-ring-fill, .rf-quickcount .rf-ring.is-low .rf-ring-fill { stroke: var(--rf-ink); }
.rf-facts[hidden], .rf-quickcount[hidden], .rf-change[hidden] { display: none; }
/* v2.15: quick play names its game ("Your game", its shape, Change game) above the topic, and the count names it too. */
.rf-quickgame { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border: var(--rf-line) solid var(--rf-ink); border-radius: var(--rf-r-card); background: var(--rf-white); color: var(--rf-ink); }
.rf-quickgame > .rf-avatar { flex: none; width: 44px; height: 44px; }
.rf-quickgame-text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rf-quickgame .rf-label { color: var(--rf-ink); }
.rf-quickgame-name { font-size: 24px; font-weight: 800; line-height: 1.1; }
.rf-quickgame-blurb { font-size: 15px; font-weight: 600; line-height: 1.3; }
.rf-quickgame .rf-change { flex: none; }
.rf-quickcount-topic { font-size: 18px; font-weight: 700; }
.rf-quickcount-changes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
/* v2.15: How to play's per-game buttons (Host <game>, Play <game> solo) under each game's paragraph. */
.rf-howto-play { margin: 4px 0 12px; }
