/* ============================================
   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: #fffaf2;
    --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);

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

* { 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: rgba(255, 250, 242, 0.94);
    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;
    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: var(--text);
    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); }
.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: 68px;
    }
    .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);
    }

    /* 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 : panneau drop-down sous le header */
    .main-nav {
        display: none;
        position: fixed;
        top: var(--mobile-header-h, 64px);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--mobile-header-h, 64px));
        z-index: 200;
        background: var(--bg);
        flex-direction: column;
        gap: 4px;
        padding: 16px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.12);
        border-top: 2px solid var(--border);
        overflow-y: auto;
        order: 99;
    }
    .main-nav.open {
        display: flex;
    }

    /* Search bar dans la nav mobile - en premier */
    .nav-mobile-search {
        order: -1;
        margin: 0 0 8px;
        display: block !important; /* override le display:none inline */
    }
    .nav-mobile-search .search-wrap-mobile {
        position: relative;
        display: block;
    }
    .nav-mobile-search .search-input {
        width: 100%;
        padding: 12px 14px 12px 40px;
        border: 2px solid var(--border-strong);
        border-radius: 12px;
        font-size: 15px;
        font-family: inherit;
        background: var(--bg-1);
    }
    .nav-mobile-search .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        display: flex;
        pointer-events: none;
    }

    .nav-item {
        width: 100%;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--border);
    }
    .nav-item:last-child {
        border-bottom: none;
    }
    .nav-link {
        display: block;
        width: 100%;
        padding: 14px 14px;
        border-radius: 10px;
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
    }
    .nav-link:hover { background: var(--bg-2); }
    .nav-link::after { display: none; }

    /* Mega-menu : toujours déplié sur mobile, scrollable */
    .has-mega { position: relative; }
    .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
        background: var(--bg-2);
        margin-top: 8px;
        padding: 12px;
        box-shadow: none;
        border: 0;
        border-radius: 12px;
    }
    .mega-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mega-item {
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 14px;
        background: var(--bg-1);
        border: 1px solid var(--border);
        gap: 10px;
    }
    .mega-item:hover,
    .mega-item:active {
        background: var(--yellow);
        border-color: var(--text);
    }
    .mega-dot {
        width: 10px;
        height: 10px;
        flex-shrink: 0;
    }
    .mega-name {
        font-size: 14px;
        font-weight: 700;
    }
    .mega-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }
    .mega-footer a {
        padding: 10px 12px;
        background: var(--bg-1);
        border: 1px solid var(--border);
        border-radius: 10px;
        text-align: center;
        font-weight: 700;
    }
}

@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: var(--text);
    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: var(--text);
    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: var(--text);
    border-color: var(--yellow);
}
.btn.cta-yellow:hover { box-shadow: 0 4px 0 0 #cc9d00; }

.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: #fff;
    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); }
.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: 56px;
    width: auto;
    display: block;
}
.logo:has(.logo-img) {
    /* Quand le logo est une image, plus de gap entre les ex-spans */
    gap: 0;
}
.footer-brand .logo-img {
    height: 64px;
}
@media (max-width: 880px) {
    .logo-img {
        height: 44px;
    }
}

/* ============ 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);
}
