/* ==========================================
   LUJEUX v3.0 PRO - DESIGN SYSTEM NUIT MODERNE
   Dark Mode | Glassmorphism | Accent Cyan
   Optimisé Performance | 60 FPS Garantis
   ========================================== */

/* === VARIABLES DE COULEURS === */
:root {
    --accent: #6dc8e8;
    --accent-glow: rgba(109, 200, 232, 0.4);
    --accent-gradient: linear-gradient(135deg, #4a9abb 0%, #6dc8e8 100%);
    
    --bg-deep: #0a0f18;
    --bg-surface: rgba(26, 35, 50, 0.85);
    --bg-surface-hover: rgba(26, 35, 50, 0.95);
    --surface-border: rgba(255, 255, 255, 0.08);
    --surface-border-hover: rgba(109, 200, 232, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --nav-width: 280px;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-secondary);
    background-color: var(--bg-deep);
    line-height: 1.6;
    overflow-x: hidden;
    
    background-image: 
        radial-gradient(at 0% 0%, rgba(74, 154, 187, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(109, 200, 232, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

/* === NAVIGATION LATÉRALE === */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    background: rgba(13, 20, 32, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--surface-border);
    padding: 40px 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-header { margin-bottom: 3rem; }

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-menu { list-style: none; flex: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 18px;
    margin: 6px 0;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link i { width: 20px; text-align: center; font-size: 16px; }

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: rgba(109, 200, 232, 0.08);
    border-color: rgba(109, 200, 232, 0.15);
}

.nav-footer {
    padding-top: 20px;
    border-top: 1px solid var(--surface-border);
}

.version-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
}

/* BOUTON MOBILE */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background: var(--bg-surface-hover);
    border-color: var(--surface-border-hover);
}

/* LAYOUT PRINCIPAL */
main {
    margin-left: var(--nav-width);
    padding: 0 60px;
    min-height: 100vh;
}

.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 0;
}

.section.active { display: block !important; }
.section:not(.active) { display: none !important; }

/* HERO SECTION */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 80px;
    padding-top: 60px;
}

.hero-content { flex: 1; max-width: 600px; }

.hero-badge {
    display: inline-block;
    background: rgba(109, 200, 232, 0.1);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(109, 200, 232, 0.2);
    margin-bottom: 28px;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px var(--accent-glow));
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 36px;
}

.hero-buttons { display: flex; gap: 16px; margin-bottom: 48px; flex-wrap: wrap; }

/* BOUTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 10px 25px -5px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -5px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--surface-border-hover);
    transform: translateY(-3px);
}

/* MINI STATS */
.hero-stats-row { display: flex; gap: 32px; }

.mini-stat { display: flex; flex-direction: column; }

.mini-stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.mini-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* FLOATING ELEMENTS */
.hero-visual { flex: 1; position: relative; height: 500px; display: flex; align-items: center; justify-content: center; }

.floating-element {
    position: absolute;
    width: 140px;
    height: 140px;
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--accent);
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--shadow-lg);
}

.elem-1 { top: 10%; left: 10%; animation-delay: 0s; }
.elem-2 { top: 45%; right: 5%; animation-delay: -2s; background: linear-gradient(135deg, rgba(240, 147, 251, 0.1), rgba(245, 87, 108, 0.1)); border-color: rgba(240, 147, 251, 0.2); color: #f093fb; }
.elem-3 { bottom: 10%; left: 25%; animation-delay: -4s; background: linear-gradient(135deg, rgba(79, 172, 254, 0.1), rgba(0, 242, 254, 0.1)); border-color: rgba(79, 172, 254, 0.2); color: #4facfe; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* SECTION TITRES */
.section-header { margin-bottom: 56px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(109, 200, 232, 0.08);
}

/* GAMES GRID */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.game-card {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--shadow-lg), 0 0 50px rgba(109, 200, 232, 0.15);
}

.game-preview {
    height: 180px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    position: relative;
    overflow: hidden;
}

.game-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg-surface), transparent);
}

.game-info { padding: 24px; }

.game-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.game-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.game-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    background: rgba(109, 200, 232, 0.1);
    padding: 5px 14px;
    border-radius: 15px;
    font-weight: 600;
}

.game-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.play-game-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.play-game-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px var(--accent-glow);
}

/* MODAL DU JEU */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 24, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(109, 200, 232, 0.15);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-deep);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

.modal-header { padding: 32px 32px 24px; border-bottom: 1px solid var(--surface-border); }

.modal-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal-score-display { display: flex; gap: 20px; flex-wrap: wrap; }

.score-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--accent);
    background: rgba(109, 200, 232, 0.1);
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid rgba(109, 200, 232, 0.2);
}

.modal-body {
    padding: 32px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 24, 0.4);
    position: relative;
}

.modal-footer {
    padding: 24px 32px;
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    border-top: 1px solid var(--surface-border);
}

/* CANVAS STYLES */
canvas {
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* GAME INSTRUCTIONS */
.game-instructions {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px;
    background: rgba(26, 35, 50, 0.5);
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
}

/* ANIMATIONS REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent-gradient); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }
    main { margin-left: 0; padding: 0 24px; }
    .hero-section { flex-direction: column; text-align: center; padding-top: 120px; }
    .hero-title { font-size: 42px; }
    .hero-buttons { justify-content: center; }
    .hero-stats-row { justify-content: center; }
    .hero-visual { height: 350px; }
    .floating-element { width: 110px; height: 110px; font-size: 38px; }
    .games-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 28px; flex-direction: column; gap: 12px; text-align: center; }
}
