html, body { overflow: hidden; user-select: none; }
#jeu { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#pluie, #voile { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.ico { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.cadre { background: var(--panneau); border: 1px solid var(--bord); border-radius: 10px; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); }

/* ---- barre du haut */
#hud-haut {
  position: fixed; top: 8px; left: 8px; right: 8px; display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; pointer-events: none;
}
#hud-haut > div { pointer-events: auto; background: var(--panneau); border: 1px solid var(--bord); border-radius: 10px; padding: 6px 10px; box-shadow: 0 3px 12px rgba(0, 0, 0, .45); }
.ressources { display: flex; gap: 12px; align-items: center; }
.res { display: flex; gap: 4px; align-items: center; min-width: 58px; }
.res b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pop-ico { font-size: 17px; }
.vague { flex: 1; min-width: 260px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.vague .titre { font-size: 17px; }
.vague-bas { display: flex; gap: 10px; align-items: center; justify-content: space-between; color: var(--texte2); font-size: 14px; }
.vague-bas b { color: var(--texte); }
.boss-txt { color: #ff6a5a !important; }
#vinfo { color: #ff9a7a; font-size: 14px; }
.stats { display: flex; gap: 14px; align-items: center; font-size: 15px; }
.stats b { font-variant-numeric: tabular-nums; }
.vitesses { display: flex; gap: 4px; align-items: center; }
.btn.mini { padding: 3px 8px; font-size: 13px; border-radius: 6px; }
.btn.mini.actif { background: linear-gradient(#ffd77a, #d79a34); color: #1b130a; }

/* ---- messages */
#messages { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(720px, 92vw); }
.msg { background: rgba(20, 16, 12, .85); border: 1px solid var(--bord); border-radius: 8px; padding: 6px 14px; text-align: center; animation: apparait .3s ease-out; text-shadow: 0 1px 2px #000; }
.msg.vague { font-family: 'Cinzel', serif; font-size: 22px; color: #ffcf6a; border-color: #b34a2a; background: rgba(60, 14, 8, .85); }
.msg.boss { font-family: 'Cinzel', serif; font-size: 24px; color: #ff7a6a; border-color: #ff5a3a; background: rgba(70, 8, 30, .9); }
.msg.alerte { color: #ff9a8a; border-color: #b33a2a; }
@keyframes apparait { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- boss */
#boss { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); width: min(560px, 80vw); text-align: center; pointer-events: none; margin-top: 0; }
#boss .nom { font-family: 'Cinzel', serif; font-size: 20px; color: #ff8a7a; text-shadow: 0 2px 4px #000; }
#boss .barre { height: 14px; border: 2px solid #7a2a2a; border-radius: 8px; background: rgba(0, 0, 0, .7); overflow: hidden; margin-top: 3px; }
#boss .barre i { display: block; height: 100%; background: linear-gradient(#ff5a4a, #a01a1a); transition: width .2s; }
#boss ~ #messages { top: 128px; }

/* ---- mini-carte */
/* taille de l'interface (menu pause) : --ui de 1 à 2, appliqué par zoom aux éléments d'interface du jeu ;
   la mini-carte (dessinée par le moteur) suit la même échelle (main.js) */
:root { --ui: 1; }
#hud-haut, #panneau, #mini-cadre, #aide-rapide, #astuce, #badges .puce, #menu .menu-carte { zoom: var(--ui); }
#messages, #boss { zoom: var(--ui); }
#mini-cadre { position: fixed; left: 8px; bottom: 8px; width: 228px; height: 228px; border: 2px solid var(--or2); border-radius: 6px; pointer-events: none; box-shadow: 0 0 0 4px rgba(20, 16, 12, .9), 0 4px 18px rgba(0, 0, 0, .6); }

/* ---- panneau de sélection */
#panneau {
  position: fixed; bottom: 8px; left: 250px; right: 8px; max-width: 980px; margin: 0 auto; min-height: 96px;
  background: var(--panneau); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start;
}
.portrait { width: 84px; height: 84px; border-radius: 10px; border: 1px solid var(--bord); background: radial-gradient(circle at 50% 40%, #4a4030, #1d1812); display: grid; place-items: center; flex: none; }
.portrait img { max-width: 92%; max-height: 92%; }
.infos { min-width: 200px; flex: 0 1 260px; }
.infos h3 { margin: 0 0 4px; font-size: 18px; }
.ligne { font-size: 13px; color: var(--texte2); margin-top: 4px; }
.ligne.alerte { color: #ff8a7a; }
.ligne.ordre { color: #9fd38a; }
.pv { position: relative; height: 16px; border-radius: 6px; background: #120e0a; border: 1px solid #000; overflow: hidden; }
.pv i { display: block; height: 100%; }
.pv i.ok { background: linear-gradient(#7ad35a, #3f8f2a); }
.pv i.moyen { background: linear-gradient(#f2c84a, #b0861a); }
.pv i.bas { background: linear-gradient(#f2604a, #a0281a); }
.pv span { position: absolute; inset: 0; font-size: 12px; text-align: center; line-height: 16px; text-shadow: 0 1px 2px #000; }
.groupe { display: flex; gap: 6px; flex-wrap: wrap; max-width: 300px; }
.g-unite { position: relative; width: 52px; height: 52px; border: 1px solid var(--bord); border-radius: 8px; background: #241d15; display: grid; place-items: center; cursor: pointer; }
.g-unite img { max-width: 90%; max-height: 90%; }
.g-unite b { position: absolute; right: 3px; bottom: 1px; font-size: 13px; text-shadow: 0 1px 2px #000; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 260px; }
.action {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; min-height: 76px; padding: 4px;
  background: linear-gradient(#3a2e20, #241c13); border: 1px solid var(--bord); border-radius: 8px; color: var(--texte); cursor: pointer; font: inherit;
}
.action:hover:not(:disabled) { border-color: var(--or); background: linear-gradient(#4a3a28, #2d2318); }
.action.actif { border-color: var(--or); box-shadow: 0 0 0 2px rgba(240, 190, 80, .4); }
.action:disabled { opacity: .5; cursor: default; }
.action .nom { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.1; }
.action .vign { width: 38px; height: 34px; object-fit: contain; }
.action .touche { position: absolute; left: 4px; top: 2px; font-size: 11px; color: var(--or); font-weight: 800; }
.action .recharge { font-size: 13px; color: #9fc3ff; }
/* sorts du héros, sous ses points de vie : deux boutons côte à côte */
.sorts-heros { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.sorts-heros .action.sort { flex: 1; width: auto; min-height: 0; padding: 6px 6px 5px; }
.cout { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; font-size: 11px; }
.cout span { display: inline-flex; align-items: center; }
.cout .ico { width: 14px; height: 14px; }
.cout .manque { color: #ff7a6a; }
.file { display: flex; gap: 4px; width: 100%; }
.file.vide { height: 42px; align-items: center; color: var(--texte2); font-size: 12px; font-style: italic; opacity: 0.7; }
.f-item { position: relative; width: 40px; height: 40px; border: 1px solid var(--bord); border-radius: 6px; background: #241d15; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.f-item img { max-width: 90%; max-height: 90%; }
.f-item i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--bleu); }
.astuce { font-size: 12px; color: var(--texte2); width: 100%; }

#selbox { position: fixed; display: none; border: 1px solid #8f8; background: rgba(120, 255, 120, .08); pointer-events: none; }
#fps { position: fixed; right: 10px; bottom: 6px; font-size: 11px; color: rgba(255, 255, 255, .5); pointer-events: none; }
#debug { position: fixed; left: 250px; top: 70px; font: 12px monospace; background: rgba(0, 0, 0, .6); padding: 4px 8px; border-radius: 4px; pointer-events: none; }
#aide-rapide { position: fixed; right: 10px; bottom: 22px; font-size: 11px; color: rgba(255, 240, 210, .55); pointer-events: none; text-shadow: 0 1px 2px #000; }
#panneau:not([style*="none"]) ~ #aide-rapide { display: none; }

/* ---- écrans */
#titre-ecran, #menu, #fin, #chargement { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; }
#titre-ecran { background: #120e0a center / cover no-repeat; }
#titre-ecran::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 6, .2), rgba(10, 8, 6, .75)); }
.titre-carte { position: relative; text-align: center; max-width: 760px; padding: 24px; }
.titre-carte h1 { font-size: clamp(42px, 7vw, 86px); margin: 0; font-weight: 800; text-shadow: 0 4px 16px #000, 0 0 30px rgba(255, 160, 60, .35); }
.sous-titre { font-size: 20px; margin: 4px 0 22px; text-shadow: 0 2px 6px #000; }
.liens { margin-top: 12px; font-size: 14px; color: var(--texte2); text-shadow: 0 1px 3px #000; }
.regles { margin-top: 18px; background: rgba(20, 16, 12, .82); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 16px; font-size: 14px; text-align: left; color: var(--texte); }
#menu { background: rgba(0, 0, 0, .55); }
.menu-carte, .fin-carte { background: var(--panneau); border: 1px solid var(--or2); border-radius: 14px; padding: 22px 30px; text-align: center; display: flex; flex-direction: column; gap: 12px; min-width: 320px; }
.menu-carte label { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
#fin { background: rgba(0, 0, 0, .6); }
.fin-carte { max-width: 760px; }
.fin-carte img { width: 100%; max-height: 46vh; object-fit: cover; border-radius: 10px; }
.fin-carte h1 { margin: 4px 0; font-size: 44px; }
.stats-fin { color: var(--texte2); }
#chargement { background: radial-gradient(circle at 50% 40%, #2a2016, #0e0b08); flex-direction: column; }
#chargement h1 { font-size: 54px; margin: 0 0 18px; }
#chargement .barre { width: min(460px, 80vw); height: 12px; border: 1px solid var(--bord); border-radius: 8px; background: #000; overflow: hidden; margin: 0 auto; }
#chargement .barre i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--or2), var(--or)); transition: width .2s; }
#chargement .txt { margin-top: 10px; color: var(--texte2); text-align: center; }
#chargement > * { text-align: center; }
.erreur { max-width: 600px; padding: 20px; text-align: center; }

/* ---- sauvegardes */
.continuer { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.continuer:empty { display: none; }
.continuer .btn { flex-direction: column; gap: 0; line-height: 1.2; }
.continuer .btn small { color: var(--texte2); font-weight: 400; font-size: 12px; }
.sauve-etat { min-height: 1.2em; font-size: 13px; color: var(--texte2); }

.f-plus { display: grid; place-items: center; min-width: 44px; height: 40px; padding: 0 6px; border: 1px solid var(--bord); border-radius: 6px; background: #241d15; font-weight: 800; color: var(--or); }
.portrait { position: relative; }
.nb-groupe { position: absolute; right: 4px; bottom: 2px; font-size: 16px; color: var(--or); text-shadow: 0 1px 3px #000; }
.f-nb { position: absolute; right: 2px; bottom: 0; font-size: 12px; text-shadow: 0 1px 2px #000; }

#inactifs.alerte { border-color: #ffd36a; box-shadow: 0 0 0 2px rgba(255, 211, 106, .35); animation: clignoteInactifs 1.6s infinite; }
@keyframes clignoteInactifs { 50% { box-shadow: 0 0 0 4px rgba(255, 211, 106, .15); } }
/* un paysan vient de devenir inactif : le bouton grossit et s'illumine un instant */
#inactifs.surgit { animation: surgitInactifs 1.4s ease-out 1, clignoteInactifs 1.6s 1.4s infinite; }
@keyframes surgitInactifs {
  0% { transform: scale(1); }
  12% { transform: scale(1.55); background: #ffd36a; color: #2a1a05; box-shadow: 0 0 22px 8px rgba(255, 200, 80, .85); }
  30% { transform: scale(1.2); }
  45% { transform: scale(1.4); background: #ffd36a; color: #2a1a05; box-shadow: 0 0 16px 6px rgba(255, 200, 80, .7); }
  100% { transform: scale(1); }
}
.energie { position: relative; height: 14px; margin-top: 5px; border-radius: 6px; background: #0c1220; border: 1px solid #000; overflow: hidden; }
.energie i { display: block; height: 100%; background: linear-gradient(#7ac8ff, #2f6fd0); }
.energie span { position: absolute; inset: 0; font-size: 11px; text-align: center; line-height: 14px; text-shadow: 0 1px 2px #000; }

/* badges des groupes d'unités en vue dézoomée (badges.js) */
#badges { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#badges .badge { position: absolute; left: 0; top: 0; display: flex; gap: 2px; pointer-events: none; will-change: transform; }
#badges .puce { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 3px; height: 28px; padding: 0 7px 0 1px;
  border-radius: 14px; background: rgba(14, 22, 40, 0.88); border: 1.5px solid #5fb8ff; color: #eaf4ff;
  font: 700 13px/1 system-ui, sans-serif; text-shadow: 0 1px 1px #000; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); white-space: nowrap; }
#badges .puce i { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: radial-gradient(#3a4f72, #1a2438); display: block; }
#badges .puce img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.45) translateY(8%); }
#badges .puce:hover { border-color: #fff; background: rgba(30, 50, 85, 0.95); }
#badges .puce.sel { border-color: #73ff73; box-shadow: 0 0 6px rgba(115, 255, 115, 0.7); }
#badges .puce.demi { border-color: #b8ff8a; }
#badges .puce.somme { padding: 0 6px; color: #ffe27a; }

/* astuce « Maj = rectangle » (première ligne de bâtiments tracée) */
#astuce { position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 14px;
  max-width: 560px; padding: 10px 16px 10px 10px; background: var(--panneau); border: 1px solid var(--or2); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6); pointer-events: none; animation: astuceEntre .25s ease-out; }
#astuce img { width: 192px; height: 120px; border-radius: 8px; border: 1px solid var(--bord); flex: none; }
#astuce .astuce-texte { font-size: 15px; line-height: 1.35; }
#astuce kbd { display: inline-block; padding: 1px 7px; border: 1px solid var(--or2); border-bottom-width: 3px; border-radius: 5px; background: #2a2116; font: 700 13px system-ui, sans-serif; }
@keyframes astuceEntre { from { opacity: 0; transform: translate(-50%, -8px); } }

/* cinématiques (src/cinematique.js) : introduction, fin, crédits */
#cinematique { position: fixed; inset: 0; z-index: 40; background: #000; }
#cinematique canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#cinematique .sous-titre { position: absolute; left: 50%; bottom: 10.5%; transform: translateX(-50%); width: min(86vw, 1100px); text-align: center;
  font: 600 clamp(18px, 2.6vw, 34px)/1.3 Cinzel, Cambria, Georgia, serif; color: #f4e8cd; text-shadow: 0 2px 6px #000, 0 0 18px #000; pointer-events: none; }
#cinematique .passer { position: absolute; right: 18px; bottom: 18px; opacity: .55; }
#cinematique .passer:hover { opacity: 1; }
.cine-liens { margin-top: 8px; display: flex; gap: 8px; justify-content: center; }

/* tutoriel vidéo (assets/tuto.mp4, fabriqué par tools/tuto_montage.py) */
#tuto { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0, 0, 0, .78); }
.tuto-carte { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(92vw, 1280px); }
#tuto-video { width: 100%; max-height: 80vh; border: 1px solid var(--or2); border-radius: 10px; background: #000; box-shadow: 0 8px 40px rgba(0, 0, 0, .7); }

/* écran « cliquer pour commencer » : le clic lance l'introduction avec le son (exigence des navigateurs) */
#demarrer { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: radial-gradient(ellipse at center, #2a1a0c 0%, #070403 75%); cursor: pointer; }
.demarrer-carte { text-align: center; }
.demarrer-carte h1 { font-size: clamp(42px, 7vw, 86px); margin: 0 0 24px; font-weight: 800; text-shadow: 0 4px 16px #000, 0 0 30px rgba(255, 160, 60, .35); }
.demarrer-carte p { color: var(--texte2); margin-top: 14px; }

/* ================================================================ écran titre « AAA »
   décor animé (canevas #titre-fond, dessiné par src/cinematique.js), logo métallique, menu à gauche */
#titre-ecran { place-items: stretch; overflow: hidden; background: #070403 center / cover no-repeat; }
#titre-ecran::before { content: none; }
#titre-fond { position: absolute; inset: 0; width: 100%; height: 100%; }
.titre-voile { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 3, 2, .92) 0%, rgba(6, 3, 2, .7) 32%, rgba(6, 3, 2, 0) 62%),
              linear-gradient(0deg, rgba(4, 2, 1, .85) 0%, rgba(4, 2, 1, 0) 30%); }
.titre-contenu { position: relative; display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3.5vh, 44px);
  height: 100%; padding: 0 0 0 clamp(28px, 7vw, 130px); box-sizing: border-box; }

/* logo */
.titre-logo { animation: logoEntree 1.6s cubic-bezier(.2, .8, .2, 1) both; }
.logo-sup { font: 600 clamp(12px, 1.3vw, 17px) 'Cinzel', serif; letter-spacing: .5em; text-transform: uppercase; color: #c9a24b;
  margin-left: .3em; text-shadow: 0 2px 6px #000; animation: apparait 1s .9s both; }
.logo { margin: 0; line-height: .9; font-weight: 800; font-size: clamp(50px, min(10vw, 15vh), 170px); letter-spacing: .02em; text-transform: uppercase;
  display: flex; flex-direction: column; filter: drop-shadow(0 6px 0 #1a0c04) drop-shadow(0 12px 22px rgba(0, 0, 0, .9)) drop-shadow(0 0 34px rgba(255, 110, 20, .35));
  animation: lueurLogo 4s ease-in-out 2s infinite; }
.logo span { background: linear-gradient(100deg, #8a5a1c 0%, #f5d27c 18%, #fff4cc 26%, #e3a94b 34%, #8f5a1a 52%, #f0c668 70%, #fff1c0 78%, #c88a33 90%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: reflet 7s linear 1.8s infinite; }
.logo span:last-child { font-size: .62em; letter-spacing: .14em; margin-top: .08em; }
.logo-devise { margin-top: 14px; font: 600 clamp(14px, 1.5vw, 21px) 'Cinzel', serif; letter-spacing: .18em; color: #f1e6d0;
  text-shadow: 0 2px 8px #000; animation: apparait 1s 1.2s both; }
.logo-devise i, .titre-pied i { font-style: normal; color: #c9a24b; margin: 0 .5em; font-size: .7em; vertical-align: middle; }

/* menu */
.menu-principal { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(3px, .6vh, 6px); }
.menu-principal .continuer { display: contents; }
.menu-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: min(440px, 80vw);
  padding: clamp(8px, 1.5vh, 13px) 40px clamp(8px, 1.5vh, 13px) 58px; box-sizing: border-box; border: 0; cursor: pointer; text-decoration: none; text-align: left;
  font: 700 clamp(19px, 2vw, 27px) 'Cinzel', serif; letter-spacing: .14em; text-transform: uppercase; color: #e9dcc0;
  background: linear-gradient(90deg, rgba(30, 16, 6, .78), rgba(30, 16, 6, .35) 70%, rgba(30, 16, 6, 0));
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%);
  text-shadow: 0 2px 4px #000; transition: transform .25s cubic-bezier(.2, .8, .2, 1), color .2s, background .25s;
  animation: entreeMenu .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(1.3s + var(--i, 0) * 90ms); }
.menu-item small { font: 400 clamp(11px, 1vw, 14px) 'Alegreya Sans', sans-serif; letter-spacing: .04em; text-transform: none; color: #b9a88a; }
/* filet doré à gauche et losange qui s'allume */
.menu-item::before { content: ''; position: absolute; left: 22px; top: 50%; width: 12px; height: 12px; margin-top: -6px; transform: rotate(45deg) scale(.7);
  border: 2px solid #8a6a2c; background: transparent; transition: all .25s; }
.menu-item::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 180, .28) 45%, transparent 60%); background-size: 250% 100%; background-position: 120% 0; }
.menu-item:hover, .menu-item.actif { color: #fff4cc; transform: translateX(14px);
  background: linear-gradient(90deg, rgba(150, 90, 25, .75), rgba(90, 45, 10, .45) 65%, rgba(60, 25, 5, 0)); }
.menu-item:hover::before, .menu-item.actif::before { transform: rotate(45deg) scale(1); background: #ffd77a; border-color: #fff1c0; box-shadow: 0 0 14px #ffb347; }
.menu-item:hover::after, .menu-item.actif::after { animation: balayage .9s ease-out; }
.menu-item:hover small, .menu-item.actif small { color: #f1e6d0; }
.menu-item:active { transform: translateX(14px) scale(.98); }
.menu-item.principal { font-size: clamp(22px, min(2.5vw, 4.4vh), 34px); padding-top: clamp(11px, 2vh, 17px); padding-bottom: clamp(11px, 2vh, 17px); color: #ffe9a8; }
/* entrées secondaires : plus petites, sans fond tant qu'on ne les survole pas */
.menu-item.secondaire { font-size: clamp(14px, min(1.4vw, 2.5vh), 19px); min-width: min(330px, 70vw); padding-top: clamp(5px, 1vh, 8px);
  padding-bottom: clamp(5px, 1vh, 8px); padding-left: 52px; color: #d8c9a8; background: linear-gradient(90deg, rgba(30, 16, 6, .45), rgba(30, 16, 6, 0) 70%); }
.menu-item.secondaire::before { width: 9px; height: 9px; margin-top: -4.5px; left: 24px; }
.menu-item.discret { font-size: clamp(13px, 1.1vw, 15px); padding-top: 8px; padding-bottom: 8px; color: #9c8a6a; letter-spacing: .1em; }
.titre-pied { position: absolute; right: 24px; bottom: 16px; text-align: right; font: 600 12px 'Cinzel', serif; letter-spacing: .2em;
  color: rgba(241, 230, 208, .55); text-transform: uppercase; animation: apparait 1s 2s both; }

/* panneau « comment jouer » */
#aide-panneau { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 2, 1, .72); backdrop-filter: blur(3px); z-index: 2;
  animation: apparait .35s both; }
.aide-carte { width: min(780px, 88vw); max-height: 82vh; overflow: auto; padding: 30px 38px; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(40, 24, 10, .96), rgba(18, 10, 5, .96)); border: 1px solid #8a6a2c;
  box-shadow: 0 0 0 1px #2a1808, 0 0 60px rgba(0, 0, 0, .8), inset 0 0 40px rgba(201, 162, 75, .08); }
.aide-carte h2 { margin: 0 0 14px; font-size: 30px; letter-spacing: .12em; text-transform: uppercase; }
.aide-carte .regles { font-size: 16px; line-height: 1.55; color: #e9dcc0; }
.aide-carte .menu-item { margin-top: 18px; animation: none; }

@keyframes logoEntree { 0% { opacity: 0; transform: scale(1.25); filter: blur(10px); } 60% { opacity: 1; filter: blur(0); } 100% { transform: scale(1); } }
@keyframes apparait { from { opacity: 0; } }
@keyframes entreeMenu { from { opacity: 0; transform: translateX(-60px); } }
@keyframes reflet { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@keyframes lueurLogo { 50% { filter: drop-shadow(0 6px 0 #1a0c04) drop-shadow(0 12px 22px rgba(0, 0, 0, .9)) drop-shadow(0 0 60px rgba(255, 120, 30, .6)); } }
@keyframes balayage { from { background-position: 120% 0; } to { background-position: -60% 0; } }
.menu-principal .continuer + .menu-item.secondaire { margin-top: clamp(6px, 1.4vh, 14px); }

/* menu pause et écran de démarrage : mêmes boutons que l'écran titre */
#menu { backdrop-filter: blur(4px); }
#menu .menu-carte { align-items: stretch; min-width: min(440px, 86vw); padding: 26px 30px 22px; background: linear-gradient(180deg, rgba(40, 24, 10, .95), rgba(16, 9, 4, .95));
  border: 1px solid #8a6a2c; border-radius: 0; box-shadow: 0 0 0 1px #2a1808, 0 0 60px rgba(0, 0, 0, .8); }
#menu .menu-carte h2 { margin: 0 0 6px; font-size: 34px; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
#menu .menu-item, #demarrer .menu-item { animation: none; min-width: 0; }
#demarrer .menu-item { margin: 0 auto; padding-right: 54px; animation: pulseDemarrer 2.4s ease-in-out infinite; }
@keyframes pulseDemarrer { 50% { color: #fff4cc; text-shadow: 0 0 18px rgba(255, 180, 70, .9), 0 2px 4px #000; } }

/* ================================================================ habillage « AAA » de l'interface en jeu
   panneaux de métal sombre cerclés d'or, boutons biseautés qui s'illuminent, touches façon clavier,
   barres en relief. (Ces règles viennent en dernier : elles remplacent l'habillage d'origine.) */
:root {
  --cadre-fond: linear-gradient(180deg, rgba(44, 33, 21, .97) 0%, rgba(26, 18, 11, .97) 55%, rgba(17, 11, 6, .97) 100%);
  --cadre-bord: #7a5a26;
  --cadre-ombre: 0 0 0 1px #0a0603, inset 0 0 0 1px rgba(255, 214, 140, .08), inset 0 1px 0 rgba(255, 224, 160, .22),
                 inset 0 -12px 22px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .65);
  --bouton-fond: radial-gradient(120% 95% at 50% 12%, #4b3926 0%, #2b1f13 55%, #170f08 100%);
  --bouton-ombre: inset 0 1px 0 rgba(255, 228, 170, .28), inset 0 -2px 0 rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .55),
                  0 2px 0 #0a0603, 0 4px 8px rgba(0, 0, 0, .5);
  --lueur-or: 0 0 14px rgba(255, 180, 70, .5);
}

/* ---- panneaux (barre du haut, panneau de sélection) */
#hud-haut > div, #panneau {
  background: var(--cadre-fond); border: 1px solid var(--cadre-bord); border-radius: 3px; box-shadow: var(--cadre-ombre);
}
#hud-haut > div { position: relative; padding: 6px 12px; }
/* losanges dorés aux coins hauts */
#hud-haut > div::before, #hud-haut > div::after, #panneau::before, #panneau::after {
  content: ''; position: absolute; top: -4px; width: 7px; height: 7px; transform: rotate(45deg); pointer-events: none;
  background: linear-gradient(135deg, #fff1c0, #c9902e); box-shadow: 0 0 0 1px #2a1806, 0 0 6px rgba(255, 190, 80, .5);
}
#hud-haut > div::before, #panneau::before { left: -4px; }
#hud-haut > div::after, #panneau::after { right: -4px; }
#panneau { border-top: 1px solid #b08a3e; padding: 12px 14px; }

/* ressources et statistiques */
.res b, .stats b { font-family: 'Cinzel', serif; font-weight: 800; font-size: 16px; color: #f6ead0; text-shadow: 0 1px 0 #000, 0 0 8px rgba(0, 0, 0, .6); }
.res .ico, .stats .ico { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .8)); }
.vague .titre { font-size: 19px; letter-spacing: .08em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff2c6, #e1a845 60%, #a8721f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #000); }

/* ---- petits boutons (vitesses, menu, appeler la vague, paysans inactifs) */
.btn.mini, .btn.mini:hover:not(:disabled) {
  font: 700 12px 'Cinzel', serif; letter-spacing: .06em; text-transform: uppercase; color: #ecdcb8;
  padding: 5px 10px; border-radius: 3px; border: 1px solid var(--cadre-bord); background: var(--bouton-fond); box-shadow: var(--bouton-ombre);
  text-shadow: 0 1px 1px #000; transition: transform .12s, box-shadow .15s, border-color .15s, color .15s;
}
.btn.mini:hover:not(:disabled) { color: #fff4cc; border-color: #e8b85a; transform: translateY(-1px); box-shadow: var(--bouton-ombre), var(--lueur-or); }
.btn.mini:active:not(:disabled) { transform: translateY(1px); }
.btn.mini.actif, .btn.mini.actif:hover {
  color: #1d1206; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); border-color: #ffe6a0;
  background: linear-gradient(180deg, #fff0b8 0%, #f0c25a 45%, #b98326 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(90, 50, 0, .5), 0 2px 0 #0a0603, var(--lueur-or);
}
#appeler { color: #ffd77a; }

/* ---- boutons d'action (construction, formation, améliorations, sorts) */
.action {
  border: 1px solid #6b4f24; border-radius: 4px; background: var(--bouton-fond); box-shadow: var(--bouton-ombre);
  transition: transform .12s, box-shadow .15s, border-color .15s; padding: 6px 4px 5px;
}
.action:hover:not(:disabled) { border-color: #e8b85a; background: var(--bouton-fond); transform: translateY(-2px);
  box-shadow: var(--bouton-ombre), var(--lueur-or), inset 0 0 20px rgba(255, 190, 90, .14); }
.action:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .7), 0 1px 0 #0a0603; }
.action.actif { border-color: #ffe08a; animation: actionActive 1.6s ease-in-out infinite;
  box-shadow: var(--bouton-ombre), 0 0 0 1px rgba(255, 220, 130, .6), 0 0 18px rgba(255, 190, 80, .6), inset 0 0 22px rgba(255, 200, 100, .25); }
@keyframes actionActive { 50% { box-shadow: var(--bouton-ombre), 0 0 0 1px rgba(255, 220, 130, .9), 0 0 26px rgba(255, 190, 80, .85), inset 0 0 26px rgba(255, 200, 100, .35); } }
.action:disabled { opacity: 1; filter: grayscale(.85) brightness(.6); }
.action .nom { font: 700 10.5px/1.15 'Cinzel', serif; letter-spacing: .03em; text-transform: uppercase; color: #eadcbc; text-shadow: 0 1px 1px #000; }
.action .vign { width: 42px; height: 36px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .75)); transition: transform .15s; }
.action:hover:not(:disabled) .vign { transform: scale(1.1) translateY(-1px); }
/* touche de raccourci façon touche de clavier */
.action .touche { left: 3px; top: 3px; min-width: 16px; height: 16px; padding: 0 3px; display: grid; place-items: center;
  font: 800 10px 'Cinzel', serif; color: #ffd77a; border: 1px solid #8a6a32; border-radius: 3px;
  background: linear-gradient(180deg, #5a4428, #2a1d10); box-shadow: inset 0 1px 0 rgba(255, 230, 170, .3), 0 1px 0 #000; }
.action .recharge { font: 800 13px 'Cinzel', serif; color: #a9d0ff; text-shadow: 0 0 6px rgba(80, 150, 255, .7); }
.cout { gap: 2px 4px; margin-top: 1px; }
.cout span { background: rgba(0, 0, 0, .38); border-radius: 3px; padding: 0 3px 0 1px; font-weight: 700; }
.cout .ico { filter: drop-shadow(0 1px 1px #000); }

/* ---- portrait, vignettes de groupe, file de formation */
.portrait { border: 2px solid #8a6a32; border-radius: 4px; background: radial-gradient(circle at 50% 38%, #4d3e2a, #1a120b 75%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .85), 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 214, 140, .18); }
.portrait img { filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .8)); }
.infos h3 { font-size: 19px; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff2c6, #e1a845 60%, #a8721f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-unite, .f-item, .f-plus { border: 1px solid #6b4f24; border-radius: 4px; background: var(--bouton-fond); box-shadow: var(--bouton-ombre); }
.g-unite:hover, .f-item:hover { border-color: #e8b85a; box-shadow: var(--bouton-ombre), var(--lueur-or); }
.g-unite b, .nb-groupe, .f-nb { font-family: 'Cinzel', serif; font-weight: 800; color: #ffe39a; }
.f-item i { background: linear-gradient(90deg, #6fb6ff, #c8e6ff); box-shadow: 0 0 6px rgba(120, 190, 255, .8); }

/* ---- barres de vie et d'énergie en relief */
.pv, .energie { height: 17px; border: 1px solid #000; border-radius: 3px; background: linear-gradient(180deg, #0b0806, #1c140d);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .85), 0 0 0 1px #5a4422; }
.pv i, .energie i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 4px rgba(0, 0, 0, .3); }
.pv span, .energie span { font: 700 11px/17px 'Cinzel', serif; letter-spacing: .04em; }

/* ---- mini-carte : double cadre doré */
#mini-cadre { border: 2px solid #a07a34; border-radius: 3px;
  box-shadow: 0 0 0 3px #120b06, 0 0 0 4px #6b4f24, inset 0 0 12px rgba(0, 0, 0, .6), 0 8px 22px rgba(0, 0, 0, .7); }

/* ---- messages : bannières à filets dorés */
.msg { background: linear-gradient(90deg, rgba(18, 11, 5, 0), rgba(18, 11, 5, .92) 14%, rgba(18, 11, 5, .92) 86%, rgba(18, 11, 5, 0));
  border: 0; border-radius: 0; padding: 7px 46px; border-top: 1px solid; border-bottom: 1px solid;
  border-image: linear-gradient(90deg, transparent, #c9a24b 20%, #f5d989 50%, #c9a24b 80%, transparent) 1; color: #f1e6d0; }
.msg.vague { font-size: 24px; letter-spacing: .1em; text-transform: uppercase; background: linear-gradient(90deg, rgba(70, 14, 6, 0), rgba(70, 14, 6, .9) 14%, rgba(70, 14, 6, .9) 86%, rgba(70, 14, 6, 0));
  border-image: linear-gradient(90deg, transparent, #c94a2a 20%, #ffb36a 50%, #c94a2a 80%, transparent) 1; }
.msg.boss { font-size: 26px; letter-spacing: .1em; text-transform: uppercase;
  border-image: linear-gradient(90deg, transparent, #b0203a 20%, #ff7a6a 50%, #b0203a 80%, transparent) 1; }
.msg.alerte { border-image: linear-gradient(90deg, transparent, #b33a2a 20%, #ff9a7a 50%, #b33a2a 80%, transparent) 1; }

/* ---- barre du boss */
#boss .nom { letter-spacing: .12em; text-transform: uppercase; }
#boss .barre { height: 16px; border: 1px solid #000; border-radius: 3px; box-shadow: 0 0 0 1px #8a2a1e, 0 0 16px rgba(255, 60, 40, .35), inset 0 2px 4px rgba(0, 0, 0, .8); }
#boss .barre i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }

/* ---- badges des groupes (vue dézoomée) */
#badges .puce { border-radius: 4px; background: var(--bouton-fond); box-shadow: var(--bouton-ombre); font-family: 'Cinzel', serif; }
.sorts-heros .action.sort { padding-left: 24px; padding-right: 6px; }
.btn.mini { white-space: nowrap; }
#appeler { letter-spacing: .02em; padding: 4px 8px; }
.vague-bas { white-space: nowrap; gap: 8px; }
.vague-bas > span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- succès : notification façon Steam + page de consultation ---------- */
#succes-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; zoom: var(--ui); }
.succes-toast { display: flex; align-items: center; gap: 12px; width: 340px; padding: 10px 14px 10px 10px; border-radius: 6px;
  background: linear-gradient(135deg, #2b3340 0%, #1b222c 60%, #151a22 100%); border: 1px solid rgba(120, 150, 190, .28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .07); color: #dfe6ee; font-family: 'Motiva Sans', Arial, 'Alegreya Sans', sans-serif;
  transform: translateY(130%); opacity: 0; transition: transform .45s cubic-bezier(.2, .9, .25, 1), opacity .35s ease; }
.succes-toast.entre { transform: translateY(0); opacity: 1; }
.succes-toast.sort { transform: translateY(40%); opacity: 0; transition: transform .5s ease-in, opacity .5s ease-in; }
.succes-toast .st-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.succes-toast .st-txt small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #67c1f5; }
.succes-toast .st-txt b { font-size: 16px; font-weight: 700; color: #fff; margin-top: 1px; }
.succes-toast .st-txt span { font-size: 12.5px; color: #9aa7b6; margin-top: 2px; }
.succes-toast .st-compte { align-self: flex-start; font-size: 11px; color: #6d7d90; }

/* icône : tuile 64 px à la teinte de la catégorie, avec le reflet qui la balaie à l'apparition */
.st-ico { position: relative; flex: none; width: 64px; height: 64px; border-radius: 4px; display: grid; place-items: center; font-size: 34px; overflow: hidden;
  background: linear-gradient(145deg, hsl(var(--h, 210) 45% 38%), hsl(var(--h, 210) 50% 16%)); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, .45); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.st-ico i { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); }
.succes-toast.entre .st-ico i { animation: refletSucces 1.1s .5s ease-out forwards; }
@keyframes refletSucces { to { transform: translateX(120%); } }
.st-ico.t0 { --h: 0; } .st-ico.t15 { --h: 15; } .st-ico.t30 { --h: 30; } .st-ico.t45 { --h: 45; } .st-ico.t48 { --h: 48; } .st-ico.t50 { --h: 50; } .st-ico.t130 { --h: 130; }
.st-ico.t190 { --h: 190; } .st-ico.t210 { --h: 210; } .st-ico.t270 { --h: 270; } .st-ico.t300 { --h: 300; } .st-ico.t355 { --h: 355; }

#succes-panneau { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(4, 6, 10, .78); backdrop-filter: blur(4px); }
.sp-carte { width: min(860px, 94vw); max-height: 90vh; display: flex; flex-direction: column; gap: 10px; padding: 22px 26px 16px; border-radius: 8px;
  background: linear-gradient(180deg, #1f2733, #131920); border: 1px solid rgba(120, 150, 190, .3); box-shadow: 0 20px 60px rgba(0, 0, 0, .7); zoom: var(--ui); }
.sp-tete h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.sp-resume { display: flex; align-items: center; gap: 16px; color: #b8c4d2; }
.sp-resume b { color: #67c1f5; font-size: 20px; }
.sp-barre { flex: 1; height: 8px; border-radius: 4px; background: #0c1016; overflow: hidden; border: 1px solid rgba(120, 150, 190, .25); }
.sp-barre i { display: block; height: 100%; background: linear-gradient(90deg, #2a8fd0, #67c1f5); }
.sp-filtres { display: flex; gap: 8px; margin-top: 10px; }
.sp-filtres button { font: 600 13px 'Alegreya Sans', sans-serif; padding: 5px 14px; border-radius: 3px; cursor: pointer; color: #b8c4d2; background: #2a3441; border: 1px solid transparent; }
.sp-filtres button.actif { color: #fff; background: #3d6c91; }
.sp-liste { overflow-y: auto; padding-right: 6px; min-height: 120px; }
.sp-liste h3 { margin: 14px 0 6px; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: #8ba5c0; }
.sp-liste h3 small { color: #5f7186; letter-spacing: 0; margin-left: 6px; }
.sp-ligne { display: flex; align-items: center; gap: 14px; padding: 8px 12px; margin-bottom: 4px; border-radius: 4px; background: rgba(255, 255, 255, .045); }
.sp-ligne .st-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.sp-ligne .st-txt b { font-size: 16px; color: #fff; }
.sp-ligne .st-txt span { font-size: 13px; color: #9aa7b6; }
.sp-date { flex: none; text-align: right; font-size: 11.5px; color: #6d7d90; line-height: 1.35; }
.sp-ligne.verrou .st-ico { filter: grayscale(1) brightness(.55); }
.sp-ligne.verrou .st-txt b { color: #8a96a4; }
.sp-ligne.verrou { background: rgba(255, 255, 255, .025); }
#succes-fermer { align-self: center; margin-top: 4px; }

.fin-boutons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.fin-boutons .btn small { display: block; font-size: 12px; font-weight: 600; opacity: .75; }
.fin-boutons a.btn { flex-direction: column; gap: 0; }
