:root {
  --brown: #3c2109;
  --gold: #d79b25;
  --gold-deep: #ba7711;
  --cream: #fff6df;
  --line: rgba(255, 243, 209, 0.66);
  --shadow: 0 24px 54px rgba(99, 60, 9, 0.26);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f4dca5;
  color: var(--brown);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.music-screen {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.page-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.05);
}

.music-screen::before,
.music-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.music-screen::before {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 244, 215, 0.18), rgba(255, 237, 188, 0.45) 56%, rgba(255, 238, 190, 0.92)),
    radial-gradient(circle at 50% 8%, rgba(255, 252, 237, 0.54), transparent 24rem);
}

.music-screen::after {
  z-index: -1;
  box-shadow: inset 0 0 3.5rem rgba(92, 52, 8, 0.16);
  animation: warm-breathe 7s ease-in-out infinite;
}

.romance-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.romance-layer span {
  position: absolute;
  display: block;
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 999px;
  background: rgba(255, 239, 178, 0.82);
  box-shadow:
    0 0 0.7rem rgba(255, 219, 116, 0.7),
    0 0 1.6rem rgba(255, 246, 216, 0.48);
  opacity: 0;
  animation: floating-spark 9s linear infinite;
}

.romance-layer span:nth-child(1) {
  left: 13%;
  bottom: 18%;
  animation-delay: 0s;
}

.romance-layer span:nth-child(2) {
  left: 31%;
  bottom: 7%;
  animation-delay: 1.8s;
  animation-duration: 10s;
}

.romance-layer span:nth-child(3) {
  left: 55%;
  bottom: 10%;
  width: 0.44rem;
  height: 0.44rem;
  animation-delay: 3.4s;
}

.romance-layer span:nth-child(4) {
  left: 74%;
  bottom: 16%;
  animation-delay: 5s;
  animation-duration: 8.5s;
}

.romance-layer span:nth-child(5) {
  left: 88%;
  bottom: 6%;
  width: 0.28rem;
  height: 0.28rem;
  animation-delay: 6.7s;
}

.romance-layer span:nth-child(6) {
  left: 43%;
  bottom: 24%;
  width: 0.24rem;
  height: 0.24rem;
  animation-delay: 2.6s;
  animation-duration: 7.5s;
}

.romance-layer span:nth-child(7) {
  left: 63%;
  bottom: 28%;
  width: 0.3rem;
  height: 0.3rem;
  animation-delay: 4.8s;
  animation-duration: 8.2s;
}

.glow-orbit {
  position: absolute;
  top: 16%;
  left: 50%;
  z-index: 0;
  width: min(82vw, 23rem);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 45% 48%, rgba(255, 245, 199, 0.34), transparent 38%),
    radial-gradient(circle at 62% 32%, rgba(228, 169, 42, 0.18), transparent 48%);
  filter: blur(0.3rem);
  transform: translateX(-50%);
  animation: glow-drift 8s ease-in-out infinite;
  pointer-events: none;
}

.player-card {
  position: relative;
  z-index: 1;
  display: grid;
  align-self: center;
  width: min(100%, 430px);
  margin: 0 auto;
  padding:
    max(1.35rem, env(safe-area-inset-top))
    clamp(1.25rem, 6vw, 2rem)
    max(1.4rem, env(safe-area-inset-bottom));
}

.artwork-card {
  width: min(88vw, 23.6rem);
  margin: clamp(0.3rem, 2dvh, 1rem) auto clamp(1.9rem, 4.5dvh, 2.55rem);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1.5px solid rgba(255, 247, 222, 0.72);
  border-radius: 1.65rem;
  background: rgba(255, 245, 219, 0.18);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: artwork-float 6s ease-in-out infinite;
}

.artwork-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  animation: artwork-glow 8s ease-in-out infinite;
}

.playback-area {
  width: min(82vw, 22rem);
  margin: 0 auto;
}

.sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.seek-bar {
  display: block;
  width: 100%;
  height: 1.35rem;
  margin: 0;
  appearance: none;
  background: transparent;
}

.seek-bar::-webkit-slider-runnable-track {
  height: 0.34rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--gold) var(--progress, 0%), rgba(162, 107, 34, 0.2) 0);
}

.seek-bar::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
  margin-top: -0.33rem;
  appearance: none;
  border: 2px solid #fff9e8;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 3px 10px rgba(95, 55, 7, 0.3);
}

.seek-bar::-moz-range-track {
  height: 0.34rem;
  border-radius: 999px;
  background: rgba(162, 107, 34, 0.2);
}

.seek-bar::-moz-range-progress {
  height: 0.34rem;
  border-radius: 999px;
  background: var(--gold);
}

.seek-bar::-moz-range-thumb {
  width: 0.86rem;
  height: 0.86rem;
  border: 2px solid #fff9e8;
  border-radius: 999px;
  background: var(--gold);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.38rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.play-button {
  position: relative;
  display: grid;
  width: clamp(5.4rem, 24vw, 6.35rem);
  height: clamp(5.4rem, 24vw, 6.35rem);
  place-items: center;
  margin: clamp(2.7rem, 8dvh, 4rem) auto 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, #ffd976, #dc9418 70%),
    var(--gold);
  color: #fff7db;
  box-shadow:
    0 1.15rem 2.3rem rgba(116, 70, 8, 0.34),
    inset 0 0 0 0.18rem rgba(255, 247, 214, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  animation: play-glow 4s ease-in-out infinite;
}

.play-button svg {
  width: 2.4rem;
  height: 2.4rem;
  fill: currentColor;
}

.pause-icon,
.is-playing .play-icon {
  display: none;
}

.is-playing .pause-icon {
  display: block;
}

@keyframes warm-breathe {
  0%,
  100% {
    opacity: 0.82;
  }

  50% {
    opacity: 1;
  }
}

@keyframes artwork-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.32rem);
  }
}

@keyframes artwork-glow {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }

  50% {
    filter: saturate(1.06) brightness(1.035);
  }
}

@keyframes glow-drift {
  0%,
  100% {
    opacity: 0.56;
    transform: translateX(-50%) translateY(0) scale(0.96);
  }

  50% {
    opacity: 0.86;
    transform: translateX(-50%) translateY(-0.7rem) scale(1.03);
  }
}

@keyframes play-glow {
  0%,
  100% {
    box-shadow:
      0 1.15rem 2.3rem rgba(116, 70, 8, 0.34),
      0 0 0 rgba(255, 217, 112, 0),
      inset 0 0 0 0.18rem rgba(255, 247, 214, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  50% {
    box-shadow:
      0 1.35rem 2.7rem rgba(116, 70, 8, 0.38),
      0 0 2.4rem rgba(255, 217, 112, 0.38),
      inset 0 0 0 0.18rem rgba(255, 247, 214, 0.48),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }
}

@keyframes floating-spark {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.7);
  }

  15% {
    opacity: 0.72;
  }

  70% {
    opacity: 0.58;
  }

  100% {
    opacity: 0;
    transform: translate3d(1rem, -16rem, 0) scale(1.14);
  }
}

@media (min-width: 431px) {
  body {
    display: grid;
    place-items: center;
  }

  .music-screen {
    width: min(100vw, 430px);
    min-height: min(100dvh, 932px);
    border-right: 1px solid rgba(151, 96, 24, 0.2);
    border-left: 1px solid rgba(151, 96, 24, 0.2);
    box-shadow: 0 0 5rem rgba(95, 55, 7, 0.25);
  }
}

@media (max-height: 700px) {
  .artwork-card {
    width: min(74vw, 19rem);
    margin-bottom: 1.1rem;
  }

  .play-button {
    width: 4.9rem;
    height: 4.9rem;
    margin-top: 1.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
