/* Game Controls */
#fullscreen-btn {
    backdrop-filter: blur(4px);
    background-color: rgba(37, 99, 235, 0.9);
    transition: all 0.2s ease-in-out;
}

#fullscreen-btn:hover {
    background-color: rgba(29, 78, 216, 0.95);
    transform: translateY(-1px);
}

/* Mobile optimizations for game controls */
@media (max-width: 640px) {
    #fullscreen-btn {
        padding: 0.5rem;
    }
    
    #fullscreen-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Fullscreen mode */
:fullscreen .iframe-container {
    padding-bottom: 0;
    height: 100vh;
}

:fullscreen .iframe-container iframe {
    border-radius: 0;
}

:fullscreen #fullscreen-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

:fullscreen #game-content:hover #fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}/* Custom styles */
.game-card {
    transition: transform 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
}

.game-modal {
    display: none;
}

.game-modal.active {
    display: block;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive iframe container */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Base styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Game grid layout */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Game card hover effects */
.game-card {
    transition: transform 0.2s ease-in-out;
}

.game-card:hover {
    transform: translateY(-4px);
}

/* Game iframe container */
.iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.5rem;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .game-card {
        margin-bottom: 1rem;
    }

    /* Show play button overlay on mobile */
    .game-card .absolute {
        opacity: 1 !important;
        background-color: rgba(0, 0, 0, 0.3) !important;
    }

    /* Adjust modal padding for mobile */
    #game-modal .p-4 {
        padding: 0.5rem;
    }

    /* Make close button more prominent on mobile */
    #close-modal {
        top: 0.5rem;
        right: 0.5rem;
        background-color: rgba(0, 0, 0, 0.5);
        padding: 0.5rem;
        border-radius: 50%;
    }
}

/* Fullscreen mode */
:fullscreen .iframe-container {
    padding-bottom: 0;
    height: 100vh;
}

:fullscreen .iframe-container iframe {
    border-radius: 0;
}

/* Game Controls */
#fullscreen-btn {
    backdrop-filter: blur(4px);
    background-color: rgba(37, 99, 235, 0.9);
    transition: all 0.2s ease-in-out;
}

#fullscreen-btn:hover {
    background-color: rgba(29, 78, 216, 0.95);
    transform: translateY(-1px);
}

/* Mobile optimizations for game controls */
@media (max-width: 640px) {
    #fullscreen-btn {
        padding: 0.5rem;
    }
    
    #fullscreen-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

:fullscreen #fullscreen-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

:fullscreen #game-content:hover #fullscreen-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Loading state */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
