/* THOMZY.com — player.css (video stage + controls) */

.player-panel { background: linear-gradient(135deg, rgba(255,62,201,0.18), rgba(37,232,255,0.18)); }

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 3px ridge var(--yellow);
  box-shadow: 4px 4px 0 var(--violet);
  margin-bottom: 8px;
  overflow: hidden;
}

/* Inside the windowed player body: fill available space, no margin */
.wm-body-player .video-stage {
  flex: 1;
  min-height: 0;
  aspect-ratio: unset;
  margin-bottom: 0;
  border: none;
  box-shadow: none;
}
.video {
  width: 100%; height: 100%;
  display: block;
  background: #000;
  border: 0;
}
.video[hidden] { display: none; }
#yt-iframe-host {
  pointer-events: none; /* Disable interaction */
  transform: translateZ(0);
}
#yt-iframe-host iframe {
  /* Size/transform set by YouTubeAdapter._rescale(). The iframe stays at
     1920×1080 in the DOM so YouTube's internal scripts see a full-HD player
     and its ABR serves 1080p. The CSS transform scales it down visually to
     fill the container without affecting the iframe's own layout. */
  display: block; border: 0;
  pointer-events: none;
}
.video-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--yellow);
  font-family: var(--mono);
  text-align: center;
  background: repeating-linear-gradient(45deg, #111 0 8px, #1a0a2e 8px 16px);
}
.video-empty[hidden] { display: none; }
.video-stage.audio-mode .video {
  background: radial-gradient(circle at center, var(--violet), #000 70%);
}

/* "Now playing" art shown when there is no video frame (audio-only tracks,
   local uploads, soundcloud, bandcamp, etc.). Sits above the <video>/<iframe>
   layers but below #video-empty. */
.np-art {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, var(--violet), #000 75%);
  overflow: hidden;
}
.np-art[hidden] { display: none; }
.np-art::before {
  content: "";
  position: absolute; inset: -10%;
  background-image: var(--np-art-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.3) brightness(0.55);
  opacity: 0.85;
  z-index: 0;
}
.np-art img {
  position: relative;
  z-index: 1;
  max-width: 60%;
  max-height: 80%;
  object-fit: contain;
  border: 3px ridge var(--yellow);
  box-shadow: 4px 4px 0 var(--magenta), 0 0 24px rgba(0,0,0,0.6);
  background: #000;
  display: none;
}
.np-art img.has-src { display: block; }
.np-art-fallback {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  color: var(--yellow);
  font-size: 96px;
  text-shadow: 2px 2px 0 var(--magenta);
  display: none;
}
.np-art img:not(.has-src) ~ .np-art-fallback { display: block; }

.np-meta { margin-bottom: 6px; }

.np-title {
  font-size: 16px; font-weight: bold; color: var(--yellow);
  margin: 0 0 2px 0;
  text-shadow: 1px 1px 0 var(--magenta);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-artist { color: var(--cyan); margin: 0 0 4px 0; font-family: var(--mono); }
.np-time { color: var(--fg); margin: 0; font-family: var(--mono); font-size: 12px; }
.tag {
  display: inline-block;
  background: var(--violet); color: #000;
  padding: 0 6px; margin-left: 6px;
  font-size: 10px; border: 1px solid var(--yellow);
  text-transform: uppercase; font-weight: bold;
}

.seek {
  width: 100%;
  -webkit-appearance: none; appearance: none;
  height: 14px;
  background: #000;
  border: 2px inset var(--magenta);
  margin: 6px 0;
  cursor: pointer;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 18px; background: var(--yellow);
  border: 1px solid #000; cursor: grab;
}
.seek::-moz-range-thumb {
  width: 14px; height: 18px; background: var(--yellow);
  border: 1px solid #000; cursor: grab;
}

.controls {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  flex-wrap: wrap;
}

.btn {
  background: linear-gradient(180deg, #2a2a4a, #0a0a2a);
  color: var(--yellow);
  border: 2px outset var(--magenta);
  font-family: var(--mono);
  font-size: 14px; font-weight: bold;
  padding: 4px 10px; cursor: pointer;
  text-shadow: 1px 1px 0 #000;
}
.btn:hover { background: linear-gradient(180deg, var(--magenta), var(--violet)); color: #000; }
.btn:active { border-style: inset; }
.btn-big { font-size: 22px; padding: 4px 16px; }
.btn.small { font-size: 11px; padding: 2px 8px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.vol {
  flex: 1; min-width: 80px;
  -webkit-appearance: none; appearance: none;
  height: 10px; background: #000;
  border: 2px inset var(--cyan); cursor: pointer;
  margin-left: 8px;
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 14px; background: var(--cyan);
  border: 1px solid #000;
}
.vol::-moz-range-thumb {
  width: 10px; height: 14px; background: var(--cyan);
  border: 1px solid #000;
}

.audio-only {
  font-family: var(--mono); font-size: 11px;
  color: var(--yellow); background: #000;
  padding: 2px 6px; border: 2px outset var(--magenta);
  cursor: pointer; white-space: nowrap;
}
.audio-only input { vertical-align: middle; margin: 0 4px 0 0; }

.supported { line-height: 1.6; }

/* ===========================================================
   PERSISTENT PLAYER BAR (always visible at the bottom).
   =========================================================== */

:root { --player-bar-h: 64px; }
/* body padding handled by flex layout — player bar is fixed */

.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--player-bar-h);
  z-index: 200;
  display: grid;
  /* Spotify-like: 3 equal columns so the center is truly viewport-centered. */
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(10,10,35,0.96), rgba(26,10,46,0.98));
  border-top: 3px ridge var(--magenta);
  box-shadow: 0 -4px 0 var(--violet), 0 -8px 18px rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
body.no-effects .player-bar { backdrop-filter: none; }

/* Left cell groups thumb + meta together */
.pb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Thumb on the left */
.pb-thumb {
  position: relative;
  width: 48px; height: 48px; flex-shrink: 0;
  background: #000; border: 2px ridge var(--cyan);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  overflow: hidden;
}
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; display: none; }
.pb-thumb img.has-src { display: block; }
.pb-thumb .pb-thumb-fallback {
  font-size: 22px; color: var(--magenta);
  font-family: 'Comic Sans MS', sans-serif;
}
.pb-thumb img.has-src + .pb-thumb-fallback { display: none; }
.pb-thumb:hover { border-color: var(--magenta); }

/* Meta column */
.pb-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px; line-height: 1.1; }
.player-bar .np-title { font-size: 13px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .np-artist { font-size: 11px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .np-time { margin: 0; font-size: 10px; opacity: 0.85; }
.player-bar .tag { font-size: 9px; padding: 0 4px; margin-left: 4px; }

/* Center: controls + seek stacked, both centered in their grid cell (which is itself centered in the viewport) */
.pb-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; width: 100%; }
.pb-controls { display: flex; align-items: center; justify-content: center; gap: 6px; }
.pb-controls .btn { padding: 1px 8px; font-size: 12px; line-height: 1; }
.pb-controls .btn-big { font-size: 16px; padding: 1px 12px; }
.pb-seek { width: 100%; max-width: 600px; display: flex; align-items: center; gap: 8px; }
.pb-seek .seek { flex: 1; margin: 0; height: 8px; border-width: 1px; }
.pb-seek .seek::-webkit-slider-thumb { width: 10px; height: 14px; }
.pb-seek .seek::-moz-range-thumb { width: 10px; height: 14px; }
.pb-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.pb-time-dur { cursor: pointer; }
.pb-time-dur:hover { color: var(--yellow); }
.pb-time-dur.is-remaining { color: var(--magenta); }

/* Right: volume + extras, pushed to the far right */
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.pb-right .btn { padding: 1px 6px; font-size: 11px; line-height: 1; }
.pb-right .vol { width: 80px; flex: none; min-width: 0; margin-left: 0; height: 8px; }
.pb-right .audio-only { font-size: 10px; padding: 1px 4px; }
.pb-right .audio-only input { transform: scale(0.85); margin-right: 2px; }

/* Mobile */
@media (max-width: 880px) {
  :root { --player-bar-h: 110px; }
  .player-bar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 4px 8px;
    padding: 4px 8px;
  }
  .pb-thumb { width: 40px; height: 40px; }
  .pb-left { grid-row: 1; }
  .pb-center { grid-row: 2; }
  .pb-right { grid-row: 3; justify-content: space-between; }
  .pb-right .vol { flex: 1; }
}

/* ===========================================================
   DJ PANEL — collapsible mixer above the player bar
   =========================================================== */
.dj-panel {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--player-bar-h);
  max-height: 52vh;
  overflow-y: auto;
  z-index: 199;
  background: linear-gradient(160deg, rgba(14,6,34,0.99) 0%, rgba(6,14,28,0.99) 100%);
  border-top: 2px ridge var(--violet);
  box-shadow: 0 -4px 18px rgba(0,0,0,0.7);
  padding: 10px 14px;
}
.dj-panel[hidden] { display: none; }
.dj-panel .mixer-panel {
  margin: 0;
  border: 1px solid rgba(182,92,255,0.4);
}

/* DJ button in player bar */
.btn-dj { border-color: var(--violet); color: var(--violet); letter-spacing: 1px; }
.btn-dj.active {
  background: linear-gradient(180deg, var(--violet), var(--magenta));
  color: #000;
  border-style: inset;
  box-shadow: 0 0 8px var(--violet);
}

/* ===========================================================
   CHAPTERS PANEL (above player bar, like DJ panel)
   =========================================================== */
.chapters-panel {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--player-bar-h);
  max-height: 40vh;
  overflow-y: auto;
  z-index: 198;
  background: linear-gradient(160deg, rgba(10,6,30,0.99) 0%, rgba(6,10,24,0.99) 100%);
  border-top: 2px ridge var(--cyan);
  box-shadow: 0 -4px 14px rgba(0,0,0,0.7);
  padding: 6px 0;
}
.chapters-panel[hidden] { display: none; }

.chapters-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 16px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s;
}
.chapter-item:hover {
  background: rgba(37,232,255,0.1);
  color: var(--cyan);
}
.chapter-item.active {
  background: rgba(255,62,201,0.15);
  color: var(--yellow);
  border-left: 3px solid var(--magenta);
  padding-left: 13px;
}
.chapter-ts {
  color: var(--cyan);
  min-width: 44px;
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.85;
}
.chapter-item.active .chapter-ts { color: var(--magenta); opacity: 1; }
.chapter-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Chapters button in player bar */
.btn-chapters { border-color: var(--cyan); color: var(--cyan); }
.btn-chapters.active {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  color: #000;
  border-style: inset;
  box-shadow: 0 0 8px var(--cyan);
}

/* ── Salty Bet stream iframe ──────────────────────────────────────────────── */
#salty-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* Prevent iframes from stealing mouse events during window drag/resize */
.wm-dragging iframe,
.wm-resizing iframe {
  pointer-events: none;
}
