/* =========================================================
   Gluantissime - Pet
   DA reprise du site Gluantissime (site/style.css) :
   parchemin, encre, rubrique rouge, lueur de fée turquoise, Almendra.
   ========================================================= */
:root {
  --ink: #3a2716;
  --ink-soft: #6b4f33;
  --parch: #f4e7c6;
  --parch-2: #ead7a8;
  --parch-dark: #d9c08a;
  --rubric: #8e2f1c;
  --gluant: #2f8f3a;
  --gluant-light: #b4f07a;
  --fairy: #8ff5dc;
  --wood: #2b1d12;
  --brun: #5a3e22;
  --or: #ffd04a;
  --rouge: #ff6a52;
  --bleu: #7fd8ff;
  --f-title: "Almendra", Georgia, "Times New Roman", serif;
  --f-sc: "Almendra SC", "Almendra", Georgia, serif;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .12  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--f-title); color: var(--ink); font-size: 16px; line-height: 1.35;
  background: radial-gradient(ellipse at 50% -10%, rgba(143,245,220,.18), transparent 55%),
    repeating-linear-gradient(92deg, rgba(0,0,0,.07) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #3a2818, #22160c);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font-family: var(--f-sc); color: inherit; cursor: pointer; }
.cache { display: none !important; }

#app, .modal-boite, .plein-boite {
  background: var(--grain),
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(160,110,40,.22), transparent 55%),
    radial-gradient(circle at 50% 50%, var(--parch) 55%, var(--parch-2) 100%);
}
#app { position: relative; height: 100%; max-width: 480px; margin: 0 auto; overflow: hidden; box-shadow: inset 0 0 40px rgba(120,80,30,.35); }
.ecran { position: absolute; inset: 0; display: none; flex-direction: column; padding-top: var(--sat); padding-bottom: var(--sab); }
.ecran.actif { display: flex; }

/* ---------- Boutons (grimoire) ---------- */
.btn {
  font-family: var(--f-sc); font-size: 17px; color: var(--ink); padding: 9px 16px; border-radius: 4px;
  background: linear-gradient(#c9f59a, #5fb64c); border: 2px solid #1d5a22;
  box-shadow: 0 3px 0 #1d5a22, inset 0 1px 0 #fff8; transition: transform .08s, filter .15s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1d5a22; }
.btn:disabled { filter: grayscale(.9) opacity(.55); }
.btn.gros { font-size: 21px; padding: 12px 26px; min-width: 230px; }
.btn.petit { font-size: 15px; padding: 5px 11px; box-shadow: 0 2px 0 #1d5a22; }
.btn.bois { background: linear-gradient(#f6ebcf, #dcc58f); border-color: var(--brun); box-shadow: 0 3px 0 var(--brun), inset 0 1px 0 #fff8; }
.btn.rouge { background: linear-gradient(#f3d2c4, #c9654c); border-color: #7a2a18; box-shadow: 0 3px 0 #7a2a18; color: #2a0d06; }
.plein-l { grid-column: 1 / -1; width: 100%; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 400; }

/* ---------- Titre ---------- */
#ecran-titre { align-items: center; justify-content: center; gap: 10px; text-align: center; }
.titre-fond { position: absolute; inset: 0; background: url(../assets/fonds/fond_foret.svg) center/cover; opacity: .3; }
#ecran-titre > *:not(.titre-fond) { position: relative; }
.logo { width: 92%; max-width: 420px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); animation: flotte 4s ease-in-out infinite; }
.sous-titre { margin: 0; font-size: 20px; font-style: italic; color: var(--rubric); }
.titre-gluants { display: flex; justify-content: center; margin: 4px 0 10px; }
.titre-gluants img { width: 110px; margin: 0 -14px; animation: rebond 1.6s ease-in-out infinite; }
.titre-gluants img:nth-child(2) { animation-delay: .3s; width: 130px; }
.titre-gluants img:nth-child(3) { animation-delay: .6s; }
.titre-boutons { display: flex; flex-direction: column; gap: 14px; }
.credit { position: absolute !important; bottom: calc(10px + var(--sab)); font-size: 12px; opacity: .6; margin: 0; }

/* ---------- Bandeaux bois ---------- */
.crea-entete, .entete, .plein-entete {
  display: flex; align-items: center; gap: 8px; color: var(--parch);
  background: repeating-linear-gradient(92deg, rgba(0,0,0,.1) 0 2px, transparent 2px 9px), linear-gradient(#4a3420, var(--wood));
  border-bottom: 2px solid #7b5a33; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* ---------- Création ---------- */
.crea-entete { padding: 12px 14px; }
.crea-entete h1 { flex: 1; margin: 0; font-size: 23px; color: var(--gluant-light); text-shadow: 0 2px 0 #12300f, 0 0 12px rgba(143,245,220,.35); }
.btn-retour { background: none; border: 0; color: var(--parch); font-size: 34px; line-height: 1; padding: 0 6px; }
.crea-etape { font-family: var(--f-sc); font-size: 15px; opacity: .8; }
.crea-corps { flex: 1; overflow-y: auto; padding: 12px 14px; -webkit-overflow-scrolling: touch; }
.crea-pied { padding: 12px; display: flex; justify-content: center; border-top: 1px solid #7b5a33; }
.intro { margin: 0 0 12px; font-style: italic; font-size: 15px; }
.grille-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.carte-choix { position: relative; border: 2px solid #7b5a33; outline: 1px solid #7b5a33; outline-offset: -6px; border-radius: 6px; background: rgba(255,250,235,.6); padding: 8px; text-align: center; box-shadow: 0 3px 8px rgba(80,50,20,.25); overflow: hidden; }
.carte-choix.choisi { background: #eef8dc; box-shadow: 0 0 0 3px var(--gluant), 0 0 16px var(--fairy); }
.carte-choix img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.carte-choix.biome img { object-fit: cover; border-radius: 4px; border: 1px solid #7b5a33; }
.carte-choix h3 { margin: 4px 0 2px; font-size: 16px; line-height: 1.1; color: var(--rubric); }
.carte-choix .tag { position: absolute; top: 6px; left: 6px; z-index: 1; font-family: var(--f-sc); font-size: 11px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: var(--parch); }
.mini-stats, .stats-l { display: flex; justify-content: center; gap: 8px; font-family: var(--f-sc); font-size: 12.5px; }
.stats-l { justify-content: flex-start; display: inline-flex; margin-left: 6px; }
.desc-choix { margin-top: 14px; padding: 10px 12px; border: 2px solid #7b5a33; outline: 1px solid #7b5a33; outline-offset: -6px; border-radius: 6px; background: rgba(255,250,235,.55); font-size: 15px; }
.desc-choix p { margin: 6px 0; }
.sp { margin: 8px 0; padding: 6px 10px; border-left: 3px solid var(--rubric); background: rgba(142,47,28,.07); font-size: 14.5px; }
.sp b { color: var(--rubric); }
.capas { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.capa { padding: 6px 10px; border: 1px solid #9a7a50; border-radius: 6px; background: rgba(255,250,235,.7); font-size: 14px; }
.capa b { color: var(--rubric); font-size: 15px; }
.capa i { font-size: 12.5px; opacity: .75; }
.capa p { margin: 3px 0 0; }
.capa.cochee { border-color: var(--gluant); box-shadow: 0 0 0 1px var(--gluant); }
.nom-zone { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 10px; }
.nom-zone .apercu { width: 200px; height: 200px; border-radius: 50%; border: 3px solid #7b5a33; background-size: cover; background-position: center 70%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--fairy), 0 6px 14px rgba(0,0,0,.3); }
.germe-apercu { width: 58%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(143,245,220,.55) 35%, rgba(143,245,220,.2) 70%); border: 2px solid rgba(58,39,22,.6); animation: tremble 2.5s infinite; }
.germe-apercu img { width: 60%; opacity: .75; filter: blur(.6px); }
.champ-nom { display: flex; gap: 8px; width: 100%; max-width: 340px; }
.champ-nom input { flex: 1; font-family: var(--f-title); font-size: 22px; padding: 9px 12px; border: 2px solid #7b5a33; border-radius: 4px; background: #fbf3dc; min-width: 0; color: var(--ink); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.suggestions button { font-size: 14px; padding: 3px 12px; border-radius: 20px; border: 1.5px solid var(--ink-soft); background: transparent; }

/* ---------- Jeu : entête ---------- */
.entete { padding: 8px 10px; }
.entete-id { flex: 1; min-width: 0; }
.entete .nom { font-size: 21px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gluant-light); text-shadow: 0 2px 0 #12300f; }
.entete .stade { font-family: var(--f-sc); font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-niv { width: 66px; font-family: var(--f-sc); font-size: 14px; }
.barre-xp { height: 6px; background: rgba(0,0,0,.4); border-radius: 4px; overflow: hidden; margin-top: 2px; }
.barre-xp div { height: 100%; width: 0; background: var(--fairy); box-shadow: 0 0 6px var(--fairy); transition: width .4s; }
.pieces { display: flex; align-items: center; gap: 4px; font-size: 18px; background: rgba(0,0,0,.3); padding: 2px 9px 2px 3px; border-radius: 14px; }
.ico-piece { width: 22px; height: 22px; vertical-align: middle; }
.btn-menu { background: none; border: 0; color: var(--parch); font-size: 26px; padding: 0 4px; }

.jauges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 7px 10px; border-bottom: 1px solid #7b5a33; background: rgba(217,192,138,.35); }
.jauge { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 17px; }
.j-barre { width: 100%; height: 9px; border: 1.5px solid var(--ink-soft); border-radius: 6px; background: #fbf3dc; overflow: hidden; }
.j-barre div { height: 100%; width: 50%; background: linear-gradient(90deg, var(--gluant), #5fb64c); transition: width .5s; }
.jauge.bas .j-barre div { background: var(--or); }
.jauge.critique .j-barre div { background: var(--rouge); }
.jauge.critique span { animation: tremble .6s infinite; }

/* ---------- Scène ---------- */
.scene { position: relative; flex: 1; min-height: 0; overflow: hidden; border-bottom: 2px solid #7b5a33; background: #435c34; }
.scene .fond { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.gluant-zone { position: absolute; left: 50%; bottom: 9%; width: min(64vw, 300px); aspect-ratio: 1; transform: translateX(-50%); }
.ombre { position: absolute; left: 18%; right: 18%; bottom: 6%; height: 10%; background: radial-gradient(ellipse, rgba(0,0,0,.4), transparent 70%); }
.gluant { position: absolute; inset: 0; transform-origin: 50% 92%; transition: scale .6s; }
.calques, .gluant-calques { position: absolute; inset: 0; }
.gluant-calques img { position: absolute; inset: 0; width: 100%; height: 100%; }
.gluant.anim-idle { animation: respire 2.4s ease-in-out infinite; }
.gluant.anim-joie { animation: saut .55s ease-out 2; }
.gluant.anim-calin { animation: squish .45s ease-out; }
.gluant.anim-mange { animation: mange .3s ease-in-out 4; }
.gluant.anim-dort { animation: respire 4.5s ease-in-out infinite; filter: brightness(.85); }
.gluant.anim-malade { animation: tremble 1.6s infinite; filter: hue-rotate(40deg) saturate(.7); }
.gluant.anim-triste { animation: respire 3.5s ease-in-out infinite; filter: saturate(.6); }
.gluant.anim-evolue { animation: evolue 1.8s ease-in-out; }
.gluant .aura { position: absolute; inset: 6%; border-radius: 50%; opacity: 0; transition: opacity .5s; }
.gluant.ultime .aura { opacity: 1; background: radial-gradient(circle, rgba(143,245,220,.55), rgba(255,208,74,.25) 50%, transparent 70%); animation: pulse 2s infinite; }
/* Germe : le gluant encore dans sa bulle de gelée (simple effet CSS, aucun nouvel asset) */
.gluant.est-germe .calques { inset: 14%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.85), rgba(143,245,220,.5) 35%, rgba(143,245,220,.15) 72%); border: 2px solid rgba(58,39,22,.55); animation: tremble 2.2s infinite; }
.gluant.est-germe .gluant-calques { inset: 18%; opacity: .7; filter: blur(.8px) saturate(.8); }

.crottes { position: absolute; inset: 0; pointer-events: none; }
.flaque { position: absolute; bottom: 7%; width: 44px; height: 18px; border-radius: 50% 60% 45% 55%; background: radial-gradient(ellipse at 40% 35%, rgba(255,255,255,.5), rgba(110,130,40,.85) 45%, rgba(70,80,20,.9)); border: 1.5px solid var(--ink); }
.flaque::after { content: '〰'; position: absolute; top: -18px; left: 12px; color: #6a7a2a; font-size: 14px; animation: fume 1.8s infinite; }

.emote { position: absolute; left: calc(50% + 40px); top: 10%; font-size: 32px; background: #fbf3dc; border: 2px solid var(--ink-soft); border-radius: 50% 50% 50% 8px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; }
.emote img { width: 80%; }
.emote.vu { opacity: 1; animation: flotte 1.6s ease-in-out infinite; }
.nuit { position: absolute; inset: 0; background: rgba(10,15,45,.55); opacity: 0; pointer-events: none; transition: opacity 1s; }
.nuit.actif { opacity: 1; }
.nuit span { position: absolute; left: 60%; top: 28%; color: #dfe9ff; font-size: 32px; animation: zzz 3s infinite; opacity: 0; }
.nuit span:nth-child(2) { animation-delay: 1s; font-size: 24px; }
.nuit span:nth-child(3) { animation-delay: 2s; font-size: 18px; }
.btn-evolution { position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 5; font-family: var(--f-sc); font-size: 19px; padding: 7px 18px; border-radius: 4px; border: 2px solid #1d5a22; color: var(--ink); background: linear-gradient(90deg, var(--fairy), var(--gluant-light), var(--fairy)); background-size: 200% 100%; animation: brille 1.5s linear infinite, flotte 2s ease-in-out infinite; box-shadow: 0 0 18px var(--fairy); }
.particules { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.part { position: absolute; font-size: 24px; animation: monte 1.2s ease-out forwards; }
.flash { position: absolute; inset: 0; background: #fff; animation: flash 1.6s ease-out forwards; z-index: 6; pointer-events: none; }

.message { padding: 7px 12px; min-height: 40px; font-size: 15.5px; font-style: italic; line-height: 1.25; text-align: center; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #7b5a33; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 9px 9px calc(9px + var(--sab)); background: repeating-linear-gradient(92deg, rgba(0,0,0,.1) 0 2px, transparent 2px 9px), linear-gradient(#4a3420, var(--wood)); }
.actions button { border: 2px solid var(--brun); border-radius: 4px; background: linear-gradient(#f6ebcf, #dcc58f); box-shadow: 0 3px 0 #120b05, inset 0 1px 0 #fff8; padding: 5px 2px; font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.actions button i { font-style: normal; font-size: 23px; height: 28px; display: flex; align-items: center; }
.actions button i img { width: 28px; height: 28px; }
.actions button:active { transform: translateY(2px); box-shadow: 0 1px 0 #120b05; }
.actions button:disabled { filter: grayscale(1) opacity(.5); }

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,12,5,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-boite { position: relative; width: 100%; max-width: 480px; max-height: 88%; border: 2px solid #7b5a33; border-bottom: 0; border-radius: 10px 10px 0 0; padding: 14px 14px calc(14px + var(--sab)); display: flex; flex-direction: column; animation: glisseHaut .25s ease-out; box-shadow: 0 -6px 24px rgba(0,0,0,.45); }
.modal-boite h2 { margin: 0 34px 8px 2px; font-size: 25px; color: var(--rubric); }
.modal-contenu { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-fermer { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 24px; }
.liste { display: flex; flex-direction: column; gap: 7px; }
.ligne { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: rgba(255,250,235,.7); border: 1px solid #9a7a50; border-radius: 6px; }
.ligne .ico { font-size: 28px; width: 46px; text-align: center; flex-shrink: 0; }
.ligne .ico img { width: 46px; height: 46px; object-fit: contain; }
.ligne .stat-ico { font-family: var(--f-sc); font-size: 16px; color: var(--rubric); border: 1.5px solid var(--rubric); border-radius: 50%; height: 46px; display: flex; align-items: center; justify-content: center; }
.ligne .txt { flex: 1; min-width: 0; }
.ligne .txt b { display: block; font-size: 16px; }
.ligne .txt small { display: block; font-size: 13px; opacity: .85; line-height: 1.25; }
.ligne.verrou { opacity: .55; }
.ligne.cliquable:active, .ligne.cochee { background: #eef8dc; border-color: var(--gluant); }
.onglets { display: flex; gap: 6px; margin-bottom: 10px; }
.onglets button { flex: 1; font-size: 14.5px; padding: 6px; border-radius: 20px; border: 1.5px solid var(--ink-soft); background: transparent; }
.onglets button.actif { background: var(--ink); color: var(--parch); }
.petit-texte { font-size: 14px; margin: 0 0 8px; }
.malus { color: var(--rubric); }
.bourse { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.centre { text-align: center; }
.gros-txt { font-size: 19px; }
.portrait-evo { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.portrait-evo.triste { filter: grayscale(.6); opacity: .8; }
.fiche-haut { display: flex; gap: 12px; align-items: center; }
.fiche-haut .portrait { width: 112px; height: 112px; border-radius: 6px; border: 2px solid #7b5a33; outline: 1px solid #7b5a33; outline-offset: -5px; background-size: cover; background-position: center 70%; position: relative; flex-shrink: 0; }
.fiche-haut .portrait .gluant-calques { inset: 6%; }
.fiche-nom { font-size: 21px; color: var(--rubric); }
.stats-okf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.stats-okf div { text-align: center; font-family: var(--f-sc); padding: 4px; border: 2px solid #7b5a33; border-radius: 6px; background: rgba(255,250,235,.7); }
.stats-okf b { display: block; font-family: var(--f-title); font-size: 26px; color: var(--rubric); line-height: 1; }
.fiche-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin: 8px 0; font-size: 14.5px; }
.sous-titre-fiche { margin: 12px 0 4px; font-size: 19px; color: var(--rubric); border-bottom: 1px solid #9a7a50; }
.indice { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--ink-soft); border-radius: 6px; background: rgba(143,245,220,.18); font-size: 14px; }
.grille-tresors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tresor { border: 1px solid #9a7a50; border-radius: 6px; background: rgba(255,250,235,.7); padding: 4px; text-align: center; font-family: var(--f-title); font-size: 10.5px; line-height: 1.1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tresor img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.tresor .or { color: #8a6400; font-size: 11px; font-weight: 400; }
.tresor.manque img { filter: brightness(0) opacity(.22); }
.tresor.manque span { opacity: .45; }
.tresor-detail { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin-bottom: 6px; border: 2px solid #7b5a33; border-radius: 6px; background: rgba(255,250,235,.8); font-size: 14px; }
.tresor-detail img { width: 80px; flex-shrink: 0; }
.tresor-detail p { margin: 4px 0 0; }
.journal-l { font-size: 14px; padding: 6px 2px; border-bottom: 1px dashed rgba(58,39,22,.3); }
.journal-l small { opacity: .6; margin-right: 6px; }
textarea.code { width: 100%; height: 86px; font-family: monospace; font-size: 11px; border: 1.5px solid #7b5a33; border-radius: 4px; padding: 6px; background: #fbf3dc; }
.boutons-ligne { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.boutons-ligne.centre { justify-content: center; }

/* ---------- Plein écran (mini-jeux & combat) ---------- */
.plein { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; background: #22160c; }
.plein-boite { position: relative; width: 100%; max-width: 480px; height: 100%; display: flex; flex-direction: column; padding-top: var(--sat); padding-bottom: var(--sab); }
.plein-entete { padding: 9px 12px; font-size: 19px; }
.plein-entete b { flex: 1; font-weight: 400; color: var(--gluant-light); }
.plein-corps { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px; min-height: 0; }
.consigne { text-align: center; font-size: 17px; padding: 0 10px; margin: 0; }
.depart-ico { font-size: 70px; }
.ico-depart { width: 130px; height: 130px; object-fit: contain; }
.gros-score { font-size: 46px; color: var(--rubric); }
canvas.jeu { width: 100%; height: 100%; display: block; touch-action: none; }

.timing { position: relative; width: 92%; height: 44px; border: 2px solid var(--ink); border-radius: 6px; background: linear-gradient(90deg, #f3d2c4, #fbf3dc 30%, #fbf3dc 70%, #f3d2c4); overflow: hidden; }
.timing .zone { position: absolute; top: 0; bottom: 0; background: rgba(95,182,76,.75); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.timing .zone .parfait { position: absolute; top: 0; bottom: 0; left: 35%; right: 35%; background: var(--fairy); }
.timing .curseur { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; background: var(--ink); border-radius: 3px; }

.grille-reflexes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 92%; max-width: 340px; }
.case-r { aspect-ratio: 1; border: 2px solid #7b5a33; border-radius: 8px; background: rgba(217,192,138,.6); display: flex; align-items: center; justify-content: center; padding: 10%; }
.case-r img { width: 100%; }
.case-r.on { background: rgba(143,245,220,.6); box-shadow: 0 0 16px var(--fairy); }
.case-r.piege { background: rgba(255,106,82,.5); }

.grille-runes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 80%; max-width: 300px; }
.rune { aspect-ratio: 1; border: 2px solid #7b5a33; border-radius: 10px; background: #4a3a5e; display: flex; align-items: center; justify-content: center; padding: 14%; transition: all .12s; }
.rune img { width: 100%; opacity: .55; filter: grayscale(.6); }
.rune.on { background: var(--fairy); box-shadow: 0 0 24px var(--fairy); transform: scale(1.06); }
.rune.on img { opacity: 1; filter: none; }

.tenir-wrap { display: flex; gap: 18px; align-items: center; height: 100%; width: 100%; justify-content: center; }
.tenir { position: relative; width: 96px; height: 58%; border: 2px solid var(--ink); border-radius: 10px; background: linear-gradient(#cfe7ff, #8a6a45); overflow: hidden; }
.tenir .zone { position: absolute; left: 0; right: 0; background: rgba(95,182,76,.6); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.tenir .marque { position: absolute; left: 6%; right: 6%; height: 46px; margin-top: -23px; }
.tenir .marque img { width: 100%; height: 100%; object-fit: contain; }
.btn-pousse { width: 130px; height: 130px; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 22px; }

.piece-jeu { width: 150px; height: 150px; }
.piece-jeu img { width: 100%; }
.piece-jeu.lance { animation: lancer .75s ease-out; }

/* ---------- Combat (règles OKF) ---------- */
.plein-corps.corps-combat { padding: 0; gap: 0; justify-content: stretch; align-items: stretch; }
.combat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.arena { position: relative; flex: 1; min-height: 0; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 6px 6px; overflow: hidden; }
.file { position: absolute; top: 5px; left: 6px; right: 6px; display: flex; gap: 3px; justify-content: center; z-index: 3; }
.file img { width: 26px; height: 26px; border-radius: 50%; background: rgba(244,231,198,.92); border: 2px solid #7b5a33; padding: 1px; object-fit: contain; }
.file img.e { border-color: var(--rubric); }
.file img.actif { transform: scale(1.3); box-shadow: 0 0 10px var(--fairy); border-color: var(--fairy); }
.camp { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; z-index: 1; }
.ent { position: relative; width: 31%; min-width: 96px; display: flex; flex-direction: column; align-items: center; transition: transform .2s, opacity .4s; }
.ent-moi { width: 40%; }
.ent-img { position: relative; width: 82%; aspect-ratio: 1; }
.ent-img > img, .ent-img .gluant-calques { position: absolute; inset: 0; width: 100%; height: 100%; }
.ent-info { width: 100%; background: rgba(244,231,198,.93); border: 1.5px solid #7b5a33; border-radius: 5px; padding: 2px 5px 3px; font-size: 12px; line-height: 1.15; }
.ent-info b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--rubric); }
.ent-chiffres { font-family: var(--f-sc); font-size: 10.5px; }
.pv-barre { height: 7px; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; background: #fff; margin: 1px 0; }
.pv-barre div { height: 100%; background: #5fb64c; transition: width .4s; }
.pv-barre.e div { background: var(--rouge); }
.ent-st { display: flex; flex-wrap: wrap; gap: 2px; }
.jeton-st { position: relative; width: 20px; height: 20px; }
.jeton-st img { width: 100%; }
.jeton-st b { position: absolute; right: -3px; bottom: -3px; font-size: 10px; background: var(--ink); color: var(--parch); border-radius: 6px; padding: 0 3px; font-weight: 400; }
.jeton-txt { font-size: 14px; }
.ent.mort { opacity: .35; filter: grayscale(1); }
.ent.ciblable { cursor: pointer; animation: cible .9s ease-in-out infinite; }
.ent.ciblable .ent-info { border-color: var(--fairy); box-shadow: 0 0 10px var(--fairy); }
.ent.touche { animation: touche .4s; }
.ent.attaque-a { animation: fonceA .36s; }
.ent.attaque-e { animation: fonceE .36s; }
.degat { position: absolute; top: 20%; left: 50%; translate: -50% 0; z-index: 4; font-size: 28px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); animation: monte 1s ease-out forwards; pointer-events: none; white-space: nowrap; }
.degat.soin { color: var(--gluant-light); }
.degat.bouclier { color: var(--bleu); }
.piece-anim { position: absolute; left: 50%; top: 42%; translate: -50% -50%; z-index: 6; display: none; flex-direction: column; align-items: center; gap: 4px; }
.piece-anim.vu { display: flex; animation: disparait 1.4s forwards; }
.piece-anim img { width: 90px; animation: lancer .6s ease-out; }
.piece-anim span { background: rgba(244,231,198,.95); border: 1.5px solid #7b5a33; border-radius: 6px; padding: 2px 8px; font-size: 14px; white-space: nowrap; }
.log-combat { padding: 7px 12px; min-height: 60px; max-height: 26%; overflow-y: auto; font-size: 14.5px; line-height: 1.3; border-top: 2px solid #7b5a33; border-bottom: 1px solid #7b5a33; }
.cmd-combat { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; min-height: 118px; background: repeating-linear-gradient(92deg, rgba(0,0,0,.1) 0 2px, transparent 2px 9px), linear-gradient(#4a3420, var(--wood)); align-content: start; }
.btn-capa { text-align: left; font-family: var(--f-title); font-size: 14px; line-height: 1.15; padding: 6px 8px; border-radius: 4px; border: 2px solid var(--brun); background: linear-gradient(#f6ebcf, #dcc58f); box-shadow: 0 2px 0 #120b05; }
.btn-capa b { display: block; font-weight: 400; font-size: 15px; color: var(--rubric); }
.btn-capa small { display: block; font-size: 11.5px; opacity: .85; }
.btn-capa:disabled { filter: grayscale(1) opacity(.5); }
.btn-capa.annuler { grid-column: 1 / -1; text-align: center; }
.cmd-combat .btn { width: 100%; }
.fin-combat { width: 100%; text-align: center; }
.butin { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.butin div { display: flex; align-items: center; gap: 4px; font-size: 12.5px; text-align: left; }
.butin img { width: 54px; height: 54px; }

/* ---------- Fin ---------- */
#ecran-fin { align-items: center; justify-content: center; background: url(../assets/fonds/fond_catacombes.svg) center/cover; }
.fin-boite { width: 88%; border: 2px solid #7b5a33; outline: 1px solid #7b5a33; outline-offset: -8px; border-radius: 6px; padding: 18px; text-align: center; background: rgba(244,231,198,.95); }
.fin-boite h2 { color: var(--rubric); }

.toast { position: fixed; left: 50%; top: calc(70px + var(--sat)); transform: translate(-50%, -20px); background: var(--wood); color: var(--parch); padding: 9px 16px; border-radius: 6px; font-size: 16px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 100; max-width: 88%; text-align: center; border: 1.5px solid var(--fairy); }
.toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes flotte { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rebond { 0%,100% { transform: translateY(0) scale(1,1); } 45% { transform: translateY(-14px) scale(.95,1.05); } 80% { transform: translateY(0) scale(1.08,.92); } }
@keyframes respire { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.04,.96); } }
@keyframes saut { 0% { transform: translateY(0) scale(1.1,.9); } 40% { transform: translateY(-22%) scale(.92,1.08); } 75% { transform: translateY(0) scale(1.15,.85); } 100% { transform: scale(1,1); } }
@keyframes squish { 0% { transform: scale(1.2,.78); } 50% { transform: scale(.9,1.1); } 100% { transform: scale(1,1); } }
@keyframes mange { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.08,.92); } }
@keyframes tremble { 0%,100% { transform: rotate(0); } 10% { transform: rotate(-5deg); } 20% { transform: rotate(5deg); } 30% { transform: rotate(-3deg); } 40% { transform: rotate(0); } }
@keyframes pulse { 0%,100% { transform: scale(.95); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0,0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(40px,-60px); } }
@keyframes monte { 0% { opacity: 1; transform: translateY(0) scale(.8); } 30% { transform: translateY(-20px) scale(1.15); } 100% { opacity: 0; transform: translateY(-70px) scale(1); } }
@keyframes fume { 0% { opacity: 0; transform: translateY(0); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
@keyframes brille { to { background-position: -200% 0; } }
@keyframes flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes glisseHaut { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes touche { 0%,100% { transform: translateX(0); filter: none; } 20% { transform: translateX(-10px); filter: brightness(2) saturate(0); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); filter: brightness(1.6) saturate(0); } }
@keyframes fonceA { 50% { transform: translateY(-22%) scale(1.08); } }
@keyframes fonceE { 50% { transform: translateY(22%) scale(1.08); } }
@keyframes cible { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes evolue { 0% { filter: brightness(1); transform: scale(1); } 30% { filter: brightness(4) saturate(0); transform: scale(.7); } 60% { filter: brightness(4) saturate(0); transform: scale(1.25); } 100% { filter: brightness(1); transform: scale(1); } }
@keyframes lancer { 0% { transform: translateY(0) rotateY(0); } 50% { transform: translateY(-60px) rotateY(900deg); } 100% { transform: translateY(0) rotateY(1800deg); } }
@keyframes disparait { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

@media (max-height: 640px) {
  .actions button { font-size: 12px; padding: 4px 2px; }
  .actions button i { font-size: 20px; height: 24px; }
  .actions button i img { width: 24px; height: 24px; }
  .message { min-height: 34px; font-size: 14px; }
  .ent-img { width: 68%; }
}

/* ---------- Portrait uniquement ---------- */
.paysage { display: none; }
@media (orientation: landscape) and (pointer: coarse) {
  .paysage { display: flex; position: fixed; inset: 0; z-index: 1000; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; background: #22160c; color: var(--parch); font-size: 22px; }
  .paysage .tel { font-size: 64px; animation: tourne 2.2s ease-in-out infinite; }
  .paysage p { margin: 0; }
  .paysage small { opacity: .7; font-size: 15px; }
  #app, .plein, .modal { visibility: hidden; }
}
@keyframes tourne { 0%, 20% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
