/* =========================================================
   v0.76 : ÉCRAN DE COMBAT UNIFIÉ (Expédition, Fléaux, Cave, Raid, Entraînement, ouverture)
   Dans la page (plein écran en option) : bandeau du haut (manche, frise, commandes), scène sur toute la largeur,
   formation en groupe, colonne de droite (vos héros, grille des alliés façon HealBot), barre du bas.
   ========================================================= */

/* ---------- v0.76.2 : dans la page par défaut, plein écran en option (Options ▾) ---------- */
.battle-layout.bv-e.uni { position: relative; height: clamp(520px, calc(100vh - 150px), 920px); margin: 0; padding: 0; overflow: hidden; border: 1px solid rgba(201, 162, 74, .45);
  border-radius: 6px; background: #070a16 !important; opacity: 1; backdrop-filter: none; }
.battle-layout.bv-e.uni.full { position: fixed; inset: 0; z-index: 45; height: auto; border: 0; border-radius: 0; }
.bv-e.uni .bv-fs { display: none; }
.bv-e.uni .bv-body, .bv-e.uni .bv-main { position: absolute !important; inset: 0; display: block; margin: 0; padding: 0; }
.bv-e.uni .field, .bv-e.uni.v34 .field { position: absolute; inset: 0; width: auto; height: auto !important; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }

/* Bandeau du haut */
.bv-e.uni .bv-top { position: absolute; left: 0; right: 0; top: 0; z-index: 30; height: 56px; margin: 0; padding: 0 12px; display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .55)); border: 0; border-radius: 0; box-shadow: none; }
.bv-e.uni .bv-round { flex: none; display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.bv-e.uni .bv-rn { font-family: var(--font-title); font-size: 22px; letter-spacing: .06em; text-transform: uppercase; color: #f2ede0; text-shadow: 0 2px 0 #000, 0 0 6px #000; }
.bv-e.uni .bv-sub { display: block; max-width: 300px; font-size: 11px; color: #c9c3b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bv-e.uni .bv-phase { display: block; font-size: 10.5px; font-weight: 700; color: #a8a496; white-space: nowrap; }
.bv-e.uni .bv-phase.done { color: #8fe0a0; } .bv-e.uni .bv-phase.play { color: #ffcf40; }
/* Frise : visages ronds */
.bv-e.uni .bv-order { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; background: none; border: 0; overflow: hidden; }
.bv-e.uni .ord-row { flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0; border: 0; }
.bv-e.uni .ord-row.next { margin: 0; padding: 0; border: 0; }
.bv-e.uni .ord-lab { display: none; }
.bv-e.uni .ord-row.next .ord-lab { display: inline; width: auto; margin: 0 2px 0 4px; font-size: 10px; font-weight: 600; color: #9a9484; text-transform: none; letter-spacing: 0; }
.bv-e.uni .ord { position: relative; width: 34px; height: 34px; flex: none; padding: 0; border-radius: 50%; overflow: hidden; justify-content: flex-end;
  background: #141a33; border: 1px solid rgba(255, 255, 255, .3); }
.bv-e.uni .ord.enemy { background: #3a1410; border-color: #ff8a7a; }
.bv-e.uni .ord.cur { border: 2px solid #ffe27a; box-shadow: 0 0 8px #ffcf40; }
.bv-e.uni .ord.ko { filter: grayscale(1) brightness(.5); }
.bv-e.uni .ord .px, .bv-e.uni .ord img, .bv-e.uni .ord canvas { height: 34px; margin-bottom: -4px; }
.bv-e.uni .ord b, .bv-e.uni .ord .ord-tag, .bv-e.uni .ord .own-bar { display: none; }
.bv-e.uni .ord.small { width: 22px; height: 22px; opacity: .75; }
.bv-e.uni .ord.small .px, .bv-e.uni .ord.small img { height: 22px; margin-bottom: -3px; }
/* Commandes en pastilles */
.bv-e.uni .bv-controls { flex: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; background: none; border: 0; }
.bv-e.uni .bv-controls .grow, .bv-e.uni .bv-controls .bv-help, .bv-e.uni .bv-controls .hint, .bv-e.uni .bv-padhint,
.bv-e.uni .bv-controls .bv-pfx, .bv-e.uni .bv-controls .bv-v34 { display: none !important; }
.bv-e.uni .bv-top .btn-small { height: 30px; min-height: 0; padding: 0 12px; border-radius: 15px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .28);
  color: #f2ede0; font-size: 13px; font-weight: 700; box-shadow: none; white-space: nowrap; clip-path: none; }
.bv-e.uni .bv-top .btn-small:hover:not(:disabled) { border-color: #e2bd5f; }
.bv-e.uni .bv-top .btn-small:disabled { opacity: .45; }
.bv-e.uni .bv-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.bv-e.uni .bv-extra { flex: none; display: flex; align-items: center; gap: 6px; }
.bv-e.uni .bv-extra:empty { display: none; }
.bv-e.uni .bv-top .bv-fsq.on { border-color: #ffcf40; color: #ffcf40; }
.bv-e.uni .bv-top .bv-xgold { border-color: #c9a24a; color: #ffe27a; }
.bv-e.uni .bv-top .bv-xgo { border-color: #ffcf40; color: #ffcf40; }
.bv-e.uni .bv-clock { flex: none; font-size: 13px; font-weight: 900; color: #ffcf40; } .bv-e.uni .bv-clock.low { color: #ff6a5a; }
/* « Jouer la manche » : en bas à droite */
.bv-e.uni .bv-end { position: absolute; right: 14px; bottom: 8px; z-index: 40; height: 40px; padding: 0 20px; border-radius: 6px; background: rgba(0, 0, 0, .75); clip-path: none; box-shadow: none; min-height: 0;
  border: 2px solid #ffcf40; color: #ffcf40; font-size: 15px; font-weight: 900; }
.bv-e.uni .bv-end:disabled { opacity: .4; }
.bv-e.uni.ended .bv-end { display: none; }
/* Menu Options */
.bv-optmenu { position: absolute; right: 100px; top: 50px; z-index: 60; display: grid; gap: 2px; min-width: 270px; padding: 6px; border-radius: 8px;
  background: rgba(8, 10, 22, .97); border: 1px solid #c9a24a; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.bv-optmenu button { display: block; width: 100%; padding: 9px 10px; text-align: left; border: 0; border-radius: 4px; background: none; box-shadow: none; color: #f2ede0; font-size: 13.5px; font-weight: 600; clip-path: none; }
.bv-optmenu button:hover { background: rgba(201, 162, 74, .22); }
.bv-optmenu button b { color: #ffe27a; } .bv-optmenu button small { color: #a8a496; font-weight: 400; }

/* Scène : fenêtres flottantes, annonces, journal, barre du bas */
.bv-e.uni .bv-float { left: 12px; right: auto; top: 66px; align-items: flex-start; max-height: calc(100% - 140px); z-index: 16; }
.bv-e.uni .bv-intent { top: 64px; left: 50%; right: auto; transform: translateX(-50%); max-width: 40%; z-index: 17; }
.bv-e.uni .stage-log { left: 14px; right: auto; bottom: 64px; top: auto; max-width: 38%; z-index: 15; }
.bv-e.uni .bv-desc { left: 0; right: 230px; bottom: 0; min-height: 56px; z-index: 25; background: linear-gradient(0deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .6) 75%, rgba(0, 0, 0, 0)); }
.bv-e.uni .bv-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; z-index: 12; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0)); }
/* Menu de commandes en escalier : à gauche, sous-menu à droite */
@media (min-width: 701px) {
  .bv-e.uni .bv-cmd { left: 10px; top: 150px; }
  .bv-e.uni .bv-cmd .cmd-sub { left: calc(100% + 6px); right: auto; }
}

/* Formation : compagnie en bas à droite, ennemis en haut à gauche (positions posées par BattleView.placeAlly / placeEnemy) */
.bv-e.uni .bv-enemies .enemy-actor[style] { left: var(--ax) !important; top: var(--ay) !important; z-index: var(--az) !important; }
.bv-e.uni .party-area .hero-actor[style], .bv-e.uni .party-area.many .hero-actor[style] { left: var(--ax) !important; top: var(--ay) !important; z-index: var(--az) !important;
  transform: translate(-50%, -100%) !important; }
.bv-e.uni .hero-actor.other { opacity: 1; }
.bv-e.uni .hero-actor .hero-mini { width: 54px; }

/* Colonne de droite : vos héros (lignes), puis les alliés (grille) */
.bv-e.uni .bv-right { position: absolute; right: 0; top: 62px; bottom: 62px; width: 370px; z-index: 20; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.bv-e.uni .bv-rh { display: flex; justify-content: space-between; align-items: baseline; padding: 0 10px 0 50px; text-shadow: 0 2px 0 #000, 0 0 6px #000; }
.bv-e.uni .bv-rh b { font-family: var(--font-title); font-size: 15px; color: #f2ede0; } .bv-e.uni .bv-rh small { font-size: 10.5px; color: #b9b3a2; }
.bv-e.uni .bv-cards, .bv-e.uni.v34 .bv-cards, .bv-e.uni.v34:not(.has-others) .bv-cards { position: static !important; width: auto !important; max-height: none !important;
  display: flex !important; flex-direction: column; gap: 3px; margin: 0; padding: 0; }
.bv-e.uni .bv-others { position: static; width: auto; max-height: none; margin: 0 8px 0 0; padding: 0; background: none; border: 0; box-shadow: none; }
.bv-e.uni .bv-gh { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 3px; text-shadow: 0 1px 2px #000; }
.bv-e.uni .bv-gh b { font-family: var(--font-title); font-size: 15px; color: #f2ede0; } .bv-e.uni .bv-gh small { font-size: 10.5px; color: #b9b3a2; }
.bv-e.uni .bv-others .tcf-cell { cursor: default; }
.bv-e.uni .bv-others .tcf-cell .fill.hp { position: absolute; left: 0; top: 0; bottom: 8px; height: auto; }

/* Lignes de vos héros : plus compactes (état de l'ordre sur la ligne du nom) */
.bv-e.uni .bv-cards .card.c34 { position: relative; grid-template-columns: 34px 12px minmax(0, 1fr); min-height: 50px; padding-top: 3px; padding-bottom: 3px; }
.bv-e.uni .bv-cards .c34-face { display: none; }
.bv-e.uni .bv-cards .card-state { position: absolute; right: 12px; top: 5px; margin: 0; font-size: 11px; }
.bv-e.uni .bv-cards .c34-head { padding-right: 110px; }
.bv-e.uni .bv-cards .c34-sub { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: 10px; }

/* Chat du raid : panneau repliable en bas à gauche */
.bv-chat { position: absolute; left: 12px; bottom: 64px; z-index: 35; width: 340px; display: flex; flex-direction: column; gap: 4px; }
.bv-chat .raid-chat { position: static; display: block; margin: 0; width: auto; max-height: 260px; overflow: auto; }
.bv-chat.closed .raid-chat { display: none; }
.bv-chat .bv-chatbtn { align-self: flex-start; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .28); color: #f2ede0; clip-path: none; box-shadow: none; }

/* ---------- Téléphone tenu droit : scène en haut, héros dessous, commandes en bas ---------- */
@media (max-width: 700px) {
  .battle-layout.bv-e.uni:not(.full) { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  .bv-e.uni .bv-top { height: auto; min-height: 44px; flex-wrap: wrap; row-gap: 4px; gap: 6px; padding: 4px 6px; }
  .bv-e.uni .bv-rn { font-size: 16px; } .bv-e.uni .bv-sub, .bv-e.uni .bv-phase { display: none; }
  .bv-e.uni .bv-order { flex: 1 1 calc(100% - 110px); }
  .bv-e.uni .ord { width: 26px; height: 26px; } .bv-e.uni .ord .px, .bv-e.uni .ord img { height: 26px; }
  .bv-e.uni .ord-row.next { display: none; }
  .bv-e.uni .bv-acts { flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .bv-e.uni .bv-extra, .bv-e.uni .bv-controls { flex-wrap: nowrap; }
  .bv-e.uni .bv-cmd { bottom: 56px; z-index: 50; }
  .bv-e.uni .hero-actor .hero-mini { width: 34px; }
  .bv-e.uni .bv-top .btn-small { height: 28px; padding: 0 9px; font-size: 12px; }
  .bv-e.uni .field, .bv-e.uni.v34 .field { bottom: auto; height: 38vh !important; top: 74px; }
  .bv-e.uni .party-area .hero-actor[style], .bv-e.uni .party-area.many .hero-actor[style] { left: var(--axm) !important; }
  .bv-e.uni .bv-enemies .enemy-actor[style] { left: var(--axm) !important; }
  .bv-e.uni .bv-float { top: 6px; left: 6px; }
  .bv-e.uni .bv-intent { top: 6px; max-width: 70%; }
  .bv-e.uni .bv-right { top: calc(78px + 38vh); bottom: 56px; width: auto; left: 0; }
  .bv-e.uni .bv-cards, .bv-e.uni.v34 .bv-cards, .bv-e.uni.v34:not(.has-others) .bv-cards { display: grid !important; grid-template-columns: 1fr 1fr !important; }
  .bv-e.uni .bv-cards .card.c34 { grid-template-columns: 10px 8px minmax(0, 1fr); min-height: 42px; }
  .bv-e.uni .bv-cards .c34-sub, .bv-e.uni .bv-cards .c34-face, .bv-e.uni .bv-cards .res-line, .bv-e.uni .bv-cards .chan-line,
  .bv-e.uni .bv-cards .card-state, .bv-e.uni .bv-cards .c34-lv, .bv-e.uni .bv-cards .c34-fx { display: none; }
  .bv-e.uni .bv-cards .c34-head { padding-right: 0; }
  .bv-e.uni .bv-cards .card.c34.acted strong::after { content: " ✓"; color: #8fe0a0; }
  .bv-e.uni .bv-rh { padding-left: 10px; }
  .bv-e.uni .bv-desc { right: 0; bottom: 56px; }
  .bv-e.uni .bv-end { left: 8px; right: 8px; bottom: 8px; height: 40px; }
  .bv-optmenu { right: 6px; top: 70px; }
  .bv-chat { left: 6px; right: 6px; width: auto; bottom: 56px; }
}

/* ---------- v0.76 : Brèche alignée sur les autres combats ---------- */
/* Décor du combat sous la carte (inclinée), sprites plus grands */
.tc-scene { position: fixed; inset: 0; z-index: 44; pointer-events: none; }
.tc-scene.hidden { display: none; }
body.tc-full .tcf { background: transparent; }
body.tc-full .tcf-stage { background: radial-gradient(ellipse 75% 70% at 45% 55%, rgba(8, 8, 16, .2) 0%, rgba(4, 4, 10, .55) 70%, rgba(0, 0, 0, .8) 100%); }
body.tc-full .tc-hex:not(.pillar):not(.altar):not(.portal):not(.red):not(.reach):not(.start):not(.aim):not(.aimu):not(.prev):not(.selh):not(.threat) { fill-opacity: .55; }
.tcf .tc-spr { transform: scale(calc(var(--tcz, 1) * 1.35)); }
/* Bandeau : pastille Options et son menu */
.tcf-optw { position: relative; display: inline-flex; }
.tcf-optmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 250px; padding: 6px; border-radius: 8px;
  background: rgba(8, 10, 22, .97); border: 1px solid #c9a24a; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.tcf-optmenu button { display: block; width: 100%; padding: 9px 10px; text-align: left; border: 0; border-radius: 4px; background: none; box-shadow: none; color: #f2ede0; font-size: 13.5px; font-weight: 600; clip-path: none; }
.tcf-optmenu button:hover { background: rgba(201, 162, 74, .22); } .tcf-optmenu button b { color: #ffe27a; }
/* « Lancer la manche » en bas à droite, comme « Jouer la manche » */
@media (min-width: 701px) {
  .tcf .tcf-end { position: fixed; right: 14px; bottom: 8px; z-index: 9; display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; margin: 0; }
  .tcf .tcf-end small { max-width: 260px; text-align: right; }
  .tcf .tcf-end .tcf-go { height: 40px; padding: 0 20px; border-radius: 6px; font-weight: 900; font-size: 15px; }
  .tcf .tcf-end small { text-shadow: 0 1px 2px #000; }
  .tcf .tcf-bot { right: 560px; }
}
