:root {
  /* Reddit dark palette */
  --bg: #030303;
  --panel: #1a1a1b;
  --panel-2: #272729;
  --line: #343536;
  --text: #d7dadc;
  --muted: #818384;
  --accent: #ff4500; /* Reddit OrangeRed */
  --accent-2: #ff6a33;
  --danger: #ea0027;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hidden { display: none !important; }

/* ---- Lobby ---- */
.lobby {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.card input[type="text"] {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
}
.card input[type="text"]:focus { outline: none; border-color: var(--accent); }
.card select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
}
.card select:focus { outline: none; border-color: var(--accent); }

.roles { display: flex; gap: 10px; margin-bottom: 14px; }
.role {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  margin: 0;
}
.role small { color: var(--muted); }
.role:has(input:checked) { border-color: var(--accent); background: #1b2233; }

.check { display: flex; align-items: center; gap: 8px; color: var(--text) !important; }
.check input { width: auto; }

#joinBtn {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 999px; /* Reddit pill */
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#joinBtn:hover { background: #ff5414; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---- Call ---- */
.call { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-2);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.viewer { background: var(--accent); }
.room { color: var(--muted); font-size: 14px; }
.spacer { flex: 1; }
.count { color: var(--muted); font-size: 13px; margin-right: 6px; }
.ctrl {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  cursor: pointer;
}
.ctrl.off { background: var(--danger); border-color: var(--danger); }
.ctrl.leave { color: var(--danger); font-weight: 600; }

/* Video fills the whole area; everything else floats on top of it. */
.stageArea { flex: 1; min-height: 0; padding: 12px; }
.stageWrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
#mainVideo { width: 100%; height: 100%; object-fit: contain; background: #000; }

.mainLabel {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(0,0,0,0.55);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 5;
}
.pip {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 150px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.25);
  background: #111;
  z-index: 5;
}

/* Audience filmstrip (broadcaster only): a right-hand column that scrolls,
   so adding viewers never shrinks the main video. */
.viewerGrid {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 84px;
  width: 148px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  z-index: 5;
}
.tile {
  position: relative;
  width: 148px;
  aspect-ratio: 4/3;
  flex-shrink: 0;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.muted-tile { cursor: pointer; }
.tile .tlabel {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  background: rgba(0,0,0,0.6);
  padding: 2px 7px;
  border-radius: 6px;
}
.tile .kickBtn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(220,50,70,0.9);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.tile .kickBtn:hover { background: #dc3246; transform: scale(1.08); }

.kickedNotice {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: var(--bg);
  z-index: 100;
}
.kickedNotice h2 { margin: 0 0 8px; }
.kickedNotice p { color: var(--muted); margin: 0 0 20px; }
.kickedNotice button {
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.knockPulse { font-size: 46px; margin-bottom: 6px; animation: knockPulse 1.4s ease-in-out infinite; }
@keyframes knockPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ---- Knock-knock queue (broadcaster) ---- */
.knockPanel {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 72%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 8;
}
.knockCard {
  background: rgba(20, 24, 33, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: knockIn 0.18s ease-out;
}
@keyframes knockIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.knockInfo { flex: 1; min-width: 0; }
.knockName { font-size: 13.5px; font-weight: 600; }
.knockNote { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.knockCard.flagged { border-color: var(--danger); box-shadow: 0 6px 20px rgba(255, 91, 110, 0.35); }
.knockWarn { font-size: 12px; color: var(--danger); font-weight: 700; margin-top: 2px; }
.knockActions { display: flex; gap: 6px; flex-shrink: 0; }
.knockYes, .knockNo {
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.knockYes { background: #2ec16a; color: #06210f; }
.knockNo { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.knockYes:hover { filter: brightness(1.08); }
.knockNo:hover { background: rgba(255, 91, 110, 0.9); color: #fff; }

/* ---- Spotlight: one viewer enlarged, local to the host ---- */
.spotlight {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
#spotlightVideo { max-width: 100%; max-height: 100%; object-fit: contain; }
.spotlightLabel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.spotlightClose {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.spotlightClose:hover { background: rgba(255, 91, 110, 0.9); }

.tile .focusBtn {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.tile .focusBtn:hover { background: var(--accent); }

.clickable { cursor: pointer; }
.pip.clickable:hover { border-color: var(--accent); }

/* ---- Image in chat ---- */
.imgBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  margin: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.imgBtn:hover { border-color: var(--accent); }

/* Small thumbnail in chat — expands on click. */
.chatThumb {
  display: block;
  margin-top: 6px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.imgSummary {
  margin-top: 4px;
  font-size: 12px;
  color: #cfd6e2;
  cursor: pointer;
}

/* Expanded image view with reactions + comments. */
.imgView {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: grid;
  place-items: center;
  padding: 16px;
}
.imgViewPanel {
  position: relative;
  width: min(820px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.imgViewImg { width: 100%; max-height: 64vh; object-fit: contain; background: #000; }
.imgViewReactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.imgViewReactions button {
  font-size: 15px;
  line-height: 1;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
}
.imgViewReactions button.mine { border-color: var(--accent); background: #1b2233; }
.imgViewComments {
  flex: 1;
  min-height: 56px;
  max-height: 30vh;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.imgComment { font-size: 13.5px; line-height: 1.35; }
.imgComment .who { font-weight: 700; color: #9db8ff; margin-right: 6px; }
.imgViewForm { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.imgViewForm input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
}
.imgViewForm input:focus { outline: none; border-color: var(--accent); }
.imgViewForm button {
  border: none;
  border-radius: 999px;
  width: 42px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.imgViewClose {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* Reconnecting banner */
.reconnectBar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ---- Chat overlaid on the video ---- */
.chatOverlay {
  position: absolute;
  left: 12px;
  bottom: 76px;
  max-height: 58%;
  display: flex;
  align-items: flex-end;
  z-index: 6;
  pointer-events: none; /* let clicks pass through empty areas to the video */
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Collapsed to the left (mobile). Peeks back briefly when a message arrives. */
.stageWrap.chat-collapsed .chatOverlay {
  transform: translateX(-120%);
  opacity: 0;
}
.stageWrap.chat-collapsed.chat-peek .chatOverlay {
  transform: translateX(0);
  opacity: 1;
}

/* Drawer handles — clearly visible on any background (chat = left, videos = right). */
.chatToggle,
.videoToggle {
  position: absolute;
  bottom: 30%;
  width: 30px;
  height: 54px;
  background: rgba(40, 44, 54, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  z-index: 8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.chatToggle {
  left: 0;
  border-left: none;
  border-radius: 0 12px 12px 0;
}
.videoToggle {
  right: 0;
  border-right: none;
  border-radius: 12px 0 0 12px;
  bottom: 42%;
}

/* Small videos hidden to the right. */
.viewerGrid,
.pip {
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.stageWrap.videos-collapsed .viewerGrid,
.stageWrap.videos-collapsed .pip {
  transform: translateX(140%);
  opacity: 0;
  pointer-events: none;
}

/* Image download button (only when the room allows it). */
.imgViewDl {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
/* Deter casual saving when download isn't allowed (can't stop screenshots). */
.no-download {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.stageWrap.role-broadcaster .chatOverlay { right: 172px; } /* clear the filmstrip */
.stageWrap.role-viewer .chatOverlay { right: auto; width: min(66%, 520px); }

.messages {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 26px;
  /* fade the oldest messages at the top */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30px);
  mask-image: linear-gradient(to bottom, transparent, #000 30px);
  pointer-events: auto;
}
.msg {
  align-self: flex-start;
  max-width: 100%;
  background: rgba(0,0,0,0.5);
  padding: 6px 11px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
  word-break: break-word;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.msg .who { font-weight: 700; color: #9db8ff; margin-right: 6px; }
.msg.system { background: rgba(0,0,0,0.34); color: #cfd6e2; font-style: italic; font-size: 12.5px; }

/* ---- Floating bottom bar: reactions + input ---- */
.bottomBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px;
  z-index: 7;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
}
.reactions { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.reactions::-webkit-scrollbar { display: none; }
.reactions button { flex: 0 0 auto; }
.reactions button {
  font-size: 20px;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 7px 9px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.reactions button:hover { background: rgba(255,255,255,0.22); transform: translateY(-1px); }

.chatForm { flex: 1; display: flex; gap: 8px; min-width: 0; }
.chatForm input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.chatForm input::placeholder { color: rgba(255,255,255,0.6); }
.chatForm input:focus { outline: none; border-color: var(--accent); }
.chatForm button {
  border: none;
  border-radius: 999px;
  width: 44px;
  height: 42px;
  flex-shrink: 0;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

/* ---- Floating reactions ---- */
.reactionLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floatEmoji {
  position: absolute;
  bottom: 10%;
  font-size: 52px;
  animation: floatUp 4.2s ease-out forwards;
}
.floatEmoji .fname {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 1px 6px;
  border-radius: 6px;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  12%  { opacity: 1; transform: translateY(-14px) scale(1.15); }
  100% { transform: translateY(-340px) scale(1); opacity: 0; }
}
.reactImg { width: 26px; height: 26px; object-fit: contain; display: block; }
.floatImg { width: 68px; height: 68px; object-fit: contain; display: block; }
#camSelect { max-width: 132px; }

/* Phone-as-camera mode — fullscreen camera, only the flip button on top */
.camScreen { position: fixed; inset: 0; background: #000; z-index: 50; }
#camPreview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.camStatus {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 2;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.camFlipBtn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 26px;
  z-index: 2;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.camFlipBtn:active { background: rgba(255, 255, 255, 0.25); }

.camLinkOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  display: grid;
  place-items: center;
  padding: 20px;
}
.camLinkBox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  width: min(420px, 100%);
  text-align: center;
}
.camLinkBox h3 { margin: 0 0 8px; }
.camLinkBox p { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.camLinkBox input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 12px;
}
.camLinkBox button {
  margin: 4px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
.camLinkBox .primary { border: none; }

/* Reaction use-count badge (main bar). */
.reactions button { position: relative; }
.rcount {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.rcount.inline { position: static; display: inline-flex; margin-left: 5px; }

/* Image summary line (reactions + comments + downloads). */
.imgSummary { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; }
.sumItem { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: #cfd6e2; }
.sumImg { width: 16px; height: 16px; object-fit: contain; }
.imgDlInfo { padding: 6px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .stageArea { padding: 6px; }
  .pip { width: 96px; }
  .room { display: none; } /* free up space in the topbar */

  /* Top bar: shrink + wrap so it never overflows (no pinch-zoom / h-scroll). */
  .topbar { gap: 5px; padding: 8px; flex-wrap: wrap; }
  .topbar .spacer { display: none; }
  .ctrl { padding: 6px 8px; font-size: 14px; }
  .ctrl.leave { padding: 6px 9px; }
  .badge { padding: 3px 7px; font-size: 10px; }
  .count { font-size: 11px; margin-right: 0; }

  /* Two-row bottom bar: emoji (scrollable) on top, full-width input below. */
  .bottomBar { padding: 8px; gap: 8px; flex-wrap: wrap; }
  .reactions {
    order: 1;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .reactions::-webkit-scrollbar { display: none; }
  .reactions button { flex: 0 0 auto; padding: 6px 8px; font-size: 18px; }
  .chatForm { order: 2; flex-basis: 100%; }

  /* Lift the overlays above the taller two-row bar. */
  .chatOverlay { bottom: 112px; }
  .viewerGrid { width: 104px; bottom: 116px; }
  .tile { width: 104px; }
  .stageWrap.role-broadcaster .chatOverlay { right: 120px; }
  .stageWrap.role-viewer .chatOverlay { width: 80%; }
}

/* ---- Create/Join lobby ---- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1;
  padding: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.tab.active { border-color: var(--accent); color: var(--text); background: #1b2233; }
.pane { margin: 0; }
.primary {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 999px; /* Reddit pill */
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.primary:hover { background: #ff5414; }

/* Generated code + link box after creating a room */
.codeBox {
  margin-top: 12px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.codeBox .code {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.codeBox .small { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Face-blur toggle active state */
.ctrl.blurOn { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

