/* ═══════════════════════════════════════════════════════════════════════════
   ⚔️  ARENA BATTLE CARD — Unified component
   Used in: feed posts, arena history, arena index, profile posts
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Container ── */
.abc {
  --abc-att: #ff2d55;
  --abc-def: #007aff;
  --abc-win: #30d158;
  --abc-lose: #ff453a;
  --abc-draw: #ffd60a;
  --abc-gold: #fbbf24;
  --abc-glass: rgba(255, 255, 255, 0.03);

  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,45,85,0.04) 0%, rgba(0,122,255,0.04) 100%),
    var(--k-bg-card, #1e1e2a);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.3s ease;
}

.abc:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

/* Top gradient bar */
.abc::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--abc-att), var(--k-primary, #ff6b35), var(--abc-def));
  opacity: 0.7;
}

/* ── Fighters row ── */
.abc__fighters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 16px 12px;
  position: relative;
}

/* Fighter side */
.abc__fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.abc__fighter:hover {
  transform: scale(1.03);
}

/* Avatar circle */
.abc__ava {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.abc__fighter--att .abc__ava {
  background: linear-gradient(135deg, #ff2d55, #ff6b81);
  box-shadow: 0 0 0 3px rgba(255,45,85,0.2), 0 4px 20px rgba(255,45,85,0.3);
}

.abc__fighter--def .abc__ava {
  background: linear-gradient(135deg, #007aff, #5ac8fa);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.2), 0 4px 20px rgba(0,122,255,0.3);
}

/* Winner crown/glow */
.abc__fighter--winner .abc__ava {
  box-shadow:
    0 0 0 3px rgba(48,209,88,0.35),
    0 0 24px rgba(48,209,88,0.4),
    0 4px 20px rgba(48,209,88,0.2);
}

.abc__fighter--winner .abc__ava::after {
  content: '👑';
  position: absolute;
  top: -14px;
  font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  animation: abc-crown-float 2s ease-in-out infinite;
}

@keyframes abc-crown-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Fighter name */
.abc__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--k-text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  text-align: center;
}

.abc__fighter--att .abc__name { color: #ff6b81; }
.abc__fighter--def .abc__name { color: #64b5f6; }

/* ── VS center ── */
.abc__vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  position: relative;
}

.abc__vs-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(255,107,53,0.5));
  z-index: 2;
  position: relative;
}

.abc__vs-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,107,53,0.15);
  animation: abc-ring-pulse 3s ease-in-out infinite;
}

@keyframes abc-ring-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1); opacity: 0.8; }
}

/* ── Result banner ── */
.abc__result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px 8px;
}

.abc__result-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.abc__result-badge--win {
  background: rgba(48,209,88,0.15);
  color: #30d158;
  border: 1px solid rgba(48,209,88,0.25);
  text-shadow: 0 0 12px rgba(48,209,88,0.4);
}

.abc__result-badge--lose {
  background: rgba(255,69,58,0.12);
  color: #ff6b6b;
  border: 1px solid rgba(255,69,58,0.2);
}

.abc__result-badge--draw {
  background: rgba(255,214,10,0.12);
  color: #ffd60a;
  border: 1px solid rgba(255,214,10,0.2);
}

/* ── Stats row ── */
.abc__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px 14px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.12);
}

.abc__stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--k-text-secondary, #94a3b8);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.04);
}

.abc__stat-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.abc__stat-val {
  font-weight: 700;
  color: var(--k-text-primary, #f8fafc);
}

/* Gold highlight */
.abc__stat--gold .abc__stat-val {
  color: var(--abc-gold);
}

/* ELO positive / negative */
.abc__stat--elo-up .abc__stat-val {
  color: var(--abc-win);
}

.abc__stat--elo-down .abc__stat-val {
  color: var(--abc-lose);
}

/* ── Mini variant (for profile posts, recent list) ── */
.abc--mini {
  border-radius: 12px;
}

.abc--mini .abc__fighters {
  padding: 14px 12px 8px;
  gap: 0;
}

.abc--mini .abc__ava {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.abc--mini .abc__vs {
  width: 48px;
  height: 48px;
}

.abc--mini .abc__vs-icon {
  font-size: 22px;
}

.abc--mini .abc__name {
  font-size: 12px;
  max-width: 100px;
}

.abc--mini .abc__fighter--winner .abc__ava::after {
  font-size: 12px;
  top: -10px;
}

.abc--mini .abc__stats {
  padding: 8px 12px 10px;
  gap: 4px;
}

.abc--mini .abc__stat {
  padding: 3px 8px;
  font-size: 11px;
}

/* ── Inline variant (for arena history list rows) ── */
.abc--row {
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
}

.abc--row::before {
  height: 0;
}

.abc--row .abc__fighters {
  padding: 0;
  flex: 0 0 auto;
  gap: 0;
}

.abc--row .abc__ava {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.abc--row .abc__vs {
  width: 36px;
  height: 36px;
}

.abc--row .abc__vs-icon {
  font-size: 18px;
}

.abc--row .abc__vs-ring {
  display: none;
}

.abc--row .abc__name {
  font-size: 12px;
  max-width: 90px;
}

.abc--row .abc__fighter--winner .abc__ava::after {
  font-size: 11px;
  top: -10px;
}

.abc--row .abc__stats {
  padding: 0;
  border: 0;
  background: none;
  flex: 1;
  justify-content: flex-end;
  gap: 4px;
}

.abc--row .abc__stat {
  padding: 2px 8px;
  font-size: 11px;
}

.abc--row .abc__result {
  padding: 0;
  flex: 0 0 auto;
}

/* ── Actions (share button, etc.) ── */
.abc__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .abc__ava {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .abc__vs {
    width: 48px;
    height: 48px;
  }

  .abc__name {
    font-size: 12px;
    max-width: 80px;
  }

  .abc__stats {
    gap: 4px;
    padding: 8px 10px 12px;
  }

  .abc__stat {
    padding: 3px 7px;
    font-size: 11px;
  }

  .abc--row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .abc--row .abc__stats {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

/* ── Light theme override ── */
[data-theme="light"] .abc,
.light-theme .abc {
  background:
    linear-gradient(135deg, rgba(255,45,85,0.03) 0%, rgba(0,122,255,0.03) 100%),
    var(--k-bg-card, #fff);
  border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .abc:hover,
.light-theme .abc:hover {
  border-color: rgba(0,0,0,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

[data-theme="light"] .abc__stats,
.light-theme .abc__stats {
  background: rgba(0,0,0,0.02);
  border-top-color: rgba(0,0,0,0.05);
}

[data-theme="light"] .abc__stat,
.light-theme .abc__stat {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.05);
  color: #64748b;
}

[data-theme="light"] .abc__stat-val,
.light-theme .abc__stat-val {
  color: #1e293b;
}

[data-theme="light"] .abc__fighter--att .abc__name,
.light-theme .abc__fighter--att .abc__name { color: #e0245e; }

[data-theme="light"] .abc__fighter--def .abc__name,
.light-theme .abc__fighter--def .abc__name { color: #1a73e8; }
