@font-face {
  font-family: "VT323";
  src: url("../assets/fonts/VT323-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
  background: #090909;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
}

.listening-room {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem 1.5rem 10rem;
  isolation: isolate;
}

.backdrop,
.backdrop::after,
.backdrop video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.backdrop {
  z-index: -1;
  overflow: hidden;
  background: #090909 url("../assets/00000/static-poster.jpg") center / cover no-repeat;
}

.backdrop video {
  object-fit: cover;
}

.backdrop::after {
  content: "";
  background: rgba(0, 0, 0, 0.38);
}

.back-link {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  left: max(1.5rem, env(safe-area-inset-left));
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.35rem;
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
  text-shadow: 0 1px 6px #000;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.volume-control {
  --volume: 100%;
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.5rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 44px;
}

.volume-control svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

.volume-control__waves {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.volume-control[data-muted="true"] .volume-control__waves {
  visibility: hidden;
}

.volume-control__slider {
  width: 112px;
  height: 44px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.volume-control__slider::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, #fff var(--volume), rgba(255, 255, 255, 0.28) var(--volume));
}

.volume-control__slider::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  -webkit-appearance: none;
  background: #fff;
}

.volume-control__slider::-moz-range-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.volume-control__slider::-moz-range-progress {
  height: 3px;
  background: #fff;
}

.volume-control__slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.volume-control__slider:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.volume-control__slider:disabled {
  opacity: 0.5;
  cursor: default;
}

.soundcloud-audio {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

.now-playing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 3rem), 68rem);
  transform: translate(-50%, -50%);
  text-align: center;
}

.now-playing h1 {
  margin: 0;
  font-family: "VT323", "Courier New", monospace;
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.5), 0 2px 12px #000;
}

.player-status {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin: 1.25rem 0 0;
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-shadow: 0 1px 6px #000;
}

.transport {
  position: absolute;
  bottom: max(3.5rem, calc(env(safe-area-inset-bottom) + 3rem));
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.75rem);
  transform: translateX(-50%);
}

.transport-button {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  padding: 1rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #090909;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.transport-button--play {
  width: 4.25rem;
  height: 4.25rem;
  padding: 1.1rem;
}

.transport-button svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.transport-button:enabled:hover {
  background: #dedede;
}

.transport-button:enabled:active {
  transform: scale(0.95);
}

.transport-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.transport-button .pause-icon,
.transport-button[data-playing="true"] .play-icon {
  display: none;
}

.transport-button[data-playing="true"] .pause-icon {
  display: block;
}

.scrubber {
  --progress: 0%;
  position: absolute;
  right: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  height: 44px;
}

.scrubber__track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.scrubber__fill {
  display: block;
  width: var(--progress);
  height: 100%;
  background: #fff;
}

.scrubber__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.scrubber__input::-webkit-slider-runnable-track {
  height: 44px;
  background: transparent;
}

.scrubber__input::-webkit-slider-thumb {
  width: 1px;
  height: 44px;
  border: 0;
  -webkit-appearance: none;
  background: transparent;
}

.scrubber__input::-moz-range-track {
  height: 44px;
  background: transparent;
}

.scrubber__input::-moz-range-progress {
  background: transparent;
}

.scrubber__input::-moz-range-thumb {
  width: 1px;
  height: 44px;
  border: 0;
  background: transparent;
}

.scrubber__input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.scrubber__input:disabled {
  cursor: default;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 399px) {
  .volume-control__slider {
    width: 88px;
  }
}

@media (max-height: 32rem) {
  .listening-room {
    padding-top: 4rem;
    padding-bottom: 6rem;
  }

  .now-playing {
    top: 43%;
  }

  .now-playing h1 {
    font-size: clamp(2rem, 6vh, 3.5rem);
  }

  .transport {
    bottom: max(3.25rem, calc(env(safe-area-inset-bottom) + 3rem));
  }

  .transport-button {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.75rem;
  }

  .transport-button--play {
    width: 3.25rem;
    height: 3.25rem;
    padding: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop video {
    visibility: hidden;
  }
}
