/* 탑 시스템 스타일 - 스톱워치 스타일 */

.tower-container {
    max-width: 1200px;
    margin: 0 auto;
    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);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 10px 0;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

.tower-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tower-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.tower-key-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-icon {
    font-size: 20px;
}

.tower-progress-info {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 탑 랭킹 섹션 */
.tower-ranking-section {
    margin-bottom: 40px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
}

.ranking-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.my-rank-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.my-rank-label {
    color: var(--text-secondary);
}

.my-rank-value {
    font-weight: bold;
    color: var(--gold-primary);
    font-size: 18px;
}

.my-rank-floor {
    color: var(--text-secondary);
    font-size: 14px;
}

.ranking-list {
    min-height: 100px;
}

.ranking-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.ranking-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.5);
}

.ranking-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border-color: rgba(192, 192, 192, 0.5);
}

.ranking-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border-color: rgba(205, 127, 50, 0.5);
}

.ranking-rank {
    min-width: 80px;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 16px;
}

.ranking-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ranking-profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.ranking-profile-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    font-size: 24px;
    flex-shrink: 0;
}

.ranking-nickname {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

.ranking-floor {
    min-width: 60px;
    text-align: right;
    font-weight: bold;
    color: var(--gold-primary);
    font-size: 16px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold-primary);
}

.tower-floor-group {
    margin-bottom: 40px;
}

.floor-group-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* 탑 층 목록 컨테이너 (슬라이드 형식) */
.tower-floors-container {
    padding: 20px;
    position: relative;
}

/* 슬라이드 컨테이너 */
.tower-slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

/* 슬라이드 래퍼 */
.tower-slider-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0; /* flex 아이템이 축소될 수 있도록 */
    width: 100%;
}

/* 슬라이드 트랙 */
.tower-slider-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    will-change: transform;
}

/* 슬라이드 아이템 */
.tower-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tower-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* 슬라이드 버튼 */
.tower-slider-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.tower-slider-btn:hover:not(:disabled) {
    background: var(--gold-primary);
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.6);
}

.tower-slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 슬라이드 인디케이터 */
.tower-slider-indicator {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.tower-slider-indicator .current-floor {
    color: var(--gold-primary);
    font-size: 1rem;
}

.tower-slider-indicator .floor-separator {
    color: var(--text-secondary);
}

.tower-slider-indicator .total-floors {
    color: var(--text-secondary);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .tower-container {
        padding: 16px;
    }

    .tower-slider-container {
        gap: 10px;
        margin: 20px 0;
    }

    .tower-slider-wrapper {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }

    .tower-slider-track {
        width: 100%;
    }

    .tower-slide {
        width: 100%;
        min-width: 100%;
    }

    .tower-slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .tower-floor-card {
        padding: 20px;
        max-width: 100%;
    }

    .floor-number {
        font-size: 2rem;
    }

    .tower-slider-indicator {
        bottom: -35px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .tower-slider-indicator .current-floor {
        font-size: 0.9rem;
    }

    .tower-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .tower-progress-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tower-container {
        padding: 12px;
    }

    .tower-slider-container {
        gap: 5px;
        margin: 15px 0;
    }

    .tower-slider-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .tower-floor-card {
        padding: 16px;
    }

    .floor-number {
        font-size: 1.8rem;
    }

    .floor-pokemon {
        flex-direction: column;
        text-align: center;
    }

    .floor-pokemon-image {
        width: 80px;
        height: 80px;
    }

    .tower-slider-indicator {
        bottom: -30px;
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* 탑 시각화 컨테이너 (슬라이드 형식에서는 사용하지 않음) */

.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tower-floor-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.tower-floor-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    z-index: 10;
}

.tower-floor-card.locked {
    opacity: 0.5;
    background: rgba(50, 50, 50, 0.3);
    filter: grayscale(0.7);
    cursor: not-allowed;
}

.tower-floor-card.cleared {
    border-color: var(--neon-green, #00ff88);
    background: rgba(0, 255, 136, 0.1);
}

.floor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.floor-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
}

.floor-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.cleared-badge {
    background: var(--success-color);
    color: white;
}

.locked-badge {
    background: var(--text-secondary);
    color: white;
}

.floor-pokemon {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floor-pokemon-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.floor-pokemon-info {
    flex: 1;
}

.pokemon-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.pokemon-types {
    display: flex;
    gap: 5px;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-dark { background: #705848; }
.type-steel { background: #B8B8D0; }
.type-fairy { background: #EE99AC; }

.floor-requirements {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.requirement-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.req-label {
    color: var(--text-secondary);
}

.req-value {
    font-weight: bold;
}

.req-value.satisfied {
    color: var(--success-color);
}

.req-value.unsatisfied {
    color: var(--error-color);
}

.floor-rewards {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reward-gold {
    font-size: 1rem;
    color: var(--gold-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.floor-challenge-btn {
    width: 100%;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.floor-challenge-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.floor-challenge-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tower-catch-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.catch-modal-content {
    background: var(--card-bg-solid, #121212);
    border: var(--card-border, 1px solid rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--card-shadow, 0 8px 32px rgba(0, 0, 0, 0.6));
}

.catch-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.catch-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
}

.catch-pokemon-info {
    text-align: center;
    margin-bottom: 30px;
}

.catch-pokemon-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.catch-pokemon-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.catch-pokemon-rarity {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.catch-pokemon-rarity.rarity-common {
    background: #e0e0e0;
    color: #666;
}

.catch-pokemon-rarity.rarity-uncommon {
    background: #2ecc71;
    color: white;
}

.catch-pokemon-rarity.rarity-rare {
    background: #4fc3f7;
    color: white;
}

.catch-pokemon-rarity.rarity-epic {
    background: #ba68c8;
    color: white;
}

.catch-pokemon-rarity.rarity-legendary {
    background: linear-gradient(135deg, #ffd700, #ff8f00);
    color: white;
}

.catch-pokemon-rarity.rarity-mythical {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
    color: white;
}

.catch-attempts {
    font-size: 14px;
    color: var(--text-secondary);
}

.catch-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.catch-success {
    background: var(--success-color);
    color: white;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.success-message {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.success-details {
    font-size: 14px;
}

.shiny-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-weight: bold;
}

.catch-fail {
    background: var(--error-color);
    color: white;
}

.fail-message {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.fail-details {
    font-size: 14px;
}

.no-more-attempts {
    margin-top: 10px;
    font-weight: bold;
}

/* 스톱워치 게임 스타일 (챌린지와 동일) */
.tower-catch-modal .stopwatch-game {
    margin-top: 20px;
}

.tower-catch-modal .stopwatch-display {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: var(--text-primary);
}

.tower-catch-modal .stopwatch-target {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.tower-catch-modal .game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tower-catch-modal .game-buttons button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
}

/* ================================
   전투 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;
}

/* 썸네일 그리드 */
.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-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;
  position: relative;
  transition: width 0.4s ease-out;
}

.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); }
}

/* 전투 반응형 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;
  }
}
