/**
 * ⚔️ 팀 편성 & 전투 프리미엄 스타일
 * NIKKE + Blue Archive 스타일
 */

/* ===== 팀 편성 (TeamView) ===== */
#content-team {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 덱 탭 */
.deck-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.deck-tab {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.deck-tab.active {
    background: linear-gradient(135deg, rgba(107, 92, 231, 0.3), rgba(26, 26, 46, 0.9));
    border-color: #6B5CE7;
    color: #fff;
}

.deck-tab:hover {
    border-color: rgba(107, 92, 231, 0.5);
}

/* 덱 슬롯 */
#deck-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 25px 15px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(26, 26, 46, 0.6));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-slot {
    width: 90px;
    height: 90px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.deck-slot:hover {
    border-color: #6B5CE7;
    background: rgba(107, 92, 231, 0.1);
    transform: scale(1.05);
}

.deck-slot.filled {
    border-style: solid;
    border-color: #6B5CE7;
}

.deck-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.deck-slot .btn-remove-slot {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #EF5350, #D32F2F);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.deck-slot .btn-remove-slot:hover {
    transform: scale(1.1);
}

/* 크리처 풀 */
#deck-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
}

/* ===== 전투 페이지 (BattleView) ===== */
#content-battle {
    padding: 20px;
}

/* 전투 모드 탭 */
.battle-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.battle-mode-tab {
    flex: 1;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #888;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.battle-mode-tab.active {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.3), rgba(26, 26, 46, 0.9));
    border-color: #EF5350;
    color: #fff;
}

.battle-mode-tab:hover {
    border-color: rgba(239, 83, 80, 0.5);
}

/* 스테이지 정보 */
.stage-info-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(26, 26, 46, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.stage-info-card h3 {
    color: #FFD700;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.stage-progress {
    margin-bottom: 15px;
}

.stage-progress .progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
}

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

/* 전투 속도 컨트롤 */
.speed-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
}

.speed-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-btn.active {
    border-color: #6B5CE7;
    background: linear-gradient(135deg, #6B5CE7, #8B5CF6);
    box-shadow: 0 0 15px rgba(107, 92, 231, 0.5);
}

.speed-btn:hover {
    transform: scale(1.1);
}

/* 타워 UI */
.tower-info {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(156, 39, 176, 0.4);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.tower-floor {
    font-size: 3rem;
    font-weight: bold;
    color: #CE93D8;
    text-shadow: 0 0 20px rgba(156, 39, 176, 0.5);
}

.tower-best {
    color: #888;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* PvP 로비 */
.pvp-lobby {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pvp-opponent-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pvp-opponent-card:hover {
    border-color: #EF5350;
    background: rgba(239, 83, 80, 0.1);
    transform: translateX(5px);
}

.pvp-opponent-card .rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.pvp-opponent-card .rank-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FF9800);
    color: #000;
}

.pvp-opponent-card .rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #9E9E9E);
    color: #000;
}

.pvp-opponent-card .rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #8D5524);
    color: #fff;
}

.pvp-opponent-card .opponent-info {
    flex: 1;
}

.pvp-opponent-card .opponent-name {
    font-weight: bold;
    color: #fff;
}

.pvp-opponent-card .opponent-power {
    color: #888;
    font-size: 0.9rem;
}

/* 전투 시작 버튼 */
.btn-battle-start {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #EF5350, #D32F2F);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(239, 83, 80, 0.4);
    transition: all 0.3s ease;
}

.btn-battle-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(239, 83, 80, 0.5);
}

.btn-battle-start:disabled {
    background: #4a4a4a;
    box-shadow: none;
    cursor: not-allowed;
}

/* 반응형 */
@media (max-width: 600px) {
    #deck-slots {
        flex-wrap: wrap;
    }

    .deck-slot {
        width: 70px;
        height: 70px;
    }

    .speed-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ========================================
   🌞 라이트 모드 - 전투 탭
   Blue Archive 청량 스타일
   ======================================== */

[data-theme="light"] #deck-slots {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.05),
            rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .deck-slot {
    background: rgba(255, 255, 255, 0.8);
    border: 2px dashed rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .deck-slot:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="light"] .deck-slot.filled {
    border-style: solid;
    border-color: #3b82f6;
}

[data-theme="light"] .deck-tab {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #64748b;
}

[data-theme="light"] .deck-tab.active {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.1),
            rgba(255, 255, 255, 0.95));
    border-color: #3b82f6;
    color: #1e40af;
}

[data-theme="light"] #deck-pool {
    background: rgba(59, 130, 246, 0.05);
}

[data-theme="light"] .battle-mode-tab {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #64748b;
}

[data-theme="light"] .battle-mode-tab.active {
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.05),
            rgba(255, 255, 255, 0.95));
    border-color: #ef4444;
    color: #b91c1c;
}

[data-theme="light"] .stage-info-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 248, 255, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="light"] .stage-info-card h3 {
    color: #f59e0b;
    /* Gold but darker for light mode */
}

[data-theme="light"] .speed-controls {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .speed-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.3);
    color: #64748b;
}

[data-theme="light"] .speed-btn.active {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .tower-info {
    background: linear-gradient(135deg,
            rgba(147, 51, 234, 0.05),
            rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(147, 51, 234, 0.2);
}

[data-theme="light"] .tower-floor {
    color: #9333ea;
    text-shadow: none;
}

[data-theme="light"] .pvp-opponent-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e293b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .pvp-opponent-card:hover {
    border-color: #ef4444;
    background: rgba(254, 242, 242, 0.95);
}

[data-theme="light"] .pvp-opponent-card .opponent-name {
    color: #1e293b;
}

[data-theme="light"] .pvp-opponent-card .opponent-power {
    color: #64748b;
}

[data-theme="light"] .btn-battle-start {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}