:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --accent: #f093fb;
    --bg-dark: #08090d;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --glow: 0 0 20px rgba(0, 242, 254, 0.3);
}

/* Theme Definitions */
body.theme-cyberpunk {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --accent: #f093fb;
}

body.theme-emerald {
    --primary: #10b981;
    --secondary: #059669;
    --accent: #fbbf24;
    --glow: 0 0 20px rgba(16, 185, 129, 0.3);
}

body.theme-royal {
    --primary: #d946ef;
    --secondary: #c026d3;
    --accent: #00f2fe;
    --glow: 0 0 20px rgba(217, 70, 239, 0.3);
}

body.theme-fire {
    --primary: #f59e0b;
    --secondary: #d97706;
    --accent: #ef4444;
    --glow: 0 0 20px rgba(245, 158, 11, 0.3);
}

body.theme-ocean {
    --primary: #3b82f6;
    --secondary: #2563eb;
    --accent: #a855f7;
    --glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

body.theme-midnight {
    --primary: #2dd4bf;
    --secondary: #0d9488;
    --accent: #2dd4bf;
    --bg-dark: #020617;
    --glow: 0 0 20px rgba(45, 212, 191, 0.3);
}

body.theme-sunset {
    --primary: #fb7185;
    --secondary: #e11d48;
    --accent: #fcd34d;
    --glow: 0 0 20px rgba(251, 113, 133, 0.3);
}

body.theme-lava {
    --primary: #f87171;
    --secondary: #dc2626;
    --accent: #facc15;
    --glow: 0 0 20px rgba(248, 113, 113, 0.3);
}

body.theme-forest {
    --primary: #4ade80;
    --secondary: #16a34a;
    --accent: #fde047;
    --glow: 0 0 20px rgba(74, 222, 128, 0.3);
}

body.theme-space {
    --primary: #a78bfa;
    --secondary: #7c3aed;
    --accent: #ec4899;
    --bg-dark: #050505;
    --glow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* AdSense Friendly & Premium Themes */
body.theme-light-premium {
    --primary: #2563eb;
    --secondary: #1d4ed8;
    --accent: #f59e0b;
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --glass: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glow: 0 0 15px rgba(37, 99, 235, 0.1);
}

body.theme-dark-gold {
    --primary: #fbbf24;
    --secondary: #d97706;
    --accent: #ffffff;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --glow: 0 0 20px rgba(251, 191, 36, 0.2);
}

body.theme-modern-slate {
    --primary: #38bdf8;
    --secondary: #0ea5e9;
    --accent: #818cf8;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --glow: 0 0 20px rgba(56, 189, 248, 0.2);
}

body.theme-gaming-red {
    --primary: #ef4444;
    --secondary: #b91c1c;
    --accent: #fecaca;
    --glow: 0 0 20px rgba(239, 68, 68, 0.3);
}

body.theme-minimalist {
    --primary: #ffffff;
    --secondary: #94a3b8;
    --accent: #ffffff;
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --glow: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(79, 172, 254, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #0f172a 0%, #08090d 100%);
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
header {
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.3));
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a,
.dropdown-trigger {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.nav-links a:hover,
.dropdown-trigger:hover {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.nav-links a.active,
.dropdown-trigger.active {
    color: var(--primary);
}

/* Mega Menu Styles */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    width: 600px;
    background: rgba(10, 11, 16, 0.98);
    backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.mega-menu a {
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: var(--transition);
}

.mega-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(5px);
}

.mega-menu a.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Search Bar */
.search-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    width: 320px;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--glow);
}

.search-container i {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.search-container input {
    background: none;
    border: none;
    color: white;
    padding-left: 0.8rem;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.search-container input::placeholder {
    color: var(--text-dim);
    opacity: 0.7;
}

/* Hero Section */
.hero {
    padding: 4rem 5%;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg-dark));
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem 5%;
}

.game-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

.game-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.2);
}

.game-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    transition: var(--transition);
}

.game-card:hover .game-thumb {
    scale: 1.1;
}

.game-info {
    padding: 1rem;
}

.game-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-category {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Game View Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: var(--transition);
    background: var(--primary);
    color: black;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
}

.game-card:hover .play-overlay {
    opacity: 1;
}

/* Footer */
footer {
    padding: 4rem 5%;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    text-align: center;
    color: var(--text-dim);
}

.footer-links {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
    padding: 0 5%;
}

.page-btn {
    padding: 0.8rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-dim);
}

.page-btn:hover {
    border-color: var(--primary);
    color: white;
    box-shadow: var(--glow);
}

.page-btn.active {
    background: var(--primary);
    color: black;
    border-color: var(--primary);
    box-shadow: var(--glow);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem 5%;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .search-container {
        width: 100%;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .game-title {
        font-size: 0.9rem;
    }

    .mega-menu {
        position: static;
        transform: none;
        min-width: 100%;
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
        display: none;
    }

    .dropdown:hover .mega-menu {
        display: grid;
        transform: none;
    }
}