:root {
  --ink: #eaf2f5;
  --accent: #7fd8c9;
  --danger: #ff5d4d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #02030a;
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* durante el clip, el cursor es la luz dibujada en el canvas */
body.playing { cursor: none; }
body.playing #end-screen.visible { cursor: auto; }

/* ---------- lyric layer ---------- */

#lyric-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

#lyric-line {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  font-weight: 420;
  font-variation-settings: 'opsz' 90;
  letter-spacing: 0.015em;
  text-align: center;
  max-width: 84vw;
  line-height: 1.22;
  color: var(--ink);
  opacity: 0;
  transform: translateY(calc(11vh + 18px)) scale(0.985);
  filter: blur(7px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.3, 1),
              filter 0.8s ease, color 0.7s ease;
  text-shadow: 0 0 34px rgba(127, 216, 201, 0.4), 0 2px 22px rgba(0, 0, 0, 0.8);
}

#lyric-line.visible {
  opacity: 1;
  transform: translateY(11vh) scale(1);
  filter: blur(0);
}

#lyric-line.shout {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 4.1rem);
  text-shadow: 0 0 42px rgba(255, 93, 77, 0.55), 0 2px 22px rgba(0, 0, 0, 0.85);
}

#lyric-line.whisper {
  font-style: italic;
  font-weight: 340;
  letter-spacing: 0.06em;
  opacity: 0.88;
}

/* ---------- white flash layer ---------- */

#flash-layer {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

/* ---------- entry gate ---------- */

#gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(20, 60, 70, 0.55), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(60, 18, 30, 0.5), transparent 65%),
    #03040c;
  transition: opacity 1.6s ease;
}

#gate.leaving { opacity: 0; pointer-events: none; }

.gate-inner {
  text-align: center;
  animation: gate-rise 1.8s ease both;
}

@keyframes gate-rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gate-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: rgba(234, 242, 245, 0.45);
  margin-bottom: 2.2rem;
}

.gate-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 6.2rem);
  line-height: 1.02;
  letter-spacing: 0.05em;
  background: linear-gradient(165deg, #f4fbfa 20%, #7fd8c9 55%, #2a6f78 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 38px rgba(127, 216, 201, 0.22));
}

.gate-sub {
  margin-top: 1.6rem;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: rgba(234, 242, 245, 0.55);
  letter-spacing: 0.08em;
}

#enter-btn, #replay-btn {
  margin-top: 3.2rem;
  padding: 1.05rem 4.4rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(127, 216, 201, 0.5);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
  animation: btn-breathe 3.2s ease-in-out infinite;
}

@keyframes btn-breathe {
  0%, 100% { box-shadow: 0 0 18px rgba(127, 216, 201, 0.12), inset 0 0 14px rgba(127, 216, 201, 0.06); }
  50%      { box-shadow: 0 0 42px rgba(127, 216, 201, 0.32), inset 0 0 22px rgba(127, 216, 201, 0.14); }
}

#enter-btn:hover, #replay-btn:hover {
  border-color: rgba(127, 216, 201, 1);
  transform: translateY(-2px);
}

#enter-btn:active, #replay-btn:active { transform: translateY(0) scale(0.98); }

.gate-hint {
  margin-top: 1.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: rgba(234, 242, 245, 0.3);
  text-transform: uppercase;
}

/* ---------- end screen ---------- */

#end-screen {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #02030a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2.4s ease;
}

#end-screen.visible { opacity: 1; pointer-events: auto; }

.end-inner { text-align: center; }

.end-line, .end-line2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: 0.06em;
  color: rgba(234, 242, 245, 0.85);
}

.end-line2 {
  font-style: italic;
  color: var(--accent);
  margin-top: 0.4rem;
}

@media (max-width: 600px) {
  #enter-btn, #replay-btn { padding: 0.9rem 3rem; }
}
