:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    /* Couleurs par groupe de jeux */
    --logic-color: #8b5cf6;
    --logic-light: #ede9fe;
    --logic-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    --words-color: #ec4899;
    --words-light: #fce7f3;
    --words-gradient: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    
    --letters-color: #f59e0b;
    --letters-light: #fef3c7;
    --letters-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    --numbers-color: #06b6d4;
    --numbers-light: #cffafe;
    --numbers-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    --visual-color: #10b981;
    --visual-light: #d1fae5;
    --visual-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --quick-color: #f97316;
    --quick-light: #fed7aa;
    --quick-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    
    --classic-color: #6366f1;
    --classic-light: #e0e7ff;
    --classic-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    
    --ai-color: #a855f7;
    --ai-light: #f3e8ff;
    --ai-gradient: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 50%, #f0f9ff 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.75rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.3s;
}

.logo:hover {
    transform: scale(1.05);
}

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

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease-out;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

/* Categories */
.categories {
    padding: 4rem 0;
}

.categories h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

/* Groupes de catégories */
.category-group {
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.category-group:nth-child(1) { animation-delay: 0.1s; }
.category-group:nth-child(2) { animation-delay: 0.2s; }
.category-group:nth-child(3) { animation-delay: 0.3s; }
.category-group:nth-child(4) { animation-delay: 0.4s; }
.category-group:nth-child(5) { animation-delay: 0.5s; }
.category-group:nth-child(6) { animation-delay: 0.6s; }
.category-group:nth-child(7) { animation-delay: 0.7s; }
.category-group:nth-child(8) { animation-delay: 0.8s; }

.category-group-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.category-group-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.1) 10px,
        rgba(255,255,255,0.1) 20px
    );
}

.category-group-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0;
    z-index: 1;
}

.category-group-icon {
    font-size: 2.5rem;
    z-index: 1;
}

/* Couleurs par groupe */
.group-logic .category-group-header {
    background: var(--logic-gradient);
    color: white;
}

.group-words .category-group-header {
    background: var(--words-gradient);
    color: white;
}

.group-letters .category-group-header {
    background: var(--letters-gradient);
    color: white;
}

.group-numbers .category-group-header {
    background: var(--numbers-gradient);
    color: white;
}

.group-visual .category-group-header {
    background: var(--visual-gradient);
    color: white;
}

.group-quick .category-group-header {
    background: var(--quick-gradient);
    color: white;
}

.group-classic .category-group-header {
    background: var(--classic-gradient);
    color: white;
}

.group-ai .category-group-header {
    background: var(--ai-gradient);
    color: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::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;
}

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

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

/* Couleurs de bordure au survol */
.group-logic .category-card:hover {
    border-color: var(--logic-color);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
}

.group-words .category-card:hover {
    border-color: var(--words-color);
    box-shadow: 0 12px 24px rgba(236, 72, 153, 0.3);
}

.group-letters .category-card:hover {
    border-color: var(--letters-color);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.3);
}

.group-numbers .category-card:hover {
    border-color: var(--numbers-color);
    box-shadow: 0 12px 24px rgba(6, 182, 212, 0.3);
}

.group-visual .category-card:hover {
    border-color: var(--visual-color);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
}

.group-quick .category-card:hover {
    border-color: var(--quick-color);
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.3);
}

.group-classic .category-card:hover {
    border-color: var(--classic-color);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.group-ai .category-card:hover {
    border-color: var(--ai-color);
    box-shadow: 0 12px 24px rgba(168, 85, 247, 0.3);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s;
}

.category-card:hover .category-icon {
    transform: scale(1.2) rotate(5deg);
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1.1rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Features */
.features {
    padding: 4rem 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(240, 249, 255, 0.5) 100%);
    position: relative;
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(5deg);
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
}

/* Games Grid */
.games-filters {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.game-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.game-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.game-card h3 {
    margin-bottom: 0.5rem;
}

.game-meta {
    color: var(--text-light);
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.badge-premium {
    background: #fbbf24;
    color: #78350f;
}

.badge-easy {
    background: #d1fae5;
    color: #065f46;
}

.badge-medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-hard {
    background: #fed7aa;
    color: #9a3412;
}

.badge-expert {
    background: #fecaca;
    color: #991b1b;
}

.game-card-body {
    padding: 1.5rem;
}

.game-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.play-btn {
    width: 100%;
}

/* Premium Page */
.premium-hero {
    text-align: center;
    padding: 4rem 0;
}

.premium-hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.premium-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.pricing-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 500px;
    margin: 0 auto;
}

.price {
    text-align: center;
    margin-bottom: 2rem;
}

.amount {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
}

.period {
    font-size: 1.25rem;
    color: var(--text-light);
}

.features-list {
    list-style: none;
    margin-bottom: 2rem;
}

.features-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

#paypal-button-container {
    margin-top: 2rem;
}

/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.profile-card,
.stats-card,
.progress-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.profile-card h3,
.stats-card h3,
.progress-card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.profile-info p {
    margin-bottom: 0.75rem;
}

.stats-list,
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text);
}

.modal h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    color: var(--danger);
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fee2e2;
    border-radius: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

.modal-footer {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-light);
}

.modal-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Footer */
.footer {
    background: var(--surface);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.125rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .category-group-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .category-group-title {
        font-size: 1.5rem;
    }

    .features-grid,
    .games-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 1rem;
    }

    .category-icon {
        font-size: 2.5rem;
    }

    .category-card h3 {
        font-size: 1rem;
    }
}

