/* ==========================================================================
   LyricBingo V2 — Host console (Spotify-style contained layout)
   ========================================================================== */

/* Host fills the main pane — no page-level scroll */
.lb-v2 .v2-main:has(.v2-host-pro) {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding-bottom: 20px !important;
  max-width: none !important;
}

.lb-v2 .v2-main:has(.v2-host-pro) .v2-top,
.lb-v2 .v2-main:has(.v2-host-pro) .v2-top-pro {
  display: none !important;
}

.v2-host-pro {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 16px;
  padding-bottom: 0 !important;
}

/* ── Top bar ── */
.v2-host-topbar {
  flex-shrink: 0;
  position: relative !important;
  top: auto !important;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px !important;
  border-radius: 12px !important;
  background: var(--pro-elevated, #181818) !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.v2-host-topbar h1 {
  font-family: var(--v2-font) !important;
  font-size: clamp(20px, 2.5vw, 28px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.v2-host-topbar p {
  color: var(--pro-muted, #b3b3b3) !important;
  font-size: 14px;
  line-height: 1.45;
}

.v2-event-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.v2-event-name-input {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.v2-host-utilitybar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v2-host-utilitybar .v2-validate-btn {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  border-radius: 500px !important;
}

.v2-icon-btn {
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  background: var(--pro-hover, #282828) !important;
  box-shadow: none !important;
}

.v2-icon-btn:hover {
  border-color: var(--pro-border-strong, rgba(255, 255, 255, 0.14)) !important;
  transform: none !important;
  box-shadow: none !important;
}

.v2-venue-launch {
  height: 44px !important;
  padding: 0 16px !important;
  border-radius: 500px !important;
  border: 1px solid var(--pro-border-strong, rgba(255, 255, 255, 0.14)) !important;
  background: transparent !important;
  color: var(--pro-text, #fff) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

.v2-venue-launch:hover {
  background: var(--pro-hover, #282828) !important;
  transform: none !important;
}

/* ── Two-column grid ── */
.v2-host-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch !important;
  overflow: hidden;
}

.v2-host-grid > * {
  min-height: 0;
}

/* Left column: scroll the whole deck (current song + controls + queue) */
.v2-performance-deck {
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.v2-performance-deck > .v2-current-song,
.v2-performance-deck > .v2-playback-console,
.v2-performance-deck > .v2-queue-panel {
  flex-shrink: 0;
}

.v2-performance-deck > .v2-queue-panel {
  display: block;
  overflow: visible;
  margin: 0 !important;
  min-height: auto;
}

.v2-queue-panel .v2-head {
  margin-bottom: 12px;
}

.v2-queue-panel .v2-command-queue,
.v2-queue-panel .v2-queue-list {
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: grid;
  gap: 8px;
}

/* Override beatdesk-v2.css max-height:58vh on host queue */
.v2-host-pro .v2-command-queue,
.v2-host-pro .v2-queue-list.v2-command-queue {
  max-height: none !important;
  overflow: visible !important;
}

.v2-queue-panel .v2-head h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  text-transform: none !important;
}

.v2-queue-panel .v2-head p {
  font-size: 13px;
  color: var(--pro-muted, #b3b3b3);
  margin: 4px 0 0;
}

/* Right column: scroll inside, match grid height */
.v2-game-status {
  position: relative !important;
  top: auto !important;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.v2-game-status > .v2-card {
  flex-shrink: 0;
}

.v2-game-status h2,
.v2-game-status h3 {
  font-size: 16px !important;
  font-weight: 700 !important;
  margin: 0 0 12px !important;
  text-transform: none !important;
  letter-spacing: -0.01em;
}

/* ── Cards: pro palette ── */
.v2-host-pro .v2-card {
  border-radius: 12px !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  background: var(--pro-elevated, #181818) !important;
  box-shadow: none !important;
  padding: 18px !important;
}

.v2-host-pro .v2-current-song {
  display: grid !important;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) !important;
  gap: 20px !important;
  align-items: center !important;
  min-height: auto !important;
  background: var(--pro-elevated, #181818) !important;
  padding: 20px !important;
}

.v2-current-copy h2 {
  font-size: clamp(24px, 3vw, 36px) !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em;
}

.v2-current-copy p {
  color: var(--pro-muted, #b3b3b3) !important;
  font-size: 15px !important;
}

.v2-current-art {
  min-height: 0 !important;
}

.v2-current-art .v2-turntable {
  width: 100% !important;
  max-width: 160px;
}

.v2-mini-eq {
  display: none;
}

.v2-deck-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.v2-deck-buttons .v2-btn {
  min-height: 44px !important;
  font-size: 13px !important;
}

.v2-setting-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.v2-setting span {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--pro-subtle, #6a6a6a) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.v2-volume-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08));
  color: var(--pro-muted, #b3b3b3);
  font-size: 13px;
  font-weight: 600;
}

.v2-audio-strip {
  margin-top: 14px;
  padding: 12px 14px !important;
  border-radius: 8px !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  background: var(--pro-card, #1e1e1e) !important;
  color: var(--pro-muted, #b3b3b3) !important;
  font-weight: 600 !important;
  font-size: 12px;
}

/* ── Status sidebar ── */
.v2-status-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}

.v2-status-grid div {
  padding: 12px !important;
  border-radius: 8px !important;
  background: var(--pro-card, #1e1e1e) !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
}

.v2-status-grid span {
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pro-subtle, #6a6a6a) !important;
}

.v2-status-grid strong {
  font-size: 16px !important;
  font-weight: 700 !important;
  margin-top: 4px;
  text-transform: none !important;
}

.v2-mini-history {
  gap: 6px;
}

.v2-mini-history div {
  padding: 10px 12px !important;
  border-radius: 8px !important;
  background: var(--pro-card, #1e1e1e) !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
}

.v2-mini-history strong {
  font-size: 14px;
}

.v2-mini-history small {
  color: var(--pro-muted, #b3b3b3);
  font-size: 12px;
}

/* ── Queue rows ── */
.v2-host-pro .v2-command-queue .v2-queue-row {
  grid-template-columns: 40px 36px minmax(0, 1fr) 80px auto !important;
  gap: 10px !important;
  min-height: 56px !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  background: var(--pro-card, #1e1e1e) !important;
  font-weight: 600 !important;
}

.v2-host-pro .v2-command-queue .v2-queue-row:hover {
  transform: none !important;
  background: var(--pro-hover, #282828) !important;
  border-color: var(--pro-border-strong, rgba(255, 255, 255, 0.14)) !important;
}

.v2-host-pro .v2-command-queue .v2-queue-row.is-now {
  border-color: var(--pro-accent, #1ed760) !important;
  background: var(--pro-accent-dim, rgba(30, 215, 96, 0.12)) !important;
  box-shadow: inset 3px 0 0 var(--pro-accent, #1ed760) !important;
}

.v2-host-pro .v2-command-queue .v2-queue-row.is-marked-played,
.v2-host-pro .v2-command-queue .v2-queue-row.is-done {
  background: var(--pro-hover, #282828) !important;
  border-color: var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: none !important;
  opacity: 0.75 !important;
}

.v2-queue-play {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: var(--pro-hover, #282828) !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  color: var(--pro-text, #fff) !important;
  font-size: 12px !important;
}

.v2-host-pro .v2-queue-row.is-now .v2-queue-play {
  background: var(--pro-accent, #1ed760) !important;
  color: var(--pro-accent-text, #000) !important;
  border-color: transparent !important;
}

.v2-queue-index {
  background: var(--pro-hover, #282828) !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.v2-host-pro .v2-queue-row.is-now .v2-queue-index {
  background: var(--pro-accent, #1ed760) !important;
  color: var(--pro-accent-text, #000) !important;
}

.v2-queue-song small {
  color: var(--pro-muted, #b3b3b3) !important;
}

.v2-command-queue em {
  font-style: normal !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pro-subtle, #6a6a6a) !important;
}

.v2-host-pro .v2-queue-row.is-now em {
  color: var(--pro-accent, #1ed760) !important;
}

.v2-queue-tools button {
  min-width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  background: var(--pro-hover, #282828) !important;
  font-size: 12px;
}

.v2-hint-preview span {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
  font-size: 18px !important;
  background: var(--pro-card, #1e1e1e) !important;
  border: 1px solid var(--pro-border, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: none !important;
}

.v2-hint-preview span.on {
  border-color: var(--pro-accent, #1ed760) !important;
  background: var(--pro-accent-dim, rgba(30, 215, 96, 0.14)) !important;
  transform: none !important;
}

/* Scrollbar — left deck + right sidebar */
.v2-performance-deck::-webkit-scrollbar,
.v2-game-status::-webkit-scrollbar {
  width: 8px;
}

.v2-performance-deck::-webkit-scrollbar-thumb,
.v2-game-status::-webkit-scrollbar-thumb {
  background: var(--pro-hover, #282828);
  border-radius: 999px;
}

@media (max-width: 1180px) {
  .lb-v2 .v2-main:has(.v2-host-pro) {
    overflow-y: auto !important;
  }

  .v2-host-pro {
    flex: none;
    min-height: min(100%, auto);
  }

  .v2-host-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .v2-performance-deck {
    overflow-y: auto !important;
    max-height: none;
  }

  .v2-performance-deck > .v2-queue-panel {
    min-height: auto;
    max-height: none;
  }

  .v2-game-status {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .v2-current-song {
    grid-template-columns: 1fr !important;
  }

  .v2-setting-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .v2-host-topbar {
    flex-direction: column;
  }

  .v2-deck-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .v2-setting-grid {
    grid-template-columns: 1fr;
  }

  .v2-host-pro .v2-command-queue .v2-queue-row {
    grid-template-columns: 36px minmax(0, 1fr) !important;
  }

  .v2-host-pro .v2-command-queue .v2-queue-index,
  .v2-host-pro .v2-command-queue em {
    display: none;
  }

  .v2-queue-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
