.stage {
  position: relative;
  display: grid;
  width: min(
    100vw,
    calc(100vh * 720 / 480),
    var(--game-width)
  );
  aspect-ratio: 720 / 480;
  height: auto;
  overflow: hidden;
  z-index: 5;
}

.stage > canvas,
.stage > .game-overlay,
.stage > .overlay {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
  transform: rotateX(2deg);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.25);
  animation: pulseCanvas 4s ease-in-out infinite;
}

@keyframes pulseCanvas {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.5);
  }
}

.stage:hover #canvas {
  transform: rotateX(2deg) !important;
  transition: none !important;
}

.stage::after {
  content: none !important;
}

.shake {
  animation: none !important;
}

.game-over-content,
.you-won-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.game-over-content img,
.you-won-content img {  
  height: 250px;      
  object-fit: contain;
  display: block;
}

.mobile-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: none;          
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px;
  box-sizing: border-box;
  pointer-events: none;    
  z-index: 10;
}

.mobile-controls-left,
.mobile-controls-right {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}
