:root {
  --bois: #4a3020; --bois-clair: #7a5232; --parchemin: #f4e8cc; --parchemin-fonce: #e2cfa4;
  --encre: #2e2016; --or: #f2c14e; --pv: #d9483b; --xp: #8f6ad8; --energie: #3d8fd9; --pas: #4caf50;
  --ombre: 0 3px 0 rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #16210f;
  font-family: "Trebuchet MS", system-ui, sans-serif; color: var(--encre);
  -webkit-user-select: none; user-select: none; touch-action: none;
}
#jeu { position: fixed; inset: 0; }
#jeu canvas { display: block; }
[hidden] { display: none !important; }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.btn {
  font: inherit; font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 8px;
  border: 3px solid var(--bois); background: var(--parchemin); color: var(--encre); cursor: pointer; box-shadow: 0 3px 0 var(--bois);
}
.btn:hover { background: #fff7e2; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--bois); }
.btn.principal { background: var(--or); }
.btn.discret { background: transparent; color: var(--parchemin); border-color: rgba(244, 232, 204, .45); box-shadow: none; font-size: 13px; padding: 5px 10px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
kbd { font: 700 11px/1 "Trebuchet MS", sans-serif; background: rgba(0, 0, 0, .14); border-radius: 4px; padding: 2px 5px; margin-left: 2px; }

/* Exploration */
.colonne-gauche {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; width: 232px;
  display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 20px);
}
.carte-heros {
  background: var(--parchemin); border: 3px solid var(--bois); border-radius: 10px; padding: 8px 10px; box-shadow: var(--ombre);
}
.atelier-pret {
  display: block; width: 100%; margin-top: 6px; padding: 5px 6px; border-radius: 7px; border: 2px solid #c98a1a; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 800; color: var(--encre); background: linear-gradient(#fff1b8, #ffd86a);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 10px 2px rgba(242, 193, 78, .9); } }
.defis-mini {
  background: rgba(244, 232, 204, .96); border: 3px solid var(--bois); border-radius: 10px; box-shadow: var(--ombre);
  font-size: 13px; overflow: auto;
}
.defis-tete {
  display: flex; justify-content: space-between; width: 100%; padding: 6px 10px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 14px; color: var(--encre);
}
.defis-mini.replie .defis-liste { display: none; }
.defis-liste { padding: 0 10px 8px; }
.defi { padding: 5px 0; border-top: 2px dashed var(--parchemin-fonce); }
.defi.fait .defi-texte { color: #2f7d32; font-weight: 700; }
.defi .barre { height: 14px; margin: 3px 0 1px; }
.defi .barre span { line-height: 14px; font-size: 11px; }
.defi-recompense { font-size: 11px; color: #7a6448; }
.defi-coffre { margin-top: 4px; padding: 5px 6px; border-radius: 7px; background: #fff3cf; border: 2px dashed #e0a92b; font-size: 12px; }
.defi-coffre.ouvert { background: #e6f4dc; border-color: #6fae5a; }
.barre.objectif i { background: linear-gradient(#8fd0ff, #3d8fd9); }
.titre-heros { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 16px; }
.barre { position: relative; height: 18px; background: #3a2a1e; border-radius: 6px; overflow: hidden; margin-bottom: 5px; }
.barre i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transition: width .3s; }
.barre.pv i { background: linear-gradient(#f06a5a, var(--pv)); }
.barre.xp i { background: linear-gradient(#b192ef, var(--xp)); }
.barre span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 700; color: #fff; line-height: 18px; text-shadow: 0 1px 2px #000; }
.pieces { font-weight: 700; }
.boutons-haut { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; }

/* Fenêtres */
.fenetre {
  position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 20px)); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--parchemin); border: 4px solid var(--bois); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 0 0 3px var(--parchemin-fonce) inset;
}
.fenetre h2 { margin: 0 0 10px; font-size: 20px; }
.fenetre.petite { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(540px, calc(100vw - 20px)); font-size: 15px; }
.fenetre ul { margin: 8px 0; padding-left: 20px; line-height: 1.5; }
.fermer { position: absolute; top: 8px; right: 10px; padding: 3px 10px; }
.choix { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.choix.colonne { flex-direction: column; align-items: stretch; }
.aide { font-size: 14px; line-height: 1.6; }
.note { font-size: 13px; color: #7a6448; margin: 10px 0 0; }
.objet { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 2px dashed var(--parchemin-fonce); }
.objet img { width: 36px; height: 36px; }
.objet .emoji { width: 36px; text-align: center; font-size: 24px; }
.objet b { flex: 1; }
.vide { color: #7a6448; font-style: italic; }

#infobulle {
  position: fixed; z-index: 40; pointer-events: none; max-width: 270px;
  background: rgba(30, 20, 12, .95); color: #fff; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; line-height: 1.45; border: 1px solid rgba(255, 255, 255, .15);
}
#infobulle .titre { font-weight: 800; color: var(--or); margin-bottom: 2px; }
#infobulle .niv { color: #c9b48a; font-size: 12px; }
#infobulle .rouge { color: #ff8a7a; font-weight: 700; margin-top: 3px; }
#infobulle .indice { color: #9fe0a0; margin-top: 4px; font-style: italic; }
#message {
  position: fixed; z-index: 45; top: 92px; left: 50%; transform: translateX(-50%);
  background: rgba(30, 20, 12, .92); color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 700;
  opacity: 0; transition: opacity .25s; pointer-events: none; text-align: center; max-width: min(90vw, 520px);
}
#message.visible { opacity: 1; }
#fondu { position: fixed; inset: 0; z-index: 60; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fondu.actif { opacity: 1; pointer-events: auto; }
#erreur-chargement { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; color: #fff; font-size: 18px; text-align: center; }

/* Combat */
#timeline {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px; background: rgba(30, 20, 12, .75); border-radius: 10px; width: max-content;
}
.portrait { position: relative; width: 52px; height: 58px; background: var(--parchemin); border: 3px solid #b33a2e; border-radius: 8px; overflow: hidden; transition: transform .2s; }
.portrait.heros { border-color: #2f9d94; }
.portrait.actif { outline: 3px solid var(--or); outline-offset: 1px; transform: translateY(-3px); }
.portrait.mort { opacity: .3; filter: grayscale(1); }
.portrait img { width: 100%; height: 46px; object-fit: contain; display: block; }
.portrait .niv { position: absolute; top: 1px; right: 3px; font-size: 10px; font-weight: 800; }
.portrait .mini { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 5px; background: #3a2a1e; border-radius: 3px; overflow: hidden; }
.portrait .mini i { display: block; height: 100%; background: var(--pv); }
.portrait.heros .mini i { background: var(--pas); }
#bandeau-placement { bottom: 140px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#journal {
  position: absolute; left: 10px; bottom: 130px; width: 270px; max-height: 130px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none;
  font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
#barre-combat {
  position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap;
  width: max-content; max-width: calc(100vw - 20px);
  padding: 10px 14px; background: rgba(30, 20, 12, .9); border: 3px solid var(--bois-clair); border-radius: 12px; color: #fff;
}
.stats-tour { display: flex; flex-direction: column; gap: 3px; font-size: 14px; min-width: 92px; }
.stat.pv b { color: #ff8a7a; } .stat.energie b { color: #7cc0ff; } .stat.pas b { color: #8fe08f; }
#sorts { display: flex; gap: 8px; }
.sort { position: relative; width: 56px; height: 56px; padding: 0; border-radius: 10px; border: 3px solid var(--parchemin-fonce); background: #2a1d14; cursor: pointer; }
.sort img { width: 44px; height: 44px; display: block; margin: auto; }
.sort .cout { position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; line-height: 18px; text-align: center; border-radius: 50%; border: 2px solid #fff; background: var(--energie); color: #fff; font-size: 12px; font-weight: 800; }
.sort .touche {
  position: absolute; left: -7px; bottom: -7px; width: 20px; height: 20px; line-height: 16px; text-align: center;
  border-radius: 6px; border: 2px solid var(--bois); background: var(--parchemin); color: var(--encre); font-size: 12px; font-weight: 800;
}
.sort .rang { position: absolute; right: 1px; bottom: 0; font-size: 10px; color: var(--or); text-shadow: 0 1px 2px #000; letter-spacing: -1px; }
.badge-serie {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 12px; padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(#ffb347, #e8641f); color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); box-shadow: var(--ombre);
}
.serie { margin-top: 4px; font-size: 13px; font-weight: 700; color: #c4501a; }
.serie-gagnee { text-align: center; font-weight: 800; color: #c4501a; margin: -4px 0 8px; }
.barre.carac i { background: linear-gradient(#ffcf6a, #e89a1f); }
.barre.quota i { background: linear-gradient(#8fe08f, #3f9a43); }
.fenetre h3 { margin: 14px 0 4px; font-size: 16px; }
.prog { padding: 6px 0 8px; border-top: 2px dashed var(--parchemin-fonce); }
.prog-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.prog .note { margin: 2px 0 0; }
.etoiles { color: #d99a1a; letter-spacing: 1px; }
.butin .piece.rare { background: linear-gradient(#fff4c2, #ffe08a); border-color: #e0a92b; box-shadow: 0 0 8px rgba(242, 193, 78, .7); }
.sort.choisi { border-color: var(--or); box-shadow: 0 0 12px var(--or); }
.sort.indispo { filter: grayscale(.85) brightness(.6); }
.sort .voile { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 7px; background: rgba(0, 0, 0, .35); color: #fff; font-size: 18px; font-weight: 800; text-shadow: 0 1px 3px #000; }
.sort .voile small { font-size: 10px; }
.actions-combat { display: flex; flex-direction: column; gap: 6px; }

.resultat-titre { font-size: 26px; font-weight: 800; text-align: center; margin: 4px 0 10px; }
.resultat-titre.victoire { color: #2f7d32; }
.resultat-titre.defaite { color: #b33a2e; }
.ligne-resultat { display: flex; justify-content: space-between; padding: 6px 0; border-top: 2px dashed var(--parchemin-fonce); font-weight: 700; }
.butin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.butin .piece { display: flex; align-items: center; gap: 6px; background: #fff7e2; border: 2px solid var(--parchemin-fonce); border-radius: 8px; padding: 4px 8px; font-weight: 700; font-size: 14px; }
.butin img { width: 28px; height: 28px; }
.niveau-gagne { background: var(--or); border-radius: 8px; padding: 8px 10px; margin-top: 12px; font-weight: 800; text-align: center; }
.niveau-gagne small { font-weight: 600; }
.defi-gagne, .coffre-gagne, .atelier-gagne { border-radius: 8px; padding: 7px 10px; margin: 6px 0; font-weight: 800; }
.defi-gagne { background: #dcefff; border: 2px solid #3d8fd9; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.defi-gagne span { font-weight: 700; color: #1f5f99; }
.coffre-gagne { background: linear-gradient(#fff4c2, #ffd86a); border: 2px solid #e0a92b; text-align: center; box-shadow: 0 0 12px rgba(242, 193, 78, .8); }
.coffre-gagne img { width: 28px; height: 28px; vertical-align: middle; }
.atelier-gagne { background: #f3e2c4; border: 2px dashed var(--bois-clair); margin-top: 12px; }

/* Atelier */
.fenetre.large { width: min(600px, calc(100vw - 20px)); }
.atelier-tete { display: flex; gap: 12px; align-items: center; padding-bottom: 6px; }
.atelier-tete .note { margin-top: 3px; }
.apercu-heros { width: 64px; height: 96px; flex: none; background: radial-gradient(#fff7e2, #e2cfa4); border: 2px solid var(--parchemin-fonce); border-radius: 10px; }
.recette { display: flex; gap: 10px; align-items: center; padding: 7px 6px; border-top: 2px dashed var(--parchemin-fonce); border-radius: 6px; }
.recette.doree { background: linear-gradient(90deg, rgba(255, 224, 138, .35), transparent); }
.recette.porte { background: rgba(76, 175, 80, .14); }
.recette.nouveau { animation: eclat-recette 1.2s ease-out; }
@keyframes eclat-recette { from { background: rgba(255, 216, 106, .95); box-shadow: 0 0 16px #f2c14e; } }
.icone-eq { width: 40px; height: 40px; flex: none; }
.recette-corps { flex: 1; min-width: 0; }
.recette .bonus { font-size: 13px; color: #2f6b34; font-weight: 700; }
.porte-badge { font-size: 11px; background: #4caf50; color: #fff; border-radius: 999px; padding: 1px 7px; vertical-align: 2px; }
.ingrs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.ingr { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; padding: 1px 5px 1px 2px; border-radius: 6px; background: #f7e0dc; color: #8a2a20; }
.ingr.ok { background: #e1f1d8; color: #2f6b34; }
.ingr.rare { box-shadow: 0 0 0 2px #e0a92b inset; }
.ingr img { width: 20px; height: 20px; }
.btn.petit { font-size: 13px; padding: 5px 10px; flex: none; }
.btn.discret-clair { background: transparent; box-shadow: none; border-color: var(--parchemin-fonce); color: #7a6448; }
.portes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-bottom: 6px; }
.portes img { width: 34px; height: 34px; }
.portes .note { margin: 0 0 0 6px; flex: 1; }
.talent { font-size: 13px; margin-top: 4px; color: #8a7458; }
.talent.acquis { color: var(--encre); background: #fff3cf; border-radius: 6px; padding: 3px 6px; }
#infobulle .res { color: #9fd0ff; font-weight: 700; margin-top: 3px; }
#infobulle .dore { color: #ffd34d; font-weight: 700; margin-top: 3px; }
.portrait.champion { border-color: #e0a92b; box-shadow: 0 0 10px rgba(242, 193, 78, .9); background: #fff4c2; }
.stat.bonus { font-size: 12px; color: #ffd98a; }

@media (max-width: 700px) {
  .colonne-gauche { width: 175px; }
  .carte-heros { font-size: 13px; padding: 6px 8px; }
  .titre-heros { font-size: 14px; }
  .boutons-haut { flex-direction: column; }
  .boutons-haut .lib, .boutons-haut kbd { display: none; }
  .defis-mini { font-size: 12px; }
  #b-sac kbd, #barre-combat kbd, #bandeau-placement kbd { display: none; }
  #journal { display: none; }
  #barre-combat { gap: 8px 10px; padding: 8px; }
  .stats-tour { flex-direction: row; justify-content: center; gap: 12px; width: 100%; min-width: 0; }
  .sort { width: 46px; height: 46px; }
  .sort img { width: 36px; height: 36px; }
  .btn { font-size: 14px; padding: 6px 10px; }
  .portrait { width: 42px; height: 48px; }
  .portrait img { height: 36px; }
  #bandeau-placement { top: calc(max(10px, env(safe-area-inset-top)) + 64px); bottom: auto; flex-wrap: wrap; }
}

/* ---------- Mode nuit « Lucioles » : verre sombre, bords turquoise, titres gravés ---------- */
body.nuit {
  --bois: #26305e; --bois-clair: #3c4b86; --parchemin: #141b3a; --parchemin-fonce: #2a3566;
  --encre: #dce7ff; --or: #ffd27a; --pv: #ff6b9a; --lueur: rgba(127, 247, 225, .38);
  background: #0a0f24;
}
body.nuit .fenetre h2, body.nuit .fenetre h3, body.nuit .titre-heros b, body.nuit .resultat-titre,
body.nuit .btn { font-family: Cinzel, Georgia, serif; letter-spacing: .02em; }
body.nuit .btn { border: 2px solid var(--lueur); box-shadow: 0 0 12px rgba(127, 247, 225, .14), 0 3px 0 #070b1c; }
body.nuit .btn:hover { background: #1d2650; }
body.nuit .btn:active { box-shadow: 0 1px 0 #070b1c; }
body.nuit .btn.principal { background: linear-gradient(#ffe39c, #e7a94c); color: #1a1430; border-color: #ffd27a; box-shadow: 0 0 14px rgba(255, 210, 122, .45), 0 3px 0 #6b4a17; }
body.nuit .btn.discret { color: var(--encre); border-color: rgba(127, 247, 225, .3); box-shadow: none; }
body.nuit kbd { background: rgba(127, 247, 225, .12); color: #a9fff0; }
body.nuit .carte-heros, body.nuit .defis-mini, body.nuit .fenetre {
  background: rgba(16, 22, 50, .95); border: 2px solid var(--lueur);
  box-shadow: 0 0 22px rgba(127, 247, 225, .12), 0 8px 24px rgba(0, 0, 0, .5);
}
body.nuit .fenetre { box-shadow: 0 0 0 1px rgba(127, 247, 225, .15) inset, 0 0 30px rgba(127, 247, 225, .14), 0 10px 30px rgba(0, 0, 0, .6); }
body.nuit .barre { background: #070b1c; box-shadow: 0 0 0 1px rgba(127, 247, 225, .2) inset; }
body.nuit .barre.pv i { background: linear-gradient(90deg, #ff6b9a, #ffb36b); box-shadow: 0 0 8px #ff6b9a; }
body.nuit .barre.xp i { background: linear-gradient(90deg, #8a5ad6, #c69cff); }
body.nuit .barre.objectif i { background: linear-gradient(90deg, #3fd6c0, #8ffcea); }
body.nuit .note, body.nuit .vide, body.nuit .defi-recompense, body.nuit .talent, body.nuit .btn.discret-clair { color: #8f9cc4; }
body.nuit .defi.fait .defi-texte, body.nuit .resultat-titre.victoire { color: #7ff7a8; }
body.nuit .resultat-titre.defaite { color: #ff7a8a; }
body.nuit .defi-coffre { background: rgba(255, 210, 122, .08); border-color: #e0b65a; }
body.nuit .defi-coffre.ouvert { background: rgba(127, 247, 168, .08); border-color: #5fc48a; }
body.nuit #infobulle, body.nuit #message { background: rgba(8, 12, 32, .95); border: 1px solid rgba(127, 247, 225, .3); }
body.nuit #infobulle .niv { color: #9fb0d8; }
body.nuit #timeline { background: rgba(8, 12, 32, .78); box-shadow: 0 0 0 1px rgba(127, 247, 225, .2); }
body.nuit .portrait { background: #1a2347; }
body.nuit .portrait.heros { border-color: #7ff7e1; }
body.nuit .portrait.champion { background: #3a3120; }
body.nuit .portrait .mini { background: #070b1c; }
body.nuit #barre-combat { background: rgba(10, 15, 36, .92); border: 2px solid var(--lueur); box-shadow: 0 0 22px rgba(127, 247, 225, .16); }
body.nuit .sort { background: #0d1330; border-color: rgba(127, 247, 225, .35); box-shadow: inset 0 0 10px rgba(127, 247, 225, .1); }
body.nuit .sort.choisi { border-color: var(--or); box-shadow: 0 0 14px var(--or); }
body.nuit .sort .touche { background: #141b3a; color: #7ff7e1; border-color: rgba(127, 247, 225, .55); }
body.nuit .sort .cout { border-color: #dce7ff; }
body.nuit .serie, body.nuit .serie-gagnee { color: #ffa65c; }
body.nuit .etoiles { color: #ffd27a; }
body.nuit .butin .piece { background: #1d2650; border-color: #2f3c74; }
body.nuit .butin .piece.rare { background: rgba(255, 210, 122, .16); border-color: #e0b65a; box-shadow: 0 0 12px rgba(255, 210, 122, .6); }
body.nuit .niveau-gagne { color: #1a1430; box-shadow: 0 0 16px rgba(255, 210, 122, .5); }
body.nuit .defi-gagne { background: rgba(61, 143, 217, .16); border-color: #5aa8f0; }
body.nuit .defi-gagne span { color: #9cc8ff; }
body.nuit .coffre-gagne { color: #2a1d08; }
body.nuit .atelier-gagne { background: rgba(255, 255, 255, .05); }
body.nuit .apercu-heros { background: radial-gradient(#2a3566, #141b3a); }
body.nuit .recette.porte { background: rgba(127, 247, 168, .1); }
body.nuit .recette .bonus { color: #8fe0a0; }
body.nuit .ingr { background: rgba(255, 107, 154, .14); color: #ff9ab4; }
body.nuit .ingr.ok { background: rgba(127, 247, 168, .12); color: #9ff0b8; }
body.nuit .talent.acquis { background: rgba(255, 210, 122, .12); color: var(--encre); }

/* Fin de combat réduite en bandeau (bouton ▾ Réduire ou Échap) */
#fenetre-resultat .res-compact { display: none; }
#fenetre-resultat.reduite .res-complet { display: none; }
#fenetre-resultat.reduite .res-compact { display: block; }
#fenetre-resultat.reduite {
  top: auto; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(780px, calc(100vw - 20px)); max-height: 46vh; padding: 10px 14px;
}
#fenetre-resultat.reduite .choix { margin-top: 8px; }
#fenetre-resultat [data-reduire] { margin-right: auto; }
.res-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 700; font-size: 15px; }
.res-titre { font-size: 19px; color: #2f7d32; }
.res-butin { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mini-objet { display: inline-flex; align-items: center; gap: 1px; font-size: 13px; }
.mini-objet img { width: 26px; height: 26px; }
.mini-objet.rare img { filter: drop-shadow(0 0 4px #f2c14e); }
.res-faits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.res-fait { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fff3cf; border: 1px solid #e0a92b; }
body.nuit .res-titre { color: #7ff7a8; font-family: Cinzel, Georgia, serif; }
body.nuit .res-fait { background: rgba(255, 210, 122, .12); border-color: #e0b65a; color: #ffe7b0; }
@media (max-width: 700px) { .res-ligne { font-size: 14px; gap: 4px 10px; } .res-titre { font-size: 17px; width: 100%; } }

/* Atelier : rang, étoiles, fusion, ambre */
.rang { font-size: 11px; font-weight: 800; color: #8a7458; border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; vertical-align: 2px; }
.atelier-regles { font-size: 12.5px; display: grid; gap: 5px; padding: 7px 9px; margin: 2px 0 6px; border-radius: 8px; background: rgba(0, 0, 0, .05); line-height: 1.45; }
.atelier-regles label { display: flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.atelier-regles label.vide { opacity: .6; cursor: default; }
.atelier-regles img { width: 22px; height: 22px; flex: none; }
.exemplaires { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.exemplaires .note { margin: 0 0 0 2px; }
.ex { font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #fff3cf; color: #b07a10; }
.ex.porte { background: #4caf50; color: #fff; }
.ex.et-3, .ex.et-4 { color: #d9641e; }
.ex.et-5, .ex.et-6 { color: #b3309a; box-shadow: 0 0 6px rgba(214, 80, 200, .55); }
.ex.porte.et-3, .ex.porte.et-4, .ex.porte.et-5, .ex.porte.et-6 { color: #fff; }
.boutons-recette { display: flex; flex-direction: column; gap: 5px; align-items: stretch; flex: none; max-width: 46%; }
.boutons-recette .btn { white-space: nowrap; }
.btn.fusion { background: linear-gradient(#ffd79a, #f39a4a); }
body.nuit .rang { color: #8f9cc4; }
body.nuit .atelier-regles { background: rgba(127, 247, 225, .06); }
body.nuit .ex { background: rgba(255, 210, 122, .12); color: #ffd27a; }
body.nuit .ex.porte { background: #2f8f5a; color: #eafff2; }
body.nuit .ex.et-3, body.nuit .ex.et-4 { color: #ffa65c; }
body.nuit .ex.et-5, body.nuit .ex.et-6 { color: #ff8ae0; }
body.nuit .btn.fusion { background: linear-gradient(#ffb36b, #e0703a); color: #1a1430; border-color: #ffb36b; }
@media (max-width: 560px) { .recette { flex-wrap: wrap; } .boutons-recette { max-width: none; width: 100%; flex-direction: row; flex-wrap: wrap; } }

/* Boss */
.boss-mini {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 6px 10px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13px; color: #fff; border-radius: 10px; border: 2px solid #ff4d6d;
  background: linear-gradient(#7a1630, #4a0c1e); box-shadow: 0 0 14px rgba(255, 77, 109, .6); animation: pulse-boss 1.6s ease-in-out infinite;
}
.boss-mini b { font-size: 14px; }
.boss-mini span { font-size: 12px; opacity: .9; font-variant-numeric: tabular-nums; }
@keyframes pulse-boss { 50% { box-shadow: 0 0 22px rgba(255, 77, 109, .95); } }
#infobulle .boss { color: #ff8a9e; font-weight: 800; margin-top: 3px; }
.portrait.boss { border-color: #ff4d6d; box-shadow: 0 0 12px rgba(255, 77, 109, .9); background: #ffe3e8; }
body.nuit .portrait.boss { background: #3a1422; }
body.nuit .boss-mini b { font-family: Cinzel, Georgia, serif; }

/* Difficulté */
.chip-difficulte { display: block; margin-top: 5px; font: inherit; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; cursor: pointer;
  border: 1px solid var(--parchemin-fonce); background: transparent; color: var(--encre); }
.chip-difficulte.dure { border-color: #e8641f; color: #c4501a; box-shadow: 0 0 8px rgba(232, 100, 31, .35); }
.choix-difficulte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0; }
.btn.diff { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; font-size: 14px; }
.btn.diff small { font: 600 11.5px/1.35 "Trebuchet MS", system-ui, sans-serif; opacity: .85; }
body.nuit .chip-difficulte { border-color: rgba(127, 247, 225, .35); }
body.nuit .chip-difficulte.dure { border-color: #ffa65c; color: #ffa65c; }
@media (max-width: 480px) { .choix-difficulte { grid-template-columns: 1fr; } }
/* Défis : onglets Jour / Semaine / Mois */
.defis-onglets { display: flex; gap: 4px; margin: 2px 0 4px; }
.defis-onglets button { flex: 1; font: inherit; font-size: 11.5px; font-weight: 800; padding: 3px 4px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--parchemin-fonce); background: transparent; color: var(--encre); }
.defis-onglets button.actif { background: var(--or); color: #2a1d08; border-color: var(--or); }
.defis-tete span { font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.nuit .defis-onglets button { border-color: rgba(127, 247, 225, .3); }

/* Défis : discrets par défaut (repliés, transparents), dépliés au clic ou au toucher */
.defis-mini { background: rgba(244, 232, 204, .8); border-color: rgba(74, 48, 32, .5); box-shadow: none; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); transition: background .2s, border-color .2s; }
.defis-mini.replie { background: rgba(244, 232, 204, .3); border-color: rgba(74, 48, 32, .25); }
.defis-mini.replie .defis-tete { text-shadow: 0 0 4px rgba(255, 255, 255, .8); }
body.nuit .defis-mini { background: rgba(16, 22, 50, .8); border-color: rgba(127, 247, 225, .3); box-shadow: none; }
body.nuit .defis-mini.replie { background: rgba(16, 22, 50, .3); border-color: rgba(127, 247, 225, .15); }
body.nuit .defis-mini.replie .defis-tete { text-shadow: 0 1px 3px #000; }
.mini-objet.equip { color: #ffd34d; font-weight: 800; }
.mini-objet.equip img { width: 30px; height: 30px; filter: drop-shadow(0 0 5px #ffd34d); }
.fusion-info { font-size: 12.5px; line-height: 1.4; margin-top: 5px; padding: 5px 8px; border-radius: 7px; background: rgba(243, 154, 74, .16); border: 1px dashed #f39a4a; }
.fusion-info.attente { background: transparent; border-color: rgba(138, 116, 88, .5); opacity: .85; }
body.nuit .fusion-info { background: rgba(255, 166, 92, .12); border-color: rgba(255, 166, 92, .6); }
body.nuit .fusion-info.attente { background: transparent; border-color: rgba(143, 156, 196, .4); }
.boutons-recette .btn.fusion { white-space: normal; text-align: left; }

/* Atelier : filtre et épinglage */
.filtres-atelier { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 4px; }
.filtres-atelier button { font: inherit; font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--parchemin-fonce); background: transparent; color: var(--encre); }
.filtres-atelier button.actif { background: var(--or); color: #2a1d08; border-color: var(--or); }
.btn-epingle { border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 0 2px; opacity: .35; filter: grayscale(1); vertical-align: 1px; }
.btn-epingle:hover, .btn-epingle.actif { opacity: 1; filter: none; }
.recette.epinglee { box-shadow: inset 0 0 0 2px rgba(242, 193, 78, .55); }
/* Raccourcis des recettes épinglées, sous la fiche du héros */
.epingles { background: rgba(244, 232, 204, .85); border: 2px solid rgba(74, 48, 32, .5); border-radius: 10px; padding: 5px 7px; font-size: 12px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; gap: 5px; }
.ep-tete { font-weight: 800; font-size: 12.5px; }
.ep-ligne { display: flex; align-items: center; gap: 6px; }
.ep-icone { width: 30px; height: 30px; flex: none; }
.ep-corps { flex: 1; min-width: 0; line-height: 1.25; }
.ep-corps b { font-size: 12px; }
.ep-a { font-size: 10.5px; opacity: .8; }
.ep-ingr { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; font-size: 10.5px; font-weight: 700; }
.ep-ingr span { display: inline-flex; align-items: center; gap: 1px; }
.ep-ingr img { width: 15px; height: 15px; }
.ep-ingr .manque { color: #b33a2e; }
.ep-boutons { display: flex; gap: 3px; flex: none; align-items: center; }
.ep-boutons .btn.petit { padding: 3px 6px; font-size: 12px; }
.ep-retirer { border: 0; background: transparent; cursor: pointer; font-size: 11px; opacity: .55; color: var(--encre); padding: 0 2px; }
body.nuit .epingles { background: rgba(16, 22, 50, .8); border-color: rgba(127, 247, 225, .3); }
body.nuit .ep-ingr .manque { color: #ff8a9e; }
body.nuit .btn-epingle { filter: grayscale(1) brightness(1.4); }
body.nuit .btn-epingle.actif { filter: none; }
@media (max-width: 700px) { .ep-ingr, .ep-a { display: none; } .ep-icone { width: 24px; height: 24px; } }

/* Larme d'ambre : interrupteur bien visible */
.ambre-bascule { display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0 8px; padding: 8px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  font: inherit; color: var(--encre); border: 2px dashed #d9a441; background: rgba(255, 216, 106, .12); }
.ambre-bascule img { width: 34px; height: 34px; flex: none; }
.ambre-bascule span { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ambre-bascule small { font-size: 12px; opacity: .85; }
.ambre-bascule .interrupteur { flex: none; font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .25); color: #fff; }
.ambre-bascule.actif { border-style: solid; border-color: #ffd34d; background: linear-gradient(90deg, rgba(255, 211, 77, .35), rgba(255, 160, 60, .18)); box-shadow: 0 0 16px rgba(255, 211, 77, .55); animation: pulse 1.6s ease-in-out infinite; }
.ambre-bascule.actif .interrupteur { background: #2f8f5a; }
.ambre-bascule.vide { opacity: .6; cursor: default; }
.ep-ambre { margin-left: 4px; font: inherit; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; cursor: pointer; border: 1px solid #d9a441; background: transparent; color: var(--encre); }
.ep-ambre.actif { background: #ffd34d; color: #2a1d08; box-shadow: 0 0 8px rgba(255, 211, 77, .6); }
.ep-ambre:disabled { opacity: .5; cursor: default; }
/* Enchantement */
.enchant-info { font-size: 12.5px; margin-top: 4px; padding: 4px 8px; border-radius: 7px; background: rgba(176, 120, 255, .14); border: 1px solid rgba(176, 120, 255, .5); }
.enchant-info.vide { background: transparent; border-style: dashed; opacity: .8; }
.btn.enchant { background: linear-gradient(#d9c2ff, #a77ef0); }
.marque-epingle { font-size: 14px; vertical-align: 1px; }
body.nuit .enchant-info { background: rgba(176, 120, 255, .16); border-color: rgba(196, 156, 255, .55); }
body.nuit .btn.enchant { background: linear-gradient(#b48cff, #7d4fd6); color: #fff; border-color: #c4a2ff; }
body.nuit .ambre-bascule { color: var(--encre); }

/* « ? » d'aide */
.aide-q { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin-left: 4px; border-radius: 50%; cursor: help; vertical-align: 1px;
  font: 800 11px/1 "Trebuchet MS", sans-serif; color: var(--encre); background: rgba(0, 0, 0, .08); border: 1px solid currentColor; opacity: .7; }
.aide-q:hover { opacity: 1; }
body.nuit .aide-q { background: rgba(127, 247, 225, .1); color: #a9fff0; }
.fusion-mini, .enchant-mini { font-size: 12.5px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 2px; }
.fusion-mini { color: #c4501a; } .fusion-mini.attente { color: inherit; opacity: .7; font-weight: 600; }
.enchant-mini { color: #7d4fd6; }
body.nuit .fusion-mini { color: #ffa65c; } body.nuit .fusion-mini.attente { color: inherit; } body.nuit .enchant-mini { color: #c9b6ff; }
.ambre-bascule { width: auto; display: inline-flex; padding: 4px 10px; margin: 0 0 6px; }
.ambre-bascule img { width: 26px; height: 26px; }
/* Carte du personnage */
.perso-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.perso-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-weight: 700; font-size: 14px; }
.perso-equip { display: flex; gap: 6px; flex-wrap: wrap; }
.perso-slot { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--parchemin-fonce); background: rgba(0, 0, 0, .05); font-size: 22px; }
.perso-slot img { width: 40px; height: 40px; }
.perso-slot.vide { opacity: .45; }
.perso-slot .et { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: 800; color: #b07a10; }
.perso-slot .ench { position: absolute; left: 1px; top: -3px; font-size: 13px; }
.perso-barre { display: flex; gap: 6px; margin: 4px 0 8px; }
.perso-case { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 10px; border: 2px solid var(--or); background: #2a1d14; cursor: pointer; display: grid; place-items: center; }
.perso-case img { width: 42px; height: 42px; }
.perso-case.vide { border-style: dashed; border-color: var(--parchemin-fonce); background: transparent; cursor: default; }
.perso-case .touche { position: absolute; left: -6px; bottom: -6px; width: 18px; height: 18px; line-height: 15px; text-align: center; border-radius: 5px; font-size: 11px; font-weight: 800; background: var(--parchemin); color: var(--encre); border: 2px solid var(--bois); }
.perso-sorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.perso-sort { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; text-align: left;
  border: 2px solid var(--parchemin-fonce); background: transparent; color: var(--encre); }
.perso-sort img { width: 32px; height: 32px; flex: none; }
.perso-sort.dans { border-color: var(--or); background: rgba(242, 193, 78, .18); }
.perso-sort.verrou { opacity: .45; cursor: not-allowed; }
body.nuit .perso-case { background: #0d1330; }
body.nuit .perso-case .touche { background: #141b3a; color: #7ff7e1; border-color: rgba(127, 247, 225, .55); }
body.nuit .perso-slot { border-color: rgba(127, 247, 225, .3); background: rgba(127, 247, 225, .05); }

/* Voies */
.voie-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; vertical-align: 2px; color: #fff; }
.voie-lame { background: #6b7280; } .voie-sangsue { background: #a3243a; } .voie-archer { background: #3f8f3a; } .voie-tempete { background: #3d6fd9; }
.perso-voies { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.filtres-atelier button { font-size: 12px; padding: 3px 8px; }

/* Atelier allégé : une ligne par recette ou par objet */
.atelier-barre { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-weight: 700; margin: -2px 0 6px; }
.atelier-barre .ambre-bascule { margin: 0; }
.onglets-atelier { display: flex; gap: 6px; margin-bottom: 6px; }
.onglets-atelier button { flex: 1; font: inherit; font-weight: 800; font-size: 14px; padding: 6px; border-radius: 8px; cursor: pointer; border: 2px solid var(--parchemin-fonce); background: transparent; color: var(--encre); }
.onglets-atelier button.actif { background: var(--or); color: #2a1d08; border-color: var(--or); }
#atelier-contenu .ligne { display: flex; align-items: center; gap: 6px; padding: 4px 4px; border-top: 1px solid rgba(0, 0, 0, .08); min-height: 40px; }
#atelier-contenu .ligne.porte { background: rgba(76, 175, 80, .12); border-radius: 6px; }
#atelier-contenu .ligne.epinglee { background: rgba(242, 193, 78, .12); border-radius: 6px; }
#atelier-contenu .ligne .ico { width: 30px; height: 30px; flex: none; }
#atelier-contenu .ligne .nom { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
#atelier-contenu .ligne .nb { font-size: 11px; opacity: .7; }
#atelier-contenu .ligne .et { font-size: 12px; color: #b07a10; letter-spacing: -1px; white-space: nowrap; }
#atelier-contenu .ligne .et-3, #atelier-contenu .ligne .et-4 { color: #d9641e; } #atelier-contenu .ligne .et-5, #atelier-contenu .ligne .et-6 { color: #b3309a; }
#atelier-contenu .ligne .effet { font-size: 12px; font-weight: 700; color: #7d4fd6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
#atelier-contenu .ligne .ingr-mini { display: flex; gap: 4px; font-size: 11px; font-weight: 700; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
#atelier-contenu .ligne .ingr-mini span { display: inline-flex; align-items: center; } #atelier-contenu .ligne .ingr-mini img { width: 15px; height: 15px; }
#atelier-contenu .ligne .ingr-mini .manque { color: #b33a2e; }
#atelier-contenu .ligne .actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
#atelier-contenu .ligne .btn.petit { padding: 3px 7px; font-size: 12px; }
#atelier-contenu .mini { border: 0; background: transparent; cursor: pointer; font-size: 14px; opacity: .3; filter: grayscale(1); padding: 0 2px; }
#atelier-contenu .mini.actif, #atelier-contenu .mini:hover { opacity: 1; filter: none; }
.voie-pastille { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 11px; flex: none; background: rgba(0, 0, 0, .1); }
.voie-pastille.voie-lame { background: #6b7280; } .voie-pastille.voie-sangsue { background: #a3243a; } .voie-pastille.voie-archer { background: #3f8f3a; } .voie-pastille.voie-tempete { background: #3d6fd9; }
body.nuit #atelier-contenu .ligne { border-top-color: rgba(127, 247, 225, .1); }
body.nuit #atelier-contenu .ligne .effet { color: #c9b6ff; } body.nuit #atelier-contenu .ligne .et { color: #ffd27a; }
body.nuit #atelier-contenu .ligne .ingr-mini .manque { color: #ff8a9e; }
@media (max-width: 560px) { #atelier-contenu .ligne { flex-wrap: wrap; } #atelier-contenu .ligne .actions { margin-left: 36px; } }
#liste-equipement .ligne, #sac-contenu .ligne { display: flex; align-items: center; gap: 6px; padding: 4px; border-top: 1px solid rgba(0, 0, 0, .08); min-height: 40px; }
#sac-contenu .ligne.porte { background: rgba(76, 175, 80, .12); border-radius: 6px; }
#sac-contenu .ligne .ico { width: 30px; height: 30px; flex: none; }
#sac-contenu .ligne .nom { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#sac-contenu .ligne .et { font-size: 12px; color: #b07a10; white-space: nowrap; }
#sac-contenu .ligne .effet { font-size: 12px; font-weight: 700; color: #7d4fd6; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sac-contenu .ligne .actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
#sac-contenu .ligne .btn.petit { padding: 3px 8px; font-size: 12px; }
#fenetre-sac { width: min(560px, calc(100vw - 20px)); }
body.nuit #sac-contenu .ligne .effet { color: #c9b6ff; } body.nuit #sac-contenu .ligne .et { color: #ffd27a; }

/* Lignes dépliables et filtres groupés */
#atelier-contenu .ligne[data-detail], #sac-contenu .ligne[data-detail] { cursor: pointer; }
#atelier-contenu .ligne.ouverte, #sac-contenu .ligne.ouverte { background: rgba(242, 193, 78, .14); border-radius: 6px 6px 0 0; }
.ligne-detail { font-size: 12.5px; line-height: 1.5; padding: 5px 10px 7px 44px; margin-bottom: 2px; border-radius: 0 0 6px 6px; background: rgba(242, 193, 78, .1); }
body.nuit .ligne-detail { background: rgba(127, 247, 225, .07); }
body.nuit #atelier-contenu .ligne.ouverte, body.nuit #sac-contenu .ligne.ouverte { background: rgba(127, 247, 225, .1); }
.sep-filtre { width: 1px; align-self: stretch; margin: 2px 3px; background: var(--parchemin-fonce); }
body.nuit .sep-filtre { background: rgba(127, 247, 225, .3); }

/* Titres de famille (voies) dans l'atelier et le sac */
.famille { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; padding: 2px 4px 3px; font-size: 13px; border-bottom: 2px solid var(--parchemin-fonce); }
.famille:first-of-type { margin-top: 4px; }
.famille span { font-size: 12px; opacity: .75; }
.famille .pano { margin-left: auto; opacity: 1; font-weight: 800; }
.famille-lame { border-color: #6b7280; } .famille-sangsue { border-color: #a3243a; } .famille-archer { border-color: #3f8f3a; } .famille-tempete { border-color: #3d6fd9; }
body.nuit .famille { border-color: rgba(127, 247, 225, .25); }
body.nuit .famille-lame { border-color: #9aa3b0; } body.nuit .famille-sangsue { border-color: #e2546a; } body.nuit .famille-archer { border-color: #6cc792; } body.nuit .famille-tempete { border-color: #7aa6ff; }

/* Coffres : rangés dans le sac, ouverture animée */
.badge-coffre { margin-left: 4px; font-size: 12px; font-weight: 800; padding: 0 6px; border-radius: 999px; background: #ffd34d; color: #2a1d08; animation: pulse 1.4s ease-in-out infinite; }
.coffres-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 4px; }
.coffre-case { display: grid; justify-items: center; gap: 4px; padding: 8px; border-radius: 12px; border: 2px solid var(--parchemin-fonce); font-size: 13px; text-align: center; }
.coffre-case img { width: 72px; height: 72px; }
.coffre-semaine { border-color: #7ff7e1; box-shadow: 0 0 10px rgba(127, 247, 225, .35); }
.coffre-mois { border-color: #ffd34d; box-shadow: 0 0 16px rgba(255, 211, 77, .6); animation: pulse 1.6s ease-in-out infinite; }
#ouverture-coffre { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
#ouverture-coffre[hidden] { display: none; }
.oc-fond { position: absolute; inset: 0; background: rgba(5, 8, 20, .85); }
.oc-scene { position: relative; display: grid; justify-items: center; gap: 12px; padding: 20px; max-width: 94vw; }
.oc-titre { position: relative; font-family: Cinzel, Georgia, serif; font-size: 26px; font-weight: 700; color: #ffd27a; text-shadow: 0 0 14px rgba(255, 210, 122, .8); }
.oc-coffre { position: relative; width: 200px; height: 200px; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .6)); }
.oc-coffre.tremble { animation: oc-tremble .11s infinite; }
.oc-mois .oc-coffre.tremble { animation-duration: .08s; }
@keyframes oc-tremble { 0% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.05); } 100% { transform: rotate(-4deg) scale(1); } }
.oc-coffre.ouvert { animation: oc-pop .55s ease-out; }
@keyframes oc-pop { 0% { transform: scale(.8); filter: brightness(2.4); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.oc-rayons { position: absolute; left: 50%; top: 150px; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 230, 150, .32) 0 9deg, transparent 9deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 68%); mask: radial-gradient(circle, #000 15%, transparent 68%); transition: opacity .3s; }
.oc-scene.ouvert .oc-rayons { opacity: 1; animation: oc-tourne 9s linear infinite; }
.oc-semaine .oc-rayons { background: repeating-conic-gradient(rgba(127, 247, 225, .32) 0 9deg, transparent 9deg 22deg); }
.oc-mois .oc-rayons { background: repeating-conic-gradient(rgba(255, 211, 77, .45) 0 8deg, rgba(255, 107, 154, .25) 8deg 13deg, transparent 13deg 20deg); width: 720px; height: 720px; margin: -360px 0 0 -360px; }
@keyframes oc-tourne { to { transform: rotate(360deg); } }
.oc-contenu { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: min(600px, 92vw); min-height: 76px; }
.oc-objet { display: grid; justify-items: center; gap: 3px; min-width: 90px; padding: 7px 9px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 12px; text-align: center;
  background: rgba(20, 27, 58, .92); border: 2px solid rgba(127, 247, 225, .45); animation: oc-apparait .45s ease-out both; }
.oc-objet.rare { border-color: #ffd34d; box-shadow: 0 0 14px rgba(255, 211, 77, .7); }
.oc-objet img { width: 42px; height: 42px; } .oc-emoji { font-size: 30px; line-height: 42px; }
@keyframes oc-apparait { from { transform: scale(.3) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.oc-ok { position: relative; }
.oc-confetti { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; animation: oc-tombe 2s ease-in forwards; pointer-events: none; }
@keyframes oc-tombe { to { top: 105%; opacity: 0; transform: rotate(540deg); } }
.perso-sort .valeur { display: block; font-size: 12px; color: #c4501a; font-weight: 800; }
body.nuit .perso-sort .valeur { color: #ffa65c; }
.coffre-gagne img { width: 32px; height: 32px; vertical-align: middle; }

/* Atelier + inventaire côte à côte */
#fenetre-atelier { width: min(1040px, calc(100vw - 20px)); }
.atelier-grille { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.atelier-inv { border: 2px solid var(--parchemin-fonce); border-radius: 10px; padding: 6px 8px; position: sticky; top: 0; max-height: calc(100vh - 120px); overflow: auto; }
.inv-titre { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
body.nuit .atelier-inv { border-color: rgba(127, 247, 225, .3); background: rgba(127, 247, 225, .03); }
@media (max-width: 820px) { .atelier-grille { grid-template-columns: 1fr; } .atelier-inv { position: static; max-height: none; } }
.ico-or { font-size: 20px; }
/* Fabrication à plusieurs étoiles : ça brille */
#eclat-craft { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 85; cursor: pointer; }
#eclat-craft[hidden] { display: none; }
.ec-carte { position: relative; display: grid; justify-items: center; gap: 4px; padding: 18px 28px; border-radius: 16px; color: #fff; text-align: center;
  background: rgba(16, 22, 50, .96); border: 3px solid #ffd34d; box-shadow: 0 0 40px rgba(255, 211, 77, .75); animation: ec-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.ec-carte b { font-size: 16px; } .ec-carte small { font-size: 13px; color: #c9b6ff; font-weight: 700; }
.ec-carte img { width: 76px; height: 76px; animation: ec-brille .7s ease-in-out infinite alternate; }
.ec-4, .ec-5 { border-color: #ff8ae0; box-shadow: 0 0 50px rgba(255, 138, 224, .8); }
.ec-rayons { position: absolute; inset: -70px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 230, 150, .35) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); animation: oc-tourne 6s linear infinite; }
.ec-etoiles span { display: inline-block; font-size: 32px; color: #ffd34d; text-shadow: 0 0 14px #ffb347; animation: ec-etoile .45s cubic-bezier(.2, 1.8, .4, 1) both; }
.ec-etincelle { position: absolute; left: 50%; top: 40%; width: 6px; height: 6px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 8px #ffd34d; opacity: 0; animation: ec-etincelle 1s ease-out forwards; pointer-events: none; }
@keyframes ec-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ec-etoile { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ec-brille { from { filter: drop-shadow(0 0 6px #ffd34d); } to { filter: drop-shadow(0 0 22px #fff3c4) brightness(1.25); } }
@keyframes ec-etincelle { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }

/* Inventaire : porté / en stock */
.inv-section { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 3px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.inv-section span { font-weight: 700; letter-spacing: 0; }
.inv-stock { margin-top: 12px; padding-top: 9px; border-top: 2px dashed var(--parchemin-fonce); }
body.nuit .inv-stock { border-color: rgba(127, 247, 225, .35); }
/* Choix des exemplaires sacrifiés (⬆★) */
.choix-sacrifice { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 10px 8px 44px; margin-bottom: 4px; border-radius: 0 0 6px 6px; background: rgba(242, 193, 78, .14); font-size: 12.5px; }
body.nuit .choix-sacrifice { background: rgba(127, 247, 225, .08); }
.cs-titre { font-weight: 800; margin-right: 2px; }
.cs-objet { font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--parchemin-fonce); background: transparent; color: inherit; opacity: .7; }
.cs-objet.pris { opacity: 1; border-color: #d9534f; background: rgba(217, 83, 79, .18); text-decoration: line-through; text-decoration-color: rgba(217, 83, 79, .7); }
.cs-actions { display: inline-flex; gap: 4px; margin-left: auto; }

/* Atelier : fenêtre de taille fixe, seules les listes défilent */
#fenetre-atelier { height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
#atelier-contenu { flex: 1; min-height: 0; }
.atelier-grille { height: 100%; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.atelier-gauche { display: flex; flex-direction: column; min-height: 0; }
.atelier-liste { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 2px; }
.atelier-inv { position: static; max-height: none; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; }
@media (max-width: 820px) {
  .atelier-grille { grid-template-rows: none; overflow-y: auto; }
  .atelier-liste, .atelier-inv { overflow: visible; }
}

/* Tableau des effets d'enchantement (onglet Enchanter) */
#atelier-contenu .ligne.guide-effets { border-top: none; min-height: 32px; }
#atelier-contenu .ligne.guide-effets .nom { font-size: 13px; }
#atelier-contenu .ligne.guide-effets .effet { color: inherit; opacity: .6; }
.table-effets { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.table-effets th { font-size: 11px; font-weight: 700; opacity: .7; text-align: left; padding: 0 6px 3px; }
.table-effets td { padding: 3px 6px; border-top: 1px solid rgba(0, 0, 0, .08); vertical-align: top; }
body.nuit .table-effets td { border-color: rgba(127, 247, 225, .12); }
.table-effets .te-ou { white-space: nowrap; }
.te-couts { margin-top: 6px; font-size: 12px; opacity: .85; }
.table-effets td:first-child { white-space: nowrap; }

/* Ascenseurs fins, aux couleurs du jeu */
* { scrollbar-width: thin; scrollbar-color: rgba(122, 90, 48, .5) transparent; }
body.nuit * { scrollbar-color: rgba(127, 247, 225, .32) transparent; }
/* Métiers (sac, onglet Ressources) */
.metiers { margin-bottom: 10px; padding: 6px 8px; border: 2px solid var(--parchemin-fonce); border-radius: 10px; }
body.nuit .metiers { border-color: rgba(127, 247, 225, .25); }
.metiers-titre { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
.metier { display: grid; grid-template-columns: 120px 28px 1fr auto; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.m-niv { text-align: center; }
.m-barre { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .15); overflow: hidden; }
.m-barre i { display: block; height: 100%; background: linear-gradient(90deg, #7ff7a8, #4fc3a1); }
.m-pro { font-size: 11.5px; opacity: .75; white-space: nowrap; }

/* Ensembles d'équipement */
.ensembles { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 4px 0 6px; }
.ens-titre { font-size: 12px; font-weight: 800; margin-right: 2px; }
.ens { display: inline-flex; align-items: stretch; border: 2px solid var(--parchemin-fonce); border-radius: 8px; overflow: hidden; }
.ens button { font: inherit; font-size: 12.5px; font-weight: 800; border: none; background: transparent; color: inherit; cursor: pointer; padding: 2px 7px; }
.ens .ens-sauver { padding: 2px 4px; opacity: .55; border-left: 1px solid var(--parchemin-fonce); font-size: 11px; }
.ens .ens-sauver:hover { opacity: 1; }
.ens.actif { border-color: #4caf50; background: rgba(76, 175, 80, .16); }
.ens.vide { font: inherit; font-size: 13px; padding: 1px 9px; border-style: dashed; opacity: .6; background: transparent; color: inherit; cursor: pointer; }
.ens.vide:hover { opacity: 1; }
.ens.voie-lame { border-color: #6b7280; } .ens.voie-sangsue { border-color: #a3243a; } .ens.voie-archer { border-color: #3f8f3a; } .ens.voie-tempete { border-color: #3d6fd9; }
.ens.actif.voie-lame, .ens.actif.voie-sangsue, .ens.actif.voie-archer, .ens.actif.voie-tempete { box-shadow: 0 0 0 2px #4caf50; }
body.nuit .ens { border-color: rgba(127, 247, 225, .3); }

/* Barre des monstres : on vise en survolant un portrait */
.portrait[data-u] { cursor: crosshair; }
.portrait[data-u]:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px #fff; }
.portrait.heros[data-u] { cursor: default; }

/* Filtre par étoiles (onglet Enchanter) */
.filtres-etoiles button { color: #b07a10; letter-spacing: -1px; }
.filtres-etoiles button small { letter-spacing: 0; font-size: 10.5px; opacity: .75; margin-left: 2px; }
.filtres-etoiles button.actif { color: #2a1d08; }
body.nuit .filtres-etoiles button { color: #ffd34d; }
body.nuit .filtres-etoiles button.actif { color: #2a1d08; }

/* ===== Éclat de fabrication : un palier de couleurs par nombre d'étoiles ===== */
#eclat-craft { left: 0; top: 0; inset: 0; transform: none; display: grid; place-items: center; padding-bottom: 14vh; pointer-events: none; overflow: hidden; cursor: default; }
#eclat-craft[hidden] { display: none; }
#eclat-craft .ec-carte { pointer-events: auto; cursor: pointer; }
.ec-carte { --c1: #ffd34d; --c2: #ffb347; --glow: rgba(255, 211, 77, .75); --rayon: rgba(255, 230, 150, .35);
  border-color: var(--c1); box-shadow: 0 0 40px var(--glow), inset 0 0 24px color-mix(in srgb, var(--c2) 25%, transparent); }
.ec-1 { --c1: #ffe9a8; --c2: #ffd34d; --glow: rgba(255, 211, 77, .5); --rayon: rgba(255, 240, 190, .25); }
.ec-2 { --c1: #ffd34d; --c2: #ffb347; --glow: rgba(255, 190, 60, .85); --rayon: rgba(255, 220, 120, .42); }
.ec-3 { --c1: #ffa24a; --c2: #ff4d2e; --glow: rgba(255, 110, 40, .95); --rayon: rgba(255, 150, 70, .5);
  background: radial-gradient(circle at 50% 28%, rgba(110, 38, 10, .97), rgba(26, 12, 26, .97)); }
.ec-4 { --c1: #ff7adb; --c2: #b04dff; --glow: rgba(255, 90, 210, 1); --rayon: rgba(255, 130, 225, .55);
  background: radial-gradient(circle at 50% 28%, rgba(96, 12, 86, .97), rgba(22, 8, 44, .97)); padding: 22px 34px; }
.ec-5 { --c1: #b2a4ff; --c2: #4fd6ff; --glow: rgba(120, 160, 255, 1); --rayon: rgba(140, 210, 255, .6);
  background: radial-gradient(circle at 50% 28%, rgba(34, 34, 130, .97), rgba(6, 8, 40, .98)); padding: 24px 38px; border-width: 4px; }
.ec-6 { --c1: #ffffff; --c2: #ff6ad5; --glow: rgba(255, 255, 255, 1); --rayon: rgba(255, 255, 255, .5);
  background: radial-gradient(circle at 50% 28%, rgba(70, 24, 110, .97), rgba(8, 6, 30, .98)); padding: 26px 42px; border: 4px solid #fff;
  box-shadow: 0 0 0 3px #ff4d4d, 0 0 0 6px #ffe14d, 0 0 0 9px #5dff8a, 0 0 0 12px #4fd6ff, 0 0 0 15px #9f6bff, 0 0 90px 20px rgba(255, 140, 230, .9); }
.ec-3 img { width: 84px; height: 84px; } .ec-4 img { width: 92px; height: 92px; } .ec-5 img { width: 100px; height: 100px; } .ec-6 img { width: 112px; height: 112px; }
.ec-carte img { animation: ec-brille-v .7s ease-in-out infinite alternate; }
@keyframes ec-brille-v { from { filter: drop-shadow(0 0 6px var(--c1)); } to { filter: drop-shadow(0 0 24px var(--c2)) drop-shadow(0 0 8px #fff) brightness(1.3); } }
.ec-etoiles span { color: var(--c1); text-shadow: 0 0 12px var(--c2), 0 0 26px var(--c2); }
.ec-3 .ec-etoiles span { font-size: 36px; } .ec-4 .ec-etoiles span { font-size: 38px; } .ec-5 .ec-etoiles span { font-size: 40px; } .ec-6 .ec-etoiles span { font-size: 44px; }
.ec-titre { font-family: 'Cinzel', serif; font-weight: 800; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--c1);
  text-shadow: 0 0 10px var(--c2), 0 0 22px var(--c2); animation: ec-etoile .5s cubic-bezier(.2, 1.8, .4, 1) .1s both; }
.ec-4 .ec-titre { font-size: 15px; } .ec-5 .ec-titre { font-size: 17px; } .ec-6 .ec-titre { font-size: 20px; }
.ec-6 .ec-titre { background: linear-gradient(90deg, #ff4d4d, #ffe14d, #5dff8a, #4fd6ff, #9f6bff, #ff6ad5, #ff4d4d); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .8));
  animation: ec-etoile .5s cubic-bezier(.2, 1.8, .4, 1) .1s both, ec-defile 1.6s linear infinite; }
@keyframes ec-defile { to { background-position: 200% 0; } }
/* rayons : plus larges et plus nombreux avec les étoiles */
.ec-rayons { background: repeating-conic-gradient(var(--rayon) 0 10deg, transparent 10deg 24deg); }
.ec-3 .ec-rayons { inset: -100px; } .ec-4 .ec-rayons { inset: -130px; } .ec-5 .ec-rayons { inset: -170px; } .ec-6 .ec-rayons { inset: -220px; }
.ec-rayons2 { background: repeating-conic-gradient(color-mix(in srgb, var(--c2) 45%, transparent) 0 6deg, transparent 6deg 30deg); animation: oc-tourne 9s linear infinite reverse; }
.ec-6 .ec-rayons { background: repeating-conic-gradient(rgba(255, 77, 77, .55) 0 8deg, transparent 8deg 15deg, rgba(255, 225, 77, .55) 15deg 23deg, transparent 23deg 30deg,
  rgba(93, 255, 138, .5) 30deg 38deg, transparent 38deg 45deg, rgba(79, 214, 255, .55) 45deg 53deg, transparent 53deg 60deg, rgba(255, 106, 213, .55) 60deg 68deg, transparent 68deg 75deg);
  animation: oc-tourne 4s linear infinite, ec-arcenciel 3s linear infinite; }
@keyframes ec-arcenciel { to { filter: hue-rotate(360deg); } }
/* voile de couleur sur tout l'écran, et ondes de choc */
.ec-voile { position: absolute; inset: 0; pointer-events: none; opacity: 0; animation: ec-voile 1.6s ease-out forwards;
  background: radial-gradient(circle at 50% 43%, var(--voile, rgba(255, 211, 77, .18)), transparent 60%); }
.ec-z3 .ec-voile { --voile: rgba(255, 120, 40, .3); }
.ec-z4 .ec-voile { --voile: rgba(255, 90, 210, .38); animation-duration: 1.9s; }
.ec-z5 .ec-voile { --voile: rgba(110, 150, 255, .5); animation-duration: 2.3s; }
.ec-z6 .ec-voile { background: radial-gradient(circle at 50% 43%, rgba(255, 255, 255, .8), rgba(255, 120, 220, .4) 22%, rgba(80, 200, 255, .28) 42%, transparent 70%);
  animation: ec-voile 2.8s ease-out forwards, ec-arcenciel 2s linear infinite; }
@keyframes ec-voile { 0% { opacity: 0; } 10% { opacity: 1; } 100% { opacity: 0; } }
.ec-onde { position: absolute; left: 50%; top: 43%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  border: 4px solid var(--onde, #ff7adb); box-shadow: 0 0 20px var(--onde, #ff7adb); opacity: 0; animation: ec-onde 1.2s ease-out forwards; }
.ec-z5 .ec-onde { --onde: #8fdcff; }
.ec-z6 .ec-onde { --onde: #ffffff; border-width: 6px; box-shadow: 0 0 30px #ff6ad5, inset 0 0 30px #4fd6ff; }
@keyframes ec-onde { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(16); } }

/* L'éclat de fabrication ne capte aucun clic : on peut refabriquer à travers */
#eclat-craft, #eclat-craft .ec-carte { pointer-events: none; cursor: default; }

/* Sac : fenêtre de taille fixe, les onglets restent en haut, seule la liste défile */
#fenetre-sac { height: min(640px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
#sac-contenu { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sac-liste { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 2px; }
#fenetre-sac > .note { flex: none; }
/* Métiers dans la fiche du héros */
.metiers-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; margin-top: 6px; padding: 4px 6px; font: inherit; font-size: 12px; color: inherit;
  background: rgba(0, 0, 0, .06); border: 1.5px solid var(--parchemin-fonce); border-radius: 8px; cursor: pointer; }
.metiers-mini .mm { display: grid; gap: 2px; }
.metiers-mini b { font-weight: 800; white-space: nowrap; text-align: left; }
.metiers-mini i { display: block; height: 5px; border-radius: 4px; background: rgba(0, 0, 0, .18); overflow: hidden; }
.metiers-mini em { display: block; height: 100%; background: linear-gradient(90deg, #7ff7a8, #4fc3a1); }
body.nuit .metiers-mini { background: rgba(127, 247, 225, .05); border-color: rgba(127, 247, 225, .25); }

/* Choix des sacrifices : l'objet porté bien signalé */
.cs-objet.cs-porte { border-color: #4caf50; border-width: 2px; }
.cs-badge { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 0 5px; border-radius: 6px; background: #4caf50; color: #fff; text-decoration: none; }
.cs-objet.cs-porte.pris { border-color: #d9534f; box-shadow: 0 0 0 2px rgba(217, 83, 79, .35); }
.cs-alerte { flex-basis: 100%; font-size: 12px; font-weight: 800; color: #c0392b; padding: 2px 0; }
body.nuit .cs-alerte { color: #ff8a80; }

/* Donjons */
#fenetre-donjon { width: min(480px, calc(100vw - 20px)); }
#fenetre-donjon ul { font-size: 14px; }
.donjon-texte { font-style: italic; margin: 0 0 6px; }
.donjon-record { font-weight: 800; font-size: 15px; margin: 6px 0; }
.donjon-res { font-size: 13px; padding: 4px 8px; margin-bottom: 4px; border-radius: 8px; background: rgba(180, 140, 255, .14); border: 1.5px solid rgba(180, 140, 255, .5); }
.donjon-objets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.donjon-objets .piece img { width: 26px; height: 26px; vertical-align: middle; }

/* Points de sort (fiche du personnage) */
.points-titre { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.points-titre .btn { margin-left: auto; }
.perso-sort-case { display: grid; gap: 3px; }
.perso-sort-case .perso-sort { width: 100%; }
.pts { display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 0 4px; }
.pts button { font: inherit; font-weight: 800; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--parchemin-fonce); background: transparent; color: inherit; cursor: pointer; line-height: 1; }
.pts button:not(:disabled):hover { background: var(--or); color: #2a1d08; border-color: var(--or); }
.pts button:disabled { opacity: .35; cursor: default; }
.pts b { min-width: 22px; text-align: center; font-size: 13px; }
.pts small { opacity: .75; font-size: 11px; line-height: 1.2; }
.badge-points { margin-left: 4px; font-size: 11px; font-weight: 800; padding: 0 5px; border-radius: 8px; background: #7d4fd6; color: #fff; }
body.nuit .pts button { border-color: rgba(127, 247, 225, .35); }

/* Fiche : caractéristiques et paliers de chaque sort */
.perso-sort .carac-sort { display: block; font-size: 11px; font-weight: 700; opacity: .8; }
.paliers-sort { display: grid; gap: 2px; padding: 0 4px 4px; font-size: 11px; }
.paliers-sort span { opacity: .55; }
.paliers-sort span b { display: inline-block; min-width: 18px; font-weight: 800; }
.paliers-sort span.atteint { opacity: 1; color: #2f8f3a; font-weight: 700; }
.paliers-sort span.atteint::before { content: '✓ '; }
.paliers-sort span.prochain { opacity: 1; font-weight: 700; }
.paliers-sort span.prochain::before { content: '→ '; }
body.nuit .paliers-sort span.atteint { color: #7cf0a0; }

/* Téléphone : barre de boutons repliable */
#b-replier { display: none; }
@media (max-width: 700px) {
  #b-replier { display: inline-flex; justify-content: center; }
  .boutons-haut.repliee > .btn:not(#b-replier) { display: none; }
  .boutons-haut.repliee:has(.badge-points, .badge-coffre) #b-replier::after { content: ''; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a7a; box-shadow: 0 0 6px #ff5a7a; }
  #b-replier { position: relative; }
}

/* Au doigt : l'infobulle devient un cadre fixe, lisible, qui ne suit pas le doigt */
body.tactile #infobulle { left: 50% !important; top: 78px !important; bottom: auto; transform: translateX(-50%); max-width: min(92vw, 380px); font-size: 14px; }
body.tactile #infobulle.bas { top: auto !important; bottom: 14px !important; }
body.tactile .sort { width: 52px; height: 52px; }
