:root {
  --or: #e8c060;
  --or-sombre: #8a6a2a;
  --fond: rgba(10, 8, 14, 0.78);
  --vie: linear-gradient(#4be04b, #1f9a1f);
  --mana: linear-gradient(#4a8cff, #1a4fc0);
  --rage: linear-gradient(#ff4a3a, #a8180e);
  --energie: linear-gradient(#ffe95a, #c9a800);
  --police-titre: "Cinzel", Georgia, serif;
  --police: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050408; color: #fff; font-family: var(--police); touch-action: none; }
#rendu { position: fixed; inset: 0; width: 100%; height: 100%; outline: none; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%); }
#vignette.rouge { animation: flashRouge 0.6s ease-out; }
@keyframes flashRouge {
  0% { box-shadow: inset 0 0 120px 40px rgba(255,40,0,0.75); }
  100% { box-shadow: inset 0 0 120px 40px rgba(255,40,0,0); }
}
.cache { display: none !important; }
button { font-family: inherit; }

/* ---------- Cadres (joueur, cible, groupe) ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#calqueTextes { position: absolute; inset: 0; pointer-events: none !important; overflow: hidden; }

.cadre {
  position: absolute; display: flex; align-items: center; gap: 6px;
  background: var(--fond); border: 2px solid var(--or-sombre); border-radius: 10px;
  padding: 4px 8px 4px 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
#cadreJoueur { top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); width: 230px; }
#cadreCible { top: max(8px, env(safe-area-inset-top)); left: calc(max(8px, env(safe-area-inset-left)) + 240px); width: 230px; }
#cadreCible.ennemi { border-color: #a02a2a; }
#cadreCible.boss { border-color: #ff6a1a; box-shadow: 0 0 14px rgba(255,90,20,0.6); }
.portrait {
  position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4458, #15121c); border: 2px solid var(--or);
  display: grid; place-items: center; font-size: 24px;
}
.portrait .niveau {
  position: absolute; bottom: -4px; right: -6px; background: #15121c; border: 1px solid var(--or);
  border-radius: 9px; font-size: 11px; padding: 0 5px; font-weight: 800; color: var(--or);
}
.infos { flex: 1; min-width: 0; }
.nom { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.barre { position: relative; height: 14px; margin-top: 3px; background: rgba(0,0,0,0.7); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); }
.barre .rempli { height: 100%; width: 100%; background: var(--vie); transition: width 0.15s linear; }
.barre span { position: absolute; inset: 0; font-size: 10px; line-height: 13px; text-align: center; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.barre.ressource { height: 10px; }
.barre.ressource span { line-height: 9px; font-size: 9px; }
.barre.mana .rempli { background: var(--mana); }
.barre.rage .rempli { background: var(--rage); }
.barre.energie .rempli { background: var(--energie); }
.barre.energie span { color: #222; text-shadow: none; }
.barre.incantationCible .rempli { background: linear-gradient(#ffb43a, #c06a0a); transition: none; }
.barre.vie.bas .rempli { background: linear-gradient(#ffcf3a, #c08a0a); }
.barre.vie.critique .rempli { background: linear-gradient(#ff4a3a, #a8180e); }

#groupe { position: absolute; top: 74px; left: max(8px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 5px; }
.membre {
  width: 158px; padding: 4px 6px; background: var(--fond); border: 2px solid #3a3446; border-radius: 8px;
  cursor: pointer; position: relative;
}
.membre.cible { border-color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.5); }
.membre.mort { opacity: 0.5; filter: grayscale(1); }
.membre .nom { font-size: 12px; display: flex; justify-content: space-between; }
.membre .barre { height: 12px; }
.membre .barre.ressource { height: 5px; }
.membre .barre.ressource span { display: none; }
.membre .effets { position: absolute; right: 4px; top: 2px; font-size: 11px; }
.membre.prend { animation: prend 0.25s; }
@keyframes prend { 50% { border-color: #ff3a3a; } }

/* ---------- Objectif ---------- */
#objectif {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: calc(max(10px, env(safe-area-inset-right)) + 48px);
  max-width: 230px; text-align: right; font-size: 12px; text-shadow: 0 1px 3px #000; pointer-events: none !important;
}
#objectif b { color: var(--or); font-family: var(--police-titre); font-size: 13px; }
#objectif .fait { color: #7aff7a; text-decoration: line-through; opacity: 0.8; }
.petitBouton {
  position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--or-sombre); background: var(--fond);
  color: #fff; font-size: 18px;
}

#btnSac { top: calc(max(8px, env(safe-area-inset-top)) + 48px); }
#btnTalents { top: calc(max(8px, env(safe-area-inset-top)) + 96px); }
#btnFoyer { top: calc(max(8px, env(safe-area-inset-top)) + 144px); font-size: 15px; font-weight: 800; }
#btnMonture { top: calc(max(8px, env(safe-area-inset-top)) + 192px); }
#btnHautsFaits { top: calc(max(8px, env(safe-area-inset-top)) + 240px); }

/* ---------- Hauts faits ---------- */
#banniereHautFait {
  position: absolute; left: 50%; top: 18%; transform: translate(-50%, -30px) scale(0.8); opacity: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 10px 22px; min-width: 300px; pointer-events: none;
  background: linear-gradient(#3a2a10, #1a1206); border: 3px solid var(--or); border-radius: 14px;
  box-shadow: 0 0 30px rgba(255, 200, 80, 0.6); transition: opacity 0.4s, transform 0.4s;
}
#banniereHautFait.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
#banniereHautFait .iconeHF { font-size: 40px; }
#banniereHautFait small { display: block; color: var(--or); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
#banniereHautFait b { display: block; font-family: var(--police-titre); font-size: 20px; color: #fff; }
#banniereHautFait em { display: block; color: #ccc; font-size: 12px; font-style: normal; }
#hautsFaits {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20;
  width: min(560px, 96vw); max-height: 94vh; overflow-y: auto; padding: 8px 12px 10px;
  background: rgba(14, 11, 20, 0.96); border: 2px solid var(--or); border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,0.8);
}
#pointsHautsFaits { margin-left: auto; margin-right: 10px; font-weight: 800; color: var(--or); }
#btnFermerHautsFaits { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--or-sombre); background: #1a1622; color: #fff; font-size: 16px; }
#listeHautsFaits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.hautFait { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 2px solid #3a3446; background: #1a1622; opacity: 0.5; filter: grayscale(1); }
.hautFait.obtenu { opacity: 1; filter: none; border-color: var(--or); }
.hautFait .iconeHF { font-size: 24px; } .hautFait b { display: block; font-size: 13px; } .hautFait small { color: #aaa; font-size: 11px; }
.hautFait .ptsHF { margin-left: auto; font-weight: 800; color: var(--or); }

/* ---------- Talents ---------- */
#talents {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20;
  width: min(680px, 96vw); max-height: 94vh; overflow-y: auto; padding: 8px 12px 10px;
  background: rgba(14, 11, 20, 0.96); border: 2px solid var(--or); border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,0.8);
}
#pointsTalents { margin-left: auto; margin-right: 10px; font-weight: 800; color: #7aff7a; }
#btnFermerTalents { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--or-sombre); background: #1a1622; color: #fff; font-size: 16px; }
#arbresTalents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.brancheTalents h4 { margin: 2px 0 6px; text-align: center; font-family: var(--police-titre); color: var(--or); }
.talent {
  display: flex; flex-direction: column; align-items: center; width: 100%; margin-bottom: 6px; padding: 6px 4px;
  border-radius: 10px; border: 2px solid #3a3446; background: #1a1622; color: #ddd; font-family: inherit; font-size: 12px;
}
.talent .iconeT { font-size: 22px; } .talent .nomT { font-weight: 800; } .talent .rangT { color: var(--or); font-weight: 800; }
.talent small { color: #aaa; font-size: 10px; }
.talent.pris { border-color: #4aff4a; } .talent.max { border-color: var(--or); box-shadow: 0 0 8px rgba(232,192,96,0.5); }
.talent.bloque { opacity: 0.4; filter: grayscale(1); }
.etal.monture { flex-direction: row; gap: 10px; margin-bottom: 8px; text-align: left; border-color: var(--or); }
.etal.monture .gros { font-size: 30px; }

/* ---------- Inventaire ---------- */
#inventaire {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20;
  width: min(620px, 96vw); max-height: 94vh; overflow-y: auto; padding: 8px 12px 10px;
  background: rgba(14, 11, 20, 0.95); border: 2px solid var(--or); border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,0.8);
}
.enteteSac { display: flex; justify-content: space-between; align-items: center; }
.enteteSac h3 { margin: 0; font-family: var(--police-titre); color: var(--or); }
#btnFermerSac { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--or-sombre); background: #1a1622; color: #fff; font-size: 16px; }
.corpsSac { display: flex; gap: 14px; align-items: flex-start; }
.corpsSac h4 { margin: 4px 0; font-size: 12px; color: #ccc; }
#equipePorte { display: grid; grid-template-columns: repeat(2, 48px); gap: 6px; }
#sacCases { display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; }
.caseObjet {
  position: relative; width: 48px; height: 48px; border-radius: 8px; border: 2px solid #3a3446;
  background: radial-gradient(circle at 40% 30%, #2e2838, #110e16); font-size: 24px; color: #fff; padding: 0;
}
.caseObjet.vide { opacity: 0.6; }
.caseObjet .fantome { opacity: 0.25; filter: grayscale(1); }
.caseObjet.choisie { box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(255,255,255,0.5); }
.caseObjet .puiss { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#ficheObjet { flex: 1; min-width: 140px; font-size: 13px; line-height: 1.5; padding-top: 22px; }
#ficheObjet .astuce { color: #999; margin: 0; }
#ficheObjet .mieux { color: #5aff5a; } #ficheObjet .moins { color: #ff6a5a; }
.boutonsFiche { display: flex; gap: 8px; margin-top: 8px; }
.boutonsFiche button {
  padding: 7px 12px; border-radius: 8px; border: 2px solid var(--or); background: linear-gradient(#ffe7a0, #d4a040);
  color: #1a1208; font-weight: 800; font-size: 13px;
}
#puissanceTotale { margin: 8px 0 0; font-size: 12px; color: var(--or); font-weight: 800; }

/* ---------- Taverne ---------- */
#taverne {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20;
  width: min(660px, 96vw); max-height: 94vh; overflow-y: auto; padding: 8px 12px 10px;
  background: linear-gradient(rgba(40, 24, 12, 0.96), rgba(20, 12, 8, 0.97)); border: 2px solid var(--or);
  border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,0.8);
}
#orTaverne { margin-left: auto; margin-right: 10px; font-weight: 800; color: var(--or); font-size: 16px; }
#btnFermerTaverne, .boutonTaverne {
  padding: 6px 10px; border-radius: 8px; border: 2px solid var(--or-sombre); background: #2a1c12; color: #fff;
  font-weight: 800; font-size: 13px; font-family: inherit;
}
.boutonTaverne.choisie { border-color: var(--or); background: #5a3a18; box-shadow: 0 0 10px rgba(232,192,96,0.4); }
.boutonTaverne:disabled { opacity: 0.45; }
.boutonTaverne.pret { color: #7aff7a; }
#corpsTaverne .parole { margin: 4px 0 8px; font-size: 13px; color: #f0e0c0; font-style: italic; }
#corpsTaverne h4 { margin: 8px 0 4px; font-size: 12px; color: #ccc; }
#corpsTaverne .astuce { color: #999; margin: 0; font-size: 13px; }
#corpsTaverne .minuteurBoutique { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--or); }
.toutVendre { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ligneTaverne { display: flex; gap: 14px; align-items: flex-start; }
.grilleSac { display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; }
.ficheTaverne { flex: 1; font-size: 13px; line-height: 1.5; }
.ficheTaverne .boutonTaverne, .etal .boutonTaverne, .lancerFusion .boutonTaverne {
  margin-top: 8px; border-color: var(--or); background: linear-gradient(#ffe7a0, #d4a040); color: #1a1208;
}
.etals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.etal { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px;
  padding: 6px; border: 1px solid #4a3420; border-radius: 8px; background: rgba(0,0,0,0.25); }
.choixFusion { display: flex; flex-wrap: wrap; gap: 6px; }
.lancerFusion .boutonTaverne { font-size: 15px; padding: 8px 16px; }

/* ---------- Messages ---------- */
#alerte {
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%); width: 90%; text-align: center;
  font-family: var(--police-titre); font-weight: 800; font-size: clamp(16px, 3.4vw, 28px); pointer-events: none !important;
  color: #ffd84a; text-shadow: 0 0 10px rgba(0,0,0,0.9), 0 2px 3px #000; opacity: 0; transition: opacity 0.3s;
}
#alerte.visible { opacity: 1; }
#alerte.danger { color: #ff5a3a; }
#alerte.boss { color: #ff9a3a; }
#erreur {
  position: absolute; top: 14%; left: 50%; transform: translateX(-50%); color: #ff3a3a; font-weight: 800;
  font-size: 15px; text-shadow: 0 1px 3px #000; opacity: 0; transition: opacity 0.2s; pointer-events: none !important; white-space: nowrap;
}
#erreur.visible { opacity: 1; }
#bandeau {
  position: absolute; top: 34%; left: 0; right: 0; text-align: center; pointer-events: none !important;
  font-family: var(--police-titre); font-size: clamp(30px, 7vw, 64px); font-weight: 800; color: var(--or);
  text-shadow: 0 0 20px rgba(255,200,60,0.8), 0 3px 4px #000; opacity: 0; transform: scale(0.6);
}
#bandeau.visible { animation: bandeau 2.6s ease-out forwards; }
#bandeau small { display: block; font-size: 0.35em; color: #fff; }
@keyframes bandeau { 10% { opacity: 1; transform: scale(1.1); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

#toasts { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none !important; }
.toast {
  background: var(--fond); border: 2px solid; border-radius: 8px; padding: 6px 12px; font-weight: 800; font-size: 14px;
  animation: toast 4s forwards; white-space: nowrap; text-shadow: 0 1px 2px #000;
}
.toast small { display: block; color: #ccc; font-size: 11px; font-weight: 600; }
@keyframes toast { 0% { opacity: 0; transform: translateY(20px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Textes flottants et plaques ---------- */
.flottant {
  position: absolute; font-weight: 800; font-size: 18px; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #000, 0 2px 2px #000; animation: monte 1.1s ease-out forwards; transform: translate(-50%, -50%);
}
.flottant.degats { color: #fff; }
.flottant.feu { color: #ffb04a; }
.flottant.glace { color: #9adfff; }
.flottant.dos { color: #ff9cf0; font-size: 21px; }
.flottant.crit { color: #ffe23a; font-size: 26px; animation-name: monteCrit; }
.flottant.recu { color: #ff4a3a; font-size: 16px; }
.flottant.soin { color: #5aff5a; }
.flottant.soinCrit { color: #5aff5a; font-size: 24px; animation-name: monteCrit; }
.flottant.soinEnnemi { color: #3ac03a; font-size: 14px; }
.flottant.info { color: #ffd84a; font-size: 15px; }
.flottant.xp { color: #c47aff; font-size: 15px; }
@keyframes monte { 0% { opacity: 0; margin-top: 0; } 10% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; margin-top: -60px; } }
@keyframes monteCrit { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -50px; transform: translate(-50%, -50%); } }

.plaque { position: absolute; left: 0; top: 0; width: 90px; will-change: transform; pointer-events: none; text-align: center; }
.plaque .nomP { font-size: 11px; font-weight: 800; color: #ff8a7a; text-shadow: 0 0 2px #000, 0 1px 2px #000; white-space: nowrap; }
.plaque.calme .nomP { color: #ffd86a; }
.plaque .nivP { font-size: 11px; }
.plaque.ami .nomP { color: #7aff8a; }
.plaque.ciblee .nomP { color: #fff; }
.plaque.ciblee .vieP { box-shadow: 0 0 6px #fff; }
.plaque .vieP { height: 7px; background: rgba(0,0,0,0.8); border: 1px solid #000; border-radius: 2px; overflow: hidden; }
.plaque .vieP div { height: 100%; background: linear-gradient(#ff4a3a, #a8180e); }
.plaque.ami .vieP div { background: var(--vie); }
.plaque .incP { height: 4px; margin-top: 1px; background: rgba(0,0,0,0.8); }
.plaque .incP div { height: 100%; background: #ffb43a; }
.plaque.boss { width: 140px; }
.plaque.boss .nomP { font-size: 13px; color: #ff9a3a; }

/* ---------- Barre d'incantation ---------- */
#incantation {
  position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%); width: min(300px, 50vw); height: 20px;
  background: rgba(0,0,0,0.8); border: 2px solid var(--or-sombre); border-radius: 6px; overflow: hidden; pointer-events: none !important;
}
#incantation .rempli { height: 100%; background: linear-gradient(#ffd84a, #c08a0a); }
#incantation span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 16px; font-weight: 800; text-shadow: 0 1px 2px #000; }

/* ---------- Barre d'actions ---------- */
#barreActions {
  position: absolute; right: calc(max(12px, env(safe-area-inset-right)) + 4px); bottom: 24px;
  display: grid; grid-template-columns: repeat(2, 66px); gap: 10px;
}
.sort {
  position: relative; width: 66px; height: 66px; border-radius: 14px; border: 2px solid var(--or-sombre);
  background: radial-gradient(circle at 40% 30%, #3e3650, #120f18); font-size: 32px; color: #fff;
  display: grid; place-items: center; overflow: hidden; box-shadow: 0 3px 8px rgba(0,0,0,0.7), inset 0 0 8px rgba(0,0,0,0.6);
  padding: 0; touch-action: none;
}
.sort .recharge { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,0.72) var(--p, 0%), transparent 0); pointer-events: none; }
.sort .chiffre { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; text-shadow: 0 0 4px #000, 0 0 4px #000; pointer-events: none; }
.sort .touche { position: absolute; top: 2px; left: 6px; font-size: 11px; font-weight: 800; color: #ddd; text-shadow: 0 1px 2px #000; }
.sort .cout { position: absolute; bottom: 1px; right: 5px; font-size: 10px; font-weight: 800; color: #8ab8ff; text-shadow: 0 1px 2px #000; }
.sort.rage .cout { color: #ff8a7a; }
.sort.energie .cout { color: #ffe95a; }
.sort.indispo { filter: saturate(0.3) brightness(0.6); }
.sort.loin { box-shadow: inset 0 0 0 40px rgba(255,0,0,0.25); }
.sort.pret { animation: pret 0.4s; }
.sort:active, .sort.appui { transform: scale(0.92); border-color: var(--or); }
@keyframes pret { 50% { box-shadow: 0 0 16px var(--or); border-color: var(--or); } }
#btnCibleSuivante {
  position: absolute; right: calc(max(12px, env(safe-area-inset-right)) + 160px); bottom: 24px;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--or-sombre); background: var(--fond); font-size: 22px; color: #fff;
}
.infobulle {
  position: absolute; right: 170px; bottom: 100px; width: 230px; background: rgba(10,8,14,0.95); border: 2px solid var(--or-sombre);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none;
}
.infobulle b { color: var(--or); font-size: 14px; }

/* ---------- XP ---------- */
#xp { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: rgba(0,0,0,0.8); border-top: 1px solid #3a2a50; pointer-events: none !important; }
#xp .rempli { height: 100%; background: linear-gradient(#b05aff, #6a1ab8); width: 0; transition: width 0.4s; }
#xp span { position: absolute; inset: 0; font-size: 8px; text-align: center; line-height: 9px; font-weight: 800; }

/* ---------- Joystick ---------- */
#joystick {
  position: fixed; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.06), rgba(255,255,255,0.14)); border: 2px solid rgba(232,192,96,0.5);
}
#joystick .manche {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f0d080, #8a6a2a); box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* ---------- Écrans ---------- */
.ecran {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(ellipse at center, rgba(30,20,40,0.82), rgba(3,2,6,0.96)); padding: 16px; overflow-y: auto; text-align: center;
}
.titre h1, .ecran h1 {
  margin: 0; font-family: var(--police-titre); font-weight: 800; font-size: clamp(30px, 6.5vw, 64px); letter-spacing: 2px;
  background: linear-gradient(#fff3c0, #e8c060 45%, #8a5a1a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.8));
}
.titre h2 { margin: 2px 0 0; font-family: var(--police-titre); color: #c9a0ff; font-size: clamp(14px, 2.6vw, 22px); letter-spacing: 3px; }
.ecran h1.rouge { background: linear-gradient(#ffb0a0, #c01a0a); -webkit-background-clip: text; background-clip: text; }
.consigne { margin: 4px 0 0; color: #ccc; font-weight: 800; }
.aide { font-size: 11px; color: #999; max-width: 640px; margin: 0; }
.choixSexe { display: flex; gap: 8px; }
.choixSexe button {
  padding: 6px 16px; border-radius: 20px; border: 2px solid #3a3446; background: rgba(20,16,28,0.9);
  color: #fff; font-weight: 800; font-size: 14px; cursor: pointer;
}
.choixSexe button.choisie { border-color: var(--or); box-shadow: 0 0 12px rgba(232,192,96,0.4); }
#choixClasses { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.carteClasse {
  width: 180px; padding: 10px; border-radius: 12px; border: 2px solid #3a3446; background: rgba(20,16,28,0.9);
  color: #fff; cursor: pointer; transition: transform 0.15s, border-color 0.15s; text-align: center;
}
.carteClasse .gros { font-size: 36px; }
.carteClasse h3 { margin: 2px 0; font-family: var(--police-titre); font-size: 18px; }
.carteClasse .role { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--or); }
.carteClasse p { font-size: 12px; color: #bbb; margin: 6px 0 0; }
.carteClasse.choisie { border-color: var(--or); transform: translateY(-4px); box-shadow: 0 0 20px rgba(232,192,96,0.4); }
.grosBouton {
  font-family: var(--police-titre); font-weight: 800; font-size: 18px; padding: 12px 28px; border-radius: 12px;
  border: 2px solid var(--or); color: #1a1208; background: linear-gradient(#ffe7a0, #d4a040); cursor: pointer;
  box-shadow: 0 4px 14px rgba(232,192,96,0.35);
}
.grosBouton:disabled { opacity: 0.4; }
#ecranCompte { z-index: 40; }
#erreurCompte { color: #ff7a6a; font-weight: 800; margin: 0; min-height: 1.2em; }
.formCompte { display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(340px, 90vw); }
.formCompte input {
  width: 100%; padding: 12px; border-radius: 10px; border: 2px solid var(--or-sombre); background: #1a1622;
  color: #fff; font-size: 16px; font-family: inherit;
}
.boutonsCompte { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.grosBouton.secondaire { background: #2a2433; color: #fff; }
#questionImport { max-width: 420px; text-align: center; }
#infoCompte button { background: none; border: none; color: var(--or); text-decoration: underline; font: inherit; cursor: pointer; }
#butinVictoire { display: flex; flex-direction: column; gap: 4px; font-weight: 800; }

#tourner {
  display: none; position: fixed; inset: 0; z-index: 50; background: #0b0a10; color: var(--or); font-family: var(--police-titre);
  font-size: 26px; text-align: center; align-items: center; justify-content: center; line-height: 1.6;
}
@media (orientation: portrait) and (max-width: 700px) {
  body.enJeu #tourner { display: flex; }
}

/* petits écrans (téléphone en paysage) */
@media (max-height: 430px) {
  #cadreJoueur, #cadreCible { width: 200px; }
  #cadreCible { left: calc(max(8px, env(safe-area-inset-left)) + 208px); }
  .portrait { width: 38px; height: 38px; font-size: 20px; }
  #groupe { top: 64px; }
  .membre { width: 140px; padding: 3px 5px; }
  #barreActions { grid-template-columns: repeat(2, 60px); gap: 8px; bottom: 18px; }
  .sort { width: 60px; height: 60px; font-size: 28px; }
  #btnCibleSuivante { right: calc(max(12px, env(safe-area-inset-right)) + 144px); bottom: 18px; }
  #incantation { bottom: 96px; }
  #toasts { bottom: 80px; }
  #equipePorte, #sacCases { gap: 4px; }
  .caseObjet { width: 42px; height: 42px; font-size: 20px; }
  #equipePorte { grid-template-columns: repeat(2, 42px); }
  #sacCases { grid-template-columns: repeat(4, 42px); }
  .carteClasse { width: 160px; padding: 6px; }
  .carteClasse p { display: none; }
  .titre h1 { font-size: 32px; }
}
