/* Styles du jeu, repris des maquettes (dossier maquettes). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0d0a1c; font-family: "Segoe UI", sans-serif; overflow: hidden; user-select: none; -webkit-user-select: none; }
#cadre { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.tel { width: 390px; height: 844px; flex: none; background: #17132b; padding: 16px 8px; color: #f4ead0; font-size: 13px; position: relative; overflow: hidden; transform-origin: center center; }
.pixel { font-family: "Jersey 15", "Segoe UI", sans-serif; letter-spacing: .5px; line-height: 1; }
.titre { font-size: 22px; color: #f4ead0; }
.doux { color: #a79fd1; font-size: 12px; }
.ligne { display: flex; justify-content: space-between; align-items: center; }
.panneau { border: 24px solid transparent; border-image: url(maquettes/cadres/panneau.svg) 16 fill / 24px; color: #f4ead0; }
.panneau > div { margin: -12px -8px; }
img { -webkit-user-drag: none; }

/* boutons dessinés pixel par pixel */
.btn { position: relative; display: inline-block; vertical-align: middle; cursor: pointer; }
.btn canvas { display: block; image-rendering: pixelated; }
.btn span { position: absolute; left: 0; right: 0; top: 0; text-align: center; font-family: "Jersey 15", "Segoe UI", sans-serif; letter-spacing: 1px; white-space: nowrap; }
.btn:active { transform: translateY(2px); }
.btn.eteint { opacity: .4; pointer-events: none; }

/* ressources et mana : un logo et un nombre */
.ressource { display: inline-flex; align-items: center; gap: 4px; height: 26px; }
.ressource img { height: 26px; }
.ressource .pixel { font-size: 24px; color: #fff3d8; text-shadow: 0 2px #0b0817; }
.ressource.adverse .pixel { color: #ffb4a4; }
.portrait { position: relative; display: inline-block; overflow: hidden; flex: none; }
.portrait img { position: absolute; }
.portrait.inconnue img { filter: brightness(0); opacity: .55; }

/* ---------- terrain de combat ---------- */
.terrain { position: relative; width: 374px; height: 566px; margin-top: 10px; overflow: hidden; }
.terrain > svg, .terrain > img.fond { position: absolute; left: 0; top: 0; width: 374px; height: 566px; }
.terrain > svg { pointer-events: none; }
.terrain > svg.tuiles { pointer-events: auto; }
.terrain .ciel { position: absolute; left: 0; top: 0; width: 374px; height: 100px; background: #241d47; }
.unite { position: absolute; left: 0; top: 0; pointer-events: none; }
.unite img { position: absolute; cursor: pointer; pointer-events: auto; }
.unite .ombre { position: absolute; background: rgba(8, 5, 20, .5); border-radius: 50%; }
.unite .anneau { position: absolute; border: 3px solid #ffe27a; border-radius: 50%; display: none; }
.unite.choisi .anneau { display: block; }
.unite.morte { opacity: 0; transition: opacity .5s; }
.unite .corps { position: absolute; left: 0; top: 0; transition: transform .09s ease-out; }
.unite.touche .corps img { filter: brightness(2.2); }
.barres { position: absolute; z-index: 200; pointer-events: none; }
.barre { border: 1px solid #0b0817; background: #0b0817; height: 6px; margin-top: 1px; }
.barre i { display: block; height: 100%; }
.pv i { background: #5fd38d; }
.barres.ennemi .pv i { background: #ef6a5b; }
.jauge { height: 5px; }
.jauge i { background: #6fb2ff; }
.effets { position: absolute; z-index: 201; display: flex; gap: 1px; pointer-events: none; }
.effets b { font: 400 12px/13px "Jersey 15", "Segoe UI", sans-serif; padding: 0 2px; border: 1px solid #0b0817; background: #c9a6f5; color: #1c0f33; }
.effets b.bonus { background: #9be38f; color: #0f2a12; }
.flottant { position: absolute; z-index: 300; font: 400 20px/1 "Jersey 15", "Segoe UI", sans-serif; color: #fff3d8; text-shadow: 0 2px #0b0817, 1px 0 #0b0817, -1px 0 #0b0817, 0 -1px #0b0817; pointer-events: none; animation: monte .8s ease-out forwards; white-space: nowrap; }
.flottant.soin { color: #9be38f; }
.flottant.critique { color: #ffd23f; font-size: 26px; }
.flottant.pur { color: #e2c8ff; }
.flottant.petit { font-size: 15px; color: #c9c2ea; }
@keyframes monte { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -34px); opacity: 0; } }
.bandeau { position: absolute; left: 0; right: 0; top: 150px; z-index: 350; text-align: center; font-size: 34px; color: #fff3d8; text-shadow: 0 3px #0b0817, 2px 0 #0b0817, -2px 0 #0b0817, 0 -2px #0b0817; pointer-events: none; animation: bandeau 2.2s ease-out forwards; }
@keyframes bandeau { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.08); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* familles : une icône et un nombre par famille ; un clic ouvre la bulle du bonus */
.rangee-familles { position: relative; z-index: 400; min-height: 45px; }
.familles { display: flex; gap: 12px; align-items: center; }
.famille { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.famille .jeton { position: relative; }
.famille canvas { display: block; image-rendering: pixelated; }
.famille .jeton img { position: absolute; left: 4px; top: 4px; width: 34px; height: 34px; }
.famille .nb { font-family: "Jersey 15", "Segoe UI", sans-serif; font-size: 28px; line-height: 22px; color: #fff3d8; text-shadow: 0 2px #0b0817; text-align: center; }
.famille .paliers { display: flex; gap: 3px; margin-top: 4px; justify-content: center; }
.famille .paliers i { width: 7px; height: 7px; background: #3a3358; border: 1px solid #0b0817; }
.famille .paliers i.atteint { background: #f2c14e; }
.famille.inactif .jeton { opacity: .5; }
.famille.inactif .nb { color: #8c84ad; }
.famille.ouvert .jeton { outline: 3px solid #ffe27a; outline-offset: 1px; }
.bulle { position: absolute; left: 0; top: calc(100% + 11px); width: 300px; background: #f3e2b8; color: #3a2204; border: 3px solid #150f26;
         box-shadow: inset 0 3px #fff8dc, inset 0 -3px #d6bb85, 0 4px rgba(8, 5, 20, .55); padding: 10px 12px 11px; font-size: 13px; line-height: 1.35; }
.bulle::before { content: ""; position: absolute; left: var(--fleche, 14px); top: -12px; border: 9px solid transparent; border-top: 0; border-bottom: 9px solid #150f26; }
.bulle::after { content: ""; position: absolute; left: calc(var(--fleche, 14px) + 3px); top: -7px; border: 6px solid transparent; border-top: 0; border-bottom: 7px solid #fff8dc; }
.bulle h4 { margin: 0 0 6px; font: 400 21px/1 "Jersey 15", "Segoe UI", sans-serif; letter-spacing: .5px; }
.bulle .palier { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.bulle .palier b { flex: none; width: 20px; height: 20px; text-align: center; border: 2px solid #150f26; background: #d6bb85; font: 400 17px/17px "Jersey 15", "Segoe UI", sans-serif; }
.bulle .palier.atteint b { background: #f2c14e; }
.bulle .palier.eteint { opacity: .55; }
.bulle .palier em { font-style: normal; margin-left: auto; padding: 0 5px; background: #3a2204; color: #fff3d8; font-size: 11px; }
.bulle .note { margin-top: 5px; font-size: 12px; color: #6b4a1c; }

/* fiche du monstre touché */
.fiche { min-height: 58px; }
.fiche .passif { margin-top: 4px; color: #cfc8ee; font-size: 12px; line-height: 1.3; }
/* fiche courte, pour les écrans où il faut garder de la place pour le stock : le texte du passif tient sur deux lignes */
.fiche.courte { min-height: 73px; }
.fiche.courte .passif { margin-top: 3px; font-size: 11.5px; line-height: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.placement .rangee-familles { margin-top: 2px !important; }
.placement .terrain { margin-top: 4px; }
.placement .case-stock { width: 42px; height: 42px; }

/* le stock : une rangée de cases où attendent les monstres retirés du terrain */
.stock .cases { display: flex; gap: 5px; margin-top: 4px; overflow-x: auto; max-width: 362px; padding-bottom: 2px; }
.case-stock { flex: none; width: 46px; height: 46px; border: 2px dashed #5a4f8a; background: #1e1838; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; cursor: pointer; }
.case-stock.pleine { border: 2px solid #d9b45a; background: #262048; }
.case-stock.choisie { border-color: #ffe27a; background: #4a3f1c; }

/* ---------- ville ---------- */
.ville { position: relative; width: 374px; height: 561px; margin-top: 10px; overflow: hidden; }
.ville > img { position: absolute; left: 0; top: 0; width: 374px; height: 561px; }
.enseigne { position: absolute; transform: translateX(-50%); filter: drop-shadow(0 3px 0 rgba(8, 5, 20, .45)); cursor: pointer; }
.enseigne.plus-tard { opacity: .75; cursor: default; pointer-events: none; }
.equipe-bande { display: flex; margin-top: 4px; align-items: flex-end; height: 50px; gap: 6px; }

/* ---------- carte du donjon ---------- */
.carte { position: relative; width: 374px; height: 561px; margin-top: 10px; overflow: hidden; }
.carte > img.fond { position: absolute; left: 0; top: 0; width: 374px; height: 561px; }
.pas-image { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.dalle { position: absolute; transform: translate(-50%, -50%); }
.etape { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 0 rgba(8, 5, 20, .5)); pointer-events: none; }
.etape.faite, .etape.fermee { opacity: .4; filter: none; }
.anneau-carte { position: absolute; width: 46px; height: 38px; transform: translate(-50%, -50%); border: 3px solid #ffe27a; border-radius: 50%; box-shadow: 0 0 0 2px #150f26, inset 0 0 0 2px #150f26; cursor: pointer; animation: bat 1.1s ease-in-out infinite; }
.anneau-carte.grand { width: 84px; height: 62px; }
.anneau-carte.choisie { background: rgba(255, 226, 122, .65); animation: none; }
@keyframes bat { 50% { box-shadow: 0 0 0 2px #150f26, inset 0 0 0 2px #150f26, 0 0 0 6px rgba(255, 226, 122, .35); } }
.pion { position: absolute; filter: drop-shadow(0 2px 0 rgba(8, 5, 20, .5)); pointer-events: none; transition: left .35s, top .35s; }
.choix-tete { display: flex; align-items: center; gap: 7px; }
.choix-tete > img { height: 28px; }
.especes { display: flex; gap: 8px; align-items: flex-end; min-height: 44px; margin-top: 6px; flex-wrap: wrap; }

/* ---------- fenêtre des donjons ---------- */
#onglets { display: flex; gap: 8px; padding: 0 6px; margin-top: 10px; }
.onglet.actif { box-shadow: 0 5px 0 -1px #ffe27a; }
.onglet .cadenas-onglet { position: absolute; right: -6px; top: -8px; height: 22px; }
.donjon { display: flex; gap: 10px; margin: 8px 6px 0; padding: 8px; background: #262048; border: 3px solid #150f26; box-shadow: inset 0 3px #342c5e, inset 0 -3px #1c1738; cursor: pointer; }
.donjon.choisi { border-color: #ffe27a; box-shadow: inset 0 3px #342c5e, inset 0 -3px #1c1738, 0 0 0 3px #150f26; }
.donjon.ferme { cursor: default; }
.vignette { position: relative; flex: none; width: 114px; height: 171px; border: 3px solid #150f26; overflow: hidden; }
.vignette > img.fond { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.donjon.ferme .vignette > img.fond { filter: brightness(.4) saturate(.6); }
.vignette > img.cadenas { position: absolute; left: 50%; top: 50%; height: 56px; transform: translate(-50%, -50%); }
.infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.infos .nom { display: flex; align-items: center; gap: 6px; }
.infos .nom img { height: 26px; }
.infos .nom .pixel { font-size: 24px; color: #fff3d8; }
.info { display: flex; align-items: center; gap: 5px; min-height: 22px; }
.info img { height: 20px; flex: none; }
.info .pixel { font-size: 19px; color: #fff3d8; }
.infos .especes { margin-top: auto; gap: 3px 4px; min-height: 0; }
.recompense { position: relative; display: inline-flex; padding: 2px 4px; background: #1c1738; border: 2px solid #150f26; }
.recompense img { height: 22px; display: block; }
.recompense.gagnee > img:first-child { opacity: .55; }
.recompense .coche { position: absolute; right: -9px; bottom: -6px; height: 20px; }

/* ---------- listes (invocation, boutique) ---------- */
.liste { margin: 8px 6px 0; overflow-y: auto; }
.carte-espece { display: flex; gap: 10px; align-items: center; padding: 8px; margin-bottom: 6px; background: #262048; border: 3px solid #150f26; box-shadow: inset 0 3px #342c5e, inset 0 -3px #1c1738; }
.carte-espece .vignette-espece { flex: none; width: 64px; height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.carte-espece .corps-carte { flex: 1; min-width: 0; }
.carte-espece .nom-espece { font-size: 21px; color: #fff3d8; display: flex; align-items: center; gap: 6px; }
.carte-espece .nom-espece img { height: 20px; }
.jauge-fragments { position: relative; height: 16px; margin-top: 4px; background: #150f26; border: 2px solid #150f26; }
.jauge-fragments i { display: block; height: 100%; background: #7fd6c6; }
.jauge-fragments.pleine i { background: #f2c14e; }
.jauge-fragments span { position: absolute; inset: 0; text-align: center; font: 400 14px/12px "Jersey 15", "Segoe UI", sans-serif; color: #fff3d8; text-shadow: 0 1px #0b0817; }
.actions-espece { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

/* ---------- fenêtres par-dessus l'écran ---------- */
.voile { position: absolute; inset: 0; z-index: 900; background: rgba(8, 5, 20, .72); display: flex; align-items: center; justify-content: center; }
.fenetre { width: 330px; background: #f3e2b8; color: #3a2204; border: 3px solid #150f26; box-shadow: inset 0 3px #fff8dc, inset 0 -3px #d6bb85, 0 6px rgba(8, 5, 20, .6); padding: 16px 16px 14px; text-align: center; animation: surgit .25s ease-out; }
@keyframes surgit { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fenetre h3 { margin: 0 0 8px; font: 400 28px/1 "Jersey 15", "Segoe UI", sans-serif; letter-spacing: .5px; }
.fenetre p { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.fenetre .gros { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; }
.fenetre .gros > img { height: 52px; }
.fenetre .gros .pixel { font-size: 40px; }
.fenetre .butin { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: flex-end; margin: 10px 0; }
.fenetre .butin .lot { display: inline-flex; align-items: flex-end; gap: 3px; }
.fenetre .butin .lot img.logo { height: 30px; }
.fenetre .butin .lot .pixel { font-size: 24px; padding-bottom: 2px; }
.fenetre .boutons { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.fenetre.fete { animation: fete 1s ease-out; }
@keyframes fete { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 55% { transform: scale(1.12) rotate(2deg); opacity: 1; } 75% { transform: scale(.97); } 100% { transform: scale(1); } }
.etoiles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.etoiles img { position: absolute; height: 28px; animation: tombe 2.4s linear infinite; }
@keyframes tombe { from { transform: translateY(-60px) rotate(0); opacity: 1; } to { transform: translateY(900px) rotate(360deg); opacity: .2; } }

/* ---------- guidage du début de partie ---------- */
.guide { position: absolute; z-index: 800; left: 20px; right: 20px; background: #f3e2b8; color: #3a2204; border: 3px solid #150f26; box-shadow: inset 0 3px #fff8dc, inset 0 -3px #d6bb85, 0 4px rgba(8, 5, 20, .55); padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.guide .boutons { display: flex; justify-content: flex-end; margin-top: 8px; }
.vise { animation: vise 1s ease-in-out infinite; }
@keyframes vise { 0%, 100% { filter: drop-shadow(0 0 0 #ffe27a); } 50% { filter: drop-shadow(0 0 8px #ffe27a) drop-shadow(0 0 3px #ffe27a); } }
