/* ══════════════════════════════════════════════════════════════════════
   style-overlays.css — connect overlay, multiview wall, scrollbar
   Load order: 4 of 4 (base → scanbar → cards → overlays)

   Sections:
     connect overlay      ~12   blurred backdrop, amber-top card, purple CTA
     multiview            ~68   full-screen wall: bar, grid, tiles, players, chat split
     scrollbar           ~178   slim dark webkit scrollbar
   ══════════════════════════════════════════════════════════════════════ */

/* ---------------- connect overlay ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 11, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.overlay-card h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
  margin: 0 0 14px;
}
.overlay-card p { color: var(--dim); font-size: 13.5px; }
.overlay-card code {
  font-family: var(--mono);
  color: var(--amber);
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.connect-btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  background: #9146ff;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  padding: 12px 28px;
  margin: 14px 0 6px;
  transition: box-shadow 0.15s;
}
.connect-btn:hover { box-shadow: 0 0 26px rgba(145, 70, 255, 0.6); }
.overlay-alt { font-size: 12px !important; color: var(--faint) !important; }
.overlay-err { color: var(--red) !important; font-family: var(--mono); font-size: 12px !important; }

/* ---------------- help overlay (? key) ---------------- */

.help-card { text-align: left; max-width: 560px; }
.help-card p { font-size: 12.5px; margin: 9px 0; line-height: 1.5; }
.help-card code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ---------------- multiview ---------------- */

.watch-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.watch-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.watch-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
}
.watch-title span { color: var(--amber); font-size: 12px; }
.watch-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.watch-close {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
}
.watch-close:hover { border-color: var(--red); color: var(--red); }

.watch-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px;
  padding: 10px;
  align-content: start;
}

.watch-tile {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.watch-tile.unmuted { border-color: var(--amber); box-shadow: 0 0 14px rgba(255, 179, 0, 0.25); }

.watch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}
.watch-name {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-name:hover { color: var(--amber); }
.watch-fav.faved { color: var(--amber); border-color: var(--amber); }

.watch-fav, .watch-mute, .watch-chat-btn, .watch-rm {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--dim);
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
}
.watch-fav:hover, .watch-mute:hover, .watch-chat-btn:hover { border-color: var(--amber); }
.watch-rm:hover { border-color: var(--red); color: var(--red); }

.watch-split { display: flex; }
.watch-body {
  aspect-ratio: 16 / 9;
  background: #000;
  flex: 1;
  min-width: 0;
  /* a lone (or span-2) tile must never push its bottom past the screen —
     the player letterboxes when the cap overrides 16:9 */
  max-height: calc(100vh - 150px);
}
.watch-chat { display: none; }
.watch-chat iframe { width: 100%; height: 100%; border: 0; display: block; }
.watch-chat-btn.active { border-color: var(--amber); color: var(--amber); }
.watch-tile.chat-open { grid-column: span 2; }
/* Twitch chat needs ~400px of height for its input + points row, and 340px
   of width (Twitch's native sidebar size) or the Drops panel clips */
.watch-tile.chat-open .watch-chat { display: block; width: 340px; min-height: 400px; }
@media (max-width: 720px) {
  /* span 2 in a one-column grid would overflow the wall */
  .watch-tile.chat-open { grid-column: auto; }
  .watch-tile.chat-open .watch-chat { width: 200px; }
}

/* ---------------- scrollbar ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
