/* ============================================================
   irikos — LIVE QUIZ (Kahoot-style, our system).
   Builds on mobile.css tokens. The live experience runs in
   DARK by default (great for projected screens); energy comes
   from scale + motion + the single teal accent — never loud color.
   Answer slots are SHAPE + NUMBER coded (accessible), not color-coded.
   ============================================================ */

/* shared display scale */
.lv { --q-shape-0: #19b39f; --q-shape-1: #5aa6e6; --q-shape-2: #e6b24c; --q-shape-3: #a98fe0; }

/* button reset (the app's global reset lives in styles.css, not loaded here) */
.lv-stage button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---- the projected/host stage backdrop: calm dark with a faint teal wash ---- */
.lv-host {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in oklab, var(--accent) 16%, var(--bg)) 0%, transparent 55%),
    var(--bg);
  color: var(--ink); font-family: var(--sans); overflow: hidden;
}
.lv-host-pad { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 24px 30px; }

/* generic big display type */
.lv-display { font-weight: 800; letter-spacing: -0.025em; line-height: 1.06; }

/* =====================================================================
   HOST — SETUP
   ===================================================================== */
.lv-setup { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 22px; }
.lv-setup-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.lv-setup-title { font-size: 38px; }
.lv-field { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 20px 22px; }
.lv-field-label { font-size: 15px; font-weight: 700; }
.lv-field-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.lv-fam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.lv-fam {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius-md);
  padding: 14px 16px; text-align: left; transition: border-color 140ms ease, background 140ms ease;
}
.lv-fam.is-on { border-color: var(--accent); background: var(--accent-soft); }
.lv-fam-name { font-size: 14px; font-weight: 600; }
.lv-field-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lv-field-row + .lv-field-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }

/* =====================================================================
   HOST — LOBBY
   ===================================================================== */
.lv-lobby { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lv-lobby-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.lv-join-card {
  display: flex; align-items: stretch; background: var(--card);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-pop);
  border: 1px solid var(--rule);
}
.lv-join-where { padding: 16px 22px; display: flex; flex-direction: column; justify-content: center; }
.lv-join-where .l1 { font-size: 14px; color: var(--ink-3); }
.lv-join-where .l2 { font-size: 17px; font-weight: 700; }
.lv-join-pin { background: var(--bg-2); padding: 14px 26px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--rule); }
.lv-join-pin .pl { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.lv-pin-num { font-size: 46px; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; line-height: 1; }
.lv-qr { width: 116px; height: 116px; background: #fff; border-radius: 14px; padding: 9px; flex-shrink: 0; box-shadow: var(--shadow-card); }
.lv-qr svg { display: block; width: 100%; height: 100%; }

.lv-lobby-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 0; }
.lv-waiting { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 14px; }
.lv-count-pill {
  font-size: 18px; font-weight: 800; color: #fff; background: var(--accent);
  padding: 6px 16px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.lv-players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 880px; }
.lv-player-chip {
  display: flex; align-items: center; gap: 9px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px 8px 8px;
  font-size: 16px; font-weight: 600; animation: lv-pop-in 360ms var(--spring);
}
.lv-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
@keyframes lv-pop-in { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.lv-lobby-foot { display: flex; align-items: center; justify-content: space-between; }
.lv-lobby-empty { color: var(--ink-3); font-size: 16px; }

/* =====================================================================
   COUNTDOWN RING
   ===================================================================== */
.lv-ring { position: relative; display: grid; place-items: center; }
.lv-ring svg { transform: rotate(-90deg); display: block; }
.lv-ring-track { stroke: var(--bg-3); }
.lv-ring-fill { stroke: var(--accent); transition: stroke-dashoffset 980ms linear, stroke 300ms ease; stroke-linecap: round; }
.lv-ring.is-warn .lv-ring-fill { stroke: var(--warn); }
.lv-ring.is-danger .lv-ring-fill { stroke: var(--no); }
.lv-ring-num { position: absolute; font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-ring.is-danger .lv-ring-num { color: var(--no); }

/* =====================================================================
   HOST — QUESTION
   ===================================================================== */
.lv-q { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lv-q-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lv-q-tag { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.lv-q-counter { font-size: 15px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lv-q-prompt {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: clamp(30px, 4.2vw, 50px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.16;
  padding: 18px 10px; text-wrap: balance;
}
.lv-blank { display: inline-block; min-width: 1.6em; border-bottom: 5px solid var(--accent); margin: 0 6px; vertical-align: bottom; }
/* A single wrapping line for non-passage prompts. Without this the prompt's
   text-runs + blank become side-by-side flex items inside .lv-q-prompt and a
   long sentence splits into narrow columns around the blank. */
.lv-q-line { display: block; width: 100%; text-align: center; text-wrap: balance; }
/* Persistent "join with this PIN" chip on the board during a game (late joiners). */
.lv-pin-chip { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 40; display: inline-flex; align-items: center; gap: 9px; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 15px 6px 13px; box-shadow: var(--shadow-card); }
.lv-pin-chip-l { font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.lv-pin-chip-n { font-size: 15px; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--ink); }
/* OGE passage prompts on the BOARD: a whole paragraph with one blank.
   The base .lv-q-prompt is display:flex, which turned the passage's text
   runs + blank into side-by-side flex items (a narrow left column, then the
   blank, then the rest). Center a single block child instead so the passage
   flows as one paragraph and fills the wide board without overflowing. */
.lv-q-prompt.is-passage { display: flex !important; flex-direction: column; justify-content: center !important; align-items: stretch !important; overflow: visible; max-height: none; text-align: left; padding: 12px clamp(18px, 5vw, 80px); }
.lv-q-prompt.is-passage .lv-passage-inner { font-size: clamp(20px, 2.6vw, 34px); font-weight: 700; line-height: 1.55; text-wrap: pretty; max-height: 82vh; overflow-y: auto; width: 100%; }
.lv-q-prompt.is-passage .lv-blank { min-width: 2.4em; }
.lv-p-prompt.is-passage { font-size: clamp(12.5px, 3.5vw, 15px); font-weight: 600; line-height: 1.5; text-align: left; max-height: 46vh; overflow-y: auto; padding: 12px 12px 10px; background: color-mix(in oklab, var(--ink) 4%, transparent); border-radius: 12px; }
.lv-oge-note { line-height: 1.5; }
/* OGE-live passage framing + word-only reveal */
.lv-context-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px; }
.lv-form-word { margin-top: 16px; font-size: 15px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.lv-reveal-word { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1; justify-content: center; padding: 16px 0; }
.lv-reveal-answer { font-size: clamp(34px, 5vw, 60px); font-weight: 800; color: var(--ok); letter-spacing: -0.01em; text-align: center; }
/* In a long passage the single blank must be impossible to miss — a highlighted
   pulsing box rather than a faint underline. */
.lv-p-prompt.is-passage .lv-blank, .lv-q-prompt.is-passage .lv-blank {
  min-width: 4.2em; height: 1.45em; border: 2px dashed var(--accent); border-bottom-width: 2px;
  border-radius: 7px; background: color-mix(in oklab, var(--accent) 16%, transparent);
  margin: 0 5px; vertical-align: middle; animation: lvBlankPulse 1.5s ease-in-out infinite;
}
@keyframes lvBlankPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 0%, transparent); }
}
.lv-q-sub { display: flex; align-items: center; justify-content: center; gap: 28px; margin-bottom: 18px; }
.lv-answers-count { display: flex; flex-direction: column; align-items: center; }
.lv-answers-count .n { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.lv-answers-count .l { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* ANSWER GRID — shape + number coded */
.lv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lv-opt {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border: 2px solid var(--rule); border-radius: var(--radius-lg);
  padding: 18px 22px; min-height: 84px; font-size: clamp(18px, 2vw, 24px); font-weight: 700;
  transition: border-color 140ms ease, background 140ms ease, opacity 220ms ease, transform 120ms ease;
}
.lv-shape { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; }
.lv-opt-num { width: 26px; height: 26px; border-radius: 7px; background: var(--bg-3); color: var(--ink-2); display: grid; place-items: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.lv-opt-text { flex: 1; }
.lv-opt-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 800; flex-shrink: 0; }
.lv-opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.lv-opt.is-correct .lv-opt-mark { background: var(--ok); }
.lv-opt.is-wrong { border-color: var(--no); background: var(--no-soft); }
.lv-opt.is-wrong .lv-opt-mark { background: var(--no); }
.lv-opt.is-faded { opacity: 0.4; }

/* =====================================================================
   HOST — REVEAL (distribution + leaderboard)
   ===================================================================== */
.lv-reveal { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; min-height: 0; padding-bottom: 6px; }
.lv-reveal-main { display: flex; flex-direction: column; min-height: 0; }
.lv-dist { display: flex; align-items: stretch; gap: 16px; flex: 1; min-height: 0; overflow: hidden; padding-top: 8px; }
.lv-dist-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-height: 0; }
.lv-dist-track { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; }
.lv-dist-bar { width: 100%; border-radius: 10px 10px 4px 4px; background: var(--bg-3); min-height: 6px; transition: height 600ms var(--spring); }
.lv-dist-col.is-correct .lv-dist-bar { background: var(--ok); }
.lv-dist-n { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); flex: 0 0 auto; }
.lv-dist-col.is-correct .lv-dist-n { color: var(--ok); }
.lv-dist-others { color: var(--ink-4); }
.lv-dist-foot { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink-2); flex: 0 0 auto; text-align: center; max-width: 100%; }
.lv-dist-foot span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 13ch; }

.lv-board { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; }
.lv-board-title { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.lv-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.lv-row:last-child { border-bottom: 0; }
.lv-rank { width: 26px; font-size: 16px; font-weight: 800; color: var(--ink-3); text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.lv-row-name { flex: 1; font-size: 16px; font-weight: 600; }
.lv-row-score { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-row-delta { font-size: 12px; font-weight: 700; color: var(--ok); margin-left: 4px; }

/* =====================================================================
   HOST — FINAL (podium)
   ===================================================================== */
.lv-final { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 24px; }
.lv-final-title { font-size: 38px; text-align: center; }
.lv-podium { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.lv-pod { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 180px; }
.lv-pod-av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800; }
.lv-pod-name { font-size: 18px; font-weight: 700; }
.lv-pod-score { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.lv-pod-stand { width: 100%; border-radius: 14px 14px 0 0; background: var(--card); border: 1px solid var(--rule); border-bottom: 0; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: var(--accent-ink); }
.lv-pod.p1 .lv-pod-stand { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 35%, var(--rule)); }

/* =====================================================================
   PLAYER (phone) — reuses .m-* from mobile.css
   ===================================================================== */
.lv-p { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--sans); }
.lv-p-pad { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 70px 22px 26px; }
.lv-p-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }

/* join */
.lv-join-input {
  width: 100%; text-align: center; background: var(--card); border: 2px solid var(--rule-2);
  border-radius: var(--radius-md); padding: 18px; font-weight: 800; color: var(--ink);
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
.lv-join-input::placeholder { color: var(--ink-4); font-weight: 600; letter-spacing: 0; }
.lv-join-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lv-join-input.pin { font-size: 34px; letter-spacing: 0.18em; }
.lv-join-input.nick { font-size: 20px; }

/* player lobby / waiting pulse */
.lv-pulse { width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; position: relative; }
.lv-pulse::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: lv-pulse 1.8s ease-out infinite; }
@keyframes lv-pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }
.lv-pulse-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); }

/* player answer grid — big tappable, 2x2 */
.lv-p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lv-p-opt {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: var(--card); border: 2px solid var(--rule-2); border-radius: var(--radius-lg);
  padding: 16px; min-height: 116px; text-align: left;
  transition: border-color 130ms ease, background 130ms ease, transform 120ms ease, opacity 200ms ease;
}
.lv-p-opt:active { transform: scale(0.97); }
.lv-p-opt-text { font-size: 18px; font-weight: 700; line-height: 1.2; }
.lv-p-opt.is-dim { opacity: 0.45; }
.lv-p-opt.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.lv-p-opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.lv-p-opt.is-wrong { border-color: var(--no); background: var(--no-soft); }

/* slim countdown bar (player) */
.lv-p-bar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin-bottom: 16px; }
.lv-p-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 980ms linear, background 300ms ease; }
.lv-p-bar-fill.is-warn { background: var(--warn); }
.lv-p-bar-fill.is-danger { background: var(--no); }

.lv-p-prompt { font-size: 21px; font-weight: 700; line-height: 1.32; letter-spacing: -0.01em; margin-bottom: 16px; text-wrap: pretty; }
.lv-p-prompt .lv-blank { border-bottom-width: 3px; }

/* player feedback (reveal) */
.lv-verdict { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 56px; font-weight: 800; color: #fff; animation: lv-pop-in 420ms var(--spring); }
.lv-verdict.ok { background: var(--ok); }
.lv-verdict.no { background: var(--no); }
.lv-points { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-points-sub { font-size: 14px; color: var(--ink-3); }
.lv-rank-big { font-size: 26px; font-weight: 800; }
.lv-rank-big .em { color: var(--accent-ink); }

/* shape badges shared */
.lv-shape-tri  { color: var(--q-shape-0); }
.lv-shape-dia  { color: var(--q-shape-1); }
.lv-shape-cir  { color: var(--q-shape-2); }
.lv-shape-sqr  { color: var(--q-shape-3); }

/* locked state */
.lv-locked-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 18px 20px; width: 100%; }

/* edge: reconnecting overlay */
.lv-overlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: color-mix(in oklab, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-align: center; padding: 30px; }
.lv-spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--rule-2); border-top-color: var(--accent); animation: lv-spin 800ms linear infinite; }
@keyframes lv-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   STAGE — host frame + player phone + director
   ===================================================================== */
.lv-stage {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 30px 24px 150px; background: radial-gradient(1100px 600px at 50% -10%, #25302e 0%, #15201d 60%, #101512 100%);
  font-family: var(--sans);
}
.lv-stage-head { text-align: center; color: #d8ddd9; max-width: 720px; }
.lv-stage-head h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; color: #fff; }
.lv-stage-head p { font-size: 14px; color: #93a09a; margin: 0; }
.lv-stage-views { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; justify-content: center; }
.lv-view-label { text-align: center; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8fa49d; margin-bottom: 12px; }

/* director control bar (fixed bottom) */
.lv-director {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(20,24,22,0.92); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -16px rgba(0,0,0,0.6);
  max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center;
}
.lv-dir-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; transition: filter 130ms ease, transform 120ms ease; }
.lv-dir-btn:active { transform: scale(0.96); }
.lv-dir-btn.ghost { background: rgba(255,255,255,0.08); color: #d8ddd9; }
.lv-dir-btn:disabled { opacity: 0.4; }
.lv-dir-state { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: #9fb0a9; text-transform: uppercase; padding: 0 8px; min-width: 96px; text-align: center; }
.lv-dir-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.12); }
.lv-dir-toggle { font-size: 12px; font-weight: 600; color: #b9c4bf; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.lv-dir-toggle.is-on { background: var(--no); color: #fff; }

@media (max-width: 980px) {
  .lv-stage-views { flex-direction: column; gap: 28px; }
}

/* ---- host component classes (mirrored from the app's styles.css so the live
   stylesheet is self-sufficient — same teal pill / segmented / switch) ---- */
.cta-primary { display: inline-flex; align-items: center; gap: 12px; background: var(--accent); color: #fff; padding: 8px 10px 8px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; min-height: 50px; box-shadow: 0 1px 2px rgba(10,90,80,0.18); transition: background 140ms ease, transform 120ms ease; }
.cta-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.cta-primary:active { transform: none; }
.cta-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.cta-primary.lg { padding: 11px 11px 11px 28px; font-size: 16px; min-height: 58px; }
.cta-arrow { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: #fff; color: var(--accent-ink); display: grid; place-items: center; font-size: 16px; font-weight: 700; line-height: 1; }
.cta-primary.lg .cta-arrow { width: 38px; height: 38px; font-size: 18px; }
.cta-secondary { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--card); color: var(--ink-2); border: 1px solid var(--rule-2); font-size: 14px; font-weight: 500; min-height: 48px; transition: background 140ms ease; }
.cta-secondary:hover { background: var(--bg-2); color: var(--ink); }
.segmented { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 999px; border: 1px solid var(--rule); }
.segmented-btn { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-3); min-height: 36px; transition: background 140ms ease, color 140ms ease; }
.segmented-btn.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.switch { width: 46px; height: 26px; padding: 2px; background: var(--bg-3); border-radius: 999px; display: inline-flex; align-items: center; transition: background 200ms ease; border: 0; flex-shrink: 0; }
.switch > span { width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 200ms ease; }
.switch.is-on { background: var(--accent); }
.switch.is-on > span { transform: translateX(20px); }

/* =====================================================================
   PLAYER on a COMPUTER — same screens, centered & roomier
   ===================================================================== */
.lv-p.is-wide .lv-p-pad { max-width: 580px; margin: 0 auto; padding: 56px 36px; }
.lv-p.is-wide .lv-p-prompt { font-size: 27px; }
.lv-p.is-wide .lv-p-opt { min-height: 132px; padding: 22px; }
.lv-p.is-wide .lv-p-opt-text { font-size: 21px; }
.lv-p.is-wide .lv-join-input.pin { font-size: 40px; }
.lv-p.is-wide .lv-verdict { width: 128px; height: 128px; font-size: 64px; }
.lv-p.is-wide .lv-points { font-size: 48px; }

/* =====================================================================
   HOST too small — you can't host from a phone
   ===================================================================== */
.lv-guard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 40px 30px; }
.lv-guard-mark { width: 78px; height: 78px; border-radius: 22px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-ink); }
.lv-guard h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 0; }
.lv-guard p { font-size: 15px; color: var(--ink-3); margin: 0; max-width: 30ch; line-height: 1.5; }
.lv-guard-hint { margin-top: 8px; font-size: 13px; color: var(--ink-4); }

/* host main-app top nav (charcoal pill) — shows the live-quiz entry lives here, not only in Class */
.lv-topnav { display: flex; align-items: center; gap: 8px; background: #2a2d2c; border-radius: 999px; padding: 8px; box-shadow: 0 6px 18px -6px rgba(0,0,0,0.55); margin-bottom: 26px; }
.lv-tn-brand { display: flex; align-items: baseline; gap: 0; background: #16201d; color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: 0.03em; }
.lv-tn-brand .a { color: var(--accent); }
.lv-tn-tabs { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.lv-tn-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; color: #c2c6c2; font-size: 13px; font-weight: 500; }
.lv-tn-tab.is-on { background: #fff; color: #222; font-weight: 600; }
.lv-tn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--no); }
.lv-tn-avatar { width: 34px; height: 34px; border-radius: 50%; background: #16201d; color: #ddd; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-left: 4px; }

/* typed-question host hint */
.lv-typed-hint { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 22px; border: 2px dashed var(--rule-2); border-radius: var(--radius-lg); color: var(--ink-3); font-size: clamp(16px, 1.8vw, 20px); font-weight: 600; }

/* player sign-in divider + text button */
.lv-or { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 13px; margin: 18px 0; }
.lv-or::before, .lv-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.lv-text-btn { display: block; width: 100%; text-align: center; margin-top: 14px; padding: 12px; color: var(--ink-3); font-size: 14px; font-weight: 600; }

/* live-quiz entry icon (in the app top bar) + 2×2 shape glyph + "live" dot */
.lv-quiz-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; position: relative; flex-shrink: 0; }
.lv-quiz-glyph { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.lv-quiz-btn::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--no); border: 2px solid var(--bg); }
.lv-callout { position: absolute; top: 104px; right: 18px; z-index: 5; white-space: nowrap; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 10px; box-shadow: var(--shadow-pop); }
.lv-callout::before { content: ""; position: absolute; top: -5px; right: 18px; width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); }

/* end-of-game review (teacher) */
.lv-review { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; scrollbar-width: thin; }
.lv-review-q { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 16px 18px; }
.lv-review-q-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lv-review-pct { font-size: 14px; font-weight: 800; color: var(--ok); }
.lv-review-pct[data-low="true"] { color: var(--no); }
.lv-review-prompt { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
/* Passage review rows are full paragraphs — shrink, left-align, cap height. */
.lv-review-prompt.is-passage { font-size: 14px; font-weight: 600; line-height: 1.5; text-align: left; max-height: 30vh; overflow-y: auto; }
.lv-review-bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.lv-review-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lv-review-meta { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.lv-review-meta b { color: var(--ink); }

/* per-student table */
/* Horizontally-scrollable so it adapts to ANY question count (10/20/30). The
   student column is sticky so names stay put while the Q marks scroll. */
.lv-table { width: 100%; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.lv-table-head, .lv-table-row { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.lv-table-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); background: var(--bg-2); }
.lv-table-row { border-top: 1px solid var(--rule); font-size: 15px; }
.lv-th-name { flex: 0 0 148px; display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 11px 14px; position: sticky; left: 0; background: var(--card); z-index: 1; }
.lv-table-head .lv-th-name { background: var(--bg-2); }
.lv-table-row.is-you { background: var(--accent-soft); }
.lv-table-row.is-you .lv-th-name { background: var(--accent-soft); }
.lv-th-q { flex: 0 0 34px; display: grid; place-items: center; padding: 11px 0; font-variant-numeric: tabular-nums; }
.lv-th-score { flex: 0 0 66px; display: grid; place-items: center; padding: 11px 8px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.lv-mk { font-style: normal; font-weight: 800; }
.lv-mk.ok { color: var(--ok); }
.lv-mk.no { color: var(--no); }
/* =====================================================================
   PRODUCTION ADDITIONS (fold-in): the .m-* phone classes the player views
   use (the prototype loaded mobile.css; production doesn't), plus the dark-
   mode accent-ink fix so accent text/podium numbers aren't near-black on the
   dark live screens.
   ===================================================================== */
:root[data-theme="dark"] {
  --accent-ink:  color-mix(in oklab, var(--accent) 70%, #fff);
  --accent-deep: color-mix(in oklab, var(--accent) 55%, #fff);
}
.m-appbar { display: flex; align-items: center; justify-content: space-between; padding: 56px 18px 10px; }
.m-brand { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 17px; letter-spacing: 0.02em; }
.m-brand .b-main { color: var(--ink); }
.m-brand .b-accent { color: var(--accent); }
.m-brand .b-tag { color: var(--ink-4); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.m-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--nav); color: #e6e6e6; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.m-eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: 5px 11px; border-radius: 999px; margin-bottom: 14px; }
.m-hero-title { font-size: 33px; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.m-hero-sub { color: var(--ink-3); font-size: 15px; margin: 0 0 22px; max-width: 30ch; }
.m-cta {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px;
  background: var(--accent); color: #fff; padding: 8px 8px 8px 24px; border-radius: 999px;
  font-size: 17px; font-weight: 700; box-shadow: 0 1px 2px rgba(10,90,80,0.2), 0 12px 28px -16px rgba(10,90,80,0.5);
  transition: transform 120ms ease, opacity 130ms ease;
}
.m-cta:active { transform: scale(0.985); }
.m-cta:disabled { opacity: 0.45; }
.m-cta .arrow { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--accent-ink); display: grid; place-items: center; font-size: 19px; font-weight: 700; flex-shrink: 0; }
.m-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); }
.m-card.is-accent { background: var(--accent-tint); border-color: color-mix(in oklab, var(--accent) 28%, var(--rule)); }
.m-card-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.m-card.is-accent .m-card-eyebrow { color: var(--accent-ink); }
.m-answer {
  width: 100%; min-height: 60px; background: var(--card); border: 2px solid var(--rule-2);
  border-radius: var(--radius-md); padding: 16px 18px; font-size: 19px; font-weight: 600; color: var(--ink);
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
.m-answer::placeholder { color: var(--ink-4); font-weight: 500; }
.m-answer:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.m-tasktag { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); display: inline-block; }

/* ---- production: full-viewport live screen container + exit ---- */
.lv-screen { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow: hidden; }
.lv-exit {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 62;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--card) 82%, transparent); color: var(--ink-2);
  font-size: 15px; display: grid; place-items: center; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* the host fills the screen; the player phone layout centers in a max-width column */
.lv-screen .lv-p { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 620px) { .lv-screen .lv-p { width: min(460px, 100%); left: 50%; right: auto; transform: translateX(-50%); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); } }

/* ===== Live entry chooser (desktop: host or join) + join hint ===== */
.lv-entry { max-width: 780px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 48px 24px; text-align: center; gap: 6px; }
.lv-entry-brand { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 800; letter-spacing: -0.02em; font-size: 18px; }
.lv-entry-brand .a { color: var(--accent); }
.lv-entry-brand .t { margin-left: 8px; font-size: 11px; letter-spacing: 0.18em; color: var(--ink-3); align-self: center; font-weight: 700; }
.lv-entry-title { font-size: clamp(34px, 6vw, 52px); margin: 8px 0 2px; }
.lv-entry-sub { color: var(--ink-3); font-size: 16px; max-width: 46ch; margin: 0 0 28px; }
.lv-entry-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.lv-entry-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  padding: 24px; border-radius: 18px; background: var(--card); border: 1px solid var(--rule); min-height: 210px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease; }
.lv-entry-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-tint); }
.lv-entry-glyph { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 4px; padding: 12px;
  border-radius: 12px; background: var(--bg-2); margin-bottom: 6px; }
.lv-entry-glyph.one { display: grid; place-items: center; }
.lv-entry-card-h { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.lv-entry-card-s { font-size: 14px; color: var(--ink-3); line-height: 1.45; flex: 1; }
.lv-entry-go { margin-top: 10px; font-weight: 700; color: var(--accent-ink); font-size: 15px; }
@media (max-width: 640px) { .lv-entry-cards { grid-template-columns: 1fr; } .lv-entry-card { min-height: 0; } }

.lv-back { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 14px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); font-size: 20px; font-weight: 700; z-index: 62; }
.lv-back:hover { background: var(--bg-3); color: var(--ink); }
.lv-join-screen { position: relative; }

.lv-join-hint { background: var(--bg-2); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 20px; max-width: 340px; }
.lv-join-hint-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 8px; }
.lv-join-hint ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.lv-join-hint b { color: var(--ink); }

/* ===== Host setup (configure the game) ===== */
.lv-setup-screen { position: relative; max-width: 600px; margin: 0 auto; min-height: 100%;
  display: flex; flex-direction: column; justify-content: center; padding: 60px 24px 40px; }
.lv-setup-group { margin-bottom: 22px; }
.lv-setup-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 10px; }
.lv-setup-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-chip { padding: 11px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule);
  color: var(--ink-2); font-size: 15px; font-weight: 600; transition: background 120ms ease, border-color 120ms ease, color 120ms ease; min-height: 44px; }
.lv-chip:hover { border-color: var(--ink-4); }
.lv-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lv-setup-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.lv-setup-go { align-self: flex-end; margin-top: 12px; }

/* host question: no-timer placeholder (keeps the ring's footprint) + skip button */
.lv-no-timer { display: grid; place-items: center; width: 124px; height: 124px; border-radius: 50%;
  border: 2px dashed var(--ink-4); color: var(--ink-3); font-weight: 700; font-size: 15px; text-align: center; }
.lv-skip-btn { margin-left: auto; align-self: center; }

/* player question tags: muted family chip + a prominent, distinct CUE badge */
.lv-p-tags { display: flex; gap: 8px; align-self: flex-start; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.lv-cue { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 0.06em;
  font-size: 14px; padding: 7px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-transform: uppercase; }
.lv-cue::before { content: "\21A6"; font-weight: 700; opacity: 0.85; font-size: 15px; }

/* ===== Lobby QR ===== */
.lv-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lv-qr-box { background: #fff; padding: 12px; border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); line-height: 0; }
.lv-qr-cap { font-size: 13px; color: var(--ink-3); }
.lv-join-tip { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.lv-join-tip b { color: var(--ink-2); }

/* ===== Live host · My-tasks source picker ===== */
.lv-tasklist { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; border-radius: 14px; background: rgba(255,255,255,.03); padding: 6px; }
.lv-task-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: none; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; color: inherit; }
.lv-task-row:hover { background: rgba(255,255,255,.05); }
.lv-task-check { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; border: 2px solid rgba(255,255,255,.28); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #06281f; }
.lv-task-row.is-on .lv-task-check { background: var(--accent); border-color: var(--accent); }
.lv-task-sentence { flex: 1; font-size: 15px; font-weight: 600; line-height: 1.3; }
.lv-task-fam { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.lv-task-fam[data-task="word-formation"] { color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, transparent); }
.lv-task-fam[data-task="grammar"] { color: #9db4ff; background: rgba(120,150,255,.15); }
.lv-task-fam[data-task="multiple-choice"] { color: #e7b45a; background: rgba(220,170,80,.16); }
.lv-task-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; flex-wrap: wrap; gap: 8px; }
.lv-task-count { color: rgba(255,255,255,.72); }
.lv-task-count b { color: var(--accent); }
.lv-task-actions { display: flex; gap: 18px; }
.lv-link { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; padding: 0; }
