/* -------------------------------------------------------
   LIGHT / DARK MODE HANDLING
--------------------------------------------------------*/
:root[data-theme='light'] {
  --jukebox_border: #4b6f7c80;
  --jukebox_text-color: #2b3a42;
  --jukebox_box-shadow: 0 0 14px rgba(100, 150, 170, 0.15);
  --jukebox_skip-button: #dceef58c;
  --jukebox_skip-button--hover: #FDFEFE;
  --jukebox_quote-bg: #dceef58c;
  --jukebox_desc-bg: rgba(255, 255, 255, 0.041);
  --jukebox_details-bottom: #64aeee;
  --jukebox_track-title-underline: #ef5a5abd;
  --jukebox_toggle-button: rgba(76, 120, 140, 0.45);
  --jukebox_progress-bar: linear-gradient(to right, #c7e2f0, #57aedd);
  --jukebox_progress-bar-container: #eef6f9;
  --jukebox_wren-overlay: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.035) 0%, transparent 65%),
    linear-gradient(to right, rgba(190, 220, 240, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(160, 210, 235, 0.28) 2px, transparent 2px);
  --jukebox_wren-scanline: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(185, 225, 245, 0.086) 45%,
    transparent 90%
  );
  --jukebox_milimetric-background: repeating-linear-gradient(
    to bottom,
    rgba(36, 49, 63, 0.03) 0px,
    rgba(36, 49, 63, 0.03) 1.5px,
    transparent 1.5px,
    transparent 6px
  ),
  repeating-linear-gradient(
    to right,
    rgba(36, 49, 63, 0.015) 0px,
    rgba(36, 49, 63, 0.015) 1.5px,
    transparent 1.5px,
    transparent 6px
  );
}

:root[data-theme='dark'] {
  --jukebox_border: rgba(106, 154, 193, 0.5);
  --jukebox_text-color: #f8f8f8;
  --jukebox_box-shadow: 0 0 20px rgba(200, 230, 255, 0.06);
  --jukebox_quote-bg: rgba(235, 245, 255, 0.089);
  --jukebox_desc-bg: rgba(235, 245, 255, 0.051);
  --jukebox_details-bottom: #95c7e9bd;
  --jukebox_track-title-underline: #abddffbd;
  --jukebox_toggle-button: rgba(255, 255, 255, 0.158);
  --jukebox_progress-bar: linear-gradient(to right, var(--highlight), var(--accent));
  --jukebox_progress-bar-container: color-mix(in srgb, var(--text) 5%, transparent);
  --jukebox_wren-overlay: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 0%, transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 2px, transparent 2px);
  --jukebox_wren-scanline: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 45%,
    transparent 90%
  );
  --jukebox_milimetric-background: repeating-linear-gradient(
    to bottom,
    rgba(240, 248, 255, 0.035) 0px,
    rgba(240, 248, 255, 0.035) 1.5px,
    transparent 1.5px,
    transparent 6px
  ),
  repeating-linear-gradient(
    to right,
    rgba(240, 248, 255, 0.02) 0px,
    rgba(240, 248, 255, 0.02) 1.5px,
    transparent 1.5px,
    transparent 6px
  );
}

/* -------------------------------------------------------
   LAYOUT CONTAINERS
--------------------------------------------------------*/
.jukebox-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -1em;
  gap: 1.2em;
}

.jukebox-top {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2em;
  flex-wrap: wrap;
}

.quote-and-skip {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 255px;
  margin-top: 3em;
}

/* -------------------------------------------------------
   PLAYER BOX
--------------------------------------------------------*/
.player-box {
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--jukebox_border);
  border-radius: 18px;
  margin-top: 3em;
  width: 330px;
  max-width: 330px;
  min-width: 330px;
  min-height: 308px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  padding: 2.4em 2.6em;
  text-align: center;
  color: var(--jukebox_text-color);
  box-shadow: var(--jukebox_box-shadow), inset 0 0 8px rgba(255, 255, 255, 0.258);
  transition: transform 0.4s ease, background 0.4s ease;
}

.player-box::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--jukebox_milimetric-background);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 0;
  animation: scribbleFade 6s linear infinite;
  animation-play-state: paused;
}

.player-box.playing::after {
  opacity: 1;
  animation-play-state: running;
}

@keyframes scribbleFade {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 12px 12px, -12px -12px;
  }
}

/* -------------------------------------------------------
   QUOTE BOX
--------------------------------------------------------*/
#track-quote {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--jukebox_quote-bg);
  border: 1px solid var(--jukebox_border);
  padding: 1.6em 1.8em;
  margin-top: -0.2em;
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--jukebox_text-color);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow: 0 0 16px rgba(190, 220, 255, 0.05);
  transition: transform 0.4s ease, background 0.4s ease;
  min-width: 267px;
  max-width: 267px;
  min-height: 260px;
}

/* -------------------------------------------------------
   DESCRIPTION BOX
--------------------------------------------------------*/
#volume-slider {
  width: 100%;
  accent-color: #a3d2ff;
  cursor: pointer;
  margin-top: 0.5em;
  background: transparent;
}

#volume-slider {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

#track-quote:hover #volume-slider {
  opacity: 1;
}

#volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  background-color: #f5faff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

#volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background-color: #f5faff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}

/* -------------------------------------------------------
   DESCRIPTION BOX
--------------------------------------------------------*/
.description-box {
  margin-top: -0.1em;
  width: 625px;
  align-self: center;
  background: var(--jukebox_desc-bg);
  border: 1px solid var(--jukebox_border);
  padding: 1.6em 2em;
  border-radius: 18px;
  font-family: 'Georgia', serif;
  font-size: 1em;
  color: var(--jukebox_text-color);
  line-height: 1.6;
  text-align: center;
  backdrop-filter: blur(10px) saturate(130%);
  box-shadow: 0 0 12px rgba(180, 220, 255, 0.07);
  transition: transform 0.4s ease, background 0.4s ease;
}

/* -------------------------------------------------------
   SKIP BUTTON
--------------------------------------------------------*/
#skip-btn {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 0.95rem;
  padding: 0.65em 3.3em;
  min-width: 270px;
  margin-bottom: 1em;
  color: var(--jukebox_text-color);
  background: var(--jukebox_skip-button);
  border: 1px solid var(--jukebox_border);
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 16px rgba(190, 220, 255, 0.05);
  position: relative;
  overflow: hidden;
  cursor: url(https://file.garden/ZkVg_PCtvnSJZ3-N/mii.cur), auto !important;
}

#skip-btn::after {
  content: '';
  position: absolute;
  left: 15%;
  bottom: 11%;
  width: 70%;
  height: 2px;
  background-image: linear-gradient(
    to right,
    transparent 0%,
    var(--jukebox_text-color) 45%,
    var(--jukebox_text-color) 55%,
    transparent 100%
  );
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s ease, opacity 0.4s ease, background 0.4s ease;
}

#skip-btn:hover::after {
  opacity: 0.6;
  transform: scaleX(1);
}

#skip-btn:hover {
  box-shadow: 0 0 10px rgba(200, 230, 255, 0.25);
  background-color: var(--jukebox_skip-button--hover);
  transform: scale(1.03) translateY(-1px);
}

/* -------------------------------
   INTERACTIVES: QUOTE + DESC
---------------------------------*/

#track-quote:hover,
.description-box:hover {
  transform: scale(1.008);
  background-color: var(--jukebox-skip-button--hover);
}

/* -------------------------------------------------------
   CRT OVERLAY EFFECTS
--------------------------------------------------------*/
.wren-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: var(--jukebox_wren-overlay);
  background-size: 100% 100%, 37px 37px, 37px 37px;
  mix-blend-mode: screen;
  animation: faint-pulse 10s ease-in-out infinite;
  border-radius: 18px;
}

@keyframes faint-pulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.005); }
}

.wren-scanline::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--jukebox_wren-scanline);
  animation: wrenSweep 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes wrenSweep {
  0%   { top: -100%; }
  50%  { top: 0%; }
  100% { top: 100%; }
}

/* -------------------------------------------------------
   RESPONSIVE (Mobile Optimization)
--------------------------------------------------------*/
@media screen and (max-width: 600px) {
  .jukebox-container {
    align-items: center;
  }

  .jukebox-top {
    flex-direction: column;
    align-items: center;
    gap: 0.7em;
  }

  .description-box,
  #track-quote {
    width: 258px !important;
    max-width: 258px !important;
    min-width: 258px !important;
  }

  #skip-btn {
    width: 315px !important;
    max-width: 315px !important;
    min-width: 315px !important;
    padding: 0.65em 2em;
  }

  .quote-and-skip {
    align-items: center;
    max-width: 250px;
    margin-top: auto;
  }

  .description-box {
    margin-top: -0.3em;
  }
}