/* ================================
   배틀 화면 스타일
   배틀 컨테이너, 배틀 섹션, 배틀 히스토리, 랜덤 배틀
================================ */

#battle-modal .modal-content {
  background: transparent;
  box-shadow: none;
  padding: 0;
  max-width: 800px;
  width: 100%;
}

#battle-stage {
  width: 100%;
  height: 100%;
}

.trainer-status,
.trainer-status span,
.hp-bar-container {
  width: 100%;
  height: 12px;
  background: #333;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #000;
}

.hp-bar {
  height: 100%;
  background: linear-gradient(90deg, #4cd137, #44bd32);
}

.hp-bar.reducing {
  transition: width 0.4s ease-out;
}

.hp-bar.low {
  background: linear-gradient(90deg, #e84118, #c23616);
}

.battle-controls {
  pointer-events: auto;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.battle-log {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.battle-container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  padding: 24px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-container h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.battle-container .page-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

.battle-count-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 30px;
  font-size: 1rem;
  color: var(--text-primary);
}

.battle-count-display .battle-icon {
  font-size: 1.2rem;
}

.battle-count-display strong {
  color: var(--gold-primary);
  font-size: 1.1rem;
}

.recharge-timer {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 8px;
}

.battle-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.battle-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.battle-section:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.battle-section-header {
  margin-bottom: 20px;
  padding: 16px 22px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.battle-section-header h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  margin-bottom: 8px;
  text-align: center;
  position: relative;
  z-index: 1;
}


.battle-step {
  margin-bottom: 20px;
  flex: 1;
}

.battle-step h3 {
  color: var(--gold-primary);
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 600;
}

.battle-trainers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

.battle-trainers-list::-webkit-scrollbar {
  width: 6px;
}

.battle-trainers-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.battle-trainers-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-primary), var(--gold-dark));
  border-radius: 10px;
}

.battle-trainers-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

.battle-trainers-list .loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.battle-trainer-card .trainer-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pokemon-card-selectable {
  background: white;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 2px solid transparent;
  position: relative;
}

.pokemon-card-selectable:hover {
  border-color: var(--pokemon-blue);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.pokemon-card-selectable.selected {
  border-color: var(--pokemon-red);
  background: linear-gradient(135deg, #fff5f5, #ffe5e5);
  box-shadow: 0 6px 20px rgba(227, 53, 13, 0.3);
}

.selected-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--pokemon-red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.battle-stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.stat-box.win {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.3);
}

.stat-box.win:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 255, 136, 0.4);
}

.stat-box.lose {
  background: rgba(255, 51, 102, 0.1);
  border-color: rgba(255, 51, 102, 0.3);
}

.stat-box.lose:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 51, 102, 0.4);
}

.stat-box .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stat-box .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-box.win .stat-value {
  color: #4CAF50;
}

.stat-box.lose .stat-value {
  color: #F44336;
}

.battle-history-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.battle-history-list::-webkit-scrollbar {
  width: 6px;
}

.battle-history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.battle-history-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-primary), var(--gold-dark));
  border-radius: 10px;
}

.battle-history-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

.battle-history-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  min-height: auto;
}

.battle-history-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.battle-history-item.win {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--neon-green);
}

.battle-history-item.win:hover {
  background: rgba(0, 255, 136, 0.15);
}

.battle-history-item.lose {
  background: rgba(255, 51, 102, 0.1);
  border-color: var(--neon-red);
}

.battle-history-item.lose:hover {
  background: rgba(255, 51, 102, 0.15);
}

.battle-result-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.battle-history-item.win .battle-result-badge {
  background: linear-gradient(135deg, var(--neon-green), #00aa55);
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4);
}

.battle-history-item.lose .battle-result-badge {
  background: linear-gradient(135deg, var(--neon-red), #aa0033);
  box-shadow: 0 4px 16px rgba(255, 51, 102, 0.4);
}

.battle-details {
  flex: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: visible;
}

.battle-opponent {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 1rem;
  word-break: break-word;
  line-height: 1.4;
}

.battle-history-item.win .battle-opponent::after {
  content: ' 에게 승리';
  color: var(--neon-green);
  font-size: 0.85rem;
  font-weight: 600;
}

.battle-history-item.lose .battle-opponent::after {
  content: ' 에게 패배';
  color: var(--neon-red);
  font-size: 0.85rem;
  font-weight: 600;
}

.battle-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  margin-top: 4px;
}

.battle-trainer {
  text-align: center;
}

.battle-trainer.challenger {
  text-align: left;
}

.battle-trainer.opponent {
  text-align: right;
}

.trainer-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--pokemon-blue);
}

.pokemon-sprite {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
  border-radius: 50%;
  margin: 0 auto 12px;
  object-fit: contain;
  image-rendering: pixelated;
}

.pokemon-name {
  font-weight: 600;
  color: var(--pokemon-blue);
  margin-bottom: 2px;
  font-size: 15px;
}

.pokemon-level {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.hp-bar {
  width: 100%;
  height: 16px;
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.05s ease-out, background 0.05s ease;
  border-radius: 8px;
}

.hp-fill.warning {
  background: linear-gradient(90deg, #FFA000, #FFD54F);
}

.hp-fill.danger {
  background: linear-gradient(90deg, #D32F2F, #EF5350);
}

.hp-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.battle-log {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 16px;
  padding: 20px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 247, 255, 0.2);
  box-shadow:
    inset 0 0 30px rgba(0, 247, 255, 0.05),
    0 4px 20px rgba(0, 0, 0, 0.3);
}

.battle-log::-webkit-scrollbar {
  width: 6px;
}

.battle-log::-webkit-scrollbar-track {
  background: rgba(0, 247, 255, 0.05);
  border-radius: 6px;
}

.battle-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 6px;
}

.battle-log .log-entry {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.4;
  word-break: keep-all;
}

.battle-log .log-entry:last-child {
  border-bottom: none;
}

.battle-log .log-entry.damage {
  color: #ff6b6b;
}

.battle-log .log-entry.info {
  color: #74b9ff;
}

.battle-result-content {
  max-width: 480px;
  text-align: center;
  padding: 40px 36px;
  background: linear-gradient(145deg, rgba(25, 25, 40, 0.98), rgba(15, 15, 28, 0.99));
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.battle-result-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), var(--neon-green), transparent);
}

.result-header {
  margin-bottom: 28px;
}

.result-header h2 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-icon {
  font-size: 4rem;
  animation: resultIconBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
}

@keyframes resultIconBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.1);
  }
}

.result-body {
  margin-bottom: 36px;
}

.result-body p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.result-reward {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
  border: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 14px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-primary);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.result-reward .reward-icon {
  font-size: 1.5rem;
}

.random-battle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  text-align: center;
}

.random-battle-info {
  margin-bottom: 30px;
}

.random-battle-info .random-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.random-battle-info h3 {
  font-size: 24px;
  color: #2d3436;
  margin-bottom: 12px;
}

.random-battle-info p {
  color: #636e72;
  font-size: 16px;
  margin-bottom: 8px;
}

.random-battle-info .random-note {
  color: #e3350d;
  font-size: 14px;
  font-weight: 500;
}

.btn-random-battle {
  padding: 16px 48px;
  background: linear-gradient(135deg, var(--pokemon-red), #ff5a36);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(227, 53, 13, 0.4);
}

.btn-random-battle:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(227, 53, 13, 0.5);
}

.btn-random-battle:active {
  transform: translateY(0);
}

.btn-random-battle:disabled {
  background: #666;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* 배틀 팀 정보 스타일 */
.battle-team-info {
  margin-bottom: 24px;
}

.battle-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.battle-team-header h4 {
  color: var(--gold-primary);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.battle-team-header .team-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.battle-team-header .team-count.complete {
  color: var(--neon-green);
  background: rgba(0, 255, 136, 0.15);
}

.battle-team-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.battle-team-slot {
  aspect-ratio: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 240, 0.95));
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 80px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
  padding: 8px;
}

.battle-team-slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
  border-color: var(--gold-primary);
}

.battle-team-slot.empty {
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.battle-team-slot .slot-number {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--gold-primary);
  opacity: 0.8;
}

.battle-team-slot .slot-placeholder {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.battle-team-slot img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 4px;
}

.battle-team-slot .pokemon-name {
  font-size: 0.65rem;
  color: #2c3e50;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  font-weight: 600;
}

.battle-team-slot .pokemon-level {
  font-size: 0.6rem;
  color: rgba(44, 62, 80, 0.7);
  margin-top: 2px;
}

.battle-team-slot .pokemon-stars {
  font-size: 0.55rem;
  margin-top: 2px;
  color: var(--gold-primary);
}

.battle-team-warning {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.1), rgba(200, 40, 80, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(255, 51, 102, 0.3);
  margin-bottom: 20px;
}

.battle-team-warning p {
  color: var(--neon-red);
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.btn-team-setup {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--neon-cyan), #0088aa);
  color: #000;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 247, 255, 0.3);
  border: 2px solid rgba(0, 247, 255, 0.5);
}

.btn-team-setup:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 247, 255, 0.5);
  background: linear-gradient(135deg, #00f7ff, #00aacc);
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
  .battle-sections-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .battle-section {
    min-height: auto;
  }

  .battle-stats-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .battle-field {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .battle-vs {
    display: none;
  }

  .battle-trainer.opponent {
    text-align: left;
  }

  .battle-trainers-list {
    grid-template-columns: 1fr;
  }

  .battle-pokemon-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .battle-team-slots {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
}

/* ================================
   전투 UI v2 스타일 (컴팩트 레이아웃, 간지나는 애니메이션)
   배틀, 던전, 탑, 레이드 공통 적용
================================ */

/* 전투 모달 컨테이너 v2 */
.raid-battle-modal,
#battle-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.raid-battle-modal.hidden,
#battle-modal.hidden {
  display: none;
}

.raid-battle-content {
  background: rgba(18, 18, 18, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  padding: 16px 20px;
  position: relative;
  backdrop-filter: blur(10px);
  max-width: 920px;
  width: 100%;
  margin: 20px;
}

/* 헤더 v2 */
.raid-battle-header h2,
.battle-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.1em;
  text-align: center;
}

/* 전투 모달 컨테이너 v2 */
#battle-modal .modal-content {
  background: transparent;
  box-shadow: none;
  padding: 0;
  max-width: 920px;
  width: 100%;
}

/* 전투 필드 - v2 컴팩트 좌우 배치 */
.raid-battle-field {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

/* 팀 박스 v2 */
.raid-battle-team,
.raid-battle-boss-area {
  background: linear-gradient(145deg, rgba(25, 25, 40, 0.9), rgba(15, 15, 28, 0.95));
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.raid-battle-boss-area {
  border-color: rgba(255, 51, 102, 0.2);
}

/* 팀 라벨 v2 */
.raid-battle-team h4,
.raid-battle-boss-area h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--neon-cyan);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
}

.raid-battle-boss-area h4 {
  color: var(--neon-red);
}

/* 팀 그리드 v2 */
.raid-team-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 활성 포켓몬 섹션 */
.active-pokemon-section {
  margin-bottom: 12px;
}

/* 활성 포켓몬 카드 v2 */
.pokemon-card-active {
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 35, 0.9));
  border-radius: 12px;
  padding: 12px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  position: relative;
  transition: all 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
}

.pokemon-card-active.active {
  border-color: var(--gold-primary);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* 레어리티 별 */
.rarity-stars {
  display: flex;
  justify-content: center;
  gap: 1px;
  margin-bottom: 6px;
  font-size: 0.55rem;
}

.star {
  color: rgba(255, 255, 255, 0.2);
}

.star.filled {
  color: var(--gold-primary);
}

/* 활성 포켓몬 이미지 - 크게 */
.pokemon-image-active {
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pokemon-image-active img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.pokemon-name {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  margin-bottom: 4px;
}

.level-badge {
  font-size: 0.65rem;
  text-align: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--neon-cyan), #0088aa);
  border-radius: 10px;
  color: #000;
  font-weight: 700;
  margin: 0 auto 8px;
  width: fit-content;
  display: block;
}

/* HP 바 */
.hp-container { margin-top: 4px; }
.hp-bar-bg {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hp-bar-bg .hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), #00cc66) !important;
  border-radius: 8px;
  transition: width 0.4s ease-out;
  position: relative;
  will-change: width, transform;
  transform: translateZ(0);
}
.hp-bar-bg .hp-bar.low { background: linear-gradient(90deg, var(--neon-yellow), #cc9900) !important; }
.hp-bar-bg .hp-bar.critical {
  background: linear-gradient(90deg, var(--neon-red), #cc0033) !important;
  animation: hpCritical 0.5s ease-in-out infinite;
}
@keyframes hpCritical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.hp-bar-bg .hp-bar.dropping {
  animation: hpDropFlash 0.3s ease-out;
}
@keyframes hpDropFlash {
  0% { filter: brightness(2); background: linear-gradient(90deg, var(--neon-red), #cc0033); }
  100% { filter: brightness(1); }
}
.hp-text {
  font-size: 0.6rem;
  text-align: center;
  color: #a0a0a0;
  margin-top: 3px;
}

/* 썸네일 그리드 */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}

/* 썸네일 포켓몬 카드 v2 */
.pokemon-card-thumbnail {
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.6), rgba(20, 20, 35, 0.7));
  border-radius: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.pokemon-card-thumbnail:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 35, 0.9));
}

.pokemon-card-thumbnail.fainted {
  opacity: 0.4;
  filter: grayscale(1);
}

.thumbnail-image {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.thumbnail-image img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.thumbnail-info {
  flex: 1;
  min-width: 0;
}

.thumbnail-name {
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.thumbnail-level {
  font-size: 0.55rem;
  color: #a0a0a0;
}

.thumbnail-hp-bar {
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.thumbnail-hp-fill {
  height: 100%;
  background: var(--neon-green);
  border-radius: 2px;
  transition: width 0.4s ease-out;
}

.thumbnail-hp-fill.low {
  background: var(--neon-yellow);
}

.thumbnail-hp-fill.critical {
  background: var(--neon-red);
}

/* VS 디바이더 v2 */
.raid-vs-badge,
.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.raid-vs-badge .vs-text,
.vs-divider .vs-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold-primary);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* 배틀 로그 v2 */
.raid-battle-log,
.battle-log {
  background: rgba(18, 18, 30, 0.95);
  border-radius: 12px;
  padding: 12px 16px;
  border-left: 4px solid var(--neon-cyan);
  max-height: 100px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.raid-battle-log .log-entry,
.battle-log .log-entry {
  font-size: 0.8rem;
  color: #ffffff;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.raid-battle-log .log-entry:last-child,
.battle-log .log-entry:last-child {
  border-bottom: none;
}

.raid-battle-log .log-entry.damage,
.battle-log .log-entry.damage {
  color: var(--neon-red);
}

.raid-battle-log .log-entry.attack,
.battle-log .log-entry.attack {
  color: var(--neon-cyan);
}

.raid-battle-log .log-entry.faint,
.battle-log .log-entry.faint {
  color: var(--neon-green);
}

/* ================================
   전투 애니메이션 v2
================================ */

/* 1. 공격 애니메이션 v2 */
.pokemon-card-active.attack {
  animation: attackLunge 0.3s ease-out;
}

@keyframes attackLunge {
  0% { transform: translateX(0) scale(1); }
  40% { transform: translateX(15px) scale(1.08); }
  100% { transform: translateX(0) scale(1); }
}

/* 상대방 공격 (반대 방향) */
.raid-battle-boss-area .pokemon-card-active.attack {
  animation: attackLungeEnemy 0.3s ease-out;
}

@keyframes attackLungeEnemy {
  0% { transform: translateX(0) scale(1); }
  40% { transform: translateX(-15px) scale(1.08); }
  100% { transform: translateX(0) scale(1); }
}

/* 2. 피격 애니메이션 v2 */
.pokemon-card-active.hit {
  animation: hitShake 0.5s ease-out;
}

@keyframes hitShake {
  0% { transform: translateX(0); filter: brightness(1); }
  15% { transform: translateX(-4px); filter: brightness(2); }
  30% { transform: translateX(4px); filter: brightness(1.5); }
  45% { transform: translateX(-3px); filter: brightness(1.2); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); filter: brightness(1); }
}

/* 3. 쓰러짐 애니메이션 v2 */
.pokemon-card-active.fainted {
  opacity: 0.5;
  filter: grayscale(0.9);
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.1) !important;
  animation: faintFall 0.6s ease-out forwards !important;
  box-shadow: none !important;
}

.pokemon-card-active.fainted .hp-bar {
  width: 0% !important;
}

.pokemon-card-active.fainted .thumbnail-hp-fill {
  width: 0% !important;
}

.pokemon-card-active.fainted::after {
  content: '쓰러졌다';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-red);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 6px var(--neon-red);
  z-index: 5;
  animation: faintText 0.5s ease-out 0.3s both;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  white-space: nowrap;
}

@keyframes faintFall {
  0% { transform: scale(1) rotate(0deg); opacity: 1; filter: grayscale(0); }
  30% { transform: scale(1.05) rotate(5deg); opacity: 0.8; }
  60% { transform: scale(0.98) rotate(-3deg); opacity: 0.6; }
  100% { transform: scale(0.92) rotate(0deg); opacity: 0.5; filter: grayscale(0.9); }
}

@keyframes faintText {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 4. 파티클 효과 v2 */
.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
}

/* 피격 파티클 (빨간색) */
.particle-hit {
  background: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
  animation: particleExplode 0.6s ease-out forwards;
}

@keyframes particleExplode {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* 쓰러짐 파티클 (회색) */
.particle-faint {
  background: #666666;
  box-shadow: 0 0 6px rgba(100, 100, 100, 0.5);
  animation: particleFade 0.8s ease-out forwards;
}

@keyframes particleFade {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* HP바 감소 애니메이션 v2 */
.hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), #00cc66);
  border-radius: 8px;
  position: relative;
  transition: width 0.4s ease-out;
}

.hp-bar.low {
  background: linear-gradient(90deg, var(--neon-yellow), #cc9900);
}

.hp-bar.critical {
  background: linear-gradient(90deg, var(--neon-red), #cc0033);
  animation: hpCritical 0.5s ease-in-out infinite;
}

@keyframes hpCritical {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.hp-bar.dropping {
  animation: hpDropFlash 0.3s ease-out;
}

@keyframes hpDropFlash {
  0% { filter: brightness(2); background: linear-gradient(90deg, var(--neon-red), #cc0033); }
  100% { filter: brightness(1); }
}

/* 전투 반응형 v2 */
@media (max-width: 768px) {
  .raid-battle-field {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .raid-vs-badge {
    transform: rotate(90deg);
    margin: 8px 0;
  }
  .thumbnail-grid {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr;
  }
  .pokemon-image-active {
    width: 100px;
    height: 100px;
  }
}

@media (max-width: 600px) {
  .pokemon-image-active {
    width: 90px;
    height: 90px;
  }
  .pokemon-name {
    font-size: 0.8rem;
  }
  .level-badge {
    font-size: 0.6rem;
    padding: 2px 8px;
  }
  .hp-bar-bg {
    height: 6px;
  }
  .hp-text {
    font-size: 0.55rem;
  }
  .vs-text {
    font-size: 1.5rem;
  }
  .thumbnail-image {
    width: 32px;
    height: 32px;
  }
  .thumbnail-image img {
    width: 24px;
    height: 24px;
  }
  .raid-battle-log {
    padding: 10px 12px;
    max-height: 80px;
  }
  .raid-battle-log .log-entry {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .pokemon-image-active {
    width: 80px;
    height: 80px;
  }
  .pokemon-name {
    font-size: 0.75rem;
  }
  .level-badge {
    font-size: 0.55rem;
    padding: 2px 6px;
  margin: 0 auto 6px;
  }
  .hp-bar-bg {
    height: 5px;
    border-radius: 5px;
  }
  .hp-text {
    font-size: 0.5rem;
    margin-top: 2px;
  }
  .vs-text {
    font-size: 1.3rem;
  }
  .thumbnail-image {
    width: 28px;
    height: 28px;
  }
  .thumbnail-image img {
    width: 20px;
    height: 20px;
  }
  .thumbnail-name {
    font-size: 0.6rem;
  }
  .thumbnail-level {
    font-size: 0.5rem;
  }
  .thumbnail-hp-bar {
    height: 2px;
    margin-top: 2px;
  }
  .raid-battle-log {
    padding: 8px 10px;
    max-height: 70px;
  }
  .raid-battle-log .log-entry {
    font-size: 0.7rem;
    padding: 2px 0;
  }
}

@media (max-width: 360px) {
  .pokemon-image-active {
    width: 70px;
    height: 70px;
  }
  .pokemon-name {
    font-size: 0.7rem;
  }
  .level-badge {
    font-size: 0.5rem;
    padding: 2px 5px;
  }
  .hp-text {
    font-size: 0.45rem;
  }
  .vs-text {
    font-size: 1.1rem;
  }
  .thumbnail-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
  .thumbnail-image {
    width: 24px;
    height: 24px;
  }
  .thumbnail-image img {
    width: 18px;
    height: 18px;
  }
  .thumbnail-name {
    font-size: 0.5rem;
  }
  .thumbnail-level {
    font-size: 0.4rem;
  }
  .raid-battle-log .log-entry {
    font-size: 0.65rem;
  }
}

