/* PlayShelly Stream — Twitch-inspired theme */
:root {
  --bg: #0e0e10;
  --bg-2: #18181b;
  --bg-3: #1f1f23;
  --bg-hover: #26262c;
  --border: #2f2f35;
  --text: #efeff1;
  --text-dim: #adadb8;
  --text-muted: #8f8f9a;
  --accent: #9147ff;
  --accent-hover: #a970ff;
  --pink: #fa1ed2;
  --red: #eb0400;
  --green: #00f593;
  --topbar-h: 50px;
  --sidebar-w: 240px;
  --chat-w: 340px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', Roobert, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }

/* === Top bar === */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  position: relative;
  z-index: 50;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand-icon {
  width: 30px; height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px;
}
.brand-text { font-size: 16px; letter-spacing: -0.3px; }
.brand-accent { color: var(--accent); margin-left: 2px; }

.nav { display: flex; gap: 6px; }
.nav-link {
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text-dim);
  font-weight: 600;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link-active { color: var(--text); }

.topbar-search input {
  width: 320px; max-width: 40vw;
  height: 30px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}
.topbar-search input:focus { border-color: var(--accent); }

.auth-area { display: flex; gap: 8px; align-items: center; }

/* === Language switcher === */
.lang-switcher { position: relative; }
.lang-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.lang-btn:hover { background: var(--bg-hover); color: var(--text); }
.lang-btn svg { display: block; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 160px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.lang-menu button:hover { background: var(--bg-hover); }
.lang-menu button.is-active {
  background: var(--bg-hover);
  color: var(--accent);
  font-weight: 700;
}
.lang-menu button.is-active::after {
  content: ' ✓';
  color: var(--accent);
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 6px 12px;
  height: 30px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--bg-hover);
  transition: background 0.12s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: #3a3a42; }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-pink { background: var(--bg-hover); }
.btn-pink:hover { background: #3a3a42; }
.btn-purple { background: var(--accent); }
.btn-purple:hover { background: var(--accent-hover); }
.btn-sm { height: 26px; padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; height: 36px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 4px;
  background: var(--bg-3); cursor: pointer;
}
.user-chip:hover { background: var(--bg-hover); }
.user-chip-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px;
}

/* === Layout === */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--chat-w);
  height: calc(100vh - var(--topbar-h));
}

/* === Sidebar === */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 0 16px 8px;
  text-transform: uppercase;
}
.channel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  cursor: pointer;
}
.channel-item:hover { background: var(--bg-hover); }
.channel-item-active { background: var(--bg-hover); }
.channel-avatar {
  position: relative;
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
}
.live-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--bg-2);
}
.channel-item.is-live .live-dot { background: var(--red); }
.channel-meta { flex: 1; min-width: 0; }
.channel-name { font-weight: 600; font-size: 14px; }
.channel-game { color: var(--text-dim); font-size: 12px; }
.channel-viewers { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.live-indicator {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  padding: 1px 4px; border-radius: 2px;
}
.live-indicator.is-live { background: var(--red); color: #fff; }
.viewer-count { font-size: 12px; color: var(--text-dim); }
.viewer-count::before { content: '● '; color: var(--red); font-size: 10px; }

/* === Content === */
.content {
  overflow-y: auto;
  padding: 0;
  background: var(--bg);
}
.player-wrap {
  background: #000;
  width: 100%;
}
.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.player-shell.offline video { opacity: 0; }
.offline-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a1f, #0e0e10);
}
.player-shell.offline .offline-overlay { display: flex; }
.offline-card { text-align: center; max-width: 380px; padding: 24px; }
.offline-icon { font-size: 64px; margin-bottom: 12px; }
.offline-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.offline-sub { color: var(--text-dim); font-size: 14px; }

.live-pill {
  position: absolute; top: 12px; left: 12px;
  background: var(--red); color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.live-pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: pulse 1.5s ease-in-out infinite;
}
.live-pill-sep { opacity: 0.6; }

/* === Player controls === */
.player-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 6px;
  height: 50px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  z-index: 4;
}
.player-shell:hover .player-controls,
.player-shell.is-active .player-controls,
.player-controls:focus-within { opacity: 1; pointer-events: auto; }
.player-shell.offline .player-controls { display: none; }

.ctrl-group { display: flex; align-items: center; gap: 4px; }

.ctrl-btn {
  background: transparent;
  border: 0;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ctrl-btn:hover { color: #d6c7ff; }
.ctrl-btn svg { display: block; }

.ctrl-volume-wrap {
  display: flex;
  align-items: center;
  position: relative;
}
.ctrl-volume {
  width: 0;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  outline: none;
  margin-left: 0;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.15s ease, margin 0.15s ease;
  cursor: pointer;
  vertical-align: middle;
}
.ctrl-volume-wrap:hover .ctrl-volume,
.ctrl-volume:focus { width: 80px; opacity: 1; margin-left: 6px; margin-right: 6px; }
.ctrl-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.ctrl-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

.ctrl-resolution {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 3px 7px;
  border-radius: 3px;
  margin-right: 4px;
  user-select: none;
}
.ctrl-resolution[hidden] { display: none; }

/* Quality picker (now in control bar) */
.quality-control { position: relative; }
.quality-control[hidden] { display: none; }
.quality-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: rgba(15, 15, 18, 0.97);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quality-menu[hidden] { display: none; }
.quality-menu button {
  background: transparent;
  border: 0;
  color: #fff;
  text-align: left;
  padding: 7px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.quality-menu button:hover { background: rgba(255,255,255,0.08); }
.quality-menu button.is-active {
  color: var(--accent);
  font-weight: 700;
}
.quality-menu button.is-active::after {
  content: '✓';
  color: var(--accent);
}
/* Theater mode — hide sidebars */
.layout.is-theater { grid-template-columns: 0 1fr 0; }
.layout.is-theater .sidebar,
.layout.is-theater .chat-panel { display: none; }

.quality-menu .q-tag {
  font-size: 9px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.info-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.info-left { display: flex; gap: 14px; align-items: flex-start; flex: 1; }
.info-avatar {
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 26px;
  border: 3px solid var(--accent-hover);
  flex-shrink: 0;
}
.info-text { min-width: 0; }
.info-title {
  font-size: 18px; font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis;
}
.info-channel { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.info-channel-name { font-weight: 700; color: var(--text); font-size: 18px; }
.info-game { color: var(--accent); font-weight: 600; font-size: 14px; }
.info-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  background: var(--bg-3);
  color: var(--text-dim);
  padding: 3px 10px;
  border-radius: 999px;
}
.info-right { display: flex; gap: 8px; }

.about-card {
  background: var(--bg-2);
  margin: 16px 24px;
  padding: 16px 20px;
  border-radius: 6px;
}
.about-title { font-weight: 700; margin-bottom: 8px; font-size: 16px; }
.about-text { color: var(--text-dim); margin: 0; line-height: 1.5; }

.about-bio {
  color: var(--text-dim);
  line-height: 1.55;
  white-space: pre-line;
  margin: 0 0 12px;
}
.about-bio:empty { display: none; }
.about-bio a { color: var(--accent); }
.about-bio a:hover { text-decoration: underline; }

.about-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.about-socials:empty { display: none; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  transition: background 0.12s, border-color 0.12s;
}
.social-link:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.social-link svg { width: 14px; height: 14px; }

/* Twitch-style panels: fixed 320px width, image keeps natural aspect ratio */
.about-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, 320px);
  gap: 16px;
  justify-content: start;
}
.about-panels:empty { display: none; }
.panel-card {
  width: 320px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.12s;
}
.panel-card:hover { opacity: 0.85; }
.panel-card-img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-3);
  border-radius: 4px;
}
.panel-card-img.is-empty {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 28px;
}
.panel-card-body { padding: 8px 0 0; }
.panel-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
  word-break: break-word;
}
.panel-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-word;
}

@media (max-width: 720px) {
  .about-panels { grid-template-columns: 1fr; }
  .panel-card { width: 100%; }
}

/* Streamer About editor */
.streamer-about {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.about-bio-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.about-bio-input:focus { border-color: var(--accent); }
.about-import { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.about-import-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.about-import-row .kick-url-input { flex: 1; }
.about-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Chat panel === */
.chat-panel {
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.chat-header {
  height: 44px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 13px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
/* Hide all scrollbars, keep scrolling functional */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
.chat-system {
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
  font-size: 12px;
}
.chat-line {
  padding: 4px 0;
  line-height: 1.45;
}
.chat-line .chat-name {
  font-weight: 700;
  cursor: pointer;
}
.chat-line .chat-name::after { content: ':'; color: var(--text); margin-right: 4px; }
.chat-line .chat-text { color: var(--text); }
.chat-line {
  position: relative;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0 -6px;
}
.chat-line:hover { background: rgba(255,255,255,0.03); }
.chat-line.is-streamer {
  background: linear-gradient(90deg, rgba(145,71,255,0.18), rgba(145,71,255,0.05) 60%, transparent);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.chat-line .streamer-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: 1px;
  text-transform: uppercase;
}
.chat-line .streamer-badge::before {
  content: '⭐';
  font-size: 9px;
}
.chat-line .reply-quote {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0 2px 10px;
  border-left: 2px solid var(--border);
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-line .reply-quote::before {
  content: '↩';
  margin-right: 2px;
}
.chat-line .reply-quote .reply-quote-user {
  color: var(--text-dim);
  font-weight: 600;
}
.chat-line .msg-actions {
  position: absolute;
  top: 2px;
  right: 4px;
  display: none;
  gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.chat-line:hover .msg-actions.is-streamer-view { display: flex; }
.chat-line .msg-actions button {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.chat-line .msg-actions button:hover { background: var(--bg-hover); color: var(--text); }
.chat-line .msg-actions .act-ban:hover { color: #ff6b6b; }

.chat-line .emote {
  height: 28px;
  vertical-align: middle;
  display: inline-block;
  font-size: 22px;
  line-height: 1;
  margin: 0 1px;
}

.chat-input-wrap {
  border-top: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
  position: relative;
}
.chat-locked {
  text-align: center;
  color: var(--text-dim);
  padding: 8px 4px;
  font-size: 13px;
}
.chat-locked-actions {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 8px;
}
.chat-input-box { display: flex; flex-direction: column; gap: 8px; }

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
}
.reply-bar[hidden] { display: none; }
.reply-bar-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}
.reply-bar-text strong { color: var(--text); margin: 0 4px; }
.reply-bar-preview { color: var(--text-muted); }
.reply-cancel {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  line-height: 1;
}
.reply-cancel:hover { background: var(--bg-hover); color: var(--text); }
.chat-input-row {
  position: relative;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: 4px;
  padding: 6px 36px 6px 8px;
  transition: border-color 0.12s ease;
}
.chat-input-row:focus-within { border-color: var(--accent); }
.chat-input-row textarea {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  resize: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  max-height: 120px;
}
.emoji-toggle {
  position: absolute; right: 6px; bottom: 4px;
  background: transparent; border: 0;
  width: 28px; height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
}
.emoji-toggle:hover { background: var(--bg-hover); }
.chat-actions-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.chat-error { color: #ff6b6b; font-size: 12px; flex: 1; }

.emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 10px;
  width: 320px;
  max-height: 280px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
  margin-bottom: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  z-index: 10;
}
.emoji-picker-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin: 6px 0 4px;
  letter-spacing: 1px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-cell {
  background: transparent; border: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  height: 34px;
}
.emoji-cell:hover { background: var(--bg-hover); }
.emoji-cell .emote-name {
  display: none;
}

/* === Modal === */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-2);
  width: 380px; max-width: 90vw;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 700; font-size: 18px; }
.modal-close {
  background: transparent; border: 0; color: var(--text-dim);
  font-size: 26px; cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-body label {
  display: flex; flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.modal-body input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  height: 36px;
}
.modal-body input:focus { border-color: var(--accent); }
.modal-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}
.modal-foot a { color: var(--accent); margin-left: 4px; }
.auth-error {
  color: #ff6b6b; font-size: 13px; min-height: 16px;
}

.modal.modal-wide { width: 460px; }

/* Streamer-only UI: hidden by default, shown when body.is-streamer */
.streamer-only { display: none !important; }
body.is-streamer .streamer-only { display: inline-flex !important; }

/* === Stream source picker === */
.streamer-source {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-status {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
}
.source-status strong { color: var(--accent); }
.source-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.source-option:hover { background: var(--bg-3); }
.source-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(145, 71, 255, 0.08);
}
.source-option input[type="radio"] {
  margin: 3px 0 0 0;
  accent-color: var(--accent);
}
.source-text { flex: 1; min-width: 0; }
.source-name { font-weight: 700; font-size: 14px; }
.source-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.kick-auto-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 2px;
  user-select: none;
}
.kick-auto-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.kick-auto-toggle:hover { color: var(--text); }

.kick-url-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 0;
}
.kick-url-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.kick-url-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 12px;
  outline: none;
  font-family: 'Consolas', 'Menlo', monospace;
}
.kick-url-input:focus { border-color: var(--accent); }
.kick-url-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.streamer-bans {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.streamer-bans-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.streamer-bans-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.ban-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.ban-row button {
  background: var(--bg-hover);
  border: 0;
  color: var(--text);
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.ban-row button:hover { background: var(--accent); }
.streamer-bans-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
}

/* === Responsive === */
@media (max-width: 1100px) {
  :root { --sidebar-w: 60px; --chat-w: 300px; }
  .sidebar-title, .channel-meta, .channel-viewers { display: none; }
  .channel-item { justify-content: center; }
  .nav, .topbar-search { display: none; }
}
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar { display: none; }
  .chat-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    height: 320px;
  }
}
