/* ============================================================================
   ⚡ 4대 액티브 전투 스킬 패널 & 쿨타임 시스템 스타일
   ============================================================================ */
.hero-skills-panel {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 12px 12px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin-bottom: 2px;
}

/* AUTO 스킬 토글 버튼 */
.btn-auto-skill {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-auto-skill .auto-skill-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.btn-auto-skill .auto-skill-txt {
  font-size: 0.5rem;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 1px;
}

.btn-auto-skill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.btn-auto-skill.active .auto-skill-txt {
  color: #f0f9ff;
  text-shadow: 0 0 4px #38bdf8;
}

.btn-auto-skill.active .auto-skill-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  border: 1.5px solid #38bdf8;
  animation: autoSkillPulse 1.8s infinite;
  pointer-events: none;
}

@keyframes autoSkillPulse {
  0% { transform: scale(0.96); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 0.2; }
  100% { transform: scale(0.96); opacity: 0.8; }
}

/* 4대 스킬 슬롯 컨테이너 */
.skills-slots-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* 개별 스킬 슬롯 버튼 */
.skill-slot {
  flex: 1;
  height: 40px;
  min-width: 0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, border-color 0.2s, box-shadow 0.2s;
}

.skill-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
}

.skill-slot:active, .skill-slot.casting-slot {
  transform: scale(0.92);
}

.skill-bg {
  position: absolute;
  inset: 0;
  opacity: 0.88;
  z-index: 1;
}

.skill-icon-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

.pet-slot-skill-icon {
  height: 38px;
  width: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.pet-slot-thumb {
  height: 32px;
  width: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform: scaleX(-1);
}

.skill-shortcut-badge {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.48rem;
  font-weight: 900;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  z-index: 4;
}

.skill-name-label {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.48rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  z-index: 4;
}

/* 쿨타임 마스크 오버레이 */
.skill-cd-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(1px);
  z-index: 3;
  pointer-events: none;
  transition: height 0.1s linear;
}

/* 쿨타임 잔여 시간 텍스트 */
.skill-cd-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
  z-index: 5;
  pointer-events: none;
}

/* 레디 상태 (쿨타임 완료) */
.skill-slot.ready {
  border-color: rgba(255, 255, 255, 0.3);
}

.skill-slot.ready .skill-ready-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 2;
  animation: skillReadyPulse 2s infinite ease-in-out;
}

@keyframes skillReadyPulse {
  0% { opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { opacity: 0.3; }
}

/* 쿨다운 진행 중 슬롯 */
.skill-slot.cooling {
  filter: grayscale(0.2);
}

/* ============================================================================
   💥 스킬 비주얼 파티클 & 애니메이션
   ============================================================================ */

/* 1. 스킬 발동 배너 */
.skill-cast-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid currentColor;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
  z-index: 30;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  animation: skillBannerPop 1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  pointer-events: none;
}

@keyframes skillBannerPop {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.05); }
  75% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.9); }
}

/* 2. 화면 진동 (Screen Shake) */
.battle-scene-viewport.screen-shake {
  animation: screenShakeFx 0.28s ease-in-out;
}

@keyframes screenShakeFx {
  /* translate 속성 사용: 축소(transform: scale)된 다시보기 화면에서도 크기가 바뀌지 않게 */
  0% { translate: 0 0; }
  20% { translate: -3px 3px; }
  40% { translate: 3px -2px; }
  60% { translate: -2px 2px; }
  80% { translate: 2px -1px; }
  100% { translate: 0 0; }
}

/* 3. 🌪️ 질풍검격 파티클 */
.wind-slash-fx {
  position: absolute;
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 12;
  animation: windSlashArc 0.38s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes windSlashArc {
  0% { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 0.9; filter: drop-shadow(0 0 12px #38bdf8); }
  50% { transform: translate(-50%, -50%) scale(1.4) rotate(180deg); opacity: 1; filter: drop-shadow(0 0 20px #0284c7); }
  100% { transform: translate(-50%, -50%) scale(1.6) rotate(360deg); opacity: 0; }
}

/* 4. 🔥 메테오 스트라이크 파티클 */
.meteor-strike-fx {
  position: absolute;
  top: -40px;
  right: 15%;
  font-size: 3rem;
  z-index: 20;
  pointer-events: none;
  animation: meteorFall 0.28s ease-in forwards;
}

@keyframes meteorFall {
  0% { transform: translate(40px, -60px) scale(0.6); opacity: 0.8; filter: drop-shadow(0 0 15px #f97316); }
  100% { transform: translate(-50px, 120px) scale(1.4); opacity: 1; filter: drop-shadow(0 0 30px #ef4444); }
}

.meteor-blast-fx {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle at center, rgba(239, 68, 68, 0.85) 0%, rgba(249, 115, 22, 0.6) 40%, transparent 70%);
  border-radius: 50%;
  z-index: 18;
  pointer-events: none;
  animation: meteorBlastExpand 0.42s ease-out forwards;
}

@keyframes meteorBlastExpand {
  0% { transform: scale(0.3); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* 5. 🛡️ 신성한 가호 방어막 오라 */
.hero-combat-unit.has-divine-shield .hero-sprite-box::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.8), inset 0 0 10px rgba(251, 191, 36, 0.5);
  animation: divineShieldRotate 3s linear infinite;
  pointer-events: none;
}

@keyframes divineShieldRotate {
  0% { transform: rotate(0deg) scale(0.98); opacity: 0.7; }
  50% { transform: rotate(180deg) scale(1.05); opacity: 1; }
  100% { transform: rotate(360deg) scale(0.98); opacity: 0.7; }
}

.divine-shield-burst-fx {
  position: absolute;
  font-size: 1.4rem;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  animation: shieldBurstPop 0.6s ease-out forwards;
}

@keyframes shieldBurstPop {
  0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 1; filter: drop-shadow(0 0 8px #fbbf24); }
  60% { transform: translateX(-50%) translateY(-20px) scale(1.2); opacity: 1; filter: drop-shadow(0 0 16px #f59e0b); }
  100% { transform: translateX(-50%) translateY(-30px) scale(1); opacity: 0; }
}

/* 6. ⚡ 뇌신강림 벼락 파티클 */
.thunder-bolt-fx {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  z-index: 15;
  pointer-events: none;
  animation: thunderBoltStrike 0.24s ease-out forwards;
}

@keyframes thunderBoltStrike {
  0% { transform: translateX(-50%) translateY(-20px) scale(0.4); opacity: 1; filter: drop-shadow(0 0 15px #a855f7); }
  40% { transform: translateX(-50%) translateY(0) scale(1.4); opacity: 1; filter: drop-shadow(0 0 25px #c084fc); }
  100% { transform: translateX(-50%) translateY(5px) scale(1.1); opacity: 0; }
}

/* ============================================================================
   ⚡ 3대 액티브 스킬 슬롯 & 잠금/빈 슬롯 & 버프 오라 스타일
   ============================================================================ */

/* 1. 영웅 유닛 공격력 버프 오라 */
.hero-combat-unit.has-atk-buff .hero-sprite-box::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8), inset 0 0 10px rgba(245, 158, 11, 0.5);
  animation: atkBuffRotate 2s linear infinite;
  pointer-events: none;
  filter: drop-shadow(0 0 6px #f59e0b);   /* 고정 (애니메이션에서 필터를 바꾸면 매 프레임 다시 그림) */
  will-change: transform, opacity;
}

@keyframes atkBuffRotate {
  0% { transform: rotate(0deg) scale(0.96); opacity: 0.8; }
  50% { transform: rotate(180deg) scale(1.08); opacity: 1; }
  100% { transform: rotate(360deg) scale(0.96); opacity: 0.8; }
}

/* 2. 전투 아레나 스킬 슬롯: 잠김 (Lock) */
.skill-slot.slot-locked {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px dashed rgba(239, 68, 68, 0.4);
  cursor: pointer;
}

.skill-lock-mask {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.lock-big-icon, .lock-icon {
  font-size: 0.85rem;
}

.lock-req-text {
  font-size: 0.52rem;
  font-weight: 800;
  color: #f87171;
}

/* 3. 전투 아레나 스킬 슬롯: 미장착 (Empty) */
.skill-slot.slot-empty {
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.skill-slot.slot-empty:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.skill-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.empty-plus {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 900;
  line-height: 1;
}

.empty-label {
  font-size: 0.52rem;
  font-weight: 700;
  color: #64748b;
}

.skill-level-sub {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.46rem;
  font-weight: 900;
  color: #fde047;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  z-index: 4;
}

/* ============================================================================
   ⚡ [스킬 탭] 상세 레이아웃 및 컴포넌트
   ============================================================================ */

/* ============================================================================
   🎰 [스킬 소환 결과 모달창]
   ============================================================================ */
.skill-gacha-result-sheet {
  max-width: 380px;
}

.skill-gacha-results-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.skill-gacha-results-grid.count-1 {
  grid-template-columns: 1fr;
  max-width: 220px;
  margin: 12px auto;
}

.skill-gacha-results-grid.count-10 {
  grid-template-columns: repeat(5, 1fr);
}

.gacha-result-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  animation: cardPopIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes cardPopIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.gacha-result-card.tier-1 { border-color: #d97706; }
.gacha-result-card.tier-2 { border-color: #b45309; }
.gacha-result-card.tier-3 { border-color: #64748b; }
.gacha-result-card.tier-4 { border-color: #38bdf8; box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); }
.gacha-result-card.tier-5 { border-color: #eab308; box-shadow: 0 0 14px rgba(234, 179, 8, 0.6); }

.result-tier-badge {
  font-size: 0.52rem;
  font-weight: 900;
  color: #fde047;
}

.result-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon {
  font-size: 1rem;
}

.result-name {
  font-size: 0.6rem;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.result-cat {
  font-size: 0.5rem;
  color: #94a3b8;
}

.result-status-tag {
  font-size: 0.48rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
}

.result-status-tag.new-tag {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.result-status-tag.card-tag {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
