.page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
  transition: transform 0.25s ease;
}

body.leaving .page {
  transform: scale(0.985);
}

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.home-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 20px 26dvh;
  text-align: center;
}

.home-content > * {
  animation: fadeInUp 0.55s cubic-bezier(0.33, 1, 0.68, 1) backwards;
}

.home-content > :nth-child(1) { animation-delay: 0.05s; }
.home-content > :nth-child(2) { animation-delay: 0.13s; }
.home-content > :nth-child(3) { animation-delay: 0.21s; }
.home-content > :nth-child(4) { animation-delay: 0.29s; }
.home-content > :nth-child(5) { animation-delay: 0.37s; }
.home-content > :nth-child(6) { animation-delay: 0.45s; }
.home-content > :nth-child(7) { animation-delay: 0.53s; }

#play-btn {
  animation: fadeInUp 0.55s cubic-bezier(0.33, 1, 0.68, 1) 0.21s backwards, glowPulse 2.8s ease-out 1.4s infinite;
}

.tagline {
  font-size: clamp(0.95rem, 3.2vmin, 1.15rem);
  font-weight: 500;
  color: var(--sky-meta);
  transition: color 0.6s ease;
}

.home-content h1 {
  color: var(--sky-text);
  transition: color 0.6s ease;
}

.home-content .button {
  margin-top: 6px;
}

.home-nav {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 20;
  display: flex;
  gap: 8px;
}

.nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  transition: background 0.2s ease, transform 0.15s ease;
  animation: fadeInUp 0.5s cubic-bezier(0.33, 1, 0.68, 1) backwards;
}

.nav-button:nth-child(2) { animation-delay: 0.06s; }
.nav-button:nth-child(3) { animation-delay: 0.12s; }
.nav-button:nth-child(4) { animation-delay: 0.18s; }

.nav-button:hover,
.nav-button.hover {
  background: var(--button-secondary-bg-hover);
}

.nav-button:active {
  transform: scale(0.95);
}

.nav-button svg {
  flex-shrink: 0;
  display: block;
}

.nav-label {
  display: none;
}

.secondary-button.compact {
  position: relative;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
}

.badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--hazard);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  animation: badgePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards, badgeRing 2.2s ease-out 0.8s infinite;
}

.home-best {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sky-meta);
  transition: color 0.6s ease;
  min-height: 1.2em;
}

.key-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.key-chip {
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--meta-text);
}

.key-chip kbd {
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--secondary-bg);
  border-radius: 6px;
  padding: 1px 7px;
}

.credits-container {
  position: absolute;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ground-text);
  text-align: center;
  pointer-events: none;
}

.credits-copyright {
  font-family: sans-serif;
}

.credits-container a {
  pointer-events: auto;
}

.credits-link {
  color: var(--ground-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.credits-link:hover {
  color: var(--accent-soft);
}

@media (max-height: 480px) {
  .home-content {
    gap: 8px;
    padding-bottom: 14dvh;
  }
  .home-content .button {
    margin-top: 2px;
  }
}