/* Orbio Dodge — dark / violet / or */
:root {
    --bg: #0e0c16;
    --bg2: #171226;
    --panel: #1d1730;
    --violet: #8c5aff;
    --violet-dim: #5b3aa8;
    --gold: #c9a227;
    --text: #e8e4f5;
    --muted: #9b93b8;
    --danger: #ff5a7a;
    --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* reserve toujours la place de la scrollbar verticale, meme sur les pages
   trop courtes pour en avoir une : sinon la largeur de contenu (donc la
   navbar sticky) se decale de quelques pixels a chaque changement de page
   selon que la precedente avait une scrollbar ou non. */
html { scrollbar-gutter: stable; }
body {
    margin: 0;
    background: radial-gradient(1200px 600px at 50% -100px, #241b42 0%, var(--bg) 60%);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--violet); text-decoration: none; }
.gold { color: var(--gold); }

/* tous les <select> du site : evite le halo bleu/blanc systeme (Chrome/Edge)
   au survol ET au focus, qui jure avec le theme sombre — voir les regles
   dediees plus bas pour la couleur de bordure au survol propre a chaque zone. */
select { outline: none; }
select:focus-visible { box-shadow: 0 0 0 3px rgba(201,162,39,.25); }

/* --- Navbar --- */
.navbar {
    display: flex; align-items: center; gap: 1rem;
    padding: .7rem 1.2rem;
    background: rgba(20, 15, 36, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(140, 90, 255, .2);
    position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: .5px;
    display: flex; align-items: center; gap: .5rem; }
.brand-logo { filter: drop-shadow(0 0 6px rgba(140,90,255,.5)); }
.nav-links { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.nav-links a {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--muted); font-weight: 600; font-size: .88rem;
    padding: .45rem .7rem; border-radius: 9px;
    transition: background .15s, color .15s, transform .1s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nav-ic { font-size: 1rem; line-height: 1; }
/* Jouer (lobby) : point d'entree du jeu, mis en avant comme un vrai bouton CTA
   plutot qu'un simple lien parmi d'autres — /play redevient une "demo" a cote. */
.nav-links a.nav-primary {
    color: #fff; background: linear-gradient(135deg, var(--violet), var(--violet-dim));
    box-shadow: 0 4px 14px rgba(140,90,255,.4);
}
.nav-links a.nav-primary:hover {
    color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(140,90,255,.55);
}
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
/* Dropdown de langue avec drapeaux (recette Orbio-KingShot) */
.dropdown { position: relative; }
.dropdown > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--violet-dim);
    color: var(--text); font-size: .85rem; font-weight: 600; background: rgba(255,255,255,.03);
    user-select: none; transition: border-color .14s, background .14s;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::marker { content: ""; }
.dropdown > summary:hover, .dropdown[open] > summary {
    border-color: var(--gold); background: rgba(140,90,255,.09);
}
.dropdown .caret { color: var(--muted); font-size: .6rem; margin-left: 1px; transition: transform .15s; }
.dropdown[open] .caret { transform: rotate(180deg); }
.dd-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 170px; z-index: 60;
    background: var(--panel); border: 1px solid var(--violet-dim); border-radius: 11px;
    padding: 6px; box-shadow: 0 12px 34px rgba(0,0,0,.5);
    display: flex; flex-direction: column; gap: 2px;
}
.dd-menu.right { left: auto; right: 0; }
.dd-menu a {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 11px; border-radius: 8px; color: var(--muted); font-size: .9rem;
    text-align: left;
}
.dd-menu a:hover { background: rgba(255,255,255,.05); color: var(--text); }
.dd-menu a.active { color: var(--text); background: rgba(140,90,255,.14); }
.flag-svg {
    display: inline-flex; width: 20px; height: 14px; border-radius: 3px; overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); flex-shrink: 0;
}
.flag-svg svg { width: 100%; height: 100%; display: block; }

.lang-switch select, .lb-filters select, .settings-card select {
    background: var(--panel); color: var(--text);
    border: 1px solid var(--violet-dim); border-radius: 8px; padding: .35rem .5rem;
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
    outline: none; /* remplace par le box-shadow ci-dessous, sinon Chrome/Edge
                       dessinent par-dessus un halo bleu/blanc systeme au survol
                       ET au focus qui jure avec le theme sombre. */
}
.lang-switch select:hover, .lb-filters select:hover, .settings-card select:hover {
    border-color: var(--gold);
}
.lang-switch select:focus-visible, .lb-filters select:focus-visible, .settings-card select:focus-visible {
    border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.25);
}
/* liste deroulee : fond sombre + texte clair (au lieu du blanc/bleu systeme) */
select option {
    background-color: #1d1730; color: #e8e4f5; padding: .4rem;
}
select option:checked { background-color: #5b3aa8; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: var(--text) !important; }
.user-chip img { border-radius: 50%; border: 2px solid var(--gold); }

/* --- Boutons --- */
.btn {
    display: inline-block; cursor: pointer;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--violet-dim);
    border-radius: var(--radius);
    padding: .6rem 1.3rem; font-size: 1rem; font-weight: 600;
    transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(140, 90, 255, .35); }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--violet-dim)); border: none; color: #fff; }
.btn-discord { background: #5865F2; border: none; color: #fff; }
.btn-lg { padding: .9rem 2rem; font-size: 1.15rem; }
.btn-insane { border-color: var(--danger); color: var(--danger); }

/* --- Layout --- */
.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.2rem; width: 100%; flex: 1; }
.hero { text-align: center; padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 .6rem; }
/* .lead : aligne a gauche sous son titre par defaut ; centre uniquement dans le hero */
.lead { color: var(--muted); font-size: 1.15rem; max-width: 720px; margin: .3rem 0 1.6rem; }
.hero .lead { max-width: 640px; margin: 0 auto 1.6rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* accueil uniquement : hero en 2 colonnes avec l'aperçu anime du jeu a droite
   (voir hero-demo.js) — le hero centre classique (play.html) n'est pas touche. */
.hero.hero-split {
    display: flex; align-items: center; justify-content: center; gap: 2.6rem;
    text-align: left; flex-wrap: wrap;
}
.hero-split .hero-text { flex: 1 1 380px; min-width: 0; }
.hero-split .hero-text h1 { text-align: left; }
.hero-split .hero .lead, .hero-split .lead { margin: .3rem 0 1.6rem; text-align: left; }
.hero-split .hero-cta { justify-content: flex-start; }
.hero-demo-wrap {
    position: relative; flex: 0 0 auto; border-radius: var(--radius);
    background: radial-gradient(120% 120% at 30% 20%, rgba(140,90,255,.18), rgba(10,12,20,.6) 65%);
    border: 1px solid rgba(140,90,255,.3); padding: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(140,90,255,.12);
}
.hero-demo-wrap canvas { display: block; border-radius: calc(var(--radius) - 4px); max-width: 100%; height: auto; }
.hero-demo-badge {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    display: flex; align-items: center; gap: .4rem;
    background: rgba(10,12,20,.75); backdrop-filter: blur(4px);
    border: 1px solid rgba(201,162,39,.5); border-radius: 20px;
    padding: .3rem .7rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    color: var(--gold); text-transform: uppercase;
}
.hero-demo-badge::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff5a7a;
    box-shadow: 0 0 6px rgba(255,90,122,.9); animation: hero-demo-pulse 1.6s ease-in-out infinite;
}
@keyframes hero-demo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 900px) {
    .hero.hero-split { flex-direction: column; text-align: center; }
    .hero-split .hero-text h1, .hero-split .hero .lead, .hero-split .lead { text-align: center; }
    .hero-split .hero-cta { justify-content: center; }
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2rem 0; }
.card {
    background: var(--panel); border: 1px solid rgba(140, 90, 255, .18);
    border-radius: var(--radius); padding: 1.2rem 1.3rem;
}
.card h3 { margin-top: 0; color: var(--gold); }
.card p { color: var(--muted); margin-bottom: 0; }

/* accueil : bandeau de chiffres + comment ca marche */
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem;
    margin: 2.2rem 0; }
.stat-box { text-align: center; padding: 1rem;
    background: linear-gradient(180deg, rgba(140,90,255,.12), rgba(20,15,36,.5));
    border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius); }
.stat-box b { display: block; font-size: 2rem; color: var(--gold); }
.stat-box span { color: var(--muted); font-size: .9rem; }
.how { margin: 2.5rem 0; text-align: center; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem;
    margin: 1.5rem 0 2rem; }
.how-step { background: var(--panel); border: 1px solid rgba(140,90,255,.18);
    border-radius: var(--radius); padding: 1.4rem 1.2rem; position: relative; }
.how-num { width: 40px; height: 40px; margin: 0 auto .8rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--violet), var(--violet-dim));
    color: #fff; font-weight: 800; font-size: 1.2rem;
    box-shadow: 0 0 14px rgba(140,90,255,.4); }
.how-step h3 { color: var(--gold); margin: 0 0 .4rem; }
.how-step p { color: var(--muted); margin: 0; }

/* --- Jeu --- */
.game-page { display: flex; flex-direction: column; align-items: center; }
.game-menu { text-align: center; padding: 2rem 0; }
.difficulty-grid { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.2rem 0; }
.game-page { max-width: 1320px; margin: 0 auto; }
.game-wrap { position: relative; width: 100%; max-width: 1280px; }
#game {
    width: 100%; display: block;
    border-radius: var(--radius);
    border: 1px solid rgba(140, 90, 255, .3);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
    touch-action: none;
    cursor: crosshair;
}
.hud {
    display: flex; justify-content: space-between;
    padding: .4rem .8rem; font-weight: 700; font-size: 1.05rem;
}
#hud-score { color: var(--gold); }
#hud-flash { color: var(--gold); }
#hud-flash.cd { color: var(--muted); }
#hud-lives { color: var(--danger); letter-spacing: 3px; }
.game-over {
    position: absolute; inset: 0;
    display: flex; justify-content: center; align-items: center;
    background: rgba(8, 6, 16, .78); backdrop-filter: blur(3px);
    border-radius: var(--radius);
    text-align: center;
}
.game-over h2 { color: var(--gold); font-size: 1.8rem; margin: 0; }
/* panneau de rapport de fin de partie */
.report {
    background: linear-gradient(180deg, rgba(35,26,62,.97), rgba(18,14,32,.97));
    border: 1px solid rgba(201,162,39,.55); border-radius: 14px;
    padding: 1.4rem 2rem 1.6rem; min-width: 380px; max-width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,.65), 0 0 30px rgba(140,90,255,.12);
}
.report-diff {
    display: inline-block; margin: .35rem 0 1rem; padding: .18rem .9rem;
    border: 1px solid var(--violet-dim); border-radius: 20px;
    color: #b596ff; font-weight: 700; font-size: .85rem; letter-spacing: .5px;
}
.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.rp-stat {
    background: rgba(10,12,20,.5); border: 1px solid rgba(140,90,255,.22);
    border-radius: 10px; padding: .6rem .3rem;
    display: flex; flex-direction: column; gap: .1rem;
}
.rp-ic { font-size: 1.1rem; }
.rp-stat b { color: var(--gold); font-size: 1.15rem; }
.rp-stat small { color: var(--muted); font-size: .68rem; }
.report-rewards { display: flex; justify-content: center; gap: 1.4rem; margin-bottom: .7rem; }
.rp-gain { color: #b596ff; font-weight: 700; }
.rp-gain b { font-size: 1.15rem; }
.rp-gain.gold { color: var(--gold); }
.report-level { display: flex; align-items: center; gap: .7rem; justify-content: center; margin-bottom: .5rem; }
.report-level > span:first-child { color: var(--text); font-size: .9rem; white-space: nowrap; }
.report-level b { color: #b596ff; }
.rp-bar { width: 170px; }
.rp-levelup { color: var(--gold); font-weight: 800; margin: .3rem 0; animation: rp-pop .5s ease-out; }
@keyframes rp-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.report-rank { display: flex; flex-direction: column; gap: .25rem; margin: .6rem 0 .4rem; font-size: .95rem; }
.report-rank b { color: var(--gold); }
.rp-newbest { color: #7dff9a; font-weight: 700; }
.report .hero-cta { margin-top: .9rem; }
@media (max-width: 520px) {
    .report { min-width: 0; padding: 1rem; }
    .report-stats { grid-template-columns: repeat(2, 1fr); }
}
.hint { color: var(--muted); font-size: .92rem; }
.warn { color: var(--gold); }
.demo-lobby-link {
    display: inline-block; margin-top: 1rem; font-weight: 700; font-size: .92rem;
    color: var(--violet); transition: color .15s;
}
.demo-lobby-link:hover { color: var(--gold); }

/* --- Leaderboard --- */
.lb-filters { display: flex; gap: .8rem; margin: 1rem 0; }
.lb-filters select { padding: .5rem .9rem; border-radius: 20px; font-weight: 600; cursor: pointer; }
/* podium top 3 : dispositon 2-1-3 */
.lb-podium { display: flex; justify-content: center; align-items: flex-end; gap: 1.2rem;
    margin: 1.5rem 0 2rem; min-height: 0; }
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: .3rem;
    padding: 1rem 1.4rem 0; }
.podium-spot img { border-radius: 50%; border: 3px solid var(--violet-dim); }
.podium-spot.p1 img { border-color: var(--gold); width: 72px; height: 72px;
    box-shadow: 0 0 20px rgba(201,162,39,.45); }
.podium-spot.p2 img { border-color: #c0c0c0; }
.podium-spot.p3 img { border-color: #cd7f32; }
.podium-medal { font-size: 1.5rem; }
.podium-spot.p1 .podium-medal { font-size: 2rem; }
.podium-name { font-weight: 700; max-width: 130px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.podium-score { color: var(--gold); font-weight: 800; font-size: 1.1rem; }
.podium-base { width: 100%; text-align: center; border-radius: 8px 8px 0 0;
    font-weight: 800; color: rgba(255,255,255,.55); padding-top: .4rem; }
.podium-spot.p1 .podium-base { height: 64px; background: linear-gradient(180deg, rgba(201,162,39,.5), rgba(201,162,39,.12)); }
.podium-spot.p2 .podium-base { height: 44px; background: linear-gradient(180deg, rgba(192,192,192,.4), rgba(192,192,192,.1)); }
.podium-spot.p3 .podium-base { height: 32px; background: linear-gradient(180deg, rgba(205,127,50,.4), rgba(205,127,50,.1)); }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th, .lb-table td { padding: .55rem .8rem; text-align: left; }
.lb-table thead th { color: var(--muted); border-bottom: 1px solid var(--violet-dim); font-size: .85rem; text-transform: uppercase; }
.lb-table tbody tr { border-bottom: 1px solid rgba(140, 90, 255, .08); }
.lb-table tbody tr:hover { background: rgba(140, 90, 255, .07); }
.lb-player { display: flex; align-items: center; gap: .6rem; }
.lb-player img { border-radius: 50%; }
.lb-top1 td:first-child { color: var(--gold); font-weight: 800; }
.lb-top2 td:first-child { color: #c0c0c0; font-weight: 800; }
.lb-top3 td:first-child { color: #cd7f32; font-weight: 800; }

/* --- Champions --- */
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; margin: 1.5rem 0; }
.champ-card { text-align: center; transition: transform .12s, box-shadow .15s; }
.champ-card:hover { transform: translateY(-4px); box-shadow: 0 8px 26px var(--champ-glow, rgba(140,90,255,.3)); }
.champ-card h3 { margin: .6rem 0 .2rem; }
.champ-demo { width: 100%; border-radius: 8px; border: 1px solid rgba(140, 90, 255, .25); }
.champ-ref { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; font-style: italic; }
.champ-desc { min-height: 3em; }
.champ-stats { display: flex; justify-content: center; gap: 1rem; color: var(--muted); font-size: .9rem; }
.champ-stats b { color: var(--gold); }

/* --- Progression : boutique & equipement --- */
.prog-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.prog-stats { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
    background: rgba(10,12,20,.55); border: 1px solid rgba(201,162,39,.5);
    border-radius: 10px; padding: .55rem 1rem; width: fit-content; }
.prog-stats.prominent { margin: 0 auto 1rem; font-size: 1.05rem;
    box-shadow: 0 0 18px rgba(201,162,39,.15); }
.prog-gold b { color: var(--gold); font-size: 1.25rem; }
.prog-level b { color: #b596ff; font-size: 1.25rem; }
.xp-label { color: var(--muted); font-size: .8rem; }
.xp-bar { width: 180px; height: 12px; background: rgba(140,90,255,.15); border-radius: 6px; overflow: hidden; border: 1px solid var(--violet-dim); }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); border-radius: 6px; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.item-card { text-align: center; transition: transform .12s, box-shadow .15s; }
.item-card:not(.locked):hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(140,90,255,.3); }
.item-card.locked { opacity: .55; filter: grayscale(.6); }
.item-card.owned { border-color: rgba(125,255,154,.45); }
/* or insuffisant : contrairement a .locked (niveau), l'objet reste achetable
   (le bouton fonctionne des qu'on a assez d'or) donc pas de grayscale total,
   juste le prix en rouge pour signaler pourquoi l'achat va echouer. */
.item-card.unaffordable .item-price { color: #ff5a7a; }
.item-icon { font-size: 2.4rem; line-height: 1; margin: .3rem 0 .5rem;
    filter: drop-shadow(0 0 8px rgba(201,162,39,.5)); }
.item-icon.sm { font-size: 1.3rem; margin: 0; }
.item-desc { color: var(--muted); font-size: .92rem; min-height: 3.2em; }
.item-footer { display: flex; align-items: center; justify-content: center; gap: .8rem; min-height: 42px; }
.item-price { color: var(--gold); font-weight: 700; }
.item-lock { color: var(--muted); }
.item-owned { color: #7dff9a; font-weight: 700; }

/* boutique : bandeau marchand */
.shop-hero { display: flex; align-items: center; gap: 2rem; flex-wrap: nowrap;
    background: linear-gradient(135deg, rgba(140,90,255,.12), rgba(201,162,39,.08));
    border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius);
    padding: 1rem 1.6rem; margin-bottom: 1.5rem; }
.shopkeeper-wrap { flex-shrink: 0; }
.shop-hero-text { flex: 1; min-width: 0; }
.shop-hero-text h1 { margin-top: 0; }
.shop-hero-text .lead { margin-bottom: 1rem; }
@media (max-width: 640px) { .shop-hero { flex-wrap: wrap; } }
.shop-hero { padding-top: 3rem; }
.shopkeeper-wrap { position: relative; }
.shop-bubble { position: absolute; top: -40px; left: 0; max-width: 220px;
    background: var(--panel); border: 1px solid var(--gold); border-radius: 12px 12px 12px 2px;
    padding: .5rem .8rem; font-size: .88rem; color: var(--text); z-index: 2;
    opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; pointer-events: none; }
.shop-bubble.show { opacity: 1; transform: translateY(0); }
.shop-cat { display: flex; align-items: center; gap: .6rem; margin-top: 2rem;
    border-bottom: 1px solid rgba(201,162,39,.35); padding-bottom: .5rem; }
.cat-icon { font-size: 1.4rem; filter: drop-shadow(0 0 6px rgba(201,162,39,.6)); }

/* fiche de personnage */
.char-sheet { display: grid; grid-template-columns: 1fr minmax(360px, auto) 1fr; gap: 2rem;
    align-items: center; margin: 1.5rem 0;
    background: linear-gradient(180deg, rgba(140,90,255,.08), rgba(20,15,36,.4));
    border: 1px solid rgba(140,90,255,.22); border-radius: var(--radius); padding: 1.5rem; }
.sheet-col h2 { font-size: 1.05rem; color: var(--gold); margin: .4rem 0 .8rem; }
.sheet-col:first-child { justify-self: end; text-align: right; }
.sheet-col:first-child .slot-col { align-items: flex-end; }
.sheet-center { text-align: center; }
.char-name { font-weight: 800; font-size: 1.15rem; color: var(--gold); margin-top: .2rem; }
.slot-col { display: flex; flex-direction: column; gap: .9rem; }
.equip-slot.cosmetic { opacity: .45; }
@media (max-width: 860px) {
    .char-sheet { grid-template-columns: 1fr; }
    .sheet-col:first-child { justify-self: start; text-align: left; }
    .sheet-col:first-child .slot-col { align-items: flex-start; }
    .slot-col { flex-direction: row; flex-wrap: wrap; }
}

.equip-section { margin: 1.8rem 0; }
.slot-row { display: flex; gap: 1rem; }
.equip-slot {
    width: 92px; height: 92px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .25rem; font-size: .82rem; text-align: center; cursor: pointer;
    background: rgba(140,90,255,.08);
    border: 2px dashed var(--violet-dim);
    transition: border-color .15s, background .15s;
}
.equip-slot.open:hover { border-color: var(--gold); }
.equip-slot.filled { border-style: solid; border-color: var(--gold); background: rgba(201,162,39,.1); }
.equip-slot.locked { cursor: default; opacity: .5; border-color: #3a3355; }
.slot-lock { color: var(--muted); }
.inv-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: .8rem 0; }
.inv-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .9rem; border-radius: 10px; cursor: pointer;
    background: var(--panel); border: 1px solid var(--violet-dim);
    transition: border-color .15s, transform .1s;
}
.inv-item:hover { border-color: var(--gold); transform: translateY(-2px); }
.inv-item.equipped { border-color: #7dff9a; box-shadow: 0 0 10px rgba(125,255,154,.25); }
.equip-actions { display: flex; align-items: center; gap: 1rem; margin-top: .6rem; }
.equip-actions.center { justify-content: center; margin-top: 1rem; }
.slot-plus { font-size: 1.8rem; color: var(--violet-dim); font-weight: 300; }
.equip-slot.open:hover .slot-plus { color: var(--gold); }
.slot-name { font-size: .78rem; }

/* cadre de statistiques (base + bonus des runes) */
.stats-frame {
    margin: 1rem auto 0; max-width: 280px; text-align: left;
    background: rgba(10,12,20,.55); border: 1px solid rgba(140,90,255,.35);
    border-radius: 10px; padding: .7rem 1rem;
}
.stats-frame h3 { margin: 0 0 .5rem; font-size: .95rem; color: var(--gold);
    border-bottom: 1px solid rgba(201,162,39,.3); padding-bottom: .35rem; }
.stat-line { display: flex; justify-content: space-between; padding: .22rem 0;
    color: var(--muted); font-size: .92rem; }
.stat-line b { color: var(--text); }
.stat-line .st-bonus { color: #7dff9a; margin-left: .3rem; }
.stat-line .st-bonus:empty { display: none; }

/* panneau de choix d'objet */
.picker-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(8, 6, 16, .7); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
}
.picker {
    background: var(--panel); border: 1px solid var(--violet-dim);
    border-radius: var(--radius); padding: 1.2rem 1.4rem; min-width: 300px;
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.picker h3 { margin: 0 0 .8rem; color: var(--gold); }
.picker-items { display: flex; flex-direction: column; gap: .4rem; }
.picker-item {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    padding: .6rem .8rem; border-radius: 9px; cursor: pointer;
    background: rgba(255,255,255,.03); border: 1px solid transparent;
    color: var(--text); font: inherit; text-align: left;
}
.picker-item:not(:disabled):hover { border-color: var(--gold); background: rgba(140,90,255,.1); }
.picker-item.current { border-color: #7dff9a; }
.picker-item.locked { opacity: .45; filter: grayscale(.7); cursor: not-allowed; }
.picker-item.locked .picker-name { text-decoration: line-through; }
.picker-item.used { opacity: .55; cursor: not-allowed; }
.picker-name { flex: 1; }
.picker-tag { font-size: .78rem; color: var(--muted); }
.picker-remove { margin-top: .8rem; width: 100%; }
.unlock-track { max-width: 560px; }
.next-unlocks { color: var(--muted); line-height: 2; }
.next-unlocks li::marker { content: '🔓 '; }

/* inventaire + arbre de deblocages cote a cote */
.equip-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .equip-bottom { grid-template-columns: 1fr; } }

/* arbre de deblocages : noeuds relies par une ligne, colonne scrollable */
.unlock-track {
    position: relative; max-height: 380px; overflow-y: auto;
    padding: .3rem .6rem .3rem 1.3rem;
    border: 1px solid rgba(140,90,255,.22); border-radius: var(--radius);
    background: rgba(20,15,36,.45);
    scrollbar-width: thin; scrollbar-color: var(--violet-dim) transparent;
}
.unlock-track::-webkit-scrollbar { width: 8px; }
.unlock-track::-webkit-scrollbar-track { background: transparent; }
.unlock-track::-webkit-scrollbar-thumb { background: var(--violet-dim); border-radius: 4px; }
.unlock-track::-webkit-scrollbar-thumb:hover { background: var(--violet); }
.unlock-node { position: relative; display: flex; gap: 1.1rem; padding: .8rem .5rem .8rem 8px;
    border-radius: 10px; transition: background .15s; }
.unlock-node:hover { background: rgba(140,90,255,.06); }
.unlock-node + .unlock-node { border-top: 1px solid rgba(140,90,255,.1); }
/* la ligne qui relie les noeuds */
.unlock-node::before {
    content: ''; position: absolute; left: 27px; top: 0; bottom: 0; width: 2px;
    background: repeating-linear-gradient(180deg, rgba(140,90,255,.4) 0 4px, transparent 4px 8px);
}
.unlock-node:first-child::before { top: 50%; }
.unlock-node:last-child::before { bottom: 50%; }
.unlock-node.reached::before {
    background: linear-gradient(180deg, rgba(201,162,39,.85), rgba(201,162,39,.45)); }
.unlock-badge {
    position: relative; z-index: 1; flex-shrink: 0; align-self: center;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 35% 30%, rgba(140,90,255,.25), var(--panel) 70%);
    border: 2px solid var(--violet-dim);
    font-weight: 800; font-size: 1.05rem; color: var(--muted);
    transition: transform .15s;
}
.unlock-node:hover .unlock-badge { transform: scale(1.08); }
.unlock-node.reached .unlock-badge {
    background: radial-gradient(circle at 35% 30%, rgba(201,162,39,.35), var(--panel) 70%);
    border-color: var(--gold); color: var(--gold);
    box-shadow: 0 0 14px rgba(201,162,39,.45);
}
.unlock-items { display: flex; flex-direction: column; gap: .4rem; justify-content: center; }
.unlock-item { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--muted); }
.unlock-node.reached .unlock-item { color: var(--text); }
.unlock-icon { font-size: 1.05rem; width: 1.7rem; height: 1.7rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; border-radius: 8px;
    background: rgba(140,90,255,.1); filter: drop-shadow(0 0 5px rgba(201,162,39,.35)); }
.unlock-node.reached .unlock-icon { background: rgba(201,162,39,.14); }
.unlock-node:not(.reached) .unlock-icon { filter: grayscale(.85); opacity: .55; }

/* --- Lobby multijoueur (scene "3D" de la Faille avec podiums en arc) --- */
.lobby-stage {
    position: relative; flex: 1; min-height: calc(100vh - 64px);
    display: flex; flex-direction: column; overflow: hidden;
    padding: 1.2rem 1.4rem 0;
}
.lobby-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* illustration de fond : plateforme rituelle symetrique, teintee vers le
   violet/or du site (l'original penche bleu-teal) + tres legere derive
   ("Ken Burns") pour que la scene ne soit pas totalement figee. */
.lobby-bg-image {
    position: absolute; inset: -2%;
    background-image: url('/img/lobby-bg-ba080b2c1492017dab609a8b121689ec.jpg');
    background-size: cover; background-position: center 42%;
    filter: saturate(1.15) hue-rotate(-8deg) brightness(.85) contrast(1.05);
    animation: lobby-bg-drift 40s ease-in-out infinite alternate;
}
@keyframes lobby-bg-drift {
    from { transform: scale(1.04) translate(0, 0); }
    to   { transform: scale(1.1) translate(-0.8%, -0.6%); }
}

.lobby-glow {
    position: absolute; top: -10%; left: 50%; width: 900px; height: 500px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(201,162,39,.14) 0%, rgba(140,90,255,.07) 45%, transparent 70%);
}
/* degrade sombre par-dessus l'illustration : lisibilite de l'interface,
   surtout en bas ou les podiums/le chat se posent. */
.lobby-fog {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(8,6,16,.35) 0%, transparent 30%, transparent 55%, rgba(8,6,16,.6) 80%, rgba(8,6,16,.9) 100%),
        linear-gradient(90deg, rgba(8,6,16,.5) 0%, transparent 18%, transparent 82%, rgba(8,6,16,.5) 100%);
}

.lobby-topbar { position: relative; z-index: 2; }
.lobby-topbar h1 { margin: 0; font-size: 1.5rem; }

/* panneau de reglages (mode + difficulte) : regroupe, flottant, hors du champ
   des podiums — plus l'ancien alignement colle au titre en haut a droite. */
.lobby-config {
    position: absolute; z-index: 5; top: 96px; left: 1.4rem;
    display: flex; flex-direction: column; gap: .7rem;
    background: rgba(10,12,20,.55); backdrop-filter: blur(6px);
    border: 1px solid rgba(140,90,255,.3); border-radius: var(--radius);
    padding: .9rem 1rem;
}
.config-group { display: flex; flex-direction: column; gap: .35rem; }
.config-label { font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted); padding-left: .2rem; }
.mode-select, .diff-select { display: flex; gap: .35rem; background: rgba(10,12,20,.5);
    border: 1px solid rgba(140,90,255,.3); border-radius: 12px; padding: .3rem; }
.mode-btn, .diff-btn {
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    padding: .45rem .8rem; border-radius: 9px; font-weight: 700; font-size: .8rem;
    display: flex; align-items: center; gap: .4rem; transition: background .15s, color .15s;
}
.mode-btn:hover, .diff-btn:hover { color: var(--text); }
.mode-btn.active, .diff-btn.active {
    background: linear-gradient(135deg, var(--violet), var(--violet-dim)); color: #fff;
    box-shadow: 0 4px 14px rgba(140,90,255,.4);
}
.mode-select[data-locked], .diff-select[data-locked] { opacity: .55; pointer-events: none; }
.nav-equip-btn { display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; }

/* editeur d'equipement in-place (voir lobby.js) : reutilise telle quelle la
   fiche de personnage complete de la page Equipement (.char-sheet et son
   script equipment.js), juste enveloppee dans une popup pour rester dans le
   lobby. Le picker (.picker-overlay, z-index 100) reste en dessous. */
.lobby-equip-overlay {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(8,6,16,.75); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.lobby-equip-panel {
    position: relative;
    background: var(--panel); border: 1px solid var(--violet-dim);
    border-radius: var(--radius); padding: 2.2rem 1.6rem 1.4rem; max-width: 96vw; max-height: 92vh;
    overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.lobby-equip-closebtn {
    position: absolute; top: .7rem; right: .7rem; padding: .3rem .7rem; font-size: .85rem;
}
.lobby-equip-panel .char-sheet.compact { margin: 0; padding: 0; background: none; border: none; }

/* colonne sociale : demandes d'ami, recherche, liste par dossiers, statut en
   ligne — panneau flottant a droite, symetrique de .lobby-config a gauche.
   Agrandie + accent dore en tete pour matcher le standing des autres popups
   (voir .lobby-equip-panel / .add-friend-panel). */
.lobby-social {
    position: absolute; z-index: 5; top: 96px; right: 1.4rem; width: 320px;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, rgba(140,90,255,.1), rgba(10,12,20,.65) 40%);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(140,90,255,.3); border-radius: var(--radius);
    max-height: calc(100vh - 220px);
    box-shadow: 0 14px 38px rgba(0,0,0,.4);
}
.social-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem .8rem;
    border-bottom: 1px solid rgba(201,162,39,.25); margin-bottom: .5rem; }
.social-title { font-size: .82rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .09em; color: var(--gold); flex: 1;
    text-shadow: 0 0 12px rgba(201,162,39,.35); }
.social-title::before { content: '👥'; margin-right: .45rem; font-size: 1rem; filter: none; }
.social-ic-btn {
    position: relative; border: 1px solid rgba(140,90,255,.4); background: rgba(140,90,255,.12);
    color: var(--text); border-radius: 9px; width: 34px; height: 34px; font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}
.social-ic-btn:hover { border-color: var(--gold); background: rgba(201,162,39,.15); transform: translateY(-1px); }
.req-badge {
    position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 3px;
    border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    box-shadow: 0 0 0 2px rgba(10,12,20,.8);
}
.social-search {
    margin: 0 1.1rem .8rem; background: rgba(10,12,20,.55); border: 1px solid var(--violet-dim);
    border-radius: 9px; color: var(--text); padding: .55rem .85rem; font-size: .85rem; outline: none;
    transition: border-color .15s;
}
.social-search:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
.friend-list { overflow-y: auto; padding: 0 .6rem .9rem; scrollbar-width: thin;
    scrollbar-color: var(--violet-dim) transparent; }
.friend-list::-webkit-scrollbar { width: 7px; }
.friend-list::-webkit-scrollbar-thumb { background: var(--violet-dim); border-radius: 4px; }
.friend-group-title { font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); padding: .6rem .5rem .35rem; cursor: pointer;
    display: flex; align-items: center; gap: .35rem; user-select: none; }
.friend-group-title .fg-count { color: var(--violet-dim); font-weight: 400; }
.friend-group.collapsed .friend-group-body { display: none; }
.friend-group-title .fg-arrow { transition: transform .15s; font-size: .6rem; }
.friend-group.collapsed .fg-arrow { transform: rotate(-90deg); }
.friend-row {
    display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 9px;
    cursor: default; position: relative; transition: background .15s;
}
.friend-row:hover { background: rgba(140,90,255,.12); }
.friend-row:hover .friend-actions { opacity: 1; pointer-events: auto; }
.friend-avatar-wrap { position: relative; flex-shrink: 0; }
.friend-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--violet-dim); }
.status-dot { position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px;
    border-radius: 50%; border: 2px solid #14101f; background: #5a5470; }
.status-dot.online { background: #7dff9a; box-shadow: 0 0 5px rgba(125,255,154,.7); }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-status { font-size: .72rem; color: var(--muted); }
/* survole en overlay (position absolue) plutot que dans le flux : sinon le
   select de dossier (largeur variable selon le texte) ecrase .friend-info a
   0px des que le texte des options est un peu long. */
.friend-actions {
    position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; gap: .2rem;
    background: linear-gradient(90deg, transparent, rgba(20,15,36,.92) 22%);
    padding-left: 1.4rem;
    opacity: 0; pointer-events: none; transition: opacity .15s;
}
.friend-actions button {
    border: none; background: transparent; color: var(--muted); cursor: pointer;
    width: 22px; height: 22px; border-radius: 6px; font-size: .8rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.friend-actions button:hover { color: var(--gold); background: rgba(201,162,39,.15); }
.friend-actions button.fa-remove:hover { color: var(--danger); background: rgba(220,80,80,.15); }
.fa-folder {
    max-width: 68px; font-size: .68rem; background: var(--panel); color: var(--muted);
    border: 1px solid var(--violet-dim); border-radius: 6px; padding: .1rem .15rem; flex-shrink: 0;
}
.friend-empty { color: var(--muted); font-size: .84rem; padding: 1.4rem .6rem; text-align: center; line-height: 1.6; }
.friend-empty::before { content: '🙈'; display: block; font-size: 1.6rem; margin-bottom: .3rem; opacity: .7; }

/* popup "Ajouter un ami" — reutilise .lobby-equip-overlay/.lobby-equip-panel,
   agrandie et habillee comme une vraie fiche (accent dore, sections separees
   par un liseret, avatars plus grands) plutot qu'un simple formulaire. */
.add-friend-panel { width: 520px; max-width: 92vw; text-align: left; overflow-x: hidden; padding-top: 1.8rem; }
.add-friend-panel h3 {
    margin: 0 0 1.2rem; color: var(--gold); font-size: 1.3rem; font-weight: 800;
    text-shadow: 0 0 16px rgba(201,162,39,.3);
    padding-bottom: .7rem; border-bottom: 1px solid rgba(201,162,39,.3);
}
.add-friend-panel h3::before { content: '➕ '; }
.add-friend-panel h4 {
    margin: 1.5rem 0 .7rem; color: var(--gold); font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    display: flex; align-items: center; gap: .5rem;
}
.add-friend-panel h4::after { content: ''; flex: 1; height: 1px; background: rgba(140,90,255,.25); }
.friend-search-form { display: flex; gap: .6rem; }
.friend-search-form input {
    flex: 1; background: rgba(10,12,20,.5); border: 1px solid var(--violet-dim); border-radius: 9px;
    color: var(--text); padding: .65rem .9rem; font-size: .92rem; transition: border-color .15s;
}
.friend-search-form input:focus { border-color: var(--gold); outline: none; }
.friend-search-form button { padding: .65rem 1.2rem; font-size: .88rem; }
.search-result-row, .request-row {
    display: flex; align-items: center; gap: .8rem; padding: .7rem .6rem; border-radius: 10px;
    background: rgba(140,90,255,.06); border: 1px solid rgba(140,90,255,.15);
    transition: border-color .15s;
}
.search-result-row + .search-result-row, .request-row + .request-row { margin-top: .5rem; }
.search-result-row:hover, .request-row:hover { border-color: rgba(140,90,255,.35); }
.search-result-row .friend-avatar, .request-row .friend-avatar { width: 40px; height: 40px; }
.sr-name { flex: 1; font-size: .94rem; font-weight: 700; }
.sr-level { color: var(--muted); font-size: .76rem; }
.social-msg { font-size: .82rem; color: var(--muted); margin: .4rem 0 0; }
.social-msg.error { color: var(--danger); }
.social-msg.ok { color: #7dff9a; }

/* badge de messages non lus, colle sur l'avatar de la liste d'amis */
.dm-badge {
    position: absolute; top: -3px; left: -3px; min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 8px; background: var(--danger); color: #fff; font-size: .6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; line-height: 1; z-index: 1;
}

/* messagerie privee : panneau flottant bas-droite, une conversation a la fois */
.dm-panel {
    position: fixed; z-index: 150; right: 20px; bottom: 20px; width: 300px; height: 380px;
    background: var(--panel); border: 1px solid var(--violet-dim); border-radius: var(--radius);
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.dm-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem;
    border-bottom: 1px solid rgba(140,90,255,.25); background: rgba(140,90,255,.08); }
.dm-name { flex: 1; font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-close { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem; }
.dm-close:hover { color: var(--danger); }
.dm-log { flex: 1; overflow-y: auto; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .4rem; }
.dm-bubble { max-width: 80%; padding: .4rem .6rem; border-radius: 10px; font-size: .82rem; line-height: 1.35; word-break: break-word; }
.dm-bubble.mine { align-self: flex-end; background: linear-gradient(135deg, var(--violet), var(--violet-dim)); color: #fff; border-bottom-right-radius: 3px; }
.dm-bubble.theirs { align-self: flex-start; background: rgba(140,90,255,.12); border: 1px solid rgba(140,90,255,.25); border-bottom-left-radius: 3px; }
.dm-form { display: flex; border-top: 1px solid rgba(140,90,255,.2); }
.dm-form input { flex: 1; background: transparent; border: none; color: var(--text); padding: .5rem .6rem; font-size: .82rem; outline: none; }
.dm-form button { border-radius: 0; padding: .5rem .8rem; }

/* interrupteur a bascule (parametres) — remplace les checkboxes brutes */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; cursor: pointer; border-radius: 24px;
    background: rgba(140,90,255,.15); border: 1px solid var(--violet-dim);
    transition: background .18s, border-color .18s;
}
.toggle-slider::before {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.4);
    transition: transform .18s, background .18s;
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--violet), var(--violet-dim)); border-color: var(--gold);
    box-shadow: 0 0 10px rgba(140,90,255,.4);
}
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--gold); outline-offset: 2px; }

.podium-arc {
    position: relative; z-index: 2; flex: 1;
    display: flex; align-items: flex-end; justify-content: center;
    gap: 2.2rem; padding: 1rem 0 2.4rem;
}
.lobby-podium {
    position: relative; width: 168px; display: flex; flex-direction: column;
    align-items: center; transition: transform .25s;
}
.lobby-podium:nth-child(1), .lobby-podium:nth-child(5) { transform: translateY(16px) scale(.84); }
.lobby-podium:nth-child(2), .lobby-podium:nth-child(4) { transform: translateY(6px) scale(.93); }
.lobby-podium.me { z-index: 3; }
/* mode Solo/Duo : les podiums hors capacite restent dans le DOM (simplicite du
   JS) mais sont masques plutot que de montrer des emplacements inutilisables. */
.lobby-podium.hidden { display: none; }

/* banniere qui se deploie derriere le podium des qu'un joueur l'occupe :
   pseudo, niveau, les 2 sorts equipes (case vide si aucun). */
.pod-banner {
    /* etendard complet : depasse AU-DESSUS de l'avatar (comme un drapeau
       plante derriere le joueur) et redescend jusqu'au sol — l'avatar/pilier/
       socle restent devant (z-index superieur). Le texte (pseudo/niveau/sorts)
       se loge tout en haut, DANS la partie visible au-dessus de la tete. */
    position: absolute; z-index: 1; top: -128px; left: 50%; width: 140px; height: 300px;
    transform: translateX(-50%) scaleY(0); transform-origin: 50% 0%;
    /* legers plis verticaux (texture tissu) en plus du degrade de fond */
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 3px, transparent 3px 18px),
        linear-gradient(180deg, rgba(72,50,112,.95) 0%, rgba(60,40,98,.96) 32%, rgba(24,16,44,.97) 100%);
    border: 1px solid rgba(201,162,39,.6); border-top-width: 2px;
    border-radius: 10px 10px 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
    display: flex; flex-direction: column; align-items: center;
    padding-top: .5rem;
    box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
    opacity: 0; pointer-events: none;
    transition: transform .45s cubic-bezier(.22,.85,.32,1.25), opacity .3s;
}
/* tringle doree suspendue en haut de la banniere, avec deux pommeaux */
.pod-banner::before {
    content: ''; position: absolute; top: -9px; left: -12px; right: -12px; height: 7px;
    border-radius: 4px;
    background:
        radial-gradient(circle 4.5px at 4.5px 3.5px, #ffe9a3 0%, var(--gold) 75%, transparent 100%),
        radial-gradient(circle 4.5px at calc(100% - 4.5px) 3.5px, #ffe9a3 0%, var(--gold) 75%, transparent 100%),
        linear-gradient(90deg, rgba(201,162,39,.4), rgba(201,162,39,.95) 15%, rgba(201,162,39,.95) 85%, rgba(201,162,39,.4));
    box-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.lobby-podium.occupied .pod-banner { transform: translateX(-50%) scaleY(1); opacity: 1; }
.banner-name {
    font-weight: 800; font-size: .96rem; text-align: center; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.banner-level { font-size: .78rem; font-weight: 700; color: var(--gold); text-align: center; margin-top: .2rem; }
.banner-spells { display: flex; justify-content: center; gap: .45rem; margin-top: .6rem; }
.banner-spell {
    width: 27px; height: 27px; border-radius: 6px; font-size: 1.02rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(140,90,255,.2); border: 1px solid rgba(201,162,39,.4);
}
.banner-spell.empty { background: rgba(140,90,255,.08); border: 1.5px dashed rgba(201,162,39,.55); }

/* structure du podium, de haut en bas : avatar -> colonne fuselee -> socle au sol
   (toutes trois devant la banniere : z-index > 1, voir .pod-banner) */
.pod-avatar-wrap { position: relative; z-index: 3; }
.pod-pillar {
    position: relative; z-index: 2; width: 70px; height: 58px; margin-top: -6px;
    clip-path: polygon(28% 0%, 72% 0%, 100% 100%, 0% 100%);
    /* nettement plus clair que la banniere juste derriere, sinon les deux
       violets sombres se confondent en un seul bloc illisible */
    background: linear-gradient(180deg, rgba(216,196,255,.95) 0%, rgba(140,90,255,.65) 45%, rgba(60,40,98,.9) 100%);
    box-shadow: inset 0 0 10px rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.55);
    border-left: 2px solid rgba(201,162,39,.75); border-right: 2px solid rgba(201,162,39,.75);
}
.pod-pillar::before {
    content: ''; position: absolute; top: -3px; left: 50%; width: 70%; height: 6px;
    transform: translateX(-50%); border-radius: 50%;
    background: rgba(201,162,39,.4); box-shadow: 0 0 10px rgba(201,162,39,.45);
}
.lobby-podium.leader .pod-pillar { box-shadow: inset 0 0 16px rgba(201,162,39,.25); }
.pod-base {
    position: relative; z-index: 2;
    width: 132px; height: 36px; border-radius: 50%;
    background: linear-gradient(180deg, rgba(180,150,255,.65), rgba(140,90,255,.2));
    border: 1.5px solid rgba(201,162,39,.7);
    box-shadow: 0 0 24px rgba(140,90,255,.4);
    margin-top: -8px;
}
.lobby-podium.leader .pod-base { border-color: var(--gold); box-shadow: 0 0 24px rgba(201,162,39,.5); }
.lobby-podium.empty { opacity: .5; }
.pod-avatar {
    width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--violet-dim); background: var(--panel);
    box-shadow: 0 0 20px rgba(140,90,255,.4);
    animation: pod-bob 3.2s ease-in-out infinite;
}
.lobby-podium.leader .pod-avatar { border-color: var(--gold); box-shadow: 0 0 20px rgba(201,162,39,.5); }
.lobby-podium.ready .pod-avatar { border-color: #7dff9a; box-shadow: 0 0 20px rgba(125,255,154,.4); }
@keyframes pod-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pod-crown {
    /* le glyphe emoji lui-meme n'est pas visuellement centre dans sa boite de
       caracteres (poids graphique decale) — compense de quelques pixels */
    position: absolute; top: -28px; left: 50%; transform: translateX(-50%) translateX(-2px);
    font-size: 2rem; z-index: 4;
    filter: drop-shadow(0 0 6px rgba(201,162,39,.9)) drop-shadow(0 2px 3px rgba(0,0,0,.8));
    animation: pod-crown-bob 3.2s ease-in-out infinite;
}
@keyframes pod-crown-bob { 0%, 100% { transform: translateX(-50%) translateX(-2px) translateY(0); } 50% { transform: translateX(-50%) translateX(-2px) translateY(-4px); } }
.pod-ready-badge {
    position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
    background: #1d1730; border: 2px solid #7dff9a; color: #7dff9a;
    display: flex; align-items: center; justify-content: center; font-size: .75rem;
}
.pod-name { margin-top: .5rem; font-weight: 700; font-size: .9rem; max-width: 130px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-status { font-size: .72rem; color: var(--muted); }
.lobby-podium.ready .pod-status { color: #7dff9a; }

.lobby-bottom { position: relative; z-index: 2; display: flex; justify-content: space-between;
    align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: 0 0 1.2rem; }
.lobby-chat {
    width: 440px; max-width: 100%; background: rgba(10,12,20,.6);
    border: 1px solid rgba(140,90,255,.3); border-radius: var(--radius);
    display: flex; flex-direction: column; overflow: hidden;
}
.chat-log { height: 260px; overflow-y: auto; padding: .6rem .8rem; font-size: .84rem;
    display: flex; flex-direction: column; gap: .3rem; }
.chat-line b { color: #b596ff; }
.chat-line.system { color: var(--muted); font-style: italic; }
.chat-form { display: flex; border-top: 1px solid rgba(140,90,255,.2); }
.chat-form input {
    flex: 1; background: transparent; border: none; color: var(--text);
    padding: .55rem .7rem; font-size: .85rem; outline: none;
}
.chat-send { border-radius: 0; padding: .5rem .9rem; }

.lobby-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.invite-form { display: flex; gap: .5rem; }
.invite-form input {
    background: var(--panel); border: 1px solid var(--violet-dim); border-radius: 8px;
    color: var(--text); padding: .5rem .8rem; font-size: .85rem; width: 200px;
}
.lobby-error { color: var(--danger); font-size: .82rem; margin: 0; }
.invite-disabled-msg { color: var(--muted); font-size: .8rem; font-style: italic; margin: 0; max-width: 220px; text-align: right; }

/* pret / lancer : action principale de la page, centree en bas comme dans un
   vrai lobby LoL, independante du flex chat/invite. */
.lobby-launch {
    position: relative; z-index: 3; display: flex; justify-content: center;
    padding-bottom: 1.2rem; margin-top: -1rem;
}
.lobby-cta { display: flex; gap: .6rem; }
.btn-ready { border-color: #7dff9a; color: #7dff9a; }
.btn-ready.active { background: rgba(125,255,154,.15); }
.lobby-cta .btn-start {
    padding: .7rem 2.4rem; font-size: 1rem;
    box-shadow: 0 8px 26px rgba(140,90,255,.45);
}
.btn-start:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); }

.invite-toast {
    position: fixed; top: 84px; right: 20px; z-index: 200;
    background: var(--panel); border: 1px solid var(--gold); border-radius: var(--radius);
    padding: .9rem 1.1rem; display: flex; align-items: center; gap: .7rem;
    box-shadow: 0 12px 34px rgba(0,0,0,.5); font-size: .88rem;
}
.conn-error-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(10,6,20,.86); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
}
.conn-error-box {
    background: var(--panel); border: 1px solid var(--danger); border-radius: var(--radius);
    padding: 2rem 2.2rem; max-width: 420px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.conn-error-box h2 { color: var(--danger); margin: 0 0 .6rem; }
.conn-error-box p { color: var(--muted); margin: 0 0 1.2rem; }

@media (max-width: 780px) {
    .lobby-config { position: static; margin: .8rem 0; width: 100%; }
    .lobby-social { position: static; margin: .8rem 0; width: 100%; max-height: 260px; }
    .podium-arc { flex-wrap: wrap; }
    .lobby-podium:nth-child(1), .lobby-podium:nth-child(5),
    .lobby-podium:nth-child(2), .lobby-podium:nth-child(4) { transform: scale(.85); }
    .lobby-bottom { flex-direction: column; align-items: stretch; }
    .lobby-actions { align-items: stretch; }
    .invite-form input { width: auto; flex: 1; }
    .dm-panel { right: 10px; left: 10px; bottom: 10px; width: auto; height: 60vh; }
}

/* --- Settings / profil --- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.4rem; max-width: 900px; }
.settings-card { max-width: none; }
.settings-card h3 { border-bottom: 1px solid rgba(201,162,39,.3); padding-bottom: .5rem; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; gap: 1rem; }
.keybind { min-width: 110px; text-align: center; }
.keybind.listening { border-color: var(--gold); color: var(--gold); }
.profile-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.avatar-lg { border-radius: 50%; border: 3px solid var(--gold); }

/* --- Pub (discrete, jamais sur la zone de jeu) --- */
.ad-slot { min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 1.2rem auto; max-width: 728px; width: 100%; }
.ad-slot:empty::after { content: ''; }

/* --- Footer --- */
.footer { padding: 1.5rem 1.2rem; text-align: center; border-top: 1px solid rgba(140, 90, 255, .15); }
.disclaimer { color: var(--muted); font-size: .78rem; max-width: 720px; margin: .8rem auto; }
.copyright { color: var(--muted); font-size: .85rem; }

/* --- Espace staff (/staff/**) --- */
.nav-staff { color: var(--gold) !important; }
/* barre laterale fixe pleine hauteur a gauche, contenu qui utilise TOUT
   l'espace restant (au lieu d'un bloc sidebar+contenu centre avec du vide
   des deux cotes sur grand ecran). 64px = hauteur de la navbar (voir
   .lobby-stage plus haut, meme valeur reutilisee). */
.staff-layout { display: block; min-height: calc(100vh - 64px); }
.staff-side {
    position: fixed; top: 64px; left: 0; bottom: 0; width: 240px; z-index: 4;
    background: rgba(20,15,36,.75); backdrop-filter: blur(6px);
    border-right: 1px solid rgba(140,90,255,.25); border-radius: 0;
    padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: .3rem;
    overflow-y: auto;
}
.staff-main { margin-left: 240px; padding: 1.4rem 2rem 2.4rem; max-width: 1600px; }
.staff-brand { font-weight: 800; color: var(--gold); font-size: 1.05rem; margin-bottom: .6rem; padding: 0 .4rem; }
.staff-nav { display: flex; flex-direction: column; gap: .2rem; }
.staff-nav a {
    color: var(--text); padding: .55rem .7rem; border-radius: 9px; font-size: .9rem;
    display: flex; align-items: center; gap: .5rem; transition: background .15s;
}
.staff-nav a:hover { background: rgba(140,90,255,.12); }
.staff-nav a.active { background: linear-gradient(135deg, var(--violet), var(--violet-dim)); color: #fff; }
.staff-nav a.staff-back { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid rgba(140,90,255,.2); color: var(--muted); }
.staff-role-badge {
    margin-top: .8rem; text-align: center; font-size: .68rem; font-weight: 800; letter-spacing: .06em;
    color: var(--gold); border: 1px solid rgba(201,162,39,.4); border-radius: 8px; padding: .3rem;
}
.staff-h1 { margin: 0 0 1.2rem; font-size: 1.5rem; }

.staff-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; margin-bottom: 1.6rem; }
.staff-card {
    background: var(--panel); border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius);
    padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem;
}
.sc-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sc-value { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.sc-value.sc-live { color: #7dff9a; text-shadow: 0 0 10px rgba(125,255,154,.5); }
.sc-sub { font-size: .76rem; color: var(--violet-dim); }

.staff-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.6rem; }
@media (max-width: 900px) {
    .staff-charts, .staff-two-col { grid-template-columns: 1fr; }
    .staff-side { position: static; width: auto; height: auto; border-right: none;
        border-bottom: 1px solid rgba(140,90,255,.25); border-radius: 0; }
    .staff-main { margin-left: 0; padding: 1.2rem; }
}
.staff-chart-box {
    background: var(--panel); border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius);
    padding: 1rem 1.1rem 0.6rem;
}
.staff-chart-box h3 { margin: 0 0 .8rem; font-size: .92rem; color: var(--gold); }
.staff-barchart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 2rem; }
.sb-bar {
    flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
    height: 100%; position: relative; cursor: default; border-radius: 4px;
    transition: background .12s;
}
.sb-bar:hover { background: rgba(140,90,255,.08); }
.sb-fill { width: 100%; min-height: 2px; background: linear-gradient(180deg, var(--violet), var(--violet-dim)); border-radius: 3px 3px 0 0; }
.sb-fill.gold { background: linear-gradient(180deg, #ffe9a3, var(--gold)); }
.sb-label { font-size: .58rem; color: var(--muted); margin-top: .3rem; writing-mode: vertical-rl; transform: rotate(180deg); height: 26px; }
/* tooltip custom (remplace le title systeme, lent et illisible sur fond
   sombre) : apparait instantanement, colle au theme du site. */
.sb-bar[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
    background: var(--panel); border: 1px solid var(--gold); border-radius: 8px;
    padding: .35rem .6rem; font-size: .72rem; font-weight: 600; color: var(--text);
    white-space: nowrap; pointer-events: none; z-index: 6;
    box-shadow: 0 6px 18px rgba(0,0,0,.5);
    opacity: 0; visibility: hidden; transition: opacity .1s, transform .1s;
}
.sb-bar[data-tip]::before {
    content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--gold);
    opacity: 0; visibility: hidden; transition: opacity .1s;
}
.sb-bar[data-tip]:hover::after, .sb-bar[data-tip]:hover::before { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.staff-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.staff-panel {
    background: var(--panel); border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.staff-panel h3 { margin: 0 0 .8rem; font-size: .92rem; color: var(--gold); }
.staff-diff-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .85rem; }
.sd-label { width: 60px; color: var(--muted); }
.sd-bar { flex: 1; height: 10px; background: rgba(140,90,255,.1); border-radius: 5px; overflow: hidden; }
.sd-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); }
.sd-count { width: 40px; text-align: right; color: var(--text); }

.staff-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.staff-table td, .staff-table th { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid rgba(140,90,255,.12); }
.staff-table th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.staff-table .st-rank { color: var(--gold); font-weight: 700; width: 32px; }
.staff-table .st-avatar img, .staff-table .st-avatar-name img { border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.staff-table .st-mono { font-family: monospace; color: var(--muted); font-size: .8rem; }
.staff-table th.num, .staff-table td.num { text-align: right; }
.staff-players-table tbody tr { transition: background .12s; }
.staff-players-table tbody tr:hover { background: rgba(140,90,255,.06); }
.staff-players-table .st-avatar-name { display: flex; align-items: center; gap: .55rem; }
.staff-players-table .st-avatar-name img { border-radius: 50%; margin: 0; }
.st-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a5470; flex-shrink: 0; }
.st-status-dot.on { background: #7dff9a; box-shadow: 0 0 5px rgba(125,255,154,.7); }
.staff-level-badge { background: rgba(140,90,255,.15); color: #b596ff; border-radius: 6px;
    padding: .15rem .5rem; font-size: .78rem; font-weight: 700; }
.st-lastlogin { color: var(--muted); font-size: .82rem; cursor: help; }
.staff-role-tag { padding: .15rem .5rem; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.staff-role-tag.ADMIN { background: rgba(201,162,39,.18); color: var(--gold); }
.staff-role-tag.SUPPORT { background: rgba(140,90,255,.18); color: #b596ff; }

.staff-search { display: flex; gap: .6rem; margin-bottom: .6rem; }
.staff-search input {
    flex: 1; max-width: 320px; background: var(--panel); border: 1px solid var(--violet-dim); border-radius: 8px;
    color: var(--text); padding: .5rem .8rem; font-size: .85rem;
}
.staff-result-count { color: var(--muted); font-size: .82rem; margin: 0 0 .8rem; }
.staff-empty { text-align: center; color: var(--muted); padding: 1.4rem !important; }
.staff-add-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.staff-add-form input, .staff-add-form select {
    background: rgba(10,12,20,.5); border: 1px solid var(--violet-dim); border-radius: 8px;
    color: var(--text); padding: .5rem .8rem; font-size: .85rem;
}
.staff-add-form input[name="label"] { flex: 1; min-width: 160px; }

.staff-games-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .8rem; }
.staff-games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; }
.staff-game-card {
    background: var(--panel); border: 1px solid rgba(140,90,255,.25); border-radius: var(--radius);
    padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem;
    max-width: 400px; /* auto-fit etire sinon une seule carte sur toute la largeur */
}
.sg-head { display: flex; justify-content: space-between; align-items: center; }
.sg-diff { font-size: .7rem; font-weight: 800; text-transform: uppercase; padding: .2rem .5rem; border-radius: 6px; }
.sg-diff-EASY { background: rgba(125,255,154,.15); color: #7dff9a; }
.sg-diff-NORMAL { background: rgba(140,90,255,.18); color: #b596ff; }
.sg-diff-HARD { background: rgba(255,165,90,.18); color: #ffa55a; }
.sg-diff-INSANE { background: rgba(255,90,122,.18); color: var(--danger); }
.sg-elapsed { font-size: .8rem; color: var(--muted); }
.sg-id { font-family: monospace; font-size: .7rem; color: var(--violet-dim); }
.sg-stats { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.sg-players { display: flex; flex-direction: column; gap: .3rem; border-top: 1px solid rgba(140,90,255,.15); padding-top: .5rem; }
.sg-player { display: flex; align-items: center; gap: .5rem; font-size: .82rem; }
.sg-player.dead { opacity: .5; }
.sg-player-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-player-lives { font-size: .78rem; }
.sg-player-conn { width: 8px; height: 8px; border-radius: 50%; background: #5a5470; flex-shrink: 0; }
.sg-player-conn.on { background: #7dff9a; box-shadow: 0 0 5px rgba(125,255,154,.7); }
.staff-spectate-btn { margin-top: .3rem; opacity: .5; cursor: not-allowed; }

/* --- Responsive --- */
@media (max-width: 720px) {
    .nav-toggle { display: block; margin-left: auto; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; background: var(--bg2);
        padding: 1rem; border-bottom: 1px solid var(--violet-dim);
    }
    .nav-links.open { display: flex; }
    .hero { padding: 2rem 0 1.5rem; }
    .lb-table th:nth-child(4), .lb-table td:nth-child(4) { display: none; }
    .setting-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
