* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#searchInput:focus {
    border-color: #2ecc71;
    background: rgba(255, 255, 255, 0.15);
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.hidden {
    display: none !important;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.game-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.game-content {
    padding: 15px;
}

.game-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #fff;
}

.game-category {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.game-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Game Frame View */
#gameFrameContainer {
    animation: fadeIn 0.3s ease-out;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.game-header h2 {
    font-size: 1.8rem;
    color: #fff;
}

.back-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #c0392b;
}

.iframe-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading States */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: white;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #3498db;
}

.loading p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .iframe-container {
        height: 400px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
    
    .iframe-container {
        height: 300px;
    }
}