/* Võ Lâm Idle - PvP & Multiplayer Styling */

/* Nút Lôi Đài trên màn hình game */
#pvpBtn {
  background: linear-gradient(180deg, #991b1b, #5f0e0e) !important;
  border: 1px solid #f59e0b !important;
  color: #fef3c7 !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  transition: transform 0.1s, box-shadow 0.2s;
}
#pvpBtn:active {
  transform: scale(0.95);
}
#pvpBtn em {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 5px #10b981;
}

/* Thẻ thông tin mục tiêu khi chạm/click vào người chơi trên bản đồ */
#pvpTargetHud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 12, 7, 0.94);
  border: 1.5px solid #d4af37;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 85;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 10px rgba(212, 175, 55, 0.3);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: pvpSlideDown 0.25s ease-out;
  max-width: 96%;
}
@keyframes pvpSlideDown {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#pvpTargetHud .th-avatar {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1.5px solid #d4af37;
  background: #2b1810;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
}
#pvpTargetHud .th-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}
#pvpTargetHud .th-name {
  font-weight: 700;
  font-size: 13px;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 4px;
}
#pvpTargetHud .th-sub {
  font-size: 11px;
  color: #94a3b8;
}
#pvpTargetHud .th-power {
  font-size: 11px;
  color: #fbbf24;
  font-weight: 600;
}
#pvpTargetHud .th-actions {
  display: flex;
  gap: 5px;
  margin-left: 4px;
}
#pvpTargetHud .th-btn {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}
#pvpTargetHud .th-btn-fight {
  background: linear-gradient(180deg, #dc2626, #7f1d1d);
  color: #fff;
  border-color: #ef4444;
}
#pvpTargetHud .th-btn-fight:hover {
  background: linear-gradient(180deg, #ef4444, #991b1b);
}
#pvpTargetHud .th-btn-chat {
  background: #1e293b;
  color: #38bdf8;
  border-color: #0284c7;
}
#pvpTargetHud .th-btn-inspect {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}
#pvpTargetHud .th-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* Cửa sổ Lôi Đài Tỷ Võ Modal */
.pvp-window {
  width: 100%;
  max-width: 520px;
  background: #161009;
  border: 2px solid #b8860b;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9), inset 0 0 15px rgba(184, 134, 11, 0.15);
  color: #f5eedc;
  overflow: hidden;
  font-family: inherit;
}
.pvp-header {
  background: linear-gradient(180deg, #382414, #22140a);
  padding: 10px 14px;
  border-bottom: 1.5px solid #b8860b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pvp-header h3 {
  margin: 0;
  font-size: 16px;
  color: #ffd700;
  text-shadow: 0 1px 3px #000;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pvp-tabs {
  display: flex;
  background: #0f0a06;
  border-bottom: 1px solid #4a341e;
}
.pvp-tab-btn {
  flex: 1;
  padding: 9px 0;
  background: transparent;
  border: none;
  color: #a89680;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.pvp-tab-btn.active {
  color: #ffd700;
  background: #1c140c;
  border-bottom: 2px solid #ffd700;
}
.pvp-tab-content {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

/* Thẻ người chơi trong danh sách Lôi Đài */
.pvp-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #20170f;
  border: 1px solid #3d2a17;
  border-radius: 6px;
  margin-bottom: 6px;
  transition: transform 0.15s, border-color 0.2s;
}
.pvp-player-card:hover {
  border-color: #b8860b;
  transform: translateY(-1px);
}
.pvp-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pvp-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #b8860b;
  background: #2e1d12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pvp-card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pvp-card-name {
  font-weight: 700;
  font-size: 13px;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pvp-card-fac {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
}
.pvp-card-meta {
  font-size: 11px;
  color: #c4b5a0;
  display: flex;
  gap: 8px;
}
.pvp-card-power {
  color: #f59e0b;
  font-weight: 600;
}
.pvp-card-status {
  font-size: 10px;
}
.pvp-card-status.online { color: #10b981; }
.pvp-card-status.offline { color: #6b7280; }

.pvp-challenge-btn {
  background: linear-gradient(180deg, #b91c1c, #7f1d1d);
  color: #fff;
  border: 1px solid #ef4444;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  transition: all 0.15s;
  white-space: nowrap;
}
.pvp-challenge-btn:hover {
  background: linear-gradient(180deg, #dc2626, #991b1b);
  border-color: #fca5a5;
}
.pvp-challenge-btn:active {
  transform: scale(0.95);
}

/* MÀN HÌNH TỶ VÕ ĐỈNH CAO (DUEL ARENA OVERLAY) */
#pvpArenaOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: pvpFadeIn 0.3s ease-out;
}
@keyframes pvpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* TOP HUD CỦA TRẬN ĐẤU */
.duel-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(30, 20, 10, 0.95), rgba(15, 10, 5, 0.8));
  border-bottom: 2px solid #b8860b;
}
.duel-fighter-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 42%;
}
.duel-fighter-card.right {
  flex-direction: row-reverse;
  text-align: right;
}
.duel-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #ffd700;
  background: #2e1c10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}
.duel-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.duel-name {
  font-weight: 700;
  font-size: 14px;
  color: #fef08a;
  text-shadow: 0 1px 2px #000;
}
.duel-bar-wrap {
  width: 100%;
  height: 12px;
  background: #262626;
  border: 1px solid #525252;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.duel-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #22c55e);
  transition: width 0.25s ease-out;
}
.duel-bar-text {
  position: absolute;
  inset: 0;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.duel-power {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
}

/* VS BANNER */
.duel-vs-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.duel-vs-text {
  font-size: 24px;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 0 12px #dc2626, 0 2px 4px #000;
  letter-spacing: 1px;
}
.duel-timer {
  font-size: 13px;
  color: #fef08a;
  font-weight: 700;
  background: rgba(0,0,0,0.6);
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid #78350f;
}

/* KHÔNG GIAN SÂN ĐẤU CANVAS */
.duel-canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center, #2e2014 0%, #120c08 80%, #050302 100%);
}
#pvpArenaCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* HIỆU ỨNG CHIÊU THỨC BAY */
.duel-skill-announcement {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #ffd700;
  color: #ffd700;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

/* NHẬT KÝ CHIẾN ĐẤU BÊN DƯỚI */
.duel-bottom-bar {
  padding: 8px 16px;
  background: rgba(15, 10, 5, 0.95);
  border-top: 1.5px solid #4a341e;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.duel-log {
  height: 52px;
  overflow-y: auto;
  font-size: 11px;
  color: #d1d5db;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.duel-log-item {
  color: #e5e7eb;
}
.duel-log-item.dmg-player { color: #f87171; }
.duel-log-item.dmg-enemy { color: #6ee7b7; }
.duel-log-item.crit { color: #fde047; font-weight: 700; }
.duel-ctrls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.duel-btn-surrender {
  background: #374151;
  color: #d1d5db;
  border: 1px solid #4b5563;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* BẢNG KẾT QUẢ TỶ VÕ */
.duel-result-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1c130b;
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 25px rgba(255, 215, 0, 0.4);
  z-index: 1001;
  animation: pvpZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 90%;
  width: 320px;
}
@keyframes pvpZoomIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.duel-result-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px #000;
}
.duel-result-title.win {
  color: #facc15;
  text-shadow: 0 0 15px rgba(250, 204, 21, 0.6);
}
.duel-result-title.lose {
  color: #ef4444;
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}
.duel-result-rewards {
  background: #2a1b0e;
  border: 1px solid #573a1e;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
  font-size: 12px;
  color: #fef08a;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.duel-result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.duel-btn-close {
  background: linear-gradient(180deg, #d97706, #b45309);
  color: #fff;
  border: 1px solid #fbbf24;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Nút PK Hòa Bình / Đồ Sát góc bản đồ */
#pkModeBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #d4af37;
  color: #fef08a;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 4px;
}
#pkModeBtn.pk-on {
  background: rgba(185, 28, 28, 0.85);
  border-color: #ef4444;
  color: #fff;
  animation: pkPulse 1.5s infinite;
}
@keyframes pkPulse {
  0%, 100% { box-shadow: 0 0 4px #ef4444; }
  50% { box-shadow: 0 0 12px #ef4444; }
}
