<div class="mournblade-chat-result">
  {{!-- Header --}}
  <div class="chat-result-header">
    {{#if actorImg}}
    <img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
    {{/if}}
    <div class="header-info">
      <h4 class="actor-name">{{alias}}</h4>
      <div class="action-title">
        <i class="fas fa-flask"></i> Préparation de Potion
      </div>
    </div>
  </div>

  {{!-- Résultat principal --}}
  <div class="result-main">
    <div class="result-display">
      <div class="dice-result">
        <i class="fas fa-dice"></i>
        <span class="dice-value">{{diceResult}}</span>
      </div>
      <div class="total-result">
        <span class="total-label">Total</span>
        <span class="total-value">{{finalResult}}</span>
      </div>
      <div class="difficulty">
        <span class="difficulty-label">SD</span>
        <span class="difficulty-value">{{difficulte}}</span>
      </div>
    </div>

    <div class="result-badge-container">
      {{#if isHeroique}}
      <div class="result-badge heroique">
        <i class="fas fa-star"></i> HÉROÏQUE !
      </div>
      {{else if isDramatique}}
      <div class="result-badge dramatique">
        <i class="fas fa-skull"></i> DRAMATIQUE !
      </div>
      {{else if isSuccess}}
      <div class="result-badge success">
        <i class="fas fa-check"></i> Succès
      </div>
      {{else}}
      <div class="result-badge failure">
        <i class="fas fa-times"></i> Échec
      </div>
      {{/if}}
    </div>
  </div>

  {{!-- Détails du jet --}}
  <div class="result-details">
    <div class="details-section">
      {{!-- Rune utilisée --}}
      <div class="detail-row rune">
        <span class="detail-label">
          {{#if runeImg}}<img class="rune-mini-img" src="{{runeImg}}" alt="{{runeName}}" />{{/if}}
          {{runeName}}
        </span>
        <span class="detail-value">Seuil : {{runeSeuil}}</span>
      </div>
      {{#if runeHautParler}}
      <div class="detail-row">
        <span class="detail-label">Haut-Parler :</span>
        <span class="detail-value potion-haut-parler"><em>«{{runeHautParler}}»</em></span>
      </div>
      {{/if}}
      <div class="detail-row">
        <span class="detail-label">Formule :</span>
        <span class="detail-value formula-text">{{diceFormula}}</span>
      </div>
      <div class="detail-row">
        <span class="detail-label">Clairvoyance :</span>
        <span class="detail-value">{{attr.value}}</span>
      </div>
      <div class="detail-row">
        <span class="detail-label">Savoir : Runes :</span>
        <span class="detail-value">{{competence.system.niveau}}</span>
      </div>
      {{#if limitHautParlerValue}}
      <div class="detail-row">
        <span class="detail-label">Limite Haut-Parler :</span>
        <span class="detail-value">{{limitHautParlerValue}}</span>
      </div>
      {{/if}}
      {{#if limitAlchimieValue}}
      <div class="detail-row">
        <span class="detail-label">Limite Alchimie :</span>
        <span class="detail-value">{{limitAlchimieValue}}</span>
      </div>
      {{/if}}
      <div class="detail-row">
        <span class="detail-label">Points d'Âme :</span>
        <span class="detail-value">{{pointsAme}}</span>
      </div>
      <div class="detail-row">
        <span class="detail-label">Forme :</span>
        <span class="detail-value">{{formeLabel}}</span>
      </div>
    </div>
  </div>

  {{!-- Résultat de la potion (visible uniquement du MJ) --}}
  {{#if isGM}}
  <div class="result-effects">
    <div class="effect-item {{#if isHeroique}}victory{{/if}}">
      {{#if isHeroique}}
      <i class="fas fa-star"></i> <strong>Potion héroïque créée</strong>
      {{else if isDramatique}}
      <i class="fas fa-skull-crossbones"></i> <strong>POISON créé (Virulence {{virulence}})</strong> — le personnage ne le sait pas
      {{else if isSuccess}}
      <i class="fas fa-flask"></i> <strong>Potion efficace créée</strong>
      {{else}}
      <i class="fas fa-times"></i> <strong>Potion inefficace</strong> — le personnage le sait
      {{/if}}
    </div>
    {{#if potionCreated}}
    <div class="effect-item">
      <i class="fas fa-plus-circle"></i> La potion a été ajoutée à l'inventaire du personnage.
    </div>
    {{/if}}
    <div class="details-section" style="margin-top:6px;">
      <div class="detail-row">
        <span class="detail-label">Durée d'effet :</span>
        <span class="detail-value">{{dureePotion}}</span>
      </div>
      <div class="detail-row">
        <span class="detail-label">Conservation :</span>
        <span class="detail-value">{{conservationPotion}}</span>
      </div>
      <div class="detail-row">
        <span class="detail-label">Temps de préparation :</span>
        <span class="detail-value">{{tempsPreparation}}</span>
      </div>
    </div>
  </div>
  {{/if}}

  {{!-- Message neutre pour le joueur --}}
  {{#unless isGM}}
  <div class="result-warning">
    <i class="fas fa-hourglass-half"></i> La préparation est en cours… le résultat sera connu bientôt.
  </div>
  {{/unless}}

</div>
