:root {
  --bg1: #020816;
  --bg2: #031e30;
  --accent: #ffdd7b;
  --label: #f3f7ff;
  --thumb: #ff4655;
  --thumb-glow: #ff8090;
  --rail1: #547c7c;
  --rail2: #203040;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* animated Christmasy blue / green / berry gradient */
  background: linear-gradient(135deg, #021226, #053a6b, #0a3f3a, #3a2340);
  background-size: 260% 260%;
  animation: xmasBg 30s ease infinite;
  color: #fff;
  font-family: "Poppins", Arial, sans-serif;
  overflow: hidden;
}

@keyframes xmasBg {
  0% {
    background-position: 0% 20%;
  }

  50% {
    background-position: 100% 80%;
  }

  100% {
    background-position: 0% 20%;
  }
}

/* GLOBAL SNOW (soft) */
#snowOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0, transparent 60%),
    radial-gradient(circle, rgba(255, 255, 255, 0.45) 0, transparent 60%);
  background-size: 8px 8px, 5px 5px;
  animation: snowFall 18s linear infinite;
}

@keyframes snowFall {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 0 900px, 0 700px;
  }
}

.app {
  position: relative;
  z-index: 2;
  /* above snow */
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* HEADER */
.topHeader {
  text-align: center;
}

h1 {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent), 0 0 24px rgba(255, 255, 255, 0.35);
  font-size: 2rem;
  margin-bottom: 6px;
}

.subtitle {
  color: #dbe9ff;
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

button,
select {
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: inherit;
}

button {
  background: var(--accent);
  color: #1b1306;
  box-shadow: 0 0 8px var(--accent);
}

button:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 0 16px var(--accent), 0 0 28px rgba(255, 255, 255, 0.5);
}

#dynamicBtn {
  background: #123b4b;
  color: #e6f8ff;
  border: 1px solid #5ad1ff;
  box-shadow: 0 0 8px rgba(90, 209, 255, 0.5);
}

#dynamicBtn:hover {
  box-shadow: 0 0 16px rgba(90, 209, 255, 0.9);
}

#resetBtn {
  background: #1f1522;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(255, 221, 123, 0.6);
}

#resetBtn:hover {
  box-shadow: 0 0 18px rgba(255, 221, 123, 0.9);
}

select {
  background: #071525;
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(255, 221, 123, 0.4);
}

#songName {
  color: #f2e9ff;
  margin: 6px 0 18px;
  font-size: 0.95rem;
}

/* QUICK MOODS */
.moodsRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.moodsLabel {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.presetBtn {
  background: rgba(7, 21, 37, 0.95);
  color: #f5f9ff;
  border-radius: 999px;
  border: 1px solid rgba(255, 221, 123, 0.4);
  box-shadow: 0 0 8px rgba(8, 60, 93, 0.7);
  font-size: 0.8rem;
  padding-inline: 14px;
}

.presetBtn.active {
  background: var(--accent);
  color: #1b1306;
}

/* MAIN LAYOUT */
.main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

.controlsColumn {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* SCENE CARD */
.sceneCard {
  position: relative;
  background: radial-gradient(circle at top, #13253c, #050a14);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow:
    0 0 25px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(6, 27, 61, 0.9);
  overflow: hidden;
}

.sceneGlow {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at left, rgba(255, 221, 123, 0.25) 0, transparent 55%),
    radial-gradient(circle at right, rgba(255, 255, 255, 0.08) 0, transparent 60%);
  opacity: 0.85;
  pointer-events: none;
}

#tree {
  position: relative;
  z-index: 2;
  width: 120px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
  transform: translateX(6px);
}

#penguinWrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  margin-top: 10px;
}

#penguinGlow {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 221, 123, 0.55) 0%, rgba(255, 221, 123, 0) 70%);
  filter: blur(46px);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

#penguin {
  width: 160px;
  transition: transform 0.25s ease;
  animation: bounce 1.1s ease-in-out infinite;
  animation-play-state: paused;
  position: relative;
  z-index: 2;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.playing #penguin {
  animation-play-state: running;
}

/* SLIDERS */
.sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 18px 26px;
}

.slider-col {
  background: rgba(9, 18, 32, 0.96);
  border-radius: 18px;
  padding: 12px 10px 16px;
  text-align: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 14px rgba(10, 54, 79, 0.8);
  backdrop-filter: blur(6px);
}

.vbox {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

input[type="range"].vslider {
  -webkit-appearance: none;
  width: 200px;
  height: 28px;
  transform: rotate(-90deg);
  background: transparent;
  outline: none;
  cursor: pointer;
}

input[type="range"].vslider::-webkit-slider-runnable-track {
  height: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--rail1), var(--rail2));
}

input[type="range"].vslider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 22px;
  border-radius: 8px;
  background: var(--thumb);
  box-shadow: 0 0 10px var(--thumb-glow);
  transition: transform 0.15s ease;
}

input[type="range"].vslider:hover::-webkit-slider-thumb {
  transform: scale(1.08);
}

.label {
  margin-top: 8px;
  color: var(--label);
  font-size: 0.86rem;
  text-transform: lowercase;
}

/* TRANSPORT + SEEK */
.seekwrap {
  margin-top: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  max-width: 260px;
  width: 100%;
}

.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  background: rgba(7, 21, 37, 0.95);
  color: #f5f9ff;
  box-shadow: 0 0 10px rgba(8, 42, 80, 0.9);
  border: 1px solid rgba(255, 221, 123, 0.4);
  font-size: 1rem;
}

.iconBtn:hover {
  box-shadow: 0 0 16px rgba(255, 221, 123, 0.9);
}

#repeatBtn.active {
  background: var(--accent);
  color: #1b1306;
}

input[type="range"].seek {
  -webkit-appearance: none;
  width: 100%;
  max-width: 620px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38495b, #1c2733);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  margin: 0 auto;
}

input[type="range"].seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent), 0 0 12px rgba(255, 255, 255, 0.9);
}

#timeDisplay {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #f2f4ff;
  text-shadow: 0 0 8px rgba(124, 187, 255, 0.9);
}

/* BLEND SLIDER */
.blendwrap {
  margin-top: 10px;
  text-align: center;
}

#blendSlider {
  -webkit-appearance: none;
  width: 100%;
  max-width: 500px;
  height: 18px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--rail1), var(--rail2));
  box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  outline: none;
}

#blendSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 22px;
  border-radius: 8px;
  background: var(--thumb);
  box-shadow: 0 0 10px var(--thumb-glow);
  transition: transform 0.15s ease;
}

#blendSlider:hover::-webkit-slider-thumb {
  transform: scale(1.06);
}

/* LOADER */
#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #071426, #02040b);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: var(--accent);
  font-family: "Poppins", sans-serif;
  transition: opacity 1s ease;
}

#progressBar {
  width: 300px;
  height: 16px;
  background: #050c17;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 0 10px rgba(255, 221, 123, 0.4);
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff4655, #ffdd7b);
  border-radius: 10px;
  transition: width 0.3s ease;
}

#progressText {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 0 10px var(--accent);
}

/* LOADER PENGUIN ANIMATION */
#loaderPenguinWrap {
  position: relative;
  width: 380px;
  height: 220px;
  overflow: hidden;
  margin-bottom: 20px;
}

.penguinContainer {
  position: absolute;
  bottom: 0;
  animation: walkPenguin 5s linear infinite;
}

#loaderPenguin {
  width: 120px;
  animation: bouncePenguin 1s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

#boombox {
  position: absolute;
  bottom: 0;
  width: 100px;
  left: 280px;
  animation: bounceBox 1s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

@keyframes walkPenguin {
  0% {
    left: -40px;
    transform: scaleX(-1);
  }

  45% {
    left: 220px;
    transform: scaleX(-1);
  }

  50% {
    transform: scaleX(1);
  }

  95% {
    left: -40px;
    transform: scaleX(1);
  }

  100% {
    transform: scaleX(-1);
  }
}

@keyframes bouncePenguin {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes bounceBox {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-8px) rotate(-3deg);
  }

  75% {
    transform: translateY(-8px) rotate(3deg);
  }
}