* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #080818;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    url("img.jpg") center / cover no-repeat,
    linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
  filter: brightness(0.35) saturate(0.7);
  transition: filter 2s ease;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 20%,
    rgba(0, 0, 0, 0.92) 65%
  );
  opacity: 1;
  transition:
    opacity 2s ease,
    transform 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vignette.playing {
  opacity: 0.2;
  transform: scale(1.4);
}

.container {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 640px;
}

.text-stage {
  position: relative;
  width: 100%;
  margin-bottom: 3rem;
}

.text-intro {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition:
    opacity 1.2s ease,
    visibility 1.2s ease;
}

.text-intro.faded {
  opacity: 0;
  visibility: hidden;
}

.heading {
  font-family: "Cormorant", serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.5px;
  padding: 0 1rem;
  text-align: center;
}

.description {
  font-family: "Cormorant", serif;
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 1rem;
  letter-spacing: 0.3px;
  text-align: center;
}

.train-text {
  font-family: "Cormorant", serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 0 1rem;
  letter-spacing: 0.3px;
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 1.2s ease,
    visibility 1.2s ease;
}

.train-text.visible {
  opacity: 1;
  visibility: visible;
}

.restart-btn {
  font-family: "Cormorant", serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.5rem 1.5rem;
  border-radius: 24px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  width: auto;
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 1.2s ease,
    visibility 1.2s ease;
}

.restart-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.25);
}

.restart-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.controls {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.play-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pause-svg {
  display: none;
}

.play-icon.pause .play-svg {
  display: none;
}

.play-icon.pause .pause-svg {
  display: block;
}

.play-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.play-btn:active {
  transform: scale(0.96);
}

.skip-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  outline: none;
}

.skip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

.skip-btn:active {
  transform: scale(0.92);
}

.bottom-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.timer {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  padding: 0.8rem 2rem 2rem;
  font-variant-numeric: tabular-nums;
}

.volume-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem 2rem;
}

.vol-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
  margin-right: 0.15rem;
}

.vol-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
}

.vol-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.2);
}

.vol-btn:active {
  transform: scale(0.9);
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: visible;
}

.progress-bar {
  width: 100%;
  height: 100%;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  border-radius: 2px;
  position: relative;
  transition: width 0.1s linear;
}

.progress-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: -20px;
  bottom: -20px;
  width: 80px;
  background: radial-gradient(
    ellipse at right center,
    rgba(249, 115, 22, 0.35) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.progress-fill.active::after {
  opacity: 1;
  animation: glowPulse 5s ease-in-out infinite;
}

.spark {
  position: absolute;
  left: 100%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 24px;
  background: linear-gradient(to top, #f97316, rgba(251, 191, 36, 0));
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.spark.active {
  opacity: 1;
  animation: flameHeight 5s ease-in-out infinite;
}

@keyframes flameHeight {
  0%,
  100% {
    height: 24px;
  }
  25% {
    height: 28px;
  }
  50% {
    height: 21px;
  }
  75% {
    height: 26px;
  }
}

@keyframes glowPulse {
  0%,
  100% {
    top: -20px;
    bottom: -20px;
    width: 80px;
    background: radial-gradient(
      ellipse at right center,
      rgba(249, 115, 22, 0.35) 0%,
      transparent 70%
    );
  }
  25% {
    top: -22px;
    bottom: -22px;
    width: 90px;
    background: radial-gradient(
      ellipse at right center,
      rgba(249, 115, 22, 0.45) 0%,
      transparent 70%
    );
  }
  50% {
    top: -18px;
    bottom: -18px;
    width: 70px;
    background: radial-gradient(
      ellipse at right center,
      rgba(249, 115, 22, 0.3) 0%,
      transparent 70%
    );
  }
  75% {
    top: -21px;
    bottom: -21px;
    width: 85px;
    background: radial-gradient(
      ellipse at right center,
      rgba(249, 115, 22, 0.4) 0%,
      transparent 70%
    );
  }
}

.download-link {
  text-align: center;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
  transition:
    color 0.3s ease,
    opacity 1.2s ease,
    border-color 0.3s ease,
    visibility 1.2s ease;
  letter-spacing: 0.3px;
  margin-top: 2.5rem;
  display: inline-block;
}

.download-link.faded {
  opacity: 0;
  visibility: hidden;
}

.download-link:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  .controls {
    gap: 1.5rem;
  }

  .play-btn {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
  }

  .skip-btn {
    width: 40px;
    height: 40px;
  }

  .description {
    font-size: 0.95rem;
  }

  .bottom-section {
    padding: 0;
  }

  .volume-area {
    padding: 0.6rem 1rem 1rem;
  }

  .timer {
    padding: 0.6rem 1rem 1rem;
  }

  .vol-btn {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
}
