/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    background: 
        /* Top layer: Subtle dots pattern */
        radial-gradient(circle at 25% 25%, rgba(255, 107, 107, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(78, 205, 196, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 25% 75%, rgba(255, 215, 0, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, rgba(74, 144, 226, 0.3) 2px, transparent 2px),
        
        /* Middle layer: Geometric diamonds */
        linear-gradient(45deg, rgba(255, 107, 107, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(78, 205, 196, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 215, 0, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(74, 144, 226, 0.1) 75%),
        
        /* Base layer: Soft gradient */
        linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    
    background-size: 
        40px 40px,
        40px 40px,
        40px 40px,
        40px 40px,
        30px 30px,
        30px 30px,
        30px 30px,
        30px 30px,
        100% 100%;
    
    background-position:
        0 0,
        20px 20px,
        0 20px,
        20px 0,
        0 0,
        15px 15px,
        0 15px,
        15px 0,
        0 0;
    
    animation: subtleShift 20s ease-in-out infinite;
}

@keyframes subtleShift {
    0%, 100% {
        background-position:
            0 0,
            20px 20px,
            0 20px,
            20px 0,
            0 0,
            15px 15px,
            0 15px,
            15px 0,
            0 0;
    }
    50% {
        background-position:
            5px 5px,
            25px 25px,
            5px 25px,
            25px 5px,
            2px 2px,
            17px 17px,
            2px 17px,
            17px 2px,
            0 0;
    }
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #ff6b6b;
}

.header .container {
    padding: 20px;
    text-align: center;
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    color: #666;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Main content */
.main {
    padding: 40px 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #4a90e2;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #666;
    font-weight: 600;
}

/* Games grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: #ff6b6b;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffecd2);
    background-size: 300% 300%;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.game-desc {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: #888;
    font-weight: 600;
}

.play-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.play-btn:active {
    transform: translateY(0);
}

/* Features section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.feature h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.feature p {
    color: #666;
    font-weight: 600;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

.footer p {
    font-weight: 600;
    opacity: 0.8;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card {
        padding: 25px;
    }
    
    .game-icon {
        font-size: 3.5rem;
    }
    
    .game-title {
        font-size: 1.6rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 30px 15px;
        margin-bottom: 30px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .game-title {
        font-size: 1.4rem;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.game-card:active {
    animation: pulse 0.3s ease;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Popup ad styles */
.popup-ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-ad-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.popup-ad-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 340px;
    width: 90%;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-ad-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    z-index: 1;
}

.popup-ad-close:hover,
.popup-ad-close:focus {
    background: #ff6b6b;
    color: #fff;
}

.popup-ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

/* Mock ad card styles */
.mock-ad {
    width: 300px;
    min-height: 250px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #fff;
    text-align: center;
    position: relative;
}

.mock-ad .mock-ad-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mock-ad .mock-ad-banner {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.mock-ad .mock-ad-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.25rem;
    color: #333;
    padding: 12px 16px 4px;
    line-height: 1.2;
}

.mock-ad .mock-ad-desc {
    font-size: 0.85rem;
    color: #666;
    padding: 0 16px 12px;
    line-height: 1.4;
}

.mock-ad .mock-ad-cta {
    display: inline-block;
    margin-bottom: 16px;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mock-ad .mock-ad-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mock ad theme variants */
.mock-ad[data-theme="game"] .mock-ad-banner { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.mock-ad[data-theme="game"] .mock-ad-cta { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

.mock-ad[data-theme="vpn"] .mock-ad-banner { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.mock-ad[data-theme="vpn"] .mock-ad-cta { background: linear-gradient(135deg, #11998e, #38ef7d); color: #fff; }

.mock-ad[data-theme="food"] .mock-ad-banner { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.mock-ad[data-theme="food"] .mock-ad-cta { background: linear-gradient(135deg, #f5576c, #f093fb); color: #fff; }

.mock-ad[data-theme="rewards"] .mock-ad-banner { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.mock-ad[data-theme="rewards"] .mock-ad-cta { background: linear-gradient(135deg, #fa709a, #fee140); color: #fff; }

.mock-ad[data-theme="cloud"] .mock-ad-banner { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.mock-ad[data-theme="cloud"] .mock-ad-cta { background: linear-gradient(135deg, #4facfe, #00f2fe); color: #fff; }

.mock-ad[data-theme="stream"] .mock-ad-banner { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.mock-ad[data-theme="stream"] .mock-ad-cta { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #333; }
