/* ================================================================
   COMBAT UI — Tela de Batalha PvP
   ================================================================ */

.combat-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.fighter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 2px solid var(--border-subtle);
  transition: var(--transition);
}

.fighter-card.active {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-gold);
  animation: glow 1.5s ease-in-out infinite;
}

.fighter-card.defeated {
  border-color: rgba(232, 64, 64, 0.4);
  opacity: 0.7;
}

.fighter-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 0.25rem;
  text-align: center;
}

.fighter-level {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.vs-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  color: #000;
  align-self: center;
  box-shadow: var(--shadow-gold);
  animation: glow 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Combat log */
.combat-log {
  background: rgba(5, 8, 16, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  height: 220px;
  overflow-y: auto;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  scroll-behavior: smooth;
}

.log-entry {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
  animation: fadeIn 0.3s ease;
}

.log-entry.damage { color: #ff8080; }
.log-entry.heal { color: #5dde90; }
.log-entry.critical { color: var(--text-gold); font-weight: 700; }
.log-entry.system { color: var(--text-cosmic); }
.log-entry.levelup { color: #ffd700; font-weight: 700; }
.log-entry.xp { color: var(--gold-300); }

/* Custom Action & Dice Roll Log Blocks */
.log-entry-action { border-left: 3px solid var(--gold-500); padding-left: 10px; margin-top: 10px; color: var(--text-primary); font-family: var(--font-display); }
.log-entry-roll { background: rgba(0,0,0,0.3); border-radius: 6px; padding: 10px; margin: 4px 0 4px 13px; font-size: 0.9em; box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05); }
.log-entry-success { margin-left: 13px; color: #5dde90; font-weight: bold; }
.log-entry-fail { margin-left: 13px; color: #ff8080; font-weight: bold; }



/* Action buttons */
.combat-actions {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.combat-actions-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-align: center;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.action-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.action-btn:hover:not(:disabled) {
  border-color: var(--gold-500);
  background: rgba(230, 168, 23, 0.08);
  transform: translateY(-2px);
}

.action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.action-btn .action-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.action-btn .action-cost {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.action-btn .action-dmg {
  font-size: 0.72rem;
  color: var(--text-gold);
}

.action-btn.technique-btn {
  border-color: rgba(61, 107, 232, 0.3);
  background: rgba(61, 107, 232, 0.05);
}

.action-btn.technique-btn:hover:not(:disabled) {
  border-color: var(--cosmic-400);
  background: rgba(61, 107, 232, 0.12);
}

.action-btn.defend-btn {
  border-color: rgba(39, 174, 96, 0.3);
  background: rgba(39, 174, 96, 0.05);
}

.action-btn.defend-btn:hover:not(:disabled) {
  border-color: #27ae60;
  background: rgba(39, 174, 96, 0.12);
}

.potions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Dice roll animation */
.dice-display {
  text-align: center;
  font-size: 2rem;
  margin: 0.5rem 0;
  animation: spin 0.3s ease;
}

/* Battle waiting */
.battle-waiting {
  text-align: center;
  padding: 3rem;
}

.battle-waiting-icon {
  font-size: 4rem;
  animation: pulse 1.5s ease-in-out infinite;
  margin-bottom: 1rem;
}

/* Win/Loss screen */
.battle-result {
  text-align: center;
  padding: 2rem;
}

.battle-result-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.victory-text {
  color: var(--text-gold);
  text-shadow: 0 0 30px rgba(230, 168, 23, 0.8);
  animation: glow 1s ease-in-out infinite;
}

.defeat-text {
  color: #ff6b6b;
  text-shadow: 0 0 30px rgba(232, 64, 64, 0.8);
}

/* ── Chat panel ── */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message {
  font-size: 0.85rem;
  animation: fadeIn 0.2s ease;
}

.chat-sender {
  color: var(--text-gold);
  font-weight: 700;
  font-family: var(--font-display);
}

.chat-level {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-text {
  color: var(--text-secondary);
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.chat-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.chat-input:focus { border-color: var(--gold-500); }

@media (max-width: 768px) {
  .combat-arena { grid-template-columns: 1fr; }
  .vs-badge { display: none; }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  
  .combat-floating-widget {
    bottom: 15px;
    right: 15px;
    left: 15px;
    min-width: unset;
    width: auto;
    padding: 0.8rem;
    z-index: 99999;
  }
}

