.splash-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(229, 9, 20, 0.1), transparent 30%),
    linear-gradient(180deg, #090909 0%, #000 100%);
  isolation: isolate;
}

.splash-light-rails,
.splash-light-streaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.rail {
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: clamp(20px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 87, 67, 0.95) 18%, rgba(88, 0, 0, 0.96) 90%);
  box-shadow: 0 0 22px rgba(255, 68, 45, 0.5), 0 0 68px rgba(229, 9, 20, 0.28);
  opacity: 0;
  transform-origin: center;
  filter: blur(0.2px);
}

.rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.36));
  mix-blend-mode: screen;
  opacity: 0.82;
}

.rail-left {
  left: 34%;
  animation: railEnterLeft 1.4s cubic-bezier(0.18, 0.72, 0.2, 1) 0.05s forwards;
}

.rail-center {
  left: 50%;
  width: clamp(28px, 4vw, 44px);
  margin-left: calc(clamp(28px, 4vw, 44px) / -2);
  animation: railPulse 1.2s ease 0.88s forwards;
}

.rail-right {
  right: 34%;
  animation: railEnterRight 1.4s cubic-bezier(0.18, 0.72, 0.2, 1) 0.26s forwards;
}

.streak {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 188, 182, 0.8) 30%, rgba(255, 75, 44, 0.35) 70%, rgba(255, 255, 255, 0));
  box-shadow: 0 0 18px rgba(255, 98, 74, 0.4);
}

.streak-1 {
  left: 21%;
  animation: streakSweep 1.25s linear 0.42s forwards;
}

.streak-2 {
  left: 39%;
  animation: streakSweep 1.15s linear 0.7s forwards;
}

.streak-3 {
  left: 50%;
  animation: streakFlash 0.7s ease 1.22s forwards;
}

.streak-4 {
  right: 37%;
  animation: streakSweep 1.1s linear 0.92s forwards;
}

.streak-5 {
  right: 18%;
  animation: streakSweep 1.25s linear 0.52s forwards;
}

.splash-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: sweep 1.7s ease 0.95s forwards, layerFadeOut 0.2s linear 1.9s forwards;
}

.splash-screen::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.18), transparent 55%);
  animation: ambientPulse 3.2s ease-in-out infinite alternate;
  z-index: -1;
}

.splash-screen.is-complete {
  animation: screenFade 0.8s ease forwards;
}

.splash-letter {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: min(38vw, 250px);
  aspect-ratio: 0.68;
  animation: letterZoom 3.2s ease-out forwards;
  filter: drop-shadow(0 0 22px rgba(229, 9, 20, 0.72)) drop-shadow(0 0 72px rgba(229, 9, 20, 0.24));
}

.s-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: min(38vw, 250px);
  line-height: 1;
  transform-origin: center;
  user-select: none;
}

.s-letter-shadow {
  color: #490006;
  opacity: 0;
  transform: translateX(-10px) skewY(-4deg);
  animation: shadowRise 0.5s ease 1.35s forwards;
}

.s-letter-core {
  color: #b20710;
  background: linear-gradient(90deg, #730009 0%, #b10610 22%, #ff2d1f 50%, #b10610 76%, #6f0008 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: scaleX(0.86);
  transform-origin: center;
  animation: coreSettle 0.55s ease 1.55s forwards;
}

.s-letter-highlight {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 49%, rgba(255, 255, 255, 0) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  mix-blend-mode: screen;
  opacity: 0;
  transform: scaleX(0.82);
  animation: highlightPulse 0.9s ease 1.95s forwards;
}

.s-letter-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 90, 75, 0.95);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  animation: outlineDraw 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s forwards, pathFade 0.35s linear 1.55s forwards;
}

.splash-sound-wave {
  position: absolute;
  bottom: max(48px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
  align-items: end;
}

.splash-sound-wave span {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--red));
  animation: wave 0.7s ease-in-out infinite alternate;
}

.splash-sound-wave span:nth-child(1) {
  height: 12px;
  animation-delay: 0s;
}

.splash-sound-wave span:nth-child(2) {
  height: 20px;
  animation-delay: 0.1s;
}

.splash-sound-wave span:nth-child(3) {
  height: 28px;
  animation-delay: 0.2s;
}

.splash-sound-wave span:nth-child(4) {
  height: 18px;
  animation-delay: 0.28s;
}

.splash-sound-wave span:nth-child(5) {
  height: 24px;
  animation-delay: 0.16s;
}

.splash-copy {
  position: absolute;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 36px));
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  color: var(--gray);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  animation: copyReveal 0.9s ease 1.55s forwards;
}

.splash-screen[data-audio-ready="true"] .splash-copy::after {
  content: "  sound on";
  color: rgba(255, 255, 255, 0.32);
}

@keyframes letterZoom {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  70% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.96;
    transform: scale(14);
  }
}

@keyframes outlineDraw {
  0% {
    opacity: 1;
    clip-path: inset(0 100% 0 0);
  }

  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes railEnterLeft {
  0% {
    opacity: 0;
    transform: perspective(420px) rotateY(28deg) scaleY(0.2);
  }

  25% {
    opacity: 0.95;
  }

  100% {
    opacity: 0.1;
    transform: perspective(420px) rotateY(6deg) translateX(-24px) scaleY(1);
  }
}

@keyframes railEnterRight {
  0% {
    opacity: 0;
    transform: perspective(420px) rotateY(-28deg) scaleY(0.2);
  }

  25% {
    opacity: 0.95;
  }

  100% {
    opacity: 0.1;
    transform: perspective(420px) rotateY(-6deg) translateX(24px) scaleY(1);
  }
}

@keyframes railPulse {
  0% {
    opacity: 0;
    transform: scaleY(0.1);
  }

  30% {
    opacity: 1;
    transform: scaleY(1);
  }

  100% {
    opacity: 0.14;
    transform: scaleY(1);
  }
}

@keyframes streakSweep {
  0% {
    opacity: 0;
    transform: scaleY(0.22) translateY(20%);
  }

  25% {
    opacity: 0.38;
  }

  100% {
    opacity: 0;
    transform: scaleY(1) translateY(-10%);
  }
}

@keyframes streakFlash {
  0% {
    opacity: 0;
    transform: scaleX(1);
  }

  35% {
    opacity: 0.22;
    transform: scaleX(4);
  }

  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes layerFadeOut {
  to {
    opacity: 0;
  }
}

@keyframes shadowRise {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes coreSettle {
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes highlightPulse {
  0% {
    opacity: 0;
    transform: translateX(-8px) scaleX(0.78);
  }

  55% {
    opacity: 0.95;
  }

  100% {
    opacity: 0.42;
    transform: translateX(2px) scaleX(0.9);
  }
}

@keyframes pathFade {
  to {
    opacity: 0;
  }
}

@keyframes wave {
  to {
    height: 7px;
  }
}

@keyframes copyReveal {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes ambientPulse {
  from {
    opacity: 0.55;
    transform: scale(0.96);
  }

  to {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

@keyframes sweep {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }

  to {
    opacity: 1;
    transform: translateX(100%);
  }
}

@keyframes screenFade {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (min-width: 768px) {
  .splash-copy {
    font-size: 0.9rem;
  }
}
