
:root {
  --bg: #050816;
  --panel: rgba(5, 10, 24, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, 0.72);
  --soft: rgba(255, 255, 255, 0.08);
  --accent: #ffffff;
  --accent-text: #050816;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
body.landing {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.12), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 50%, #050816 100%);
}

.stage {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(180deg, #0b1021 0%, #050816 100%);
  overflow: hidden;
}

canvas,
video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

video {
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#lensMaskLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(6px);
  z-index: 12;
}

.overlay.hidden,
.hud.hidden,
.spinner.hidden,
.countdown.hidden,
#secondaryBtn.hidden,
#primaryBtn.hidden {
  display: none !important;
}

.panel,
.landing-card {
  width: min(100%, 720px);
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel {
  text-align: center;
}

.badge,
.hud-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#overlayTitle,
.landing-card h1 {
  margin: 18px 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
}

#overlayMessage,
.landing-card p,
.footnote {
  margin: 0 auto;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.5;
  font-size: 16px;
}

.actions,
.landing-actions,
.hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.actions,
.landing-actions {
  margin-top: 24px;
}

.btn,
.hud-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.btn:hover,
.hud-btn:hover,
.btn:focus-visible,
.hud-btn:focus-visible {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn.ghost,
.hud-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn:disabled,
.hud-btn:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 24px auto 0;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.14);
  border-top-color: rgba(255,255,255,0.95);
  animation: spin 1s linear infinite;
}

.countdown {
  margin-top: 22px;
  font-size: clamp(56px, 14vw, 108px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.footnote {
  margin-top: 18px;
  font-size: 14px;
}

.hud {
  position: absolute;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  z-index: 14;
}

.hud-actions {
  padding: 8px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.56);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
}

.landing-card {
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .panel,
  .landing-card {
    padding: 22px;
    border-radius: 22px;
  }

  .actions,
  .landing-actions,
  .hud-actions {
    flex-direction: column;
  }

  .btn,
  .hud-btn {
    width: 100%;
  }

  .hud {
    width: calc(100% - 24px);
  }

  .hud-actions {
    width: 100%;
  }
}
