/* Game Section Styles */
.game-section {
    background-color: #f5f5f5;
    padding: 60px 20px;
}

.game-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 95vw;
    position: relative;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #1a1a2e;
    /* Maintain 16:9 aspect ratio */
    aspect-ratio: 16 / 9;
    /* Pixelated rendering for sharp scaling - browser-specific prefixes */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    -webkit-font-smoothing: none;
    font-smooth: never;
    /* Touch optimization for iOS */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* Prevent scaling issues on iOS Safari */
    -webkit-user-scalable: no;
    /* Prevent text selection on long press (iOS) */
    -webkit-tap-highlight-color: transparent;
    /* Ensure swipe gestures are handled by the game */
    touch-action: none;
    -ms-touch-action: none;
    /* Better performance */
    will-change: transform;
    transform: translateZ(0);
}

/* Fullscreen container sizing */
.game-container:fullscreen,
.game-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* Canvas inside fullscreen container: let JS control sizing */
.game-container:fullscreen #gameCanvas,
.game-container:-webkit-full-screen #gameCanvas {
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

/* Small mobile devices */
@media (max-width: 480px) {
    .game-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    #gameCanvas {
        border-radius: 4px;
    }
    
    .fullscreen-btn {
        bottom: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Medium screens (tablets) */
@media (min-width: 481px) and (max-width: 768px) {
    .game-container {
        max-width: 500px;
    }
}

/* Large screens (desktop) */
@media (min-width: 769px) {
    .game-container {
        max-width: 800px;
    }
}

/* Extra large screens */
@media (min-width: 1200px) {
    .game-container {
        max-width: 960px;
    }
}

