.game-viewport {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 90vw;
    height: 80vh;
    max-height: 900px; /* Reasonable cap */
    border-radius: 12px;
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    border: 4px solid white;
}

.game-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--sky-gradient);
    overflow: hidden;
}

.game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.stats-container {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.score-display, .lives-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.lives-display {
    font-size: 1.2rem;
}

/* State-based UI Visibility */
.game-viewport[data-state="PLAYING"] .overlay {
    display: none;
}

.game-viewport[data-state="START"] .game-over-screen {
    display: none;
}

.game-viewport[data-state="GAMEOVER"] .start-screen {
    display: none;
}
