/* ===== Style BDEUXA (fond clair, header violet, textes noirs) ===== */
html[data-theme]:root {
    --bx-violet: #6C3BFF;
    --bx-violet-dark: #5626e6;
    --bx-paper: #F4F3EF;
    --bx-ink: #0A0A0A;
    --bx-line: rgba(10, 10, 10, .12);
    --bs-primary: #6C3BFF !important;
    --bs-primary-rgb: 108, 59, 255 !important;
    --bs-body-bg: #F4F3EF !important;
    --bs-body-bg-rgb: 244, 243, 239 !important;
    --bs-body-color: #0A0A0A !important;
    --bs-body-color-rgb: 10, 10, 10 !important;
    --bs-gray-100: #FFFFFF !important;
    --bs-gray-200: #ECEAE4 !important;
    --bs-gray-300: #DAD8D1 !important;
    --bs-gray-400: #A9A7A0 !important;
    --bs-gray-500: #7A7872 !important;
    --bs-gray-600: #55534E !important;
    --bs-gray-700: #2B2A27 !important;
    --bs-gray-800: #1A1A18 !important;
    --bs-gray-900: #0A0A0A !important;
    --bs-font-sans-serif: "DM Sans", Arial, sans-serif !important;
    --bs-body-font-family: "DM Sans", Arial, sans-serif !important;
    --zon-theme-color: #6C3BFF !important;
    --theme-color: #6C3BFF !important;
}

body {
    background-color: var(--bx-paper) !important;
    color: var(--bx-ink) !important;
    font-family: "DM Sans", Arial, sans-serif;
    background-image:
        linear-gradient(rgba(10,10,10,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10,10,10,.055) 1px, transparent 1px) !important;
    background-size: 120px 120px !important;
    background-position: -24px -84px;
}
body::before { content: none; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.navbar .nav-link, .btn, .category-btn a, .card-tags a {
    font-family: "Space Grotesk", "Arial Black", sans-serif !important;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--bx-ink); font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: #55534E !important; }
a { color: inherit; }

/* Header violet */
.layout-header {
    background: var(--bx-violet) !important;
    border-bottom: 1px solid var(--bx-ink);
    position: sticky; top: 0; z-index: 1030;
}
.layout-header .dark-logo { display: none !important; }
.layout-header .light-logo { display: block !important; }
.layout-header .nav-link { color: rgba(255,255,255,.92) !important; font-weight: 600 !important; }
.layout-header .nav-link:hover { color: #fff !important; text-decoration: underline; text-underline-offset: 4px; }
.layout-header .navbar-toggler { color: #fff !important; }
.layout-header .form-search {
    background: rgba(255,255,255,.14) !important;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 0 !important;
}
.layout-header .form-search input, .layout-header .form-search .input-group-text { color: #fff !important; }
.layout-header .form-search input::placeholder { color: rgba(255,255,255,.75) !important; }
.layout-header .dropdown-menu { background: #fff !important; border: 1px solid var(--bx-ink) !important; border-radius: 0 !important; }
.layout-header .dropdown-menu a { color: var(--bx-ink) !important; }

/* Catégories (pilules comme bdeuxa.com) */
.category-btn { display: flex; flex-wrap: wrap; gap: 10px; }
.category-btn a, .card-tags a {
    display: inline-flex; align-items: center;
    background: #fff !important;
    color: var(--bx-ink) !important;
    border: 1px solid rgba(10,10,10,.1) !important;
    border-radius: 999px !important;
    padding: 11px 20px !important;
    margin: 0 !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
    box-shadow: none !important;
    transition: background .2s, color .2s, border-color .2s;
}
.category-btn a:hover, .card-tags a:hover, .category-btn a.active {
    background: var(--bx-ink) !important;
    color: #fff !important;
    border-color: var(--bx-ink) !important;
}
.card-category a { color: var(--bx-violet) !important; font-weight: 600; }

/* Cartes jeux */
.card-masonry .card, .card {
    border-radius: 0 !important;
    border: 1px solid var(--bx-ink) !important;
    background: #fff !important;
    box-shadow: none;
    transition: transform .2s, box-shadow .2s;
}
.card-masonry .card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 6px 6px 0 var(--bx-violet) !important;
}
.card picture, .card img { border-radius: 0 !important; width: 100%; height: 100%; object-fit: cover; }

/* Boutons */
.btn-primary, .btn-theme { background: var(--bx-violet) !important; border-color: var(--bx-violet) !important; color: #fff !important; border-radius: 0 !important; }
.btn-primary:hover { background: var(--bx-violet-dark) !important; }
.btn-dark { background: var(--bx-ink) !important; color: var(--bx-paper) !important; border-radius: 0 !important; }
.btn-ghost, .btn-fullscreen { background: var(--bx-violet) !important; color: #fff !important; }

/* Page jeu */
.game-ratio { background: var(--bx-ink) !important; border: 1px solid var(--bx-ink); border-radius: 0 !important; }

/* Formulaires */
.form-control, .form-select { background: #fff !important; color: var(--bx-ink) !important; border: 1px solid var(--bx-ink) !important; border-radius: 0 !important; }
.layout-header .form-control { background: transparent !important; border: 0 !important; }
.modal-content, .dropdown-menu { background: #fff !important; color: var(--bx-ink) !important; border-radius: 0 !important; }

/* Footer */
.footer { background: var(--bx-ink) !important; color: var(--bx-paper) !important; }
.footer .text-muted, .footer a { color: rgba(244,243,239,.75) !important; }
.footer a:hover { color: #fff !important; background: var(--bx-violet) !important; }
.layout-text { color: var(--bx-ink); }

/* Continuité bdeuxa.com : logo, CTA, footer */
.layout-header { min-height: 66px; }
.bx-brand { display: flex !important; align-items: center; gap: 10px; }
.bx-brand img { height: 24px; width: auto; }
.bx-brand-tag {
    font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 11px;
    letter-spacing: .18em; text-transform: uppercase; color: #fff;
    border: 1px solid rgba(255,255,255,.6); padding: 3px 7px; line-height: 1;
}
.layout-header .nav-link.bx-cta {
    background: #fff; color: var(--bx-ink) !important; padding: 11px 20px !important;
    margin-left: 8px; font-weight: 600 !important; text-decoration: none !important;
}
.layout-header .nav-link.bx-cta:hover { background: var(--bx-ink); color: #fff !important; }

.bx-footer { background: var(--bx-ink); color: var(--bx-paper); padding: 0 24px 34px; }
.bx-footer__inner { max-width: 1400px; margin: 0 auto; padding-top: 30px; border-top: 1px solid rgba(244,243,239,.12); }
.bx-footer__brand img { height: 23px; width: auto; }
.bx-footer__tag { margin: 10px 0 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: rgba(244,243,239,.48); }
.bx-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.bx-footer__nav a { font-size: 13.5px; font-weight: 500; color: rgba(244,243,239,.72) !important; text-decoration: none; }
.bx-footer__nav a:hover { color: #fff !important; }
.bx-footer__legal { margin: 0; font-size: 13px; color: rgba(244,243,239,.42); }

/* Mobile : catégories sur une ligne qui défile */
@media (max-width: 767px) {
    .category-btn { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
    .category-btn::-webkit-scrollbar { display: none; }
    .category-btn a { flex: 0 0 auto; white-space: nowrap; }
}

/* Logo unique "BDEUXA Arcade" */
.bx-brand { gap: 10px !important; text-decoration: none !important; }
.bx-brand img { height: 30px !important; width: 30px !important; }
.bx-brand-name {
    font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 19px;
    letter-spacing: .02em; color: #fff; line-height: 1; white-space: nowrap;
}
.bx-brand-name span { font-weight: 500; opacity: .9; }

/* Deux logos en début de ligne : B BDEUXA + B ARCADE */
.bx-brands { gap: 4px; flex-shrink: 0; }
.bx-logo { display: flex !important; align-items: center; margin: 0 !important; padding: 0 !important; }
.bx-logo img { height: 24px; width: auto; display: block; }
.bx-logo + .bx-logo { padding-left: 14px !important; border-left: 1px solid rgba(255,255,255,.35); }
@media (max-width: 991px) { .bx-logo img { height: 20px; } .bx-logo + .bx-logo { padding-left: 10px !important; } }

/* ===== Menu mobile identique à bdeuxa.com ===== */
.bx-burger, .bx-close {
    display: inline-flex; align-items: center; gap: 12px;
    background: none; border: 0; padding: 4px 0; color: #fff; cursor: pointer;
    font: 600 15px "Space Grotesk", sans-serif;
}
.bx-burger i { display: inline-flex; flex-direction: column; gap: 6px; width: 26px; }
.bx-burger b { display: block; height: 2px; background: #fff; border-radius: 2px; }
.bx-burger:focus-visible, .bx-close:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

@media (max-width: 991.98px) {
    .layout-header { min-height: 64px; padding-top: 0; padding-bottom: 0; }
    .layout-header > .container-fluid { flex-wrap: nowrap; padding-left: 20px; padding-right: 20px; }
    .layout-header .navbar-collapse, .layout-header .navbar-toggler { display: none !important; }
    .layout-header .bx-brands { flex-shrink: 1; min-width: 0; }
    .bx-logo img { height: 18px; }
    .bx-logo + .bx-logo { padding-left: 10px !important; margin-left: 2px !important; }
    .bx-m-actions { margin-left: auto; padding-left: 12px; }
}
@media (max-width: 380px) {
    .bx-burger span { display: none; }
    .bx-logo img { height: 16px; }
}

.bx-menu {
    position: fixed; inset: 0; z-index: 2000;
    background: var(--bx-violet); color: #fff;
    display: flex; flex-direction: column;
    padding: 0 30px calc(34px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.bx-menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease; }
html.bx-menu-open, html.bx-menu-open body { overflow: hidden; }
.bx-menu__bar { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding-top: env(safe-area-inset-top, 0px); }
.bx-menu .bx-logo img { height: 18px; }
.bx-close svg { width: 28px; height: 28px; }

.bx-menu__search {
    display: flex; align-items: center; gap: 12px; margin: 28px 0 8px;
    border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
    padding: 0 16px; height: 52px; color: rgba(255,255,255,.8);
}
.bx-menu__search input {
    flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff;
    font: 400 16px "DM Sans", sans-serif;
}
.bx-menu__search input::placeholder { color: rgba(255,255,255,.7); }

.bx-menu__nav { display: flex; flex-direction: column; margin-top: 24px; }
.bx-menu__nav a {
    display: flex; align-items: baseline; gap: 22px;
    padding: 22px 0; border-bottom: 1px solid rgba(255,255,255,.28);
    color: #fff !important; text-decoration: none !important;
    font: 700 clamp(30px, 9vw, 40px)/1.1 "Space Grotesk", sans-serif; letter-spacing: -.01em;
}
.bx-menu__nav a em {
    font-style: normal; font: 600 14px "Space Grotesk", sans-serif; letter-spacing: .12em;
    color: rgba(255,255,255,.7); min-width: 26px;
}
.bx-menu__nav a:active, .bx-menu__nav a:hover { opacity: .8; }

.bx-menu__foot { margin-top: auto; padding-top: 48px; }
.bx-menu__foot a { color: #fff !important; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.5); padding-bottom: 4px; font-size: 17px; }
.bx-menu__foot p { margin: 14px 0 0; color: rgba(255,255,255,.85); font-size: 17px; }

@media (min-width: 992px) { .bx-menu { display: none; } }
@media (prefers-reduced-motion: reduce) { .bx-menu, .bx-menu.is-open { transition: none; transform: none; } }

/* Mobile : pas de catégories de jeux (accueil + page jeu) */
@media (max-width: 991.98px) {
    .category-btn, .card-tags { display: none !important; }
    div.py-1:has(> .container-fluid > .category-btn) { display: none !important; }
}

/* Bouton "BDEUXA Studio" (comme "Play Games" sur bdeuxa.com) */
.layout-header .bx-studio {
    display: inline-flex; align-items: center; gap: 18px;
    background: #fff; color: var(--bx-ink) !important;
    padding: 13px 22px; margin-left: 16px; border-radius: 0;
    font: 600 14px/1 "Space Grotesk", sans-serif; letter-spacing: 0; text-transform: none; text-decoration: none !important; white-space: nowrap;
    transition: background .2s, color .2s;
}
.layout-header .bx-studio svg { transition: transform .2s; }
.layout-header .bx-studio:hover { background: var(--bx-ink); color: #fff !important; }
.layout-header .bx-studio:hover svg { transform: translate(2px, -2px); }
.bx-menu__nav a.bx-menu__studio { align-items: center; gap: 14px; }

/* ===== Jeu : iframe plus grande sur mobile + plein écran iPhone ===== */
@media (max-width: 991.98px) {
    .game-ratio {
        height: calc((100svh - 150px) * 0.8);
        min-height: 336px;
        margin-left: -12px; margin-right: -12px; width: auto !important;
    }
    .game-ratio::before { padding-top: 0 !important; }
}
.game-ratio.bx-fs {
    position: fixed !important; inset: 0 !important; z-index: 3000;
    width: 100vw !important; height: 100vh !important; height: 100dvh !important;
    min-height: 0; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: #000 !important;
    padding: 0 !important; transform: none !important; overflow: hidden;
}
.game-ratio.bx-fs::before { display: none; }
.game-ratio.bx-fs > iframe {
    position: absolute !important;
    top: env(safe-area-inset-top, 0px) !important; left: env(safe-area-inset-left, 0px) !important;
    right: auto !important; bottom: auto !important;
    width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    background: #000;
}
.game-ratio:fullscreen { width: 100%; height: 100%; }
.game-ratio:-webkit-full-screen { width: 100%; height: 100%; }
.game-ratio:fullscreen::before { display: none; }
.bx-fs-close {
    position: absolute !important; z-index: 20 !important; top: calc(env(safe-area-inset-top, 0px) + 10px) !important; right: calc(env(safe-area-inset-right, 0px) + 10px) !important; left: auto !important;
    width: 42px !important; height: 42px !important; display: grid; place-items: center;
    background: rgba(10,10,10,.6); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 50%;
}
.game-ratio:not(.bx-fs) .bx-fs-close { display: none; }
html.bx-fs-open, html.bx-fs-open body { overflow: hidden; }

/* Bouton "Fullscreen" juste sous le jeu, à droite (mobile uniquement) */
.bx-fs-row { display: none; }
@media (max-width: 991.98px) {
    .bx-fs-row {
        display: flex; justify-content: flex-end;
        margin: -1.5rem -12px 1.25rem;   /* colle sous le jeu (annule le mb-4) et aligne sur son bord droit */
    }
    .bx-fs-row .bx-fs-open {
        display: inline-flex; align-items: center; gap: 8px;
        padding: 10px 14px; background: var(--bx-violet); color: #fff; border: 0; border-radius: 0;
        font: 600 13px/1 "Space Grotesk", sans-serif;
    }
    html.bx-fs-open .bx-fs-row { display: none; }
}

/* Mobile : un seul bouton plein écran (celui posé sur le jeu) */
@media (max-width: 991.98px) {
    .btn-fullscreen:not(.bx-fs-open) { display: none !important; }
    .dropdown:has(> .btn-fullscreen:not(.bx-fs-open)) { display: none !important; }
}
