﻿#title.title-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  width: 100%;
  max-width: none;
  background: #060608;
}

#title.title-screen[hidden] {
  display: none !important;
}

.title-stage {
  position: relative;
  z-index: 1;
  padding: 0 0.2em;
  overflow: visible;
}

.title-beam-pivot {
  position: absolute;
  left: 50%;
  top: -310%;
  width: min(130vw, 840px);
  height: 640px;
  margin-left: calc(min(130vw, 840px) / -2);
  transform: rotate(0deg);
  transform-origin: 50% 0%;
  pointer-events: none;
  z-index: 0;
}

.title-beam {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.9;
  background: linear-gradient(
    to bottom,
    rgba(255, 240, 170, 0.95) 0%,
    rgba(255, 215, 110, 0.55) 50%,
    rgba(255, 195, 80, 0.15) 85%,
    transparent 100%
  );
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.title-player-shadow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #101014 0%, #08080c 85%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.45);
  z-index: 1;
  pointer-events: none;
}

.title-player-shadow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 2px;
  margin-top: -1px;
  background: #0a0a0e;
  transform-origin: 0 50%;
  transform: rotate(90deg);
  border-radius: 1px;
  opacity: 0.7;
}

@keyframes title-beam-patrol-a {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  25% {
    transform: rotate(-58deg);
    animation-timing-function: ease-in-out;
  }
  75% {
    transform: rotate(58deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes title-beam-patrol-b {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  20% {
    transform: rotate(-54deg);
    animation-timing-function: ease-in-out;
  }
  34% {
    transform: rotate(-54deg);
    animation-timing-function: ease-in-out;
  }
  70% {
    transform: rotate(50deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes title-beam-patrol-c {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  18% {
    transform: rotate(52deg);
    animation-timing-function: ease-in-out;
  }
  58% {
    transform: rotate(-50deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes title-beam-patrol-d {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  36% {
    transform: rotate(-62deg);
    animation-timing-function: ease-in-out;
  }
  50% {
    transform: rotate(-62deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes title-beam-patrol-e {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  14% {
    transform: rotate(48deg);
    animation-timing-function: ease-in-out;
  }
  24% {
    transform: rotate(26deg);
    animation-timing-function: ease-in-out;
  }
  42% {
    transform: rotate(-56deg);
    animation-timing-function: ease-in-out;
  }
  72% {
    transform: rotate(44deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes title-beam-patrol-f {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-in-out;
  }
  28% {
    transform: rotate(-46deg);
    animation-timing-function: ease-in-out;
  }
  46% {
    transform: rotate(54deg);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: rotate(0deg);
  }
}

.title-logo {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(2.8rem, 10vw, 4.2rem);
  letter-spacing: 0.22em;
  color: #060608;
  user-select: none;
  pointer-events: none;
}

.title-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: min(320px, 88vw);
}

#title .title-footer input {
  width: 100%;
  padding: 10px 14px;
  background: #0a0a0c;
  border: 1px solid #333;
  color: #eee;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  outline: none;
}

#title .title-footer input:focus {
  border-color: #666;
}

#title #play-btn {
  width: 100%;
  padding: 12px 32px;
  background: #060608;
  border: 1px solid #555;
  color: #ccc;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

#title #play-btn:hover:not(:disabled) {
  border-color: #fff;
  color: #fff;
}

.menu-screen[hidden] {
  display: none !important;
}

.status-line {
  font-size: 0.7rem;
  color: #555;
  letter-spacing: 0.08em;
  text-align: center;
  min-height: 1.2em;
}
