/* ==========================================================================
   BeatDesk Host Page — single clean layout (loads last)
   https://darren.marketing/playlists/*
   ========================================================================== */

.bd-host-page {
  --host-max: var(--p-max, 1120px);
  --host-pad: var(--p-gutter, 1.25rem);
  --host-radius: var(--p-radius-lg, 14px);
  --host-border: var(--p-border, rgba(255, 255, 255, 0.08));
  --host-surface: var(--p-surface, #12101c);
  --host-surface-2: var(--p-surface-2, #1a1628);
  --host-touch: 2.75rem;
}

/* ── Page background ── */

.bd-host-page .pb-16 {
  padding-bottom: 2rem !important;
  background: var(--ui-bg, #07040f);
}

.bd-host-page .pb-16::before {
  display: none;
}

/* ── HERO — reset broken grid / negative margins ── */

.bd-host-page .game-hero--detail {
  display: block !important;
  min-height: 0 !important;
  max-width: var(--host-max) !important;
  margin: 0 auto !important;
  padding: 1.25rem var(--host-pad) 0 !important;
  background: transparent !important;
  border: none !important;
  position: relative;
  z-index: 1;
}

.bd-host-page .game-hero--detail .game-hero-overlay {
  display: none !important;
}

.bd-host-page .game-hero--detail .relative.mx-auto {
  display: block !important;
  max-width: none !important;
  padding: 0 !important;
}

.bd-host-page .game-hero--detail .relative.mx-auto > a.inline-flex {
  display: inline-flex !important;
  padding: 0 0 1rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600;
  color: var(--bd-cream-muted) !important;
}

.bd-host-page .game-hero--detail .game-hero-bg {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: 140px !important;
  margin: 0 0 1rem !important;
  border-radius: var(--host-radius) !important;
  box-shadow: none !important;
  background-size: cover !important;
  background-position: center !important;
}

.bd-host-page .game-hero--detail .mt-5.flex {
  margin: 0 !important;
  padding: 0 !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 1.25rem !important;
  background: none !important;
  border: none !important;
}

.bd-host-page .game-hero--detail h1 {
  font-size: clamp(1.625rem, 4vw, 2.25rem) !important;
  line-height: 1.15 !important;
  margin: 0.5rem 0 0 !important;
}

.bd-host-page .game-hero--detail .mt-5.flex > div:last-child {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.625rem;
  width: 100%;
}

.bd-host-page .game-hero--detail .action-chip {
  min-height: 3rem !important;
  padding: 0.75rem 1.25rem !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  flex: 1 1 calc(50% - 0.5rem);
  justify-content: center;
}

.bd-host-page .game-hero--detail .action-chip:first-of-type {
  flex: 1 1 100%;
  background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 6px 24px var(--bd-violet-glow);
  min-height: 3.25rem !important;
  font-size: 1rem !important;
}

.bd-host-page .game-hero--detail .ui-icon-btn {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  .bd-host-page .game-hero--detail {
    display: grid !important;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto auto;
    column-gap: 1.5rem;
    row-gap: 0.75rem;
    align-items: start !important;
    padding-top: 1.5rem !important;
  }

  .bd-host-page .game-hero--detail .game-hero-bg {
    grid-column: 1;
    grid-row: 2;
    width: 200px !important;
    height: 200px !important;
    margin: 0 !important;
  }

  .bd-host-page .game-hero--detail .relative.mx-auto {
    display: contents !important;
  }

  .bd-host-page .game-hero--detail .relative.mx-auto > a.inline-flex {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .bd-host-page .game-hero--detail .mt-5.flex {
    grid-column: 2;
    grid-row: 2;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between;
    gap: 1.5rem !important;
  }

  .bd-host-page .game-hero--detail .mt-5.flex > div:last-child {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
  }

  .bd-host-page .game-hero--detail .action-chip {
    flex: 0 0 auto;
    min-width: 140px;
  }

  .bd-host-page .game-hero--detail .action-chip:first-of-type {
    flex: 0 0 auto;
    min-width: 180px;
  }
}

/* ── Console shell (one card) ── */

.bd-host-page .mx-auto.max-w-6xl {
  max-width: var(--host-max) !important;
  margin: 1.5rem auto 0 !important;
  padding: var(--host-pad) !important;
  background: var(--host-surface);
  border: 1px solid var(--host-border);
  border-radius: calc(var(--host-radius) + 4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.bd-host-page .mx-auto.max-w-6xl::before {
  content: "Host console";
  display: block;
  font-family: var(--ui-display, "Sora", sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-success, var(--bd-teal));
  margin-bottom: 1rem;
}

/* ── Player grid ── */

.bd-host-page .game-player.bd-host-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr) !important;
  gap: 1rem !important;
  align-items: stretch !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.bd-host-page .bd-host-grid .sp-queue,
.bd-host-page .bd-host-grid .sp-player {
  margin: 0 !important;
  max-width: none !important;
  border-radius: var(--host-radius) !important;
  border: 1px solid var(--host-border) !important;
  background: var(--host-surface-2) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 1rem !important;
}

.bd-host-page .bd-host-grid .sp-queue {
  order: 1;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 560px;
}

.bd-host-page .bd-host-grid .sp-player {
  order: 2;
  display: flex;
  flex-direction: column;
}

/* Queue */
.bd-host-page .sp-queue-head {
  flex-shrink: 0;
  margin-bottom: 0.75rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bd-host-page .sp-queue-title {
  font-size: 1rem !important;
  font-weight: 800 !important;
}

.bd-host-page .sp-queue-title::before {
  content: none;
}

.bd-host-page .sp-queue-sub {
  font-size: 0.8125rem !important;
  margin-top: 0.25rem;
}

.bd-host-page .sp-queue-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  max-height: none !important;
}

.bd-host-page .sp-queue-row {
  min-height: 2.75rem !important;
  padding: 0.625rem 0.75rem !important;
  border-radius: 10px !important;
  font-size: 0.875rem !important;
}

.bd-host-page .sp-queue-row--now {
  background: rgba(124, 58, 237, 0.2) !important;
  border: 1px solid var(--bd-teal) !important;
}

.bd-host-page .sp-queue-row--done {
  opacity: 0.35;
}

/* Player — centered now playing */
.bd-host-page .sp-player-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.bd-host-page .sp-brand {
  flex-shrink: 0;
}

.bd-host-page .sp-game-bar {
  flex: 1;
  max-width: 200px;
  height: 8px !important;
}

.bd-host-page .sp-game-bar-label {
  font-size: 0.75rem !important;
  font-weight: 700;
}

.bd-host-page .sp-player-body {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1.25rem !important;
  width: 100%;
  padding: 0.5rem 0 !important;
}

.bd-host-page .sp-player-panel {
  width: 100%;
  max-width: 420px;
  align-items: center !important;
}

.bd-host-page .sp-artwork {
  width: 200px !important;
  max-width: 200px !important;
  border-radius: 14px !important;
}

.bd-host-page .sp-letter {
  font-size: 4rem !important;
}

.bd-host-page .sp-track {
  text-align: center;
  width: 100%;
}

.bd-host-page .sp-track::before {
  content: "Now playing";
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bd-teal);
  margin-bottom: 0.375rem;
}

.bd-host-page .sp-title {
  font-size: 1.375rem !important;
  line-height: 1.2 !important;
}

.bd-host-page .sp-artist {
  font-size: 1rem !important;
  color: var(--bd-cream-muted) !important;
}

.bd-host-page .sp-status {
  font-size: 0.875rem !important;
  font-weight: 700;
  color: var(--bd-teal) !important;
  margin-top: 0.35rem;
}

/* Transport — clean row */
.bd-host-page .sp-controls {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100%;
  padding: 0.5rem 0 !important;
}

.bd-host-page .sp-ctrl--labeled,
.bd-host-page .sp-ctrl-play-wrap {
  min-width: 5rem !important;
  min-height: 4.5rem !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 12px !important;
  background: var(--host-surface-2) !important;
  border: 1px solid var(--host-border) !important;
  height: auto !important;
  width: auto !important;
}

.bd-host-page .sp-ctrl--ghost {
  width: auto !important;
  height: auto !important;
}

.bd-host-page .sp-ctrl--play {
  min-width: 5.5rem !important;
  min-height: 4.75rem !important;
  width: auto !important;
  height: auto !important;
}

.bd-host-page .sp-ctrl-label,
.bd-host-page .sp-ctrl-label--play {
  font-size: 0.6875rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

.bd-host-page .sp-scrubber {
  width: 100%;
  max-width: 400px;
}

/* Actions row */
.bd-host-page .sp-player-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem !important;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding-top: 1rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bd-host-page .sp-autodj {
  grid-column: 1 / -1;
}

.bd-host-page .sp-autodj-btn {
  width: 100%;
  min-height: 3rem !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
}

.bd-host-page .sp-volume {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  background: var(--host-surface-2);
  border: 1px solid var(--host-border);
  max-width: none !important;
}

.bd-host-page .sp-volume::before {
  content: "Volume";
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--bd-cream-muted);
  min-width: 4rem;
}

.bd-host-page .sp-vol-btn {
  width: 2.75rem !important;
  height: 2.75rem !important;
}

.bd-host-page .sp-vol-slider {
  flex: 1;
  height: 8px !important;
}

.bd-host-page .sp-options {
  width: 100%;
  max-width: 420px;
  margin: 0.75rem auto 0;
}

.bd-host-page .sp-options summary {
  min-height: 2.75rem;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 10px;
  background: var(--host-surface-2);
  border: 1px solid var(--host-border);
  list-style: none;
  display: flex;
  align-items: center;
}

.bd-host-page .sp-options summary::-webkit-details-marker {
  display: none;
}

/* ── Mobile ── */

@media (max-width: 900px) {
  .bd-host-page .game-player.bd-host-grid {
    grid-template-columns: 1fr !important;
  }

  .bd-host-page .bd-host-grid .sp-player {
    order: 1;
    min-height: auto;
  }

  .bd-host-page .bd-host-grid .sp-queue {
    order: 2;
    min-height: 240px;
    max-height: 320px;
  }

  .bd-host-page .mx-auto.max-w-6xl {
    margin-top: 1rem !important;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom)) !important;
  }
}

/* Mobile dock */
.bd-host-dock {
  display: none;
}

@media (max-width: 900px) {
  .bd-host-dock {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    padding: 0.625rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom));
    background: rgba(7, 4, 15, 0.97);
    border-top: 1px solid var(--host-border);
    backdrop-filter: blur(12px);
  }

  .bd-host-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 3.25rem;
    border-radius: 10px;
    border: 1px solid var(--host-border);
    background: var(--host-surface-2);
    color: var(--bd-cream);
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
  }

  .bd-host-dock-btn svg {
    width: 1.125rem;
    height: 1.125rem;
  }

  .bd-host-dock-btn--play {
    background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark));
    border-color: transparent;
    color: #fff;
  }
}

/* ── Kill conflicting legacy layers on this page ── */

.bd-host-page .bd-host-intro,
.bd-host-page .bd-stage,
.bd-host-page .bd-status-bar,
.bd-host-page .bd-game-dock {
  display: none !important;
}

.bd-host-page .game-player {
  position: static !important;
  top: auto !important;
}

/* Focus */
.bd-host-page button:focus-visible,
.bd-host-page .sp-ctrl:focus-visible {
  outline: 3px solid var(--bd-teal);
  outline-offset: 2px;
}

.bd-host-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Override player-ui grid at all breakpoints */
.bd-host-page .game-player.bd-host-grid {
  display: grid !important;
}

@media (min-width: 1024px) {
  .bd-host-page .game-player.bd-host-grid {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr) !important;
  }
}

/* ==========================================================================
   Control-room redesign (v2) — clean stage + prominent Auto DJ + countdown
   These rules load last and intentionally override the layout above.
   ========================================================================== */

.bd-host-page .game-player.bd-host-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px) !important;
  gap: 1.25rem !important;
  align-items: start !important;
}

@media (min-width: 1024px) {
  .bd-host-page .game-player.bd-host-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px) !important;
  }
}

/* Player = main stage (left); queue = sidebar (right) */
.bd-host-page .bd-host-grid .sp-player {
  order: 1 !important;
  padding: 1.25rem 1.25rem 1.5rem !important;
  background: radial-gradient(
      120% 80% at 50% 0%,
      rgba(124, 58, 237, 0.14),
      transparent 60%
    ),
    var(--host-surface-2) !important;
}

.bd-host-page .bd-host-grid .sp-queue {
  order: 2 !important;
  position: sticky;
  top: 1rem;
  min-height: 0;
  max-height: min(72vh, 640px);
}

/* ── Now-playing stage ── */
.bd-host-page .sp-player-body {
  gap: 1rem !important;
  padding: 0.75rem 0 0.25rem !important;
}

.bd-host-page .sp-artwork {
  width: 168px !important;
  max-width: 168px !important;
  aspect-ratio: 1 / 1;
  box-shadow: 0 14px 40px rgba(124, 58, 237, 0.3);
}

.bd-host-page .sp-artwork--live {
  animation: bdHostPulse 1.8s ease-in-out infinite;
}

@keyframes bdHostPulse {
  0%, 100% { box-shadow: 0 14px 40px rgba(124, 58, 237, 0.3); }
  50% { box-shadow: 0 18px 56px rgba(45, 212, 191, 0.45); }
}

.bd-host-page .sp-title {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
}

/* ── Between-song countdown — make it a hero element ── */
.bd-host-page .sp-countdown {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.bd-host-page .sp-countdown-ring {
  width: 168px !important;
  height: 168px !important;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--bd-teal) calc(var(--pct, 0) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
}

.bd-host-page .sp-countdown-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--host-surface, #12101c);
}

.bd-host-page .sp-countdown-num {
  position: relative;
  z-index: 1;
  font-size: 3.25rem !important;
  font-weight: 900 !important;
  line-height: 1;
  color: #fff !important;
}

.bd-host-page .sp-countdown-unit {
  position: relative;
  z-index: 1;
  font-size: 0.75rem !important;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bd-teal) !important;
}

.bd-host-page .sp-countdown-copy {
  text-align: center;
}

.bd-host-page .bde-gap-countdown {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(18, 16, 28, 0.92);
  backdrop-filter: blur(6px);
}

.bd-host-page .bde-gap-countdown .sp-countdown {
  width: 100%;
}

.bd-host-page .game-player.bd-autodj-on .sp-status {
  color: var(--bd-teal) !important;
}

.bd-host-page .sp-countdown-label {
  font-size: 0.6875rem !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bd-cream-muted) !important;
}

.bd-host-page .sp-upnext {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 12px;
  background: var(--host-surface-2);
  border: 1px solid var(--host-border);
}

.bd-host-page .sp-upnext-badge {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark));
  color: #fff;
}

.bd-host-page .sp-upnext-kicker {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bd-cream-muted);
}

.bd-host-page .sp-upnext-title {
  display: block;
  font-weight: 700;
}

/* ── Transport row ── */
.bd-host-page .sp-controls {
  gap: 1rem !important;
  padding: 0.75rem 0 0.25rem !important;
}

.bd-host-page .sp-ctrl--play {
  min-width: 6rem !important;
  min-height: 5rem !important;
  background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 10px 30px var(--bd-violet-glow);
}

/* ── Auto DJ — primary toggle ── */
.bd-host-page .sp-player-actions {
  gap: 0.625rem !important;
  padding-top: 0.875rem !important;
}

.bd-host-page .sp-autodj-btn {
  min-height: 3.25rem !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--bd-teal), #0ea5a5) !important;
  border: none !important;
  color: #04201d !important;
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.35);
}

.bd-host-page .sp-autodj-btn--stop {
  background: linear-gradient(135deg, #f43f5e, #b91c40) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.35);
}

.bd-host-page .sp-autodj-btn:disabled {
  filter: grayscale(0.6);
  opacity: 0.55;
}

/* ── Surfaced settings (clip length + pause between songs) ── */
.bd-host-page .sp-options.sp-options--surfaced {
  max-width: 460px;
  border: 1px solid var(--host-border);
  border-radius: 12px;
  background: var(--host-surface-2);
  padding: 0.25rem 0.875rem 0.875rem;
}

.bd-host-page .sp-options--surfaced > summary {
  background: none !important;
  border: none !important;
  padding: 0.625rem 0 0.375rem !important;
  min-height: 0 !important;
  font-size: 0.6875rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bd-cream-muted) !important;
  cursor: default;
  pointer-events: none;
}

.bd-host-page .sp-options--surfaced .sp-options-body {
  display: flex !important;
  flex-direction: column;
  gap: 0.75rem;
}

.bd-host-page .sp-opt-row {
  display: flex !important;
  flex-direction: column;
  gap: 0.4rem;
}

.bd-host-page .sp-opt-label {
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  color: var(--bd-cream) !important;
}

.bd-host-page .sp-opt-row--gap .sp-opt-label::after {
  content: " — sets the countdown";
  font-weight: 600;
  color: var(--bd-cream-muted);
}

.bd-host-page .sp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bd-host-page .sp-pill {
  min-height: 2.25rem !important;
  padding: 0 0.875rem !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  border: 1px solid var(--host-border) !important;
  background: var(--host-surface) !important;
}

.bd-host-page .sp-pill--on {
  background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.bd-host-page .sp-select {
  min-height: 2.5rem !important;
  border-radius: 10px !important;
  background: var(--host-surface) !important;
  border: 1px solid var(--host-border) !important;
  padding: 0 0.75rem !important;
  font-weight: 700 !important;
}

/* ── Host-console "Run the music" playback panel ── */
.bd-host-page .bd-control-step--playback {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(45, 212, 191, 0.08));
  border: 1px solid var(--host-border);
  border-radius: var(--host-radius, 14px);
  padding: 1rem;
  margin-bottom: 1rem;
}

.bd-host-page #bd-host-console-playback .bd-host-action-grid--2 {
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

@media (max-width: 640px) {
  .bd-host-page .game-player.bd-host-grid {
    grid-template-columns: 1fr !important;
  }
  .bd-host-page .bd-host-grid .sp-queue {
    position: static;
    order: 2 !important;
  }
  .bd-host-page .sp-options.sp-options--surfaced {
    max-width: none;
  }
}

/* ==========================================================================
   Host console — flat sections (no nested cards)
   ========================================================================== */

.bd-host-page #bd-host-console .bd-host-console-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bd-host-page #bd-host-console .bd-host-console-top {
  margin-bottom: 0.75rem;
}

.bd-host-page #bd-host-console .bd-host-section {
  padding: 0.875rem 0;
  border: none;
  border-top: 1px solid var(--host-border);
  border-radius: 0;
  background: transparent;
}

.bd-host-page #bd-host-console .bd-host-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.bd-host-page #bd-host-console .bd-host-section--music {
  background: transparent;
  border-color: var(--host-border);
}

.bd-host-page #bd-host-console .bd-host-section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bd-cream-muted);
  margin: 0 0 0.625rem;
}

.bd-host-page #bd-host-console .bd-host-section-hint {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: var(--bd-cream-muted);
}

/* Legacy aliases */
.bd-host-page #bd-host-console .bd-host-block-label,
.bd-host-page #bd-host-console .bd-host-block-hint {
  display: none;
}

.bd-host-page #bd-host-console .bd-control-header--deck {
  display: none;
}

/* Live badge — compact inline pill */
.bd-host-page #bd-host-console-badge .bd-control-live-badge,
.bd-host-page #bd-host-console-badge .bd-host-console-badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--host-surface-2);
  border: 1px solid var(--host-border);
  font-size: 0.8125rem;
  font-weight: 700;
}

.bd-host-page #bd-host-console-badge .bd-control-live-badge.is-live {
  border-color: rgba(45, 212, 191, 0.5);
  background: rgba(45, 212, 191, 0.12);
}

.bd-host-page #bd-host-console-badge .bd-host-console-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--bd-teal);
}

.bd-host-page #bd-host-console-badge .bd-host-console-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--bd-teal);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6);
  animation: bdHostDot 1.6s ease-out infinite;
}

@keyframes bdHostDot {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0); }
}

.bd-host-page #bd-host-console-badge .bd-control-live-room {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.bd-host-page #bd-host-console-badge .bd-control-live-room-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bd-cream-muted);
}

.bd-host-page #bd-host-console-badge .bd-host-console-badge-code {
  font-family: var(--ui-mono, ui-monospace, monospace);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: #fff;
}

/* Blocks — kept for older markup; flat sections override above */
.bd-host-page #bd-host-console .bd-host-block {
  border: none;
  border-top: 1px solid var(--host-border);
  border-radius: 0;
  background: transparent;
  padding: 0.875rem 0;
}

.bd-host-page #bd-host-console .bd-host-block--music {
  background: transparent;
  border-color: var(--host-border);
}

.bd-host-page #bd-host-console .bd-host-block-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bd-cream-muted);
  margin-bottom: 0.625rem;
}

.bd-host-page #bd-host-console .bd-host-block-hint {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: var(--bd-cream-muted);
}

/* Action grids */
.bd-host-page #bd-host-console .bd-host-action-grid {
  display: grid;
  gap: 0.5rem;
}

.bd-host-page #bd-host-console .bd-host-action-grid--2 {
  grid-template-columns: 1fr 1fr;
}

.bd-host-page #bd-host-console .bd-host-action-grid--music {
  grid-template-columns: repeat(3, 1fr);
}

.bd-host-page #bd-host-console .bd-host-action-grid--music > [data-action="player-autodj"] {
  grid-column: 1 / -1;
}

.bd-host-page #bd-host-console .bd-host-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.9rem;
  padding: 0 0.75rem;
  border-radius: 11px;
  border: 1px solid var(--host-border);
  background: var(--host-surface);
  color: var(--bd-cream);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.bd-host-page #bd-host-console .bd-host-action:hover { filter: brightness(1.08); }
.bd-host-page #bd-host-console .bd-host-action:active { transform: translateY(1px); }

.bd-host-page #bd-host-console .bd-host-action__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.bd-host-page #bd-host-console .bd-host-btn--accent {
  background: linear-gradient(135deg, var(--bd-teal), #0ea5a5);
  border-color: transparent;
  color: #04201d;
}

.bd-host-page #bd-host-console .bd-host-btn--primary {
  background: linear-gradient(135deg, var(--bd-violet), var(--bd-violet-dark));
  border-color: transparent;
  color: #fff;
}

.bd-host-page #bd-host-console .bd-host-btn--winner {
  background: linear-gradient(135deg, #f7b733, #fc8a3a);
  border-color: transparent;
  color: #2b1500;
}

.bd-host-page #bd-host-console .bd-host-btn--danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4b4;
}

.bd-host-page #bd-host-console .bd-host-btn--locked {
  opacity: 0.7;
}

/* Win pattern board */
.bd-host-page #bd-host-console .bd-host-pattern-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 0.5rem;
}

.bd-host-page #bd-host-console .bd-host-pattern-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--host-border);
  background: var(--host-surface);
  color: var(--bd-cream);
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
}

.bd-host-page #bd-host-console .bd-host-pattern-tile.is-active {
  border-color: var(--bd-teal);
  background: rgba(45, 212, 191, 0.14);
  color: #fff;
}

.bd-host-page #bd-host-console .bd-host-pattern-hint {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: var(--bd-cream-muted);
}

.bd-host-page #bd-host-console .bd-host-block--game .bd-host-action-grid--2 {
  margin-top: 0.875rem;
}

/* Collapsible (sponsors + players) */
.bd-host-page #bd-host-console .bd-host-collapse-summary,
.bd-host-page #bd-host-console .bd-host-players-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--bd-cream);
}

.bd-host-page #bd-host-console .bd-host-collapse-summary::-webkit-details-marker,
.bd-host-page #bd-host-console .bd-host-players-summary::-webkit-details-marker {
  display: none;
}

.bd-host-page #bd-host-console .bd-host-collapse-summary::after,
.bd-host-page #bd-host-console .bd-host-players-summary::after {
  content: "▾";
  color: var(--bd-cream-muted);
  transition: transform 0.15s ease;
}

.bd-host-page #bd-host-console details[open] > .bd-host-collapse-summary::after,
.bd-host-page #bd-host-console details[open] > .bd-host-players-summary::after {
  transform: rotate(180deg);
}

.bd-host-page #bd-host-console .bd-host-collapse-hint {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bd-cream-muted);
  margin-left: auto;
  margin-right: 0.5rem;
}

.bd-host-page #bd-host-console .bd-host-players-details,
.bd-host-page #bd-host-console details.bd-host-console-panel--sponsors {
  border: 1px solid var(--host-border);
  border-radius: var(--host-radius, 14px);
  background: var(--host-surface-2);
  padding: 0.875rem;
}

.bd-host-page #bd-host-console .bd-host-players-details {
  border: none;
  background: none;
  padding: 0;
  margin-top: 0.875rem;
}

.bd-host-page #bd-host-console .bd-host-console-note {
  font-size: 0.8125rem;
  color: var(--bd-cream-muted);
  margin: 0.5rem 0;
}

.bd-host-page #bd-host-console .bd-sponsor-picks {
  display: grid;
  gap: 0.5rem;
}

.bd-host-page #bd-host-console .bd-host-players-list {
  list-style: none;
  margin: 0.625rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bd-host-page #bd-host-console .bd-host-player {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--host-surface);
  font-size: 0.8125rem;
}

.bd-host-page #bd-host-console .bd-host-players-empty {
  font-size: 0.8125rem;
  color: var(--bd-cream-muted);
}

@media (max-width: 640px) {
  .bd-host-page #bd-host-console .bd-host-action-grid--music {
    grid-template-columns: repeat(3, 1fr);
  }
  .bd-host-page #bd-host-console .bd-host-action {
    font-size: 0.8125rem;
    padding: 0 0.5rem;
  }
}

/* ==========================================================================
   Control rail — host console sits to the RIGHT of the player + song queue
   (desktop only; stacks below on narrow screens)
   ========================================================================== */

@media (min-width: 1100px) {
  .bd-host-page .mx-auto.max-w-6xl:has(#bd-host-console) {
    max-width: 1340px !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-auto-rows: min-content;
    column-gap: 1.5rem;
    align-items: start;
  }

  /* "Host console" kicker label spans the full width above both columns */
  .bd-host-page .mx-auto.max-w-6xl::before {
    grid-column: 1 / -1;
  }

  /* Left zone: existing player | queue grid stays intact */
  .bd-host-page .game-player.bd-host-grid {
    grid-column: 1;
    grid-row: 2;
  }

  /* Right zone: the control rail, pinned while the queue scrolls */
  .bd-host-page #bd-host-console {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: 1rem;
    margin-top: 0 !important;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Rail is narrow — keep paired buttons readable */
  .bd-host-page #bd-host-console .bd-host-section,
  .bd-host-page #bd-host-console .bd-host-block {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1100px) and (max-width: 1280px) {
  .bd-host-page .mx-auto.max-w-6xl:has(#bd-host-console) {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
