/* Shared bar-TV YouTube jukebox beside the board */

.jukebox-stage {
  max-width: none !important;
  width: 100% !important;
}

.jukebox-play-grid {
  display: grid;
  grid-template-columns: minmax(160px, 22%) minmax(0, 1fr) minmax(180px, 24%);
  gap: 0.45rem;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  height: 100%;
}

html.fit-viewport body.is-playing .jukebox-play-grid {
  height: 100%;
  min-height: 0;
}

html.fit-viewport body.is-playing .jukebox-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

html.fit-viewport body.is-playing .jukebox-play-grid .chess-canvas-wrap {
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}

.jukebox {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  min-height: 0;
  padding: 0.45rem;
  border-radius: 14px;
  background: rgba(10, 8, 6, 0.92);
  border: 1px solid rgba(255, 236, 210, 0.12);
  overflow: hidden;
}

.jukebox-kicker {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a89880;
  font-weight: 800;
}

.jukebox-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  flex: 0 0 auto;
}

.jukebox-frame-sm {
  aspect-ratio: 16 / 10;
  max-height: 140px;
}

.yt-host,
.yt-host iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.jukebox-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0.5rem;
  color: #a89880;
  font-size: 0.78rem;
  text-align: center;
  pointer-events: none;
}

.jukebox-now {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f2ebe0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jukebox-form {
  display: flex;
  gap: 0.3rem;
}

.jukebox-form input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 236, 210, 0.18);
  background: #1c1610;
  color: #f2ebe0;
  font-size: 0.72rem;
}

.jukebox-actions {
  display: flex;
  gap: 0.3rem;
}

.jukebox-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 7rem;
  overflow: auto;
  font-size: 0.7rem;
  color: #e8d9c0;
}

.jukebox-queue li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 236, 210, 0.08);
}

.jukebox-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.jukebox-log .moves {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-height: 5.5rem;
}

.jukebox .chat-log {
  max-height: 5rem;
}

.jukebox-analytics {
  position: static !important;
  margin-top: auto;
}

/* Side panel lives in the right TV column (not over the canvas) */
.jukebox .in-game-side {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  pointer-events: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.jukebox .in-game-side > * {
  pointer-events: auto;
}

@media (max-width: 900px) {
  .jukebox-play-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .jukebox-left {
    order: 2;
    max-height: 28vh;
  }
  .jukebox-play-grid > .chess-canvas-wrap {
    order: 1;
    min-height: 42vh;
  }
  .jukebox-right {
    order: 3;
    max-height: 34vh;
  }
}
