/* Habillage DOFUS Rétro du thème par défaut : parchemin beige-gris, cadres bois sombre,
   barres de titre brunes et boutons orange biseautés. Chargé en dernier ; seul le thème
   « Rétro » est concerné, Bonta et Brâkmar gardent leurs palettes. */
html[data-theme="retro"]{
 --theme-bg:#d5cfaa;--theme-paper:#ddd6b4;--theme-paper-deep:#c9c19a;--theme-card:#ebe5c9;--theme-ink:#2f2a1e;--theme-muted:#5e5640;--theme-border:#9b9271;
 --theme-accent:#c4650a;--theme-accent-ink:#8f4600;--theme-accent-hover:#a65300;--theme-accent-text:#fffaf0;--theme-accent-soft:#f1d8ac;--theme-gold:#f2b632;--theme-gold-ink:#7a4d00;
 --theme-chrome:#3d3628;--theme-chrome-2:#5a5141;--theme-chrome-text:#fbf3dc;--theme-chrome-muted:#d6cca8;--theme-chrome-line:#9b9271;--theme-positive:#4b6b12;--theme-negative:#a33025;
 --theme-hero-rgb:61,54,40;
 --window-chrome:#3d3628;--window-chrome-2:#5c5343;--window-text:#fff8e2;--window-muted:#d8cfab;--window-line:#7d7559;--window-accent:#f0a33a;--window-accent-ink:#3a2a10;
 --window-paper:#ddd6b4;--window-paper-deep:#cbc39c;--window-ink:#2f2a1e;--window-shadow:0 18px 50px #0b090666,0 3px 10px #0b090640;
 --rs-frame:#5b5242;--rs-frame-dark:#221d14;--rs-highlight:#f3eed6;--rs-orange:#e8780c;
}

/* Cadre des fenêtres : bordure bois, filet clair intérieur, coins peu arrondis. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel){
 border:2px solid var(--rs-frame)!important;border-radius:6px!important;
 box-shadow:0 0 0 1px var(--rs-frame-dark),inset 0 0 0 1px var(--rs-highlight),var(--window-shadow)!important;
 background-color:var(--window-paper);color:var(--window-ink);
 scrollbar-color:var(--rs-frame) transparent;
}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel)::backdrop{background:#16120bb3;backdrop-filter:blur(2px) saturate(.8)}

/* Barre de titre brune, liseré orange, titre gravé. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel)>header{
 background:linear-gradient(180deg,#675d4b 0%,#4a4234 48%,#3b3428 100%)!important;
 border-bottom:2px solid var(--rs-orange)!important;border-radius:3px 3px 0 0!important;
 box-shadow:inset 0 1px #ffffff1f,0 2px 0 #0000002e!important;color:var(--window-text)!important;
}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel)>header :is(h2,h3,strong){
 color:#fff6dc!important;text-shadow:0 1px 0 #000a,0 0 8px #0005;letter-spacing:.01em;
}

/* Boutons : coins nets et relief biseauté, quelle que soit leur couleur. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(button,.button,a[role=button]):not(.theme-option,.context-help,.link,[class*=text-link]){
 border-radius:4px!important;
 background-image:linear-gradient(180deg,#ffffff33 0%,#ffffff00 55%,#00000014 100%)!important;
 box-shadow:inset 0 1px #ffffff40,inset 0 -2px #0000001f,0 1px 0 #00000026!important;
 transition:filter .12s,transform .06s;
}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(button,.button,a[role=button]):not(:disabled):hover{filter:brightness(1.06)}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(button,.button,a[role=button]):not(:disabled):active{transform:translateY(1px);box-shadow:inset 0 2px 3px #00000033!important}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) button:disabled{filter:grayscale(.55);opacity:.62}

/* Bouton de fermeture : carré sombre comme dans le client d'origine. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel)>header button:last-of-type{
 background-color:#2c261b!important;border:1px solid #8a8064!important;color:#fff3d6!important;
}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel)>header button:last-of-type:hover{background-color:#a33025!important;filter:none}

/* Champs de saisie : creusés dans le parchemin. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(input:not([type=checkbox],[type=radio],[type=range]),select,textarea){
 border-radius:3px!important;border:1px solid #8c8466!important;background-color:#f4f0dd!important;color:var(--window-ink)!important;
 box-shadow:inset 0 1px 2px #0000002e!important;
}

/* Titres de sections dans la typographie du jeu. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop) :is(h3,h4){color:#4a3a1c}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop) hr{border:0;border-top:1px solid #9b9271;box-shadow:0 1px #f3eed6}

/* Barre d'action et HUD : même bois sombre que les fenêtres. */
html[data-theme="retro"] :is(#spell-bar,#combat-dock,.hud-panel){border-color:var(--rs-frame)!important}

@media (prefers-reduced-motion:reduce){html[data-theme="retro"] *{transition:none!important}}

/* Liens d'aide : restent de simples liens soulignés. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#adventure-panel) .context-help{background:none!important;box-shadow:none!important;color:#8f4600!important}

/* ===== HUD façon client Rétro : panneaux parchemin beige-gris, filets sombres, coins carrés,
   texte noir compact (Verdana 12px). Couvre bandeau haut-gauche, outils haut-droite, carte,
   barre de sorts, étiquettes des PNJ et infobulles. ===== */
html[data-theme="retro"]{--rv-hud:#d5cfaa;--rv-hud-2:#e5dfc4;--rv-hud-3:#beb998;--rv-hud-ink:#1e1a12;--rv-hud-dim:#4f4836;--rv-hud-line:#4a4232;--rv-hud-font:Verdana,Tahoma,"DejaVu Sans",sans-serif}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback){background:linear-gradient(180deg,var(--rv-hud-2),var(--rv-hud) 40%,var(--rv-hud-3))!important;border:1px solid var(--rv-hud-line)!important;border-radius:3px!important;box-shadow:0 0 0 1px #0007,inset 0 0 0 1px #fff9,0 3px 10px #0005!important;color:var(--rv-hud-ink)!important;backdrop-filter:none!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) :is(h1,h2,h3,strong,b,span,small,label,p,em,header,#where,#count,#coords,#player-xp-text,#class-name):not(.spell-slot *){color:var(--rv-hud-ink)!important;text-shadow:none!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) :is(small,#where,#count,.map-progress span){color:var(--rv-hud-dim)!important;font-size:12px!important}
html[data-theme="retro"] .title.glass h1{font-family:var(--font-display,Georgia,serif);color:#3a2a10!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) button:not(.spell-slot):not(.primary):not(.active):not([aria-pressed=true]){background:linear-gradient(180deg,#efe9d0,#cfc8a5)!important;border:1px solid #6d6450!important;border-radius:3px!important;color:var(--rv-hud-ink)!important;box-shadow:inset 0 1px #fffc,0 1px 0 #0003!important;font-family:var(--rv-hud-font);font-weight:700;text-shadow:none!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) button:not(.spell-slot):not(:disabled):hover{filter:brightness(1.05)}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) button:is(.active,[aria-pressed=true]):not(.spell-slot){background:linear-gradient(180deg,#f7a54a,#d86c08)!important;border:1px solid #7a3a00!important;border-radius:3px!important;color:#fff!important;text-shadow:0 1px 0 #0006!important;box-shadow:inset 0 1px #fff6!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) button img{filter:none}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) progress{border:1px solid var(--rv-hud-line)!important;border-radius:1px!important;background:#3d3628!important}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) progress::-webkit-progress-bar{background:#3d3628}html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) progress::-webkit-progress-value{background:linear-gradient(#f7c55a,#d98a12)}html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback) progress::-moz-progress-bar{background:#e8a028}
/* Barre de sorts : cases grises creusées, raccourci noir. */
html[data-theme="retro"] #spell-dock #player-strip{border-bottom:1px solid #8c8466!important}
html[data-theme="retro"] #spell-dock .spell-slot{border:1px solid var(--rv-hud-line)!important;border-radius:2px!important;background:linear-gradient(#a9a387,#c9c3a2)!important;box-shadow:inset 0 2px 4px #0006,0 1px 0 #fff8!important}
html[data-theme="retro"] #spell-dock .spell-slot>span:not(.spell-key){color:#fff!important;text-shadow:0 0 2px #000,0 1px 1px #000!important}
html[data-theme="retro"] #spell-dock .spell-slot .spell-key{background:var(--rv-hud-2)!important;color:var(--rv-hud-ink)!important;border:1px solid var(--rv-hud-line)!important;border-radius:2px!important}
/* Boutons flottants hors panneau (auras, groupe) : même relief beige. */
html[data-theme="retro"] :is(.monster-toggle,#multiplayer-toggle,#adventure-toggle,#adventure-tracker){background:linear-gradient(180deg,#efe9d0,#cfc8a5)!important;border:1px solid var(--rv-hud-line)!important;border-radius:3px!important;color:var(--rv-hud-ink)!important;box-shadow:0 0 0 1px #0006,inset 0 1px #fffc,0 2px 6px #0004!important;font-family:var(--rv-hud-font)!important;font-size:12px!important;font-weight:700;text-shadow:none!important;backdrop-filter:none!important}
html[data-theme="retro"] :is(.monster-toggle,#multiplayer-toggle,#adventure-toggle,#adventure-tracker) *{color:inherit!important}
/* Carte : cadre sombre autour de la minimap. */
html[data-theme="retro"] #mobile-map-panel>header{border-bottom:1px solid #8c8466}html[data-theme="retro"] #mobile-map-panel>header span{font:700 12px var(--rv-hud-font)!important}
html[data-theme="retro"] #minimap{border:2px solid var(--rv-hud-line)!important;border-radius:1px!important;box-shadow:inset 0 0 0 1px #0008}
/* Étiquettes et infobulles au-dessus des PNJ, monstres et joueurs. */
html[data-theme="retro"] :is(#label,.label,.adventure-point-name,.mp-label,.remote-label,[role=tooltip]){background:#ece6cbef!important;border:1px solid var(--rv-hud-line)!important;border-radius:2px!important;color:var(--rv-hud-ink)!important;box-shadow:0 1px 4px #0006!important;text-shadow:none!important;font-family:var(--rv-hud-font)!important;backdrop-filter:none!important}
html[data-theme="retro"] :is(#label,.label,.adventure-point-name,.mp-label,.remote-label) :is(b,strong){color:#000!important;font-size:12px!important}
html[data-theme="retro"] :is(#label,.label,.adventure-point-name,.mp-label,.remote-label) small{color:var(--rv-hud-dim)!important;font-size:12px!important}
/* Barre haute (Accueil / Compte) ; le menu du compte (account-character.css) garde ses couleurs, on n'impose que 12px minimum. */
html[data-theme="retro"] #game-topbar{background:linear-gradient(180deg,var(--rv-hud-2),var(--rv-hud))!important;border:1px solid var(--rv-hud-line)!important;border-radius:3px!important;box-shadow:0 0 0 1px #0007,inset 0 0 0 1px #fff9!important}
html[data-theme="retro"] #game-topbar>a,html[data-theme="retro"] #account-trigger :is(strong,span){color:var(--rv-hud-ink)!important}html[data-theme="retro"] #account-trigger small{color:var(--rv-hud-dim)!important;font-size:12px!important}
html[data-theme="retro"] #account-control :is(small,.account-eyebrow,.account-forgot){font-size:12px!important}
/* Menus et listes déroulantes génériques : jamais de texte clair sur beige. */
html[data-theme="retro"] :is(#mobile-menu-sheet,#quick-access-grid,.context-menu,[role=menu]) :is(b,strong,span){color:var(--rv-hud-ink)}
html[data-theme="retro"] :is(#mobile-menu-sheet,#quick-access-grid,.context-menu,[role=menu]) small{color:var(--rv-hud-dim);font-size:12px}
/* Coque mobile : barre du haut et barre d'exploration en parchemin, comme le HUD. */
html[data-theme="retro"] body.mobile-ui-ready :is(#mobile-topbar>button,#mobile-explorebar){background:linear-gradient(180deg,var(--rv-hud-2),var(--rv-hud) 45%,var(--rv-hud-3))!important;border:1px solid var(--rv-hud-line)!important;border-radius:3px!important;color:var(--rv-hud-ink)!important;box-shadow:0 0 0 1px #0007,inset 0 0 0 1px #fff9,0 3px 10px #0005!important;backdrop-filter:none!important}
html[data-theme="retro"] body.mobile-ui-ready :is(#mobile-topbar>button,#mobile-explorebar) :is(span,b,strong,small,button){color:var(--rv-hud-ink)!important;text-shadow:none!important}
html[data-theme="retro"] body.mobile-ui-ready #mobile-location-coords{color:var(--rv-hud-dim)!important;font-size:12px!important}
html[data-theme="retro"] body.mobile-ui-ready #mobile-explorebar>button{border-color:#8c8466!important}html[data-theme="retro"] body.mobile-ui-ready #mobile-explorebar>button[aria-pressed=true],html[data-theme="retro"] body.mobile-ui-ready #mobile-explorebar>button[aria-expanded=true]{background:#f1d8ac!important}

/* ===== Fenêtres compactes (tous thèmes) : barres de titre basses, marges réduites, boutons 32px à la
   souris, mises en page larges pour éviter le défilement sur ordinateur. ===== */
@media (min-width:701px) and (pointer:fine){
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#astrub-shop,#player-market,#adventure-panel,#multiplayer-panel,#admin-panel,#moderation-panel) :is(button,summary,select,input:not([type=checkbox],[type=radio],[type=range])){min-height:32px!important}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#astrub-shop,#player-market,#adventure-panel,#admin-panel,#moderation-panel) button{min-width:32px}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#multiplayer-panel)>header,html[data-theme] #astrub-shop>.shop-heading,html[data-theme] #player-market .market-heading,html[data-theme] :is(#admin-panel,#moderation-panel)>header{min-height:44px!important;padding:5px 10px 5px 12px!important}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#multiplayer-panel)>header h2,html[data-theme] #astrub-shop .shop-heading h2,html[data-theme] #player-market .market-heading h2,html[data-theme] :is(#admin-panel,#moderation-panel)>header h2{font-size:19px!important;margin:0!important}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#multiplayer-panel)>header h2:before,html[data-theme] #astrub-shop .shop-heading h2:before{width:22px!important;height:24px!important}html[data-theme] #player-market .market-heading h2 img{width:22px;height:24px}
 html[data-theme] :is(#player-dialog-close,#close-book,#cancel-prepare,#adventure-close,#shop-close,#market-close,#admin-close),html[data-theme] #multiplayer-panel [data-mp-close]{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;font-size:17px!important}
 html[data-theme] :is(.adventure-eyebrow,.shop-eyebrow,#multiplayer-eyebrow),html[data-theme] #player-market .market-heading>div>span{font-size:11px!important;line-height:1.1!important}
 html[data-theme] :is(#player-dialog,#class-dialog) :is(.primary-action,.stat-help-links button){min-height:34px!important;padding-block:6px!important}
 html[data-theme] #player-dialog-content{padding:10px 12px!important}
 /* Personnage : chiffres côte à côte avec l'icône, rangées serrées. */
 html[data-theme] #player-dialog[data-view=character]{width:min(900px,calc(100vw - 24px))!important}
 #player-dialog[data-view=character] .character-layout{grid-template-columns:230px minmax(0,1fr)!important;gap:10px!important}
 #player-dialog[data-view=character] .character-details{display:flex;flex-direction:column;gap:7px}#player-dialog[data-view=character] .character-details>*{margin:0!important}
 #player-dialog[data-view=character] .stat-chips{gap:6px!important}#player-dialog[data-view=character] .stat-chips>span{flex-direction:row!important;flex-wrap:wrap;justify-content:center;align-items:center;gap:2px 8px!important;padding:6px 6px!important;min-height:0!important}
 #player-dialog[data-view=character] .stat-chips>span>*{margin:0!important}#player-dialog[data-view=character] .stat-chips>span :is(b,strong){font-size:19px!important;line-height:1.1!important}#player-dialog[data-view=character] .stat-chips>span img{width:22px!important;height:22px!important}
 #player-dialog[data-view=character] .stat-chips>span small{flex-basis:100%;text-align:center;line-height:1.2}
 #player-dialog[data-view=character] .element-stats{gap:6px!important}#player-dialog[data-view=character] .element-stat{padding:5px 7px!important;min-height:0!important}#player-dialog[data-view=character] .element-stat img{width:26px!important;height:26px!important}
 #player-dialog[data-view=character] .secondary-stats{padding:8px 10px!important}#player-dialog[data-view=character] .secondary-stats>*{margin-block:0 6px!important}
 #player-dialog[data-view=character] .resistance-row>*{padding:4px!important;min-height:0!important}#player-dialog[data-view=character] .resistance-row img{width:20px!important;height:20px!important}
 #player-dialog[data-view=character] .stat-help-links{min-height:0;gap:14px}#player-dialog[data-view=character] .stat-help-links button{min-height:24px!important;padding:2px 0!important}
 #player-dialog[data-view=character] :is(.attribute-disclosure,.stat-formulas){padding-block:0!important}
 #player-dialog[data-view=character] .character-next{padding:7px 10px!important}#player-dialog[data-view=character] .character-identity{padding:10px!important}
 #player-dialog[data-view=character] .stat-breakdown{margin-top:8px!important;padding:2px 12px!important}#player-dialog[data-view=character] .bag-footer{padding-top:6px!important}
 #player-dialog[data-view=character] .resistance-row>*{display:grid!important;grid-template-columns:auto auto;justify-content:center;align-items:center;gap:0 6px!important}#player-dialog[data-view=character] .resistance-row>* :last-child{grid-column:1/-1;line-height:1.1}
 #player-dialog[data-view=character] .character-next{gap:8px!important}#player-dialog[data-view=character] .character-next p{margin:0!important;line-height:1.35}#player-dialog[data-view=character] .character-next img{width:22px!important;height:22px!important}
 #player-dialog[data-view=guide] .guide-hero h3,#player-dialog[data-view=guide] .guide-hero h2{font-size:20px!important;margin:2px 0!important}#player-dialog[data-view=guide] .guide-hero p{margin:2px 0!important}
 #player-dialog[data-view=guide] :is(.guide-steps-cards li,.guide-two-columns article) :is(p,span){line-height:1.4!important}#player-dialog[data-view=guide] .guide-two-columns article :is(h3,h4,strong){margin:0 0 3px!important}
 #book-content .book-loadout-heading{margin-bottom:4px!important}#book-content .book-effects>*{margin-block:0 4px!important}#book-content .book-casting{padding:5px 8px!important}#book-content .spell-options button,#book-content .book-reorder button{min-height:32px!important}
 #book-content details>summary{min-height:28px!important;padding-block:3px!important}#book-content .book-reorder button{width:32px!important;height:32px!important}#book-content .book-spell-heading h3{font-size:19px!important;margin:0!important}#book-content .book-spell-heading img{width:38px!important;height:38px!important}#book-content .book-loadout-slots{gap:6px!important}#book-content .book-loadout-slot img{width:26px!important;height:26px!important}
 /* Guide : étapes en trois colonnes. */
 html[data-theme] #player-dialog[data-view=guide]{width:min(1000px,calc(100vw - 24px))!important}
 #player-dialog[data-view=guide] .guide-tabs{padding-bottom:8px!important;margin:0!important}
 #player-dialog[data-view=guide] .guide-content>*{margin-block:0 9px!important}
 #player-dialog[data-view=guide] .guide-hero{gap:10px!important}
 #player-dialog[data-view=guide] .guide-steps-cards{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px!important}#player-dialog[data-view=guide] .guide-steps-cards>li{padding:9px 10px!important;margin:0!important}
 #player-dialog[data-view=guide] .guide-two-columns{gap:8px!important}#player-dialog[data-view=guide] .guide-two-columns>article{padding:9px 11px!important}
 #player-dialog[data-view=guide] .guide-actions{flex-direction:row!important;gap:8px}#player-dialog[data-view=guide] .guide-actions>.primary-action{flex:1}
 /* Sac : cases plus petites, toute la réserve visible. */
 #player-dialog[data-view=inventory] .bag-grid{grid-template-columns:repeat(auto-fill,minmax(58px,1fr))!important;gap:4px!important;padding:5px!important;align-content:start}
 #player-dialog[data-view=inventory] .bag-cell{min-height:0!important}
 html[data-theme] #player-dialog[data-view=inventory]>header{min-height:44px!important}
 #player-dialog[data-view=inventory] .bag-tabs button{min-height:32px!important}
 /* Grimoire : en-têtes et cartes resserrés. */
 html[data-theme] #class-dialog{width:min(960px,calc(100vw - 24px))!important}
 html[data-theme] #class-dialog>nav{padding:5px 12px!important}#book-content{padding:8px 12px 10px!important}
 #book-content .book-loadout{padding:7px 10px!important;margin-bottom:7px!important}#book-content .book-loadout-slot{min-height:40px!important;padding-block:4px!important}
 #book-content .spell-filters{margin-bottom:7px!important}#book-content .spell-detail{padding:10px 12px!important}#book-content .spell-detail>*{margin-block:0 7px!important}
 #book-content .book-spell-heading img{width:44px!important;height:44px!important}#book-content .book-stat-grid>*{padding:5px 8px!important;min-height:0!important}
 #book-content .book-spell-index button{min-height:44px!important;padding-block:4px!important}
 /* HDV et boutique : plus larges, cartes sur plusieurs colonnes. */
 html[data-theme] #player-market{width:min(900px,calc(100vw - 28px))!important}
 #player-market .market-login{padding:7px 10px!important;margin-bottom:6px!important}#player-market .market-toolbar{margin-bottom:6px!important}#player-market .market-login p{margin:2px 0!important}#player-market .market-list{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))!important}
 html[data-theme] #astrub-shop{width:min(1180px,calc(100vw - 28px))!important}
 #astrub-shop #shop-content{padding:10px 12px!important}#astrub-shop .shop-offers{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))!important;gap:8px!important}#astrub-shop .shop-offer{padding:10px!important}
 #astrub-shop .shop-hero{gap:8px!important;margin-bottom:8px!important}#astrub-shop :is(.shop-wallet,.shop-earn){padding:9px 11px!important}#astrub-shop .shop-account-access{margin-bottom:8px!important;padding:6px 10px!important}
}
#book-content{scroll-padding-bottom:8px}@media (min-width:701px) and (pointer:fine){#book-content .book-browser{margin-bottom:-6px}}
/* Mobile : feuilles plein écran, en-tête fixe, une colonne, cibles tactiles 44px. */
@media (max-width:700px){
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#astrub-shop,#player-market,#admin-panel,#moderation-panel)[open]{inset:0!important;transform:none!important;margin:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;border-width:0!important}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog)>header,html[data-theme] #astrub-shop>.shop-heading,html[data-theme] #player-market .market-heading{border-radius:0!important;min-height:52px!important;padding:4px 8px 4px 12px!important;padding-top:max(4px,env(safe-area-inset-top))!important}
 html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel)>header h2,html[data-theme] #astrub-shop .shop-heading h2,html[data-theme] #player-market .market-heading h2{font-size:19px!important}
 html[data-theme] #player-dialog-content{padding:8px 10px max(10px,env(safe-area-inset-bottom))!important}
 #player-dialog[data-view=character] .character-identity{padding:9px!important}#player-dialog[data-view=character] .character-details{display:flex;flex-direction:column;gap:7px}#player-dialog[data-view=character] .character-details>*{margin:0!important}
 #player-dialog[data-view=character] .character-layout{gap:8px!important}
 #player-dialog[data-view=character] .stat-chips{gap:5px!important}#player-dialog[data-view=character] .stat-chips>span{flex-direction:row!important;flex-wrap:wrap;justify-content:center;align-items:center;gap:0 5px!important;padding:5px 3px!important;min-height:0!important}#player-dialog[data-view=character] .stat-chips>span>*{margin:0!important}
 #player-dialog[data-view=character] .stat-chips>span :is(b,strong){font-size:17px!important;line-height:1.15!important}#player-dialog[data-view=character] .stat-chips>span img{width:20px!important;height:20px!important}#player-dialog[data-view=character] .stat-chips>span small{flex-basis:100%;text-align:center;line-height:1.2;font-size:12px}
 #player-dialog[data-view=character] .element-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}#player-dialog[data-view=character] .element-stat{flex-direction:column!important;align-items:center!important;text-align:center;gap:1px!important;padding:5px 2px!important;min-height:0!important}#player-dialog[data-view=character] .element-stat img{width:22px!important;height:22px!important}
 #player-dialog[data-view=character] .element-stat *{font-size:12px}#player-dialog[data-view=character] .element-stat :is(b,strong){font-size:16px!important}
 #player-dialog[data-view=character] .secondary-stats{padding:8px!important}#player-dialog[data-view=character] .secondary-stats>*{margin-block:0 6px!important}
 #player-dialog[data-view=character] .resistance-row{gap:4px!important}#player-dialog[data-view=character] .resistance-row>*{padding:3px 1px!important;min-height:0!important}#player-dialog[data-view=character] .resistance-row img{width:18px!important;height:18px!important}
 #player-dialog[data-view=character] .character-next{padding:7px 9px!important}#player-dialog[data-view=character] .character-next p{margin:0!important}
 #player-dialog[data-view=guide] .guide-steps-cards>li{padding:9px!important}#player-dialog[data-view=guide] .guide-content>*{margin-block:0 9px!important}
 #player-dialog[data-view=inventory] .empty-inspector{flex:none!important;min-height:0!important;height:auto!important;flex-direction:row!important;padding:6px 9px!important;gap:8px}#player-dialog[data-view=inventory] .empty-inspector img{width:32px!important;height:32px!important}
 #player-dialog[data-view=inventory] .bag-grid{grid-template-columns:repeat(auto-fill,minmax(52px,1fr))!important;gap:4px!important;padding:4px!important;align-content:start}
 #book-content .book-loadout{padding:7px!important}#book-content .spell-detail{padding:9px!important}#book-content .spell-detail>*{margin-block:0 7px!important}
 html[data-theme] #astrub-shop #shop-content,html[data-theme] #player-market #market-content{padding:8px 10px!important}
}
@media (max-width:650px){#player-dialog[data-view=inventory] .bag-layout:has(.empty-inspector){grid-template-rows:auto minmax(120px,1fr) auto!important}#player-dialog[data-view=inventory] .empty-inspector{align-self:end}}
@media (min-width:701px) and (pointer:fine){#astrub-shop .shop-coin{width:46px!important;height:46px!important}#astrub-shop .shop-wallet{gap:10px!important}#astrub-shop .shop-earn ol{margin:4px 0!important}#astrub-shop .shop-offer-head{min-height:0!important}#astrub-shop .shop-section-title{margin:6px 0!important}}
/* Rétro : cartes intérieures à coins nets, filet sombre, survol orangé ; onglets homogènes. */
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(section,article,aside,details,.stat-chips>span,.element-stat,.resistance-row>*,.character-next,.book-loadout-slot,.book-stat-grid>*,.bag-cell,.equip-slot,.market-row,.shop-offer,.adventure-place,.guide-steps-cards>li,.guide-hero-icon){border-radius:3px!important}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#adventure-panel,#player-market,#astrub-shop) :is(.bag-cell:not(.empty),.equip-slot,.book-spell-index button,.market-row,.adventure-place,.book-loadout-slot):hover{border-color:var(--rs-orange)!important;box-shadow:0 0 0 1px var(--rs-orange),inset 0 1px #fff8!important}
html[data-theme="retro"] :is(#player-dialog .guide-tabs,#player-dialog .bag-tabs,#class-dialog>nav,#book-content .spell-filters,#adventure-panel>nav) button:is(.active,.is-selected,[aria-pressed=true],[aria-selected=true],[aria-current=page]){background-color:var(--theme-accent)!important;border-color:#7a3a00!important;color:#fff!important;text-shadow:0 1px 0 #0006}
html[data-theme="retro"] :is(#player-dialog .guide-tabs,#player-dialog .bag-tabs,#class-dialog>nav,#book-content .spell-filters,#adventure-panel>nav) button:is(.active,.is-selected,[aria-pressed=true],[aria-selected=true],[aria-current=page]) :is(b,span,small){color:inherit!important}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop) :is(h3,h4,summary,strong){letter-spacing:0}
html[data-theme="retro"] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#multiplayer-panel) :is(button,summary,a,input,select):focus-visible{outline:2px solid var(--rs-orange)!important;outline-offset:1px!important}

/* ===== Finition premium (tous thèmes sauf mention) : typographie unifiée, chiffres tabulaires,
   barres de défilement fines, focus visibles, transitions courtes, lisibilité sur la carte. ===== */
html[data-theme="retro"]{--rv-hud-font:var(--font-ui,"Fira Sans",system-ui,sans-serif)}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#game-topbar,#account-control,.glass,#spell-dock,#fight-hud){font-family:var(--font-ui);line-height:1.4;font-kerning:normal}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel) :is(p,li,dd,td){line-height:1.45}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel)>header h2,html[data-theme] :is(#astrub-shop .shop-heading,#player-market .market-heading) h2{font-family:var(--font-display);font-weight:400;letter-spacing:.01em}
html[data-theme] :is(#spell-dock,#fight-hud,#combat-dock,.glass,#player-dialog,#class-dialog,#player-market,#astrub-shop,#adventure-panel) :is(b,strong,progress+span,.spell-slot>span){font-variant-numeric:tabular-nums}
/* Barres de défilement fines, couleur du cadre. */
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#account-control) *{scrollbar-width:thin;scrollbar-color:var(--rs-frame,var(--window-line,#7d7559)) transparent}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#account-control) ::-webkit-scrollbar{width:10px;height:10px}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#account-control) ::-webkit-scrollbar-thumb{background:var(--rs-frame,var(--window-line,#7d7559));border:2px solid transparent;border-radius:6px;background-clip:padding-box}html[data-theme]:where([data-theme="nuit"]) :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#account-control) ::-webkit-scrollbar-thumb{background:var(--rs-frame,var(--window-line,#516485))}
html[data-theme] :is(#player-dialog,#class-dialog,#prepare-dialog,#adventure-panel,#player-market,#astrub-shop,#admin-panel,#moderation-panel,#multiplayer-panel,#account-control) ::-webkit-scrollbar-track{background:transparent}
/* Focus clavier visible partout dans le jeu. */
html[data-theme] :is(#game-topbar,#account-control,.glass,#spell-dock,#mobile-topbar,#mobile-explorebar,#mobile-menu-sheet) :is(button,a,summary,input,select):focus-visible{outline:2px solid var(--rs-orange,var(--theme-accent,#c4650a))!important;outline-offset:1px}
/* États désactivés homogènes. */
html[data-theme] :is(.glass,#spell-dock,#game-topbar,#account-control) button:disabled{opacity:.55;cursor:not-allowed;filter:grayscale(.5)}
/* Micro-transitions (désactivées si mouvement réduit, cf. règle plus haut). */
html[data-theme] :is(.glass,#spell-dock,#game-topbar,#account-control,#mobile-explorebar) :is(button,a,summary){transition:background-color .12s,border-color .12s,box-shadow .12s,filter .12s,transform .06s}
html[data-theme] :is(.glass,#game-topbar) button:not(:disabled):active{transform:translateY(1px)}
/* HUD Rétro : textes nets sur parchemin, titres de zone en Bree Serif, pas de texte sous 12px. */
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud,#battle-feedback,#game-topbar){font-size:13px}
html[data-theme="retro"] :is(.glass,#spell-dock,#fight-hud) button:not(.spell-slot){font-family:var(--font-ui)!important;font-weight:600!important;letter-spacing:.01em}
html[data-theme="retro"] :is(#label,.label,.adventure-point-name,.mp-label,.remote-label,[role=tooltip]){font-family:var(--font-ui)!important;font-weight:600;letter-spacing:.01em;box-shadow:0 1px 0 #fff8 inset,0 2px 6px #0006!important}
html[data-theme="retro"] [role=tooltip]{font-size:13px;line-height:1.4;padding:6px 8px}
/* Barre haute : séparateurs nets, drapeaux alignés sur Accueil / Compte. */
html[data-theme] #game-topbar{align-items:center}
html[data-theme] #game-topbar .i18n-picker{background:#0000001a;border-color:#0000004d;box-shadow:inset 0 1px 2px #0003}
html[data-theme="retro"] #game-topbar .i18n-picker{background:#beb99866;border-color:var(--rv-hud-line,#4a4232)}
html[data-theme] #game-topbar .i18n-picker .i18n-option[aria-pressed=true]{background:var(--theme-accent-soft,#f1d8ac)}
/* Coque mobile : drapeaux compacts dans la barre du haut. */
body.mobile-ui-ready #mobile-topbar .i18n-picker{pointer-events:auto;align-self:center;margin-left:auto;margin-right:-4px;padding:2px}
body.mobile-ui-ready #mobile-topbar .i18n-picker .i18n-option{min-width:36px;min-height:36px}
html[data-theme="retro"] body.mobile-ui-ready #mobile-topbar .i18n-picker{background:linear-gradient(180deg,var(--rv-hud-2),var(--rv-hud) 45%,var(--rv-hud-3));border-color:var(--rv-hud-line)}

/* Barre du haut : s’élargit pour les drapeaux sans couper « Compte ». */
#game-topbar.has-i18n-picker{width:max-content!important;max-width:calc(100vw - 24px)}#game-topbar.has-i18n-picker>*{flex:none}

/* Mobile: keep the HDV sort label readable (no clipped option text). */
@media(max-width:420px){#player-market #market-sort{padding-inline:6px 0;font-size:15px;text-overflow:clip}}
/* Bouton Assis/Debout : même bouton crème que la barre, simple liseré vert quand on est assis (plus d'orange). */
html[data-theme] #player-strip #player-sit#player-sit{white-space:nowrap!important;min-width:66px;justify-content:center}
html[data-theme] #player-strip #player-sit#player-sit[aria-pressed=true]{background:linear-gradient(180deg,#e4ecc6,#c3d095)!important;border:1px solid #5d7a2c!important;color:#33501a!important;text-shadow:none!important;box-shadow:inset 0 1px 3px #33501a40!important}
/* Boutons clairs lisibles (texte sombre) : Annuler du signalement, touches et remise à zéro des raccourcis. */
html[data-theme] #report-dialog button:not([type=submit]):not(.primary):not([aria-label]),html[data-theme] #keybinds-dialog :is(.kb-cap,.kb-reset,.kb-undo){color:#3d3420!important;text-shadow:none!important;background:linear-gradient(180deg,#fffaf0,#ece2c4)!important;border:1px solid #b9a978!important;opacity:1!important}
html[data-theme] #keybinds-dialog .kb-cap{min-width:56px;font:800 13px/1 var(--font-ui,sans-serif)!important;letter-spacing:.02em}
html[data-theme] #keybinds-dialog .kb-cap:hover,html[data-theme] #keybinds-dialog .kb-cap:focus-visible{border-color:#c98a2a!important;box-shadow:0 0 0 2px #e9b45a55!important}
html[data-theme] #keybinds-dialog .kb-cap[aria-pressed=true],html[data-theme] #keybinds-dialog .kb-cap.is-listening{background:linear-gradient(180deg,#ffe6a8,#f2c35f)!important;color:#3a2306!important}
/* Mon compte : l'essentiel seulement (les raccourcis Personnage, Sac, Boutique, HDV, Raccourcis sont déjà dans Accès rapides). */
html[data-theme] #account-control{padding:12px!important}
html[data-theme] #account-control .account-heading{padding:10px 12px!important;border-radius:10px;margin-bottom:8px}
html[data-theme] #account-control .account-heading h2{font-size:17px!important;margin:2px 0 3px!important}
html[data-theme] #account-control .account-heading p{font-size:11.5px!important;margin:0!important}
html[data-theme] #account-control .account-links{display:grid!important;grid-template-columns:1fr 1fr;gap:6px!important;margin:0 0 8px!important}
html[data-theme] #account-control .account-links>*{min-height:34px!important;padding:6px 10px!important;font-size:12.5px!important;justify-content:center}
html[data-theme] #account-control .account-space{padding:6px 2px!important;font-size:12.5px!important;border:0!important}
html[data-theme] #account-control .account-shortcuts{display:grid!important;grid-template-columns:1fr 1fr;gap:6px!important;margin:6px 0 8px!important}
html[data-theme] #account-control .account-shortcuts>button{min-height:0!important;padding:7px 8px!important;gap:7px!important;border-radius:9px!important}
html[data-theme] #account-control .account-shortcuts>button img{width:22px!important;height:22px!important}
html[data-theme] #account-control .account-shortcuts>button b,html[data-theme] #account-control .account-shortcuts>button span{font-size:12px!important}
html[data-theme] #account-control .account-shortcuts>button small{display:none!important}
html[data-theme] #account-control .account-shortcuts>button>span[aria-hidden]{display:none!important}
html[data-theme] #account-control :is(#account-inventory,#account-shop,#account-market,#account-keys){display:none!important}
html[data-theme] #account-control .account-preferences{margin:4px 0 6px!important;padding:8px 0 0!important}
html[data-theme] #account-control .account-preferences h3{font-size:11px!important;letter-spacing:.08em;text-transform:uppercase;margin:0 0 5px!important;color:#7a6838}
html[data-theme] #account-control .account-save{padding:6px 2px 0!important;font-size:11px!important}
/* Combat : pas de nom au-dessus des monstres (seulement les PV, l'étiquette reste cliquable pour cibler). */
html[data-theme] .monster-tag.in-fight:not(.fight-plate)>b{display:none!important}
html[data-theme] .monster-tag.in-fight:not(.fight-plate){padding:1px 6px!important;min-height:0!important}
html[data-theme] .monster-tag.in-fight:not(.fight-plate)>small{font-size:10.5px!important;margin:0!important}
/* Bouton Discord (bandeau du bas, discret). */
html[data-theme] #player-strip #discord-open{display:inline-grid;place-items:center;width:30px;height:28px;margin-left:4px;border-radius:7px;background:#5865f2;border:1px solid #3c45a5;box-shadow:inset 0 1px #fff4;text-decoration:none}
html[data-theme] #player-strip #discord-open svg{width:18px;height:18px;fill:#fff}
html[data-theme] #player-strip #discord-open:hover{background:#6a76ff}
html[data-theme] #account-control .account-shortcuts>a.account-discord{display:flex;align-items:center;gap:7px;padding:7px 8px;border-radius:9px;background:#5865f2;border:1px solid #3c45a5;color:#fff;text-decoration:none;font-weight:800;font-size:12px}
html[data-theme] #account-control .account-shortcuts>a.account-discord svg{width:20px;height:20px;fill:#fff}html[data-theme] #account-control .account-shortcuts>a.account-discord small{display:none}

/* PNJ : seul le nom reste affiché ; l'action (« Acheter / vendre », « Fabriquer »…) apparaît au survol ou au focus. */
.adventure-point.npc .adventure-point-name small,.adventure-point.dungeon .adventure-point-name small{display:none!important}
.adventure-point.npc:hover .adventure-point-name small,.adventure-point.npc:focus-visible .adventure-point-name small,.adventure-point.dungeon:hover .adventure-point-name small,.adventure-point.dungeon:focus-visible .adventure-point-name small{display:inline-flex!important}
.adventure-point.npc.npc-hitbox>.adventure-point-name small{display:none!important}
.adventure-point.npc.npc-hitbox:hover>.adventure-point-name small,.adventure-point.npc.npc-hitbox:focus-visible>.adventure-point-name small{display:block!important}

/* Mobile : fiche Personnage sur une seule colonne (identité puis détails), cartes de caractéristiques lisibles. */
@media (max-width:700px){
 html[data-theme] body #player-dialog[data-view=character] .character-layout,body #player-dialog[data-view=character] .character-layout{display:flex!important;flex-direction:column!important;gap:10px!important}
 body #player-dialog[data-view=character] .character-identity,body #player-dialog[data-view=character] .character-details{width:100%!important;max-width:none!important;min-width:0!important}
 body #player-dialog[data-view=character]{width:calc(100vw - 12px)!important;max-width:none!important;padding:10px!important;margin:6px auto!important}
 body .bag-quick{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:3px!important}
 body .bag-quick small{position:static!important;display:block!important;white-space:normal!important;font-size:11px!important;line-height:1.2!important}
}
/* Barre rapide du sac : sur sa propre ligne, sous les caractéristiques (sinon elle se superpose à elles sur petit écran). */
.bag-equipment>.bag-quick{grid-column:1/-1!important;grid-row:auto!important;position:static!important;margin-top:6px!important}
@media (max-width:700px){.bag-equipment{grid-template-rows:auto!important}.bag-equipment>.stat-chips,.bag-equipment>.element-stats{grid-column:1/-1!important;grid-row:auto!important}}

/* ===== Mobile : barres plus légères, discussion visible ===== */
@media (max-width:700px){
 /* Langue : un seul drapeau (celui de l'autre langue) au lieu des deux. */
 body #mobile-topbar .i18n-mobile .i18n-option[aria-pressed=true]{display:none!important}
 body #mobile-topbar .i18n-mobile{min-width:0!important;width:auto!important;padding:2px!important}
 /* Menu : icône seule, ronde. */
 body #mobile-menu-toggle{width:44px!important;min-width:44px!important;padding:0!important;justify-content:center!important}
 body #mobile-menu-toggle>span:not(#mobile-account-state){display:none!important}
 /* Groupe : icône seule, sous le menu. */
 body #multiplayer-toggle{width:44px!important;min-width:44px!important;height:44px!important;padding:0!important;font-size:0!important;justify-content:center!important;right:8px!important;left:auto!important}
 html body #multiplayer-toggle span{display:none!important}
 body #multiplayer-toggle svg,body #multiplayer-toggle img{width:20px!important;height:20px!important;margin:0!important}
 /* Barre du bas : plus fine (couleurs du thème Rétro). */
 html[data-theme] body.mobile-ui-ready #mobile-explorebar{height:auto!important;padding:3px!important;border-radius:16px!important;box-shadow:0 4px 14px rgba(0,0,0,.35)!important}
 html[data-theme] body.mobile-ui-ready #mobile-explorebar>button{min-height:48px!important;height:48px!important;padding:3px 2px!important;background:transparent!important;border:0!important;box-shadow:none!important;font-size:10.5px!important;gap:2px!important;border-radius:12px!important}
 html[data-theme] body.mobile-ui-ready #mobile-explorebar>button:active,html[data-theme] body.mobile-ui-ready #mobile-explorebar>button[aria-expanded=true]{background:rgba(232,200,120,.18)!important}
 html[data-theme] body.mobile-ui-ready #mobile-explorebar>button img,html[data-theme] body.mobile-ui-ready #mobile-explorebar>button svg{width:22px!important;height:22px!important}
 /* Discussion : les 3 derniers messages restent visibles au-dessus de la barre ; un appui ouvre le chat. */
 body #chat-overlay{display:block!important;left:8px!important;bottom:calc(env(safe-area-inset-bottom,0px) + 70px)!important;width:min(72vw,300px)!important;font-size:11.5px!important}
 body.chat-open #chat-overlay,body.in-battle #chat-overlay{display:none!important}
 body #chat-overlay .chat-overlay-form{display:none!important}
 body #chat-overlay .chat-overlay-feed{pointer-events:auto;cursor:pointer;padding:4px 7px;border-radius:10px;background:rgba(0,0,0,.28)}
 body #chat-overlay .chat-overlay-feed p:nth-last-child(n+4){display:none}
 /* Fil compact (12/10/2026) : 2 lignes par message, annonces (paliers, boss) sur 1 ligne et seule la plus récente ; plus étroit. */
 body #chat-overlay{width:min(66vw,280px)!important}
 body #chat-overlay .chat-overlay-feed p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.3}
 body #chat-overlay .chat-overlay-feed p.is-server{-webkit-line-clamp:1;font-size:10.5px;opacity:.92}
 body #chat-overlay .chat-overlay-feed p.is-server:has(~ p.is-server){display:none}
}

/* ===== Mobile : fiche Personnage et sac robustes au texte agrandi (réglage de police du téléphone) ===== */
@media (max-width:700px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body #player-dialog{max-width:calc(100vw - 8px)!important;overflow-x:hidden!important}
 html[data-theme] body #player-dialog[data-view=character],body #player-dialog[data-view=character]{width:calc(100vw - 8px)!important;left:0!important;right:0!important;margin:4px auto!important}
 body #player-dialog .character-details,body #player-dialog .character-identity{min-width:0!important;max-width:100%!important}
 body #player-dialog .stat-chips{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body #player-dialog .element-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 body #player-dialog .secondary-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body #player-dialog .resistance-row{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
 body #player-dialog .stat-chips>*,body #player-dialog .element-stats>*,body #player-dialog .secondary-summary>*,body #player-dialog .resistance-row>*{min-width:0!important;overflow:hidden!important}
 body #player-dialog .stat-chips small,body #player-dialog .element-stat>span,body #player-dialog .secondary-summary span,body #player-dialog .resistance-row span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body #player-dialog[data-view=character] .element-stat{flex-direction:column!important;text-align:center!important;gap:2px!important;padding:7px 3px!important}
 body #player-dialog[data-view=character] .secondary-summary b,body #player-dialog[data-view=character] .secondary-summary strong{font-size:clamp(13px,4.2vw,18px)!important}
 /* Sac : caractéristiques sur leur propre ligne (3 + 4 cases) puis barre rapide, plus rien de superposé. */
 body #player-dialog[data-view=inventory] .bag-equipment{display:grid!important;grid-template-columns:3fr 4fr!important;grid-template-rows:auto!important;height:auto!important;gap:6px!important}
 body #player-dialog[data-view=inventory] .bag-equipment>.equipment-paper,body #player-dialog[data-view=inventory] .bag-equipment>.bag-quick{grid-column:1/-1!important}
 body #player-dialog[data-view=inventory] .bag-equipment>.stat-chips,body #player-dialog[data-view=inventory] .bag-equipment>.element-stats{position:static!important;width:auto!important;height:46px!important;margin:0!important;gap:4px!important}
 body #player-dialog[data-view=inventory] .bag-equipment>.stat-chips{grid-column:1!important}
 body #player-dialog[data-view=inventory] .bag-equipment>.element-stats{grid-column:2!important}
 body #player-dialog[data-view=inventory] .bag-quick{flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin-top:0!important;padding:6px 8px!important;border-radius:10px!important;background:linear-gradient(180deg,#fff8e6,#f3e4bd)!important;border:1px solid #c9a96a!important;box-shadow:inset 0 1px 0 #fff9}
 body #player-dialog[data-view=inventory] .bag-quick small{margin:0!important;flex:1;font-weight:700;color:#6b5330}
 body #player-dialog[data-view=inventory] .bag-quick .quick-item{width:46px;height:46px;border-radius:10px;background:radial-gradient(circle at 50% 35%,#fffbe9,#ecd9a8);box-shadow:0 2px 0 #a8823e,inset 0 1px 0 #fff}:where(html[data-theme="nuit"]) body #player-dialog[data-view=inventory] .bag-quick .quick-item{box-shadow:0 2px 0 #4f6997,inset 0 1px 0 #fff}
}

/* ===== Mobile : barre du bas et boutons du haut façon « bois et or » ===== */
@media (max-width:700px){
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar{background:linear-gradient(180deg,#5a4630 0%,#3d2f20 55%,#2c2117 100%)!important;border:1px solid #c9a35a!important;border-radius:18px!important;box-shadow:0 6px 18px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,226,160,.35),inset 0 -2px 0 rgba(0,0,0,.35)!important;padding:4px!important;gap:2px!important}html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-explorebar{background:linear-gradient(180deg,#324058 0%,#222b3b 55%,#181f2b 100%)!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button{color:#f3e2bb!important;font-weight:700!important;letter-spacing:.01em}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button :is(span,b,small){color:#f3e2bb!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button img,html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button svg{width:26px!important;height:26px!important;padding:3px;border-radius:50%;background:radial-gradient(circle at 50% 35%,#fff2cf,#d9b46a 70%,#a87b33);box-shadow:0 1px 0 #0006,inset 0 1px 0 #fff8;color:#4a3420;stroke:#4a3420}html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-explorebar>button img,html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-explorebar>button svg{stroke:#253145}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button:active,html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button[aria-expanded=true],html[data-theme][data-theme] body.mobile-ui-ready #mobile-explorebar>button[aria-pressed=true]{background:linear-gradient(180deg,rgba(255,214,130,.28),rgba(255,214,130,.08))!important;box-shadow:inset 0 0 0 1px rgba(255,214,130,.45)!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar>button,html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar>a{background:linear-gradient(180deg,#5a4630,#3d2f20 60%,#2c2117)!important;border:1px solid #c9a35a!important;border-radius:12px!important;color:#f3e2bb!important;box-shadow:0 3px 10px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,226,160,.3)!important}html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-topbar>button,html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-topbar>a{background:linear-gradient(180deg,#324058,#222b3b 60%,#181f2b)!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar>button :is(span,b,strong,small){color:#f3e2bb!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar>button svg{stroke:#f3e2bb!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar .i18n-mobile .i18n-option,html[data-theme][data-theme] body.mobile-ui-ready #multiplayer-toggle{background:linear-gradient(180deg,#5a4630,#3d2f20 60%,#2c2117)!important;border:1px solid #c9a35a!important;border-radius:12px!important;color:#f3e2bb!important;box-shadow:0 3px 10px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,226,160,.3)!important}html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #mobile-topbar .i18n-mobile .i18n-option,html[data-theme][data-theme]:where([data-theme="nuit"]) body.mobile-ui-ready #multiplayer-toggle{background:linear-gradient(180deg,#324058,#222b3b 60%,#181f2b)!important}
 html[data-theme][data-theme] body.mobile-ui-ready #mobile-topbar .i18n-mobile{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
 html[data-theme][data-theme] body.mobile-ui-ready #multiplayer-toggle svg{stroke:#f3e2bb!important;color:#f3e2bb!important}
}

/* ===== Mobile : boutons flottants déplaçables, intégrés au style bois et or ===== */
@media (max-width:700px),(max-width:1000px) and (max-height:500px){
 .rv-movable{touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;transition:scale .15s,filter .15s}
 .rv-movable.rv-dragging{scale:1.08;filter:drop-shadow(0 0 10px rgba(255,205,110,.85)) drop-shadow(0 6px 10px rgba(0,0,0,.45));z-index:60!important;transition:none;cursor:grabbing}
 html[data-theme][data-theme] #rv-ping{background:linear-gradient(180deg,#4a3a28,#2c2117)!important;border:1px solid #c9a35a!important;color:#f3e2bb!important;box-shadow:0 3px 10px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,226,160,.25)!important;border-radius:999px!important}html[data-theme][data-theme]:where([data-theme="nuit"]) #rv-ping{background:linear-gradient(180deg,#293549,#181f2b)!important}
 html[data-theme][data-theme] #chat-overlay{background:linear-gradient(180deg,rgba(44,33,23,.62),rgba(44,33,23,.78))!important;border:1px solid rgba(201,163,90,.55)!important;border-radius:14px!important;box-shadow:0 4px 14px rgba(0,0,0,.35)!important;backdrop-filter:blur(2px)}html[data-theme][data-theme]:where([data-theme="nuit"]) #chat-overlay{background:linear-gradient(180deg,rgba(24,31,43,.62),rgba(24,31,43,.78))!important}
 #mobile-menu-sheet .hud-reset{display:block;width:calc(100% - 20px);margin:10px auto 6px;padding:10px 12px;border-radius:12px;border:1px dashed #c9a35a;background:rgba(201,163,90,.12);color:inherit;font:700 13px/1.2 var(--font-ui,sans-serif)}
}

/* Ping : texte toujours clair (les règles du panneau de la mini-carte coloraient les <span> en brun foncé sur le fond sombre). */
html[data-theme][data-theme] #rv-ping{background:linear-gradient(180deg,#3d3022,#1f1812)!important;border:1px solid #c9a35a!important;box-shadow:0 2px 8px rgba(0,0,0,.55)!important}html[data-theme][data-theme]:where([data-theme="nuit"]) #rv-ping{background:linear-gradient(180deg,#232c3c,#12171f)!important}
/* ids répétés : plus prioritaire que « :is(.glass,…) :is(span,#where,…) » du thème Rétro */html[data-theme] #rv-ping#rv-ping#rv-ping span,html[data-theme] #rv-ping#rv-ping#rv-ping{color:#fff4dc!important;font:800 12px/1.2 var(--font-ui,system-ui,sans-serif)!important;text-shadow:0 1px 2px #000!important;opacity:1!important;visibility:visible!important}

/* Bugs & idées : bouton toujours visible (bas gauche sur ordinateur, sous le bouton Social sur mobile), masqué en combat. */
#feedback-fab{position:fixed;left:12px;top:192px;z-index:45;display:inline-flex;align-items:center;gap:6px;padding:7px 12px 7px 9px;border-radius:999px;border:1px solid #c9a35a;background:linear-gradient(180deg,#5a4630,#3d2f20 60%,#2c2117);color:#f6e8c8;font:700 12.5px/1.2 var(--font-ui,system-ui,sans-serif);box-shadow:0 4px 12px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,226,160,.3);cursor:pointer}:where(html[data-theme="nuit"]) #feedback-fab{background:linear-gradient(180deg,#324058,#222b3b 60%,#181f2b)}
#feedback-fab span{font-size:15px;line-height:1}
#feedback-fab b{color:#f6e8c8}
#feedback-fab:hover{filter:brightness(1.12)}
body.in-battle #feedback-fab{display:none}
@media (max-width:700px),(max-width:1000px) and (max-height:500px){#feedback-fab{left:auto;right:10px;bottom:auto;top:calc(env(safe-area-inset-top,0px) + 166px);padding:7px 10px;font-size:11.5px}#feedback-fab b{display:none}#feedback-fab span{font-size:18px}}

/* Fiche Personnage (ordinateur et mobile) : libellés jamais coupés en plein mot (« Intelligen-ce ») ; résistances en colonne propre : icône, valeur, élément. */
html[data-theme] body #player-dialog[data-view=character] .element-stat>span{overflow-wrap:normal!important;word-break:keep-all!important;hyphens:none!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;min-width:0;font-size:clamp(11px,1.05vw,13px)}
html[data-theme] body #player-dialog[data-view=character] .resistance-row>*{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;padding:6px 2px!important;text-align:center}
html[data-theme] body #player-dialog[data-view=character] .resistance-row>* :last-child{grid-column:auto!important;line-height:1.1}
html[data-theme] body #player-dialog[data-view=character] .resistance-row b,html[data-theme] body #player-dialog[data-view=character] .resistance-row strong{font-size:13px;line-height:1.1}
html[data-theme] body #player-dialog[data-view=character] .resistance-row small{white-space:nowrap}
html[data-theme] body #player-dialog[data-view=character] .element-stat{flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:3px!important;padding:7px 3px!important}
html[data-theme] body #player-dialog[data-view=character] .element-stat>span{font-size:12px;max-width:100%}
html[data-theme] body #player-dialog[data-view=character] .element-stat b{margin-top:1px!important}
/* Combat : aucun consommable (pain, potion) : la barre rapide disparaît. */
body.in-battle #quick-items{display:none!important}
/* Hors combat : sorts de la barre grisés (ils ne se lancent qu'en combat). */
body:not(.in-battle) #spell-bar .spell-slot{filter:grayscale(.85);opacity:.62;cursor:default}
body:not(.in-battle) #spell-bar .spell-slot em{visibility:hidden}
#feedback-fab{background:linear-gradient(180deg,#e0832a,#b8570a)!important;border-color:#ffd38a!important;color:#fff!important;box-shadow:0 4px 14px rgba(196,101,10,.45),inset 0 1px 0 rgba(255,236,190,.5)!important}
#feedback-fab b{color:#fff!important}
/* Sort sélectionné : plus de bouton « Annuler » (un nouvel appui sur le sort, Échap ou clic droit annulent) ; pas de consommable en combat. */
html body #cast-cancel{display:none!important}
html body.in-battle #consume-item{display:none!important}

/* Carte de groupe façon Rétro (monster-groups.js RetroverseGroupCard) : groupes du monde et salles de donjon. */
/* pas de display ici : le jeu masque les bulles par style.display (none / block) */
.room-mob-tip.gc-card{display:grid}
html .monster-tag.gc-card,.room-mob-tip.gc-card{gap:6px;min-width:190px;max-width:240px;padding:9px 10px 8px!important;border:1px solid #c9a35a!important;border-radius:12px!important;background:linear-gradient(180deg,#3d3022f5,#241c13f5)!important;color:#f6e8c8!important;box-shadow:0 10px 26px #000a,inset 0 1px 0 #ffe2a033!important;text-align:left;font:600 12px/1.25 var(--font-ui,sans-serif)!important}html:where([data-theme="nuit"]) .monster-tag.gc-card,:where(html[data-theme="nuit"]) .room-mob-tip.gc-card{background:linear-gradient(180deg,#232c3cf5,#141923f5)!important}
.gc-card .gc-head,.gc-card .gc-list,.gc-card .gc-hint{margin:0}.gc-card .gc-list{display:grid}.gc-card .gc-hint{display:block}
.gc-card .gc-head{display:flex;margin-bottom:6px!important;align-items:baseline;justify-content:space-between;gap:10px;padding-bottom:5px;border-bottom:1px solid #c9a35a44}
.gc-card .gc-head b{font:700 15px/1.1 var(--font-display,Georgia,serif)!important;color:#ffd58a!important;text-shadow:0 1px 3px #000}
.gc-card .gc-head small{font-size:11px!important;color:#cdb98e!important;margin:0!important}
.gc-card .gc-list{display:grid;gap:2px}
.gc-card .gc-row{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:7px;padding:2px 3px;border-radius:7px}
.gc-card .gc-row:nth-child(odd){background:#ffffff08}
.gc-card .gc-row img,.gc-card .gc-row i{width:24px;height:24px;object-fit:contain;filter:drop-shadow(0 1px 1px #0008)}
.gc-card .gc-row span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#f6e8c8;font-weight:600}
.gc-card .gc-row em{min-width:22px;padding:1px 6px;border-radius:999px;background:#c9a35a33;border:1px solid #c9a35a77;color:#ffe2a0;font:700 11px/1.3 var(--font-ui,sans-serif);font-style:normal;text-align:center}
.gc-card .gc-row.is-boss span{color:#ffcf5a}.gc-card .gc-row.is-boss em{background:#c4650a;border-color:#f0a33a;color:#fff}
.gc-card .gc-hint{margin-top:6px!important;font-size:11px;color:#f0a33a;font-weight:700}
/* Étoiles du groupe (bonus d'XP et de butin, comme DOFUS Rétro) */
.gc-stars{display:flex;align-items:center;gap:2px;margin:0 0 5px;font-size:15px;line-height:1}
.gc-stars i{font-style:normal;color:transparent;-webkit-text-stroke:1px #c9a35acc;text-shadow:none}
.gc-stars i[style]{color:var(--c);-webkit-text-stroke:1px #3a2a10;filter:drop-shadow(0 0 2px color-mix(in srgb,var(--c) 60%,transparent))}
.gc-stars small{margin-left:5px;font-size:10.5px;font-weight:800;color:#ffd58a}
