/* ============================================================
   삼국지 천하대세전: 상단 영지(장원) & 소셜 기습/복수 시스템 CSS
   (Estate Building, Raid, Shield, and Revenge Styles)
   ============================================================ */

/* 1. Estate Modal Backdrop & Scroll */
.estate-backdrop {
  background: radial-gradient(ellipse at 50% 20%, rgba(65, 34, 15, 0.85) 0%, rgba(12, 8, 5, 0.96) 65%, #080503 100%);
}

.estate-scroll::-webkit-scrollbar {
  width: 4px;
}
.estate-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
  border-radius: 9999px;
}

/* 2. Building Card Base */
.estate-building-card {
  position: relative;
  border-radius: 1rem;
  background: linear-gradient(180deg, #20140b 0%, #120b06 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(251, 191, 36, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.estate-building-card:hover {
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(251, 191, 36, 0.3);
  transform: translateY(-2px);
}

.estate-building-card.is-damaged {
  border-color: rgba(239, 68, 68, 0.85) !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.45) !important;
  animation: damagedCardShake 3s infinite ease-in-out;
}

@keyframes damagedCardShake {
  0%, 100% { transform: translate(0, 0); }
  92% { transform: translate(-1px, 0); }
  94% { transform: translate(1.5px, -1px); }
  96% { transform: translate(-1.5px, 1px); }
  98% { transform: translate(1px, 0); }
}

/* 3. Smoke & Flame Animation for Damaged Buildings */
.smoke-flame-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(239, 68, 68, 0.2) 0%, rgba(0, 0, 0, 0.55) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.flame-particle {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.75rem;
  animation: flameFlicker 1.2s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9));
}

@keyframes flameFlicker {
  0% { transform: translateX(-50%) scale(0.9) rotate(-3deg); opacity: 0.8; }
  50% { transform: translateX(-48%) scale(1.1) rotate(4deg); opacity: 1; }
  100% { transform: translateX(-52%) scale(1.0) rotate(-2deg); opacity: 0.85; }
}

/* 4. Building Level Badges */
.estate-lv-pill {
  font-family: 'Cinzel Decorative', 'Noto Serif KR', serif;
  font-weight: 900;
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.estate-lv-pill.is-max {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border-color: #fde047;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
}

/* 5. Imperial Shield (명장 방패) Indicators */
.shield-slot {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 12px;
  transition: all 0.3s ease;
}

.shield-slot.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.8);
  color: #93c5fd;
  animation: shieldPulse 2.5s infinite ease-in-out;
}

@keyframes shieldPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(96, 165, 250, 0.5); }
  50% { box-shadow: 0 0 16px rgba(147, 197, 253, 0.95); }
}

/* 6. Raid & Fire Strike Animations */
@keyframes fireballLaunch {
  0% { transform: scale(0.2) translate(0, 80px); opacity: 0; }
  40% { transform: scale(1.3) translate(0, -20px); opacity: 1; }
  100% { transform: scale(1) translate(0, 0); opacity: 1; }
}

.fireball-anim {
  animation: fireballLaunch 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes shieldDeflectBurst {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.4); opacity: 1; filter: drop-shadow(0 0 25px #60a5fa); }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 15px #3b82f6); }
}

.shield-deflect-anim {
  animation: shieldDeflectBurst 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 7. Revenge Card Menacing Glow */
.revenge-card {
  border: 1.5px solid rgba(239, 68, 68, 0.6);
  background: linear-gradient(180deg, rgba(38, 14, 12, 0.95) 0%, rgba(18, 7, 6, 0.98) 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
  transition: all 0.2s ease;
}

.revenge-card:hover {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

/* 8. Building Upgrade Progress Bar */
.estate-progress-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 9999px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  overflow: hidden;
}

.estate-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}
