/* Epic Brainrot Gaming Theme - Optimized for Kids & SEO */
:root {
    --primary: #ff6b35;
    --secondary: #f7931e;
    --accent: #00d4ff;
    --purple: #b45af2;
    --pink: #ff2e97;
    --green: #00ff88;
    --blue: #4d7cff;
    
    --bg-dark: #0a0e27;
    --bg-card: #151932;
    --bg-card-hover: #1a1f3a;
    --text-main: #ffffff;
    --text-dim: #a0aec0;
    --border-glow: rgba(0, 212, 255, 0.3);
    
    --gradient-fire: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff2e97 100%);
    --gradient-ocean: linear-gradient(135deg, #4d7cff 0%, #00d4ff 50%, #b45af2 100%);
    --gradient-neon: linear-gradient(135deg, #00ff88 0%, #00d4ff 50%, #b45af2 100%);
    --gradient-sunset: linear-gradient(135deg, #ff2e97 0%, #ff6b35 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.4);
    --shadow-glow-hover: 0 0 30px rgba(255, 107, 53, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(77, 124, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(180, 90, 242, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 20s ease infinite;
}

@keyframes bgShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.header {
    background: rgba(21, 25, 50, 0.85);
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo h1:hover {
    transform: scale(1.05);
}

.logo-number {
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

.logo-text {
    color: var(--text-main);
    font-weight: 800;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-ocean);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 12px;
}

.nav-link:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 0.15;
}

.nav-link.active {
    color: var(--text-main);
    background: var(--gradient-ocean);
    box-shadow: var(--shadow-glow);
}

.nav-link.active::before {
    opacity: 1;
}

/* Hero Section */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(21, 25, 50, 0.5) 0%, transparent 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 0 60px rgba(255, 107, 53, 0.3);
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    font-weight: 500;
    line-height: 1.5;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 1.1rem 1.5rem;
    font-size: 1.05rem;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    background: rgba(21, 25, 50, 0.8);
    color: var(--text-main);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-2px);
    background: rgba(21, 25, 50, 0.95);
}

.search-btn {
    padding: 1.1rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--gradient-fire);
    color: var(--text-main);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-hover), var(--shadow-lg);
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:active {
    transform: translateY(-1px);
}

/* Games Section */
.games-section {
    padding: 3.5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--text-main);
    position: relative;
    display: inline-block;
    padding-left: 1.5rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 80%;
    background: var(--gradient-fire);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    box-shadow: var(--shadow-md);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-ocean);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-glow-hover), var(--shadow-lg);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.game-card:hover::before {
    opacity: 0.08;
}

.game-thumbnail {
    width: 100%;
    height: 200px;
    background: var(--gradient-ocean);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    position: relative;
    overflow: hidden;
}

.game-thumbnail::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.game-info {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.game-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.game-card:hover .game-title {
    color: var(--accent);
}

.game-description {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.game-tags {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.game-tag {
    padding: 0.4rem 1rem;
    background: rgba(0, 212, 255, 0.15);
    border: 1.5px solid var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.game-card:hover .game-tag {
    background: rgba(255, 107, 53, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: rgba(21, 25, 50, 0.9);
    border-top: 2px solid rgba(0, 212, 255, 0.2);
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.footer p {
    font-weight: 600;
    font-size: 1rem;
}

.footer-text {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 0.75rem;
    font-weight: 400;
}

/* Responsive Design - Optimized for Chromebooks & Tablets */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .hero {
        padding: 3.5rem 0 3rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .search-box {
        flex-direction: column;
        max-width: 100%;
    }
    
    .search-input,
    .search-btn {
        width: 100%;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.25rem;
    }
    
    .game-thumbnail {
        height: 180px;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .games-section {
        padding: 2.5rem 0;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .game-thumbnail {
        height: 200px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 0 16px;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-dim);
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-weight: 700;
}
