:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #f7f4f1;
  --accent: #d61010;
  --accent-soft: rgba(214, 16, 16, 0.4);
  --panel: rgba(6, 6, 6, 0.36);
  --panel-border: rgba(255, 255, 255, 0.16);
  --shadow: rgba(214, 16, 16, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
}

body {
  font-family: "Orbitron", sans-serif;
  color: var(--fg);
  cursor: url("./public/images/crosshair-logo.svg") 16 16, auto;
}

button {
  font: inherit;
  cursor: url("./public/images/crosshair-logo.svg") 16 16, pointer;
}

#app {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(70, 8, 8, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(18, 0, 0, 0.12), transparent 28%),
    var(--bg);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--fg);
  font-family: "Orbitron", sans-serif;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(214, 16, 16, 0.3);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.error-overlay {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--accent);
  font-family: "Orbitron", sans-serif;
  text-align: center;
  padding: 2rem;
}

.error-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.error-retry {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--fg);
  border: none;
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
}

.ui-header-overlay,
.ui-overlay,
.screen-fx,
.touch-zone {
  position: absolute;
  inset: 0;
}

.ui-header-overlay,
.ui-overlay,
.screen-fx {
  pointer-events: none;
}

.ui-header-overlay {
  z-index: 40;
}

.ui-overlay {
  z-index: 20;
}

.brand-lockup {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  left: 1rem;
  right: 1rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: block;
  width: min(100%, 34rem);
  height: auto;
  margin: 0;
  opacity: 0;
  pointer-events: auto;
  filter:
    drop-shadow(0 0 10px rgba(214, 16, 16, 0.45))
    drop-shadow(0 0 26px rgba(214, 16, 16, 0.22));
}

.album-cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: none;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
}

.album-cover-image {
  display: block;
  width: min(78vw, 24rem);
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  pointer-events: auto;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 42px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(214, 16, 16, 0.18);
}

.audio-hint {
  margin: 0;
  width: min(100%, 34rem);
  overflow: hidden;
  color: #ffffff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.46rem, 1.45vw, 0.65rem);
  line-height: 1.8;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0), -2px -2px 0 rgba(150, 8, 8, 0.98);
  opacity: 0;
}

.audio-hint__mask {
  width: 100%;
  overflow: hidden;
}

.audio-hint__text {
  display: inline-flex;
  gap: 2.75rem;
  white-space: nowrap;
  will-change: transform;
  animation: hintScroll 18s linear infinite;
}

.audio-hint.is-hidden {
  pointer-events: none;
}

.audio-hint.is-error {
  color: #ffffff;
}

@keyframes hintScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(calc(-50% - 1.375rem), 0, 0);
  }
}

.track-panel {
  position: absolute;
  left: 0.9rem;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  z-index: 6;
  width: fit-content;
  max-width: calc(100vw - 1.8rem);
  padding: 1rem 20px 1rem 1rem;
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.46), rgba(4, 4, 4, 0.66));
  box-shadow:
    0 0 30px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(214, 16, 16, 0.08);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
}

.phnyc-logo {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 6;
  display: block;
  width: min(11.7vw, 5.2rem);
  height: auto;
  opacity: 0.9;
}

.track-panel__header {
  margin-bottom: 0.7rem;
}

.track-panel__title {
  color: #ffffff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.68rem;
  line-height: 1.5;
  text-transform: uppercase;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0), -2px -2px 0 rgba(150, 8, 8, 0.98);
}

.track-panel__rule {
  width: 100%;
  height: 1px;
  margin-top: 4px;
  background: rgba(186, 12, 12, 0.95);
}

.track-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-items: start;
}

.track-list__item {
  display: block;
  width: 100%;
  text-align: left;
}

.track-list__link {
  position: relative;
  display: inline-block;
  width: auto;
  color: #ffffff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.54rem;
  line-height: 1.7;
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0), -2px -2px 0 rgba(150, 8, 8, 0.98);
  transition: opacity 180ms ease, color 180ms ease, text-shadow 180ms ease;
}

.track-list__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 0.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 420ms ease;
}

.track-list__item.is-active .track-list__link {
  color: #ffffff;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0), -2px -2px 0 rgba(168, 10, 10, 1);
}

.track-list__item.is-active .track-list__link::after {
  transform: scaleX(1);
}

.track-list__link:hover,
.track-list__link:focus-visible {
  color: #ffffff;
  text-shadow: 0 0 0 rgba(0, 0, 0, 0), -2px -2px 0 rgba(0, 0, 0, 0.98);
  outline: none;
}

.track-list__link:hover::after,
.track-list__link:focus-visible::after {
  transform: scaleX(1);
}

.touch-zone {
  z-index: 2;
  width: 50vw;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.touch-zone--left {
  right: 50%;
}

.touch-zone--right {
  left: 50%;
}

.touch-zone:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: -1px;
}

.screen-fx__aberration,
.screen-fx__scanlines,
.screen-fx__grain,
.screen-fx__vignette,
.screen-fx__transition {
  position: absolute;
  inset: 0;
}

.screen-fx__transition {
  background: #000000;
  opacity: 0;
  z-index: 30;
}

.screen-fx__aberration {
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: 0.24;
}

.screen-fx__aberration::before,
.screen-fx__aberration::after {
  content: "";
  position: absolute;
  inset: -1.25%;
  background:
    radial-gradient(circle at center, transparent 0%, transparent 58%, rgba(255, 255, 255, 0.018) 78%, rgba(255, 255, 255, 0.05) 100%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.012) 48%, rgba(255, 255, 255, 0.012) 52%, transparent 100%);
  opacity: 0.62;
  will-change: transform, opacity;
}

.screen-fx__aberration::before {
  background-blend-mode: screen;
  filter: blur(1px);
  transform: translate3d(-0.22%, 0, 0);
  background-color: rgba(255, 24, 24, 0.09);
}

.screen-fx__aberration::after {
  filter: blur(1.25px);
  transform: translate3d(0.22%, 0, 0);
  background-color: rgba(40, 110, 255, 0.08);
}

.screen-fx__scanlines {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.22;
}

.screen-fx__grain {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px);
  background-size: 11px 11px, 15px 15px, 17px 17px;
  mix-blend-mode: soft-light;
  opacity: 0.17;
  animation: grainShift 0.28s steps(2) infinite;
}

.screen-fx__vignette {
  background: radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.64) 100%);
}

@keyframes grainShift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1%, 0.7%);
  }
  50% {
    transform: translate(0.7%, -0.6%);
  }
  75% {
    transform: translate(-0.4%, 0.8%);
  }
  100% {
    transform: translate(0.8%, -0.4%);
  }
}

@media (min-width: 768px) {
  .brand-lockup {
    top: 1.35rem;
    left: 50%;
    right: auto;
    width: min(44rem, calc(100vw - 3rem));
    transform: translateX(-50%);
  }

  .brand-logo {
    width: min(100%, 38rem);
  }

  .album-cover-image {
    width: min(34vw, 25rem);
  }

  .audio-hint {
    width: min(100%, 38rem);
    font-size: clamp(0.5rem, 0.82vw, 0.72rem);
  }

  .track-panel {
    left: 1.5rem;
    bottom: 1.5rem;
    max-width: calc(100vw - 3rem);
  }

  .phnyc-logo {
    width: min(6.5vw, 5.525rem);
  }
}

@media (min-width: 1280px) {
  .brand-lockup {
    top: 1rem;
    width: min(48rem, calc(100vw - 4rem));
  }

  .brand-logo {
    width: min(100%, 42rem);
  }

  .album-cover-image {
    width: min(30vw, 26rem);
  }

  .audio-hint {
    width: min(100%, 42rem);
    font-size: clamp(0.5rem, 0.7vw, 0.75rem);
  }
}
