*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

body {
  color: #fff;
  font-family: Arial, sans-serif;
}

.experience {
  --page-gutter: clamp(0.75rem, 2vw, 2rem);
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(0.5rem, 1.2vh, 0.875rem);
  padding: clamp(0.5rem, 1.5vh, 1rem) var(--page-gutter);
  background: #000;
}

.brand-area {
  position: relative;
  display: flex;
  min-height: 1.5rem;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  width: clamp(3.25rem, 4vw, 4rem);
  height: auto;
  max-height: 3rem;
  object-fit: contain;
}

.brand-name {
  margin: 0;
  color: rgb(255 255 255 / 86%);
  font-size: clamp(0.75rem, 1vw, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.28em;
}

.visualizer-controls {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: rgb(255 255 255 / 62%);
  font-size: 0.625rem;
}

.visualizer-controls input[type="range"] {
  width: 4.5rem;
  accent-color: #fff;
}

.visualizer-controls select,
.visualizer-toggle {
  min-height: 1.6rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.2rem;
  background: #0c0c0c;
  color: rgb(255 255 255 / 72%);
  font: inherit;
  font-size: 0.625rem;
}

.visualizer-controls select {
  padding: 0.15rem 0.25rem;
}

.visualizer-toggle {
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}

.visualizer-controls select:focus-visible,
.visualizer-toggle:focus-visible,
.visualizer-controls input:focus-visible {
  outline: 1px solid rgb(255 255 255 / 70%);
  outline-offset: 1px;
}

.visualizer-toggle[aria-pressed="false"] {
  color: rgb(255 255 255 / 45%);
}

.scene-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  /* Derive the frame width from the scene space available after reserving the UI. */
  container-type: size;
  place-items: center;
}

.scene {
  position: relative;
  width: min(100%, 177.7778cqh);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.scene-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.visualizer-screen {
  position: absolute;
  /* Measured against the 1920x1080 video frame, including its black letterboxing. */
  left: 34.95%;
  top: 26.94%;
  width: 30.52%;
  height: 29.63%;
  overflow: hidden;
  pointer-events: none;
}

#visualizerCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.backdrop-notice {
  position: absolute;
  inset: auto 0 0;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  background: rgb(0 0 0 / 70%);
  color: #fff;
}

.playback-retry {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: rgb(0 0 0 / 70%);
  color: #fff;
  cursor: pointer;
}

.playback-retry[hidden],
.backdrop-notice[hidden] {
  display: none;
}

.player-bar {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 4rem;
  grid-template-columns: auto minmax(9rem, 1fr) auto minmax(7rem, 12rem) auto;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
  padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0.4rem;
  background: #0c0c0c;
}

.youtube-player-area {
  display: grid;
  width: 9.5rem;
  min-width: 0;
  gap: 0.2rem;
}

.youtube-player-label {
  margin: 0;
  color: rgb(255 255 255 / 45%);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  line-height: 1;
}

.youtube-player-frame {
  position: relative;
  width: 9.5rem;
  height: 5.35rem;
  overflow: hidden;
  background: #000;
}

#youtubePlayer,
#youtubePlayer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-player-area.is-unavailable {
  width: auto;
  min-width: 0;
}

.youtube-player-area.is-unavailable .youtube-player-frame {
  display: none;
}

.track-details {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
}

.track-label {
  margin: 0;
  color: rgb(255 255 255 / 55%);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.track-title {
  overflow: hidden;
  color: rgb(255 255 255 / 90%);
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-status {
  position: absolute;
  bottom: 0.3rem;
  left: 0.75rem;
  max-width: min(18rem, 35%);
  margin: 0;
  overflow: hidden;
  color: rgb(255 255 255 / 55%);
  font-size: 0.625rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-retry {
  position: absolute;
  right: 0.75rem;
  bottom: 0.3rem;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 0.25rem;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.625rem;
  cursor: pointer;
}

.youtube-retry:hover,
.youtube-retry:focus-visible {
  border-color: rgb(255 255 255 / 70%);
  outline: none;
  background: rgb(255 255 255 / 8%);
}

.youtube-retry[hidden] {
  display: none;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgb(255 255 255 / 86%);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgb(255 255 255 / 32%);
  outline: none;
  background: rgb(255 255 255 / 8%);
}

.icon-button svg,
.volume-control svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.play-button {
  width: 2.75rem;
  height: 2.75rem;
  border-color: rgb(255 255 255 / 25%);
  background: rgb(255 255 255 / 7%);
}

.play-button svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
  stroke: none;
}

.volume-control {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.625rem;
  color: rgb(255 255 255 / 72%);
}

.volume-control svg {
  flex: 0 0 auto;
}

.volume-control input {
  width: 100%;
  min-width: 3.5rem;
  accent-color: #fff;
}

.browse-button {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 0.3rem;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
}

.browse-button:hover,
.browse-button:focus-visible {
  border-color: rgb(255 255 255 / 70%);
  outline: none;
  background: rgb(255 255 255 / 8%);
}

.set-list {
  width: min(28rem, calc(100vw - 2rem));
  max-height: min(80vh, 32rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.5rem;
  background: #0c0c0c;
  color: #fff;
}

.set-list::backdrop {
  background: rgb(0 0 0 / 78%);
}

.set-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.set-list-header h1 {
  margin: 0.5rem 0 0;
  font-size: 1.25rem;
  font-weight: 500;
}

.close-button {
  margin: -0.5rem -0.5rem 0 0;
}

.set-entries {
  display: grid;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.set-entries li {
  display: block;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.set-entry {
  display: flex;
  width: 100%;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}

.set-entry:hover,
.set-entry:focus-visible {
  outline: none;
  color: #fff;
}

.set-entry.is-selected {
  color: #fff;
}

.set-placeholder {
  color: rgb(255 255 255 / 48%);
  font-size: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.playback-icon {
  width: 0;
  height: 0;
  margin-left: 0.125rem;
  border-top: 0.35rem solid transparent;
  border-bottom: 0.35rem solid transparent;
  border-left: 0.5rem solid currentColor;
}

@media (max-width: 600px) {
  .experience {
    --page-gutter: 0.625rem;
    gap: 0.5rem;
    padding-top: 0.625rem;
    padding-bottom: max(0.625rem, env(safe-area-inset-bottom));
  }

  .brand-area {
    min-height: 7rem;
    justify-content: center;
  }

  .brand-logo {
    top: 4rem;
    left: 50%;
    width: 5rem;
    max-height: 5rem;
    transform: translateX(-50%);
  }

  .brand-name {
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
  }

  .visualizer-controls {
    top: 2.15rem;
    right: 0;
    left: 0;
    justify-content: center;
  }

  .visualizer-controls input[type="range"] {
    width: 3rem;
  }

  .visualizer-controls select {
    max-width: 4.5rem;
  }

  .player-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.625rem 0.75rem;
    padding: 0.625rem 0.75rem;
  }


  .youtube-player-area {
    display: none;
  }

  .track-details {
    grid-column: 1 / -1;
  }

  .player-controls {
    gap: 0.125rem;
  }

  .volume-control {
    gap: 0.375rem;
  }

  .volume-control input {
    min-width: 2.5rem;
    width: clamp(2.5rem, 16vw, 4.5rem);
  }

  .player-status {
    left: 0.75rem;
    max-width: none;
  }

  .youtube-retry {
    right: 0.75rem;
  }

  .browse-button {
    min-height: 2.75rem;
    padding-inline: 0.75rem;
  }

  .playback-retry {
    top: 0.5rem;
    right: 0.5rem;
  }
}

@media (max-width: 360px) {
  .player-controls {
    grid-column: 1 / 2;
  }

  .volume-control {
    grid-column: 1 / -1;
  }

  .browse-button {
    grid-column: 2;
    grid-row: 2;
    padding-inline: 0.625rem;
  }
}