/* Barres flottantes (mobile et tablette) : la barre du haut et la barre du bas deviennent des capsules arrondies
   qui flottent au-dessus du contenu, avec un léger flou derrière. Le J-2, le logo et les icônes ne changent pas. */
@media (max-width:1099px){
  html body:not(.fullscreen) .topbar{position:sticky!important;top:calc(.45rem + env(safe-area-inset-top))!important;z-index:40!important;
    margin:calc(.45rem + env(safe-area-inset-top)) .6rem .35rem!important;padding:.45rem .55rem!important;width:auto!important;max-width:none!important;
    border-radius:22px!important;border:1px solid var(--bd)!important;
    background:rgba(var(--paper-rgb,17,16,15),.86)!important;background:color-mix(in srgb,var(--card) 86%,transparent)!important;
    backdrop-filter:blur(18px) saturate(1.4)!important;-webkit-backdrop-filter:blur(18px) saturate(1.4)!important;box-shadow:0 10px 30px rgba(0,0,0,.2)!important}
  html.tb-mini body:not(.fullscreen) .topbar{padding:.3rem .5rem!important}
  /* pages plein écran (messages, chat) : même capsule, posée en haut de l'écran */
  html body.fullscreen .topwrap{background:var(--bg)!important;border:0!important;padding:calc(.45rem + env(safe-area-inset-top)) .6rem .35rem!important}
  html body.fullscreen .topwrap .topbar{margin:0!important;padding:.45rem .55rem!important;width:auto!important;max-width:none!important;border-radius:22px!important;border:1px solid var(--bd)!important;
    background:rgba(var(--paper-rgb,17,16,15),.86)!important;background:color-mix(in srgb,var(--card) 86%,transparent)!important;box-shadow:0 8px 24px rgba(0,0,0,.18)!important}
  html body.fullscreen .topbar::after{display:none!important}
  html body:not(.fullscreen) .topbar::after,html body:not(.fullscreen) .topwrap::after{display:none!important}

  html body .bottom-nav{left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;height:64px!important;padding:0 .3rem!important;
    align-items:center!important;border-radius:26px!important;border:1px solid var(--bd)!important;
    background:rgba(var(--paper-rgb,17,16,15),.88)!important;background:color-mix(in srgb,var(--card) 86%,transparent)!important;
    backdrop-filter:blur(18px) saturate(1.4)!important;-webkit-backdrop-filter:blur(18px) saturate(1.4)!important;box-shadow:0 12px 34px rgba(0,0,0,.28)!important}
  html body .bottom-nav a{height:52px!important;border-radius:18px!important;justify-content:center!important}
  html body .bottom-nav a.on:not(.bn-post){background:rgba(var(--acc-rgb),.14)!important}

  /* bandeau d'info : une bulle arrondie sous la barre du haut, qui défile avec la page */
  html body .gv-alerts{position:relative!important;z-index:5!important;margin:0 .6rem .5rem!important;display:flex;flex-direction:column;gap:.4rem}
  html body .gv-al{border:1px solid rgba(var(--al-rgb),.4)!important;border-radius:18px!important;
    background:linear-gradient(90deg,rgba(var(--al-rgb),.2),rgba(var(--al-rgb),.1)),var(--card)!important;box-shadow:0 6px 18px rgba(0,0,0,.12)!important;overflow:hidden}
  html body .gv-al-in{padding:.5rem .4rem .5rem .8rem!important;min-height:0!important}

  /* « Quoi de neuf » assorti aux barres */
  html body .cm-compose{background:rgba(var(--paper-rgb,17,16,15),.86)!important;background:color-mix(in srgb,var(--card) 86%,transparent)!important;border:1px solid var(--bd)!important;box-shadow:0 8px 24px rgba(0,0,0,.14)!important}

  /* le contenu ne passe plus sous la barre du bas */
  html body .shell{padding-bottom:calc(var(--nav-h) + 44px + env(safe-area-inset-bottom))!important}
  html body .rwbar{bottom:calc(var(--nav-h) + 22px + env(safe-area-inset-bottom))!important}
  html body .pd-form{bottom:calc(var(--nav-h) + 20px + env(safe-area-inset-bottom))!important}
  html body .toast{bottom:calc(var(--nav-h) + 30px + env(safe-area-inset-bottom))!important}
}

/* ================= Menu (v3) : panneau flottant, même verre que les barres =================
   Mobile et tablette : le menu flotte (détaché des bords), tuiles d'accès rapide, doublons des barres masqués,
   mode clair/sombre en icône dans l'en-tête, déconnexion dans « Compte ». Le PC garde son menu latéral complet. */
.v2d-out-end{display:none!important}
.v2d-out-in{margin:0}.v2d-out-in button{display:flex;align-items:center;gap:.85rem;width:100%;padding:.62rem .7rem;border:0;background:none;color:#e5675a;font:inherit;font-weight:700;cursor:pointer;border-radius:14px;text-align:left}
.v2d-out-in button .ico{width:20px;height:20px}
.v2d-rw{display:flex;align-items:center;gap:.7rem;margin:.55rem 0 .2rem;padding:.7rem .85rem;border-radius:16px;text-decoration:none!important;color:var(--ink)!important;
  background:linear-gradient(135deg,rgba(224,122,95,.2),rgba(224,122,95,.06));border:1px solid rgba(224,122,95,.4);font-size:.92rem}
.v2d-rw .ico{width:20px;height:20px;color:#e07a5f;flex:none}.v2d-rw span{flex:1}.v2d-rw b{color:#e07a5f}.v2d-rw .v2d-rwgo{flex:none;font-weight:800;color:#e07a5f}
.v2d-rw::before,.v2d-rw::after,.v2d-rw .v2d-n{content:none!important;display:none!important}
#drawer .v2d-rw,#drawer .v2d-tiles{margin-left:11.2px!important;margin-right:11.2px!important}
.v2d-tiles{display:none}
body.lock .rwbar{display:none!important} /* la barre « récompenses » ne passe plus devant le menu ouvert */
@media (max-width:1099px){
  #drawer.v2d{top:calc(10px + env(safe-area-inset-top))!important;bottom:calc(10px + env(safe-area-inset-bottom))!important;left:10px!important;height:auto!important;
    width:min(318px,calc(100vw - 20px))!important;border-radius:26px!important;background:rgba(21,21,23,.86)!important;
    -webkit-backdrop-filter:blur(18px) saturate(1.4)!important;backdrop-filter:blur(18px) saturate(1.4)!important;border:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 18px 50px rgba(0,0,0,.45)!important;overflow:hidden auto!important;overscroll-behavior:contain;padding-bottom:12px!important}
  #drawer.v2d.open{box-shadow:0 18px 50px rgba(0,0,0,.45),0 0 0 100vmax rgba(0,0,0,.45)!important}
  html[data-theme=light] #drawer.v2d{background:rgba(255,255,255,.88)!important;border-color:rgba(0,0,0,.08)!important}
  html[data-theme=light] #drawer.v2d.open{box-shadow:0 18px 50px rgba(0,0,0,.16),0 0 0 100vmax rgba(0,0,0,.3)!important}
  #drawer .v2d-head{gap:.35rem}#drawer .v2d-head .brand{margin-right:auto}
  #drawer .v2d-dup{display:none!important}
  #drawer .v2d-me{border-radius:20px!important}
  #drawer .v2d-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:.45rem;margin:.55rem 0 .35rem}
  #drawer .v2d-tiles a{display:grid;justify-items:center;gap:.35rem;padding:.75rem .2rem .65rem;border-radius:18px;text-decoration:none!important;color:var(--ink)!important;
    background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.06);font-size:.78rem;font-weight:700}
  html[data-theme=light] #drawer .v2d-tiles a{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.06)}
  #drawer .v2d-tiles .ico{width:23px;height:23px;color:#e07a5f}
  #drawer .v2d-tiles a.on{background:rgba(224,122,95,.16);box-shadow:inset 0 0 0 1px rgba(224,122,95,.35)}
  #drawer .v2d-nav a,#drawer .v2d-nav summary{border-radius:16px!important}
  #drawer .v2d-nav>details{border:0!important;background:rgba(255,255,255,.035);border-radius:18px!important;margin:6px 0!important}
  html[data-theme=light] #drawer .v2d-nav>details{background:rgba(0,0,0,.035)}
  #drawer .v2d-nav [aria-current=page],#drawer .v2d-tiles [aria-current=page]{color:#f0a58f!important}
  #drawer .v2d-nav a[aria-current=page]{background:rgba(224,122,95,.16)!important;box-shadow:inset 0 0 0 1px rgba(224,122,95,.35)}
  html[data-theme=light] #drawer .v2d-nav [aria-current=page],html[data-theme=light] #drawer .v2d-tiles [aria-current=page]{color:#b9533a!important}
  #drawer hr{display:none}
}
@media (max-width:1099px) and (prefers-reduced-motion:no-preference){
  #drawer.v2d .v2d-tiles a{transition:transform .15s ease}#drawer.v2d .v2d-tiles a:active{transform:scale(.96)}
}

/* Menu : barre du bas (mode clair/sombre + déconnexion). Le panneau est en deux parties : le contenu défile
   (.v2d-scroll), la barre du bas reste posée dessous (pas de position:sticky, peu fiable sur Safari iOS). */
.v2d-foot .v2d-out-foot{margin:0}
@media (max-width:1099px){
  #drawer.v2d{display:flex!important;flex-direction:column;overflow:hidden!important;padding-bottom:0!important}
  #drawer .v2d-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:.4rem}
  #drawer .v2d-scroll::-webkit-scrollbar{display:none}
  #drawer .v2d-foot{flex:none;display:flex;align-items:center;gap:.5rem;padding:.65rem 11.2px .75rem;border-top:1px solid rgba(255,255,255,.07);background:rgba(18,18,20,.6)}
  html[data-theme=light] #drawer .v2d-foot{border-top-color:rgba(0,0,0,.07);background:rgba(245,245,245,.7)}
  #drawer .v2d-foot .v2d-theme{flex:1;min-width:0;margin:0!important;min-height:48px;padding:0 .75rem!important;gap:.55rem!important;border-radius:16px!important;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.07)!important;font-size:.88rem;white-space:nowrap}
  html[data-theme=light] #drawer .v2d-foot .v2d-theme{background:rgba(0,0,0,.04);border-color:rgba(0,0,0,.07)!important}
  #drawer .v2d-foot .v2d-sw{display:none!important}
  #drawer .v2d-foot .v2d-theme span{flex:none!important}
  #drawer.v2d .v2d-foot .v2d-out-foot{flex:none}
  #drawer.v2d .v2d-foot .v2d-out-foot button{min-height:48px!important;padding:0 .8rem!important;gap:.4rem!important;border-radius:16px!important;border:1px solid rgba(229,103,90,.35)!important;
    background:rgba(229,103,90,.1)!important;color:#e5675a!important;font:700 .86rem/1 inherit!important;white-space:nowrap}
  #drawer.v2d .v2d-foot .v2d-out-foot button span{flex:none}
  #drawer.v2d .v2d-foot .v2d-out-foot .ico{width:18px;height:18px}
}
