:root {
  --c-deep: #2e4a45;
  --c-sage: #7fa094;
  --c-mist: #cfe0d8;
  --c-sand: #e9e2d4;
  --c-gold: #c2a878;
  --c-cream: #f6f3ec;
  --c-text: #243630;
  --c-muted: #7c8b84;
  --ring-length: 691;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body {
  min-height: 100vh;
  background: #cdd6cf;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  color: var(--c-text);
}

button {
  font: inherit;
}

.phone {
  width: min(100vw, 430px);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .3);
  background: linear-gradient(165deg, #dfeae3 0%, #c7d8ce 45%, #aec6ba 100%);
  background-size: 200% 200%;
  animation: breathe 14s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: .45;
  pointer-events: none;
  transition: opacity 1.4s ease, filter 1.4s ease;
}

.blob.b1 {
  width: 220px;
  height: 220px;
  background: #9bc0b1;
  top: -60px;
  right: -50px;
  animation: float1 16s ease-in-out infinite;
}

.blob.b2 {
  width: 180px;
  height: 180px;
  background: #d8c39a;
  bottom: 120px;
  left: -60px;
  animation: float2 18s ease-in-out infinite;
}

.phone.is-playing .blob {
  opacity: .54;
  filter: blur(26px);
}

.phone.is-playing .blob.b1 {
  animation-duration: 13s;
}

.phone.is-playing .blob.b2 {
  animation-duration: 15s;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 30px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(25px, -25px); }
}

.status {
  position: relative;
  z-index: 2;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.header {
  position: relative;
  z-index: 2;
  padding: 14px 24px 4px;
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(150px, 44vw);
  height: auto;
  margin: 0 auto;
  opacity: .85;
  filter: drop-shadow(0 5px 12px rgba(46, 74, 69, .12));
}

.header h1 {
  font-size: 18px;
  font-weight: 300;
  margin-top: 4px;
  letter-spacing: .8px;
  font-family: Georgia, serif;
  color: var(--c-deep);
}

.shuffle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 10px auto 0;
  padding: 7px;
  border: 1px solid rgba(127, 160, 148, .2);
  border-radius: 999px;
  background: rgba(246, 243, 236, .12);
  color: rgba(127, 160, 148, .72);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(46, 74, 69, .04);
  backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s;
}

.shuffle-button:hover,
.shuffle-button:focus-visible {
  outline: none;
  background: rgba(246, 243, 236, .26);
  border-color: rgba(127, 160, 148, .38);
  color: var(--c-sage);
  transform: translateY(-1px);
}

.shuffle-button:active {
  transform: translateY(0);
}

.shuffle-button.active {
  background: rgba(194, 168, 120, .18);
  border-color: rgba(194, 168, 120, .52);
  box-shadow: 0 0 0 1px rgba(194, 168, 120, .2), 0 5px 14px rgba(194, 168, 120, .12);
  color: var(--c-gold);
}

.shuffle-icon {
  width: 17px;
  height: 17px;
  transform: rotate(8deg);
  transform-origin: center;
}

.install-panel {
  position: relative;
  z-index: 2;
  padding: 8px 24px 0;
  text-align: center;
}

.install-panel[hidden] {
  display: none;
}

.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  border: 1px solid rgba(127, 160, 148, .5);
  border-radius: 999px;
  background: rgba(246, 243, 236, .5);
  color: var(--c-deep);
  cursor: pointer;
  padding: 6px 13px;
  box-shadow: 0 5px 16px rgba(46, 74, 69, .08);
  backdrop-filter: blur(10px);
  transition: transform .2s, background .2s, border-color .2s;
}

.install-button:hover,
.install-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  background: rgba(246, 243, 236, .72);
  border-color: rgba(194, 168, 120, .72);
}

.install-button span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .2px;
  line-height: 1;
}

.install-hint {
  min-height: 14px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--c-muted);
}

.player {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 14px 24px 0;
}

.disc-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 8px auto 0;
  transform: scale(1);
  transition: transform 1.2s ease, filter 1.2s ease;
}

.disc-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 0 34px rgba(127, 160, 148, .16),
    0 0 58px rgba(194, 168, 120, .12);
  transition: opacity 1.2s ease, box-shadow 1.2s ease;
}

.phone.is-playing .disc-wrap {
  animation: discBreath 4.2s ease-in-out infinite;
  animation-play-state: running;
}

.phone.is-playing .disc-wrap::before {
  opacity: 1;
  animation: discGlow 3.8s ease-in-out infinite;
  animation-play-state: running;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring .track {
  fill: none;
  stroke: rgba(255, 255, 255, .4);
  stroke-width: 5;
}

.ring .prog {
  fill: none;
  stroke: url(#grad);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-length);
  stroke-dashoffset: var(--ring-length);
  filter: drop-shadow(0 0 0 rgba(194, 168, 120, 0));
  opacity: .86;
  transition: stroke-dashoffset .15s linear, opacity 1s ease, filter 1s ease;
  animation: ringGlow 3.6s ease-in-out infinite;
  animation-play-state: paused;
}

#progressRing {
  transition: opacity 1s ease, filter 1s ease;
  animation: ringGlow 3.6s ease-in-out infinite;
  animation-play-state: paused;
}

.phone.is-playing .ring .prog,
.phone.is-playing #progressRing {
  animation-play-state: running;
}

.disc {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #2e4a45, #7fa094, #cfe0d8, #c2a878, #2e4a45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(46, 74, 69, .35), inset 0 0 30px rgba(0, 0, 0, .2);
  animation: spin 8s linear infinite;
  animation-play-state: paused;
}

.phone.is-playing .disc {
  animation-play-state: running;
}

.cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.disc.has-cover {
  background: #1f2f2c;
}

.disc.has-cover .cover-art {
  display: block;
}

.disc.has-cover .hole {
  width: 54px;
  height: 54px;
  background: rgba(246, 243, 236, .88);
  z-index: 2;
}

.disc .hole {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dfeae3;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.disc .hole svg {
  width: 26px;
  height: 26px;
  opacity: .6;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes discGlow {
  0%, 100% {
    box-shadow:
      0 0 30px rgba(127, 160, 148, .14),
      0 0 54px rgba(194, 168, 120, .1);
  }
  50% {
    box-shadow:
      0 0 44px rgba(127, 160, 148, .28),
      0 0 78px rgba(194, 168, 120, .18);
  }
}

@keyframes discBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@keyframes ringGlow {
  0%, 100% {
    opacity: .84;
    filter: drop-shadow(0 0 0 rgba(194, 168, 120, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(194, 168, 120, .38));
  }
}

.track-title {
  font-size: 22px;
  font-weight: 500;
  font-family: Georgia, serif;
  color: var(--c-deep);
  margin-top: 20px;
  line-height: 1.2;
}

.track-meta {
  font-size: 13px;
  color: var(--c-muted);
  margin-top: 4px;
  min-height: 18px;
}

.viz {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 34px;
  margin: 16px 0 6px;
}

.viz span {
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-sage), var(--c-deep));
  transform-origin: bottom;
  animation: wave 1.1s ease-in-out infinite;
  animation-play-state: paused;
}

.phone.is-playing .viz span,
.phone.is-playing .miniviz span {
  animation-play-state: running;
}

.phone.viz-audio-active .viz span {
  animation: none;
}

.viz span:nth-child(odd) { animation-duration: .9s; }
.viz span:nth-child(1) { height: 10px; animation-delay: 0s; }
.viz span:nth-child(2) { height: 24px; animation-delay: .1s; }
.viz span:nth-child(3) { height: 16px; animation-delay: .2s; }
.viz span:nth-child(4) { height: 30px; animation-delay: .05s; }
.viz span:nth-child(5) { height: 12px; animation-delay: .3s; }
.viz span:nth-child(6) { height: 26px; animation-delay: .15s; }
.viz span:nth-child(7) { height: 18px; animation-delay: .25s; }
.viz span:nth-child(8) { height: 32px; animation-delay: .08s; }
.viz span:nth-child(9) { height: 14px; animation-delay: .35s; }
.viz span:nth-child(10) { height: 22px; animation-delay: .12s; }
.viz span:nth-child(11) { height: 10px; animation-delay: .28s; }
.viz span:nth-child(12) { height: 28px; animation-delay: .06s; }
.viz span:nth-child(13) { height: 16px; animation-delay: .22s; }

@keyframes wave {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

.progress-bar {
  width: calc(100% - 16px);
  height: 8px;
  margin: 2px 8px 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  overflow: hidden;
  display: block;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(46, 74, 69, .12);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c-sage), var(--c-gold));
}

.times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-muted);
  margin: 6px 8px 0;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 8px;
}

.controls button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}

.controls button:not(.play) {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.controls button:not(.play):hover,
.controls button:not(.play):focus-visible {
  outline: none;
  background: rgba(246, 243, 236, .38);
}

.controls button:not(.play).active {
  background: rgba(194, 168, 120, .22);
  box-shadow: 0 0 0 1px rgba(194, 168, 120, .44);
  color: var(--c-gold);
}

.controls button:disabled {
  opacity: .35;
  cursor: default;
}

.controls .ico {
  width: 28px;
  height: 28px;
}

.controls .play {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--c-sage), var(--c-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(46, 74, 69, .45);
  position: relative;
}

.play::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(127, 160, 148, .5);
  animation: pulse 2s ease-out infinite;
  animation-play-state: paused;
}

.phone.is-playing .play::after {
  animation-play-state: running;
}

.play svg {
  width: 30px;
  height: 30px;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.lib {
  position: relative;
  z-index: 2;
  padding: 18px 20px 32px;
}

.lib h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--c-deep);
  margin: 0 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lib h2 .c {
  font-size: 12px;
  font-weight: 400;
  color: var(--c-muted);
}

.message {
  background: rgba(255, 255, 255, .48);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 16px;
  color: var(--c-muted);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(46, 74, 69, .08);
}

.message.hidden {
  display: none;
}

.song {
  width: 100%;
  border: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(46, 74, 69, .08);
  transition: transform .2s, background .2s, border-color .2s, box-shadow 1s ease;
  cursor: pointer;
}

.song:hover,
.song:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.song.active {
  background: linear-gradient(135deg, rgba(127, 160, 148, .35), rgba(255, 255, 255, .6));
  border: 1px solid rgba(127, 160, 148, .6);
  box-shadow: 0 6px 18px rgba(46, 74, 69, .1);
  animation: activeBreath 4s ease-in-out infinite;
  animation-play-state: paused;
}

.phone.is-playing .song.active {
  animation-play-state: running;
}

.song .mini {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: 0 0 46px;
  background: conic-gradient(from 0deg, #2e4a45, #7fa094, #c2a878, #2e4a45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 1s ease, transform 1s ease;
}

.song.active .mini {
  animation: spin 6s linear infinite;
}

.phone.is-playing .song.active .mini {
  box-shadow:
    0 0 0 4px rgba(127, 160, 148, .12),
    0 0 18px rgba(194, 168, 120, .18);
  animation: spin 6s linear infinite, miniBreath 4s ease-in-out infinite;
}

.song .mini.cover {
  background: #1f2f2c;
}

.song .mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song .mini .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dfeae3;
  transition: box-shadow 1s ease;
}

.phone.is-playing .song.active .mini .dot {
  animation: activeDotGlow 4s ease-in-out infinite;
  animation-play-state: running;
}

.song .info {
  flex: 1;
  min-width: 0;
}

.song .info .t {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song .info .d {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song .dur {
  font-size: 12px;
  color: var(--c-muted);
  flex: 0 0 auto;
}

.miniviz {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
  flex: 0 0 auto;
}

.miniviz span {
  width: 3px;
  background: var(--c-sage);
  border-radius: 2px;
  animation: wave .8s infinite ease-in-out;
}

.miniviz span:nth-child(1) { height: 6px; }
.miniviz span:nth-child(2) { height: 14px; animation-delay: .2s; }
.miniviz span:nth-child(3) { height: 9px; animation-delay: .4s; }

@keyframes activeBreath {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(46, 74, 69, .1);
  }
  50% {
    box-shadow:
      0 8px 22px rgba(46, 74, 69, .13),
      0 0 0 1px rgba(127, 160, 148, .22);
  }
}

@keyframes miniBreath {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(127, 160, 148, .1),
      0 0 14px rgba(194, 168, 120, .14);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(127, 160, 148, .18),
      0 0 22px rgba(194, 168, 120, .24);
  }
}

@keyframes activeDotGlow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(246, 243, 236, 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(246, 243, 236, .55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone.is-playing .disc-wrap,
  .phone.is-playing .disc-wrap::before,
  .ring .prog,
  #progressRing,
  .song.active,
  .phone.is-playing .song.active .mini,
  .phone.is-playing .song.active .mini .dot {
    animation: none;
  }

  .phone.is-playing .disc-wrap {
    transform: scale(1.005);
  }

  .phone.is-playing .disc-wrap::before {
    opacity: .45;
  }

  .phone.is-playing .ring .prog,
  .phone.is-playing #progressRing {
    opacity: .95;
    filter: drop-shadow(0 0 3px rgba(194, 168, 120, .2));
  }

  .phone.is-playing .blob {
    opacity: .48;
    filter: blur(28px);
  }
}

@media (min-width: 760px) {
  body {
    align-items: center;
    padding: 28px;
  }

  .phone {
    width: 430px;
    min-height: 844px;
    border-radius: 28px;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    width: min(128px, 42vw);
  }

  .header h1 {
    font-size: 17px;
  }

  .install-panel {
    padding-inline: 20px;
  }
}
