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

/* ── Base ── */
html { height: 100%; }

body {
  background: #1a1a2e;
  color: #f0e6d3;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── Background layers ── */
.bg-stars,
.bg-trees,
.firefly-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-stars { z-index: 0; }
.bg-trees { z-index: 1; overflow: hidden; }

.bg-trees::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10vh;
  height: 10dvh;
  background: #0a0a14;
}
.firefly-container { z-index: 2; }

/* ── Stars (box-shadow scatter) ── */
.bg-stars::before,
.bg-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.bg-stars::before {
  width: 1px;
  height: 1px;
  box-shadow:
    24vw 8vh 0 0 rgba(255,255,255,0.6),
    72vw 12vh 0 0 rgba(255,255,255,0.4),
    15vw 25vh 0 0 rgba(255,255,255,0.3),
    88vw 22vh 0 1px rgba(255,255,255,0.7),
    45vw 5vh 0 0 rgba(255,255,255,0.5),
    60vw 35vh 0 0 rgba(255,255,255,0.3),
    33vw 18vh 0 1px rgba(255,255,255,0.6),
    8vw 42vh 0 0 rgba(255,255,255,0.4),
    92vw 38vh 0 0 rgba(255,255,255,0.3),
    50vw 15vh 0 0 rgba(255,255,255,0.5),
    78vw 48vh 0 1px rgba(255,255,255,0.4),
    20vw 55vh 0 0 rgba(255,255,255,0.3),
    67vw 52vh 0 0 rgba(255,255,255,0.5),
    5vw 65vh 0 0 rgba(255,255,255,0.4),
    40vw 60vh 0 1px rgba(255,255,255,0.6),
    85vw 58vh 0 0 rgba(255,255,255,0.3),
    55vw 72vh 0 0 rgba(255,255,255,0.4),
    12vw 78vh 0 0 rgba(255,255,255,0.5),
    95vw 70vh 0 1px rgba(255,255,255,0.3),
    30vw 82vh 0 0 rgba(255,255,255,0.4),
    70vw 88vh 0 0 rgba(255,255,255,0.3),
    48vw 92vh 0 0 rgba(255,255,255,0.5),
    3vw 30vh 0 0 rgba(255,255,255,0.4),
    58vw 44vh 0 0 rgba(255,255,255,0.3),
    82vw 6vh 0 0 rgba(255,255,255,0.5);
}

.bg-stars::after {
  width: 1px;
  height: 1px;
  box-shadow:
    37vw 3vh 0 0 rgba(255,255,255,0.3),
    63vw 9vh 0 0 rgba(255,255,255,0.4),
    10vw 17vh 0 0 rgba(255,255,255,0.5),
    90vw 14vh 0 1px rgba(255,255,255,0.6),
    27vw 33vh 0 0 rgba(255,255,255,0.3),
    76vw 28vh 0 0 rgba(255,255,255,0.4),
    42vw 40vh 0 1px rgba(255,255,255,0.5),
    18vw 48vh 0 0 rgba(255,255,255,0.3),
    97vw 45vh 0 0 rgba(255,255,255,0.4),
    54vw 56vh 0 0 rgba(255,255,255,0.3),
    6vw 62vh 0 0 rgba(255,255,255,0.5),
    80vw 67vh 0 1px rgba(255,255,255,0.4),
    35vw 74vh 0 0 rgba(255,255,255,0.3),
    65vw 80vh 0 0 rgba(255,255,255,0.4),
    22vw 86vh 0 0 rgba(255,255,255,0.3),
    73vw 94vh 0 1px rgba(255,255,255,0.5),
    47vw 20vh 0 0 rgba(255,255,255,0.4),
    2vw 50vh 0 0 rgba(255,255,255,0.3),
    87vw 76vh 0 0 rgba(255,255,255,0.4),
    53vw 30vh 0 0 rgba(255,255,255,0.3),
    16vw 90vh 0 0 rgba(255,255,255,0.5),
    68vw 64vh 0 0 rgba(255,255,255,0.3),
    44vw 85vh 0 1px rgba(255,255,255,0.4),
    25vw 10vh 0 0 rgba(255,255,255,0.5),
    83vw 42vh 0 0 rgba(255,255,255,0.3);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: 0.5; }
  50%  { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ── Pine tree silhouettes (SVG) ── */
.bg-trees svg {
  position: absolute;
  bottom: 10vh;
  bottom: 10dvh;
  left: 0;
  width: 100%;
  height: auto;
}

/* ── Content ── */
.content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.tagline {
  color: #b8a9c9;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ── Install hero ── */
.install-hero {
  margin: 1.5rem 0 2.5rem;
  text-align: center;
}

.install-btn-hero {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: rgba(126, 200, 227, 0.15);
  border: 1px solid rgba(126, 200, 227, 0.3);
  border-radius: 12px;
  color: #7ec8e3;
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.install-btn-hero:hover {
  background: rgba(126, 200, 227, 0.22);
  transform: translateY(-2px);
}

.install-btn-hero:active { transform: scale(0.98); }

.install-hint {
  color: #b8a9c9;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.install-ios {
  color: #b8a9c9;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.install-ios strong { color: #f0e6d3; }

.hidden { display: none; }

.play-in-peace {
  color: rgba(184, 169, 201, 0.4);
  font-size: 0.85rem;
  margin-top: 1.5rem;
  font-style: italic;
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  flex-shrink: 0;
  pointer-events: none;
}

.site-footer a,
.site-footer span {
  pointer-events: auto;
}

.site-footer a {
  color: rgba(184, 169, 201, 0.25);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.3s;
}

.site-footer a:hover {
  color: rgba(184, 169, 201, 0.6);
}

.site-footer .version {
  color: rgba(184, 169, 201, 0.2);
  font-size: 0.75rem;
}

/* ── Fireflies ── */
.firefly {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe832 0%, rgba(255, 232, 50, 0) 60%);
  box-shadow: 0 0 4px 1px rgba(255, 232, 50, 0.9), 0 0 10px 3px rgba(255, 232, 50, 0.5);
  will-change: transform, opacity;
}

/* ── No-ads page ── */
.page-content {
  position: relative;
  z-index: 5;
  max-width: 520px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.page-content h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.page-content p {
  color: #b8a9c9;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: #b8a9c9;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: #f0e6d3;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .content { padding: 2rem 0.75rem 2rem; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .game-card { padding: 1rem 0.75rem; }
  .game-tagline { font-size: 0.8rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .bg-stars::after {
    animation: none;
    opacity: 0.7;
  }
  .firefly {
    will-change: auto;
  }
}
