/* Roomful Charades' live game (v2.0): the host's setup, joining, the phones (with the host's bar), the TV and the results.
   Built on the v2 design system in site.css (rf- classes, --rf- tokens); this file only lays out what is Charades' own
   (cg- classes). Teams carry a shape (circle, triangle, diamond, square), so a team is never told apart by color alone;
   Got it and Skip differ by label, icon and place, not only color. Classes only: the CSP allows no inline styles
   (numbers a script owns are custom properties set from JS). Loaded on /charades/host, tv, join, play and results. */

/* ---------- room-v2 stand-in (P5b, until P5a's css/room-v2.css is on these pages; the integrator may drop it then) ---------- */
body.rf-app .landing-top, body.rf-app .site-foot { display: none; }
body.rf-app { overflow-x: hidden; }
.rf-apppage, .rf-apppage > main { max-width: none; margin: 0; padding: 0; }
.rf-away { display: flex; flex-direction: column; gap: 20px; flex: 1; text-align: center; }
.rf-away-mid { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; }
.rf-away-mid .rf-ring--lg { width: 168px; height: 168px; }
.rf-away-mid .rf-ring--lg .rf-ring-num { font-size: 48px; }
.rf-away-who { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--rf-primary); }
.rf-resume { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: rgba(11, 20, 80, 0.88); color: var(--rf-white); text-align: center; padding: 24px; --rf-ghost: var(--rf-muted-room); --rf-fg: var(--rf-white); }
.rf-resume .rf-title { margin: 0; }
.rf-nextgame { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rf-nextgame .rf-section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.rf-nextgame .rf-gamestrip { margin-right: 0; }
.rf-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.rf-sheet .rf-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.rf-display-pair { display: flex; flex-direction: column; gap: 20px; width: min(100%, 760px); }
.rf-tv .rf-display-pair .rf-code-input { min-height: 1.4em; font-size: clamp(64px, 6vw, 160px); }
.rf-tv .rf-display-pair label { font-size: var(--rf-fs-label); }
.rf-tv .rf-display-pair .rf-error { font-size: var(--rf-fs-small); }

/* ---------- shared bits ---------- */
.cg-tint-blue { --rf-tile: #5aa9ff; }
.rf-qr-box > canvas.qr { width: 100%; height: 100%; border-radius: 0; }
.cg-invite .rf-invite { display: flex; align-items: center; gap: 14px; }
.cg-invite .rf-invite-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cg-invite .rf-invite-url { font-weight: 800; overflow-wrap: anywhere; }
.cg-grow { flex: 1; margin: 0; }
.charades-screen { min-width: 0; }
.charades-screen > .note { padding: 20px; }
.rf-pill .rf-avatar { width: 20px; height: 20px; }
.cg-center { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.cg-center h1, .cg-center p { margin: 0; }
.cg-cluster { justify-content: center; }
.cg-name { display: flex; align-items: center; justify-content: center; gap: 10px; overflow-wrap: anywhere; }
.cg-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--rf-muted); text-align: center; }
.cg-missing { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-weight: 700; color: var(--rf-primary); }
.cg-words { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cg-words li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 14px; background: var(--rf-panel); color: var(--rf-fg); font-weight: 700; }
.cg-words li.is-got { background: var(--rf-good, var(--rf-green)); color: var(--rf-ink); }
.cg-words li:not(.is-got) .cg-word-text { opacity: 0.85; }
.cg-mark { display: grid; place-items: center; flex: none; }
.cg-word-text { flex: 1; overflow-wrap: anywhere; }
.cg-by { font-size: 14px; font-weight: 600; opacity: 0.85; }
.cg-rules p { margin: 0; }
.cg-sheet .rf-code--sm { align-self: center; }
.cg-tvurl { margin: 0; font-size: 26px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }

/* ---------- setup (cream) ---------- */
.cg-setup .rf-title { font-size: 28px; white-space: nowrap; }
.cg-field { display: flex; flex-direction: column; gap: 8px; }
.cg-field h2 { margin: 0; }
.cg-sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cg-set {
  appearance: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; min-height: 84px; padding: 12px 14px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: 20px; background: var(--rf-white); color: var(--rf-ink); box-shadow: var(--rf-press-sm);
  font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
}
.cg-set[aria-pressed="true"] { background: var(--rf-game); outline: 3px solid var(--rf-blue); outline-offset: 2px; }
.cg-set-name { font-size: 17px; font-weight: 800; line-height: 1.15; }
.cg-set-sub { font-size: 13px; font-weight: 600; color: var(--rf-muted-cream); }
.cg-set[aria-pressed="true"] .cg-set-sub { color: var(--rf-ink); }
.cg-more { border-top: 2px solid var(--rf-line-cream); padding-top: 12px; }
.cg-more > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; cursor: pointer; list-style: none; }
.cg-more > summary::-webkit-details-marker { display: none; }
.cg-more[open] > summary .rf-icon { transform: rotate(45deg); }
.cg-more[open] { display: flex; flex-direction: column; gap: 14px; }
.cg-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 700; }
.cg-toggle input { width: 24px; height: 24px; flex: none; accent-color: var(--rf-blue); }
.cg-tvcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--rf-line-cream); border-radius: 18px; background: var(--rf-white); color: var(--rf-ink); text-decoration: none; }
.cg-tvcard-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--rf-night); color: var(--rf-white); }
.cg-tvcard-text { display: flex; flex-direction: column; font-size: 15px; }
.cg-tvcard-text span { color: var(--rf-link-cream); font-weight: 700; }
.cg-setup .tv-help-link { margin: 0; font-size: 15px; }

/* ---------- join (Room Blue) ---------- */
.cg-join-title { margin: 24px 0 0; font-size: 44px; }
.cg-join .rf-error:empty { display: none; }

/* ---------- phones ---------- */
.cg-phone { overflow-x: hidden; }
.cg-top .cg-me { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 18px; }
.cg-top .cg-me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 12px; text-align: center; }
.cg-hero-name { margin: 0; font-size: 48px; overflow-wrap: anywhere; }
.cg-invite .rf-code > span { height: 76px; font-size: 52px; }
.cg-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cg-team { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; background: var(--rf-panel); }
.cg-team-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 800; }
.cg-teampick button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cg-teampick .rf-avatar { width: 20px; height: 20px; }
.cg-actor-top { display: flex; align-items: center; justify-content: center; gap: 16px; }
.cg-actor-count { align-items: flex-start; gap: 6px; }
.cg-wordcard { position: relative; align-items: center; justify-content: center; gap: 10px; min-height: 180px; text-align: center; user-select: none; -webkit-user-select: none; }
.cg-word { width: 100%; margin: 0; font-size: 56px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.cg-word.px48 { font-size: 48px; } .cg-word.px40 { font-size: 40px; } .cg-word.px34 { font-size: 34px; } .cg-word.px28 { font-size: 28px; }
.cg-word-emoji { font-size: 64px; line-height: 1; }
.cg-cover { display: none; }
.cg-wordcard.covered > :not(.cg-cover) { visibility: hidden; }
.cg-wordcard.covered .cg-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; font-weight: 800; }
.cg-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cg-tile {
  appearance: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px; min-height: 168px; padding: 18px;
  border: var(--rf-line) solid var(--rf-outline); border-radius: 24px; color: var(--rf-ink); box-shadow: var(--rf-press);
  font: inherit; font-size: 28px; font-weight: 800; text-align: left; cursor: pointer; touch-action: manipulation;
  transition: transform var(--rf-dur-press) ease-out, box-shadow var(--rf-dur-press) ease-out;
}
.cg-tile .rf-icon { width: 44px; height: 44px; stroke-width: 3; }
.cg-tile small { font-size: 15px; font-weight: 700; }
.cg-tile:active:not(:disabled) { transform: translateY(var(--rf-drop)); box-shadow: var(--rf-pressed); }
.cg-tile:disabled { opacity: 0.5; cursor: default; }
.cg-tile--got { background: var(--rf-green); }
.cg-tile--skip { background: var(--rf-pink); }
.cg-guessers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cg-guesser { justify-content: flex-start; gap: 8px; padding-left: 12px; overflow: hidden; }
.cg-none { grid-column: 1 / -1; }
.cg-lastword { margin: 0; font-size: 30px; font-weight: 800; }
.cg-hide-note { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.cg-fix { display: inline-flex; align-items: center; gap: 6px; }
.cg-fix-n { min-width: 2ch; text-align: center; font-size: 20px; }
.cg-fix .rf-btn--icon, .cg-kick { width: 44px; height: 44px; min-height: 44px; padding: 0; }
.cg-wait-row { align-items: center; }
.cg-winner { margin: 0 -16px; border-radius: 0 0 36px 36px; }
.cg-phone.phase-ended { gap: 16px; }

/* ---------- results (cream) ---------- */
.cg-results-line { margin: 0; text-align: center; font-weight: 700; }
.cg-results .rf-cluster .rf-pill { white-space: normal; }
.cg-turn { gap: 10px; padding: 14px; }
.cg-turn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 18px; }
.cg-results .cg-words li { background: var(--rf-cream); }
.cg-results .cg-words li.is-got { background: var(--rf-green); }

/* ---------- the TV: display only, nothing tappable ---------- */
.cg-tv h1, .cg-tv h2, .cg-tv p { margin: 0; }
.cg-tv-pair-mid { display: flex; flex-direction: column; gap: clamp(20px, 2vw, 56px); margin: auto 0; }
.cg-tv-lobby { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "join qr" "people people"; gap: clamp(24px, 2.5vw, 72px); align-items: center; flex: 1; }
.cg-tv-join { grid-area: join; display: flex; flex-direction: column; gap: clamp(16px, 1.6vw, 46px); }
.cg-tv-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em; color: var(--rf-muted); }
.cg-tv-lobby .rf-qr { grid-area: qr; margin: 0; }
.cg-tv-people { grid-area: people; align-self: end; }
.cg-tv-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(16vw, 1fr)); gap: clamp(16px, 1.5vw, 44px); }
.cg-tv-team { display: flex; flex-direction: column; gap: 0.5em; padding: 0.6em; border-radius: 0.6em; background: var(--rf-panel); }
.cg-tv-team-name { display: flex; align-items: center; gap: 0.4em; font-size: var(--rf-fs-body); }
.cg-tv-team-name .rf-avatar { width: 1.2em; height: 1.2em; }
.cg-tv-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 3vw, 88px); flex: 1; align-items: start; }
.cg-tv-main { display: flex; flex-direction: column; gap: clamp(16px, 1.6vw, 46px); }
.cg-tv-side { display: flex; flex-direction: column; gap: clamp(12px, 1.1vw, 32px); }
.cg-tv-side .rf-label { display: flex; align-items: center; gap: 0.4em; }
.cg-tv-actor { display: flex; align-items: center; gap: clamp(20px, 2vw, 60px); }
.cg-tv-name { overflow-wrap: anywhere; }
.cg-tv .rf-ring.cg-tv-ring { width: clamp(220px, 20vw, 560px); height: clamp(220px, 20vw, 560px); }
.cg-tv .rf-ring.cg-tv-ring .rf-ring-num { font-size: clamp(72px, 7vw, 200px); }
.cg-tv .rf-ring.cg-tv-ring > svg { stroke-width: 5; }
.cg-tv-clock { display: flex; align-items: center; gap: clamp(24px, 2.5vw, 72px); }
.cg-tv-paused { display: inline-flex; align-items: center; gap: 0.4em; align-self: flex-start; padding: 0.2em 0.7em; border-radius: 999px; background: var(--rf-primary); color: var(--rf-ink); font-size: var(--rf-fs-title); font-weight: 800; }
.cg-tv .cg-rules { font-size: var(--rf-fs-body); color: var(--rf-muted); }
.cg-tv .cg-words { gap: 0.3em; }
.cg-tv .cg-words li { min-height: 1.9em; padding: 0.2em 0.6em; border-radius: 0.5em; font-size: var(--rf-fs-body); }
.cg-tv .cg-words .rf-icon { width: 1.1em; height: 1.1em; }
.cg-tv .cg-by { font-size: var(--rf-fs-small); }
.cg-tv-last { display: flex; flex-direction: column; gap: 0.4em; }
.cg-relay { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(10px, 0.9vw, 26px); }
.cg-relay-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 0.5em; min-height: 2.2em; padding: 0 0.6em; border-radius: 0.6em;
  background: var(--rf-panel); font-size: clamp(28px, 2.08vw, 60px); font-weight: 800; }
.cg-relay-row .rf-avatar { width: 1.1em; height: 1.1em; }
.cg-relay-row.is-acting { background: var(--rf-primary); color: var(--rf-ink); --rf-track: rgba(11, 20, 80, 0.25); }
.cg-relay-bar { display: block; height: 0.35em; border-radius: 999px; background: var(--rf-track); overflow: hidden; }
.cg-relay-bar i { display: block; height: 100%; width: calc(var(--rf-p, 0) * 100%); border-radius: inherit; background: currentColor; }
.cg-relay-score { min-width: 1.6ch; text-align: right; font-variant-numeric: tabular-nums; }
.cg-tv-final { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 3vw, 88px); flex: 1; align-items: center; }
.cg-tv-win { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(16px, 1.4vw, 40px); }
.cg-tv-win > .rf-icon { width: clamp(120px, 10vw, 280px); height: clamp(120px, 10vw, 280px); color: var(--rf-primary); }
.cg-tv-away { position: fixed; left: 50%; bottom: clamp(24px, 3vw, 80px); transform: translateX(-50%); display: flex; align-items: center; gap: 0.5em;
  padding: 0.4em 1em; border-radius: 999px; background: var(--rf-pink); color: var(--rf-ink); font-weight: 800; white-space: nowrap; }
@media (max-width: 900px) {
  .cg-tv-split, .cg-tv-final { grid-template-columns: 1fr; }
  .cg-tv-lobby { grid-template-columns: 1fr; grid-template-areas: "join" "qr" "people"; }
}
@media (min-width: 760px) {
  .cg-sets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cg-join .rf-code-input { min-height: 72px; font-size: 44px; font-weight: 800; letter-spacing: 0.3em; }
.cg-phone .rf-ring--lg { width: 112px; height: 112px; }
.cg-phone .rf-ring--lg .rf-ring-num { font-size: 30px; letter-spacing: -0.03em; }
.cg-phone .rf-hostbar .rf-ring-num { font-size: 13px; letter-spacing: -0.02em; }
.cg-winner > .rf-icon, .mg-winner > .rf-icon { width: 64px; height: 64px; color: var(--rf-primary); }
/* v2.2 (QA-B #6): the host lobby's TV line, as Bingo's and Words' */
.cg-tvs { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--rf-muted-room); font-weight: 700; }
/* v2.2 (QA-B #8): a full lobby (12 players, up to 4 teams) fits the TV: the code and the QR code are sized by the screen's
   height too, and the gaps tighten on a short screen */
.cg-tv-lobby { gap: clamp(16px, min(2.5vw, 3vh), 72px); }
.cg-tv-lobby .rf-qr-box { width: min(clamp(220px, 25vw, 720px), 34vh); height: min(clamp(220px, 25vw, 720px), 34vh); }
.cg-tv-lobby .rf-code > span { font-size: min(var(--rf-fs-code), 15vh); }
.cg-tv-join { gap: clamp(12px, min(1.6vw, 2.2vh), 46px); }
