:root {
  color-scheme: dark;
  --accent: #7c5cff;
  --accent-2: #2ee6d6;
}

* { box-sizing: border-box; }

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

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#fade.on { opacity: 1; }

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at center, rgba(40, 30, 80, 0.85), rgba(0, 0, 0, 0.95));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.5s ease;
  z-index: 10;
}
#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  max-width: 460px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: 1.05rem; line-height: 1.5; margin: 0 0 0.8em; }
.hint { font-size: 0.85rem; opacity: 0.7; line-height: 1.45; margin: 0 0 1.6em; }

button.primary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 16px 34px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #ff5c9a);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button.primary:hover, button.primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(124, 92, 255, 0.6);
  outline: none;
}
button.primary:active { transform: scale(0.97); }

.secondary {
  display: block;
  margin-top: 1.2em;
  font-size: 0.9rem;
  opacity: 0.75;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.secondary input { display: none; }

.error {
  margin-top: 1.2em;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 80, 80, 0.15);
  border: 1px solid rgba(255, 80, 80, 0.4);
  font-size: 0.9rem;
  line-height: 1.4;
}

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
#scene-name {
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
#scene-name.show { opacity: 0.9; }
#hint {
  margin-top: 6px;
  padding: 0 16px;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
#hint.show { opacity: 0.55; }

#nosignal {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  text-align: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  z-index: 5;
  pointer-events: none;
}
