/* TBGStack page – the game box itself is in css/game-stage.css */

.stage {
  /* Sky: purple city haze at the bottom, darker higher up */
  background: linear-gradient(to top, #2a1368 0%, #1b0f4a 45%, #0a0720 100%);
}

/* Phones held upright: a tall game box, because the tower grows upward */
@media (max-aspect-ratio: 1/1) {
  .stage {
    aspect-ratio: 3 / 4;
  }
}

/* Space: a dark sky with stars, faded in by tbgstack.js as the tower grows */
.space {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 27% 62%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 41% 33%, var(--cyan), transparent),
    radial-gradient(1px 1px at 55% 12%, #fff, transparent),
    radial-gradient(2px 2px at 68% 48%, var(--yellow), transparent),
    radial-gradient(1px 1px at 79% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 71%, var(--magenta), transparent),
    radial-gradient(1px 1px at 8% 84%, #fff, transparent),
    radial-gradient(1px 1px at 35% 90%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 93% 40%, #fff, transparent),
    radial-gradient(1px 1px at 61% 80%, #fff, transparent),
    radial-gradient(1px 1px at 19% 44%, #fff, transparent),
    linear-gradient(to bottom, #04030d, #0a0720);
}

.stage canvas {
  position: relative;                     /* above the stars */
  cursor: pointer;
}

/* The score: one big number at the top, like the original */
.stack-score {
  position: absolute;
  top: calc(0.4rem + var(--safe-top));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.stack-score strong {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 14px rgba(255, 233, 77, 0.6);
}

.stack-score span {
  font-size: 0.85rem;
}

.stack-score b {
  color: var(--cyan);
}

/* "PERFEKT!" pops up for a moment after a perfect drop */
.perfect {
  position: absolute;
  top: calc(5.8rem + var(--safe-top));     /* just under the score */
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  text-transform: uppercase;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 233, 77, 0.8), 0 0 2px #000;
  opacity: 0;
  pointer-events: none;
}

.perfect.show {
  animation: perfect-pop 0.7s ease-out;
}

@keyframes perfect-pop {
  0% { opacity: 1; transform: scale(0.7); }
  25% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1) translateY(-1.5rem); }
}

/* The game over screen is see-through, so you can admire your tower behind it */
.overlay.overlay-light {
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(14, 10, 36, 0.9) 0%, rgba(14, 10, 36, 0.55) 45%, transparent 75%);
}
