/* =====================================================================
   PVP DUEL — modal global de invitación + screen del duelo manual
   ===================================================================== */

/* ============== MODAL DE INVITACIÓN ============== */
.duel-inv-modal {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 24px;
  background: linear-gradient(135deg, rgba(120,30,40,0.95), rgba(50,15,25,0.95));
  border: 1px solid rgba(255,90,140,0.55);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255,90,140,0.30);
  overflow: hidden;
  animation: dimFadeIn 0.4s ease-out;
}
@keyframes dimFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.duel-inv-glow {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,90,140,0.20) 0%, transparent 50%);
  pointer-events: none;
  animation: dimGlowPulse 2.4s ease-in-out infinite;
}
@keyframes dimGlowPulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.85; }
}
.duel-inv-icon {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,90,140,0.30), rgba(220,40,80,0.10));
  border: 2px solid rgba(255,90,140,0.6);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255,90,140,0.4);
}
.duel-inv-icon i {
  font-size: 44px;
  color: #ff7a9f;
  animation: dimIconShake 1.6s ease-in-out infinite;
}
@keyframes dimIconShake {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg); }
}
.duel-inv-tag {
  position: relative;
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, #ff5a8c, #ff3a6c);
  border-radius: 99px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  box-shadow: 0 0 14px rgba(255,90,140,0.45);
}
.duel-inv-title {
  position: relative;
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 22px;
  font-weight: 800;
  color: #ffd0dc;
  margin-bottom: 14px;
  text-shadow: 0 0 14px rgba(255,90,140,0.45);
}
.duel-inv-attacker {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(255,90,140,0.10);
  border: 1px solid rgba(255,90,140,0.35);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #fff;
}
.duel-inv-attacker i { color: #ff7a9f; font-size: 18px; }
.duel-inv-zone {
  position: relative;
  font-size: 12px;
  color: var(--text-muted, #aaa);
  margin-bottom: 14px;
}
.duel-inv-zone i { margin-right: 4px; }
.duel-inv-format {
  position: relative;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}
.duel-inv-warning {
  position: relative;
  font-size: 12px;
  color: #ffc857;
  margin-bottom: 16px;
}
.duel-inv-warning i { margin-right: 4px; }
.duel-inv-actions { position: relative; }
.duel-inv-actions .btn {
  font-size: 16px;
  padding: 14px 20px;
}

/* ============== SCREEN DEL DUELO ============== */
.duel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(60,20,40,0.55), rgba(30,10,25,0.55));
  border: 1px solid rgba(255,90,140,0.30);
}
.duel-rounds {
  display: flex; gap: 10px;
}
.duel-round-pip {
  position: relative;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  font-weight: 800;
  color: var(--text-muted);
}
.duel-round-pip.is-played { background: rgba(184,132,255,0.10); border-color: rgba(184,132,255,0.45); color: #c2a8ff; }
.duel-round-pip.is-current {
  background: linear-gradient(135deg, rgba(255,200,80,0.20), rgba(255,180,80,0.05));
  border-color: rgba(255,200,80,0.7);
  color: #ffd47a;
  box-shadow: 0 0 12px rgba(255,200,80,0.35);
  animation: durRoundCurrent 2s ease-in-out infinite;
}
@keyframes durRoundCurrent {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.duel-round-num { font-size: 16px; }
.duel-round-flag {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}
.duel-round-flag.is-a { background: #5fd684; color: #fff; }
.duel-round-flag.is-b { background: #ff5a8c; color: #fff; }
.duel-score {
  font-family: var(--font-mono, monospace);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.duel-score-a { color: #5fd684; }
.duel-score-b { color: #ff7a9f; }
.duel-score-sep { margin: 0 8px; color: var(--text-muted); }

/* Arena */
.duel-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
  align-items: center;
  background: linear-gradient(135deg, rgba(40,20,40,0.55), rgba(20,10,30,0.55));
}
.duel-fighter {
  padding: 14px;
  background: rgba(0,0,0,0.30);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.duel-fighter.is-me { border-color: rgba(95,214,132,0.4); }
.duel-fighter.is-opp { border-color: rgba(255,122,159,0.4); }
.duel-fighter-name {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 2px;
}
.duel-fighter-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.duel-fighter-empty { text-align: center; color: var(--text-dim); font-size: 24px; }
.duel-bar {
  position: relative;
  height: 22px;
  background: rgba(0,0,0,0.5);
  border-radius: 99px;
  margin-bottom: 5px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.duel-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.duel-bar-hp .duel-bar-fill { background: linear-gradient(90deg, #b9303a, #f8838e); }
.duel-bar-mp .duel-bar-fill { background: linear-gradient(90deg, #1f7fc7, #4cc4ff); }
.duel-bar-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.duel-vs {
  font-size: 32px;
  color: var(--gold);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(255,200,80,0.5);
}

/* Acciones (turno del jugador) */
.duel-actions {
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(95,214,132,0.06);
  border: 1px solid rgba(95,214,132,0.40);
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(95,214,132,0.15);
}
.duel-actions-title {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5fd684;
  margin-bottom: 10px;
  text-align: center;
}
.duel-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.duel-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
}
.duel-action-btn:hover:not(.is-disabled):not(:disabled) {
  border-color: var(--gold);
  background: rgba(233,185,99,0.12);
  transform: translateY(-1px);
}
.duel-action-btn i { font-size: 20px; color: var(--gold); }
.duel-action-btn span { font-weight: 700; }
.duel-action-btn small { font-size: 10px; color: var(--text-muted); }
.duel-action-btn.is-disabled, .duel-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.duel-attack i { color: #f8838e; }
.duel-skill i { color: #c2a8ff; }

.duel-waiting {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px;
  background: rgba(184,132,255,0.06);
  border: 1px dashed rgba(184,132,255,0.35);
  border-radius: 10px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Intermission */
.duel-intermission {
  margin-bottom: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(184,132,255,0.10), rgba(110,58,204,0.05));
  border: 1px solid rgba(184,132,255,0.4);
}
.duel-int-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.duel-int-header > i { font-size: 28px; color: #c2a8ff; }
.duel-int-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: #d8c2ff;
}
.duel-int-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.duel-int-sub b {
  color: var(--text);
  font-family: var(--font-mono);
}

.duel-coin-section, .duel-potion-section {
  padding: 12px 14px;
  background: rgba(0,0,0,0.28);
  border-radius: 8px;
  margin-top: 10px;
}
.duel-coin-title, .duel-potion-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.duel-coin-buttons {
  display: flex; gap: 10px; justify-content: center;
}
.duel-coin-buttons .btn { min-width: 110px; }
.duel-coin-result {
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.duel-coin-flip-result {
  display: inline-block;
  padding: 2px 10px;
  background: linear-gradient(135deg, #ffc857, #e9b963);
  border-radius: 99px;
  color: #1a1a1a;
  font-weight: 800;
}
.duel-potion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.duel-potion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}
.duel-potion-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(233,185,99,0.10);
}
.duel-potion-btn i { font-size: 18px; color: #5fd684; }
.duel-potion-btn small { color: var(--text-muted); }

/* Log */
.duel-log-section {
  padding: 12px 14px;
  background: rgba(0,0,0,0.32);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.duel-log-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.duel-log-body {
  max-height: 240px;
  overflow-y: auto;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.duel-log-line {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
}
.duel-log-line.is-me { background: rgba(95,214,132,0.06); }
.duel-log-line.is-opp { background: rgba(255,122,159,0.06); }
.duel-log-line i { font-size: 13px; flex-shrink: 0; }
.dl-crit { color: #ff5a8c; font-weight: 800; }
.dl-heal { color: #5fd684; font-weight: 700; }
.dl-mp { color: #4cc4ff; font-weight: 700; }

/* ============== WAITING (status=invited) ============== */
.duel-waiting-card {
  position: relative;
  max-width: 480px;
  margin: 30px auto;
  padding: 32px 28px 26px;
  background: linear-gradient(135deg, rgba(60,30,80,0.88), rgba(30,20,50,0.95));
  border: 1px solid rgba(184,132,255,0.5);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 0 32px rgba(184,132,255,0.20);
  overflow: hidden;
}
.duel-waiting-glow {
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(184,132,255,0.18) 0%, transparent 50%);
  pointer-events: none;
  animation: dwGlowPulse 3s ease-in-out infinite;
}
@keyframes dwGlowPulse {
  0%,100% { opacity: 0.5; }
  50%     { opacity: 0.9; }
}
.duel-waiting-icon {
  position: relative; width: 80px; height: 80px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(184,132,255,0.30), rgba(157,108,255,0.10));
  border: 2px solid rgba(184,132,255,0.6);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(184,132,255,0.4);
}
.duel-waiting-icon i {
  font-size: 42px;
  color: #c2a8ff;
  animation: dwHourglass 1.4s ease-in-out infinite;
}
@keyframes dwHourglass {
  0%,100% { transform: rotate(0); }
  50%     { transform: rotate(180deg); }
}
.duel-waiting-tag {
  position: relative;
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #b884ff, #9c6cef);
  border-radius: 99px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.duel-waiting-title {
  position: relative;
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 20px;
  font-weight: 800;
  color: #d8c2ff;
  margin-bottom: 12px;
}
.duel-waiting-body {
  position: relative;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 18px;
}
.duel-waiting-body b {
  color: #ffc857;
  font-family: var(--font-mono, monospace);
  font-size: 18px;
}
.duel-waiting-bar {
  position: relative;
  height: 8px;
  background: rgba(0,0,0,0.5);
  border-radius: 99px;
  overflow: hidden;
}
.duel-waiting-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b884ff, #ff5a8c);
  border-radius: 99px;
  transition: width 0.2s linear;
}

/* ============== RESULT CARD (expired_auto) ============== */
.duel-result-card {
  max-width: 480px;
  margin: 30px auto;
  padding: 30px 26px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  text-align: center;
}
.duel-result-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,200,80,0.10);
  border: 1px solid rgba(255,200,80,0.3);
  border-radius: 99px;
  color: #ffc857;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.duel-result-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  margin: 12px 0 18px;
}
.duel-result-meta {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
}
.duel-result-meta > div {
  margin: 6px 0;
}
.duel-result-meta i { margin-right: 6px; }
/* 2026-05-18: nota explicativa del split 3%/5% del oro PvP. */
.duel-result-note {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(126, 158, 255, 0.08);
  border: 1px solid rgba(126, 158, 255, 0.25);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted, #b8b8b8);
  line-height: 1.45;
}
.duel-result-note i {
  color: #7e9eff;
}
.duel-result-note b { color: var(--text, #fff); }
.duel-result-actions {
  display: flex;
  justify-content: center;
}

/* Mobile */
@media (max-width: 600px) {
  .duel-arena { grid-template-columns: 1fr; gap: 8px; }
  .duel-vs { display: none; }
  .duel-actions-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
  .duel-action-btn { padding: 8px 6px; font-size: 11px; }
  .duel-action-btn i { font-size: 18px; }
  .duel-coin-buttons { flex-direction: column; }
  .duel-coin-buttons .btn { width: 100%; }
  .duel-potion-grid { grid-template-columns: 1fr 1fr; }
  .duel-inv-modal { margin: 16px; padding: 22px 16px; }
  .duel-inv-icon { width: 60px; height: 60px; }
  .duel-inv-icon i { font-size: 32px; }
  .duel-inv-title { font-size: 18px; }
  .duel-score { font-size: 22px; }
  .duel-round-pip { width: 38px; height: 38px; }
}

/* =====================================================================
   ADD-ONS PvP DUEL — reusa todas las clases cs-* de combat.js verbatim.
   Aquí sólo agregamos lo PvP-específico que combat.js no tiene:
   - Pips de rondas (R1/R2/R3 con flags)
   - Intermission panel (countdown, coin flip, potions)
   - Forfeit / Cancel buttons
   - Log lines coloreadas por actor (yo/oponente/system)
   ===================================================================== */

/* Pips de rondas (debajo del cs-field) */
.cspd-rounds-row {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 18px 8px;
}
.cspd-pip {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.55);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 99px;
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.cspd-pip.is-played { background: rgba(184,132,255,0.15); border-color: rgba(184,132,255,0.45); color: #d8c2ff; }
.cspd-pip.is-current {
  background: linear-gradient(135deg, rgba(255,200,80,0.22), rgba(255,180,80,0.05));
  border-color: rgba(255,200,80,0.7);
  color: #ffd47a;
  box-shadow: 0 0 14px rgba(255,200,80,0.45);
  animation: cspdPipPulse 1.8s ease-in-out infinite;
}
@keyframes cspdPipPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.cspd-pip-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
  border: 1.5px solid rgba(0,0,0,0.6);
}
.cspd-pip-flag.is-a { background: #5fd684; color: #003914; }
.cspd-pip-flag.is-b { background: #ff5a8c; color: #4a0017; }

/* Waiting bar (esperando turno del oponente) — usa cs-action-bar como base */
.cspd-waiting-bar {
  background: linear-gradient(180deg, rgba(40,20,60,0.65), rgba(20,10,40,0.55)) !important;
  border-color: rgba(184,132,255,0.4) !important;
}
.cspd-waiting-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px;
  color: #d8c2ff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cspd-waiting-row i { font-size: 18px; color: #b884ff; }

/* Intermission bar — reemplaza la action bar durante el descanso */
.cspd-int-bar {
  background: linear-gradient(180deg, rgba(60,30,80,0.65), rgba(30,18,50,0.65)) !important;
  border-color: rgba(184,132,255,0.4) !important;
  box-shadow: 0 0 22px rgba(184,132,255,0.18), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
.cspd-int-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(184,132,255,0.18);
}
.cspd-int-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(184,132,255,0.30), rgba(157,108,255,0.10));
  border: 2px solid rgba(184,132,255,0.6);
  border-radius: 50%;
  flex-shrink: 0;
}
.cspd-int-icon i {
  font-size: 22px;
  color: #c2a8ff;
  animation: cspdIntPulse 1.6s ease-in-out infinite;
}
@keyframes cspdIntPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.12); opacity: 0.8; }
}
.cspd-int-title {
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 16px;
  font-weight: 800;
  color: #e7d2ff;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.cspd-int-sub {
  font-size: 13px;
  color: var(--text);
}
.cspd-int-sub b {
  color: #ffc857;
  font-family: var(--font-mono, monospace);
  font-size: 17px;
  margin-left: 4px;
}
.cspd-int-section {
  padding: 10px 12px;
  margin-top: 8px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.cspd-int-section-title {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.cspd-int-section-title i { font-size: 14px; }

/* Coin flip (Round 3) */
.cspd-coin-buttons {
  display: flex; gap: 10px; justify-content: center;
}
.cspd-coin-btn {
  flex: 1;
  max-width: 180px;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 12px 8px;
  background: linear-gradient(180deg, rgba(255,200,80,0.10), rgba(255,180,80,0.04));
  border: 1.5px solid rgba(255,200,80,0.45);
  border-radius: 8px;
  color: #ffd47a;
  font-family: var(--font-title, 'Cinzel', serif);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.18s ease;
}
.cspd-coin-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,200,80,0.20), rgba(255,180,80,0.06));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,200,80,0.22);
}
.cspd-coin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cspd-coin-btn i { font-size: 26px; color: var(--gold); }
.cspd-coin-status {
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  display: flex; flex-direction: column; gap: 4px;
}
.cspd-coin-status b { color: var(--text); font-weight: 800; }
.cspd-coin-flip { margin-top: 6px; font-size: 14px; }
.cspd-coin-flip-result {
  display: inline-block;
  padding: 3px 12px;
  background: linear-gradient(135deg, #ffc857, #e9b963);
  border-radius: 99px;
  color: #1a0a30;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* Pociones */
.cspd-potion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.cspd-potion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  background: rgba(95,214,132,0.06);
  border: 1px solid rgba(95,214,132,0.30);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cspd-potion-btn:hover:not(:disabled) {
  border-color: rgba(95,214,132,0.6);
  background: rgba(95,214,132,0.12);
  transform: translateY(-1px);
}
.cspd-potion-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cspd-potion-btn i { font-size: 18px; color: #5fd684; }
.cspd-potion-btn small { color: var(--text-muted); font-weight: 700; }

/* Log lines del duelo (dentro del cs-quick-log) */
.cspd-log-line {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  color: var(--text);
  line-height: 1.35;
}
.cspd-log-line.cspd-log-me  { background: rgba(95,214,132,0.06);  border-left: 2px solid rgba(95,214,132,0.5); }
.cspd-log-line.cspd-log-opp { background: rgba(255,122,159,0.06); border-left: 2px solid rgba(255,122,159,0.5); }
.cspd-log-line.cspd-log-sys { background: rgba(184,132,255,0.06); border-left: 2px solid rgba(184,132,255,0.5); color: #d8c2ff; }
.cspd-log-line i { font-size: 13px; flex-shrink: 0; }

/* Forfeit row (debajo de la action bar) */
.cspd-forfeit-row {
  position: relative;
  z-index: 3;
  display: flex; justify-content: center;
  margin: 0 18px 16px;
}
.cspd-forfeit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(225,80,90,0.10);
  border: 1px solid rgba(225,80,90,0.45);
  border-radius: 99px;
  color: #ff8a8a;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cspd-forfeit-btn:hover:not(:disabled) {
  background: rgba(225,80,90,0.20);
  border-color: rgba(225,80,90,0.7);
  color: #ffb0b0;
}
.cspd-forfeit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cspd-forfeit-btn i { font-size: 14px; }

/* Cancel button (en duel-waiting-card) */
.duel-waiting-actions {
  margin-top: 16px;
  display: flex; justify-content: center;
}
.cspd-cancel-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cspd-cancel-btn:hover:not(:disabled) {
  background: rgba(225,80,90,0.10);
  border-color: rgba(225,80,90,0.45);
  color: #ff8a8a;
}
.cspd-cancel-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cspd-cancel-btn i { font-size: 14px; }

/* Mobile */
@media (max-width: 600px) {
  .cspd-rounds-row { padding: 0 12px 6px; gap: 6px; }
  .cspd-pip { min-width: 38px; font-size: 10px; padding: 3px 8px; }
  .cspd-pip-flag { width: 12px; height: 12px; font-size: 7px; }
  .cspd-int-header { gap: 10px; padding-bottom: 8px; }
  .cspd-int-icon { width: 38px; height: 38px; }
  .cspd-int-icon i { font-size: 18px; }
  .cspd-int-title { font-size: 14px; }
  .cspd-int-sub { font-size: 12px; }
  .cspd-int-sub b { font-size: 15px; }
  .cspd-coin-btn { padding: 10px 6px; font-size: 11.5px; }
  .cspd-coin-btn i { font-size: 22px; }
  .cspd-potion-grid { grid-template-columns: 1fr 1fr; }
  .cspd-int-section-title { font-size: 10px; }
  .cspd-forfeit-row { margin: 0 12px 12px; }
  .cspd-forfeit-btn { padding: 6px 12px; font-size: 11px; }
}

/* ============================================================================
   TURN TIMER (2026-05-14) — barra de 20s con countdown visible en cada turno.
   Al expirar, el backend dispara auto-attack. Color cambia según urgencia:
   - >10s: dorado tranquilo
   - 5-10s: naranja warning
   - <=5s: rojo crítico + animación de pulso
   ============================================================================ */
.cspd-turn-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 0 12px 8px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,200,87,0.30);
  border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cspd-turn-timer-bar {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.cspd-turn-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd24a, #ffaa50);
  border-radius: inherit;
  transition: width 0.2s linear, background 0.25s ease;
  box-shadow: 0 0 8px rgba(255,200,87,0.35);
}
.cspd-turn-timer-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ffd24a;
  letter-spacing: 0.04em;
  min-width: 38px;
  text-align: right;
  justify-content: flex-end;
}
.cspd-turn-timer-label i { font-size: 13px; }

/* Warning state — entre 5 y 10 segundos */
.cspd-turn-timer.is-warning {
  border-color: rgba(255,148,77,0.55);
  background: rgba(60,30,10,0.45);
}
.cspd-turn-timer.is-warning .cspd-turn-timer-fill {
  background: linear-gradient(90deg, #ff944d, #ff6e3c);
  box-shadow: 0 0 10px rgba(255,148,77,0.5);
}
.cspd-turn-timer.is-warning .cspd-turn-timer-label { color: #ff944d; }

/* Critical state — 5 segundos o menos */
.cspd-turn-timer.is-critical {
  border-color: rgba(232,90,106,0.75);
  background: rgba(60,12,18,0.55);
  animation: cspdTimerPulse 0.6s ease-in-out infinite;
}
.cspd-turn-timer.is-critical .cspd-turn-timer-fill {
  background: linear-gradient(90deg, #e85a6a, #ff3b56);
  box-shadow: 0 0 14px rgba(232,90,106,0.7);
}
.cspd-turn-timer.is-critical .cspd-turn-timer-label { color: #ff6e7e; }
@keyframes cspdTimerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,90,106,0); }
  50%      { box-shadow: 0 0 0 4px rgba(232,90,106,0.20); }
}

@media (max-width: 480px) {
  .cspd-turn-timer { padding: 6px 10px; gap: 8px; margin: 0 8px 6px; }
  .cspd-turn-timer-bar { height: 7px; }
  .cspd-turn-timer-label { font-size: 11px; min-width: 32px; }
}

/* =====================================================================
   PVR2 — PvP Result V2 (Obsidian Codex)
   Modal de victoria / derrota / empate / cancelado del duelo PvP.
   Reemplaza al .duel-result-card legacy.
   Markup: <div.pvr2-shell> <div.pvr2-card pvr2-card--{win|loss|draw|cancel}>
   2026-05-26
   ===================================================================== */
.pvr2-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 14px;
  animation: pvr2-fadein 280ms ease-out;
}
@keyframes pvr2-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pvr2-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 28px 26px 22px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(80,50,140,0.20) 0%, transparent 65%),
    linear-gradient(180deg, #15102a 0%, #0a0418 100%);
  border: 1px solid rgba(212,175,55,0.22);
  border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.04);
  color: #f5edd6;
  overflow: hidden;
  animation: pvr2-pop 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.pvr2-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(212,175,55,0.05);
}
@keyframes pvr2-pop {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Glow detrás del sigil — color varía por estado */
.pvr2-glow {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 120px;
  filter: blur(46px);
  border-radius: 50%;
  opacity: 0.42;
  pointer-events: none;
}
.pvr2-card--win    .pvr2-glow { background: radial-gradient(circle, rgba(255,200,87,0.65) 0%, transparent 70%); }
.pvr2-card--loss   .pvr2-glow { background: radial-gradient(circle, rgba(232,90,106,0.55) 0%, transparent 70%); }
.pvr2-card--draw   .pvr2-glow { background: radial-gradient(circle, rgba(160,160,180,0.45) 0%, transparent 70%); }
.pvr2-card--cancel .pvr2-glow { background: radial-gradient(circle, rgba(120,120,140,0.35) 0%, transparent 70%); }

/* Tag superior — small caps tipo grabado */
.pvr2-tag {
  position: relative;
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 14px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.32);
  border-radius: 99px;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d4af37;
}
.pvr2-card--loss   .pvr2-tag { background: rgba(232,90,106,0.10); border-color: rgba(232,90,106,0.35); color: #ff8a98; }
.pvr2-card--draw   .pvr2-tag { background: rgba(160,160,180,0.10); border-color: rgba(160,160,180,0.35); color: #c8c8d4; }
.pvr2-card--cancel .pvr2-tag { background: rgba(120,120,140,0.08); border-color: rgba(120,120,140,0.30); color: #a0a0b4; }

/* Sigil — ícono central con anillo doble */
.pvr2-sigil {
  position: relative;
  width: 92px; height: 92px;
  margin: 4px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvr2-sigil-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(212,175,55,0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 0 24px rgba(212,175,55,0.08),
    0 0 0 6px rgba(212,175,55,0.05);
}
.pvr2-card--loss   .pvr2-sigil-ring { border-color: rgba(232,90,106,0.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 24px rgba(232,90,106,0.12), 0 0 0 6px rgba(232,90,106,0.07); }
.pvr2-card--draw   .pvr2-sigil-ring { border-color: rgba(180,180,200,0.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 0 24px rgba(180,180,200,0.10), 0 0 0 6px rgba(180,180,200,0.05); }
.pvr2-card--cancel .pvr2-sigil-ring { border-color: rgba(140,140,160,0.35); box-shadow: none; }
.pvr2-sigil i {
  position: relative;
  z-index: 1;
  font-size: 44px;
  color: #ffc857;
  filter: drop-shadow(0 4px 14px rgba(255,200,87,0.55));
}
.pvr2-card--loss   .pvr2-sigil i { color: #ff5a6e; filter: drop-shadow(0 4px 14px rgba(232,90,106,0.55)); }
.pvr2-card--draw   .pvr2-sigil i { color: #d4d4e2; filter: drop-shadow(0 2px 10px rgba(180,180,200,0.30)); }
.pvr2-card--cancel .pvr2-sigil i { color: #a0a0b4; filter: none; }

/* Título */
.pvr2-title {
  position: relative;
  margin: 0 0 4px;
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f5edd6;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.pvr2-card--win    .pvr2-title { color: #ffc857; }
.pvr2-card--loss   .pvr2-title { color: #ff8a98; }
.pvr2-card--draw   .pvr2-title { color: #d4d4e2; }
.pvr2-card--cancel .pvr2-title { color: #b8b8c8; }

/* Subtítulo (mejor de 3, etc.) */
.pvr2-sub {
  position: relative;
  margin: 4px 0 2px;
  font-size: 12px;
  color: rgba(245,237,214,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Score grande tipo grabado en piedra */
.pvr2-score {
  position: relative;
  display: inline-block;
  margin: 14px 0 6px;
  padding: 6px 22px;
  font-family: 'Cinzel', serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f5edd6;
  background: rgba(0,0,0,0.30);
  border-top: 1px solid rgba(212,175,55,0.20);
  border-bottom: 1px solid rgba(212,175,55,0.20);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* Stats — chips horizontales con ícono */
.pvr2-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 4px;
}
.pvr2-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  text-align: left;
}
.pvr2-stat-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  font-size: 18px;
}
.pvr2-stat--gold .pvr2-stat-icon { color: #ffc857; box-shadow: inset 0 0 0 1px rgba(255,200,87,0.30); }
.pvr2-stat--xp   .pvr2-stat-icon { color: #a3d977; box-shadow: inset 0 0 0 1px rgba(163,217,119,0.30); }
.pvr2-stat--burn .pvr2-stat-icon { color: #ff7a55; box-shadow: inset 0 0 0 1px rgba(255,122,85,0.32); }
.pvr2-stat-body {
  flex: 1;
  min-width: 0;
}
.pvr2-stat-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,237,214,0.55);
  margin-bottom: 2px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
}
.pvr2-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #f5edd6;
  letter-spacing: 0.02em;
}
.pvr2-stat--gold .pvr2-stat-value { color: #ffd66a; }
.pvr2-stat--xp   .pvr2-stat-value { color: #b3eb87; }
.pvr2-stat--burn .pvr2-stat-value { color: #ff9468; }

/* Layout: 2 chips lado a lado (oro robado + oro quemado) */
.pvr2-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pvr2-stat--half {
  padding: 9px 10px;
  gap: 8px;
}
.pvr2-stat--half .pvr2-stat-icon {
  width: 30px; height: 30px;
  font-size: 15px;
}
.pvr2-stat--half .pvr2-stat-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
}
.pvr2-stat--half .pvr2-stat-value {
  font-size: 17px;
}

/* Nota economía 3%/5% */
.pvr2-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 10px 12px;
  background: rgba(126,158,255,0.06);
  border: 1px solid rgba(126,158,255,0.20);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(245,237,214,0.78);
  text-align: left;
}
.pvr2-note i {
  flex-shrink: 0;
  margin-top: 1px;
  color: #7e9eff;
  font-size: 15px;
}
.pvr2-note b { color: #f5edd6; }

/* Actions */
.pvr2-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.pvr2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  background: linear-gradient(180deg, rgba(212,175,55,0.18), rgba(212,175,55,0.06));
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 99px;
  color: #f5edd6;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}
.pvr2-btn:hover {
  background: linear-gradient(180deg, rgba(212,175,55,0.28), rgba(212,175,55,0.12));
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(212,175,55,0.18), inset 0 1px 0 rgba(255,255,255,0.10);
}
.pvr2-btn:active { transform: translateY(0); }
.pvr2-btn i { font-size: 14px; }

/* Mobile */
@media (max-width: 600px) {
  .pvr2-shell { padding: 16px 10px; }
  .pvr2-card { padding: 22px 18px 18px; max-width: 100%; }
  .pvr2-sigil { width: 78px; height: 78px; }
  .pvr2-sigil i { font-size: 38px; }
  .pvr2-title { font-size: 24px; }
  .pvr2-score { font-size: 26px; padding: 5px 16px; }
  .pvr2-stat-value { font-size: 18px; }
  .pvr2-btn { padding: 10px 22px; font-size: 12px; }
  .pvr2-stat-row { gap: 6px; }
  .pvr2-stat--half { padding: 8px 9px; }
  .pvr2-stat--half .pvr2-stat-icon { width: 26px; height: 26px; font-size: 13px; }
  .pvr2-stat--half .pvr2-stat-label { font-size: 8.5px; }
  .pvr2-stat--half .pvr2-stat-value { font-size: 15px; }
}
