/* VIDVOID — retro CRT terminal aesthetic */
:root {
  --p: #33ff33;
  --pd: #1a8c1a;
  --pb: #66ff66;
  --pg: rgba(51, 255, 51, 0.15);
  --a: #ffb000;
  --r: #ff3333;
  --c: #33ffff;
  --y: #ffff33;
  --bg: #0a0a0a;
  --bg2: #050505;
  --host: #ff3366;
  --mod: #ffb000;
  --user: #33ff33;
  --banned: #555;
  --f: 'VT323', 'Share Tech Mono', 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--f);
  background: var(--bg);
  color: var(--p);
  font-size: 16px;
  /* NB: overflow handled per-page. The room page has its own .room wrapper
     with height:100vh + overflow:hidden; every other page scrolls normally. */
}
/* Host / stats / history / bookmarks / nominations / schedules / auth pages:
   content can exceed the viewport, so let the window scroll. */
body:has(.host-main), body:has(.auth-wrap) { overflow-y: auto; }

/* Page-wide scanlines + vignette removed per request — they made videos hard
   to see. The CRT aesthetic lives in the bezel decoration now. */

a { color: var(--a); text-decoration: none; }
a:hover { color: var(--pb); text-shadow: 0 0 8px var(--pg); }

input, textarea, select, button {
  font-family: var(--f);
  font-size: 1rem;
  background: var(--bg2);
  color: var(--p);
  border: 1px solid var(--pd);
  padding: 0.4rem 0.6rem;
  border-radius: 0;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--p);
  box-shadow: 0 0 12px rgba(51,255,51,0.12);
}
input::placeholder { color: var(--pd); }
button {
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.08s;
}
button:hover:not(:disabled) {
  background: var(--p);
  color: #000;
  box-shadow: 0 0 16px var(--pg);
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.btn-primary { background: var(--bg2); color: var(--pb); border-color: var(--p); }
button.btn-mod { color: var(--host); border-color: var(--host); }
button.btn-mod:hover { background: var(--host); color: #000; box-shadow: 0 0 16px rgba(255,51,102,0.3); }

/* ═══════════════ AUTH PAGES ═══════════════ */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.auth-card {
  width: 100%; max-width: 420px;
  border: 1px solid var(--pd); background: var(--bg2);
  padding: 2rem;
  box-shadow: 0 0 40px rgba(51,255,51,0.08);
}
.brand {
  font-size: 1.6rem; letter-spacing: 4px; color: var(--pb);
  text-shadow: 0 0 20px var(--pg); text-align: center;
}
.brand-sub {
  font-size: 0.85rem; color: var(--pd); letter-spacing: 3px;
  text-align: center; margin-bottom: 1.5rem; text-transform: uppercase;
}
.brand-small {
  font-size: 1.15rem; letter-spacing: 3px; color: var(--pb);
  text-shadow: 0 0 10px var(--pg);
}
.auth-form { display: flex; flex-direction: column; gap: 0.4rem; margin: 1rem 0; }
.auth-form label { color: var(--pd); font-size: 0.8rem; letter-spacing: 2px; margin-top: 0.6rem; }
.auth-form input { width: 100%; }
.auth-form button { margin-top: 1rem; padding: 0.6rem; font-size: 1.05rem; }
.err {
  color: var(--r); border: 1px solid var(--r); padding: 0.6rem; margin-bottom: 1rem;
  background: rgba(255, 51, 51, 0.08);
}
.muted { color: var(--pd); }
.alt { text-align: center; margin-top: 1rem; font-size: 0.85rem; }
.notice {
  border: 1px solid var(--pd); background: var(--bg); padding: 1rem; margin: 1rem 0;
  font-size: 0.92rem; line-height: 1.5;
}
.notice p { margin: 0.3rem 0; }
.notice strong { color: var(--pb); }
.btn.full { display: block; width: 100%; text-align: center; padding: 0.7rem; text-decoration: none; }
.tos-check {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.8rem; line-height: 1.4; color: var(--pd);
  margin-top: 0.8rem;
}
.tos-check input[type="checkbox"] { margin-top: 0.2rem; flex-shrink: 0; }
.tos-check a { color: var(--a); text-decoration: underline; }
.legal-links { margin-top: 0.6rem; font-size: 0.75rem; letter-spacing: 1px; }
.card.legal h3 {
  color: var(--a); letter-spacing: 2px; font-size: 1rem;
  margin: 1.2rem 0 0.4rem 0; border-bottom: 1px dashed #1a1a1a; padding-bottom: 0.2rem;
}
.card.legal p, .card.legal li { line-height: 1.6; font-size: 0.92rem; }
.card.legal ul, .card.legal ol { padding-left: 1.2rem; }
.card.legal a { color: var(--a); border-bottom: 1px dotted var(--a); }
.card.legal code { color: var(--pb); background: #111; padding: 0 0.3rem; }

/* ═══════════════ MOD POPOVER (click-username quick actions) ═══════════════ */
.mod-target {
  cursor: pointer; text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.mod-target:hover { text-shadow: 0 0 8px currentColor; }

.mod-popover {
  position: absolute; z-index: 9999;
  min-width: 240px; max-width: 280px;
  background: var(--bg2); border: 1px solid var(--p);
  box-shadow: 0 6px 24px rgba(0,0,0,0.75), 0 0 14px rgba(51,255,51,0.15);
  padding: 0.5rem;
  font-family: var(--f);
}
.mod-popover.hidden { display: none; }
.mod-popover-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--pb); font-size: 0.95rem;
  border-bottom: 1px dashed var(--pd); padding-bottom: 0.3rem; margin-bottom: 0.35rem;
}
.mod-close {
  background: none; border: 1px solid var(--pd); color: var(--pd);
  padding: 0 0.4rem; cursor: pointer; font-family: var(--f);
}
.mod-close:hover { background: var(--r); color: #000; border-color: var(--r); }
.mod-popover-group {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  padding: 0.25rem 0;
}
.mod-popover-label {
  width: 100%; color: var(--pd); font-size: 0.7rem;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.mod-popover button {
  background: var(--bg); color: var(--p); border: 1px solid var(--pd);
  padding: 0.25rem 0.5rem; font-family: var(--f); font-size: 0.78rem;
  cursor: pointer; letter-spacing: 1px;
}
.mod-popover button:hover { background: var(--p); color: #000; }
.mod-popover button[data-act="ban"] { color: var(--r); border-color: var(--r); }
.mod-popover button[data-act="ban"]:hover { background: var(--r); color: #fff; }
.mod-popover-link {
  display: block; padding: 0.3rem 0.5rem;
  color: var(--a); font-size: 0.8rem; letter-spacing: 1px;
  border: 1px solid var(--pd); text-align: center;
  text-decoration: none;
}
.mod-popover-link:hover { background: var(--a); color: #000; }
.mod-popover-links {
  display: flex; flex-direction: column; gap: 0.25rem;
  margin-top: 0.1rem;
}
.mod-popover button[data-act="promote_mod"] {
  color: #33ccff; border-color: #33ccff;
}
.mod-popover button[data-act="promote_mod"]:hover { background: #33ccff; color: #000; }

/* ═══════════════ CHAT EMOTES ═══════════════ */
.emote {
  display: inline-block; vertical-align: middle;
  height: 24px; width: auto; max-width: 96px;
  margin: 0 2px; image-rendering: -webkit-optimize-contrast;
}
.emote-picker {
  display: flex; flex-wrap: wrap; gap: 0.2rem;
  padding: 0.5rem; background: var(--bg2);
  border-top: 1px solid var(--pd);
  max-height: 180px; overflow-y: auto;
}
.emote-picker.hidden { display: none; }
.emote-btn {
  background: transparent; border: 1px solid transparent;
  padding: 0.2rem; cursor: pointer;
}
.emote-btn img {
  width: 28px; height: 28px; object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.emote-btn:hover { background: var(--bg); border-color: var(--pd); }
.emote-btn.locked img { opacity: 0.35; filter: grayscale(0.7); }
.emote-btn.locked { position: relative; }
.emote-btn.locked::after {
  content: "🔒"; position: absolute; right: 2px; bottom: 0;
  font-size: 10px;
}
#emote-toggle {
  background: var(--bg2); color: var(--p);
  border: 1px solid var(--pd); padding: 0 0.5rem;
  font-size: 1.1rem; cursor: pointer; min-width: 2.4rem;
}
#emote-toggle:hover { background: var(--p); color: #000; }

/* ═══════════════ ANNOUNCEMENT BANNER ═══════════════ */
.announcement {
  display: flex; align-items: flex-start; gap: 1rem;
  background: linear-gradient(90deg, rgba(255,176,0,0.08), rgba(255,176,0,0.02));
  border-bottom: 1px solid var(--a);
  padding: 0.7rem 1rem;
  flex-shrink: 0;
  animation: announcement-slide 0.25s ease-out;
}
.announcement.hidden { display: none; }
.announcement-inner { flex: 1; min-width: 0; }
.announcement-title {
  color: var(--a); font-family: var(--f); letter-spacing: 2px;
  font-size: 0.92rem; margin-bottom: 0.2rem;
}
.announcement-body {
  color: var(--pb); font-family: var(--f); font-size: 0.95rem;
  line-height: 1.5; word-wrap: break-word;
}
.announcement-body a { color: var(--a); border-bottom: 1px dotted var(--a); }
.announcement-body a:hover { color: var(--pb); border-color: var(--pb); }
.announcement-body code { background: #111; padding: 0 0.25rem; color: var(--c); }
.announcement-close {
  background: none; border: 1px solid var(--pd); color: var(--pd);
  padding: 0.2rem 0.6rem; font-family: var(--f); font-size: 1rem; cursor: pointer;
  flex-shrink: 0; align-self: flex-start;
}
.announcement-close:hover { background: var(--pd); color: #000; }
.announcement.no-dismiss .announcement-close { display: none; }
@keyframes announcement-slide {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 300px; opacity: 1; }
}

/* ═══════════════ DEFINITION LIST (profile / user detail) ═══════════════ */
dl.kv {
  display: grid; grid-template-columns: 180px 1fr; gap: 0.4rem 1rem;
  margin: 0.5rem 0;
}
dl.kv dt { color: var(--pd); font-size: 0.85rem; letter-spacing: 1px; }
dl.kv dd { margin: 0; color: var(--pb); }
dl.kv dd code { background: #111; color: var(--a); padding: 0 0.3rem; }

/* User-management page filters + actions */
.user-filters {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.user-filters input, .user-filters select { min-width: 140px; }
.user-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.inline-form {
  display: inline-flex; gap: 0.3rem; align-items: center; flex-wrap: wrap;
}
.inline-form input { max-width: 200px; }

/* ═══════════════ TOP BAR (shared) ═══════════════ */
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--pd);
  background: var(--bg2);
}
.bar-right { display: flex; gap: 0.5rem; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--pd);
  background: var(--bg2);
  font-size: 0.85rem; letter-spacing: 1px;
  text-transform: uppercase;
}
.pill.link:hover { background: var(--p); color: #000; }
.pill.danger { border-color: var(--r); color: var(--r); }
.pill.danger:hover { background: var(--r); color: #000; }
.pill.queue-pill {
  font-size: 0.82rem; letter-spacing: 1px; cursor: default;
  border-color: var(--pd); color: var(--pd);
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.pill.queue-pill #queue-size { color: var(--pb); font-weight: bold; }
.pill.queue-pill.q-low {
  border-color: var(--r); color: var(--r);
  animation: queue-low-pulse 1.5s ease-in-out infinite;
}
.pill.queue-pill.q-low #queue-size { color: var(--r); }
.pill.queue-pill.q-mid { border-color: var(--a); color: var(--a); }
.pill.queue-pill.q-mid #queue-size { color: var(--a); }
.pill.queue-pill.q-full { border-color: var(--p); color: var(--p);
  box-shadow: 0 0 8px rgba(51, 255, 51, 0.2); }
.pill.queue-pill.q-full #queue-size { color: var(--pb); }
.pill.queue-pill.q-topping-up::after {
  content: " ⏳"; opacity: 0.6;
}
@keyframes queue-low-pulse {
  50% { box-shadow: 0 0 12px rgba(255, 51, 51, 0.35); }
}

.pill.host-link {
  border-color: var(--host); color: var(--host);
  background: rgba(255, 51, 102, 0.08);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.15);
}
.pill.host-link:hover { background: var(--host); color: #000; box-shadow: 0 0 20px rgba(255,51,102,0.4); }
.pill.mod-link { border-color: var(--mod); color: var(--mod); }
.pill.mod-link:hover { background: var(--mod); color: #000; }
.pill.muted-link { opacity: 0.55; }
.user-pill .who-name { font-weight: normal; color: var(--pb); letter-spacing: 1px; }
.user-pill[data-role="host"] .who-name { color: var(--host); text-shadow: 0 0 8px rgba(255,51,102,0.3); }
.user-pill[data-role="mod"] .who-name { color: var(--mod); }
.role-tag {
  font-size: 0.7rem; padding: 0 0.3rem; border: 1px solid currentColor;
  text-transform: uppercase; letter-spacing: 1px;
}
.role-host, [data-role="host"] .role-tag { color: var(--host); border-color: var(--host); }
.role-mod, [data-role="mod"] .role-tag { color: var(--mod); border-color: var(--mod); }
.role-user, [data-role="user"] .role-tag { color: var(--user); border-color: var(--user); }
.role-banned, [data-role="banned"] .role-tag { color: var(--banned); border-color: var(--banned); }

/* ═══════════════ ROOM LAYOUT — FITS 100vh, NO BODY SCROLL ═══════════════ */
.room { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.stage {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0; flex: 1;
  min-height: 0; overflow: hidden;
}
@media (max-width: 960px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 1fr 45vh; }
  .sidebar { border-left: 0 !important; border-top: 1px solid var(--pd); }
  .crt-top-label, .crt-bottom-strip { font-size: 0.55rem !important; }
  .crt-frame { padding: 18px 14px 26px 14px !important; }
}

.video-panel {
  padding: 0.6rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 0; overflow: hidden;
  position: relative;  /* anchor for .credits-overlay */
}

/* ═══════════════ CRT TV BEZEL ═══════════════ */
.crt-frame {
  position: relative;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14px 18px;
  background:
    radial-gradient(ellipse at 30% 30%, #2c2c2c 0%, #1a1a1a 40%, #0a0a0a 100%);
  border-radius: 14px;
  box-shadow:
    0 0 0 2px #000 inset,
    0 2px 0 2px #333 inset,
    0 -2px 0 2px #0a0a0a inset,
    0 12px 40px rgba(0,0,0,0.9),
    0 0 60px rgba(0,0,0,0.6);
}
/* Top label "VV VIDVOID" */
.crt-top-label {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-family: var(--f); font-size: 0.78rem; letter-spacing: 5px;
  color: #555; text-shadow: 0 1px 0 #000;
  user-select: none;
}
/* Bottom strip with knobs and labels */
.crt-bottom-strip {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--f); font-size: 0.7rem; letter-spacing: 2px;
  color: #444;
  user-select: none;
}
.crt-knob { color: #666; font-size: 1rem; text-shadow: 0 1px 0 #000, 0 -1px 0 #222; }
.crt-label { margin-right: 0.6rem; }
.crt-led {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #33ff33;
  box-shadow: 0 0 8px #33ff33, 0 0 14px rgba(51,255,51,0.5);
  animation: crt-pulse 2s ease-in-out infinite;
  margin-right: 0.4rem;
}
@keyframes crt-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #33ff33, 0 0 14px rgba(51,255,51,0.5); }
  50%      { opacity: 0.55; box-shadow: 0 0 4px #33ff33; }
}

/* Wraps the screen; maintains aspect-ratio and shrinks to fit available space */
.crt-screen-wrap {
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
}

/* The screen itself */
#video-shell {
  position: relative;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  aspect-ratio: 16 / 9;
  /* Fallback sizing for browsers that don't pair aspect-ratio + flex well */
  width: min(100%, calc((100cqh) * 16 / 9));
  background: #000;
  border-radius: 10px;
  border: 1px solid #000;
  box-shadow:
    inset 0 0 2px 2px #000,
    inset 0 0 50px rgba(0, 30, 0, 0.5),
    inset 0 0 120px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(51, 255, 51, 0.04);
  overflow: hidden;
}
.crt-frame { container-type: size; }
/* Scanlines + vignette pseudo-elements removed per request — users reported
   they made the video hard to see. The CRT aesthetic lives in the bezel. */
#video-frame {
  width: 100%; height: 100%; border: 0;
  position: relative; z-index: 1;
}
/* The YouTube IFrame API replaces #video-frame with its own iframe, setting
   default inline width="640" height="390". Force it to fill the CRT screen
   regardless of what YT sets. */
#video-shell iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  z-index: 1;
}
#video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  z-index: 2;
}
.loading { font-size: 1.6rem; letter-spacing: 4px; color: var(--pb); animation: flash 1.4s infinite; }
.loading-sub { color: var(--c); font-size: 0.95rem; letter-spacing: 2px; text-align: center; }
.picker-bar {
  width: 60%; height: 6px; background: #111; border: 1px solid var(--pd); margin-top: 0.6rem;
  overflow: hidden;
}
.picker-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p), var(--a));
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--pg);
}
.picker-hint {
  margin-top: 0.8rem; color: var(--pd); font-size: 0.85rem; text-align: center;
  max-width: 500px; line-height: 1.5;
}
.picker-hint strong { color: var(--a); }
.picker-hint a { color: var(--a); border-bottom: 1px dotted var(--a); }
@keyframes flash { 50% { opacity: 0.45; } }

.video-meta { padding: 0.2rem 0.2rem; flex-shrink: 0; }
.vm-title-row {
  display: flex; align-items: center; gap: 0.8rem;
}
.vm-title {
  color: var(--c); font-size: 1.02rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.vm-attribution {
  display: flex; gap: 0.3rem; flex-shrink: 0;
}
.attr-link {
  display: inline-block; padding: 0.25rem 0.6rem;
  border: 1px solid var(--pd); background: var(--bg2);
  color: var(--a); font-family: var(--f); font-size: 0.78rem;
  letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: all 0.1s;
}
.attr-link:hover {
  background: var(--a); color: #000;
  box-shadow: 0 0 10px rgba(255,176,0,0.3);
}
.attr-link.attr-video {
  border-color: #ff3333; color: #ff3333;
}
.attr-link.attr-video:hover {
  background: #ff3333; color: #fff; box-shadow: 0 0 12px rgba(255,51,51,0.35);
}
.attr-link.attr-channel {
  border-color: var(--c); color: var(--c);
}
.attr-link.attr-channel:hover {
  background: var(--c); color: #000; box-shadow: 0 0 12px rgba(51,255,255,0.3);
}
.vm-sub { color: var(--pd); font-size: 0.8rem; margin-top: 0.1rem; }
.vm-stats {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 0.25rem; font-size: 0.82rem;
}
.vm-stats .stat { color: var(--pd); }
.vm-stats .stat span { color: var(--pb); }
.vm-stats .stat-views span { color: var(--p); }
.vm-stats .stat-likes span { color: var(--c); }
.vm-stats .stat-comments span { color: var(--a); }
.vm-stats .stat-chan { overflow: hidden; text-overflow: ellipsis; max-width: 260px; white-space: nowrap; }

.controls {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.3rem 0 0.1rem 0; border-top: 1px dashed var(--pd);
  flex-shrink: 0;
}
.btn { padding: 0.5rem 1rem; }
.vote-status { flex: 1; min-width: 180px; color: var(--pd); font-size: 0.85rem; }
#vote-count, #vote-threshold { color: var(--pb); font-size: 1.05rem; }
.vote-bar {
  height: 4px; background: #111; margin-top: 6px; overflow: hidden;
}
#vote-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--p), var(--a), var(--r));
  transition: width 0.3s ease;
}

#vote-skip.voted { background: var(--a); color: #000; border-color: var(--a); }

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  border-left: 1px solid var(--pd);
  background: var(--bg2);
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;   /* anchor for .credits-overlay */
}
.tabs { display: flex; border-bottom: 1px solid var(--pd); }
.tab-btn {
  flex: 1; background: transparent; border: 0;
  border-right: 1px solid var(--pd);
  padding: 0.6rem; color: var(--pd); font-size: 0.9rem;
  letter-spacing: 2px;
}
.tab-btn:last-child { border-right: 0; }
.tab-btn.active { color: var(--pb); background: var(--bg); border-bottom: 2px solid var(--p); }
.tab-btn:hover { background: var(--bg); color: var(--pb); }

.tab-badge {
  display: inline-block;
  min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 5px;
  background: var(--r); color: #000;
  font-size: 0.65rem; letter-spacing: 0;
  border-radius: 8px;
  margin-left: 0.3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tab-badge.hidden { display: none; }

/* ═══════════════ SYSTEM LOG (separate from chat) ═══════════════ */
.system-log {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0.6rem;
  font-family: var(--f);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.sys-line {
  padding: 0.25rem 0.4rem;
  border-left: 2px solid var(--pd);
  color: var(--pd);
  font-size: 0.82rem;
  display: flex; gap: 0.5rem;
  align-items: baseline;
}
.sys-line.sys-picker { border-left-color: var(--a); }
.sys-line.sys-mod    { border-left-color: var(--mod, #33ccff); color: var(--pb); }
.sys-ts { color: var(--pd); font-size: 0.7rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.sys-body { flex: 1; word-break: break-word; color: var(--pb); }
.sys-line.sys-picker .sys-body { color: var(--a); }
#user-count { color: var(--pd); font-size: 0.75rem; }

.tab-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab-content.hidden { display: none; }

#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex; flex-direction: column; gap: 0.3rem;
  scroll-behavior: smooth;
}
.msg { word-wrap: break-word; word-break: break-word; }
.msg .who { color: var(--c); margin-right: 0.3rem; }
.msg .who.host { color: var(--host); }
.msg .who.mod { color: var(--mod); }
.msg .ts { color: var(--pd); font-size: 0.7rem; margin-right: 0.3rem; }
.msg.sys { color: var(--pd); font-style: italic; }
.msg.sys::before { content: "● "; }
.msg.mod-action { color: var(--mod); }
.msg.mod-action::before { content: "⚡ "; }
.msg .del-btn {
  display: inline-block; margin-left: 0.3rem; cursor: pointer; color: var(--r);
  font-size: 0.75rem; opacity: 0; transition: opacity 0.15s;
}
.msg:hover .del-btn { opacity: 1; }

/* Age-based fade so old messages recede visually without disappearing. */
.msg.faded       { opacity: 0.4; transition: opacity 1.5s; }
.msg.faded:hover { opacity: 1;   }
.msg.more-faded       { opacity: 0.18; }
.msg.more-faded:hover { opacity: 1; }

/* Hidden messages — stays visible to mods/hosts (with [HIDDEN] tag) and
   renders a placeholder body to everyone else. */
.msg.hidden-msg {
  opacity: 0.55; font-style: italic;
  border-left: 2px solid var(--r); padding-left: 0.5rem;
  background: rgba(255, 51, 51, 0.05);
}
.msg.hidden-msg .body { color: var(--pd); }
.msg .hidden-tag {
  display: inline-block; margin-left: 0.3rem;
  padding: 0 0.3rem; border: 1px solid var(--r); color: var(--r);
  font-size: 0.7rem; letter-spacing: 1px; font-style: normal;
}

#chat-form {
  display: flex; gap: 0.3rem; padding: 0.4rem; border-top: 1px solid var(--pd);
}
#chat-input { flex: 1; }
#chat-form button { padding: 0.4rem 0.8rem; }

#user-list {
  list-style: none; margin: 0; padding: 0.6rem;
  flex: 1; overflow-y: auto;
}
#user-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.3rem; border-bottom: 1px dashed #1a1a1a;
  gap: 0.4rem;
}
#user-list .u-actions {
  display: flex; gap: 0.2rem; flex-wrap: wrap;
}
#user-list .u-actions button {
  padding: 0.15rem 0.4rem; font-size: 0.7rem;
}

/* ═══════════════ HOST DASHBOARD ═══════════════ */
.host-main {
  padding: 1rem; display: flex; flex-direction: column; gap: 1rem;
  max-width: 1100px; margin: 0 auto; width: 100%;
}
.card {
  border: 1px solid var(--pd); background: var(--bg2); padding: 1rem;
}
.card h2 {
  margin: 0 0 0.8rem 0; color: var(--a); letter-spacing: 3px;
  font-size: 1.1rem; font-weight: normal; text-transform: uppercase;
  border-bottom: 1px dashed var(--pd); padding-bottom: 0.4rem;
}
.card form .row { margin-bottom: 0.8rem; }
.card form .row.two {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
}
.card form label {
  display: flex; flex-direction: column; gap: 0.2rem;
  color: var(--pd); font-size: 0.85rem; letter-spacing: 1px;
}
.card form label input[type="checkbox"] { width: auto; margin-right: 0.5rem; }
.card form input, .card form textarea { width: 100%; max-width: 100%; }
.card form.disabled { opacity: 0.6; pointer-events: none; }
.era-dates { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; }
.era-dates input { max-width: 160px; }
.era-dates input:disabled { opacity: 0.45; }
.era-custom.dim { opacity: 0.55; }
.filter-warn {
  border: 1px solid var(--r); background: rgba(255, 51, 51, 0.08);
  color: var(--r); padding: 0.6rem 0.8rem; margin: 0.5rem 0 1rem 0;
  font-size: 0.9rem; line-height: 1.4;
}
.filter-warn.subtle {
  border-color: var(--a); color: var(--a); background: rgba(255, 176, 0, 0.06);
}
.filter-warn code { background: #1a1a1a; color: var(--pb); padding: 0 0.3rem; }

.metrics { display: flex; gap: 1rem; margin: 0.6rem 0; flex-wrap: wrap; }
.metric {
  border: 1px solid var(--pd); padding: 0.6rem 1rem; min-width: 100px;
  text-align: center; background: var(--bg);
}
.mv { color: var(--pb); font-size: 1.8rem; text-shadow: 0 0 10px var(--pg); }
.ml { color: var(--pd); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }

.users-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.users-table th {
  text-align: left; padding: 0.4rem; border-bottom: 1px solid var(--pd);
  color: var(--pd); letter-spacing: 2px; font-weight: normal; font-size: 0.75rem;
}
.users-table td { padding: 0.4rem; border-bottom: 1px dashed #1a1a1a; }
.users-table .actions form.inline { display: inline-flex; gap: 0.3rem; }
.users-table select { padding: 0.2rem 0.3rem; font-size: 0.8rem; }
.users-table button { padding: 0.15rem 0.4rem; font-size: 0.7rem; }

/* ═══════════════ QUEUE VIEWER (host panel) ═══════════════ */
.queue-controls {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin: 0.6rem 0 1rem 0;
}
.queue-controls .btn { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.queue-list, .now-playing, .history-list {
  list-style: none; margin: 0; padding: 0;
}
.now-playing {
  display: flex; align-items: center; gap: 0.8rem;
  border: 1px solid var(--p); background: rgba(51, 255, 51, 0.04);
  padding: 0.6rem; margin-bottom: 0.6rem;
}
.queue-list li, .history-list li {
  display: flex; align-items: center; gap: 0.7rem;
  border: 1px solid var(--pd); background: var(--bg);
  padding: 0.4rem 0.6rem; margin: 0.35rem 0;
}
.queue-list li .q-idx {
  color: var(--a); font-size: 1.1rem; min-width: 1.8rem; text-align: center;
}
.q-thumb, .h-thumb {
  width: 120px; aspect-ratio: 16/9; object-fit: cover;
  border: 1px solid var(--pd); background: #000; flex-shrink: 0;
}
.h-thumb { width: 140px; }
.q-meta, .h-meta { flex: 1; min-width: 0; }
.q-title, .h-title {
  color: var(--c); font-size: 1rem; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.h-title a { color: var(--c); }
.h-title a:hover { color: var(--pb); }
.q-sub, .h-sub {
  color: var(--pd); font-size: 0.78rem; margin-top: 0.2rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.q-actions {
  display: flex; gap: 0.2rem; flex-shrink: 0;
}
.q-actions button {
  background: var(--bg2); color: var(--p); border: 1px solid var(--pd);
  padding: 0.25rem 0.5rem; font-size: 0.85rem; cursor: pointer;
  min-width: 2rem;
}
.q-actions button:hover { background: var(--p); color: #000; }

.history-search {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  margin: 0.4rem 0 1rem 0;
}
.history-search input { flex: 1; min-width: 200px; }
.history-search .btn { padding: 0.4rem 0.8rem; }
.history-list li { padding: 0.5rem 0.7rem; }

/* Nominator presence pill (in /host/nominations) */
.presence {
  display: inline-block; margin-left: 0.3rem; padding: 0 0.35rem;
  font-size: 0.7rem; letter-spacing: 1px;
  border: 1px solid currentColor;
}
.presence.online  { color: var(--p); animation: presence-pulse 2s infinite; }
.presence.offline { color: var(--pd); }
@keyframes presence-pulse {
  50% { box-shadow: 0 0 8px rgba(51,255,51,0.45); }
}
.ended-vote  { color: var(--p); }
.ended-force { color: var(--mod); }
.ended-auto  { color: var(--pd); }
.ended-manual{ color: var(--c); }

/* ═══════════════ BOOKMARK BUTTON ═══════════════ */
.btn.btn-bookmark { color: var(--c); border-color: var(--c); }
.btn.btn-bookmark:hover { background: var(--c); color: #000; }
.btn.btn-bookmark.saved {
  background: var(--c); color: #000;
  box-shadow: 0 0 10px rgba(51, 255, 255, 0.3);
}

/* ═══════════════ NOMINATE DIALOG ═══════════════ */
.dialog {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0, 0, 0, 0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.dialog.hidden { display: none; }
.dialog-card {
  background: var(--bg2); border: 1px solid var(--p);
  padding: 1.5rem; max-width: 500px; width: 100%;
  box-shadow: 0 0 40px rgba(51, 255, 51, 0.15);
}
.dialog-card h3 {
  margin: 0 0 0.8rem 0; color: var(--pb); letter-spacing: 3px;
  font-size: 1.1rem; text-transform: uppercase;
}
.dialog-card form { display: flex; flex-direction: column; gap: 0.6rem; }
.dialog-card label {
  display: flex; flex-direction: column; gap: 0.2rem;
  color: var(--pd); font-size: 0.85rem;
}
.dialog-card input { width: 100%; }
.dialog-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem;
}
#nominate-status { min-height: 1.2em; }
#nominate-status.ok { color: var(--p); }
#nominate-status.err { color: var(--r); }

/* ═══════════════ ACHIEVEMENT TOAST ═══════════════ */
.toast-stack {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 9997;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}

/* Alerts overlay — lives at the TOP of the chat panel so subs/gifts/tips
   pop next to the chat without ever covering the video. Supporter+/mod/host
   can hide it from the top-bar 👁 toggle. Collapses to zero height when empty
   so it doesn't push the chat log down by default. */
.alert-overlay {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 0;
}
.alert-overlay:empty { display: none; }
.alert-overlay .toast {
  width: 100%; max-width: 100%;
  background: rgba(10, 10, 10, 0.88);
  text-align: center;
  animation: toast-drop 0.35s ease-out forwards;
}
.alert-overlay .toast .t-title { justify-content: center; }
@keyframes toast-drop {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ═══════════════ THANK-YOU CELEBRATION (name pop in chat panel) ═══════════════ */
.thank-you-celeb {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.94) 0%, rgba(20, 10, 30, 0.94) 100%);
  border: 2px solid var(--p);
  box-shadow:
    0 0 18px rgba(51, 255, 102, 0.25),
    0 4px 14px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: var(--pb);
  animation: ty-pop-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}
.thank-you-celeb::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0 18px,
      rgba(51, 255, 102, 0.04) 18px 19px);
  animation: ty-scan 8s linear infinite;
  z-index: -1;
}
.thank-you-celeb.fading {
  animation: ty-fade-out 0.6s ease-in forwards;
}
.thank-you-gift      { border-color: #ffd700; box-shadow: 0 0 28px rgba(255,215,0,0.35), 0 8px 30px rgba(0,0,0,0.7); }
.thank-you-tip       { border-color: #33ff88; box-shadow: 0 0 28px rgba(51,255,136,0.35), 0 8px 30px rgba(0,0,0,0.7); }
.thank-you-subscribe { border-color: #ff66cc; box-shadow: 0 0 28px rgba(255,102,204,0.4),  0 8px 30px rgba(0,0,0,0.7); }
.thank-you-nom { border-color: #33ccff; box-shadow: 0 0 18px rgba(51,204,255,0.35), 0 4px 14px rgba(0,0,0,0.55); }
.thank-you-nom:hover { background: linear-gradient(135deg, rgba(20,30,50,0.96) 0%, rgba(10,10,10,0.96) 100%); }
.nom-toast-thumb {
  width: 100%; max-width: 200px;
  height: auto; aspect-ratio: 16/9; object-fit: cover;
  border: 1px solid #33ccff;
  margin: 0.3rem auto;
  display: block;
}

/* ═══════════════ MONTHLY CREDITS ROLL ═══════════════
   Rendered NEXT TO the video (attached to .sidebar) — never covers the
   player. Tab buttons + chat live underneath, briefly hidden while the
   roll plays. */
.credits-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #0a0a15 0%, #000 80%);
  color: var(--pb);
  z-index: 50;              /* above chat UI, below dialogs */
  overflow: hidden;
  display: flex; justify-content: center;
  animation: cr-in 0.5s ease-out forwards;
  font-family: var(--f);
}
.credits-overlay.credits-out { animation: cr-out 0.5s ease-in forwards; }
@keyframes cr-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cr-out { to   { opacity: 0; } }

.cr-scroll {
  position: absolute; left: 0; right: 0;
  top: 100%;                 /* start below the visible sidebar area */
  text-align: center;
  animation-name: cr-roll;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  padding: 0 0.8rem 20vh 0.8rem;
}
@keyframes cr-roll {
  from { top: 100%; }
  to   { top: -110%; }
}

.cr-heading {
  font-size: 1.3rem; letter-spacing: 3px;
  color: var(--p); text-shadow: 0 0 10px rgba(51,255,102,0.5);
  margin: 0.8rem 0 0.4rem;
  word-break: break-word;
}
.cr-heading.cr-thanks {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255,215,0,0.45);
  font-size: 1.7rem;
  margin-top: 2.5rem; margin-bottom: 1.2rem;
}
.cr-subtitle {
  color: var(--pd); font-size: 0.75rem; letter-spacing: 1px;
  margin-bottom: 2rem;
  line-height: 1.4;
}
.cr-group-label {
  color: var(--a); font-size: 0.8rem; letter-spacing: 3px;
  margin: 2rem 0 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--pd);
}
.cr-names {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.95rem; color: var(--pb);
}
.cr-names-patron .cr-name { color: #ffd700; text-shadow: 0 0 6px rgba(255,215,0,0.35); }
.cr-names-supporter .cr-name { color: #e0e0e0; }
.cr-names-tip .cr-name { color: #33ff88; font-size: 0.85rem; }
.cr-name { word-break: break-word; }
.cr-empty { color: var(--pd); font-style: italic; font-size: 0.8rem; }
.cr-footer {
  margin-top: 2rem; color: var(--pd);
  font-size: 0.8rem; letter-spacing: 2px;
}

.cr-skip {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: var(--bg); color: var(--pd);
  border: 1px solid var(--pd);
  padding: 0.25rem 0.6rem;
  font-family: inherit; font-size: 0.7rem; letter-spacing: 2px;
  cursor: pointer; z-index: 2;
  opacity: 0.55; transition: opacity 0.15s;
}
.cr-skip:hover { opacity: 1; color: var(--pb); border-color: var(--pb); }

.credits-preview {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.25rem 0.8rem;
}
.credits-preview li {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--pd); background: var(--bg);
  font-size: 0.85rem; color: var(--pb);
}

/* ═══════════════ SCHEDULE EDITOR ═══════════════ */
.day-picker {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  margin-top: 0.25rem;
}
.day-chip {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--pd); background: var(--bg);
  color: var(--pd);
  font-family: inherit; font-weight: bold; font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  position: relative;
}
.day-chip input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.day-chip:has(input:checked) {
  background: var(--p); color: #000; border-color: var(--p);
  box-shadow: 0 0 8px rgba(51,255,102,0.4);
}
.day-shortcut {
  font-size: 0.7rem !important; padding: 0.3rem 0.6rem !important;
  margin-left: 0.5rem;
}
.sched-table {
  width: 100%; border-collapse: collapse; font-family: inherit; margin-top: 0.5rem;
}
.sched-table th, .sched-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--pd);
  vertical-align: top;
  text-align: left;
}
.sched-table th {
  color: var(--pd); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
  border-bottom: 2px solid var(--pd);
}
.sched-table tr.sched-active {
  background: rgba(51,255,102,0.06);
}
.sched-table td.actions { white-space: nowrap; }
.sched-table .actions .btn { padding: 0.2rem 0.4rem; font-size: 0.8rem; }

/* ═══════════════ ANONYMOUS VIEWER MODE ═══════════════ */
.anon-banner {
  padding: 0.5rem 1rem;
  text-align: center;
  background: rgba(51, 204, 255, 0.08);
  border-bottom: 1px solid var(--pd);
  color: var(--pb);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.anon-banner a {
  color: var(--p);
  text-decoration: none;
  font-weight: bold;
}
.anon-banner a:hover { text-decoration: underline; }

/* Gated controls (chat input, vote, bookmark, nominate) for anons */
.anon-disabled {
  opacity: 0.45;
  cursor: pointer !important;   /* override disabled cursor so click registers */
  filter: grayscale(40%);
  transition: opacity 0.15s;
}
.anon-disabled:hover { opacity: 0.7; }
/* Chat input in anon mode */
#chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}

/* Anon-count footer in users tab */
.anon-footer {
  padding: 0.5rem 0.6rem;
  border-top: 1px dashed var(--pd);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--pd);
  list-style: none;
}

/* Watching-count pill in top bar */
.pill.watching-pill {
  border-color: var(--pd);
  color: var(--pd);
  font-variant-numeric: tabular-nums;
}
.pill.watching-pill #watching-count {
  color: var(--pb);
  font-weight: bold;
  margin-left: 0.2rem;
}

/* Login prompt modal (shown when an anon clicks a gated control) */
.login-prompt-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  display: flex; align-items: center; justify-content: center;
  animation: fadein 0.15s ease-out;
}
.login-prompt-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--p);
  box-shadow: 0 0 30px rgba(51, 255, 102, 0.3), 0 10px 40px rgba(0, 0, 0, 0.6);
  padding: 1.5rem 1.8rem;
  max-width: 440px; width: 90%;
  color: var(--pb);
  font-family: var(--f);
  animation: popin 0.2s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.login-prompt-title {
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--p);
  margin-bottom: 0.6rem;
}
.login-prompt-body {
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}
.login-prompt-actions {
  display: flex; gap: 0.6rem;
}
.login-prompt-actions .btn {
  flex: 1; text-align: center;
  text-decoration: none;
  padding: 0.55rem 1rem;
}
.login-prompt-close {
  position: absolute; top: 0.5rem; right: 0.6rem;
  background: transparent; border: 0;
  color: var(--pd); font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.login-prompt-close:hover { color: var(--pb); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Share button state */
.pill.share-copied {
  background: var(--p);
  color: #000;
  border-color: var(--p);
}

/* Login page "watch anonymously" link */
.brand-sub .anon-link {
  color: var(--p);
  text-decoration: none;
}
.brand-sub .anon-link:hover { text-decoration: underline; }

/* ═══════════════ FIRST-VISIT ONBOARDING TOAST ═══════════════ */
.onboarding-toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  width: min(92%, 560px);
  background: var(--bg2);
  border: 2px solid var(--p);
  box-shadow:
    0 0 28px rgba(51, 255, 102, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.7);
  padding: 1rem 1.3rem;
  color: var(--pb);
  font-family: var(--f);
  animation: onboarding-in 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.onboarding-toast.fading { animation: onboarding-out 0.4s ease-in forwards; }
.onboarding-body {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.7rem;
}
.onboarding-body strong { color: var(--p); }
.onboarding-body a { color: var(--a); }
.onboarding-actions {
  display: flex; gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.onboarding-actions .btn { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
@keyframes onboarding-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes onboarding-out {
  to { opacity: 0; transform: translate(-50%, 20px); }
}

/* ═══════════════ RESPONSIVE MOBILE LAYOUT ═══════════════
   At ≤768px the room restacks: video on top (full width, 16:9), meta + controls
   below, chat takes the remaining viewport height with a sticky input bar.
   Most top-bar controls collapse behind a hamburger menu. */
@media (max-width: 768px) {
  /* ── Top bar ── */
  .bar {
    padding: 0.5rem 0.7rem !important;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .brand-small {
    font-size: 0.75rem !important;
    flex: 1; min-width: 0;
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .tipper-scroll { display: none !important; }  /* too busy on mobile */
  .bar-right {
    gap: 0.25rem !important;
    flex-wrap: nowrap;
  }
  /* Hide most pills behind the hamburger drawer on mobile */
  .bar-right > .pill:not(.mobile-always-visible),
  .bar-right > a.pill:not(.mobile-always-visible),
  .bar-right > button.pill:not(.mobile-always-visible),
  .bar-right > div#notif-dropdown {
    display: none !important;
  }
  .mobile-menu-btn { display: inline-flex !important; }
  .pill { padding: 0.3rem 0.55rem !important; font-size: 0.72rem !important; }
  .pill.queue-pill, .pill.watching-pill {
    padding: 0.3rem 0.5rem !important;
  }

  /* ── Room layout: stack video above chat ── */
  .room {
    flex-direction: column !important;
    height: 100vh; min-height: 0;
  }
  .stage {
    flex-direction: column !important;
    flex: 1; min-height: 0;
    overflow: hidden;
  }
  .video-panel {
    padding: 0.35rem !important;
    gap: 0.35rem !important;
    flex: 0 0 auto !important;     /* size to content, don't grow */
  }
  .sidebar {
    flex: 1 1 auto !important;
    min-height: 0;
    border-left: 0 !important;
    border-top: 1px solid var(--pd);
  }

  /* ── CRT frame: shrink padding to keep video big ── */
  .crt-frame {
    padding: 6px 6px 8px !important;
    border-radius: 6px !important;
  }
  #video-shell {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
  }

  /* ── Video meta compressed ── */
  .video-meta {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.7rem !important;
  }
  .vm-title {
    font-size: 0.85rem !important;
    line-height: 1.2;
  }
  .vm-title-row { flex-direction: column !important; align-items: flex-start !important; gap: 0.2rem !important; }
  .vm-stats {
    display: flex; flex-wrap: wrap;
    gap: 0.4rem !important;
    font-size: 0.7rem;
  }
  /* Hide the noisier per-stat icons; keep views + duration + channel */
  .stat-likes, .stat-comments, .stat-date { display: none !important; }

  /* ── Controls row: wrap to fit ── */
  .controls {
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
    padding: 0.3rem !important;
  }
  .controls .btn { padding: 0.4rem 0.6rem !important; font-size: 0.75rem !important; }
  .vote-status { font-size: 0.7rem; flex: 1 1 100%; }

  /* ── Chat + input ── */
  #chat-log, .system-log {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.85rem;
  }
  #chat-form {
    padding: 0.3rem !important;
    gap: 0.25rem !important;
  }
  #chat-input { font-size: 1rem !important; /* ≥16px avoids iOS zoom */ }
  #emote-toggle, #chat-form button[type="submit"] {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
  }

  /* ── Dialogs: full-screen on narrow viewports ── */
  .dialog { padding: 0 !important; }
  .dialog-card {
    width: 100% !important; height: 100% !important;
    max-width: none !important; max-height: none !important;
    border-radius: 0 !important;
    overflow-y: auto;
  }

  /* ── Mod popover becomes a bottom sheet ── */
  .mod-popover {
    position: fixed !important;
    bottom: 0 !important; left: 0 !important; right: 0 !important;
    top: auto !important;
    max-width: none !important;
    border-left: 0 !important; border-right: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
  }

  /* ── Alert overlay scales down ── */
  .thank-you-celeb { padding: 0.5rem 0.7rem; }
  .ty-name { font-size: 1.1rem; }
  .ty-emoji { font-size: 1.4rem; }

  /* ── Onboarding toast adjusts ── */
  .onboarding-toast {
    bottom: 0.5rem !important;
    width: calc(100% - 1rem) !important;
    padding: 0.8rem 1rem !important;
  }
  .onboarding-body { font-size: 0.85rem !important; }

  /* ── Login prompt modal ── */
  .login-prompt-card { padding: 1.2rem 1rem !important; }

  /* ── Announcement banner ── */
  .announcement { font-size: 0.85rem !important; padding: 0.5rem !important; }

  /* ── Anon banner ── */
  .anon-banner { font-size: 0.75rem !important; padding: 0.4rem 0.7rem !important; }

  /* ── Credits overlay (in sidebar) ── */
  .cr-heading { font-size: 1rem !important; letter-spacing: 2px !important; }
  .cr-heading.cr-thanks { font-size: 1.4rem !important; }
  .cr-names { font-size: 0.85rem !important; }

  /* ── Notification dropdown full-width on mobile ── */
  .notif-dropdown {
    position: fixed !important;
    left: 0.5rem !important; right: 0.5rem !important;
    top: 52px !important;
    max-width: none !important;
  }

  /* ── Host admin pages: better padding + scrolling ── */
  .host-main { padding: 0.5rem !important; }
  .card { padding: 0.7rem !important; }
  .row.two { flex-direction: column !important; gap: 0.5rem !important; }
}

/* Desktop: hide the hamburger (only shown on mobile) */
.mobile-menu-btn { display: none; }

/* ═══════════════ DISCORD AUTO-SETUP ═══════════════ */
.auto-setup-card {
  border-color: #5865f2 !important;
  background: rgba(88, 101, 242, 0.05);
}
.auto-setup-card h2 { color: #7983f5; }
.auto-setup-details {
  margin: 0.6rem 0 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px dashed var(--pd);
  background: var(--bg);
}
.auto-setup-details summary {
  cursor: pointer;
  color: var(--pd);
  font-size: 0.85rem;
  letter-spacing: 1px;
}
.auto-setup-details ul { padding-left: 1.2rem; line-height: 1.6; margin: 0.5rem 0; }
.auto-setup-details code {
  background: var(--bg2);
  padding: 0 0.3rem;
  border: 1px solid var(--pd);
  color: var(--pb);
}
.auto-setup-table {
  width: 100%; border-collapse: collapse;
  margin-top: 0.4rem;
}
.auto-setup-table th, .auto-setup-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--pd);
  text-align: left;
  font-size: 0.85rem;
}
.auto-setup-table th {
  color: var(--pd); font-size: 0.7rem; letter-spacing: 2px;
  text-transform: uppercase;
}

/* ═══════════════ UNMUTE OVERLAY (mobile autoplay) ═══════════════
   Covers the entire video so the user can't accidentally tap YouTube's
   "open in app" button. One big tap = audio starts. */
.unmute-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-family: var(--f);
  border: 0; padding: 0;
  cursor: pointer;
  z-index: 30;          /* above iframe (z=1), below credits (z=50) */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: unmute-pulse 2.4s ease-in-out infinite;
}
.unmute-overlay.hidden { display: none; }
.unmute-icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(51, 255, 102, 0.7));
}
.unmute-label {
  font-size: 1.1rem;
  letter-spacing: 4px;
  color: var(--p);
  text-shadow: 0 0 14px rgba(51, 255, 102, 0.6);
}
.unmute-overlay:active {
  background: rgba(51, 255, 102, 0.15);
}
@keyframes unmute-pulse {
  0%, 100% { background: rgba(0, 0, 0, 0.5); }
  50%      { background: rgba(0, 0, 0, 0.35); }
}

/* ═══════════════ MOBILE HAMBURGER DRAWER ═══════════════ */
.mobile-menu-btn {
  align-items: center; justify-content: center;
  width: 36px; height: 32px;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
}
.mobile-menu-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(85%, 320px); height: 100vh;
  background: var(--bg2);
  border-left: 2px solid var(--p);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.7);
  z-index: 9997;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
}
.mobile-menu-drawer.open { transform: translateX(0); }
.mobile-menu-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9996;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-menu-drawer .pill,
.mobile-menu-drawer a.pill,
.mobile-menu-drawer button.pill {
  display: block !important;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.8rem !important;
  font-size: 0.85rem !important;
}
.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pd);
  margin-bottom: 0.4rem;
}
.mobile-menu-title {
  color: var(--p); letter-spacing: 2px; font-size: 0.8rem;
}
.mobile-menu-close {
  background: transparent; border: 0;
  color: var(--pd); font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
.mobile-menu-close:hover { color: var(--pb); }

/* ═══════════════ ABOUT PAGE ═══════════════ */
.about-page { max-width: 800px; margin: 0 auto; }
.about-main {
  padding: 2rem 1.5rem 4rem;
  color: var(--pb);
  font-family: var(--f);
}
.about-body { line-height: 1.6; font-size: 1.05rem; }
.about-tagline {
  color: var(--p);
  font-size: 1.2rem;
  letter-spacing: 1px;
  padding: 1rem 0;
  border-bottom: 1px solid var(--pd);
  margin-bottom: 1.5rem;
}
.about-body h1, .about-body h2 {
  color: var(--p);
  letter-spacing: 2px;
  margin-top: 1.8rem;
}
.about-body a { color: var(--a); }
.about-body code {
  background: var(--bg);
  border: 1px solid var(--pd);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}
.about-body ul { padding-left: 1.5rem; }
.about-body li { margin: 0.3rem 0; }
.about-body hr {
  border: 0; border-top: 1px solid var(--pd);
  margin: 2rem 0;
}
.about-footer { text-align: center; }

/* ═══════════════ 404 PAGE ═══════════════ */
.page-404 { max-width: 700px; margin: 0 auto; }
.page-404-main {
  padding: 4rem 1.5rem;
  text-align: center;
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
}
.page-404-body {
  color: var(--pb);
  font-family: var(--f);
  line-height: 1.6;
}
.page-404-body h1 {
  color: var(--p);
  font-size: 2.5rem;
  letter-spacing: 4px;
  margin-bottom: 1rem;
  text-shadow: 0 0 14px rgba(51, 255, 102, 0.4);
}
.page-404-body p { margin: 1rem 0; }
.page-404-body a {
  color: var(--a);
  text-decoration: none;
}
.page-404-body a:hover { text-decoration: underline; }

.ty-emoji {
  font-size: 1.8rem; line-height: 1;
  margin-bottom: 0.2rem;
  animation: ty-bounce 1.4s ease-in-out infinite;
}
.ty-heading {
  color: var(--pd); font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase;
}
.ty-name {
  color: var(--pb); font-size: 1.4rem; letter-spacing: 1.5px;
  margin: 0.1rem 0; font-weight: bold;
  text-shadow: 0 0 8px currentColor;
  word-break: break-word;
}
.ty-to {
  color: var(--a); font-size: 0.85rem; letter-spacing: 1px;
  margin-top: -0.1rem; margin-bottom: 0.2rem;
}
.ty-tier {
  color: var(--p); font-size: 0.8rem; letter-spacing: 1.5px;
  margin-top: 0.15rem;
}
.ty-note {
  color: var(--pd); font-style: italic; font-size: 0.75rem;
  margin-top: 0.25rem; padding-top: 0.25rem;
  border-top: 1px dashed var(--pd);
}
@keyframes ty-pop-in {
  0%   { transform: translateY(-30px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0)     scale(1);    opacity: 1; }
}
@keyframes ty-fade-out {
  to { transform: translateY(-12px) scale(0.96); opacity: 0; }
}
@keyframes ty-bounce {
  0%, 100% { transform: translateY(0);    }
  50%      { transform: translateY(-6px); }
}
@keyframes ty-scan {
  from { background-position: 0 0; }
  to   { background-position: 60px 60px; }
}
.pill.hide-alerts-btn { cursor: pointer; }
.pill.hide-alerts-btn:hover { background: var(--a); color: #000; }

/* ═══════════════ SCHEDULE DIALOG ═══════════════ */
.schedule-list {
  display: flex; flex-direction: column; gap: 0.6rem;
  max-height: 55vh; overflow-y: auto;
  padding-right: 0.2rem;
}
.schedule-row {
  border: 1px solid var(--pd);
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.schedule-row-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.6rem; flex-wrap: wrap;
}
.schedule-name {
  color: var(--pb); font-size: 0.95rem; letter-spacing: 1px; font-weight: bold;
}
.schedule-time {
  color: var(--a); font-size: 0.8rem; font-variant-numeric: tabular-nums;
}
.schedule-row-meta {
  display: flex; justify-content: space-between; gap: 0.6rem;
  font-size: 0.75rem; color: var(--pd); letter-spacing: 1px;
}
.schedule-changes { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.schedule-chg {
  font-size: 0.7rem; letter-spacing: 1px;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--pd); color: var(--p);
  background: rgba(51, 255, 102, 0.05);
}

/* ═══════════════ MOD PANEL ═══════════════ */
.mod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem; margin-top: 0.6rem;
}
.mod-card {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--mod, #33ccff);
  background: rgba(51, 204, 255, 0.04);
  color: var(--pb);
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.mod-card:hover {
  background: rgba(51, 204, 255, 0.12);
  transform: translateY(-1px);
}
.mod-card-title { color: var(--mod, #33ccff); font-size: 0.95rem; letter-spacing: 1.5px; }
.mod-card-desc  { color: var(--pd); font-size: 0.8rem; }
.mod-card-cta   { color: var(--pb); font-size: 0.75rem; letter-spacing: 2px; margin-top: auto; align-self: flex-end; }

.mod-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem; margin-top: 0.5rem;
}
.mod-stat {
  border: 1px solid var(--pd); padding: 0.6rem 0.8rem; background: var(--bg);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.mod-stat-label { color: var(--pd); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; }
.mod-stat-value { color: var(--pb); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; margin-left: 0.3rem;
  padding: 0 0.35rem; background: var(--r); color: #000;
  font-size: 0.65rem; letter-spacing: 1px; border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════ VIBE PICKER (host config) ═══════════════ */
.vibe-picker {
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px dashed var(--pd);
  background: rgba(51, 255, 102, 0.03);
}
.vibe-picker-head {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  font-size: 0.8rem; margin-bottom: 0.4rem;
}
.vibe-mode { color: var(--pd); font-size: 0.75rem; letter-spacing: 1px; }
.vibe-mode input { margin-right: 0.25rem; }
.vibe-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vibe-chip {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem; letter-spacing: 1px;
  background: var(--bg); color: var(--p);
  border: 1px solid var(--pd);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-family: inherit;
}
.vibe-chip:hover {
  background: rgba(51,255,102,0.12);
  border-color: var(--p);
}
.vibe-chip.vibe-chip-flash {
  background: var(--p); color: #000;
  transform: scale(1.05);
}

/* ═══════════════ NOMINATE DIALOG — TABS + BOOKMARK PICKER ═══════════════ */
.nom-tabs {
  display: flex; gap: 0.4rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--pd);
}
.nom-tab-btn {
  background: transparent; color: var(--pd);
  border: 0; border-bottom: 2px solid transparent;
  padding: 0.4rem 0.7rem;
  font-family: inherit; font-size: 0.8rem; letter-spacing: 1.5px;
  cursor: pointer;
}
.nom-tab-btn:hover { color: var(--pb); }
.nom-tab-btn.active {
  color: var(--p); border-bottom-color: var(--p);
}
.nom-bm-list {
  display: flex; flex-direction: column; gap: 0.25rem;
  max-height: 40vh; overflow-y: auto;
  padding: 0.2rem;
  border: 1px solid var(--pd);
  background: var(--bg);
}
.nom-bm-row {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.4rem 0.6rem;
  background: transparent; color: var(--pb);
  border: 1px solid transparent;
  text-align: left;
  font-family: inherit; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nom-bm-row:hover { background: rgba(51,255,102,0.08); border-color: var(--pd); }
.nom-bm-row.picked {
  background: rgba(51,255,102,0.15);
  border-color: var(--p);
}
.nom-bm-title { color: var(--pb); font-size: 0.85rem; }
.nom-bm-meta  { color: var(--pd); font-size: 0.7rem; letter-spacing: 1px; }
#nominate-bm-picked { font-size: 0.75rem; margin-top: 0.3rem; }

/* ═══════════════ NOMINATION VOTING ═══════════════ */
.nom-vote-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  max-height: 55vh; overflow-y: auto;
  padding-right: 0.2rem;
}
.nv-row {
  display: flex; gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--pd); background: var(--bg);
}
.nv-thumb { width: 110px; height: 62px; object-fit: cover; border: 1px solid var(--pd); flex-shrink: 0; }
.nv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.nv-title { color: var(--pb); font-size: 0.9rem; word-break: break-word; }
.nv-meta { color: var(--pd); font-size: 0.72rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.nv-note { color: var(--a); font-size: 0.78rem; font-style: italic; }
.nv-vote-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.nv-vote-btn {
  background: var(--bg); color: var(--p); border: 1px solid var(--p);
  padding: 0.3rem 0.6rem;
  font-family: inherit; font-size: 0.78rem; letter-spacing: 1px;
  cursor: pointer;
}
.nv-vote-btn:hover { background: var(--p); color: #000; }
.nv-vote-btn.voted { background: rgba(51,255,102,0.15); color: var(--p); }
.nv-vote-btn:disabled { opacity: 0.5; cursor: wait; }
.nv-tally { color: var(--pd); font-size: 0.78rem; }
.nv-tally .nv-weight { color: var(--pb); }

/* ═══════════════ TIER EDIT (host/membership-tiers) ═══════════════ */
.tier-edit-card {
  border: 1px solid var(--pd);
  background: var(--bg);
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.tier-edit-card h3 {
  margin: 0; padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--pd);
  letter-spacing: 2px;
}
.tier-edit-card textarea { width: 100%; font-family: var(--f); font-size: 0.85rem; }
.tier-edit-card label { color: var(--pd); font-size: 0.78rem; display: flex; flex-direction: column; gap: 0.2rem; }
.tier-section-h {
  margin: 0.8rem 0 0.3rem; padding-top: 0.5rem;
  border-top: 1px dashed var(--pd);
  color: var(--pb); font-size: 0.85rem; letter-spacing: 2px;
}
.perm-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.35rem;
}
.perm-toggle {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--pd); background: var(--bg);
  color: var(--pb); font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.perm-toggle:hover { border-color: var(--p); }
.perm-toggle input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--p);
  cursor: pointer; margin: 0;
}
.perm-toggle:has(input:checked) {
  background: rgba(51,255,102,0.08);
  border-color: var(--p);
}
.perm-default { font-size: 0.7rem; letter-spacing: 1px; }

/* ═══════════════ 2FA SETUP / BACKUP CODES ═══════════════ */
.twofa-steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.twofa-steps li { color: var(--pb); }
.twofa-qr-wrap {
  display: flex; justify-content: center; padding: 1rem 0;
}
.twofa-qr {
  background: #fff; padding: 0.6rem;
  border: 1px solid var(--pd);
  max-width: 260px; width: 100%;
}
.twofa-qr svg { width: 100%; height: auto; display: block; }
.twofa-manual { margin-top: 0.5rem; }
.twofa-manual summary { cursor: pointer; color: var(--pd); font-size: 0.8rem; }
.twofa-secret {
  margin-top: 0.4rem; padding: 0.5rem 0.7rem;
  background: var(--bg); border: 1px dashed var(--pd);
  font-family: monospace; font-size: 1rem; letter-spacing: 2px;
  word-break: break-all; color: var(--pb);
}
.twofa-code-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.twofa-code-form input {
  font-family: monospace; font-size: 1.2rem; letter-spacing: 4px;
  padding: 0.4rem 0.7rem; width: 160px;
}
.twofa-backup-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem; margin: 1rem 0;
}
.twofa-backup-code {
  background: var(--bg); border: 1px solid var(--pd);
  padding: 0.7rem 0.8rem; text-align: center;
  font-family: monospace; font-size: 1rem; letter-spacing: 2px;
  color: var(--pb);
  user-select: all;
}

/* ═══════════════ SECURITY DASHBOARD ═══════════════ */
.sec-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.sec-check {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--pd); background: var(--bg);
}
.sec-check.ok  { border-color: var(--p); background: rgba(51,255,102,0.05); }
.sec-check.bad { border-color: var(--r); background: rgba(255,51,51,0.05); }
.sec-check-icon {
  font-size: 1.3rem; flex-shrink: 0; font-family: monospace;
}
.sec-check.ok .sec-check-icon  { color: var(--p); }
.sec-check.bad .sec-check-icon { color: var(--r); }
.sec-check-label {
  color: var(--pb); font-size: 0.95rem; letter-spacing: 1px;
}
.sec-check-detail { font-size: 0.8rem; margin-top: 0.15rem; }
.sec-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.sec-actions form {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.sec-manual { padding-left: 1.4rem; color: var(--pd); font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sec-manual li { color: var(--pd); }

.toast {
  background: var(--bg2); border: 1px solid var(--a);
  padding: 0.8rem 1rem; max-width: 340px;
  box-shadow: 0 0 20px rgba(255, 176, 0, 0.3), 0 4px 12px rgba(0,0,0,0.6);
  color: var(--a); font-family: var(--f);
  animation: toast-in 0.3s ease-out forwards;
}
.toast .t-header { font-size: 0.75rem; letter-spacing: 2px; color: var(--pd); text-transform: uppercase; }
.toast .t-title { font-size: 1.2rem; color: var(--pb); margin-top: 0.2rem; display: flex; gap: 0.4rem; align-items: center; }
.toast .t-desc  { font-size: 0.85rem; color: var(--pd); margin-top: 0.3rem; }
.toast.fading { animation: toast-out 0.4s ease-in forwards; }
@keyframes toast-in {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(30px); opacity: 0; }
}

/* ═══════════════ ACHIEVEMENTS GRID ═══════════════ */
.achievements-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem; margin-top: 0.5rem;
}
.ach-tile {
  border: 1px solid var(--pd); background: var(--bg);
  padding: 0.7rem; text-align: center;
  display: flex; flex-direction: column; gap: 0.3rem;
  transition: border-color 0.2s;
}
.ach-tile.unlocked {
  border-color: var(--a); background: rgba(255, 176, 0, 0.06);
  box-shadow: 0 0 12px rgba(255, 176, 0, 0.1);
}
.ach-tile.locked { opacity: 0.45; }
.ach-icon { font-size: 2rem; }
.ach-name { color: var(--pb); font-size: 0.9rem; letter-spacing: 1px; }
.ach-tile.locked .ach-name { color: var(--pd); }
.ach-desc { color: var(--pd); font-size: 0.75rem; line-height: 1.3; }

/* ═══════════════ LEADERBOARDS ═══════════════ */
.leaderboards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.lb-col h3 {
  color: var(--a); font-size: 0.8rem; letter-spacing: 2px;
  margin: 0 0 0.3rem 0;
}
.lb-col ol { list-style: none; padding: 0; margin: 0; counter-reset: lbc; }
.lb-col li {
  display: flex; justify-content: space-between;
  counter-increment: lbc;
  padding: 0.25rem 0.1rem; border-bottom: 1px dashed #1a1a1a;
  font-size: 0.85rem;
}
.lb-col li::before {
  content: counter(lbc) ". "; color: var(--pd); margin-right: 0.3rem;
}
.lb-name.host { color: var(--host); }
.lb-name.mod  { color: var(--mod); }
.lb-name.user { color: var(--pb); }
.lb-val { color: var(--a); }

/* ═══════════════ MEMBERSHIP / TIERS ═══════════════ */
.tier-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin-top: 0.8rem;
}
.tier-card {
  border: 1px solid var(--pd); background: var(--bg);
  padding: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.tier-card:hover { border-color: var(--p); }
.tier-card[data-tier="supporter"] { border-color: #c0c0c080; }
.tier-card[data-tier="supporter"]:hover {
  border-color: #c0c0c0; box-shadow: 0 0 20px rgba(192,192,192,0.15);
}
.tier-card[data-tier="patron"] { border-color: #ffd70080; }
.tier-card[data-tier="patron"]:hover {
  border-color: #ffd700; box-shadow: 0 0 24px rgba(255,215,0,0.22);
}
.tier-card.current {
  background: rgba(51, 255, 51, 0.05);
  border-color: var(--p); box-shadow: 0 0 16px rgba(51,255,51,0.12);
}
.tier-badge { font-size: 1.6rem; line-height: 1; }
.tier-name {
  color: var(--pb); font-size: 1.3rem; letter-spacing: 3px;
  text-transform: uppercase;
}
.tier-price {
  color: var(--a); font-size: 1rem; letter-spacing: 2px;
  margin-bottom: 0.2rem;
}
.tier-perks {
  list-style: none; padding: 0; margin: 0.4rem 0;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.tier-perks li {
  color: var(--pd); font-size: 0.85rem; padding-left: 1rem;
  position: relative; line-height: 1.35;
}
.tier-perks li::before {
  content: "▸"; position: absolute; left: 0; color: var(--p);
}
.tier-cta {
  display: block; padding: 0.7rem; margin-top: auto;
  text-align: center; text-decoration: none;
  font-family: var(--f); font-size: 0.95rem; letter-spacing: 2px;
  text-transform: uppercase; cursor: pointer;
  background: var(--bg2); color: var(--pb); border: 1px solid var(--p);
  transition: all 0.1s;
  width: 100%;
}
.tier-cta.join-cta:hover { background: var(--p); color: #000; box-shadow: 0 0 16px var(--pg); }
.tier-cta.current-cta { color: var(--p); border-color: var(--p); cursor: default; }
.tier-cta.muted-cta { color: var(--pd); border-color: var(--pd); cursor: default; opacity: 0.6; }

/* Tip form */
.tip-form { display: flex; flex-direction: column; gap: 0.6rem; }
.tip-presets { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tip-preset { padding: 0.4rem 0.8rem; }

/* ═══════════════ TIER BADGES (in chat + user list) ═══════════════ */
.tier-badge-inline {
  display: inline-block; margin-right: 0.3rem;
  font-size: 0.9rem; line-height: 1;
  text-shadow: 0 0 6px currentColor;
}
.tier-badge-inline.supporter { color: #c0c0c0; }
.tier-badge-inline.patron    { color: #ffd700; }

/* ═══════════════ MEMBERSHIP LINK IN BAR ═══════════════ */
.pill.tip-link {
  border-color: #33ff88; color: #33ff88;
}
.pill.tip-link:hover { background: #33ff88; color: #000; box-shadow: 0 0 14px rgba(51,255,136,0.35); }

.pill.bell-btn {
  cursor: pointer; font-family: var(--f);
  position: relative;
  background: var(--bg2); color: var(--pb);
}
.pill.bell-btn:hover { background: var(--p); color: #000; }
.pill.bell-btn.has-unread { border-color: var(--a); color: var(--a); animation: bell-wiggle 1.8s ease-in-out infinite; }
.pill.bell-btn #notif-count {
  display: none; margin-left: 0.25rem;
  background: var(--a); color: #000; border-radius: 8px;
  padding: 0 0.35rem; font-size: 0.7rem; font-weight: bold;
}
@keyframes bell-wiggle {
  0%, 85%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-8deg); }
  92% { transform: rotate(8deg); }
  96% { transform: rotate(-4deg); }
}

.notif-dropdown {
  position: absolute; top: 52px; right: 1rem; z-index: 9996;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--p);
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), 0 0 18px rgba(51,255,51,0.12);
  padding: 0.3rem 0;
}
.notif-dropdown.hidden { display: none; }
.notif-empty {
  padding: 1rem; color: var(--pd); font-size: 0.85rem; text-align: center; line-height: 1.4;
}
.notif-item {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px dashed #1a1a1a;
  font-family: var(--f); font-size: 0.88rem; color: var(--pb); line-height: 1.3;
}
.notif-item:last-child { border-bottom: 0; }
.notif-ts {
  color: var(--pd); font-size: 0.7rem; margin-right: 0.5rem;
}
.notif-note {
  color: var(--pd); font-size: 0.8rem; margin-top: 0.15rem;
  font-style: italic;
}

.pill.membership-link {
  border-color: #ffd700; color: #ffd700;
  background: rgba(255, 215, 0, 0.05);
}
.pill.membership-link:hover { background: #ffd700; color: #000; box-shadow: 0 0 18px rgba(255,215,0,0.4); }

/* ═══════════════ TIPPER SCROLLER (top bar) ═══════════════ */
.tipper-scroll {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap;
  margin: 0 1rem; padding: 0.2rem 0;
  font-size: 0.8rem; color: var(--pd);
  font-family: var(--f); letter-spacing: 1px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tipper-scroll:empty { display: none; }
.tipper-scroll .tipper {
  display: inline-block; margin-right: 2rem;
  animation: tipper-marquee 45s linear infinite;
}
.tipper-scroll .tipper:first-child { margin-left: 100%; }
@keyframes tipper-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ═══════════════ TIP TOAST (distinct from achievement) ═══════════════ */
.toast.tip-toast {
  border-color: #33ff88;
  box-shadow: 0 0 22px rgba(51,255,136,0.35), 0 4px 12px rgba(0,0,0,0.6);
}
.toast.tip-toast .t-header { color: #33ff88; }
.toast.tip-toast .t-title { color: #99ffbb; }

.toast.gift-toast {
  border-color: #ffd700;
  box-shadow: 0 0 26px rgba(255,215,0,0.45), 0 4px 12px rgba(0,0,0,0.6);
}
.toast.gift-toast .t-header { color: #ffd700; }
.toast.gift-toast .t-title { color: #ffe880; }

.gift-grid, .bulk-gift-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin-top: 0.8rem;
}
.bulk-gift-card {
  border: 1px solid var(--pd); background: var(--bg);
  padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.bulk-gift-card .gift-badge { font-size: 1.8rem; line-height: 1; }
.bulk-gift-card .gift-name  { color: var(--pb); font-size: 1.05rem; letter-spacing: 3px; }
.bulk-gift-card select { width: 100%; }
.bulk-gift-card label  { display: flex; flex-direction: column; gap: 0.2rem; color: var(--pd); font-size: 0.82rem; }
.bulk-preview {
  font-size: 0.78rem; padding: 0.4rem 0.55rem;
  border: 1px dashed var(--pd); background: rgba(51,255,102,0.04);
  color: var(--p);
}
.bulk-preview:has(> strong) { border-color: var(--a); color: var(--a); background: rgba(255,176,0,0.05); }
.gift-card {
  border: 1px solid var(--pd); background: var(--bg);
  padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.gift-card label {
  display: flex; flex-direction: column; gap: 0.2rem;
  color: var(--pd); font-size: 0.82rem;
}
.gift-card input { width: 100%; }
.gift-badge { font-size: 1.8rem; line-height: 1; }
.gift-name {
  color: var(--pb); font-size: 1.1rem; letter-spacing: 3px; text-transform: uppercase;
}
.gift-price {
  color: var(--a); font-size: 0.9rem; letter-spacing: 2px;
}

.events {
  list-style: none; margin: 0; padding: 0;
  font-size: 0.85rem; max-height: 260px; overflow-y: auto;
}
.events li {
  padding: 0.25rem 0.1rem; border-bottom: 1px dashed #1a1a1a;
  font-family: var(--f);
}
.events code {
  color: var(--a); background: #1a1a1a; padding: 0 0.3rem;
  font-size: 0.8rem;
}

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--pd); }
::-webkit-scrollbar-thumb:hover { background: var(--p); }
