/* ==========================================================================
   泛同人放映室 (Fantren RTC) — 泛同人 F 站原版「香草金 (Vanilla Gold)」风格
   ========================================================================== */

:root {
  --primary: #00333d;           /* 深墨青主文字 */
  --primary-high: #1d4249;
  --secondary: #fcf9f2;         /* 香草金主底色 */
  --surface: #ffffff;           /* 纯白内容卡片 */
  --cream: #f1e9d5;             /* 奶黄色统计/状态条 */
  --cream-soft: #f6efe1;        /* 柔和奶油表头/次级底色 */
  --cream-pill: #ede6d3;        /* 分类胶囊默认底色 */
  --stage-bg: #f5efe0;          /* 房间舞台暖米底色 */

  --header-bg: #2f1a80;         /* 顶栏深紫 */
  --header-gold: #ffcf27;       /* 品牌明黄 */
  --accent-teal: #68c6b9;       /* 招牌薄荷绿 */
  --accent-teal-dark: #4fb0a3;
  --btn-red: #e74762;           /* 招牌红粉主按钮 */
  --btn-red-hover: #d83452;

  --success: #00a791;
  --success-bg: #e0faf5;
  --tertiary: #0088cc;
  --tertiary-bg: #e0f5ff;
  --purple-bg: #eee9ff;
  --highlight: #fcca46;
  --highlight-bg: #feefc8;
  --danger: #e74762;
  --danger-bg: #fbe3e7;

  --text-dark: #1f2d30;
  --text-muted: #6e8387;
  --text-warm: #796c54;
  --border-light: #e5dec9;
  --border-card: #ede4cf;
  --border-strong: #d8ceb5;

  --shadow-card: 0 4px 16px rgba(47, 26, 128, 0.045);
  --shadow-float: 0 8px 24px rgba(47, 26, 128, 0.12);
  --shadow-modal: 0 20px 50px rgba(0, 30, 38, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--secondary);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

a {
  color: var(--tertiary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Scrollbar (warm minimal) */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d7ccb3;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #bfb296;
}

/* ==================== FORM CONTROLS & BUTTONS ==================== */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--primary);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

input::placeholder, textarea::placeholder {
  color: #9aa7a9;
}

input:focus, select:focus, textarea:focus {
  background: #ffffff;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(104, 198, 185, 0.22);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--btn-red);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(231, 71, 98, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--btn-red-hover);
}

.btn-teal {
  background: var(--accent-teal);
  color: #ffffff;
}
.btn-teal:hover:not(:disabled) {
  background: var(--accent-teal-dark);
}

.btn-cream, .btn-secondary {
  background: var(--cream-pill);
  border-color: #dfd5be;
  color: var(--primary);
}
.btn-cream:hover:not(:disabled), .btn-secondary:hover:not(:disabled) {
  background: #e5dcc5;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--primary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--cream-soft);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: #f3b5c0;
  color: #c82342;
}
.btn-danger:hover:not(:disabled) {
  background: var(--btn-red);
  color: #ffffff;
}

/* Header-specific buttons on deep purple #2f1a80 */
.btn-header-red {
  background: var(--btn-red);
  color: #ffffff;
  border: none;
}
.btn-header-red:hover:not(:disabled) {
  background: var(--btn-red-hover);
}
.btn-header-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #f4eeff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-header-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn-lg {
  padding: 11px 26px;
  font-size: 15px;
  border-radius: 24px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-xs {
  padding: 3px 10px;
  font-size: 12px;
}

.icon-btn-sm, .icon-btn-xs {
  background: var(--cream-soft);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s;
}
.icon-btn-sm:hover, .icon-btn-xs:hover {
  background: var(--cream-pill);
}

.icon-btn-header {
  background: rgba(255, 207, 39, 0.18);
  border: 1px solid rgba(255, 207, 39, 0.45);
  color: var(--header-gold);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
.icon-btn-header:hover {
  background: rgba(255, 207, 39, 0.3);
}

.icon-btn-hud {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}
.icon-btn-hud:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ==================== BADGES & STATUS DOTS ==================== */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-lan {
  background: var(--success-bg);
  color: #007a6a;
  border: 1px solid #9fe5d9;
}
.badge-p2p {
  background: var(--tertiary-bg);
  color: #006da3;
  border: 1px solid #9fd8f5;
}
.badge-relay {
  background: var(--purple-bg);
  color: var(--header-bg);
  border: 1px solid #cfc2f7;
}
.badge-warn {
  background: var(--highlight-bg);
  color: #8f6200;
  border: 1px solid #eed283;
}
.badge-muted {
  background: var(--cream-soft);
  color: var(--text-warm);
  border: 1px solid var(--border-light);
}

.header-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--header-gold);
  background: rgba(255, 255, 255, 0.12);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-ok { background: var(--success); }
.dot-err { background: var(--danger); }
.dot-pending { background: #e09f1f; }

.cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--btn-red);
  display: inline-block;
  flex-shrink: 0;
}
.cat-dot-teal { background: var(--accent-teal); }
.cat-dot-purple { background: var(--header-bg); }

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-teal);
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  font-size: 13px;
  font-weight: 500;
  max-width: 460px;
  animation: toastIn 0.2s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-warn { border-left-color: #e09f1f; }
.toast-error { border-left-color: var(--btn-red); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== LOBBY VIEW (F站香草金经典布局) ==================== */
.view-lobby {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--secondary);
  overflow-y: auto;
}

.lobby-header {
  background: var(--header-bg);
  border-radius: 0 0 34px 34px;
  padding: 11px 28px;
  box-shadow: 0 4px 15px rgba(47, 26, 128, 0.22);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  color: #e6d9ff;
  background: rgba(255, 255, 255, 0.14);
  padding: 2px 10px;
  border-radius: 12px;
}

.lobby-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lobby-main {
  width: 100%;
  max-width: 1180px;
  margin: 24px auto 40px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 356px 1fr;
  gap: 22px;
  align-items: start;
}

.lobby-left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Friends & Live Rooms Card (Left Sidebar on Lobby) */
.friends-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.friends-card-head {
  background: var(--cream-soft);
  border-bottom: 1px solid #e7ddc7;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.friends-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
}
.friends-card-title h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary);
}
.my-code-pill {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--header-bg);
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background-color 0.15s, border-color 0.15s;
}
.my-code-pill:hover {
  background: #f2fdff;
  border-color: var(--accent-teal);
}
.friends-privacy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  background: var(--cream);
  border-bottom: 1px solid #eae5cd;
  font-size: 12.5px;
}
.privacy-check {
  font-size: 12.5px;
  font-weight: 600;
}
.privacy-hint {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--success-bg);
  color: #007a6a;
}
.privacy-hint.is-hidden {
  background: var(--highlight-bg);
  color: #8f6200;
}
.friends-add-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #f2ecdd;
}
.friends-add-row input {
  padding: 6px 10px;
  font-size: 12.5px;
}
.friend-requests-box {
  padding: 8px 12px;
  background: #fff9ec;
  border-bottom: 1px solid #efe2be;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.friend-req-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
}
.friend-req-actions {
  display: flex;
  gap: 4px;
}
.friends-list {
  max-height: 330px;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.friends-empty {
  text-align: center;
  padding: 20px 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--secondary);
  border: 1px solid var(--border-light);
  transition: border-color 0.15s, background-color 0.15s;
}
.friend-row:hover {
  border-color: var(--accent-teal);
  background: #ffffff;
}
.friend-avatar-box {
  position: relative;
  flex-shrink: 0;
}
.friend-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.friend-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #b8b3a6;
}
.friend-online-dot.online { background: var(--success); }
.friend-online-dot.in-room { background: var(--btn-red); }
.friend-main {
  min-width: 0;
  flex: 1;
}
.friend-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.friend-room-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--success-bg);
  color: #007a6a;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dm-unread-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--btn-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}
.header-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--header-gold);
  color: var(--header-bg);
  font-size: 11px;
  font-weight: 800;
}

/* F站经典薄荷绿标题栏 + 奶油白卡片 */
.lobby-card {
  background: var(--surface);
  border-radius: 20px 20px 16px 16px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.lobby-card-head {
  background: var(--accent-teal);
  padding: 18px 24px;
  color: #ffffff;
}
.lobby-card-head h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 5px;
  color: #ffffff;
}
.lobby-card-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #fcf9f2;
  font-weight: 500;
}

.lobby-card-body {
  padding: 22px 24px 24px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-warm);
}
.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn input, .input-with-btn select {
  flex: 1;
  min-width: 0;
}

/* F站经典奶黄色状态条 */
.station-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid #eae5cd;
  font-size: 12.5px;
  color: var(--primary);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mode-card {
  text-align: left;
  background: var(--secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-card:hover {
  border-color: var(--accent-teal);
  background: #ffffff;
}
.mode-card.active {
  background: #f2fdff;
  border: 1.5px solid var(--accent-teal);
  box-shadow: 0 2px 8px rgba(104, 198, 185, 0.16);
}
.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.mode-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
}
.mode-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 12px;
  background: var(--cream-pill);
  color: var(--text-warm);
}
.mode-card.active .mode-tag {
  background: var(--accent-teal);
  color: #ffffff;
}
.mode-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.lobby-submit-row {
  margin-top: 4px;
}
.lobby-submit-row .btn {
  width: 100%;
}

/* Right Info Panel */
.lobby-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.info-box {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.info-box-head {
  background: var(--cream-soft);
  border-bottom: 1px solid #e7ddc7;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-box-head h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary);
}
.info-box-body {
  padding: 15px 18px;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--primary-high);
}
.feature-list strong {
  color: var(--primary);
}
.info-muted {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}
.info-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== ROOM VIEW ==================== */
.view-room {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--stage-bg);
}

.room-topbar {
  height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--header-bg);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 3px 12px rgba(47, 26, 128, 0.2);
  flex-shrink: 0;
  z-index: 20;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-logo-mini {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.room-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 7px 4px 12px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
}

.station-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12px;
  color: #e9e0ff;
}
.rtt-tag {
  font-family: var(--font-mono);
  color: var(--header-gold);
  font-weight: 600;
  font-size: 11.5px;
}

.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 2px 6px 2px 10px;
}
.mode-switcher-label {
  font-size: 12px;
  color: #d6c8ff;
  white-space: nowrap;
}
.mode-switcher select {
  width: auto;
  border: none;
  background: transparent;
  padding: 3px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: none !important;
}
.mode-switcher select option {
  background: #ffffff;
  color: var(--primary);
}

/* Main Split */
.room-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.stage-area {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 80px;
  gap: 12px;
  background: var(--stage-bg);
  overflow: hidden;
}

/* Spotlight Screen Share */
.spotlight-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.screen-tab {
  padding: 5px 14px;
  border-radius: 18px;
  background: var(--cream-pill);
  border: 1px solid #dfd5be;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.15s;
}
.screen-tab.active, .screen-tab:hover {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #ffffff;
}

.spotlight-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #14181f;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 35, 42, 0.14);
}

.spotlight-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111419;
}
.spotlight-stage.cover-mode video {
  object-fit: cover;
}

.spotlight-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, rgba(16, 22, 32, 0.82) 0%, rgba(16, 22, 32, 0) 100%);
  color: #ffffff;
}
.spotlight-hud-info, .spotlight-hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--btn-red);
  box-shadow: 0 0 8px rgba(231, 71, 98, 0.75);
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.metrics-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 9px;
  border-radius: 99px;
}
.volume-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.volume-box input[type="range"] {
  width: 72px;
  padding: 0;
  border: none;
  accent-color: var(--accent-teal);
}

/* ==================== SCREEN SHARE LIVE REACTIONS ==================== */
.screen-reactions-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.floating-reaction {
  position: absolute;
  bottom: 58px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  animation: floatReactionUp 3.2s cubic-bezier(0.22, 0.72, 0.34, 1) forwards;
  will-change: transform, opacity;
}

.floating-reaction-emoji {
  font-size: 40px;
  line-height: 1.1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.floating-reaction-text {
  background: linear-gradient(135deg, #2f1a80, #4b2eb8);
  color: #ffcf27;
  border: 2px solid #ffcf27;
  border-radius: 18px;
  padding: 4px 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.floating-reaction-sticker {
  max-width: 96px;
  max-height: 96px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.floating-reaction-nick {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(16, 22, 32, 0.72);
  padding: 1px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

@keyframes floatReactionUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 16px) scale(0.55);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -26px) scale(1.08);
  }
  26% {
    opacity: 1;
    transform: translate(calc(-50% + var(--sway, 14px)), -72px) scale(1);
  }
  75% {
    opacity: 0.95;
    transform: translate(calc(-50% - var(--sway, 14px)), -230px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -310px) scale(0.88);
  }
}

.screen-reaction-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  background: rgba(20, 24, 34, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  border-radius: 99px;
  opacity: 0.86;
  transition: opacity 0.18s ease, background-color 0.18s ease;
  max-width: calc(100% - 20px);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.screen-reaction-bar:hover {
  opacity: 1;
  background: rgba(20, 24, 34, 0.92);
}

.react-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background-color 0.12s;
}
.react-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.22);
}

.react-text-btn {
  border: 1px solid rgba(255, 207, 39, 0.45);
  background: rgba(47, 26, 128, 0.72);
  color: #ffcf27;
  border-radius: 14px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, background-color 0.12s;
}
.react-text-btn:hover {
  background: #2f1a80;
  transform: scale(1.08);
}

.react-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 3px;
}

.react-sticker-toggle {
  border: 1px solid rgba(104, 198, 185, 0.65);
  background: rgba(104, 198, 185, 0.24);
  color: #ffffff;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}
.react-sticker-toggle:hover {
  background: var(--accent-teal);
}

.sticker-tray-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow-modal);
  z-index: 25;
}
.sticker-tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
}
.sticker-tray-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.sticker-thumb-btn {
  position: relative;
  border: 1px solid var(--border-light);
  background: var(--secondary);
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sticker-thumb-btn:hover {
  border-color: var(--accent-teal);
  transform: scale(1.04);
}
.sticker-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sticker-del-mini {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.sticker-thumb-btn:hover .sticker-del-mini {
  display: inline-flex;
}
.sticker-tray-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== FRIEND DM MODAL ==================== */
.dm-dialog {
  height: min(560px, 85vh);
}
.dm-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dm-status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--header-gold);
}
.dm-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dm-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.dm-invite-card {
  background: #ffffff;
  border: 1.5px solid var(--accent-teal);
  border-radius: 12px;
  padding: 10px 12px;
  width: 245px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 3px 10px rgba(104, 198, 185, 0.16);
}
.dm-invite-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #007a6a;
}
.dm-invite-room {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
}
.dm-invite-text {
  font-size: 12.5px;
  color: var(--text-muted);
}
.dm-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}
.dm-composer input {
  flex: 1;
  min-width: 0;
}

/* Participant Grid / Filmstrip */
.participant-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  grid-auto-rows: minmax(170px, 1fr);
  gap: 12px;
  overflow-y: auto;
  align-content: center;
}

.participant-grid.filmstrip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  height: 122px;
  align-content: stretch;
  padding-bottom: 2px;
}
.participant-grid.filmstrip .peer-tile {
  min-width: 185px;
  max-width: 210px;
  height: 100%;
  flex-shrink: 0;
}

.peer-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.peer-tile.speaking {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(0, 167, 145, 0.25);
}
.peer-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.peer-tile video.mirror {
  transform: scaleX(-1);
}

.peer-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.peer-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  border: 3px solid var(--secondary);
  box-shadow: 0 4px 12px rgba(0, 51, 61, 0.12);
}
.participant-grid.filmstrip .peer-avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.peer-tile-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.peer-tile-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.peer-name-pill {
  background: rgba(252, 249, 242, 0.92);
  border: 1px solid var(--border-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.peer-media-icons {
  display: flex;
  gap: 4px;
  font-size: 12px;
  background: rgba(252, 249, 242, 0.92);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 99px;
}

/* Alone Banner */
.alone-banner {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(500px, calc(100% - 32px));
}
.alone-banner-inner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-top: 3px solid var(--accent-teal);
  border-radius: var(--radius-md);
  padding: 16px 34px 16px 20px;
  text-align: center;
  box-shadow: var(--shadow-float);
}
.alone-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--cream-soft);
  color: var(--text-warm);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}
.alone-close-btn:hover {
  background: var(--btn-red);
  border-color: var(--btn-red);
  color: #ffffff;
}
.alone-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.alone-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.alone-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Bottom Floating Control Dock (F站暖白浮岛风格) */
.control-dock {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #e4d8bd;
  border-radius: 99px;
  box-shadow: var(--shadow-float);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  background: var(--cream-soft);
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.dock-btn:hover {
  background: var(--cream-pill);
}
.dock-btn.active {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}
.dock-btn-accent.active {
  background: var(--btn-red);
  border-color: var(--btn-red);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(231, 71, 98, 0.3);
}

.dock-split-group {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: #eaf8f6;
  border: 1px solid #a8dfd7;
  border-radius: 99px;
  padding: 2px;
}
.dock-split-group .dock-btn {
  background: transparent;
  border-color: transparent;
  padding: 6px 12px;
}
.dock-split-group .dock-btn:hover {
  background: rgba(104, 198, 185, 0.22);
}
.dock-split-group .dock-btn.active {
  background: var(--btn-red);
  color: #ffffff;
}
.dock-split-mic {
  background: var(--cream-soft);
  border-color: var(--border-light);
}
.dock-split-mic .dock-btn:hover {
  background: var(--cream-pill);
}
.dock-split-mic .dock-btn.active {
  background: var(--success);
  color: #ffffff;
}
.dock-btn-sub {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}
.dock-btn-sub:hover {
  background: rgba(0, 51, 61, 0.08);
}

/* ==================== RIGHT SIDEBAR ==================== */
.room-sidebar {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--secondary);
  border-left: 1px solid var(--border-light);
  transition: width 0.2s ease;
}
.room-sidebar.collapsed {
  width: 0;
  border-left: none;
  overflow: hidden;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream-soft);
  border-bottom: 1px solid var(--border-light);
  padding: 6px;
  gap: 6px;
}
.sidebar-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-warm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-tab.active {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 51, 61, 0.04);
}
.tab-badge {
  background: var(--btn-red);
  color: #ffffff;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  position: relative;
}
.sidebar-panel.active {
  display: flex;
}

/* Chat Feed */
.dropzone-overlay {
  position: absolute;
  inset: 10px;
  z-index: 20;
  background: rgba(252, 249, 242, 0.94);
  border: 2px dashed var(--accent-teal);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone-box {
  color: var(--primary);
  font-weight: 700;
  padding: 16px;
  text-align: center;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.chat-system {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-warm);
  padding: 3px 12px;
  background: var(--cream);
  border: 1px solid #eae5cd;
  border-radius: 99px;
  align-self: center;
}

.chat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 90%;
  align-self: flex-start;
}
.chat-item.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.chat-sender {
  color: var(--primary);
  font-weight: 600;
}
.chat-route-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--cream-soft);
  color: var(--text-warm);
}
.chat-route-tag.route-lan { color: #007a6a; background: var(--success-bg); }
.chat-route-tag.route-p2p { color: #006da3; background: var(--tertiary-bg); }
.chat-route-tag.route-turn { color: var(--header-bg); background: var(--purple-bg); }
.chat-route-tag.route-ws-relay { color: #8f6200; background: var(--highlight-bg); }

.chat-bubble {
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: 14px 14px 14px 4px;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 13.5px;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 51, 61, 0.04);
}
.chat-item.mine .chat-bubble {
  background: #e9f9f6;
  border-color: #b4e4dc;
  border-radius: 14px 14px 4px 14px;
}

/* File Cards in Chat */
.file-card {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 2px 6px rgba(0, 51, 61, 0.04);
}
.file-card-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--cream-soft);
}
.file-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.file-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.file-card-size {
  font-size: 11.5px;
  color: var(--text-muted);
}
.progress-track {
  height: 6px;
  background: var(--cream);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-teal);
  transition: width 0.12s;
}
.file-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-warm);
}

/* Chat Composer */
.emoji-popover {
  position: absolute;
  bottom: 96px;
  left: 12px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  box-shadow: var(--shadow-float);
  z-index: 15;
}
.emoji-popover span {
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  text-align: center;
}
.emoji-popover span:hover {
  background: var(--cream-soft);
}

.chat-composer {
  border-top: 1px solid var(--border-light);
  padding: 9px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #ffffff;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.composer-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}
.composer-input-row {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}
.composer-input-row textarea {
  resize: none;
  min-height: 38px;
  max-height: 110px;
  padding: 8px 10px;
  line-height: 1.4;
}

/* Peers & Telemetry List */
.peers-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--cream-soft);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-warm);
}
.peers-telemetry-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.telemetry-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 51, 61, 0.03);
}
.telemetry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.telemetry-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.telemetry-kv {
  background: var(--secondary);
  border: 1px solid #f0e9d7;
  padding: 5px 8px;
  border-radius: 8px;
}
.telemetry-kv strong {
  display: block;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* ==================== MODALS (F站紫顶奶油卡片弹窗) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 12, 48, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-sm { max-width: 440px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--header-bg);
  color: #ffffff;
}
.modal-header h2 {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
}
.modal-close {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--secondary);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.modal-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Station List */
.station-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.station-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--secondary);
  border: 1px solid var(--border-light);
}
.station-row.selected {
  border-color: var(--accent-teal);
  background: #f0fbf9;
}
.station-row-info {
  min-width: 0;
  flex: 1;
}
.station-row-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
}
.station-row-url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-row-actions {
  display: flex;
  gap: 6px;
}
.add-station-form {
  display: grid;
  grid-template-columns: 1fr 1.6fr 0.9fr auto;
  gap: 8px;
}

.section-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d5cbb4;
  border-radius: 99px;
  transition: 0.2s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider {
  background: var(--accent-teal);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--primary);
}
.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-teal);
}

.deploy-tip-box {
  background: var(--cream);
  border: 1px solid #eae5cd;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--primary);
}
.code-line {
  font-family: var(--font-mono);
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 6px 9px;
  border-radius: 6px;
  margin-top: 6px;
  color: var(--header-bg);
  font-size: 12px;
  word-break: break-all;
}

/* Diagnostics */
.diag-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.diag-placeholder {
  text-align: center;
  padding: 26px;
  color: var(--text-warm);
  background: var(--secondary);
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
}
.diag-item {
  background: var(--secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 11px 13px;
}
.diag-item.ok { border-left: 4px solid var(--success); }
.diag-item.warn { border-left: 4px solid #e09f1f; }
.diag-item.fail { border-left: 4px solid var(--btn-red); }
.diag-item-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
  margin-bottom: 4px;
}
.diag-item-detail {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Electron Native Screen Picker */
.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.picker-tabs {
  display: flex;
  gap: 6px;
}
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}
.source-card {
  background: var(--secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.source-card:hover {
  border-color: var(--accent-teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}
.source-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #14181f;
}
.source-label {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
}
.source-label img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.source-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Local Station Info Box */
.local-station-info {
  background: var(--secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lan-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Lightbox */
.lightbox-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.lightbox-wrap img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 12px;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-modal);
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--header-bg);
  color: #ffffff;
  cursor: pointer;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-float);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 960px) {
  .lobby-header {
    border-radius: 0 0 22px 22px;
    padding: 10px 16px;
  }
  .lobby-main {
    grid-template-columns: 1fr;
    margin-top: 16px;
    padding: 0 14px;
  }
  .add-station-form {
    grid-template-columns: 1fr;
  }
  .room-sidebar {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: min(350px, 92vw);
    box-shadow: -8px 0 24px rgba(0, 35, 42, 0.16);
  }
  .room-sidebar.collapsed {
    width: 0;
  }
  .mode-switcher-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .form-row-2, .mode-grid {
    grid-template-columns: 1fr;
  }
  .dock-label {
    display: none;
  }
  .brand-logo-img {
    height: 30px;
  }
}
