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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    border-bottom: 2px solid #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(45deg, #fff, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background: #fff;
    color: #000;
}

/* Main Content */
.main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 2px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #fff;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: start;
}

.game-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-width: 320px;
    margin: 0 auto;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: #fff;
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* Search Bar */
.search-container {
    margin-bottom: 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    color: #fff;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #666;
}

.search-input:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Loading and Error Containers */
.loading-container {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-container .loading {
    margin: 0 auto 1rem;
}

.error-container {
    text-align: center;
    padding: 3rem;
    color: #ff0000;
}

.retry-btn {
    background: #ff0000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #cc0000;
    transform: scale(1.05);
}

/* Game thumbnail with image */
.game-thumbnail {
    width: 100%;
    height: 140px;
    background: #000;
    border: 1px solid #333;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.game-placeholder {
    font-size: 3rem;
    font-weight: 900;
    color: #666;
    letter-spacing: 2px;
}

.game-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
    flex-shrink: 0;
    line-height: 1.2;
}

.game-description {
    color: #ccc;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 2.8rem;
}

.play-btn {
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    padding: 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-top: auto;
}

/* Played counter */
.played-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.7rem;
    color: #999;
}

.played-counter .count {
    font-weight: 600;
    color: #fff;
}

.play-btn:hover {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    transform: scale(1.05);
}

/* Game Container */
.game-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333;
}

.game-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.back-btn {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.back-btn:hover {
    background: #fff;
    color: #000;
    transform: translateX(-5px);
}

.fullscreen-btn {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

.fullscreen-btn.active {
    background: #fff;
    color: #000;
}

/* Fullscreen mode */
.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
    border: none;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    background: #000;
}

.game-container.fullscreen .game-header {
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.game-container.fullscreen .game-frame {
    flex: 1;
    height: auto;
    min-height: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.game-container.fullscreen .game-controls {
    position: absolute;
    top: 0.1rem;
    right: 1rem;
    z-index: 1001;
    gap: 0.5rem;
}

.game-container.fullscreen .fullscreen-btn {
    background: #fff;
    color: #000;
    border: 2px solid #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.game-container.fullscreen .back-btn {
    background: #fff;
    color: #000;
    border: 2px solid #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.game-container.fullscreen .fullscreen-btn:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.game-container.fullscreen .back-btn:hover {
    background: #000;
    color: #fff;
    transform: translateX(-5px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.game-frame {
    width: 100%;
    height: 600px;
    background: #000;
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.game-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background: #000;
    border-top: 2px solid #fff;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .game-card {
        padding: 1rem;
    }
    
    .game-thumbnail {
        height: 120px;
        margin-bottom: 0.8rem;
    }
    
    .game-title {
        font-size: 0.9rem;
    }
    
    .game-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        min-height: 2rem;
    }
    
    .play-btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-controls {
        justify-content: center;
        width: 100%;
    }
    
    .game-frame {
        height: 400px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
    
    .game-card {
        padding: 0.8rem;
        border-radius: 10px;
    }
    
    .game-thumbnail {
        height: 100px;
        border-radius: 8px;
    }
    
    .game-title {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .game-description {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        min-height: 1.8rem;
    }
    
    .play-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    .game-placeholder {
        font-size: 2rem;
    }
    
    .search-input {
        padding: 0.8rem 2.5rem 0.8rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #333;
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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