/* ============================================
   Vivajeux . main.css
   Palette joyeuse tirée du logo
   Rouge vif, jaune, cyan, vert lime, orange
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fredoka:wght@500;600;700&display=swap');

:root {
    /* Fonds : crème ultra clair */
    --bg: var(--bg);
    --bg-2: #ffffff;
    --bg-3: #fdf3e0;
    --surface: #ffffff;
    --border: #f0e3cc;
    --border-strong: #e0d0b0;
    --text: #1f2230;
    --text-muted: #6e7081;
    --text-soft: #a8a9b8;

    /* Couleurs du logo Vivajuegos */
    --red:    #e8332a;     /* "Viva" */
    --red-soft: #ff5f55;
    --yellow: #ffc828;     /* anneau Saturne */
    --yellow-soft: #ffd960;
    --orange: #ff8a3d;     /* planète */
    --cyan:   #29b3f2;     /* "Juegos" */
    --cyan-soft: #5cc7f5;
    --green:  #8ed14f;     /* alien */
    --green-soft: #a8dd6f;
    --pink:   #ff66a3;     /* accent extra */
    --purple: #a78bfa;     /* accent extra */

    /* Aliases sémantiques */
    --primary: var(--red);
    --accent: var(--cyan);
    --accent-2: var(--yellow);
    --accent-3: var(--green);
    --accent-4: var(--orange);
    --accent-5: var(--pink);

    /* Typo */
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-display: 'Fredoka', 'Plus Jakarta Sans', sans-serif;

    --radius: 18px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(31, 34, 48, 0.05);
    --shadow-md: 0 4px 14px rgba(31, 34, 48, 0.08);
    --shadow-lg: 0 14px 36px rgba(31, 34, 48, 0.12);
    --shadow-pop: 0 4px 0 rgba(31, 34, 48, 0.12);

    /* Couleurs spéciales utilisées en plusieurs endroits */
    --header-bg: rgba(255, 250, 242, 0.94);
    --veil-color: 255, 250, 242; /* RGB seul pour permettre rgba() dynamique */

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================== MODE SOMBRE ===================== */
html[data-theme="dark"] {
    --bg: #0f1216;
    --bg-2: #181d24;
    --bg-3: #1f252e;
    --surface: #181d24;
    --border: #2a313c;
    --border-strong: #3a4250;
    --text: #e8eaf0;
    --text-muted: #9aa2b3;
    --text-soft: #6c7382;

    /* Couleurs du logo : on adoucit un peu pour le contraste sur fond sombre */
    --red:    #ff5a4f;
    --red-soft: #ff7d72;
    --yellow: #ffd24a;
    --yellow-soft: #ffe085;
    --cyan:   #4dc1f5;
    --cyan-soft: #7ed1f7;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
    --shadow-pop: 0 4px 0 rgba(0, 0, 0, 0.45);

    /* Header transparent foncé + voile sombre pour les hero mosaïque */
    --header-bg: rgba(15, 18, 22, 0.88);
    --veil-color: 15, 18, 22; /* fond sombre principal en RGB */

    color-scheme: dark;
}

/* Inverse certains éléments spécifiques en mode sombre */
html[data-theme="dark"] img.thumb-default,
html[data-theme="dark"] .game-thumb-fallback {
    filter: brightness(0.85);
}
html[data-theme="dark"] .pill,
html[data-theme="dark"] .game-cat-tag {
    color: #1a1a1a; /* garde le contraste sur les pills colorées */
}
/* Atténue légèrement les mosaïques de jeu dans les hero pour faire ressortir le texte */
html[data-theme="dark"] .hero-mosaic-tile img,
html[data-theme="dark"] .cat-hero-tile img {
    filter: brightness(0.75);
}

/* En mode sombre, tout élément avec un fond coloré clair (jaune, etc.) doit garder un texte sombre */
html[data-theme="dark"] [style*="background: #fcd34d"],
html[data-theme="dark"] [style*="background: var(--yellow)"],
html[data-theme="dark"] [style*="background:var(--yellow)"] {
    color: #1a1a1a !important;
}

/* Bouton toggle dark mode */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
    background: var(--bg-3);
    border-color: var(--text-muted);
}
.theme-toggle-icon {
    font-size: 15px;
    line-height: 1;
}
html[data-theme="dark"] .theme-toggle-icon-light { display: none; }
html:not([data-theme="dark"]) .theme-toggle-icon-dark { display: none; }
html[data-theme="dark"] .theme-toggle-label-light { display: none; }
html:not([data-theme="dark"]) .theme-toggle-label-dark { display: none; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (max-width: 720px) {
    .container { padding: 0 16px; }
}

/* ============ HEADER ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 0;
    position: relative;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    line-height: 1;
}
.logo-mark {
    background: var(--red);
    color: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-sans);
    font-weight: 800;
    transition: transform .25s var(--ease);
    box-shadow: var(--shadow-pop);
}
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
.logo-text { color: var(--red); }
.logo-text em { font-style: normal; color: var(--cyan); margin-left: 2px; }

/* ============ MEGA MENU ============ */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.nav-item { position: relative; }
.nav-link {
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: var(--text);
    transition: all .2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
}
.nav-link:hover, .nav-item:focus-within .nav-link {
    background: var(--bg-3);
    color: var(--red);
}
.nav-link::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-bottom: 2px;
    opacity: .5;
    transition: transform .2s var(--ease);
}
.nav-item.has-mega:hover .nav-link::after { transform: rotate(225deg); margin-top: 2px; margin-bottom: 0; }
.nav-link.no-arrow::after { display: none; }

.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: min(880px, 95vw);
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    box-shadow: var(--shadow-lg);
}
/* Le méga-menu wide se positionne par rapport au .header-inner (position: relative)
   plutôt que par rapport au déclencheur, pour ne pas déborder */
.mega-menu.mega-menu-wide {
    /* Ancré sur le header-inner, centré sur la largeur du container */
    position: absolute;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    transform: translateY(-8px);
    width: min(1100px, calc(100vw - 32px));
    max-height: 70vh;
    overflow-y: auto;
}
.nav-item.has-mega:hover .mega-menu,
.nav-item.has-mega:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-item.has-mega:hover .mega-menu.mega-menu-wide,
.nav-item.has-mega:focus-within .mega-menu.mega-menu-wide {
    transform: translateY(0);
}

.mega-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.mega-col-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 6px 10px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 6px;
}
.mega-col-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mega-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    transition: background .15s, transform .15s;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.mega-line:hover {
    background: var(--bg-3);
    transform: translateX(2px);
}
.mega-line-name {
    flex: 1;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: all .2s var(--ease);
}
.mega-item:hover {
    background: var(--bg-3);
    transform: translateX(2px);
}
.mega-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 6px;
}
.mega-text { display: flex; flex-direction: column; }
.mega-name { font-weight: 700; font-size: 15px; color: var(--text); }
.mega-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.mega-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}
.mega-footer a {
    color: var(--cyan);
    font-weight: 700;
}

/* ============ SEARCH ============ */
.search-wrap {
    flex: 0 0 auto;
    position: relative;
}
.search-input {
    background: var(--bg-2);
    border: 2px solid var(--border-strong);
    color: var(--text);
    padding: 9px 16px 9px 40px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    width: 240px;
    transition: all .2s var(--ease);
    font-weight: 500;
}
.search-input:focus {
    outline: none;
    width: 300px;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(41, 179, 242, 0.18);
}
.search-input::placeholder { color: var(--text-soft); }
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Dropdown résultats AJAX */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    max-height: 480px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}
.search-dropdown[hidden] { display: none !important; }
.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background .15s;
    text-decoration: none;
    color: var(--text);
}
.search-result:hover, .search-result.is-active {
    background: var(--bg-3);
}
.search-result-thumb {
    width: 50px; height: 38px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-3);
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-cat {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.search-result-cat .pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
}
.search-empty, .search-loading {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.search-section-title {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 12px 6px;
    border-bottom: 1px solid var(--border);
    margin: 4px 0 6px;
}
.search-section-title:first-child { margin-top: 0; padding-top: 4px; }
.search-cat-dot {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin: 0 4px;
}
.search-result-cat-row {
    padding: 8px 10px;
}
.search-arrow {
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 700;
    margin-left: auto;
}
.search-footer {
    padding: 10px 12px 6px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    font-size: 12px;
    text-align: center;
}
.search-footer a { color: var(--cyan); font-weight: 700; }
.menu-toggle {
    display: none;
    background: var(--bg-3);
    border: 2px solid var(--border);
    color: var(--text);
    width: 42px; height: 42px;
    border-radius: 12px;
}

/* ============ HERO ============ */
.hero {
    padding: 72px 0 48px;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}
.hero::before {
    background: var(--yellow);
    width: 380px; height: 380px;
    top: -120px; left: -120px;
}
.hero::after {
    background: var(--cyan);
    width: 320px; height: 320px;
    bottom: -100px; right: -100px;
}
.hero-inner {
    position: relative;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    z-index: 1;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    background: var(--bg-2);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.hero-eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--green);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(142, 209, 79, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(142, 209, 79, 0); }
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
    color: var(--text);
}
.hero h1 .accent {
    color: var(--red);
    position: relative;
    display: inline-block;
}
.hero h1 .accent::after {
    content: '';
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: 4px;
    height: 12px;
    background: var(--yellow);
    z-index: -1;
    border-radius: 4px;
    opacity: 0.7;
}
.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============ SECTION ============ */
.section { padding: 56px 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--text);
}
.section-title .num {
    font-family: var(--font-sans);
    color: #fff;
    background: var(--red);
    font-size: 0.42em;
    margin-right: 12px;
    vertical-align: middle;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0;
}
.section-link {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .2s, gap .2s;
}
.section-link:hover { color: var(--cyan); gap: 8px; }

/* ============ GAME GRID ============ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .games-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
@media (max-width: 860px) {
    .games-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (max-width: 540px) {
    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.game-card {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan);
    box-shadow: 0 8px 0 0 var(--cyan), 0 8px 24px rgba(0,0,0,0.06);
}

.game-thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-3);
    position: relative;
}
.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
    /* Améliore le rendu sur écrans HD quand l'image source est petite */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.game-card:hover .game-thumb img { transform: scale(1.06); }

.game-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(31,34,48,.75));
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 14px;
    opacity: 0;
    transition: opacity .2s;
}
.game-card:hover .game-overlay { opacity: 1; }
.play-btn {
    background: var(--yellow);
    color: #1a1a1a;
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 0 0 var(--text);
}
.play-btn svg { width: 14px; height: 14px; }

.game-info {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}
.game-card .game-title {
    font-family: var(--font-sans) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
    color: var(--text) !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 !important;
    word-break: break-word;
    hyphens: auto;
    letter-spacing: -0.01em;
    min-height: 2.6em; /* réserve toujours 2 lignes pour aligner les cards */
}
.game-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
}
.game-cat-tag {
    color: #fff;
    padding: 2px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.6;
    white-space: nowrap;
}

/* ============ CATEGORY STRIP ============ */
.cat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.cat-card {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px 18px;
    text-align: center;
    transition: all .25s var(--ease);
    position: relative;
    overflow: hidden;
}
.cat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-color, var(--cyan));
    opacity: 0;
    transition: opacity .25s;
    z-index: 0;
}
.cat-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-color, var(--cyan));
    box-shadow: var(--shadow-md);
}
.cat-card:hover::before { opacity: 0.08; }
.cat-card > * { position: relative; z-index: 1; }
.cat-bar {
    display: block;
    width: 48px;
    height: 6px;
    border-radius: 3px;
    background: var(--card-color, var(--cyan));
    margin: 0 auto 14px;
}
.cat-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

/* ============ GAME PLAYER ============ */
.player-wrap {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}
.player-frame {
    --player-w: 16;
    --player-h: 10;
    aspect-ratio: var(--player-w) / var(--player-h);
    width: 100%;
    /* Plafond : hauteur viewport - header(~60) - breadcrumb(~50) - toolbar(~70) - marges */
    max-height: calc(100vh - 220px);
    /* Si le jeu est en portrait (h > w), on fait porter le calcul sur la largeur dispo */
    margin-inline: auto;
    background: var(--text);
    position: relative;
    border-radius: 14px;
    overflow: hidden;
}
/* Si portrait : on calcule la largeur en fonction de la hauteur max disponible */
.player-frame.is-portrait {
    aspect-ratio: var(--player-w) / var(--player-h);
    height: calc(100vh - 220px);
    width: auto;
    max-width: 100%;
}
@media (max-width: 720px) {
    .player-frame {
        max-height: calc(100vh - 160px);
    }
    .player-frame.is-portrait {
        height: calc(100vh - 160px);
    }
}
.player-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.player-cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 2;
}
.player-cover:hover .play-big-btn {
    transform: scale(1.05);
}
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 200, 40, .85); }
    70% { box-shadow: 0 0 0 22px rgba(255, 200, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 200, 40, 0); }
}

.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-2);
    border-top: 2px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}
.player-bar h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}
.player-actions { display: flex; gap: 8px; }
.icon-btn {
    background: var(--bg-2);
    border: 2px solid var(--border-strong);
    color: var(--text);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
}
.icon-btn:hover { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }
.icon-btn.is-active { background: var(--cyan); border-color: var(--cyan); color: #fff; }

/* ============ GAME DETAIL ============ */
.game-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}
.detail-section { margin-bottom: 24px; }
.detail-section h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
}
.detail-section p { color: var(--text-muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    background: var(--bg-3);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    transition: background .2s, color .2s;
}
.tag:hover { background: var(--cyan); color: #fff; }

.sidebar-card {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.breadcrumb a {
    color: var(--cyan);
    font-weight: 600;
}
.breadcrumb-sep {
    color: var(--text-soft);
}

/* ============ FOOTER ============ */
.site-footer {
    margin-top: 80px;
    padding: 64px 0 32px;
    background: var(--bg-2);
    border-top: 2px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand p {
    color: var(--text-muted);
    margin-top: 14px;
    max-width: 320px;
    font-size: 14px;
}
.footer-col h4 {
    font-size: 13px;
    color: var(--red);
    margin-bottom: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color .2s;
}
.footer-col a:hover { color: var(--cyan); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    color: var(--text-soft);
    font-size: 13px;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============ FLASH ============ */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
    border: 2px solid;
}
.flash.success { background: #ebf6dc; border-color: var(--green); color: #3f6e1c; }
.flash.error { background: #fde0de; border-color: var(--red); color: #8a1f1a; }
.flash.info { background: #d6eefd; border-color: var(--cyan); color: #155a85; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .game-detail-grid { grid-template-columns: 1fr; }
    .search-input { width: 180px; }
    .search-input:focus { width: 220px; }
    .mega-grid { grid-template-columns: repeat(2, 1fr); }
    .mega-menu { width: min(540px, 95vw); }
}

@media (max-width: 880px) {
    :root {
        --mobile-header-h: 76px;
    }
    .site-header {
        height: var(--mobile-header-h);
    }
    /* Force des marges latérales sur mobile au cas où le container parent ne les applique pas */
    .site-header > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .header-inner {
        height: 100%;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0;
        align-items: center;
    }
    .logo {
        font-size: 22px;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }
    .logo-mark {
        padding: 6px 10px;
        font-size: 14px;
        border-radius: 10px;
    }
    .logo-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Burger : visible, à droite */
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--bg-2);
        border: 2px solid var(--border-strong);
        border-radius: 12px;
        color: var(--text);
        cursor: pointer;
        order: 2;
        flex-shrink: 0;
    }
    .menu-toggle:hover {
        background: var(--bg-3);
        border-color: var(--text);
    }
    .menu-toggle[aria-expanded="true"] {
        background: var(--yellow);
        border-color: var(--text);
        color: #1a1a1a;
    }

    /* La search est déplacée DANS la nav (visuellement, via order=-1) */
    .search-wrap {
        order: 3;            /* dans le flux du header : caché */
        display: none;       /* on cache la search dans le header */
    }
    /* Quand la nav est ouverte, on AFFICHE la search EN PREMIER */
    .main-nav.open .search-wrap-mobile,
    .search-wrap-mobile {
        display: block;
    }
    .search-wrap-mobile .search-input,
    .search-wrap-mobile .search-input:focus {
        width: 100%;
    }

    /* ============ NAV MOBILE — REFONTE ============ */
    .main-nav {
        display: none;
        position: fixed;
        top: var(--mobile-header-h, 64px);
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(100vh - var(--mobile-header-h, 64px));
        max-height: calc(100vh - var(--mobile-header-h, 64px));
        z-index: 200;
        /* Fond OPAQUE explicite, pas via var() qui peut être semi-transparent */
        background: var(--bg);
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 12px 40px rgba(0,0,0,0.18);
        border-top: 1px solid var(--border);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        order: 99;
    }
    .main-nav.open {
        display: flex;
    }

    /* Backdrop derrière le menu : assombrit le contenu du site quand le menu est ouvert */
    .main-nav.open::before {
        content: '';
        position: fixed;
        top: var(--mobile-header-h, 64px);
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: -1;
    }

    /* Empêche le scroll du body quand le menu mobile est ouvert */
    body:has(.main-nav.open) {
        overflow: hidden;
    }

    /* Search bar en haut, sticky */
    .nav-mobile-search {
        order: -1;
        margin: 0;
        padding: 14px 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 5;
        display: block !important;
    }
    .nav-mobile-search .search-wrap-mobile {
        position: relative;
        display: block;
    }
    .nav-mobile-search .search-input {
        width: 100%;
        padding: 12px 14px 12px 42px;
        border: 2px solid var(--border-strong);
        border-radius: 12px;
        font-size: 15px;
        font-family: inherit;
        background: var(--bg-2);
        box-sizing: border-box;
    }
    .nav-mobile-search .search-input:focus {
        background: var(--bg-1);
        border-color: var(--cyan);
        outline: none;
    }
    .nav-mobile-search .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        display: flex;
        pointer-events: none;
    }

    /* Chaque entrée nav = un bloc clair */
    .nav-item {
        width: 100%;
        padding: 0;
        margin: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .nav-item:last-child {
        border-bottom: none;
    }

    /* Liens simples (sans sous-menu) */
    .nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 16px 18px;
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
        background: transparent;
        border-radius: 0;
        text-decoration: none;
    }
    .nav-link:hover,
    .nav-link:active {
        background: var(--bg-2);
    }
    .nav-link::after { display: none; }

    /* Items avec méga-menu : icône chevron à droite + comportement accordéon */
    .nav-item.has-mega > .nav-link {
        position: relative;
        cursor: pointer;
    }
    .nav-item.has-mega > .nav-link::after {
        content: '';
        display: inline-block !important;
        position: absolute;
        right: 18px;
        top: 50%;
        width: 10px;
        height: 10px;
        border-right: 2px solid var(--text-muted);
        border-bottom: 2px solid var(--text-muted);
        transform: translateY(-75%) rotate(45deg);
        transition: transform .25s ease;
    }
    .nav-item.has-mega.open-mobile > .nav-link::after {
        transform: translateY(-25%) rotate(-135deg);
    }
    .nav-item.has-mega.open-mobile > .nav-link {
        background: var(--bg-2);
        color: var(--cyan);
    }

    /* Mega-menu replié par défaut sur mobile, dépliable par accordéon */
    .mega-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        background: var(--bg-2) !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        display: none;
    }
    .nav-item.has-mega.open-mobile > .mega-menu {
        display: block;
    }

    /* Inner padding pour chaque méga-menu */
    .mega-menu > * {
        padding: 12px 14px 16px;
    }

    /* === MÉGA-MENU CATÉGORIES (4 colonnes desktop) → liste accordéon mobile === */
    .mega-cols {
        display: block !important;
        grid-template-columns: none !important;
        padding: 0 14px !important;
        background: transparent !important;
    }
    .mega-col {
        border: 0 !important;
        padding: 0 !important;
        margin: 0 0 16px !important;
        background: var(--bg);
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    .mega-col:last-child { margin-bottom: 0 !important; }
    .mega-col-title {
        font-size: 12px !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: var(--text-muted) !important;
        padding: 12px 16px 8px !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: #f5ede0;
    }
    .mega-menu-grouped .mega-item {
        margin: 0 !important;
        padding: 12px 16px !important;
        background: var(--bg);
        border-radius: 0 !important;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
        text-decoration: none;
    }
    .mega-menu-grouped .mega-col .mega-item:last-child {
        border-bottom: 0;
    }
    .mega-menu-grouped .mega-item:active {
        background: var(--bg-3);
    }
    .mega-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .mega-name { font-size: 15px; font-weight: 600; }
    .mega-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin: 14px;
        padding: 0;
        border-top: 0;
    }
    .mega-footer a {
        padding: 12px 14px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        text-align: center;
        font-weight: 700;
        text-decoration: none;
        color: var(--text);
    }

    /* === MÉGA-MENU JEUX (2 colonnes desktop) → empilé mobile === */
    .mega-menu-games .mega-games-layout {
        display: block;
        grid-template-columns: none;
        padding: 14px !important;
    }
    .mega-games-shortcuts {
        padding: 0 !important;
        border-right: 0 !important;
        background: var(--bg) !important;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    .mega-games-shortcuts .mega-item {
        margin: 0 !important;
        padding: 14px 16px !important;
        background: transparent;
        border-radius: 0 !important;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
        text-decoration: none;
        color: var(--text);
    }
    .mega-games-shortcuts .mega-item:last-child {
        border-bottom: 0;
    }
    .mega-games-shortcuts .mega-item:active {
        background: var(--bg-3);
    }
    .mega-emoji { width: 24px; text-align: center; font-size: 18px; }
    /* Cache la grille de thumbs sur mobile (trop large, redondante) */
    .mega-games-recent {
        display: none !important;
    }

    /* === MÉGA-MENU EXPLORER (8 cards) → liste compacte mobile === */
    .mega-explorer-grid {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        padding: 14px !important;
        background: transparent !important;
    }
    .mega-explorer-card {
        flex-direction: row !important;
        gap: 12px !important;
        padding: 14px 16px !important;
        border-radius: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: var(--bg) !important;
        transform: none !important;
        box-shadow: none !important;
        display: flex;
        align-items: center;
    }
    /* Premier item de la liste : arrondi en haut */
    .mega-explorer-card:first-child {
        border-top-left-radius: 14px !important;
        border-top-right-radius: 14px !important;
    }
    /* Dernier item : arrondi en bas + pas de border-bottom */
    .mega-explorer-card:last-child {
        border-bottom: 0 !important;
        border-bottom-left-radius: 14px !important;
        border-bottom-right-radius: 14px !important;
    }
    /* Si un seul enfant : arrondi total */
    .mega-explorer-card:only-child {
        border-radius: 14px !important;
    }
    .mega-explorer-card:active {
        background: var(--bg-3) !important;
    }
    .mega-explorer-icon {
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        font-size: 20px !important;
        flex-shrink: 0;
    }
    .mega-explorer-title {
        font-size: 15px !important;
        font-weight: 700;
        margin-bottom: 2px !important;
    }
    .mega-explorer-desc {
        font-size: 12px !important;
        color: var(--text-muted);
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 20px; }
    .logo-mark { padding: 5px 8px; font-size: 13px; }
    .logo-text em { display: inline; }
    .mega-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   PAGE JEU v1.4 — layout 2 colonnes + maillage interne
   ============================================================ */

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-muted);
    transition: color .15s;
}
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current] {
    color: var(--text);
    font-weight: 600;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 960px) {
    .game-layout { grid-template-columns: 1fr; }
}

.game-main { min-width: 0; }

.player-cover-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.player-cover-overlay {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(31,34,48,.6), rgba(31,34,48,.3));
}
.play-big-btn {
    position: relative;
    background: var(--yellow);
    color: #1a1a1a;
    border: 0;
    padding: 18px 36px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-weight: 800;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: pulse-ring 2.4s ease-out infinite;
    cursor: pointer;
}
.play-big-btn svg { width: 26px; height: 26px; }

.game-toolbar {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.game-toolbar .btn {
    font-size: 14px;
    padding: 11px 20px;
    box-shadow: 0 3px 0 0 var(--text);
}
.game-toolbar .btn:hover { box-shadow: 0 5px 0 0 var(--text); transform: translateY(-2px); }
.game-toolbar .btn:active { box-shadow: 0 0 0 0 var(--text); transform: translateY(2px); }
.game-toolbar .btn.cta-yellow:hover { box-shadow: 0 5px 0 0 #cc9d00; }
.game-toolbar .btn.cta-yellow:active { box-shadow: 0 0 0 0 #cc9d00; }

.game-h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin: 22px 0 14px;
    color: var(--text);
    line-height: 1.1;
}

.game-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 26px;
}
.cat-pill {
    color: #fff;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s, opacity .15s;
}
.cat-pill:hover { transform: translateY(-2px); opacity: 0.9; }

.game-section {
    margin: 24px 0;
    padding: 22px 24px;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
}
.game-section h2 {
    font-family: var(--font-display);
    font-size: 20px;
    margin: 0 0 12px;
    color: var(--red);
}
.game-prose {
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.7;
}

.game-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 13px;
}
.game-meta-item strong { color: var(--text); }

/* Aside avec blocs maillage */
.game-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 24px;
}
@media (max-width: 960px) { .game-side { position: static; } }

.side-block {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.side-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    margin: 0 0 10px;
}

.side-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.side-item {
    display: flex;
    gap: 10px;
    padding: 6px;
    border-radius: 8px;
    transition: background .15s;
    text-decoration: none;
    color: var(--text);
}
.side-item:hover { background: var(--bg-3); }
.side-item img {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-3);
    flex-shrink: 0;
}
.side-item-info {
    min-width: 0;
    flex: 1;
}
.side-item-title {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 2px;
}
.side-item-cat {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.side-link {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    margin-top: 12px;
    padding: 8px;
    border-top: 1px solid var(--border);
}

.side-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.side-cat-pill {
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s;
}
.side-cat-pill:hover { transform: translateY(-1px); }

/* Sidebar YouTube-style cards */
.side-yt-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.side-yt-card {
    display: flex;
    gap: 10px;
    padding: 6px;
    border-radius: 10px;
    transition: background .15s;
    text-decoration: none;
    color: var(--text);
}
.side-yt-card:hover { background: var(--bg-3); }
.side-yt-thumb {
    position: relative;
    flex-shrink: 0;
    width: 110px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-3);
}
.side-yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.side-yt-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--yellow);
    color: #1a1a1a;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.side-yt-info {
    flex: 1;
    min-width: 0;
}
.side-yt-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.side-yt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.side-yt-pill {
    color: #fff;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
}
.side-yt-plays { font-size: 11px; }

/* Page tous les jeux : filtres + empty state */
.games-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
    padding: 14px;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
}
.games-filter-group { flex: 1 1 180px; min-width: 0; }
.games-filter-input,
.games-filter-select {
    width: 100%;
    background: var(--bg-1);
    border: 2px solid var(--border-strong);
    color: var(--text);
    padding: 9px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}
.games-filter-input:focus,
.games-filter-select:focus {
    border-color: var(--cyan);
    outline: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-2);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin: 0 0 10px;
    color: var(--red);
}
.empty-state p { color: var(--text-muted); margin: 0; }

/* ============================================================
   BOUTONS FRONTEND (manquaient)
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--border-strong);
    background: var(--bg-2);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s, background .15s, color .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 0 var(--text);
}
.btn:active { transform: translateY(0); box-shadow: 0 0 0 0 var(--text); }

.btn.primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.btn.primary:hover {
    background: var(--red);
    box-shadow: 0 4px 0 0 #b3231b;
}

.btn.ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn.ghost:hover { background: var(--bg-2); }

.btn.cta-yellow {
    background: var(--yellow);
    color: #1a1a1a; /* Texte toujours sombre sur jaune, quel que soit le thème */
    border-color: var(--yellow);
}
.btn.cta-yellow:hover { box-shadow: 0 4px 0 0 #cc9d00; }
/* Garantit le texte sombre même en mode sombre (le var(--text) ne doit pas l'éclaircir) */
html[data-theme="dark"] .btn.cta-yellow,
html[data-theme="dark"] .btn.cta-yellow:hover {
    color: #1a1a1a;
}

.btn.is-active { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* États tooltip pour bouton partage */
.btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    margin-top: -42px;
    background: var(--text);
    color: var(--bg-2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.btn { position: relative; }

/* État favori actif */
.btn[data-fav-btn].is-active {
    background: var(--pink);
    color: #fff;
    border-color: var(--pink);
}
.btn[data-fav-btn].is-active svg { fill: currentColor; }

/* ============ FOOTER CATÉGORIES PAR GROUPE ============ */
.footer-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    padding: 40px 0 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.footer-cats-col h4 {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--red);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.footer-cats-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footer-cats-col li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color .15s, transform .15s;
    text-decoration: none;
}
.footer-cats-col li a:hover {
    color: var(--text);
    transform: translateX(2px);
}
.footer-cat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============ PAGE 404 ============ */
.section-404 { padding: 60px 0 80px; }
.error-404 {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.error-404-num {
    font-family: var(--font-display);
    font-size: clamp(120px, 18vw, 220px);
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.04em;
    text-shadow: 6px 6px 0 var(--yellow);
}
.error-404-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    color: var(--text);
    margin: 12px 0 18px;
}
.error-404-text {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 28px;
}
.error-404-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ PAGE TOUTES LES CATÉGORIES ============ */
.cats-page-section {
    margin-bottom: 40px;
}
.cats-page-group-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--red);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--border);
}
.cats-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.cats-page-card {
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 16px 14px 14px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform .2s, border-color .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.cats-page-card:hover {
    transform: translateY(-3px);
    border-color: var(--card-color);
    box-shadow: 0 4px 0 0 var(--card-color);
}
.cats-page-bar {
    display: block;
    width: 32px;
    height: 4px;
    background: var(--card-color);
    margin: 0 auto 10px;
    border-radius: 2px;
}
.cats-page-name {
    display: block;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 4px;
}
.cats-page-count {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.game-cat-tag-empty {
    background: var(--bg-3) !important;
    color: var(--text-muted) !important;
    border: 1px dashed var(--border-strong);
}

/* ============ HOME : STATS ============ */
.home-stats {
    padding: 16px 0 32px;
}
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    background: var(--bg-2);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 20px;
}
@media (max-width: 720px) {
    .home-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.home-stat {
    text-align: center;
    padding: 10px;
}
.home-stat-num {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: var(--red);
    line-height: 1;
    letter-spacing: -0.02em;
}
.home-stat-lbl {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.home-stat-cta {
    background: var(--yellow);
    border-radius: 14px;
    text-decoration: none;
    transition: transform .2s var(--ease), box-shadow .2s;
    cursor: pointer;
}
.home-stat-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 0 #cc9d00;
}
.home-stat-cta .home-stat-num { color: var(--text); font-size: clamp(28px, 4vw, 42px); }
.home-stat-cta .home-stat-lbl { color: var(--text); font-weight: 700; }

/* ============ HOME : CATÉGORIES VEDETTES ============ */
.feat-cats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
@media (max-width: 860px) {
    .feat-cats { grid-template-columns: 1fr; }
}
.feat-cat-block {
    background: var(--bg-1);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    transition: border-color .2s;
}
.feat-cat-block:hover { border-color: var(--feat-color, var(--cyan)); }
.feat-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
}
.feat-cat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}
.feat-cat-title:hover { color: var(--feat-color, var(--cyan)); }
.feat-cat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--feat-color, var(--cyan));
}
.feat-cat-count {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--feat-color, var(--cyan));
    padding: 4px 10px;
    border-radius: 99px;
}
.feat-cat-games {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 480px) {
    .feat-cat-games { grid-template-columns: repeat(2, 1fr); }
}
.feat-cat-game {
    text-decoration: none;
    color: var(--text);
}
.feat-cat-game img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: transform .25s;
}
.feat-cat-game:hover img { transform: scale(1.04); }
.feat-cat-game-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
}
.feat-cat-more {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--feat-color, var(--cyan));
    text-decoration: none;
}
.feat-cat-more:hover { text-decoration: underline; }

/* ============ HOME : RÉASSURANCE ============ */
.home-trust {
    padding: 60px 0;
    background: var(--bg-3);
    border-top: 2px solid var(--border);
}
.home-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
@media (max-width: 860px) {
    .home-trust-grid { grid-template-columns: repeat(2, 1fr); }
}
.home-trust-item {
    padding: 0 12px;
}
.home-trust-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 12px;
}
.home-trust-item h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--text);
}
.home-trust-item p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* ============ MAILLAGE CATS LIÉES ============ */
.related-cats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 980px) { .related-cats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) { .related-cats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .related-cats-grid { grid-template-columns: 1fr; } }

.related-cat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-1);
    border: 2px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.related-cat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--rc-color);
    opacity: 0;
    transition: opacity .2s;
    z-index: 0;
}
.related-cat:hover {
    transform: translateY(-3px);
    border-color: var(--rc-color, var(--cyan));
    box-shadow: 0 6px 0 0 var(--rc-color, var(--cyan));
}
.related-cat:hover::before { opacity: 0.05; }
.related-cat > * { position: relative; z-index: 1; }
.related-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.7) inset;
}
.related-cat-body {
    flex: 1;
    min-width: 0;
}
.related-cat-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.related-cat-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.related-cat-arrow {
    color: var(--rc-color);
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    transition: transform .2s;
}
.related-cat:hover .related-cat-arrow { transform: translateX(3px); }

/* ============ PAGE JEU : CARTOUCHE INFOS ============ */
.game-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.game-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.info-pill-icon { font-size: 14px; }
.info-pill-val { color: var(--text); font-weight: 700; }
.info-pill-lbl { color: var(--text-muted); font-weight: 500; font-size: 12px; }

/* ============ PAGE JEU : RATING + suivant ============ */
.game-rating-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 0 0 24px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(41,179,242,0.08), rgba(255,200,40,0.08));
    border: 2px dashed var(--border);
    border-radius: 14px;
}
.game-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}
.rating-question {
    font-weight: 700;
    color: var(--text);
}
.rating-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-2);
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: all .15s;
}
.rating-btn:hover { transform: translateY(-2px); border-color: var(--text); }
.rating-btn.voted { background: var(--yellow); border-color: var(--text); color: #1a1a1a; }
.rating-up.voted { background: var(--green, #8ed14f); color: #fff; border-color: #5a9c2a; }
.rating-down.voted { background: var(--red); color: #fff; border-color: var(--red-dark, #b81f17); }
.rating-thanks {
    color: var(--green-dark, #5a9c2a);
    font-weight: 700;
    font-size: 13px;
    animation: rating-pop .3s ease;
}
@keyframes rating-pop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.btn-shuffle {
    white-space: nowrap;
}

/* ============ PAGE JEU : GALERIE + VIDEO + FAQ ============ */
.game-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 600px) {
    .game-gallery { grid-template-columns: repeat(2, 1fr); }
}
.gallery-thumb {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 16/10;
    border: 2px solid var(--border);
    transition: transform .25s, border-color .15s;
}
.gallery-thumb:hover {
    transform: scale(1.03);
    border-color: var(--cyan);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-video-embed {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--text);
}
.game-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.game-faq .faq-list {
    margin: 0;
    padding: 0;
}
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    list-style: none;
    padding: 4px 28px 4px 0;
    position: relative;
    transition: color .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-muted);
    transition: transform .2s;
}
.faq-item[open] summary::after {
    content: '−';
    color: var(--cyan);
}
.faq-item summary:hover { color: var(--cyan); }
.faq-answer {
    padding: 10px 0 4px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
}
.faq-answer a {
    color: var(--cyan);
    font-weight: 600;
}
.faq-answer kbd {
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
}

/* ============ PAGINATION SEO-FRIENDLY ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0 16px;
    flex-wrap: wrap;
}
.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-1);
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all .15s var(--ease);
}
.pag-btn:hover:not(.is-disabled):not(.is-current) {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-2px);
}
.pag-btn.is-current {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    cursor: default;
}
.pag-btn.is-disabled {
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}
.pag-prev, .pag-next {
    font-weight: 700;
    padding: 0 16px;
}
.pag-ellipsis {
    color: var(--text-muted);
    font-weight: 700;
    padding: 0 6px;
    user-select: none;
}
.pag-all-links {
    display: none; /* Lu par les bots, pas affiché à l'utilisateur */
}

@media (max-width: 540px) {
    .pag-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }
    .pag-prev, .pag-next { padding: 0 10px; }
}

/* ============ BLOC SÉRIE DE JEUX ============ */
.side-block-series {
    background: linear-gradient(135deg, rgba(255, 200, 40, 0.1), rgba(232, 51, 42, 0.08));
    border: 2px dashed var(--yellow);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 16px;
}
.side-block-series .side-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-display);
    margin: 0 0 6px;
}
.series-badge {
    background: var(--yellow);
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.06em;
}
.series-intro {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
    font-weight: 600;
}

/* ============ SOUS-CATÉGORIES ============ */
.subcat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 24px;
    padding: 14px 16px;
    background: var(--bg-2);
    border-radius: 12px;
}
.subcat-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 6px;
}
.subcat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-1);
    border: 2px solid var(--border);
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: all .15s;
}
.subcat-pill:hover {
    border-color: var(--sc-color, var(--cyan));
    color: var(--sc-color, var(--cyan));
    transform: translateY(-1px);
}
.subcat-pill-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-color, var(--cyan));
}

/* ============ MODAL DE PARTAGE (page jeu) ============ */
dialog:not([open]) {
    display: none !important;
}
dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: min(560px, calc(100vw - 32px));
    max-width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: var(--bg-1, #fff);
    border: 2px solid var(--border, #e5e5e5);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    text-align: left;
    box-sizing: border-box;
}
dialog * {
    box-sizing: border-box;
}
dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
.share-dialog {
    width: 540px;
    padding: 0;
}
.share-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border, #eee);
}
.share-head h3 {
    margin: 0;
    font-family: var(--font-display, inherit);
    font-size: 18px;
    line-height: 1.3;
}
.share-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: var(--text-muted, #888);
    padding: 4px 10px;
    border-radius: 8px;
}
.share-close:hover {
    background: var(--bg-3, #f5f5f5);
    color: var(--text, #1a1a1a);
}
.share-section {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border, #eee);
}
.share-section:last-child {
    border-bottom: 0;
}
.share-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #666);
    margin-bottom: 8px;
}
.share-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.share-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: transform .15s, opacity .15s;
}
.share-social:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.share-input-row {
    display: flex;
    gap: 6px;
}
.share-input {
    flex: 1;
    padding: 9px 12px;
    border: 2px solid var(--border-strong, #ddd);
    border-radius: 8px;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 12px;
    background: var(--bg-2, #fafafa);
    min-width: 0;
    color: var(--text);
}
.share-input-row .btn {
    flex-shrink: 0;
}
.share-input-row .btn.success {
    background: #10b981;
    color: #fff;
}
.share-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-muted, #888);
}
@media (max-width: 600px) {
    .share-dialog {
        width: calc(100vw - 24px);
    }
    .share-socials {
        gap: 6px;
    }
    .share-social {
        padding: 7px 10px;
        font-size: 12px;
    }
}

/* ============ MÉGA-MENU 4 COLONNES ============ */
.mega-menu-grouped {
    /* Comme mega-menu-wide : centré sur le container du header */
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: translateY(-8px) !important;
    width: min(1100px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    max-height: 70vh;
    overflow-y: auto;
}
.nav-item.has-mega:hover .mega-menu-grouped,
.nav-item.has-mega:focus-within .mega-menu-grouped {
    transform: translateY(0) !important;
}
.mega-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 18px 20px;
    background: var(--bg-1);
}
.mega-col {
    border-right: 1px solid var(--border);
    padding-right: 18px;
}
.mega-col:last-child {
    border-right: 0;
    padding-right: 0;
}
.mega-col + .mega-col {
    padding-left: 18px;
}
.mega-col-title {
    font-family: var(--font-display), inherit;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.mega-menu-grouped .mega-item {
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 8px;
}
.mega-menu-grouped .mega-item:hover {
    background: var(--bg-2);
}
.mega-menu-grouped .mega-name {
    font-size: 14px;
    font-weight: 600;
}
@media (max-width: 1100px) {
    .mega-menu-grouped { min-width: 720px; }
    .mega-cols { grid-template-columns: repeat(2, 1fr); }
    .mega-col { border-right: 0; padding: 0; }
    .mega-col + .mega-col { padding-left: 0; }
    .mega-col { margin-bottom: 14px; }
}
@media (max-width: 880px) {
    .mega-menu-grouped {
        min-width: auto;
        width: 100%;
    }
    .mega-cols { padding: 12px 14px; }
}

/* ============ LOGO PNG ============ */
.logo-img {
    height: 64px;
    width: auto;
    display: block;
}
.logo:has(.logo-img) {
    gap: 0;
}
.footer-brand .logo-img {
    height: 72px;
}
@media (max-width: 880px) {
    .logo-img {
        height: 48px;
    }
}

/* ============ PAGES LÉGALES ============ */
.legal-content h2 {
    font-family: var(--font-display), inherit;
    font-size: 22px;
    margin: 32px 0 12px;
    line-height: 1.3;
}
.legal-content p,
.legal-content li {
    color: var(--text);
    line-height: 1.65;
    font-size: 15px;
}
.legal-content p {
    margin: 0 0 14px;
}
.legal-content ul {
    margin: 0 0 18px;
    padding-left: 22px;
}
.legal-content li {
    margin-bottom: 8px;
}
.legal-content a {
    color: var(--cyan);
}

/* ============ MÉGA-MENU JEUX ============ */
.mega-menu-games {
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: translateY(-8px) !important;
    width: min(820px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
}
.nav-item.has-mega:hover .mega-menu-games,
.nav-item.has-mega:focus-within .mega-menu-games {
    transform: translateY(0) !important;
}
.mega-games-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
}
.mega-games-shortcuts {
    padding: 18px 16px;
    border-right: 1px solid var(--border);
    background: var(--bg-2);
}
.mega-games-shortcuts .mega-item {
    padding: 8px 10px;
    margin: 0 -10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}
.mega-games-shortcuts .mega-item:hover {
    background: var(--bg-1);
}
.mega-emoji {
    width: 22px;
    text-align: center;
    font-size: 16px;
}
.mega-games-recent {
    padding: 18px 20px;
    background: var(--bg-1);
}
.mega-games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.mega-game-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform .15s, border-color .15s;
}
.mega-game-card:hover {
    transform: translateY(-2px);
    border-color: var(--cyan);
}
.mega-game-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.mega-game-title {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    background: var(--bg-1);
}
@media (max-width: 900px) {
    .mega-menu-games {
        width: min(640px, calc(100vw - 32px)) !important;
    }
    .mega-games-layout {
        grid-template-columns: 1fr;
    }
    .mega-games-shortcuts {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .mega-games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============ MUR DES JEUX ============ */
.wall-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
}
.wall-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}
.wall-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 4px;
    line-height: 1.1;
}
.wall-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}
.wall-sort-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.wall-sort-btn {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.wall-sort-btn:hover {
    background: var(--bg-3);
    border-color: var(--text-muted);
}
.wall-sort-btn.active {
    background: var(--cyan);
    color: #fff;
    border-color: var(--cyan);
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}

.wall-tile {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-2);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s;
    cursor: pointer;
}
.wall-tile:hover {
    transform: scale(1.06);
    z-index: 5;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.wall-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wall-tile-title {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px 6px 4px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), transparent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s, transform .15s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.wall-tile:hover .wall-tile-title {
    opacity: 1;
    transform: translateY(0);
}
.wall-tile-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #fcd34d;
    color: #1a1a1a;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Bouton + compteur de chargement */
.wall-load-more {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 40px;
}
.wall-load-more .btn {
    padding: 14px 32px;
    font-size: 15px;
}
.wall-load-counter {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.wall-end {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 30px 0;
}

/* Responsive : on densifie sur écrans larges, on aère sur petits */
@media (min-width: 1600px) {
    .wall-grid { grid-template-columns: repeat(12, 1fr); }
}
@media (max-width: 1200px) {
    .wall-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 900px) {
    .wall-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 640px) {
    .wall-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
    .wall-tile-title { font-size: 10px; padding: 12px 4px 3px; }
    .wall-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 400px) {
    .wall-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ EXPLORER (style Netflix) ============ */
.explorer-section { padding-bottom: 80px; }
.explorer-head {
    margin-bottom: 28px;
}
.explorer-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 4px;
}
.explorer-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.explorer-row {
    margin-bottom: 38px;
}
.explorer-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px;
}
.explorer-row-title-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.explorer-row-title {
    font-family: var(--font-display), inherit;
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    border-left: 4px solid var(--row-accent, var(--cyan));
    padding-left: 12px;
    line-height: 1.1;
}
.explorer-row-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    transition: color .15s;
}
.explorer-row-title-link:hover .explorer-row-subtitle {
    color: var(--row-accent);
}
.explorer-row-controls {
    display: flex;
    gap: 6px;
}
.explorer-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s, border-color .15s;
}
.explorer-arrow:hover {
    background: var(--row-accent);
    color: #fff;
    border-color: var(--row-accent);
    transform: scale(1.08);
}
.explorer-arrow:active { transform: scale(0.95); }

.explorer-row-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    cursor: grab;
    padding: 4px 4px 16px;
    margin: 0 -4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.explorer-row-scroll::-webkit-scrollbar {
    height: 6px;
}
.explorer-row-scroll::-webkit-scrollbar-track { background: transparent; }
.explorer-row-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.explorer-row-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.explorer-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    text-decoration: none;
    color: var(--text);
    transition: transform .2s ease;
}
.explorer-card:hover {
    transform: translateY(-4px);
}
.explorer-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-2);
    border: 2px solid transparent;
    transition: border-color .15s;
}
.explorer-card:hover .explorer-card-img {
    border-color: var(--row-accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.explorer-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.explorer-card-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #fcd34d;
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.explorer-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}
.explorer-card:hover .explorer-card-overlay {
    opacity: 1;
}
.explorer-card-play {
    background: var(--row-accent);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.explorer-card-title {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.explorer-card-more .explorer-card-img {
    background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
    color: var(--row-accent);
    font-weight: 800;
}

@media (max-width: 640px) {
    .explorer-card { flex: 0 0 140px; }
    .explorer-row-title { font-size: 18px; }
}

/* ============ ROULETTE ============ */
.roulette-section { padding-bottom: 80px; }
.roulette-head {
    text-align: center;
    margin-bottom: 36px;
}
.roulette-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 46px);
    margin: 0 0 8px;
    line-height: 1.1;
}
.roulette-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 640px;
    margin: 0 auto 20px;
    line-height: 1.5;
}
.roulette-respin-btn {
    font-size: 16px;
    padding: 14px 28px;
}

.roulette-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    perspective: 1200px;
}

.roulette-card {
    aspect-ratio: 3 / 4.2;
    cursor: pointer;
    position: relative;
}
.roulette-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.4, 0, .2, 1);
}
.roulette-card.revealed .roulette-card-inner {
    transform: rotateY(180deg);
}

.roulette-card-back,
.roulette-card-front {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.roulette-card-back {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 3px solid #fcd34d;
    transition: transform .15s, box-shadow .15s;
}
.roulette-card-back-pattern {
    position: absolute;
    inset: 0;
    background-image:
      radial-gradient(circle at 25% 30%, rgba(252, 211, 77, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 75% 70%, rgba(41, 179, 242, 0.18) 0%, transparent 50%);
    pointer-events: none;
}
.roulette-card:hover .roulette-card-back {
    transform: scale(1.03);
    box-shadow: 0 12px 28px rgba(252, 211, 77, 0.3);
}
.roulette-card-back-label {
    position: relative;
    z-index: 1;
}
.roulette-card-q {
    display: block;
    font-family: var(--font-display, sans-serif);
    font-size: clamp(60px, 8vw, 110px);
    font-weight: 900;
    line-height: 1;
    color: #fcd34d;
    text-shadow: 0 4px 16px rgba(252, 211, 77, 0.4);
    margin-bottom: 8px;
}
.roulette-card-tap {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}

.roulette-card-front {
    background: var(--bg-1);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
}
.roulette-card-front .roulette-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-2);
}
.roulette-card-front .roulette-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.roulette-card-star {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #fcd34d;
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}
.roulette-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.roulette-card-cat {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.roulette-card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.roulette-card-stats {
    margin: 0;
    font-size: 11px;
    color: var(--text-muted);
}
.roulette-card-btn {
    margin-top: auto;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    width: 100%;
    display: block;
    text-decoration: none;
}

.roulette-tip {
    margin-top: 32px;
    padding: 14px 18px;
    background: var(--bg-2);
    border-left: 4px solid var(--cyan);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
}

@media (max-width: 900px) {
    .roulette-cards { grid-template-columns: repeat(3, 1fr); }
    .roulette-card:nth-child(4),
    .roulette-card:nth-child(5) { grid-column: span 1; }
}
@media (max-width: 600px) {
    .roulette-cards { grid-template-columns: repeat(2, 1fr); }
    .roulette-card-q { font-size: 70px; }
    .roulette-card-tap { font-size: 10px; }
}
@media (max-width: 400px) {
    .roulette-cards { grid-template-columns: 1fr; gap: 10px; }
    .roulette-card { max-width: 280px; margin: 0 auto; width: 100%; }
}

/* ============ MÉGA-MENU EXPLORER ============ */
.mega-menu-explorer {
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: translateY(-8px) !important;
    width: min(820px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
}
.nav-item.has-mega:hover .mega-menu-explorer,
.nav-item.has-mega:focus-within .mega-menu-explorer {
    transform: translateY(0) !important;
}
.mega-explorer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 18px;
    background: var(--bg-1);
}
.mega-explorer-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 12px;
    background: var(--bg-2);
    border: 2px solid transparent;
    text-decoration: none;
    color: var(--text);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mega-explorer-card:hover {
    transform: translateY(-2px);
    border-color: var(--cyan);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.mega-explorer-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.mega-explorer-text {
    flex: 1;
    min-width: 0;
}
.mega-explorer-title {
    font-family: var(--font-display), inherit;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    margin-bottom: 3px;
}
.mega-explorer-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}
@media (max-width: 700px) {
    .mega-explorer-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .mega-explorer-card { padding: 12px; }
    .mega-explorer-icon { width: 44px; height: 44px; font-size: 22px; }
}

/* ============================================================
   PARALLAXE
   ============================================================ */
.parallax-section {
    background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    padding-bottom: 80px;
    overflow: hidden;
}
.parallax-hero {
    text-align: center;
    padding: 40px 20px 32px;
}
.parallax-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 46px);
    margin: 0 0 8px;
}
.parallax-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}
.parallax-rows {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.parallax-row {
    overflow: hidden;
    position: relative;
}
.parallax-track {
    display: flex;
    gap: 12px;
    width: max-content;
    animation: parallax-scroll var(--row-speed, 60s) linear infinite;
}
.parallax-anim-left {
    animation-name: parallax-scroll-left;
}
.parallax-anim-right {
    animation-name: parallax-scroll-right;
}
@keyframes parallax-scroll-right {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes parallax-scroll-left {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}
.parallax-row:hover .parallax-track {
    animation-play-state: paused;
}
.parallax-tile {
    flex-shrink: 0;
    position: relative;
    width: 160px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-2);
    text-decoration: none;
    transition: transform .2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.parallax-tile:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    z-index: 5;
}
.parallax-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.parallax-tile-title {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px 8px 6px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transition: opacity .15s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.parallax-tile:hover .parallax-tile-title { opacity: 1; }
@media (max-width: 640px) {
    .parallax-tile { width: 120px; }
}

/* ============================================================
   MOSAIQUE VIVANTE
   ============================================================ */
.mosaic-section {
    padding-bottom: 80px;
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
}
.mosaic-head {
    text-align: center;
    padding: 32px 20px 24px;
}
.mosaic-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 46px);
    margin: 0 0 8px;
}
.mosaic-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 16px;
}
.mosaic-controls {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.mosaic-ctrl-btn {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
}
.mosaic-ctrl-btn:hover { background: var(--bg-3); }
.mosaic-ctrl-btn.active {
    background: var(--cyan);
    color: #fff;
    border-color: var(--cyan);
}
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 16px;
    perspective: 1200px;
}
.mosaic-tile {
    aspect-ratio: 1 / 1;
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-2);
    text-decoration: none;
    transition: transform .2s ease, opacity .35s ease;
    will-change: transform, opacity;
}
.mosaic-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-2);
    transition: opacity .35s ease;
}
.mosaic-tile-label {
    position: absolute;
    inset: auto 0 0 0;
    padding: 14px 4px 4px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mosaic-tile:hover .mosaic-tile-label { opacity: 1; }
.mosaic-tile:hover {
    transform: scale(1.06);
    z-index: 5;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Animation de changement de tuile : fade out → swap → fade in */
.mosaic-tile-flipping img,
.mosaic-tile-flipping .mosaic-tile-label {
    opacity: 0;
}
.mosaic-tile-flipping {
    transform: scale(0.92);
}
.mosaic-tile-flipped-in {
    animation: mosaic-pop .5s ease;
}
@keyframes mosaic-pop {
    0%   { transform: scale(0.92); }
    60%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@media (max-width: 1100px) {
    .mosaic-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 700px) {
    .mosaic-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
}
@media (max-width: 400px) {
    .mosaic-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   GALERIE D'ART
   ============================================================ */
.gallery-section {
    background: #0a0a0a;
    color: #f5f5f5;
    min-height: calc(100vh - 80px);
    padding-bottom: 60px;
    margin: -20px 0;
}
.gallery-intro {
    text-align: center;
    padding: 40px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gallery-intro-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 6px;
    color: #fcd34d;
    letter-spacing: 0.02em;
}
.gallery-intro-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0;
}

.gallery-frame {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 70px;
    min-height: 600px;
}
.gallery-stage {
    position: relative;
    width: 100%;
    min-height: 500px;
}
.gallery-piece {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity .5s ease, transform .5s ease;
    pointer-events: none;
}
.gallery-piece[data-active] {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.gallery-piece-frame {
    padding: 20px;
    background: linear-gradient(135deg, #b8860b, #fcd34d 50%, #b8860b);
    border-radius: 4px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 12px rgba(0, 0, 0, 0.4);
    max-width: 480px;
    width: 100%;
}
.gallery-piece-mat {
    background: #f5f5f0;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.gallery-piece-mat img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.gallery-piece-plaque {
    text-align: center;
    max-width: 520px;
    padding: 18px 22px;
    background: linear-gradient(180deg, rgba(252, 211, 77, 0.06), transparent);
    border: 1px solid rgba(252, 211, 77, 0.2);
    border-radius: 6px;
}
.gallery-piece-num {
    font-size: 11px;
    color: rgba(252, 211, 77, 0.7);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.gallery-piece-title {
    font-family: var(--font-display), serif;
    font-size: clamp(20px, 3vw, 28px);
    color: #f5f5f0;
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}
.gallery-piece-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}
.gallery-piece-cat {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gallery-piece-artist,
.gallery-piece-year {
    font-style: italic;
}
.gallery-piece-visits {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 14px;
}
.gallery-piece-btn {
    display: inline-block;
    background: #fcd34d;
    color: #0a0a0a;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.gallery-piece-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(252, 211, 77, 0.4);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(252, 211, 77, 0.1);
    border: 1px solid rgba(252, 211, 77, 0.3);
    color: #fcd34d;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    z-index: 5;
}
.gallery-nav:hover {
    background: rgba(252, 211, 77, 0.2);
    transform: translateY(-50%) scale(1.1);
}
.gallery-nav-prev { left: 10px; }
.gallery-nav-next { right: 10px; }

.gallery-pagination {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 0 20px;
    text-align: center;
}
.gallery-pagination-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 0;
    cursor: pointer;
    transition: all .15s;
}
.gallery-dot:hover { background: rgba(255, 255, 255, 0.4); }
.gallery-dot.active {
    background: #fcd34d;
    transform: scale(1.4);
}
.gallery-room-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
.gallery-room-link {
    color: #fcd34d;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(252, 211, 77, 0.3);
    border-radius: 6px;
    transition: background .15s;
}
.gallery-room-link:hover {
    background: rgba(252, 211, 77, 0.1);
}
.gallery-room-current {
    flex: 1;
    text-align: center;
    font-style: italic;
    letter-spacing: 0.05em;
}

@media (max-width: 700px) {
    .gallery-frame { padding: 30px 50px; min-height: 500px; }
    .gallery-nav { width: 40px; height: 40px; }
    .gallery-nav svg { width: 22px; height: 22px; }
    .gallery-nav-prev { left: 5px; }
    .gallery-nav-next { right: 5px; }
    .gallery-piece-frame { padding: 12px; }
    .gallery-piece-mat { padding: 14px; }
}

/* ============================================================
   AQUARIUM — jeux qui flottent dans une scène aquatique
   ============================================================ */
.aquarium-section {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
    margin: 0;
    overflow: hidden;
    background: linear-gradient(180deg,
        #0c4a6e 0%,
        #075985 30%,
        #0369a1 60%,
        #1e3a8a 100%);
    color: #fff;
}

.aquarium-hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    background: rgba(7, 89, 133, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 14px 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: 90vw;
}
.aquarium-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(20px, 3vw, 30px);
    font-weight: 800;
    margin: 0 0 4px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.aquarium-subtitle {
    font-size: 13px;
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.85);
}
.aquarium-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.aqua-ctrl-btn {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background .15s;
}
.aqua-ctrl-btn:hover { background: rgba(255, 255, 255, 0.25); }
.aqua-ctrl-btn.active {
    background: rgba(252, 211, 77, 0.3);
    border-color: rgba(252, 211, 77, 0.6);
}
.aqua-ctrl-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Fond aquatique : bulles, rayons de lumière, fond sablé */
.aquarium-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
/* Rayons de lumière qui descendent (style "godrays") */
.aquarium-rays {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(95deg, transparent 30%, rgba(255, 255, 255, 0.08) 40%, transparent 50%),
        linear-gradient(75deg, transparent 60%, rgba(255, 255, 255, 0.06) 70%, transparent 82%);
    animation: aquarium-light 12s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}
@keyframes aquarium-light {
    from { transform: translateX(-5%) translateY(-2%); opacity: 0.6; }
    to   { transform: translateX(5%) translateY(2%); opacity: 1; }
}
/* Sol sableux en bas */
.aquarium-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background:
        radial-gradient(ellipse at 30% 100%, rgba(180, 140, 90, 0.4), transparent 60%),
        radial-gradient(ellipse at 70% 100%, rgba(160, 120, 70, 0.35), transparent 70%),
        linear-gradient(0deg, rgba(70, 50, 30, 0.6), transparent);
    border-radius: 50% 50% 0 0 / 60% 60% 0 0;
    transform: scaleX(1.5);
}
/* Bulles qui montent */
.aquarium-bubbles {
    position: absolute;
    inset: 0;
}
.aquarium-bubbles::before,
.aquarium-bubbles::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle 3px at 10% 110%, rgba(255, 255, 255, 0.5) 30%, transparent 60%),
        radial-gradient(circle 5px at 30% 110%, rgba(255, 255, 255, 0.4) 30%, transparent 60%),
        radial-gradient(circle 4px at 50% 110%, rgba(255, 255, 255, 0.5) 30%, transparent 60%),
        radial-gradient(circle 6px at 70% 110%, rgba(255, 255, 255, 0.35) 30%, transparent 60%),
        radial-gradient(circle 3px at 85% 110%, rgba(255, 255, 255, 0.45) 30%, transparent 60%);
    background-repeat: no-repeat;
    animation: aquarium-bubbles 14s linear infinite;
}
.aquarium-bubbles::after {
    background-position:
        20% 110%, 45% 110%, 60% 110%, 80% 110%, 95% 110%;
    animation-delay: -7s;
    animation-duration: 18s;
}
@keyframes aquarium-bubbles {
    from { transform: translateY(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    to   { transform: translateY(-100vh); opacity: 0; }
}

/* Stage qui contient les couches */
.aquarium-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
}
.aquarium-stage.paused * { animation-play-state: paused !important; }

.aquarium-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.aquarium-layer-back  { z-index: 1; filter: blur(1px); }
.aquarium-layer-mid   { z-index: 2; }
.aquarium-layer-front { z-index: 3; }

/* Chaque "poisson" = un jeu */
.aqua-fish {
    position: absolute;
    top: var(--fish-top, 50%);
    left: -200px;
    width: var(--fish-size, 110px);
    height: calc(var(--fish-size, 110px) * 0.75);
    text-decoration: none;
    opacity: var(--fish-depth, 1);
    pointer-events: auto;
    cursor: pointer;
    transition: transform .25s ease, filter .25s;
    animation: aqua-swim var(--fish-duration, 30s) linear infinite var(--fish-direction, normal);
    animation-delay: var(--fish-delay, 0s);
    will-change: transform;
    /* Inversion du contenu visuel quand on nage de droite à gauche */
    /* (pour que la "tête" pointe toujours dans le sens du mouvement) */
}
.aqua-fish[style*="reverse"] {
    /* Quand reverse, on flippe le contenu visuel pour que l'œil soit côté avant */
    /* On utilise un sélecteur d'attribut sur --fish-direction */
}
/* Container interne qui sera retourné pour orienter la tête du poisson */
.aqua-fish > * {
    will-change: transform;
}

/* Le corps du poisson (thumbnail dans une forme ovale) */
.aqua-fish img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50% 38% 38% 50% / 50% 45% 45% 50%;
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 -6px 10px rgba(7, 89, 133, 0.3),
        inset 0 4px 8px rgba(255, 255, 255, 0.2);
    /* Frétillement micro permanent */
    animation: aqua-wiggle 1.2s ease-in-out infinite alternate;
}

/* QUEUE — triangle stylisé à gauche du corps */
.aqua-fish-tail {
    position: absolute;
    left: -22%;
    top: 50%;
    width: 38%;
    height: 70%;
    background: linear-gradient(90deg,
        rgba(125, 211, 252, 0.7),
        rgba(56, 189, 248, 0.85) 70%);
    transform: translateY(-50%);
    clip-path: polygon(100% 0%, 100% 100%, 0% 70%, 18% 50%, 0% 30%);
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transform-origin: 100% 50%;
    animation: aqua-tail-flap 0.6s ease-in-out infinite alternate;
}

/* NAGEOIRE DORSALE (haut) */
.aqua-fish-fin-top {
    position: absolute;
    top: -12%;
    left: 45%;
    width: 22%;
    height: 28%;
    background: linear-gradient(180deg,
        rgba(125, 211, 252, 0.65),
        rgba(56, 189, 248, 0.4));
    clip-path: polygon(30% 100%, 70% 100%, 100% 30%, 50% 0%, 0% 30%);
    transform-origin: 50% 100%;
    animation: aqua-fin-wave 1.4s ease-in-out infinite alternate;
}

/* NAGEOIRE VENTRALE (bas) */
.aqua-fish-fin-bottom {
    position: absolute;
    bottom: -10%;
    left: 38%;
    width: 18%;
    height: 22%;
    background: linear-gradient(0deg,
        rgba(125, 211, 252, 0.55),
        rgba(56, 189, 248, 0.3));
    clip-path: polygon(30% 0%, 70% 0%, 100% 70%, 50% 100%, 0% 70%);
    animation: aqua-fin-wave 1.6s ease-in-out infinite alternate;
    animation-delay: -0.3s;
}

/* ŒIL — petit cercle blanc avec pupille noire, à droite */
.aqua-fish-eye {
    position: absolute;
    top: 22%;
    right: 14%;
    width: 22%;
    height: 22%;
    max-width: 18px;
    max-height: 18px;
    min-width: 8px;
    min-height: 8px;
    background: #fff;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 3;
}
.aqua-fish-eye::before {
    content: '';
    position: absolute;
    top: 25%;
    right: 15%;
    width: 50%;
    height: 50%;
    background: #0a0a0a;
    border-radius: 50%;
}
.aqua-fish-eye::after {
    /* Reflet brillant */
    content: '';
    position: absolute;
    top: 18%;
    right: 28%;
    width: 22%;
    height: 22%;
    background: #fff;
    border-radius: 50%;
}

/* BULLES qui sortent du poisson (visibles en hover) */
.aqua-fish-bubbles {
    position: absolute;
    top: 30%;
    right: -8%;
    width: 20px;
    height: 36px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.aqua-fish:hover .aqua-fish-bubbles {
    opacity: 1;
}
.aqua-fish-bubbles::before,
.aqua-fish-bubbles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4));
    animation: aqua-bubble-rise 1.2s linear infinite;
}
.aqua-fish-bubbles::before {
    width: 6px;
    height: 6px;
    top: 60%;
    left: 4px;
}
.aqua-fish-bubbles::after {
    width: 4px;
    height: 4px;
    top: 80%;
    left: 12px;
    animation-delay: -0.6s;
}

@keyframes aqua-bubble-rise {
    from { transform: translateY(0) scale(0.6); opacity: 0; }
    20%  { opacity: 1; }
    to   { transform: translateY(-30px) scale(1); opacity: 0; }
}

/* Sens de nage : flip horizontal pour les "reverse" (qui vont de droite à gauche) */
/* Du coup l'œil et la queue restent côté correct */
.aqua-fish[style*="reverse"] {
    transform: scaleX(-1);
}
.aqua-fish[style*="reverse"] .aqua-fish-label {
    transform: scaleX(-1); /* on inverse le texte pour qu'il reste lisible */
}

.aqua-fish:hover {
    transform: scale(1.18) translateY(-4px);
    filter: drop-shadow(0 0 16px rgba(252, 211, 77, 0.6));
    z-index: 99;
    animation-play-state: paused;
}
.aqua-fish[style*="reverse"]:hover {
    transform: scaleX(-1) scale(1.18) translateY(-4px);
}
.aqua-fish:hover img {
    border-color: #fcd34d;
    animation-play-state: paused;
}

.aqua-fish-label {
    position: absolute;
    inset: auto 0 -22px 0;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200%;
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}
.aqua-fish:hover .aqua-fish-label { opacity: 1; }

/* === Animations === */
@keyframes aqua-swim {
    from {
        translate: 0 0;
        rotate: -1deg;
    }
    25% {
        translate: 25vw -12px;
        rotate: 1deg;
    }
    50% {
        translate: 50vw 8px;
        rotate: -1deg;
    }
    75% {
        translate: 75vw -6px;
        rotate: 1deg;
    }
    to {
        translate: calc(100vw + 200px) 0;
        rotate: -1deg;
    }
}
@keyframes aqua-wiggle {
    from { transform: rotate(-1.5deg); }
    to   { transform: rotate(1.5deg); }
}
@keyframes aqua-tail-flap {
    from { transform: translateY(-50%) rotate(-15deg); }
    to   { transform: translateY(-50%) rotate(15deg); }
}
@keyframes aqua-fin-wave {
    from { transform: scaleY(0.85); }
    to   { transform: scaleY(1.1); }
}

@media (max-width: 700px) {
    .aquarium-hud {
        top: 10px;
        padding: 10px 16px;
    }
    .aqua-fish {
        --fish-size: 80px !important;
    }
    .aquarium-layer-back .aqua-fish { --fish-size: 60px !important; }
    .aquarium-layer-front .aqua-fish { --fish-size: 100px !important; }
}

/* ============================================================
   HERO MOSAÏQUE DYNAMIQUE
   Le hero prend toute la zone above-the-fold sous le header.
   La grille de vignettes s'auto-arrange (auto-rows: 1fr) sans tronquage.
   ============================================================ */
.hero-mosaic {
    position: relative;
    overflow: hidden;
    padding: 0;
    /* Hauteur exacte = viewport - header sticky (≈ 70px desktop) */
    height: calc(100vh - 70px);
    min-height: 480px;
}
.hero-mosaic::before,
.hero-mosaic::after {
    display: none;
}

/* Mosaïque : grille en position absolute qui remplit le hero */
/* On utilise grid-template-rows pour fixer le NOMBRE de lignes — pas l'aspect-ratio. */
/* Le navigateur calcule la hauteur de chaque cellule pour remplir pile la zone. */
.hero-mosaic-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(7, 1fr); /* 7 lignes pour bien remplir */
    grid-auto-rows: 0; /* Les lignes au-delà ne consomment aucun espace */
    gap: 3px;
    padding: 3px;
    overflow: hidden;
}
.hero-mosaic-tile {
    overflow: hidden;
    border-radius: 5px;
    display: block;
    background: var(--bg-3);
    opacity: 0;
    animation: hero-mosaic-fade 0.5s ease forwards;
    animation-delay: calc(var(--tile-i, 0) * 0.008s);
    will-change: opacity;
    position: relative;
    min-width: 0; /* permet à la grille de réduire la largeur si nécessaire */
    min-height: 0;
}
.hero-mosaic-tile:hover {
    z-index: 5;
    box-shadow: 0 0 0 2px var(--cyan), 0 4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 5px;
}
.hero-mosaic-tile:hover img {
    filter: brightness(1.15) saturate(1.2);
}
.hero-mosaic-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .15s;
}
@keyframes hero-mosaic-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Voile pour lisibilité de la baseline : forme oblongue au centre */
.hero-mosaic-veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at center,
            rgba(var(--veil-color), 0.98) 0%,
            rgba(var(--veil-color), 0.94) 35%,
            rgba(var(--veil-color), 0.55) 65%,
            rgba(var(--veil-color), 0.15) 88%,
            transparent 100%);
}

/* Le contenu textuel : centré verticalement sur toute la hauteur du hero */
.hero-mosaic .hero-inner {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Adaptations responsive : nombre de colonnes et lignes adapté à la taille */
@media (min-width: 1600px) {
    .hero-mosaic-bg {
        grid-template-columns: repeat(18, 1fr);
        grid-template-rows: repeat(8, 1fr);
    }
}
@media (max-width: 1100px) {
    .hero-mosaic-bg {
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: repeat(7, 1fr);
    }
}
@media (max-width: 800px) {
    .hero-mosaic {
        height: calc(100vh - 76px); /* header mobile = 76px */
        min-height: 400px;
    }
    .hero-mosaic-bg {
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(8, 1fr);
    }
}
@media (max-width: 500px) {
    .hero-mosaic-bg {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(10, 1fr);
        gap: 2px;
        padding: 2px;
    }
    .hero-mosaic-veil {
        background: radial-gradient(ellipse 95% 50% at center,
            rgba(var(--veil-color), 0.98) 0%,
            rgba(var(--veil-color), 0.94) 40%,
            rgba(var(--veil-color), 0.65) 75%,
            rgba(var(--veil-color), 0.25) 100%);
    }
}

/* ============================================================
   MINI HERO CATÉGORIE
   ============================================================ */
.cat-hero {
    position: relative;
    overflow: hidden;
    height: 320px;
    margin-bottom: 0;
    /* Couleur d'accent injectée par le PHP via --cat-color */
}
.cat-hero-mosaic {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(4, 1fr);
    grid-auto-rows: 0;
    gap: 3px;
    padding: 3px;
    overflow: hidden;
}
.cat-hero-tile {
    overflow: hidden;
    border-radius: 5px;
    display: block;
    background: var(--bg-3);
    opacity: 0;
    animation: cat-hero-fade 0.5s ease forwards;
    animation-delay: calc(var(--tile-i, 0) * 0.008s);
    position: relative;
    min-width: 0;
    min-height: 0;
}
.cat-hero-tile:hover {
    z-index: 5;
    box-shadow: 0 0 0 2px var(--cat-color, var(--cyan)), 0 4px 12px rgba(0, 0, 0, 0.25);
}
.cat-hero-tile:hover img {
    filter: brightness(1.15) saturate(1.2);
}
.cat-hero-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .15s;
}
@keyframes cat-hero-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Voile gradient + teinte couleur de la cat */
.cat-hero-veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 70% at center,
            rgba(var(--veil-color), 0.97) 0%,
            rgba(var(--veil-color), 0.92) 30%,
            rgba(var(--veil-color), 0.5) 65%,
            rgba(var(--veil-color), 0.15) 90%,
            transparent 100%);
}
/* Reflet de la couleur de la cat en haut/bas */
.cat-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--cat-color, var(--cyan)) 12%, transparent) 0%,
        transparent 30%,
        transparent 70%,
        color-mix(in srgb, var(--cat-color, var(--cyan)) 18%, transparent) 100%);
}

.cat-hero-inner {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 16px;
}
.cat-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cat-color, var(--cyan));
    color: #1a1a1a;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.cat-hero-title {
    font-family: var(--font-display), inherit;
    font-size: clamp(28px, 4.5vw, 46px);
    margin: 0 0 10px;
    line-height: 1.1;
    color: var(--text);
    max-width: 720px;
}
.cat-hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .cat-hero-mosaic {
        grid-template-columns: repeat(12, 1fr);
    }
}
@media (max-width: 800px) {
    .cat-hero {
        height: 280px;
    }
    .cat-hero-mosaic {
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }
}
@media (max-width: 500px) {
    .cat-hero {
        height: 240px;
    }
    .cat-hero-mosaic {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: 2px;
        padding: 2px;
    }
    .cat-hero-veil {
        background: radial-gradient(ellipse 95% 70% at center,
            rgba(var(--veil-color), 0.98) 0%,
            rgba(var(--veil-color), 0.93) 40%,
            rgba(var(--veil-color), 0.6) 80%,
            rgba(var(--veil-color), 0.2) 100%);
    }
    .cat-hero-eyebrow {
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* === Densités adaptatives du mini hero catégorie === */
/* Principe : la grille a EXACTEMENT le nombre de cellules nécessaire pour afficher les jeux dispos */
/* sans cellule vide. Le nb de cols × lignes = nb de jeux maximum à afficher. */

/* MINI (< 6 jeux) : pas de mosaïque, juste un gradient avec la couleur de la cat */
.cat-hero.cat-hero-mini {
    height: 220px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--cat-color, var(--cyan)) 20%, var(--bg-1)) 0%,
            color-mix(in srgb, var(--cat-color, var(--cyan)) 8%, var(--bg-1)) 100%);
}
.cat-hero.cat-hero-mini .cat-hero-veil {
    /* Pas besoin de voile fort, juste un blur très léger pour adoucir */
    background: radial-gradient(ellipse 70% 70% at center,
        rgba(var(--veil-color), 0.5) 0%,
        rgba(var(--veil-color), 0.2) 50%,
        transparent 100%);
}

/* TINY (6-11 jeux) : 6 cols × 1 ligne = 6 tuiles, ou 6 × 2 = 12 max */
.cat-hero.cat-hero-tiny {
    height: 220px;
}
.cat-hero.cat-hero-tiny .cat-hero-mosaic {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* SMALL (12-23 jeux) : 6 × 2 = 12 cellules min */
.cat-hero.cat-hero-small {
    height: 260px;
}
.cat-hero.cat-hero-small .cat-hero-mosaic {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* MEDIUM (24-39 jeux) : 12 × 2 = 24 cellules */
.cat-hero.cat-hero-medium {
    height: 280px;
}
.cat-hero.cat-hero-medium .cat-hero-mosaic {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* DENSE (≥ 40 jeux) : 15 × 4 = 60 cellules (par défaut, défini plus haut) */

/* === Adaptations responsive par densité === */
@media (max-width: 1100px) {
    .cat-hero.cat-hero-tiny .cat-hero-mosaic   { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
    .cat-hero.cat-hero-small .cat-hero-mosaic  { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(2, 1fr); }
    .cat-hero.cat-hero-medium .cat-hero-mosaic { grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .cat-hero.cat-hero-mini   { height: 200px; }
    .cat-hero.cat-hero-tiny   { height: 200px; }
    .cat-hero.cat-hero-small  { height: 230px; }
    .cat-hero.cat-hero-medium { height: 250px; }
    .cat-hero.cat-hero-tiny .cat-hero-mosaic   { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
    .cat-hero.cat-hero-small .cat-hero-mosaic  { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
    .cat-hero.cat-hero-medium .cat-hero-mosaic { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(4, 1fr); }
}
@media (max-width: 500px) {
    .cat-hero.cat-hero-mini   { height: 180px; }
    .cat-hero.cat-hero-tiny   { height: 200px; }
    .cat-hero.cat-hero-small  { height: 220px; }
    .cat-hero.cat-hero-medium { height: 240px; }
    .cat-hero.cat-hero-tiny .cat-hero-mosaic   { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
    .cat-hero.cat-hero-small .cat-hero-mosaic  { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
    .cat-hero.cat-hero-medium .cat-hero-mosaic { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); }
}

/* ============================================================
   LANGUAGE SWITCHER (nav principale)
   ============================================================ */
.lang-switcher {
    position: relative;
}
.lang-switcher-btn {
    background: transparent;
    border: 0;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}
.lang-switcher-btn:hover,
.lang-switcher.open .lang-switcher-btn {
    background: var(--bg-2, rgba(0, 0, 0, 0.04));
}
.lang-switcher-flag-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
}
.lang-switcher-flag-wrap .lang-flag {
    display: block;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}
/* Backward-compat avec ancien class emoji */
.lang-switcher-flag {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}
.lang-switcher-btn svg {
    transition: transform 0.15s;
    display: block;
    flex-shrink: 0;
}
.lang-switcher.open .lang-switcher-btn svg {
    transform: rotate(180deg);
}
.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-2);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.05);
    padding: 6px;
    min-width: 180px;
    display: none;
    z-index: 1000;
    animation: lang-menu-pop 0.15s ease;
}
.lang-switcher.open .lang-switcher-menu {
    display: block;
}
@keyframes lang-menu-pop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lang-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    transition: background 0.12s;
}
.lang-switcher-item:hover {
    background: var(--bg-2, rgba(0, 0, 0, 0.05));
}
.lang-switcher-item.active {
    background: linear-gradient(135deg, rgba(41, 179, 242, 0.10), rgba(41, 179, 242, 0.03));
    color: var(--cyan, #29b3f2);
}
.lang-switcher-label {
    flex: 1;
}
.lang-switcher-check {
    color: var(--cyan, #29b3f2);
    font-weight: 800;
}

/* Mobile : on l'intègre dans le menu burger plus tard si besoin */
@media (max-width: 880px) {
    .lang-switcher-btn {
        padding: 6px 8px;
    }
    .lang-switcher-flag {
        font-size: 16px;
    }
    .lang-switcher-menu {
        right: -4px;
        min-width: 160px;
    }
}
