/* ===== GAME CONTAINER ===== */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin: 1rem auto;
    width: calc(100% - 2rem);
    max-width: 1200px;
    position: relative;
}

/* ===== GAME HEADER ===== */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.game-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-header h2 {
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-header h2 .game-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.game-header h2 .game-icon svg {
    width: 100%;
    height: 100%;
}

/* ===== CANVAS WRAPPER ===== */
.game-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.game-canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== GAME CONTROLS ===== */
.game-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.game-controls .btn {
    min-width: 120px;
}

/* ===== GAME OVERLAY ===== */
.game-ui-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    gap: 1rem;
    z-index: 10;
    padding: 2rem;
}

.game-ui-overlay h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.game-ui-overlay p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ===== MOBILE CONTROLS ===== */
.mobile-controls {
    display: none;
    width: 100%;
    max-width: 400px;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
}

@media (hover: none) and (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}

.ctrl-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--cyan);
    color: var(--cyan);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: manipulation;
}

.ctrl-btn:active {
    background: var(--cyan);
    color: var(--bg-primary);
}

/* ===== FULLSCREEN STYLES - ONLY APPLIED WHEN .is-fullscreen CLASS EXISTS ===== */
.game-canvas-wrapper.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    border-radius: 0 !important;
    border: none !important;
    aspect-ratio: auto !important;
    z-index: 1000;
}

.game-canvas-wrapper.is-fullscreen canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* When in fullscreen, hide the rest of the game UI */
.game-container:has(.is-fullscreen) .game-header,
.game-container:has(.is-fullscreen) .game-controls,
.game-container:has(.is-fullscreen) .mobile-controls {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        gap: 1rem;
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
    }
    
    .game-header h2 {
        font-size: 1.4rem;
    }
    
    .game-controls .btn {
        min-width: 100px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}