/* ===================================================
   KURO ARCANA — Combat en ligne (classes .lg-*) : invitations, compte à rebours, émotes, fin de partie.
   =================================================== */
.lg-defis { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 1100; translate: -50% 0; width: min(94vw, 440px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.lg-defis[hidden] { display: none; }
.lg-carte {
  pointer-events: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; color: #f3e9ff;
  border: 2px solid var(--or-dore, #ffd700); background: linear-gradient(180deg, #2a0c36, #0d050d); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(220, 20, 60, 0.35);
  animation: lg-arrivee 0.25s ease-out;
}
.lg-titre { margin: 0; font-size: 18px; font-weight: 800; color: var(--or-dore, #ffd700); }
.lg-texte { margin: 0; font-size: 16px; }
.lg-reste { color: #fff; font-variant-numeric: tabular-nums; }
.lg-actions { display: flex; gap: 8px; }
.lg-bouton {
  flex: 1; min-height: 44px; padding: 0 14px; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer;
  border: 1px solid rgba(255, 215, 0, 0.5); background: linear-gradient(180deg, #3a0f4a, #1a0820);
}
.lg-bouton:disabled { opacity: 0.5; cursor: default; }
.lg-principal { border-color: #fff3a0; background: linear-gradient(180deg, #b8860b, #6b4a00); }
@keyframes lg-arrivee { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Compte à rebours du tour (barre d'instruction) */
.lg-chrono {
  flex: none; min-width: 64px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px;
  border-radius: 12px; font-size: 16px; color: #fff; border: 1px solid rgba(255, 215, 0, 0.45); background: rgba(20, 8, 24, 0.85); font-variant-numeric: tabular-nums;
}
.lg-chrono b { font-size: 18px; color: var(--or-dore, #ffd700); }
.lg-urgent { border-color: #dc143c; box-shadow: 0 0 12px rgba(220, 20, 60, 0.6); }
.lg-urgent b { color: #ff6b78; }

/* Émotes : choix au-dessus des commandes, bulles près de chaque joueur */
.lg-emotes { position: absolute; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid rgba(255, 215, 0, 0.5); background: rgba(20, 8, 24, 0.95); }
.lg-emote { padding: 0 4px; font-size: 16px; }
.lg-bulle {
  position: absolute; z-index: 11; right: 16px; padding: 8px 14px; border-radius: 16px; font-size: 18px; font-weight: 800; color: #1a0820;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6); pointer-events: none; animation: lg-arrivee 0.2s ease-out;
}
.lg-bulle-lui { top: 64px; }
.lg-bulle-moi { bottom: calc(150px + env(safe-area-inset-bottom)); }
.lg-raison { color: #ffb3bf; }
@media (min-width: 1024px) {
  .lg-emotes { left: auto; right: 16px; width: 360px; bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) { .lg-carte, .lg-bulle { animation: none; } }

/* Pendant une partie, l’indicateur de sauvegarde ne recouvre pas la barre d’instruction */
body.cb-page-active #cpt-etat { display: none; }
