@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* Google Material Design 3 Styling - Simple & Épuré */
:root {
    --md-surface: #ffffff;
    --md-surface-variant: #f8fafc;
    --md-on-surface: #1e293b;
    --md-on-surface-variant: #64748b;
    --md-border: #e2e8f0;
    
    /* Soft Material Shadows */
    --shadow-1: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-2: 0 4px 6px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-3: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
    
    --font: 'Roboto', -apple-system, sans-serif;
    
    /* Defaults mapped to Material */
    --bg: var(--md-surface-variant);
    --surface: var(--md-surface);
    --text: var(--md-on-surface);
    --muted: var(--md-on-surface-variant);
    --border: var(--md-border);

    /* Game Themes (Light Mode Defaults) */
    --theme-purple-bg: #faf5ff; --theme-purple-border: #e9d5ff; --theme-purple-text: #6b21a8; --theme-purple-title: #581c87; --theme-purple-muted: #9333ea;
    --theme-indigo-bg: #e0e7ff; --theme-indigo-border: #c7d2fe; --theme-indigo-text: #3730a3; --theme-indigo-title: #312e81; --theme-indigo-muted: #4f46e5;
    --theme-orange-bg: #fff7ed; --theme-orange-border: #ffedd5; --theme-orange-text: #9a3412; --theme-orange-title: #7c2d12; --theme-orange-muted: #ea580c;
    --theme-yellow-bg: #fefce8; --theme-yellow-border: #fef08a; --theme-yellow-text: #854d0e; --theme-yellow-title: #713f12; --theme-yellow-muted: #ca8a04;
    --theme-blue-bg: #eff6ff;   --theme-blue-border: #bfdbfe;   --theme-blue-text: #1e40af; --theme-blue-title: #1e3a8a; --theme-blue-muted: #3b82f6;
    --theme-red-bg: #fef2f2;    --theme-red-border: #fecaca;    --theme-red-text: #991b1b;  --theme-red-title: #7f1d1d;  --theme-red-muted: #ef4444;
    --theme-green-bg: #f0fdf4;  --theme-green-border: #bbf7d0;  --theme-green-text: #166534;--theme-green-title: #14532d; --theme-green-muted: #22c55e;
    --theme-fuchsia-bg: #fdf4ff;--theme-fuchsia-border: #f5d0fe;--theme-fuchsia-text: #86198f;--theme-fuchsia-title: #701a75;--theme-fuchsia-muted: #d946ef;
}

@media (prefers-color-scheme: dark) {
    :root {
        --md-surface: #1e1e1e;
        --md-surface-variant: #121212;
        --md-on-surface: #f8fafc;
        --md-on-surface-variant: #94a3b8;
        --md-border: #334155;
        
        --shadow-1: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.24);
        --shadow-2: 0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
        --shadow-3: 0 10px 20px rgba(0,0,0,0.5), 0 6px 6px rgba(0,0,0,0.4);

        /* Game Themes (Dark Mode Equivalents) */
        --theme-purple-bg: #3b0764; --theme-purple-border: #581c87; --theme-purple-text: #e9d5ff; --theme-purple-title: #f3e8ff; --theme-purple-muted: #c084fc;
        --theme-indigo-bg: #312e81; --theme-indigo-border: #3730a3; --theme-indigo-text: #c7d2fe; --theme-indigo-title: #e0e7ff; --theme-indigo-muted: #818cf8;
        --theme-orange-bg: #7c2d12; --theme-orange-border: #9a3412; --theme-orange-text: #fed7aa; --theme-orange-title: #ffedd5; --theme-orange-muted: #fb923c;
        --theme-yellow-bg: #713f12; --theme-yellow-border: #854d0e; --theme-yellow-text: #fef08a; --theme-yellow-title: #fef9c3; --theme-yellow-muted: #facc15;
        --theme-blue-bg: #1e3a8a;   --theme-blue-border: #1e40af;   --theme-blue-text: #bfdbfe; --theme-blue-title: #dbeafe; --theme-blue-muted: #60a5fa;
        --theme-red-bg: #7f1d1d;    --theme-red-border: #991b1b;    --theme-red-text: #fecaca;  --theme-red-title: #fee2e2;  --theme-red-muted: #f87171;
        --theme-green-bg: #14532d;  --theme-green-border: #166534;  --theme-green-text: #bbf7d0;--theme-green-title: #dcfce7; --theme-green-muted: #4ade80;
        --theme-fuchsia-bg: #701a75;--theme-fuchsia-border: #86198f;--theme-fuchsia-text: #f5d0fe;--theme-fuchsia-title: #fae8ff;--theme-fuchsia-muted: #e879f9;
    }
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    position: relative;
    display: block !important;
    margin: 0;
    overflow-x: hidden;
}
html, body { overscroll-behavior-y: auto; }

/* Mesh background disabled for Material */
.mesh-bg { display: none !important; }

/* ── Hero Material Style ── */
.page-hero, .hero {
    padding: 160px 20px 60px 20px; text-align: center; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    z-index: 1; margin-bottom: 20px;
    background: transparent;
    border: none;
}

.hero-content {
    z-index: 3; max-width: 900px; margin: 0 auto; padding: 0 20px; position: relative;
}

.page-hero h1, .hero h1 {
    font-family: var(--font);
    font-size: 4.5rem; color: var(--text); margin-bottom: 25px; font-weight: 900; line-height: 1.1; letter-spacing: -2px;
}
.page-hero p, .hero p.tagline {
    font-size: 1.3rem; color: var(--muted); max-width: 650px; margin: 0 auto 35px auto; line-height: 1.6; font-weight: 500; font-family: var(--font);
}

/* Addictive CTA Button with Animation */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(var(--theme-rgb), 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(var(--theme-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--theme-rgb), 0); }
}

.hero-cta {
    display: inline-flex; align-items: center; justify-content: center; 
    background: var(--theme); color: #fff !important; border: none !important;
    padding: 16px 40px; border-radius: 12px; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.5px;
    text-decoration: none; transition: 0.2s ease; box-shadow: var(--shadow-2);
    font-family: var(--font); cursor: pointer; text-transform: uppercase;
}
.hero-cta.pulse {
    animation: pulseGlow 2s infinite;
}
.hero-cta:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-3); filter: brightness(1.1); }

/* Material You Tonal Buttons */
.btn-theme-purple { background: var(--theme-purple-bg) !important; border: 2px solid var(--theme-purple-border) !important; color: var(--theme-purple-title) !important; }
.btn-theme-indigo { background: var(--theme-indigo-bg) !important; border: 2px solid var(--theme-indigo-border) !important; color: var(--theme-indigo-title) !important; }
.btn-theme-orange { background: var(--theme-orange-bg) !important; border: 2px solid var(--theme-orange-border) !important; color: var(--theme-orange-title) !important; }
.btn-theme-yellow { background: var(--theme-yellow-bg) !important; border: 2px solid var(--theme-yellow-border) !important; color: var(--theme-yellow-title) !important; }

.hero-cta-outline {
    display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--text); border: 2px solid var(--border);
    padding: 14px 38px; border-radius: 12px; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.5px;
    text-decoration: none; transition: 0.2s ease;
    font-family: var(--font); cursor: pointer; text-transform: uppercase;
}
.hero-cta-outline:hover { background: var(--bg); transform: translateY(-2px); }

/* Material App Shell Containers */
.step-card, .benefit-card, .bento-item, .faq-item, .game-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bento-item:hover, .game-chip:hover, .role-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-2);
}

.role-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    color: var(--text);
    box-shadow: var(--shadow-1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Feature List */
.feature-list { list-style: none; padding: 0; margin-bottom: 30px; }
.feature-list li {
    padding: 15px 0; font-size: 1.1rem; color: var(--text); display: flex; align-items: center; gap: 15px;
    border-bottom: 1px solid var(--border); line-height: 1.5; font-family: var(--font); font-weight: 500;
}
.feature-list li::before { display: none; }

/* ── TIMELINE (Frise Chronologique) ── */
.timeline-section {
    max-width: 800px; margin: 60px auto 100px auto; padding: 0 20px; position: relative;
    display: flex; flex-direction: column; align-items: center;
}
.timeline {
    position: relative; margin-top: 40px; padding-left: 50px; width: 100%; max-width: 600px;
}
/* La ligne verticale de la frise */
.timeline::before {
    content: ''; position: absolute; left: 18px; top: 15px; bottom: 0; width: 2px;
    background: var(--border); border-radius: 4px; z-index: 1;
}

.timeline-item {
    position: relative; margin-bottom: 30px;
}
.timeline-item:last-child { margin-bottom: 0; }

/* Le point sur la timeline */
.timeline-dot {
    position: absolute; left: -50px; top: 0px; width: 36px; height: 36px;
    background: var(--surface); border: 2px solid var(--theme); border-radius: 50%;
    z-index: 2; box-shadow: 0 0 0 6px var(--bg); display: flex; justify-content: center; align-items: center;
    color: var(--theme); font-weight: 800; font-size: 1.1rem;
}
/* Contenu de la carte timeline */
.timeline-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-1);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.timeline-content:hover { 
    transform: translateY(-3px) scale(1.01); 
    box-shadow: var(--shadow-2); 
    z-index: 3;
}
.timeline-content h3 {
    margin: 0 0 8px 0; font-size: 1.25rem; color: var(--text); font-weight: 800; line-height: 1.3;
}
.timeline-content p {
    color: var(--muted); line-height: 1.6; margin: 0; font-size: 1.05rem;
}
.timeline-avatar {
    position: absolute; bottom: -15px; right: 20px; width: 66px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15)); z-index: 4;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.timeline-content:hover .timeline-avatar {
    transform: translateY(-6px) rotate(6deg) scale(1.08); filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}
@media (max-width: 600px) {
    .timeline-avatar { width: 55px; right: 10px; bottom: -10px; }
}

/* Helper Themes for dynamic coloring (Dark mode safe) */
.theme-box { background: rgba(var(--theme-rgb), 0.1); border-color: rgba(var(--theme-rgb), 0.2); }
.theme-box h3 { color: var(--theme); }
.theme-box p { color: var(--text); }
.theme-dot { border-color: var(--theme); color: white; background: var(--theme); }

.btn-theme { background: var(--theme); border-color: var(--theme); color: #fff; }

/* Avatar float animation */
@keyframes float {
    0% { transform: translateY(0px) rotate(var(--rot)); }
    50% { transform: translateY(-15px) rotate(calc(var(--rot) + 5deg)); }
    100% { transform: translateY(0px) rotate(var(--rot)); }
}
.avatar-float {
    animation: float 6s ease-in-out infinite;
}

/* Games Grid / Cards */
.roles-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-top: 20px;
}

/* Bento Grid */
.bento-section { max-width: 1240px; margin: 0 auto 100px auto; padding: 0 20px; }
.bento-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; gap: 20px; grid-auto-flow: dense;
}
.bento-item { display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; padding: 24px 28px; }
.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-wide  { grid-column: span 2; grid-row: span 1; }

.bento-avatar { position: absolute; right: 20px; top: 20px; width: 80px; z-index: 0; filter: drop-shadow(var(--shadow-1)); opacity: 0.8;}
.bento-large .bento-avatar { width: 160px; right: 30px; top: 30px; }
.bento-wide  .bento-avatar { width: 100px; }

/* Dynamic Theme Gradients based on SQL payload */
.bento-item[style*="--card-theme"] {
    background: linear-gradient(135deg, var(--card-theme), color-mix(in srgb, var(--card-theme) 60%, black));
    border-color: color-mix(in srgb, var(--card-theme) 80%, black);
}
.bento-item[style*="--card-theme"] h2 { color: white; }
.bento-item[style*="--card-theme"] p { color: rgba(255,255,255,0.8); }

/* Themes for Bento explicitly (Legacy Fallbacks) */
.bento-purple { background: var(--theme-purple-bg); border-color: var(--theme-purple-border); }
.bento-purple h2 { color: var(--theme-purple-title); } .bento-purple p { color: var(--theme-purple-text); }

.bento-indigo { background: var(--theme-indigo-bg); border-color: var(--theme-indigo-border); }
.bento-indigo h2 { color: var(--theme-indigo-title); } .bento-indigo p { color: var(--theme-indigo-text); }

.bento-orange { background: var(--theme-orange-bg); border-color: var(--theme-orange-border); }
.bento-orange h2 { color: var(--theme-orange-title); } .bento-orange p { color: var(--theme-orange-text); }

.bento-blue { background: var(--theme-blue-bg); border-color: var(--theme-blue-border); }
.bento-blue h2 { color: var(--theme-blue-title); } .bento-blue p { color: var(--theme-blue-text); }

.bento-red { background: var(--theme-red-bg); border-color: var(--theme-red-border); }
.bento-red h2 { color: var(--theme-red-title); } .bento-red p { color: var(--theme-red-text); }

.bento-green { background: var(--theme-green-bg); border-color: var(--theme-green-border); }
.bento-green h2 { color: var(--theme-green-title); } .bento-green p { color: var(--theme-green-text); }

.bento-fuchsia { background: var(--theme-fuchsia-bg); border-color: var(--theme-fuchsia-border); }
.bento-fuchsia h2 { color: var(--theme-fuchsia-title); } .bento-fuchsia p { color: var(--theme-fuchsia-text); }


@media (max-width: 900px) {
    .page-hero, .hero { padding: 120px 20px 40px; }
    .page-hero h1, .hero h1 { font-size: 3rem; }
    .bento-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
    .bento-large { grid-column: span 1; grid-row: span 1; }
    .bento-wide  { grid-column: span 1; }
}


/* ── HERO BADGES ── */
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; }
.hero-badge { background: transparent; border: 1px solid var(--theme); color: var(--text); padding: 6px 15px; border-radius: 20px; font-weight: 800; font-size: 0.85rem; }
