/* Game Security Enhancements */

/* Hide console errors from showing in browser for users */
.game-container {
    position: relative;
    overflow: hidden;
}

/* Enhanced iframe security styling */
.game-container iframe {
    border: none;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: inherit;
}

/* Loading overlay for games with errors */
.game-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1000;
    border-radius: inherit;
}

.game-error-overlay h3 {
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.game-error-overlay p {
    margin-bottom: 1rem;
    opacity: 0.8;
}

.game-error-retry {
    padding: 0.5rem 1rem;
    background: var(--primary-color, #6C5CE7);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

/* Console error prevention CSS (for webkit) */
@media screen {
    .console-error-hidden {
        filter: blur(0);
    }
}

/* Gamepad API error prevention styling */
.gamepad-disabled {
    pointer-events: auto !important;
    user-select: none;
}

/* Enhanced security for game iframes */
iframe[src*="gamemonetize"],
iframe[src*="gamepix"],
iframe[src*="crazy-games"],
iframe[src*="poki"],
#game-iframe {
    border: none;
    background: #000;
    width: 100%;
    height: 100%;
}

/* Mobile game security enhancements */
@media (max-width: 768px) {
    .game-container {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .game-container iframe {
        touch-action: auto;
        -webkit-touch-callout: default;
        -webkit-user-select: auto;
        user-select: auto;
    }
}

/* Accessibility improvements for games with errors */
.game-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem;
    border-radius: 8px;
    z-index: 999;
}

/* Error message styling */
.game-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff4757;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.game-error-message.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Performance improvements for game containers */
.game-container {
    will-change: transform;
    contain: layout style paint;
}

.game-container iframe {
    will-change: auto;
    contain: none;
}
