html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Segoe UI", system-ui, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  touch-action: none;
}

@supports not (height: 100dvh) {
  #app,
  canvas {
    height: 100vh;
  }
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(ellipse at center, rgba(255, 237, 218, 0.05) 0%, rgba(255, 237, 218, 0) 38%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 48%, rgba(23, 13, 22, 0.38) 100%);
}

.grain {
  position: fixed;
  inset: -60px;
  pointer-events: none;
  z-index: 6;
  opacity: 0.092;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-18px, 10px); }
  50% { transform: translate(12px, -14px); }
  75% { transform: translate(-8px, -8px); }
  100% { transform: translate(0, 0); }
}

.dot {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  z-index: 7;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

body.playing .dot {
  opacity: 1;
}

#prompt {
  position: fixed;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 8;
  color: #f7f2f0;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

#prompt.visible {
  opacity: 1;
}

#musicStatus {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 8;
  color: rgba(246, 238, 228, 0.72);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s;
}

body.playing #musicStatus {
  opacity: 1;
}

#transitionFade {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, rgba(255, 206, 234, 0.95), rgba(59, 255, 238, 0.30) 42%, rgba(4, 8, 12, 0.96) 100%);
  mix-blend-mode: screen;
  transition: opacity 0.8s ease;
}

#transitionFade.active {
  opacity: 1;
}

#overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  background: rgba(4, 6, 8, 0.93);
  transition: opacity 0.8s;
  color: #e9f2f3;
  touch-action: none;
}

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

#overlay h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #eef6f7;
  text-shadow: 0 0 26px rgba(140, 220, 220, 0.35), 0 0 60px rgba(255, 150, 200, 0.25);
}

#overlay .sub {
  color: #8fd0cd;
  font-size: 17px;
  letter-spacing: 0.12em;
}

#overlay .hint {
  margin-top: 26px;
  color: #ffc4da;
  font-size: 18px;
  animation: pulse 2.4s ease-in-out infinite;
}

#overlay .controls {
  margin-top: 8px;
  color: #8aa1a2;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0 20px;
  max-width: 760px;
  line-height: 1.65;
}

@keyframes pulse {
  0%,
  100% { opacity: 0.45; }
  50% { opacity: 1; }
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c0d;
  color: #6fa9a5;
  font-size: 15px;
  letter-spacing: 0.2em;
  transition: opacity 0.5s;
}

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

@media (hover: none), (pointer: coarse) {
  #overlay {
    gap: 10px;
  }

  #overlay h1 {
    font-size: clamp(34px, 11vw, 60px);
    letter-spacing: 0.14em;
    text-indent: 0.14em;
  }

  #overlay .sub,
  #overlay .controls,
  #prompt,
  #musicStatus {
    display: none;
  }

  #overlay .hint {
    margin-top: 18px;
    font-size: 16px;
    letter-spacing: 0.08em;
    line-height: 1.65;
    text-align: center;
  }
}
