/* common.css provides shared design tokens (:root vars) */
:root {
  --r: 12px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'DM Sans',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; }
body::before {
  content:''; position:fixed; inset:0; pointer-events:none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(64,128,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(240,192,64,0.05) 0%, transparent 60%);
}

.screen { display:none; flex-direction:column; min-height:100vh; padding:28px; gap:24px; max-width:1100px; margin:0 auto; }
.screen.active { display:flex; }

.topbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.practice-banner { background:rgba(139,92,246,0.12); border:1px solid rgba(139,92,246,0.3); color:#a78bfa; padding:6px 16px; border-radius:8px; font-size:0.82rem; font-weight:600; text-align:center; }
.logo { font-family:'Bebas Neue',sans-serif; font-size:2rem; letter-spacing:4px; background:linear-gradient(135deg,var(--gold),var(--amber)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.badge { font-size:0.72rem; font-weight:700; letter-spacing:2px; text-transform:uppercase; background:rgba(240,192,64,0.12); border:1px solid rgba(240,192,64,0.3); color:var(--gold); padding:4px 12px; border-radius:99px; }

.btn { padding:12px 24px; border-radius:var(--r); border:none; font-family:'DM Sans',sans-serif; font-size:0.95rem; font-weight:700; cursor:pointer; transition:all 0.18s; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.btn-primary { background:linear-gradient(135deg,var(--gold),var(--amber)); color:#080b14; }
.btn-primary:hover { filter:brightness(1.1); transform:translateY(-1px); }
.btn-secondary { background:var(--surface); color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover { border-color:var(--gold); background:var(--surface2); }
.btn-danger { background:rgba(238,51,85,0.12); color:var(--red); border:1px solid rgba(238,51,85,0.25); }
.btn-danger:hover { background:rgba(238,51,85,0.22); }
.btn-ghost { background:transparent; color:var(--muted); border:1px solid var(--border); }
.btn-ghost:hover { color:var(--text); border-color:var(--muted); }
.btn-sm { padding:8px 16px; font-size:0.82rem; border-radius:8px; }
.btn-lg { padding:16px 36px; font-size:1.1rem; }
.btn:disabled { opacity:0.4; cursor:not-allowed; transform:none !important; filter:none !important; }

.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:22px; }
.section-label { font-size:0.7rem; font-weight:700; letter-spacing:2.5px; text-transform:uppercase; color:var(--muted); margin-bottom:14px; }

input[type=text], input[type=number], input[type=password], input[type=email], textarea, select {
  background:var(--surface2); border:1px solid var(--border); border-radius:8px;
  color:var(--text); font-family:'DM Sans',sans-serif; font-size:16px;
  padding:10px 14px; outline:none; width:100%; transition:border-color 0.2s;
}
input:focus, textarea:focus, select:focus { border-color:var(--gold); }
select option { background:var(--surface); }

/* iOS Safari zooms the page when a focused input has font-size < 16px,
   and doesn't always zoom back out on blur (appears as stuck-zoom after
   closing a modal). Force 16px on every focusable field, including the
   compact ones that opted into a smaller size. */
input[type=text], input[type=number], input[type=password], input[type=email],
input[type=search], input[type=tel], input[type=url], textarea, select,
.room-code-input, .custom-timer-input { font-size:16px; }

/* Floating vote tally panel. Sits top-right on every host screen when
   a voting round is active so the host always sees where votes are
   landing, without navigating back to the lobby. */
.host-vote-float {
  position:fixed; top:16px; right:16px; z-index:60;
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  padding:12px 14px; min-width:240px; max-width:320px;
  box-shadow:0 8px 28px rgba(0,0,0,0.35);
}
.host-vote-float-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.host-vote-float-title {
  font-size:0.72rem; font-weight:700; letter-spacing:2px; text-transform:uppercase;
  color:var(--muted);
}
.host-vote-float-controls { display:flex; gap:4px; }
.host-vote-float-icon-btn {
  background:transparent; border:none; color:var(--muted); font-size:0.95rem;
  width:24px; height:24px; line-height:1; padding:0; cursor:pointer; border-radius:4px;
  display:inline-flex; align-items:center; justify-content:center;
}
.host-vote-float-icon-btn:hover { background:rgba(255,255,255,0.08); color:var(--text); }
.host-vote-float.minimized { padding:8px 12px; min-width:auto; }
.host-vote-float.minimized #hostVoteFloatBody { display:none; }
.host-vote-float-actions { display:flex; gap:6px; margin-top:10px; justify-content:flex-end; }
.host-vote-float-actions .btn { padding:6px 10px; font-size:0.8rem; min-height:32px; width:auto; }

/* ── HOME ── */
/* `safe center` centers content when it fits, but falls back to flex-start
   when content overflows — otherwise the top of the screen (sound toggle,
   logo, badge) gets pushed above the viewport and becomes unreachable. */
#home { align-items:center; justify-content:safe center; text-align:center; gap:32px; }
.hero-logo { font-family:'Bebas Neue',sans-serif; font-size:clamp(5rem,12vw,9rem); letter-spacing:10px; background:linear-gradient(135deg,var(--gold),var(--amber)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; filter:drop-shadow(0 0 60px rgba(240,192,64,0.2)); line-height:1; }
.hero-sub { color:var(--muted); font-size:1rem; letter-spacing:3px; text-transform:uppercase; }
.room-code-bar { display:flex; align-items:center; gap:12px; margin:16px 0 8px; padding:10px 20px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); flex-wrap:wrap; }
/* Resume-game banner — appears on the home dashboard when the host
   has an active night running. Gold border + pulsing dot signals
   "you have something live to come back to." Click takes the host
   to the active screen via the resumeCurrentGame handler. */
.resume-game-banner { display:flex; align-items:center; gap:14px; width:100%; max-width:600px; margin:8px 0 16px; padding:14px 18px; background:linear-gradient(135deg, rgba(240,192,64,0.12), rgba(240,192,64,0.04)); border:1px solid rgba(240,192,64,0.45); border-radius:var(--r); color:var(--text); font-family:inherit; font-size:1rem; font-weight:600; cursor:pointer; transition:background 0.15s, border-color 0.15s, transform 0.08s; text-align:left; }
.resume-game-banner:hover, .resume-game-banner:focus-visible { background:linear-gradient(135deg, rgba(240,192,64,0.18), rgba(240,192,64,0.08)); border-color:var(--gold); outline:none; }
.resume-game-banner:active { transform:scale(0.99); }
.resume-game-icon { width:36px; height:36px; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:var(--gold); color:#080b14; font-size:1.1rem; box-shadow:0 0 0 0 rgba(240,192,64,0.6); animation:resumePulse 1.8s ease-in-out infinite; }
.resume-game-text { display:flex; flex-direction:column; gap:2px; min-width:0; }
.resume-game-text strong { color:var(--gold); font-size:0.95rem; }
.resume-game-sub { color:var(--muted); font-size:0.8rem; font-weight:500; }
@keyframes resumePulse {
  0%, 100% { box-shadow:0 0 0 0 rgba(240,192,64,0.55); }
  50%      { box-shadow:0 0 0 6px rgba(240,192,64,0); }
}
@media (prefers-reduced-motion: reduce) { .resume-game-icon { animation:none; } }
.room-code-label { font-size:0.75rem; font-weight:700; text-transform:uppercase; letter-spacing:2px; color:var(--muted); }
.room-code-value { font-family:'Bebas Neue',sans-serif; font-size:1.8rem; color:var(--gold); letter-spacing:6px; line-height:1; }
.room-code-edit-btn { padding:8px 12px; font-size:1rem; min-width:44px; min-height:44px; cursor:pointer; background:transparent; border:1px solid var(--border); border-radius:8px; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.room-code-edit-btn:hover { color:var(--text); border-color:var(--muted); }
.room-code-input { font-family:'DM Sans',sans-serif; font-size:1rem; letter-spacing:3px; text-transform:uppercase; background:var(--surface2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:10px 14px; width:140px; text-align:center; outline:none; transition:border-color 0.2s; }
.room-code-input:focus { border-color:var(--gold); }
.room-code-cancel-btn { padding:8px 12px; font-size:1rem; min-width:44px; min-height:44px; cursor:pointer; background:transparent; border:1px solid var(--border); border-radius:8px; color:#e74c3c; display:flex; align-items:center; justify-content:center; }
.room-code-cancel-btn:hover { border-color:#e74c3c; background:rgba(231,76,60,0.1); }
.btn-sm { padding:4px 10px; font-size:0.8rem; min-width:auto; }
.home-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; width:100%; max-width:800px; }
.home-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:24px; cursor:pointer; transition:all 0.2s; text-align:left; }
.home-card:hover { border-color:var(--gold); transform:translateY(-3px); background:var(--surface2); }
.home-card:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.home-card-icon { font-size:2rem; margin-bottom:12px; }
.home-card-title { font-weight:700; font-size:1.05rem; margin-bottom:4px; }
.home-card-desc { font-size:0.82rem; color:var(--muted); }

/* ── LOBBY ── */
#lobby { flex-direction:row; flex-wrap:wrap; gap:24px; }
.lobby-left { flex:1; min-width:280px; display:flex; flex-direction:column; gap:20px; overflow-y:auto; max-height:calc(100vh - 100px); }
.lobby-right { flex:1; min-width:280px; display:flex; flex-direction:column; gap:20px; }

.game-code-display { text-align:center; padding:28px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); }
.code-label { font-size:0.7rem; letter-spacing:3px; text-transform:uppercase; color:var(--muted); margin-bottom:8px; }
.game-code { font-family:'Bebas Neue',sans-serif; font-size:5rem; letter-spacing:16px; background:linear-gradient(135deg,var(--gold),var(--amber)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; line-height:1; }
.join-url { font-size:0.8rem; color:var(--muted); margin-top:10px; word-break:break-all; }
.permanent-badge { display:inline-flex; align-items:center; gap:6px; margin-top:10px; font-size:0.72rem; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--green); background:rgba(48,204,112,0.1); border:1px solid rgba(48,204,112,0.25); padding:4px 12px; border-radius:99px; }

.qr-wrap { background:white; border-radius:12px; padding:16px; display:flex; align-items:center; justify-content:center; aspect-ratio:1; max-width:200px; margin:12px auto 0; }

.player-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.player-pill { display:flex; align-items:center; gap:8px; background:var(--surface2); border:1px solid var(--border); border-radius:99px; padding:8px 14px; font-size:0.88rem; font-weight:500; animation:popIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes popIn { from{opacity:0;transform:scale(0.7)} to{opacity:1;transform:scale(1)} }
.player-pill-emoji { font-size:1.2rem; display:flex; align-items:center; }
.avatar { border-radius:50%; vertical-align:middle; }
/* Photo avatars (player-uploaded). object-fit:cover crops a
   non-square upload into the circular frame so a portrait selfie
   doesn't stretch sideways on a 36px scoreboard slot. */
.avatar.avatar-photo { object-fit:cover; }
.player-pill-disconnected { opacity:0.5; }
.player-pill.disconnected { opacity:0.55; border-color:#5a3a3a; }
.player-pill-status { width:8px; height:8px; border-radius:50%; display:inline-block; margin-left:4px; flex:0 0 8px; }
.player-pill-status.online { background:var(--green, #3ae07e); box-shadow:0 0 6px rgba(58,224,126,0.5); }
.player-pill-status.offline { background:var(--red, #ff4466); box-shadow:0 0 6px rgba(255,68,102,0.5); animation:pulseDot 1.4s ease-in-out infinite; }
@keyframes pulseDot { 0%,100%{opacity:1} 50%{opacity:0.35} }
.player-pill-kick { background:transparent; border:none; color:var(--muted); font-size:1.1rem; line-height:1; cursor:pointer; padding:0; margin-left:4px; border-radius:50%; width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; transition:background 0.15s, color 0.15s; }
.player-pill-kick:hover { background:rgba(255,68,102,0.15); color:var(--red, #ff4466); }
.lb-row-offline { opacity:0.6; }
.lb-kick { margin-left:8px; align-self:center; }
/* Manual-adjust button (#11). Sits next to the kick × on every host
   leaderboard row (round-end + break). Phase-1 ephemeral: prompts for
   a delta, server applies in-memory and rebroadcasts. */
.lb-adjust {
  margin-left:8px; align-self:center;
  background:transparent; border:1px solid var(--border);
  color:var(--muted); width:32px; height:32px; border-radius:6px;
  font-size:0.95rem; line-height:1; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
.lb-adjust:hover { background:rgba(255,255,255,0.06); color:var(--text); }

/* Score editor modal — opened from the row-level ± button. Three modes:
   adjust by delta (presets + custom), set absolute, clear (set to 0).
   Tab pattern reuses .auth-tab from common.css. */
.score-editor-meta { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px 14px; margin-bottom:14px; }
.score-editor-name { font-weight:700; font-size:1.05rem; margin-bottom:4px; }
.score-editor-current { font-size:0.88rem; color:var(--muted); }
.score-editor-current strong { color:var(--gold); font-family:'JetBrains Mono', monospace; font-size:1rem; }
.score-editor-tabs { display:flex; gap:4px; margin-bottom:14px; border-bottom:1px solid var(--border); padding-bottom:0; }
.score-editor-tabs .auth-tab { flex:1; }
.score-editor-pane { margin-bottom:8px; }
.score-editor-presets { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.score-editor-preset { padding:10px 8px; font-size:0.95rem; min-height:40px; font-variant-numeric:tabular-nums; }
.score-editor-row { display:flex; gap:8px; align-items:stretch; }
.score-editor-row input { flex:1; min-width:0; }
.score-editor-row .btn { width:auto; padding:0 16px; }
.score-editor-hint { font-size:0.78rem; color:var(--muted); margin-top:8px; line-height:1.35; }
.score-editor-clear-row { margin-top:14px; padding-top:12px; border-top:1px solid var(--border); display:flex; justify-content:center; }
.score-editor-clear { color:var(--red); border-color:rgba(238,51,85,0.35); }
.score-editor-clear:hover { background:rgba(238,51,85,0.12); }
.lb-name .player-pill-status { margin-left:8px; vertical-align:middle; }
.empty-lobby { color:var(--muted); font-size:0.9rem; font-style:italic; padding:20px 0; text-align:center; }

.settings-row { display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); }
.settings-row:last-child { border-bottom:none; }
.settings-key { font-size:0.88rem; color:var(--muted); }
.settings-val { font-size:0.88rem; font-weight:700; }

/* ── QUESTION HOST ── */
#question { gap:20px; }
.q-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.category-chip { font-size:0.72rem; font-weight:700; letter-spacing:2px; text-transform:uppercase; background:rgba(64,128,255,0.12); border:1px solid rgba(64,128,255,0.3); color:var(--blue); padding:4px 14px; border-radius:99px; }

.round-header {
  font-family:'Bebas Neue',sans-serif; font-size:1.6rem; letter-spacing:3px;
  color:var(--gold); text-align:center; padding:10px 0;
  border-bottom:2px solid var(--border); margin-bottom:4px;
}

.big-timer { font-family:'Bebas Neue',sans-serif; font-size:4rem; letter-spacing:4px; transition:color 0.3s; }
.big-timer.warning { color:var(--amber); }
.big-timer.danger { color:var(--red); animation:pulse 0.5s ease infinite alternate; }
.big-timer.paused { color:var(--blue); animation:none; }
@keyframes pulse { from{opacity:1} to{opacity:0.5} }

.progress-track { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,var(--gold),var(--amber)); border-radius:3px; transition:width 1s linear; }

.q-text { font-size:clamp(1.4rem,3vw,2.2rem); font-weight:700; line-height:1.3; }

.host-controls { display:flex; gap:8px; flex-wrap:wrap; }

.choices-host { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media(max-width:600px){ .choices-host{grid-template-columns:1fr;} }
.choice-host { background:var(--surface2); border:2px solid var(--border); border-radius:var(--r); padding:16px 18px; display:flex; align-items:center; gap:12px; font-size:1rem; font-weight:500; transition:all 0.3s; }
.choice-host.reveal-correct { border-color:var(--green); background:rgba(48,204,112,0.1); }
.choice-host.reveal-wrong { opacity:0.4; }
.choice-letter-badge { width:32px; height:32px; border-radius:8px; background:var(--border); display:flex; align-items:center; justify-content:center; font-family:'Bebas Neue',sans-serif; font-size:1.1rem; flex-shrink:0; }
.choice-host.reveal-correct .choice-letter-badge { background:var(--green); color:#080b14; }

.answer-tally { display:flex; align-items:center; gap:10px; }
.tally-count { font-size:0.9rem; color:var(--muted); }
.tally-count span { color:var(--text); font-weight:700; font-size:1.1rem; }

.answer-bars { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.answer-bar-row { display:flex; align-items:center; gap:10px; }
.bar-letter { font-family:'Bebas Neue',sans-serif; font-size:1rem; width:20px; text-align:center; color:var(--muted); }
.bar-track { flex:1; height:10px; background:var(--border); border-radius:5px; overflow:hidden; }
.bar-fill { height:100%; border-radius:5px; transition:width 0.5s ease; }
.bar-count { font-size:0.8rem; font-weight:700; width:20px; text-align:right; color:var(--muted); }

/* min was 160px which only left ~55px for the name column after the
   icon + points + padding. "EmceePlayer" (11 chars) truncated to
   "Emc..." (3-4 chars). 200px min frees ~95px which fits typical
   13-15 char names without ellipsis. The narrow-viewport override
   below stays at 130px so 2 cards still fit per row on a phone. */
.reveal-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.reveal-card { background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:12px 16px; display:flex; align-items:center; gap:10px; animation:popIn 0.3s ease; }
.reveal-card.correct { border-color:var(--green); background:rgba(48,204,112,0.07); }
.reveal-card.wrong { border-color:var(--red); background:rgba(238,51,85,0.06); }
.reveal-card.no-answer { opacity:0.5; }
.reveal-icon { font-size:1rem; flex-shrink:0; }
.reveal-name { font-size:0.88rem; font-weight:600; flex:1 1 0; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reveal-pts { font-family:'Bebas Neue',sans-serif; font-size:1.3rem; letter-spacing:1px; color:var(--gold); }
.reveal-pts.zero { color:var(--muted); }

/* ── RESULTS / ROUND END / NIGHT END ── */
#results, #roundEnd, #nightEnd { align-items:center; gap:28px; }
.round-end-set { font-size:1.1rem; color:var(--muted); text-align:center; margin-top:-12px; }
.results-title { font-family:'Bebas Neue',sans-serif; font-size:4rem; letter-spacing:6px; background:linear-gradient(135deg,var(--gold),var(--amber)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; text-align:center; }
.lb-list { width:100%; max-width:600px; display:flex; flex-direction:column; gap:10px; }
.lb-row { display:flex; align-items:center; gap:16px; padding:16px 20px; border-radius:var(--r); background:var(--surface); border:1px solid var(--border); animation:slideUp 0.4s ease both; transition:background 0.15s, border-color 0.15s; }
/* Clickable rows on the round-end / night-totals screens (open score
   editor on click). Pre-fix the row was clickable but visually
   identical to read-only rows, so the score-editor entry point
   was invisible. data-action="openScoreEditor" is set on the live
   rendered rows in host.js. */
.lb-row[data-action] { cursor:pointer; }
.lb-row[data-action]:hover,
.lb-row[data-action]:focus-visible { background:rgba(240,192,64,0.05); border-color:rgba(240,192,64,0.4); outline:none; }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.lb-row.rank-1 { border-color:var(--gold); background:rgba(240,192,64,0.07); }
.lb-row.rank-2 { border-color:#9ea8b4; }
.lb-row.rank-3 { border-color:#cd7f32; }
.lb-rank { font-family:'Bebas Neue',sans-serif; font-size:1.8rem; width:40px; text-align:center; }
.lb-row.rank-1 .lb-rank { color:var(--gold); }
.lb-row.rank-2 .lb-rank { color:#9ea8b4; }
.lb-row.rank-3 .lb-rank { color:#cd7f32; }
.lb-emoji { font-size:1.8rem; display:flex; align-items:center; }
/* min-width:0 lets flex items shrink below their intrinsic content width
   so ellipsis actually kicks in. Without it, long names push the score
   column (and any adjacent outline button) off the row. */
.lb-name { flex:1 1 0; min-width:0; font-weight:700; font-size:1.05rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-score { font-family:'Bebas Neue',sans-serif; font-size:2.2rem; color:var(--gold); letter-spacing:1px; }
.lb-score-label { font-size:0.7rem; color:var(--muted); letter-spacing:1px; text-transform:uppercase; text-align:right; }

/* ── ALLTIME LEADERBOARD ── */
#alltime { align-items:center; gap:24px; }
.alltime-title { font-family:'Bebas Neue',sans-serif; font-size:2.5rem; letter-spacing:4px; color:var(--gold); }
.alltime-row { display:flex; align-items:center; gap:16px; padding:14px 18px; border-radius:var(--r); background:var(--surface); border:1px solid var(--border); width:100%; max-width:600px; }
.alltime-rank { font-family:'Bebas Neue',sans-serif; font-size:1.4rem; width:35px; text-align:center; color:var(--muted); }
/* Period tabs above the leaderboard rows — Week / Month / Year / All-Time */
.lb-period-tabs {
  display:flex; gap:4px; background:var(--surface); border:1px solid var(--border);
  border-radius:999px; padding:4px; margin:0 0 16px; width:100%; max-width:600px;
  overflow-x:auto; -webkit-overflow-scrolling:touch;
}
.lb-period-tab {
  flex:1; min-width:80px; background:transparent; border:none; border-radius:999px;
  padding:8px 14px; color:var(--muted); font-weight:700; font-size:0.85rem;
  cursor:pointer; font-family:inherit; transition:all 0.15s; white-space:nowrap;
  touch-action:manipulation;
}
.lb-period-tab.active { background:linear-gradient(135deg,var(--gold),var(--amber)); color:#080b14; }
.lb-period-tab:hover:not(.active) { color:var(--text); }
.lb-empty { color:var(--muted); padding:24px 16px; text-align:center; }
.alltime-name { flex:1 1 0; min-width:0; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.alltime-stats { text-align:right; font-size:0.82rem; color:var(--muted); line-height:1.4; }
.alltime-stats strong { color:var(--gold); font-family:'Bebas Neue',sans-serif; font-size:1.3rem; letter-spacing:1px; }
/* Per-row action buttons: 🔗 combine + 🗑 remove. Subtle by default
   so they don't compete with the score; merge pulls gold on hover,
   remove pulls red. Used on both the All-Time leaderboard rows
   (.alltime-row) and the Open Play status leaderboard rows (.lb-row). */
.lb-row-remove, .lb-row-merge {
  background:transparent; border:1px solid transparent;
  color:rgba(255,255,255,0.35); font-size:1rem;
  width:32px; height:32px; min-width:0; padding:0;
  border-radius:8px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  transition:all 0.15s; touch-action:manipulation;
}
.lb-row-remove:hover, .lb-row-remove:focus-visible {
  color:var(--red); border-color:rgba(238,51,85,0.4);
  background:rgba(238,51,85,0.08); outline:none;
}
.lb-row-merge:hover, .lb-row-merge:focus-visible {
  color:var(--gold); border-color:rgba(240,192,64,0.4);
  background:rgba(240,192,64,0.1); outline:none;
}
/* On narrow viewports the combine icon is the first to go — it's a
   rarely-used admin action ("merge these two leaderboard rows"),
   while remove (🗑) is the more common scrub. Hiding combine on
   ≤480px frees ~48px of row width, which goes to the .alltime-name
   column (was getting only ~50px on a 358px row, truncating names
   to "Snoo..."/"Juan..."). Hosts on tablets/desktop still see it. */
@media (max-width: 480px) {
  .alltime-row .lb-row-merge { display:none; }
  /* Tighter gap + reduced padding so the .alltime-name column gets
     more horizontal room beyond what hiding combine already buys. */
  .alltime-row { gap:10px; padding:14px 12px; }
}

/* Combine-players target row in the modal — flex layout matches
   the leaderboard rows visually, with hover state pulling gold so
   the host knows clicking selects this as the merge target. */
.combine-target-row {
  display:flex; align-items:center; gap:12px;
  padding:10px 14px; border-radius:10px;
  background:var(--surface); border:1px solid var(--border);
  color:var(--text); font-family:inherit; font-size:0.95rem;
  cursor:pointer; transition:all 0.15s; text-align:left; width:100%;
}
.combine-target-row:hover, .combine-target-row:focus-visible {
  background:rgba(240,192,64,0.1); border-color:var(--gold); outline:none;
}
.combine-target-row .combine-target-name { flex:1; font-weight:600; }
.combine-target-row .combine-target-score {
  color:var(--gold); font-family:'Bebas Neue',sans-serif;
  font-size:1.1rem; letter-spacing:1px;
}

/* ── EDITOR ── */
#editor { gap:20px; }
.editor-top { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.editor-title { font-family:'Bebas Neue',sans-serif; font-size:2rem; letter-spacing:3px; color:var(--gold); }
.q-list { display:flex; flex-direction:column; gap:12px; }
.q-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:18px; display:flex; flex-direction:column; gap:12px; animation:slideIn 0.2s ease; }
@keyframes slideIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.q-card-top { display:flex; align-items:center; gap:10px; }
.q-num { font-family:'Bebas Neue',sans-serif; font-size:1.1rem; color:var(--gold); letter-spacing:1px; flex-shrink:0; }
.choices-2col { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
@media(max-width:500px){ .choices-2col{grid-template-columns:1fr;} }
.choice-row { display:flex; align-items:center; gap:8px; }
.correct-radio { width:18px; height:18px; accent-color:var(--green); cursor:pointer; flex-shrink:0; }
.remove-btn { background:none; border:none; color:var(--muted); cursor:pointer; font-size:1.1rem; padding:4px; transition:color 0.2s; }
.remove-btn:hover { color:var(--red); }

.timer-chips { display:flex; gap:8px; flex-wrap:wrap; }
.timer-chip { padding:7px 16px; border-radius:99px; border:2px solid var(--border); background:var(--surface2); cursor:pointer; font-size:0.88rem; font-weight:600; transition:all 0.18s; }
.timer-chip:hover { border-color:var(--gold); }
.timer-chip.on { border-color:var(--gold); background:rgba(240,192,64,0.12); color:var(--gold); }

.set-tabs { display:flex; gap:8px; flex-wrap:wrap; }
.set-tab { padding:8px 18px; border-radius:99px; border:2px solid var(--border); background:var(--surface2); cursor:pointer; font-size:0.85rem; font-weight:600; transition:all 0.18s; white-space:nowrap; }
.set-tab:hover { border-color:var(--gold); }
.set-tab.active { border-color:var(--gold); background:rgba(240,192,64,0.1); color:var(--gold); }

/* ── Setup set picker ── */
.setup-set-list {
  max-height:360px; overflow-y:auto; display:flex; flex-direction:column; gap:6px;
  scrollbar-width:thin; scrollbar-color:var(--border) transparent;
}
.setup-set-item {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 14px; border-radius:10px; cursor:pointer;
  border:2px solid var(--border); background:var(--surface2);
  transition:all 0.15s; font-size:0.9rem; font-weight:500;
}
.setup-set-item:hover { border-color:var(--gold); background:var(--surface); }
.setup-set-item.selected { border-color:var(--gold); background:rgba(240,192,64,0.1); }
.setup-set-item .set-item-name { flex:1; }
.setup-set-item .set-item-count {
  font-size:0.75rem; font-weight:700; color:var(--muted); letter-spacing:1px;
  background:var(--border); padding:2px 8px; border-radius:99px; white-space:nowrap;
}
.setup-set-item.selected .set-item-count { background:rgba(240,192,64,0.2); color:var(--gold); }
.setup-no-results { color:var(--muted); font-size:0.85rem; font-style:italic; padding:12px 0; text-align:center; }

/* ── Difficulty pills ── */
.diff-pills { display:flex; gap:5px; flex-shrink:0; align-items:center; }
.dp { font-size:0.7rem; font-weight:700; padding:3px 8px; border-radius:5px; letter-spacing:0.5px; }
.dp.easy { background:rgba(48,204,112,0.18); color:var(--green); }
.dp.med { background:rgba(240,192,64,0.18); color:var(--gold); }
.dp.hard { background:rgba(238,51,85,0.18); color:var(--red); }
.dp.all { background:rgba(64,128,255,0.18); color:var(--blue); }

.diff-chip { padding:7px 16px; border-radius:99px; border:2px solid var(--border); background:var(--surface2); cursor:pointer; font-size:0.88rem; font-weight:600; transition:all 0.18s; }
.diff-chip:hover { border-color:var(--gold); }
.diff-chip.on { border-color:var(--gold); background:rgba(240,192,64,0.12); color:var(--gold); }

/* ── Setup category items ── */
.setup-cat-item {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 14px; border-radius:10px; cursor:pointer;
  border:2px solid var(--border); background:var(--surface2);
  transition:all 0.15s; font-size:0.9rem; font-weight:500; flex-shrink:0;
}
.setup-cat-item .set-item-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.setup-cat-item .set-item-count {
  font-size:0.72rem; font-weight:700; color:var(--muted); letter-spacing:0.5px;
  white-space:nowrap;
}
@media (max-width:500px) {
  .setup-cat-item { flex-wrap:wrap; gap:6px; }
  .setup-cat-item .set-item-name { flex-basis:100%; }
  .setup-cat-item .diff-pills { margin-left:auto; }
}
.setup-cat-item:hover { border-color:var(--gold); background:var(--surface); }
.setup-cat-item.selected { border-color:var(--gold); background:rgba(240,192,64,0.1); }
.setup-cat-item.selected .set-item-count { background:rgba(240,192,64,0.2); color:var(--gold); }
.setup-cat-item.expanded { border-color:var(--blue); background:var(--surface); border-bottom-left-radius:0; border-bottom-right-radius:0; margin-bottom:0; }

.setup-diff-options {
  display:flex; flex-direction:column; gap:0; flex-shrink:0;
  border:2px solid var(--blue); border-top:none;
  border-radius:0 0 10px 10px; overflow:hidden; margin-bottom:2px;
}
.setup-diff-option {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px 10px 28px; cursor:pointer;
  background:var(--surface2); transition:all 0.15s;
  font-size:0.88rem; font-weight:500;
  border-top:1px solid var(--border);
}
.setup-diff-option:hover { background:var(--surface); }
.setup-diff-option.selected { background:rgba(240,192,64,0.1); }
.setup-diff-option .dp { font-size:0.75rem; padding:3px 10px; }
.setup-diff-option .set-item-count { color:var(--muted); font-size:0.82rem; }

/* ── Question Bank ── */
.bank-cat-list { display:flex; flex-direction:column; gap:6px; max-height:360px; overflow-y:auto; }
.bank-cat-row {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:12px 16px; border-radius:var(--r); cursor:pointer;
  border:1px solid var(--border); background:var(--surface);
  transition:all 0.15s; flex-shrink:0;
}
.bank-cat-row .set-item-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bank-cat-row:hover { border-color:var(--gold); background:var(--surface2); }
.bank-cat-row.selected { border-color:var(--gold); background:rgba(240,192,64,0.08); }
.bank-cat-row.expanded { border-color:var(--blue); background:var(--surface); border-bottom-left-radius:0; border-bottom-right-radius:0; margin-bottom:0; }
@media (max-width:500px) {
  .bank-cat-row { flex-wrap:wrap; gap:6px; }
  .bank-cat-row .set-item-name { flex-basis:100%; }
  .bank-cat-row .diff-pills { margin-left:auto; }
}

.bank-q-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.bank-q-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  padding:14px 16px; display:flex; flex-direction:column; gap:8px;
}
.bank-q-top { display:flex; align-items:center; gap:8px; }
.bank-q-top .remove-btn { margin-left:auto; }
.bank-src { font-size:0.6rem; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--muted); background:var(--surface2); padding:2px 6px; border-radius:4px; }
.bank-q-text { font-size:0.95rem; font-weight:600; line-height:1.3; }
.bank-q-choices { display:flex; flex-wrap:wrap; gap:6px; }
.bank-choice { font-size:0.8rem; padding:4px 10px; border-radius:6px; background:var(--surface2); color:var(--muted); }
.bank-choice.correct { background:rgba(48,204,112,0.15); color:var(--green); font-weight:700; }

.import-export { display:flex; gap:8px; flex-wrap:wrap; }

/* ── MODALS ── */
.modal-bg { display:none; position:fixed; inset:0; background:rgba(8,11,20,0.85); z-index:100; align-items:center; justify-content:center; padding:24px; backdrop-filter:blur(4px); }
.modal-bg.open { display:flex; }
.modal { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:32px; width:100%; max-width:460px; max-height:calc(100vh - 48px); overflow-y:auto; display:flex; flex-direction:column; gap:24px; animation:popIn 0.25s ease; }
/* Modal width tiers — applied alongside .modal so callers don't need
   inline `style="max-width:NNNpx"` per modal. Three sizes covers every
   current modal at sensible visual weight: compact auth (sm), standard
   forms (md), wide setup wizards (lg). */
/* Width tiers widened 2026-05-22 — the prior 400/520/560 caps left
   the host setup modals looking squeezed on laptop screens (a 560px
   modal on a 1440px MacBook viewport is ~40% of the screen, with
   wide black margins). Mobile is unaffected: .modal-bg's 24px
   padding caps the inner modal at viewport-48px regardless of
   max-width, so phone layouts render the same as before. */
.modal.modal-sm { max-width: 440px; }
.modal.modal-md { max-width: 640px; }
.modal.modal-lg { max-width: 720px; }
/* For modals whose body can overflow vertically (setup wizards with
   long category lists, onboarding wizard with smoke-test results),
   pin a 90vh cap + scroll. Combined with .modal-lg most of the time. */
.modal.modal-tall { max-height: 90vh; overflow-y: auto; }
.modal-title { font-family:'Bebas Neue',sans-serif; font-size:1.8rem; letter-spacing:2px; color:var(--gold); }
#nightSetupOptions { display:flex; flex-direction:column; gap:0; }
.night-setup-section { padding:20px 0; border-top:1px solid var(--border); }
.night-setup-section:first-child { border-top:none; padding-top:0; }
.modal-row { display:flex; gap:10px; }
.modal-row .btn { flex:1; }
/* Primary action in a modal row gets 2x the width of the dismissive
   Cancel button — both visually emphasizes the commit and prevents
   long primary labels (e.g. "Open Lobby") from wrapping to two lines
   when paired with a short "Cancel". Pre-fix the night-setup modal's
   "Open Lobby" rendered as "Open / Lobby" on narrow phones. */
.modal-row .btn-primary, .modal-row .btn-danger { flex:2; }
.modal-row .btn-primary, .modal-row .btn-danger,
.modal-row .btn-ghost { white-space:nowrap; }

/* Destructive action row — used for "End Night" / "End round early"
   buttons that were previously sharing a flex-row with primary
   advance actions ("Next Round" / "Next Question"). The UI audit
   found that proximity produced real misclicks under bar-shift
   pressure. The margin-top + border-top create a visible gap so
   the host's thumb can't muscle-memory from the primary action
   straight into a destructive one. confirm() dialogs are wired in
   host.js (endGame / endNightNow) as belt-and-suspenders. */
.host-danger-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.host-danger-row .btn-danger { opacity: 0.78; }
.host-danger-row .btn-danger:hover,
.host-danger-row .btn-danger:focus-visible { opacity: 1; }

/* ── Modal close button (X in top-right corner) ── */
.modal { position:relative; }
.modal-close-btn {
  position:absolute;
  top:12px;
  right:12px;
  width:40px;
  height:40px;
  border-radius:50%;
  background:transparent;
  border:1px solid var(--border);
  color:var(--text2);
  font-size:1.4rem;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background:var(--bg2);
  color:var(--text);
  border-color:var(--muted);
}

/* ── Router (logged-out landing page) ───────────────────────────────── */
.router-page {
  display:flex; flex-direction:column; align-items:center; gap:32px;
  width:100%; max-width:560px; margin:0 auto; padding:24px;
}
.router-logo { font-size:clamp(2.4rem, 5vw, 4rem); margin-top:8px; }
.router-tagline {
  font-size:0.95rem; color:var(--muted); letter-spacing:2px;
  text-transform:uppercase; text-align:center;
}
.router-section { width:100%; text-align:center; display:flex; flex-direction:column; gap:14px; align-items:center; }
.router-section-label {
  font-size:1.15rem; font-weight:700; color:var(--text);
}
.router-section-hint { font-size:0.82rem; color:var(--muted); }
.router-inline-link {
  background:transparent; border:0; padding:0;
  font:inherit; color:var(--gold); text-decoration:underline;
  cursor:pointer;
}
.router-inline-link:hover, .router-inline-link:focus-visible { color:var(--gold-bright,#ffd470); outline:none; }
.router-section-primary { padding:24px; background:rgba(240,192,64,0.06); border:1px solid rgba(240,192,64,0.25); border-radius:16px; }
.router-cta { width:100%; max-width:360px; padding:14px 24px; font-size:1.1rem; }
.router-divider {
  display:flex; align-items:center; gap:12px; width:100%; color:var(--muted);
  font-size:0.78rem; letter-spacing:3px; text-transform:uppercase;
}
.router-divider::before, .router-divider::after {
  content:''; flex:1; height:1px; background:var(--border);
}
.router-footer { display:flex; flex-direction:column; align-items:center; gap:14px; margin-top:8px; }
.router-footer-misc { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }

/* ── Keyboard-shortcut overlay ───────────────────────────────────────── */
.kbd-section { margin-top:18px; }
.kbd-section-title {
  font-size:0.72rem; font-weight:700; letter-spacing:2px;
  text-transform:uppercase; color:var(--muted); margin-bottom:8px;
}
.kbd-row {
  display:flex; align-items:center; gap:14px;
  padding:8px 0; border-bottom:1px solid var(--border);
}
.kbd-row:last-child { border-bottom:none; }
.kbd-row span { color:var(--muted); font-size:0.92rem; }
kbd {
  display:inline-block;
  padding:3px 9px;
  background:var(--surface2);
  border:1px solid var(--border);
  border-radius:6px;
  font-family:'DM Sans',sans-serif;
  font-size:0.78rem; font-weight:700;
  color:var(--text);
  box-shadow:0 1px 0 var(--border);
  min-width:24px; text-align:center;
}

/* ── Honeypot (hidden offscreen, not display:none) ── */
.hp-field {
  position:absolute !important;
  left:-10000px !important;
  top:auto !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
}

/* ── Feedback form (reuses .wl-field primitives) ── */
.feedback-form {
  display:flex;
  flex-direction:column;
  gap:14px;
}
.feedback-form .wl-field {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.feedback-form .wl-label {
  display:block;
  font-size:0.82rem;
  color:var(--text2);
  font-weight:500;
}
.feedback-form .wl-optional { color:var(--muted); font-weight:400; }
.feedback-form input,
.feedback-form textarea,
.feedback-form select {
  font-family:'DM Sans',sans-serif;
  font-size:16px;
  padding:12px 14px;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--text);
  outline:none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width:100%;
}
.feedback-form textarea { resize:vertical; min-height:110px; line-height:1.5; }
.feedback-form input:focus,
.feedback-form textarea:focus,
.feedback-form select:focus {
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(240, 192, 64, 0.18);
}
.feedback-form .wl-hint { font-size:0.72rem; color:var(--muted); text-align:right; }
.feedback-form .wl-submit { margin-top:6px; }
.feedback-form .wl-error { color:#e74c3c; font-size:0.85rem; text-align:center; min-height:18px; }
.waitlist-success { text-align:center; padding:12px 0; }
.wl-success-icon { font-size:3rem; margin-bottom:12px; }

.nav-back { background:none; border:none; color:var(--muted); cursor:pointer; font-family:'DM Sans',sans-serif; font-size:0.9rem; display:flex; align-items:center; gap:6px; padding:0; transition:color 0.2s; }
.nav-back:hover { color:var(--text); }

.status-dot { width:8px; height:8px; border-radius:50%; background:var(--green); display:inline-block; animation:blink 1.5s ease infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.confetti-wrap { position:fixed; inset:0; pointer-events:none; z-index:200; overflow:hidden; }
.confetto { position:absolute; top:-20px; border-radius:2px; animation:fall linear forwards; }
@keyframes fall { to{transform:translateY(110vh) rotate(720deg);opacity:0;} }

.spinner { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%; animation:spin 0.6s linear infinite; vertical-align:middle; margin-right:6px; }
@keyframes spin { to { transform:rotate(360deg); } }

.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(80px); background:var(--surface); color:var(--text); padding:12px 20px; border-radius:10px; font-size:0.9rem; z-index:300; opacity:0; transition: transform 0.3s, opacity 0.3s; pointer-events:none; border:1px solid var(--border); display:flex; align-items:center; gap:10px; max-width:90vw; }
.toast.show { transform:translateX(-50%) translateY(0); opacity:1; pointer-events:auto; }
/* Error toasts during a live game need to be impossible to miss — bigger
   font, thicker border, glowing shadow, and centered higher on screen so
   the bartender's eye is drawn to it rather than the bottom edge. */
.toast.toast-error {
  border-color:var(--red);
  background:rgba(238,51,85,0.20);
  color:#ffd0d8;
  border-width:2px;
  font-size:1.05rem;
  font-weight:600;
  padding:14px 24px;
  min-width:320px;
  bottom:auto;
  top:24px;
  box-shadow:0 8px 32px rgba(238,51,85,0.35);
}
.toast.toast-success { border-color:var(--green); background:rgba(48,204,112,0.12); color:var(--green); }
.toast.toast-info { border-color:var(--blue); background:rgba(64,128,255,0.12); color:var(--blue); }
/* Sticky errors (e.g. WS disconnected) — same loud styling but with a
   pulse animation so it stays visually active while it persists. */
.toast.toast-error.toast-sticky { animation: toastPulse 1.6s ease-in-out infinite; }
@keyframes toastPulse {
  0%, 100% { box-shadow:0 8px 32px rgba(238,51,85,0.35); }
  50%      { box-shadow:0 8px 48px rgba(238,51,85,0.65); }
}

/* ── Confirm modal ── */
.confirm-bg { display:none; position:fixed; inset:0; background:rgba(8,11,20,0.85); z-index:400; align-items:center; justify-content:center; padding:24px; backdrop-filter:blur(4px); }
.confirm-bg.open { display:flex; }
.confirm-box { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:28px; width:100%; max-width:380px; display:flex; flex-direction:column; gap:20px; animation:popIn 0.2s ease; text-align:center; }
.confirm-msg { font-size:1rem; line-height:1.5; }
.confirm-btns { display:flex; gap:10px; }
.confirm-btns .btn { flex:1; }

/* ── Ad upload (orientation picker) modal ── */
.ad-upload-box { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:24px; width:100%; max-width:520px; display:flex; flex-direction:column; gap:14px; animation:popIn 0.2s ease; }
.ad-upload-title { font-size:1.15rem; font-weight:700; text-align:center; }
.ad-upload-filename { font-size:0.85rem; color:var(--muted); text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:'JetBrains Mono', monospace; }
.ad-upload-reco { font-size:0.8rem; color:var(--gold); background:rgba(240,192,64,0.1); border:1px solid rgba(240,192,64,0.25); border-radius:8px; padding:8px 12px; text-align:center; }
.ad-orientation-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ad-orient-card { position:relative; cursor:pointer; padding:14px 10px; border:2px solid var(--border); border-radius:12px; background:rgba(255,255,255,0.02); display:flex; flex-direction:column; align-items:center; gap:8px; color:var(--muted); transition:border-color .15s, color .15s, background .15s; }
.ad-orient-card:hover { border-color:var(--gold); color:var(--gold); }
.ad-orient-card input { position:absolute; opacity:0; pointer-events:none; }
.ad-orient-card:has(input:checked) { border-color:var(--gold); color:var(--gold); background:rgba(240,192,64,0.08); }
.ad-orient-visual { width:88px; height:88px; display:flex; align-items:center; justify-content:center; }
.ad-orient-visual svg { width:100%; height:100%; }
.ad-orient-label { font-weight:700; font-size:0.95rem; color:var(--text); }
.ad-orient-card:has(input:checked) .ad-orient-label { color:var(--gold); }
.ad-orient-sub { font-size:0.72rem; line-height:1.3; text-align:center; }
.ad-upload-hint { font-size:0.78rem; color:var(--muted); line-height:1.4; text-align:center; }

/* Ad card orientation badge in the ads grid */
.ad-card-orient-row { display:flex; }
.ad-card-orient-badge { display:inline-block; font-size:0.65rem; font-weight:700; letter-spacing:0.5px; padding:2px 7px; border-radius:8px; text-transform:uppercase; }
.ad-card-orient-badge.landscape { background:rgba(80,170,230,0.18); color:#7ec8f5; }
.ad-card-orient-badge.portrait { background:rgba(159,122,234,0.22); color:#b39dff; }
.ad-card-orient-badge.legacy { background:rgba(138,143,156,0.2); color:var(--muted); }

/* ── Loading overlay on buttons ── */
.btn.loading { position:relative; color:transparent !important; pointer-events:none; }
.btn.loading::after { content:''; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.btn.loading::before { content:''; width:18px; height:18px; border:2px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%; animation:spin 0.6s linear infinite; position:absolute; left:50%; top:50%; margin:-9px 0 0 -9px; }

/* ── Correct answer hint for host ── */
.correct-hint { font-size:0.78rem; color:var(--green); font-weight:600; margin-left:auto; letter-spacing:0.5px; display:flex; align-items:center; gap:4px; }

/* ── Connection status ── */
.connection-status { display:flex; align-items:center; gap:6px; font-size:0.78rem; color:var(--muted); }
.connection-dot { width:6px; height:6px; border-radius:50%; background:var(--green); flex-shrink:0; }
.connection-dot.disconnected { background:var(--red); animation:pulse 1s ease infinite; }
.connection-dot.reconnecting { background:var(--amber); animation:pulse 0.5s ease infinite; }

/* ── Night timer (fixed position, persistent) ── */
.night-timer-fixed { position:fixed; top:12px; right:12px; z-index:50; }

/* ── Radio toggle for queue/voting ── */
.radio-toggle { display:flex; gap:0; border:2px solid var(--border); border-radius:10px; overflow:hidden; }
.radio-toggle-opt { padding:10px 18px; font-size:0.88rem; font-weight:600; cursor:pointer; transition:all 0.18s; background:var(--surface2); text-align:center; flex:1; }
.radio-toggle-opt:not(:last-child) { border-right:1px solid var(--border); }
.radio-toggle-opt.active { background:rgba(240,192,64,0.12); color:var(--gold); border-color:var(--gold); }
.radio-toggle-opt input { display:none; }

/* ── Search result count ── */
.search-count { font-size:0.78rem; color:var(--muted); text-align:right; padding:2px 0; }

/* ── Settings panel ── */
.settings-panel { display:flex; flex-direction:column; gap:12px; }
.settings-item { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); gap:16px; }
.settings-item-label { font-size:0.9rem; font-weight:500; }
.settings-item-desc { font-size:0.78rem; color:var(--muted); margin-top:2px; }
/* On narrow viewports (phones), stack the label above the control so
   chip rows don't wrap into a vertical column on the right. */
@media (max-width: 560px) {
  .settings-item { flex-direction:column; align-items:flex-start; gap:10px; }
  .settings-item > .timer-chips { width:100%; justify-content:flex-start; }
  .settings-item > .ad-toggle { align-self:flex-end; }
}

/* ── Auto-advance progress ── */
.auto-advance-bar { height:4px; background:var(--border); border-radius:2px; overflow:hidden; margin-top:12px; }
.auto-advance-fill { height:100%; background:linear-gradient(90deg,var(--gold),var(--amber)); border-radius:2px; transition:width 1s linear; }

.flex-row { display:flex; align-items:center; gap:12px; }
.flex-col { display:flex; flex-direction:column; gap:10px; }
.mt { margin-top:8px; }

/* ── Night Timer ── */
.night-timer {
  display:flex; align-items:center; gap:6px;
  background:var(--surface); border:1px solid var(--border); border-radius:99px;
  padding:5px 12px; font-size:0.85rem; font-weight:600;
}
.night-timer-sm { padding:3px 10px; font-size:0.78rem; }
.night-timer-icon { font-size:0.9rem; }
.night-timer-text { font-family:'Bebas Neue',sans-serif; letter-spacing:1px; font-size:1.1rem; }
.night-timer-sm .night-timer-text { font-size:0.95rem; }
.night-timer-btn {
  background:none; border:none; cursor:pointer; font-size:0.85rem;
  padding:6px 10px; min-height:36px; min-width:36px; color:var(--muted); transition:color 0.2s, background 0.15s;
  border-radius:6px;
}
.night-timer-btn:hover, .night-timer-btn:focus-visible {
  background:rgba(255,255,255,0.06);
}
.night-timer-btn:hover { color:var(--text); }
.night-timer.warning { border-color:var(--amber); color:var(--amber); }
.night-timer.warning .night-timer-text { color:var(--amber); }
.night-timer.expired { border-color:var(--red); color:var(--red); animation:pulse 1s ease infinite alternate; }
.night-timer.expired .night-timer-text { color:var(--red); }
.night-timer.paused { border-color:var(--blue); }
.night-timer.paused .night-timer-text { color:var(--blue); }

.night-expired-banner {
  background:rgba(238,51,85,0.1); border:1px solid rgba(238,51,85,0.3);
  border-radius:var(--r); padding:12px 18px; color:var(--red);
  font-size:0.88rem; font-weight:600; text-align:center;
  display:flex; align-items:center; justify-content:center; gap:8px;
}

/* ── Open Play Status ── */
#openPlayStatus { flex-direction:row; flex-wrap:wrap; gap:24px; }
.timer-chip-sm { padding:4px 10px !important; font-size:0.75rem !important; }

/* ── Custom timer input ── */
.custom-timer-wrap {
  display:flex; align-items:center; gap:2px;
  font-size:0.85rem; font-weight:600; color:var(--muted);
}
.custom-timer-input {
  width:60px; background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; color:var(--text); padding:6px 8px; font-size:16px;
  font-family:'DM Sans',sans-serif; text-align:center; outline:none;
  transition:border-color 0.2s;
}
.custom-timer-input:focus { border-color:var(--gold); }
.custom-timer-input.active { border-color:var(--gold); background:rgba(240,192,64,0.08); color:var(--gold); }

/* ── Auth row on home ── */
.home-auth-row { display:flex; align-items:center; gap:12px; justify-content:center; padding:8px 0; }
.venue-badge { font-size:0.85rem; color:var(--gold); font-weight:600; }
.btn-link { background:none; border:none; color:var(--blue); cursor:pointer; font-family:'DM Sans',sans-serif; font-size:0.85rem; text-decoration:underline; }
.auth-error { color:var(--red); font-size:0.82rem; padding:4px 0; }
/* Visual marker on the offending input alongside the .auth-error text.
   Without this, an error message like "Password too common" colored the
   message red but the password input itself looked normal — the user
   had to read the message to know which field to fix. Now the input
   border + a soft glow draw the eye to the right control, and the
   class clears automatically on the next input event so the user gets
   immediate feedback that they're correcting it. */
input.input-error,
textarea.input-error,
select.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}
input.input-error:focus,
textarea.input-error:focus,
select.input-error:focus {
  /* Keep the red border on focus so the marker doesn't get overridden
     by the default gold focus ring — fix the issue, then re-focus. */
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}

/* ── Ad upload zone ── */
.ads-upload-zone {
  border:2px dashed var(--border); border-radius:var(--r); padding:32px 20px;
  text-align:center; cursor:pointer; transition:all 0.2s;
  background:var(--surface);
}
.ads-upload-zone:hover, .ads-upload-zone.dragover { border-color:var(--gold); background:rgba(240,192,64,0.04); }
.upload-icon { font-size:2rem; margin-bottom:8px; }
.upload-text { font-size:0.95rem; font-weight:600; color:var(--text); }
.upload-hint { font-size:0.78rem; color:var(--muted); margin-top:4px; }

/* ── Ad grid ── */
.ads-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:16px; }
.ad-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  overflow:hidden; display:flex; flex-direction:column;
}
.ad-card-thumb { width:100%; aspect-ratio:16/9; object-fit:cover; background:var(--surface2); }
.ad-card-info { padding:10px 12px; display:flex; flex-direction:column; gap:6px; }
.ad-card-name { font-size:0.82rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ad-card-controls { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.ad-card-controls label { font-size:0.75rem; color:var(--muted); display:flex; align-items:center; gap:4px; }
.ad-card-controls input[type=number] {
  width:50px; background:var(--surface2); border:1px solid var(--border);
  border-radius:6px; color:var(--text); padding:2px 6px; font-size:16px; text-align:center;
}
.ad-toggle { position:relative; width:36px; height:20px; cursor:pointer; }
.ad-toggle input { opacity:0; width:0; height:0; }
.ad-toggle .slider {
  position:absolute; inset:0; background:var(--border); border-radius:20px; transition:0.2s;
}
.ad-toggle .slider::before {
  content:''; position:absolute; width:16px; height:16px; border-radius:50%;
  background:var(--muted); left:2px; bottom:2px; transition:0.2s;
}
.ad-toggle input:checked + .slider { background:var(--green); }
.ad-toggle input:checked + .slider::before { transform:translateX(16px); background:#fff; }
.ad-delete { background:none; border:none; color:var(--red); cursor:pointer; font-size:1rem; padding:2px 6px; border-radius:4px; }
.ad-delete:hover { background:rgba(238,51,85,0.1); }

/* ── Queue Builder ── */
.queue-list { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.queue-item {
  display:flex; align-items:center; gap:10px; background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; padding:10px 14px; font-size:0.88rem;
}
.queue-item-num { font-weight:700; color:var(--gold); min-width:22px; }
.queue-item-name { flex:1; font-weight:600; }
.queue-item-meta { color:var(--muted); font-size:0.78rem; white-space:nowrap; }
.queue-item-remove {
  background:none; border:none; color:var(--red); cursor:pointer; font-size:0.9rem;
  padding:2px 6px; border-radius:4px; opacity:0.7;
}
.queue-item-remove:hover { opacity:1; background:rgba(238,51,85,0.1); }
.queue-item-dup {
  background:none; border:none; color:var(--muted); cursor:pointer; font-size:1rem;
  padding:2px 6px; border-radius:4px; opacity:0.7;
}
.queue-item-dup:hover { opacity:1; color:var(--text); background:rgba(255,255,255,0.06); }
.queue-add-panel {
  background:var(--surface2); border:1px solid var(--border); border-radius:var(--r);
  padding:20px; display:flex; flex-direction:column; gap:16px;
}
.queue-empty { color:var(--muted); font-size:0.85rem; text-align:center; padding:12px; }

/* ── Lobby Queue Info ── */
.lobby-queue-list { display:flex; flex-direction:column; gap:4px; margin-bottom:8px; }
.lobby-queue-item {
  display:flex; align-items:center; gap:8px; font-size:0.82rem; padding:4px 0;
}
.lobby-queue-item.active { color:var(--gold); font-weight:700; }
.lobby-queue-item.done { color:var(--muted); text-decoration:line-through; opacity:0.6; }
.lobby-queue-item-num { min-width:18px; font-weight:700; }

/* ── Category Voting ── */
.vote-toggle-row {
  display:flex; align-items:flex-start; gap:12px; cursor:pointer;
  padding:14px 16px; background:var(--surface2); border:1px solid var(--border);
  border-radius:8px;
}
.vote-toggle-row input[type="checkbox"] {
  width:18px; height:18px; margin-top:2px; accent-color:var(--gold); cursor:pointer;
}
.vote-toggle-label { flex:1; }
.vote-results-list { display:flex; flex-direction:column; gap:6px; }
.vote-result-row {
  display:flex; align-items:center; gap:10px; padding:8px 12px;
  background:var(--surface2); border-radius:8px; font-size:0.88rem;
}
.vote-result-name { flex:1; font-weight:600; }
.vote-result-bar-wrap { flex:2; height:20px; background:var(--bg); border-radius:10px; overflow:hidden; }
.vote-result-bar {
  height:100%; background:linear-gradient(135deg,var(--gold),var(--amber));
  border-radius:10px; transition:width 0.3s ease; min-width:0;
}
.vote-result-count { min-width:40px; text-align:right; font-weight:700; color:var(--gold); font-size:0.85rem; }

/* ── Break Countdown ── */
.break-title {
  font-family:'Bebas Neue',sans-serif; font-size:2.8rem; letter-spacing:4px;
  background:linear-gradient(135deg,var(--gold),var(--amber));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
  margin-top:16px;
}
.break-subtitle { color:var(--muted); font-size:1.1rem; margin:8px 0 24px; }
.break-countdown {
  font-family:'Bebas Neue',sans-serif; font-size:5rem; color:var(--text);
  letter-spacing:4px; margin-bottom:32px;
}

/* ── Utility classes ── */
.hidden { display:none !important; }
.text-muted { color:var(--muted); }
.text-center { text-align:center; }
.text-sm { font-size:0.85rem; }
.text-xs { font-size:0.75rem; }
.mt-1 { margin-top:8px; }
.mt-2 { margin-top:12px; }
.mt-3 { margin-top:16px; }
.mb-1 { margin-bottom:8px; }
.w-auto { width:auto; }
.gap-1 { gap:8px; }
.gap-2 { gap:12px; }

/* ── Desktop: left-align option rows inside setup modals instead of stretching */
@media (min-width:769px) {
  .night-setup-section .timer-chips,
  .queue-add-panel .timer-chips { justify-content:flex-start; }
  .night-setup-section .radio-toggle { width:fit-content; }
  .night-setup-section .radio-toggle .radio-toggle-opt { flex:0 0 auto; }
}

/* ── Tablet + phone responsiveness ──
   Three breakpoints:
     <= 520px : phone — single-column home, stacked lobby
     521–1023 : tablet (iPad portrait + landscape) — 2-col home,
                side-by-side lobby (when each pane's min-width fits)
     >= 1024  : small-laptop+ — natural auto-fit grid, wider venue panel
   The <=768 block below keeps the touch-target + font-scale niceties
   that apply to BOTH phone and small-tablet, but the layout-forcing
   single-column rules moved to <=520 so iPad portrait gets a real
   tablet treatment instead of being lumped in with phones. */

@media (max-width: 520px) {
  .home-cards { grid-template-columns: 1fr; gap: 12px; }
  #lobby, #openPlayStatus { flex-direction: column; }
  .lobby-left { max-height: none; }
}

@media (min-width: 521px) and (max-width: 1023px) {
  /* iPad portrait (768) + landscape (1024). 2-col home cards centered
     in a tighter container — 5 cards arrange as 2+2+1, easier to scan
     than 3+2 with awkward orphan widths. The natural .home-cards
     auto-fit rule would still pick 3 cols at 1023px (max-width 800
     fits 3×220+gaps), but 2 reads better with the existing 5-card
     content. */
  .home-cards { grid-template-columns: repeat(2, 1fr); max-width: 600px; gap: 14px; }
}

/* (Tablet+ #venuePanel max-width override moved further down — needs
   to come AFTER the unconditional #venuePanel rule at line 889 to win
   the cascade. See the venue-panel section below.) */

/* Touch-target bumps + font scale-down for everything tablet-and-down.
   These apply at both phone (<=520) and small-tablet (521–768) widths
   without forcing the single-column layout. */
@media (max-width:768px) {
  .screen { padding:16px; gap:16px; }
  .home-card { padding:18px; }
  .lobby-left, .lobby-right { min-width:0; width:100%; }
  .game-code-display { padding:20px; }
  .game-code { font-size:3.5rem; letter-spacing:10px; }
  /* Narrow phones: bumped 120→140 so 11-char names like "EmceePlayer"
     don't truncate to "Emc...". Still fits 2 cards per row on iPhone SE. */
  .reveal-grid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px; }
  .reveal-card { padding:8px 10px; gap:6px; font-size:0.82rem; }
  .choices-host { grid-template-columns:1fr; }
  .q-text { font-size:clamp(1.1rem,4vw,1.8rem); }
  .modal { padding:24px; margin:12px; }
  .results-title { font-size:2.8rem; }
  .lb-row { padding:12px 14px; gap:10px; }
  .lb-score { font-size:1.6rem; }
  #roundEnd, #nightEnd { gap:20px; }
  .host-controls { flex-wrap:wrap; }
  .host-controls .btn { min-height:44px; min-width:44px; }
  .btn { min-height:44px; }
  .timer-chip, .diff-chip { min-height:44px; display:flex; align-items:center; justify-content:center; }
}

/* ── Accessibility ── */
*:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
}
.kbd-hint { display:inline-block; background:var(--surface2); border:1px solid var(--border); border-radius:4px; padding:1px 6px; font-size:0.72rem; font-weight:700; color:var(--muted); font-family:monospace; }

/* ═══ Emcee Round ═══ */
.emcee-question-list { display:flex; flex-direction:column; gap:10px; max-height:320px; overflow-y:auto; }
.emcee-q-row { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; background:var(--surface2); border-radius:8px; position:relative; }
.emcee-q-row .emcee-q-num { min-width:24px; height:24px; display:flex; align-items:center; justify-content:center; background:var(--border); border-radius:50%; font-size:0.75rem; font-weight:700; color:var(--muted); flex-shrink:0; margin-top:6px; }
/* Bumped gap 4→8 so the answer input visually separates from the
   question textarea above it. Pre-fix the dense stack made each row
   read as one blurred block. */
.emcee-q-row .emcee-q-fields { display:flex; flex-direction:column; gap:8px; flex:1; min-width:0; }
.emcee-q-row input, .emcee-q-row textarea { font-size:16px; padding:8px 10px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--text); }
.emcee-q-row textarea { resize:vertical; min-height:36px; }
.emcee-q-row .emcee-q-remove { position:absolute; top:4px; right:4px; background:none; border:none; color:var(--muted); cursor:pointer; font-size:1rem; line-height:1; padding:6px 10px; min-width:32px; min-height:32px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; }
.emcee-q-row .emcee-q-remove:hover { color:var(--danger); background:rgba(255,68,102,0.08); }
.emcee-q-row .emcee-q-photo-btn { font-size:0.75rem; padding:8px 12px; background:var(--bg); border:1px solid var(--border); border-radius:6px; cursor:pointer; color:var(--muted); min-height:32px; display:inline-flex; align-items:center; }
.emcee-q-row .emcee-q-photo-btn:hover { background:var(--surface2); }
.emcee-q-row .emcee-q-photo-thumb { height:32px; border-radius:4px; }

/* Player-count pill in the Ready-screen topbar. Matches the visual
   register of the other topbar chips (badge, night-timer). */
.emcee-ready-players {
  margin-left:auto; padding:4px 12px; border-radius:99px;
  background:rgba(255,255,255,0.06); color:var(--text);
  font-size:0.82rem; font-weight:600; white-space:nowrap;
}
/* Upcoming-queue preview block. Compact rows so the host can see
   the next few questions at a glance without scrolling. */
.emcee-ready-queue-list { display:flex; flex-direction:column; gap:6px; max-height:160px; overflow-y:auto; }
.emcee-ready-queue-row {
  display:flex; gap:10px; align-items:center;
  padding:6px 10px; border-radius:6px;
  background:var(--surface2); border:1px solid var(--border);
  font-size:0.88rem;
}
.emcee-ready-queue-num {
  min-width:22px; height:22px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--border); border-radius:50%;
  font-size:0.7rem; font-weight:700; color:var(--muted);
}
.emcee-ready-queue-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text); }
.emcee-ready-queue-empty { padding:6px 10px; color:var(--muted); font-size:0.85rem; font-style:italic; text-align:center; }
.emcee-textarea { width:100%; font-size:1rem; padding:12px; border:1px solid var(--border); border-radius:8px; background:var(--surface2); color:var(--text); resize:vertical; min-height:80px; font-family:inherit; }
.emcee-answer-input { width:100%; font-size:16px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface2); color:var(--text); margin-top:8px; }
.emcee-photo-row { display:flex; align-items:center; gap:8px; margin-top:8px; }

.emcee-correct-answer { font-size:1.2rem; font-weight:700; color:var(--gold); padding:8px 0; }
.emcee-judge-photo { max-width:200px; max-height:150px; border-radius:8px; margin-top:8px; }
.emcee-judge-list { display:flex; flex-direction:column; gap:6px; }
.emcee-judge-card { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px; border:2px solid var(--border); cursor:pointer; transition:border-color 0.15s, background 0.15s; }
.emcee-judge-card.approved { border-color:var(--success, #22c55e); background:rgba(34,197,94,0.08); }
.emcee-judge-card.rejected { border-color:var(--danger); background:rgba(239,68,68,0.08); }
.emcee-judge-card.uncertain { border-color:var(--gold); background:rgba(245,158,11,0.08); }
.emcee-judge-card .judge-icon { font-size:1.2rem; width:28px; text-align:center; }
.emcee-judge-card .judge-name { font-weight:600; min-width:80px; }
.emcee-judge-card .judge-answer { flex:1; font-size:0.9rem; color:var(--text); }
.emcee-judge-card .judge-no-answer { flex:1; font-size:0.9rem; color:var(--muted); font-style:italic; }
/* No-answer rows: muted, not clickable. Pre-fix these players were
   silently hidden from the list; the host had no visibility into who
   missed a question. Now they appear at the bottom of the sort with
   reduced opacity so they don't compete with answers needing review. */
.emcee-judge-card.no-answer { opacity:0.55; cursor:default; background:transparent; }
.emcee-judge-card.no-answer:hover { background:transparent; }
/* Keyboard-focus ring for ↑/↓ navigation. Sharper than the hover
   state so the host can see at a glance which row Space will toggle.
   Adds an inner outline rather than thickening the border so the
   row doesn't reflow when focus moves. */
.emcee-judge-card.kb-focused { box-shadow:0 0 0 2px var(--gold); }
/* Diff-cue line under uncertain answers: "vs <correct>" so the host
   can eyeball the delta without re-reading the header card. */
.emcee-judge-card .judge-compare { display:block; font-size:0.78rem; color:var(--muted); margin-top:2px; }
.emcee-judge-card .judge-compare em { font-style:normal; color:var(--gold); }
/* Question text on judging — same family as the correct-answer block
   but in default text color so the host's eye doesn't read the question
   as "the answer". */
.emcee-judge-question { font-size:1rem; color:var(--text); padding:6px 0 4px; line-height:1.4; }
/* Auto-advance countdown pill in the topbar. Quiet by default, gold
   under 30s, red under 10s — same urgency gradient as the per-question
   timer urgency colors. */
.emcee-judge-countdown {
  margin-left:auto; padding:4px 10px; border-radius:99px;
  background:rgba(255,255,255,0.06); color:var(--muted);
  font-size:0.78rem; font-weight:600; letter-spacing:0.5px;
  white-space:nowrap; transition:background 0.3s, color 0.3s;
}
.emcee-judge-countdown.urgent { background:rgba(240,192,64,0.18); color:var(--gold); }
.emcee-judge-countdown.critical { background:rgba(238,51,85,0.22); color:#ff8aa0; animation:emceeCountdownPulse 1s ease-in-out infinite; }
@keyframes emceeCountdownPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
/* Floating undo pill — appears for EMCEE_UNDO_WINDOW_MS after the
   host confirms a judgment. Positioned bottom-center so it's easy
   to spot but doesn't block the reveal scoreboard above. */
.emcee-undo-pill {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  z-index:120;
  background:rgba(240,192,64,0.18); color:var(--gold);
  border:1px solid rgba(240,192,64,0.55); border-radius:99px;
  padding:10px 20px; font-size:0.92rem; font-weight:600;
  cursor:pointer; box-shadow:0 4px 16px rgba(0,0,0,0.4);
  transition:background 0.2s, transform 0.2s;
}
.emcee-undo-pill:hover { background:rgba(240,192,64,0.28); transform:translateX(-50%) translateY(-2px); }
.emcee-undo-pill:active { transform:translateX(-50%) translateY(0); }
.badge-emcee { display:inline-block; background:var(--gold); color:var(--bg); font-size:0.65rem; font-weight:700; padding:2px 6px; border-radius:4px; text-transform:uppercase; letter-spacing:0.5px; }

/* ═══ Emcee PPTX Import Wizard ═══ */
.emcee-pptx-drop {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:8px; padding:32px 16px; cursor:pointer;
  background:var(--surface2); border:2px dashed var(--border); border-radius:12px;
  transition:border-color 0.15s, background 0.15s;
}
.emcee-pptx-drop:hover { border-color:var(--gold); background:rgba(240,192,64,0.06); }
.emcee-pptx-drop-icon { font-size:2.4rem; opacity:0.7; }
.emcee-pptx-drop-text { text-align:center; }
.emcee-pptx-preview-list { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow-y:auto; padding-right:4px; }
.emcee-pptx-preview-row {
  display:flex; gap:10px; align-items:flex-start;
  padding:10px; background:var(--surface2); border:1px solid var(--border); border-radius:8px;
  transition:border-color 0.15s, background 0.15s;
}
.emcee-pptx-preview-row.selected { border-color:var(--gold); background:rgba(240,192,64,0.05); }
.emcee-pptx-preview-check { display:flex; align-items:center; padding-top:4px; }
.emcee-pptx-preview-num {
  min-width:28px; height:28px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--border); color:var(--muted);
  border-radius:50%; font-weight:700; font-size:0.78rem;
}
.emcee-pptx-preview-thumb {
  width:64px; height:48px; flex-shrink:0;
  object-fit:cover; border-radius:6px;
}
.emcee-pptx-preview-fields { display:flex; flex-direction:column; gap:6px; flex:1; min-width:0; }
.emcee-pptx-preview-fields textarea, .emcee-pptx-preview-fields input {
  font-size:14px; padding:6px 8px;
  border:1px solid var(--border); border-radius:6px;
  background:var(--bg); color:var(--text);
  font-family:inherit;
}
.emcee-pptx-preview-fields textarea { resize:vertical; min-height:32px; }
@keyframes spin { from { transform:rotate(0); } to { transform:rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   Venue Panel (Plan, Logo, Regulars, Import, Org)
   ══════════════════════════════════════════════════════ */
#venuePanel { max-width: 720px; margin: 0 auto; padding-bottom: 60px; }
/* iPad landscape + small laptop: bump venue panel to 920 so the page
   doesn't feel like a phone layout in the middle of a wide canvas.
   Lives next to the base rule so source-order cascade picks the
   media-qualified one when the viewport matches. */
@media (min-width: 1024px) {
  #venuePanel { max-width: 920px; }
}
.venue-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 16px;
}
/* Plan-gated section dimming. Pre-fix this only set opacity, so a
   Starter operator could still tab into form inputs / file pickers
   underneath the dimmed layer (the underlying control was reachable
   and the click then either no-op'd or fell through to a server-side
   403). user-select disabled to discourage even copy-paste of plan-
   gated content. The section header (.venue-section-header) stays
   interactive so the upgrade-CTA link inside it (e.g. plan-req-badge
   "Pro plan ↗") still works. */
.venue-section.locked { opacity: 0.55; }
.venue-section.locked > *:not(.venue-section-header) { pointer-events: none; user-select: none; }
.venue-section.locked .venue-section-header { pointer-events: auto; }
/* Tab system: switcher toggles this class on sections that aren't in
 * the active tab. !important so it always beats the plan-gate inline
 * style="display:none;" (which we leave alone — plan gates still work
 * inside the active tab the same way they always did). */
.venue-section.venue-tab-hidden { display: none !important; }

/* Tab navigation row above the sections. Horizontal pill bar, scrolls
 * sideways on narrow phones rather than wrapping into multiple lines
 * (wrapping made the bar feel heavy and ate vertical space). */
.venue-tab-nav {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow-x: auto;
  scrollbar-width: thin;
}
.venue-tab-btn {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: calc(var(--r) - 4px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.venue-tab-btn:hover { color: var(--text); background: var(--surface2); }
.venue-tab-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.venue-tab-btn.active {
  background: var(--surface2);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* "How this works" expander on each section. Native <details> so there
 * is no extra JS surface; the section explainer lives in the body and
 * stays collapsed until the operator clicks. */
.inline-howto {
  margin-top: 6px;
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: calc(var(--r) - 6px);
  font-size: 0.82rem;
  color: var(--muted);
}
.inline-howto > summary {
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  list-style: none;
  color: var(--muted);
}
.inline-howto > summary::-webkit-details-marker { display: none; }
.inline-howto > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.12s ease;
}
.inline-howto[open] > summary::before { transform: rotate(90deg); }
.inline-howto[open] { background: var(--surface2); }
.inline-howto > .inline-howto-body {
  padding: 0 12px 10px;
  line-height: 1.45;
}
.inline-howto > .inline-howto-body > p { margin: 0 0 8px; }
.inline-howto > .inline-howto-body > p:last-child { margin-bottom: 0; }
.venue-section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.venue-section-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.venue-section-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.plan-badge.starter { background: var(--surface2); color: var(--muted); }
.plan-badge.pro {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: var(--bg);
  border-color: transparent;
}
.plan-badge.premium {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  border-color: transparent;
}
.plan-req-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(240,192,64,0.1);
  color: var(--gold);
  border: 1px solid rgba(240,192,64,0.3);
  text-decoration: none;
}
/* When the badge is rendered as a link (locked plan-gated section), it
   doubles as the upgrade CTA — give it a subtle hover state so the
   click affordance is obvious. Unlocked badges keep the default look. */
a.plan-req-badge { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
a.plan-req-badge:hover { background: rgba(240,192,64,0.18); border-color: rgba(240,192,64,0.55); }
/* Counterpart for sections that are AVAILABLE on every plan. Same pill
 * shape as .plan-req-badge but green instead of gold, so the operator
 * can see at a glance "this works, no upgrade needed." Pre-unification
 * the Referral section was overloading .plan-req-badge with inline
 * style="" overrides, which made the class semantics ambiguous. */
.plan-available-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(48,204,112,0.1);
  color: var(--green);
  border: 1px solid rgba(48,204,112,0.3);
}
.venue-limit-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
/* Logo */
.venue-logo-row {
  display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap;
}
.venue-logo-preview {
  width: 140px; height: 80px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.venue-logo-preview img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.venue-logo-empty { font-size: 0.75rem; color: var(--muted); }

/* Regulars list */
.venue-regulars-stats {
  display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.venue-regulars-stats .stat {
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--muted);
}
.venue-regulars-stats .stat strong { color: var(--gold); font-size: 1rem; display: block; }
.venue-regulars-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 300px; overflow-y: auto;
}
.regular-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 0.85rem;
}
.regular-row .rank { color: var(--muted); font-weight: 700; min-width: 24px; }
.regular-row .name { flex: 1; font-weight: 600; color: var(--text); }
.regular-row .visits { color: var(--gold); font-size: 0.78rem; }
.regular-row .last-seen { color: var(--muted); font-size: 0.72rem; }

/* Import */
#importBankName, #importFile {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
}
#importFile { padding: 6px 8px; }

/* Organization */
.venue-org-name { font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.venue-org-list {
  display: flex; flex-direction: column; gap: 4px; margin-top: 6px;
}
.venue-org-list .org-venue {
  padding: 6px 12px; background: var(--surface2); border-radius: 6px;
  font-size: 0.82rem; display: flex; justify-content: space-between; gap: 10px;
}
.venue-org-list .org-venue .mine { color: var(--gold); font-weight: 700; }
.venue-org-lb {
  margin-top: 10px; display: flex; flex-direction: column; gap: 4px;
  max-height: 300px; overflow-y: auto;
}
.venue-org-lb .lb-row {
  display: flex; gap: 10px; padding: 6px 12px;
  background: var(--surface2); border-radius: 6px;
  font-size: 0.8rem;
}
.venue-org-lb .lb-row .rank { color: var(--muted); font-weight: 700; min-width: 24px; }
.venue-org-lb .lb-row .name { flex: 1; font-weight: 600; }
.venue-org-lb .lb-row .venue { color: var(--muted); font-size: 0.72rem; }
.venue-org-lb .lb-row .score { color: var(--gold); font-weight: 700; }
/* "Merged across venues" badge — shown next to a player's name on
   the cross-venue leaderboard when their row aggregates data from
   2+ venues via their registered player_id. Tells the operator at a
   glance "this is the same person at multiple bars," not two unrelated
   patrons with the same name. */
.venue-org-lb .lb-row .org-lb-merged {
  margin-left: 6px; font-size: 0.85em; cursor: help;
  opacity: 0.85;
}
/* Role badges in the org venue list (Batch 5). Admin is gold to
   match the Premium plan badge; Member is muted. */
.org-role-badge {
  display: inline-block; padding: 1px 8px;
  border-radius: 99px; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.04em; cursor: help;
}
.org-role-badge.admin { background: rgba(240,192,64,0.18); color: var(--gold); }
.org-role-badge.member { background: rgba(255,255,255,0.06); color: var(--muted); }

/* Plan-locked UI elements (buttons that require a higher plan) */
.plan-locked {
  opacity: 0.72;
  position: relative;
}
.plan-locked:hover {
  opacity: 0.9;
}
.plan-lock-badge {
  /* Inline variant of .plan-req-badge — same gold pill, sized to live
   * inside a button label rather than as a standalone section badge.
   * Pre-unification this used a purple gradient that didn't match
   * any other plan-gating UI in the app. */
  display: inline-block;
  margin-left: 6px;
  background: rgba(240,192,64,0.1);
  color: var(--gold);
  border: 1px solid rgba(240,192,64,0.3);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 100px;
  vertical-align: middle;
}

/* Referral program */
.referral-link-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
  align-items: stretch;
}
.referral-link-row input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 16px;
  cursor: pointer;
}
.referral-link-row input:focus {
  outline: none;
  border-color: var(--gold);
}
.referral-link-row button {
  flex-shrink: 0;
}
.referral-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.referral-stat {
  background: var(--surface2);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.referral-stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--gold);
  letter-spacing: 1px;
}
.referral-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.referral-recent {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.referral-recent:empty { display: none; }
.referral-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 0.82rem;
}
.referral-row .ref-name { flex: 1; font-weight: 600; color: var(--text); }
.referral-row .ref-status {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.referral-row .ref-status.pending { background: rgba(107,122,148,0.2); color: var(--muted); }
.referral-row .ref-status.qualified { background: rgba(48,204,112,0.15); color: var(--green); }
.referral-row .ref-status.rewarded { background: rgba(240,192,64,0.15); color: var(--gold); }

/* Referral banner at register modal */
.referral-inbound-banner {
  background: linear-gradient(135deg, rgba(240,192,64,0.12), rgba(232,152,32,0.06));
  border: 1px solid rgba(240,192,64,0.35);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 4px 0;
  font-size: 0.82rem;
  color: var(--text);
}
.referral-inbound-banner strong { color: var(--gold); }

/* Upgrade CTA */
.venue-upgrade-cta {
  text-align: center;
  border: 1px dashed var(--gold);
  background: rgba(240,192,64,0.04);
}

/* ────────────────────────────────────────────────────────────
   LARGE-DISPLAY (TV) SCALING — host dashboard is often cast to
   a second monitor/TV in the venue. Bump readability above 1600px
   so the back of the room can see category names, questions, and
   leaderboards without squinting.
   ──────────────────────────────────────────────────────────── */
/* Small-laptop / driving-a-bar-TV tier (1280–1599px). Below 1600 the
   "TV-mode" rule below doesn't kick in, so until now hosts on a 13"
   laptop or a small TV plugged into one (e.g. 1366×768 panels) got
   the default 16px-rem layout — readable from 12" but small from
   across the bar. This tier nudges font-size up to 17px and gives
   .screen a bit more breathing room without flipping into the full
   TV-contrast palette (which is overkill for a laptop screen). */
@media (min-width: 1280px) and (max-width: 1599px) {
  html { font-size: 17px; }
  .screen { padding: 28px; }
  .q-text, #qText { font-size: 1.9rem; line-height: 1.3; }
  .game-code { letter-spacing: 12px; }
}

@media (min-width: 1600px) {
  html { font-size: 19px; }
  .screen { padding: 32px; }
  .q-text, #qText { font-size: 2.2rem !important; line-height: 1.3; }
  .lb-name, .lb-score, .lb-score-label { font-size: 1.05em; }
  .code-display, #roomCodeDisplay { font-size: 1.4em; }
  .setup-label, .field-label { font-size: 0.9rem; }
  /* Bar-TV visibility pass: boost contrast so 20-ft readers can parse
     scoreboards and round info on dim panels. Only active at TV sizes,
     so laptop/desktop hosting is unaffected. */
  body {
    --text: #ffffff;
    --muted: #aabfd8;
    --bg: #050810;
    --surface: #0b1220;
    --surface2: #141e32;
    --border: #2a3d5c;
    --gold: #ffcf50;
    --green: #3ae07e;
    --red: #ff4466;
    -webkit-font-smoothing: antialiased;
  }
  .lb-name, .lb-score, .q-text, #qText, .waiting-title { font-weight: 700; }
  .lb-row, .tv-lb-row { background: var(--surface2); border: 1px solid var(--border); }
}
@media (min-width: 1920px) {
  html { font-size: 22px; }
  .q-text, #qText { font-size: 2.6rem !important; }
  .btn { min-height: 56px; font-size: 1.1rem; }
  body { font-weight: 500; }
}

/* ── Break screen layout (host dashboard / cast-to-TV) ───────
   Two-column: countdown + QR on the left, scoreboard on the right.
   Collapses to a single column on narrow viewports. */
#breakScreen { align-items: stretch; justify-content: center; padding: 24px; }
.break-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.2fr);
  gap: 32px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
}
.break-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.break-right { display: flex; flex-direction: column; }
.break-right .card { width: 100%; }
.break-right .lb-list { max-height: 70vh; overflow-y: auto; }
.break-qr-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.break-qr { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.break-qr img, .break-qr canvas { display: block; }
.break-qr-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--muted);
}
.break-qr-label span { color: var(--gold); margin-left: 6px; }
@media (max-width: 900px) {
  .break-layout { grid-template-columns: 1fr; gap: 20px; }
  .break-right .lb-list { max-height: 40vh; }
}

/* ═══════════════════════════════════════════════════════════════════
   HELP SCREEN
   ═══════════════════════════════════════════════════════════════════ */
.help-doc {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: 40px;
  line-height: 1.55;
}
.help-section { display: flex; flex-direction: column; gap: 12px; }
.help-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 3px;
  color: var(--gold);
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.help-section-intro {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 4px;
}
/* Sub-group heading inside a help-section. Used by the Venue panel
 * help block to delimit cards by which tab they live under, so the
 * help page mirrors the tab layout operators actually see. */
.help-tab-group-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  color: var(--text);
  margin: 8px 0 2px;
  padding: 0;
}
.help-tab-group-intro {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 4px;
}
.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-card p { margin: 0; font-size: 0.95rem; }
.help-card em { color: var(--muted); font-style: normal; }
.help-card strong { color: var(--text); font-weight: 600; }
.help-card-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 2px;
  color: var(--gold);
}
.help-card-options {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.5px;
}
.help-card-screens {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 2px solid var(--gold);
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 4px 0 0;
}
.help-card-screens > div strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.help-card-example {
  background: rgba(240, 192, 64, 0.05);
  border-color: rgba(240, 192, 64, 0.3);
}
.help-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}
.help-steps li { padding-left: 4px; }
.help-steps li strong { color: var(--gold); font-weight: 600; }
.help-note {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}
.help-qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.help-q {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 6px;
}
.help-a {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 600px) {
  .help-doc { padding: 0 4px 40px; }
  .help-section-title { font-size: 1.4rem; letter-spacing: 2px; }
  .help-card { padding: 14px; }
  .help-steps { padding-left: 18px; }
}

/* ── Print-Ready QR cards (Venue Panel) ─────────────────────────────────
   Side-by-side cards for Game Night QR + Open Play QR. Stacks
   vertically below 720px so a tablet or phone bartender can scroll
   through both. Each card carries its own canvas, URL, and download
   button so the venue can print just the modes they actually run. */
.venue-qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 720px) {
  .venue-qr-grid { grid-template-columns: 1fr; }
}
.venue-qr-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.venue-qr-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.venue-qr-card-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.venue-qr-canvas {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  display: inline-block;
  line-height: 0;
  align-self: center;
  /* Cap on-screen size so the 512x512 internal canvas doesn't blow up
     the card on desktop. The canvas itself stays 512px so downloads
     are still print-quality. */
  max-width: 200px;
  max-height: 200px;
}
.venue-qr-canvas canvas, .venue-qr-canvas img {
  width: 100% !important;
  height: 100% !important;
}
.venue-qr-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.venue-qr-url {
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.venue-qr-url span { color: var(--text); }
