/* ============================================
   ARMY SYSTEM - Pokemon/Yu-Gi-Oh Trading Cards
   Professional Design Based on Real TCG Cards
   ============================================ */

/* ===== CSS Variables ===== */
.army-view {
    /* BG3 Page Theme */
    --bg-dark: #1a1412;
    --bg-medium: #2a2220;
    --bg-card: #352e2a;
    --bg-hover: #453d38;

    /* Gold Accents */
    --gold: #d4a853;
    --gold-light: #e8c77b;
    --gold-dark: #a07d32;
    --crimson: #8b2942;
    --parchment: #e8dcc4;

    /* Text Colors */
    --text-primary: #f5f0e8;
    --text-secondary: #a89f94;
    --text-muted: #6b6259;

    /* Borders */
    --border-gold: rgba(212, 168, 83, 0.4);
    --border-light: rgba(255, 255, 255, 0.08);

    /* Pokemon-Style Card Colors by Rarity */
    --card-common-bg: linear-gradient(145deg, #e8e0d0 0%, #d4c9b5 50%, #c9bea8 100%);
    --card-common-frame: linear-gradient(180deg, #a69780 0%, #8b7d68 50%, #756751 100%);
    --card-common-accent: #8b7d68;

    --card-uncommon-bg: linear-gradient(145deg, #d4f5d4 0%, #a8e6a8 50%, #8cd98c 100%);
    --card-uncommon-frame: linear-gradient(180deg, #5cb85c 0%, #449d44 50%, #357935 100%);
    --card-uncommon-accent: #449d44;

    --card-rare-bg: linear-gradient(145deg, #cce5ff 0%, #99caff 50%, #66b0ff 100%);
    --card-rare-frame: linear-gradient(180deg, #4a90d9 0%, #357abd 50%, #2563a0 100%);
    --card-rare-accent: #357abd;

    --card-epic-bg: linear-gradient(145deg, #e8d4f5 0%, #d4a8eb 50%, #c17de0 100%);
    --card-epic-frame: linear-gradient(180deg, #9b59b6 0%, #8e44ad 50%, #7d3c98 100%);
    --card-epic-accent: #8e44ad;

    --card-legendary-bg: linear-gradient(145deg, #fff3cd 0%, #ffe69c 50%, #ffd966 100%);
    --card-legendary-frame: linear-gradient(180deg, #f5a623 0%, #e8940c 50%, #d4820a 100%);
    --card-legendary-accent: #e8940c;
}

/* ===== Main Container - EPIC FANTASY WAR ROOM ===== */
.army-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px 100px;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-primary);
    /* Dramatic purple/gold magical gradient */
    background:
        /* Magical energy beams */
        radial-gradient(ellipse 100% 50% at 50% 0%, rgba(147, 51, 234, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 80% 40% at 20% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 80% 40% at 80% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        /* Central golden glow (like a magical map) */
        radial-gradient(ellipse 60% 40% at 50% 50%, rgba(212, 168, 83, 0.08) 0%, transparent 70%),
        /* Dark mystical base */
        linear-gradient(180deg,
            #0f0a15 0%,
            #1a1025 15%,
            #150d1a 40%,
            #120a14 60%,
            #0d0810 100%
        );
}

/* Magical mist/fog overlay */
.army-view::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        /* Swirling mist effect */
        radial-gradient(ellipse 100% 30% at 50% 100%, rgba(147, 51, 234, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 0% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 100% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
    animation: mistPulse 8s ease-in-out infinite;
}

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

/* Magical floating particles - golden sparkles */
.army-view::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        /* Large golden particles */
        radial-gradient(2px 2px at 15% 20%, rgba(255, 215, 0, 0.8) 0%, transparent 100%),
        radial-gradient(2px 2px at 85% 15%, rgba(255, 200, 100, 0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 45% 80%, rgba(212, 168, 83, 0.8) 0%, transparent 100%),
        radial-gradient(2px 2px at 75% 70%, rgba(255, 215, 0, 0.6) 0%, transparent 100%),
        /* Small purple magic particles */
        radial-gradient(1px 1px at 25% 40%, rgba(168, 85, 247, 0.7) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 35%, rgba(139, 92, 246, 0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 60%, rgba(147, 51, 234, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 55%, rgba(168, 85, 247, 0.6) 0%, transparent 100%),
        /* Tiny white sparkles */
        radial-gradient(1px 1px at 10% 65%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 25%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 85%, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    animation: magicParticles 15s linear infinite;
}

@keyframes magicParticles {
    0% { transform: translateY(0) scale(1); opacity: 0.7; }
    25% { opacity: 1; }
    50% { transform: translateY(-30vh) scale(1.1); opacity: 0.8; }
    75% { opacity: 1; }
    100% { transform: translateY(-60vh) scale(1); opacity: 0.7; }
}

.army-view > *:not(.army-modal-overlay):not(.army-corner) {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   GLOWING CRYSTALS - Corner Magic (Non-sticky)
   ============================================ */

.army-corner {
    position: absolute;
    width: 70px;
    height: 70px;
    z-index: 2;
    pointer-events: none;
}

.army-corner svg {
    width: 100%;
    height: 100%;
}

/* Top corners - positioned in header area */
.army-corner.top-left { top: 0; left: 0; }
.army-corner.top-right { top: 0; right: 0; transform: scaleX(-1); }

/* Bottom corners container */
.army-bottom-corners {
    position: relative;
    width: 100%;
    height: 70px;
    margin-top: 20px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Bottom corners - positioned within container */
.army-corner.bottom-left {
    position: absolute;
    bottom: 0;
    left: 0;
    transform: scaleY(-1);
}

.army-corner.bottom-right {
    position: absolute;
    bottom: 0;
    right: 0;
    transform: scale(-1, -1);
}

/* Crystal glow animation */
.army-corner .crystal-glow {
    animation: crystalPulse 3s ease-in-out infinite;
}

@keyframes crystalPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6)) drop-shadow(0 0 15px rgba(147, 51, 234, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.9)) drop-shadow(0 0 30px rgba(147, 51, 234, 0.6));
    }
}

/* ============================================
   MAGICAL BORDER FRAME - Hidden (not sticky)
   ============================================ */

.army-frame {
    display: none; /* Remove fixed frame - causes issues on mobile */
}

.army-rivet {
    display: none; /* Remove fixed rivets */
}

/* ============================================
   SWORD DIVIDERS
   ============================================ */

.army-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
    opacity: 0.7;
}

.army-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.5), transparent);
}

.army-divider-icon {
    color: var(--gold);
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Crossed swords divider */
.army-divider-swords {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 24px;
    margin: 12px 0;
}

.army-divider-swords::before,
.army-divider-swords::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.4));
}

.army-divider-swords::before { left: 0; }
.army-divider-swords::after { right: 0; transform: scaleX(-1); }

.army-divider-swords svg {
    width: 28px;
    height: 28px;
    color: var(--gold);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* ===== Header - Magical War Room Style ===== */
.army-header {
    position: relative;
    text-align: center;
    padding: 24px 0 28px;
    margin-bottom: 16px;
    background:
        /* Inner glow */
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 80%, rgba(212, 168, 83, 0.1) 0%, transparent 60%),
        linear-gradient(180deg, rgba(30, 20, 40, 0.95) 0%, rgba(20, 15, 30, 0.98) 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(180deg, rgba(168, 85, 247, 0.5), rgba(212, 168, 83, 0.5), rgba(168, 85, 247, 0.3)) 1;
    border-radius: 12px;
    box-shadow:
        0 0 40px rgba(147, 51, 234, 0.2),
        0 4px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(147, 51, 234, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Magical top glow beam */
.army-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.6) 20%,
        rgba(212, 168, 83, 1) 50%,
        rgba(168, 85, 247, 0.6) 80%,
        transparent 100%
    );
    border-radius: 2px;
    box-shadow:
        0 0 15px rgba(212, 168, 83, 0.6),
        0 0 30px rgba(168, 85, 247, 0.4);
    animation: headerGlow 2s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { opacity: 0.8; width: 150px; }
    50% { opacity: 1; width: 180px; }
}

.army-header::after {
    content: '✨';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.8));
    animation: starFloat 3s ease-in-out infinite;
}

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

/* Corner decorations on header */
.army-header-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.5;
}
.army-header-corner.tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.army-header-corner.tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.army-header-corner.bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.army-header-corner.br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

.army-header-emblem {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
        radial-gradient(circle, rgba(212, 168, 83, 0.2) 0%, transparent 80%);
    border-radius: 50%;
    border: 2px solid rgba(168, 85, 247, 0.4);
    box-shadow:
        0 0 20px rgba(147, 51, 234, 0.4),
        inset 0 0 15px rgba(168, 85, 247, 0.2);
    animation: emblemGlow 3s ease-in-out infinite;
}

@keyframes emblemGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
        box-shadow: 0 0 20px rgba(147, 51, 234, 0.4), inset 0 0 15px rgba(168, 85, 247, 0.2);
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.7));
        box-shadow: 0 0 35px rgba(147, 51, 234, 0.6), inset 0 0 20px rgba(168, 85, 247, 0.3);
    }
}

.army-title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 12px;
    background: linear-gradient(180deg, #fcd34d 0%, #d4a853 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: titleShimmer 4s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(212, 168, 83, 0.3)); }
    50% { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 20px rgba(212, 168, 83, 0.6)); }
}

.army-subtitle {
    font-size: 11px;
    color: #c4b5fd;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.army-header-line { display: none; }

/* ===== Back Button - Premium Glass Design ===== */
.army-back-btn {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(30, 20, 45, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 15px rgba(168, 85, 247, 0.05);
}

.army-back-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(212, 168, 83, 0.5);
    transform: translateY(-50%) scale(1.05);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(168, 85, 247, 0.2),
        inset 0 0 15px rgba(212, 168, 83, 0.05);
}

.army-back-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.army-back-btn .back-icon {
    width: 18px;
    height: 18px;
    stroke: var(--gold);
    filter: drop-shadow(0 0 4px rgba(212, 168, 83, 0.4));
    transition: all 0.3s ease;
}

.army-back-btn:hover .back-icon {
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.6));
}

/* Hide text label, show only icon */
.army-back-btn .back-text {
    display: none;
}

/* ===== Power Display - Magical Orb Style ===== */
.army-power-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 16px;
    background:
        radial-gradient(ellipse 80% 80% at 50% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 70%),
        linear-gradient(145deg, rgba(40, 25, 50, 0.95) 0%, rgba(20, 12, 30, 0.98) 100%);
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(147, 51, 234, 0.3),
        0 4px 25px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(168, 85, 247, 0.1);
}

/* Rotating magical energy */
.army-power-display::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(168, 85, 247, 0.2) 30deg,
        rgba(212, 168, 83, 0.15) 60deg,
        transparent 90deg,
        transparent 180deg,
        rgba(147, 51, 234, 0.15) 210deg,
        rgba(255, 215, 0, 0.1) 240deg,
        transparent 270deg
    );
    animation: powerRotate 10s linear infinite;
    pointer-events: none;
}

/* Secondary glow pulse */
.army-power-display::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(212, 168, 83, 0.2) 0%, transparent 60%);
    animation: powerPulseGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes powerPulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes powerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.army-power-display > * {
    position: relative;
    z-index: 1;
}

.army-power-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.5));
}

.army-power-value {
    font-family: 'Cinzel', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--gold);
    text-shadow:
        0 0 10px rgba(212, 168, 83, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
    animation: powerPulse 2s ease-in-out infinite;
}

@keyframes powerPulse {
    0%, 100% { text-shadow: 0 0 10px rgba(212, 168, 83, 0.5), 0 2px 4px rgba(0, 0, 0, 0.5); }
    50% { text-shadow: 0 0 20px rgba(212, 168, 83, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5); }
}

.army-power-label {
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ===== Sections - Magical Scroll Style ===== */
.army-section {
    margin-bottom: 20px;
    background:
        /* Inner magical glow */
        radial-gradient(ellipse 100% 80% at 50% 20%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 50% 80%, rgba(212, 168, 83, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, rgba(35, 25, 45, 0.95) 0%, rgba(25, 18, 35, 0.98) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    box-shadow:
        0 0 25px rgba(147, 51, 234, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(147, 51, 234, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Magical rune pattern overlay */
.army-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* Subtle mystical pattern */
        radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(212, 168, 83, 0.04) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(147, 51, 234, 0.03) 0%, transparent 40%);
    pointer-events: none;
    border-radius: 12px;
}

/* Magic orb corner accents */
.army-section::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle at 30% 30%, #a855f7, #7c3aed);
    border-radius: 50%;
    box-shadow:
        0 0 8px rgba(168, 85, 247, 0.6),
        calc(100% - 24px) 0 0 0 #a855f7,
        0 calc(100% - 24px) 0 0 #a855f7,
        calc(100% - 24px) calc(100% - 24px) 0 0 #a855f7,
        /* Glow for each corner */
        0 0 12px rgba(168, 85, 247, 0.5),
        calc(100% - 24px) 0 12px rgba(168, 85, 247, 0.5),
        0 calc(100% - 24px) 12px rgba(168, 85, 247, 0.5),
        calc(100% - 24px) calc(100% - 24px) 12px rgba(168, 85, 247, 0.5);
}

.army-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    position: relative;
}

/* Magical glow line under header */
.army-section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(168, 85, 247, 0.4) 20%,
        rgba(212, 168, 83, 0.6) 50%,
        rgba(168, 85, 247, 0.4) 80%,
        transparent 100%
    );
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.3);
}

/* Magic orb icon before title */
.army-section-header::before {
    content: '🔮';
    font-size: 16px;
    margin-right: 10px;
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
    animation: orbFloat 3s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.army-section-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    color: #e9d5ff;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(168, 85, 247, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.army-section-count {
    font-size: 10px;
    color: #fff;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.7) 0%, rgba(126, 34, 206, 0.9) 100%);
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid rgba(216, 180, 254, 0.3);
    box-shadow:
        0 0 10px rgba(168, 85, 247, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ===== Formation Grid ===== */
.army-formation-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   POKEMON-STYLE TRADING CARDS
   Authentic design with proper structure
   ============================================ */

/* Card Container */
.army-unit-card {
    position: relative;
    width: 110px;
    height: 155px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 10px;
}

.army-unit-card:hover {
    transform: translateY(-8px) scale(1.03);
}

/* Card Outer Frame - Thick metallic border */
.army-card-frame {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 5px;
    background: var(--card-common-frame);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

/* Rarity Frame Colors */
.army-unit-card.common .army-card-frame {
    background: var(--card-common-frame);
}
.army-unit-card.uncommon .army-card-frame {
    background: var(--card-uncommon-frame);
    box-shadow:
        0 4px 20px rgba(68, 157, 68, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}
.army-unit-card.rare .army-card-frame {
    background: var(--card-rare-frame);
    box-shadow:
        0 4px 20px rgba(53, 122, 189, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}
.army-unit-card.epic .army-card-frame {
    background: var(--card-epic-frame);
    box-shadow:
        0 4px 25px rgba(142, 68, 173, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}
.army-unit-card.legendary .army-card-frame {
    background: var(--card-legendary-frame);
    box-shadow:
        0 4px 30px rgba(232, 148, 12, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

/* Card Inner - The card face */
.army-card-inner {
    position: relative;
    height: 100%;
    background: var(--card-common-bg);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Rarity Inner Backgrounds */
.army-unit-card.common .army-card-inner { background: var(--card-common-bg); }
.army-unit-card.uncommon .army-card-inner { background: var(--card-uncommon-bg); }
.army-unit-card.rare .army-card-inner { background: var(--card-rare-bg); }
.army-unit-card.epic .army-card-inner { background: var(--card-epic-bg); }
.army-unit-card.legendary .army-card-inner { background: var(--card-legendary-bg); }

/* ===== CARD HEADER - Name + HP (Pokemon style) ===== */
.army-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.army-card-header .army-unit-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 10px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* HP Badge - Pokemon style red circle */
.army-hp-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.army-hp-badge::before {
    content: 'HP';
    font-size: 7px;
    opacity: 0.9;
}

/* Level Badge */
.army-level-badge {
    font-size: 9px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== PORTRAIT AREA - Large image zone ===== */
.army-unit-portrait {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%);
    border-radius: 6px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 50px;
    position: relative;
}

/* Level badge inside portrait */
.army-unit-portrait .army-level-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 8px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    padding: 2px 5px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.army-class-icon {
    font-size: 36px;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.3));
}

/* ===== STATS SECTION - Pokemon attack style ===== */
.army-card-stats {
    display: flex;
    justify-content: space-around;
    padding: 6px 5px;
    background: rgba(0, 0, 0, 0.12);
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.army-card-stat {
    text-align: center;
    flex: 1;
    padding: 2px 0;
}

.army-card-stat-value {
    font-size: 13px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.army-card-stat-label {
    font-size: 7px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Stat colors */
.army-card-stat.hp .army-card-stat-value { color: #d9534f; }
.army-card-stat.atk .army-card-stat-value { color: #e67e22; }
.army-card-stat.def .army-card-stat-value { color: #3498db; }

/* ===== CARD FOOTER - XP Progress ===== */
.army-unit-info {
    padding: 4px 6px 6px;
    background: rgba(0, 0, 0, 0.08);
}

.army-xp-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.army-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #f39c12);
    border-radius: 3px;
    box-shadow: 0 0 4px rgba(241, 196, 15, 0.5);
    transition: width 0.3s ease;
}

/* ===== EMPTY SLOT ===== */
.army-unit-card.empty .army-card-frame {
    background: rgba(100, 90, 80, 0.3);
    border: 2px dashed rgba(212, 168, 83, 0.4);
    box-shadow: none;
}

.army-unit-card.empty .army-card-inner {
    background: rgba(50, 45, 40, 0.5);
    justify-content: center;
    align-items: center;
}

.army-unit-card.empty:hover .army-card-frame {
    border-color: var(--gold);
}

.empty-plus {
    width: 36px;
    height: 36px;
    stroke: rgba(212, 168, 83, 0.5);
    stroke-width: 1.5;
}

.army-unit-card.empty:hover .empty-plus {
    stroke: var(--gold);
}

/* ============================================
   MINI CARDS - Barracks Grid
   ============================================ */

.army-barracks-section {
    background:
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(147, 51, 234, 0.1) 0%, transparent 60%),
        linear-gradient(180deg, rgba(35, 25, 45, 0.9) 0%, rgba(25, 18, 35, 0.95) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 14px;
    box-shadow:
        0 0 20px rgba(147, 51, 234, 0.15),
        inset 0 0 25px rgba(147, 51, 234, 0.05);
}

.army-barracks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.army-barracks-grid::-webkit-scrollbar { width: 4px; }
.army-barracks-grid::-webkit-scrollbar-track { background: var(--bg-dark); }
.army-barracks-grid::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

/* ============================================
   MINI CARDS - Same design as Formation Cards
   ============================================ */

.army-mini-card {
    position: relative;
    aspect-ratio: 5/7;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 4px;
}

.army-mini-card:hover {
    transform: translateY(-5px) scale(1.05);
}

/* Mini Card Frame Colors - Same metallic gradients as main cards */
.army-mini-card.common {
    background: var(--card-common-frame);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.army-mini-card.uncommon {
    background: var(--card-uncommon-frame);
    box-shadow:
        0 3px 15px rgba(68, 157, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.army-mini-card.rare {
    background: var(--card-rare-frame);
    box-shadow:
        0 3px 18px rgba(53, 122, 189, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.army-mini-card.epic {
    background: var(--card-epic-frame);
    box-shadow:
        0 3px 20px rgba(142, 68, 173, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.army-mini-card.legendary {
    background: var(--card-legendary-frame);
    box-shadow:
        0 3px 25px rgba(232, 148, 12, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.army-mini-card.in-formation {
    box-shadow:
        0 0 0 3px var(--gold),
        0 4px 15px rgba(212, 168, 83, 0.6);
}

/* Mini Card Inner - Bright gradient backgrounds */
.army-mini-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    overflow: hidden;
}

.army-mini-card.common .army-mini-card-inner { background: var(--card-common-bg); }
.army-mini-card.uncommon .army-mini-card-inner { background: var(--card-uncommon-bg); }
.army-mini-card.rare .army-mini-card-inner { background: var(--card-rare-bg); }
.army-mini-card.epic .army-mini-card-inner { background: var(--card-epic-bg); }
.army-mini-card.legendary .army-mini-card-inner { background: var(--card-legendary-bg); }

/* Mini Card Header */
.army-mini-card .army-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 5px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.army-mini-card .army-mini-name {
    font-family: 'Cinzel', serif;
    font-size: 7px;
    color: #1a1a1a;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.army-mini-card .army-mini-hp {
    font-size: 7px;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    padding: 1px 4px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Mini Card Portrait */
.army-mini-card .army-mini-portrait {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3px 4px;
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 100%);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    position: relative;
    min-height: 35px;
}

.army-mini-card .army-mini-icon {
    font-size: 22px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.25));
}

.army-mini-card .army-mini-level {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 7px;
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mini Card Stats */
.army-mini-card .army-mini-stats {
    display: flex;
    justify-content: space-around;
    padding: 3px 4px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.army-mini-card .army-mini-stat {
    text-align: center;
}

.army-mini-card .army-mini-stat-value {
    font-size: 9px;
    font-weight: 800;
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.army-mini-card .army-mini-stat-label {
    font-size: 5px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
}

/* Stat colors */
.army-mini-card .army-mini-stat.atk .army-mini-stat-value { color: #e67e22; }
.army-mini-card .army-mini-stat.def .army-mini-stat-value { color: #3498db; }

/* Formation Badge */
.army-mini-card .army-formation-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.army-mini-card .army-formation-badge .badge-icon {
    width: 12px;
    height: 12px;
    color: var(--bg-dark);
}

/* ===== Action Button - Magical Style ===== */
.army-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    margin-top: 18px;
    background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 0 20px rgba(147, 51, 234, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on button */
.army-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.army-action-btn:hover::before {
    left: 100%;
}

.army-action-btn:hover {
    background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 50%, #5b21b6 100%);
    box-shadow:
        0 0 30px rgba(147, 51, 234, 0.6),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.army-action-btn:active { transform: translateY(0) scale(0.98); }

/* ===== Empty State - Magical ===== */
.army-empty-state {
    text-align: center;
    padding: 36px 20px;
    background:
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(147, 51, 234, 0.1) 0%, transparent 70%),
        rgba(20, 15, 30, 0.6);
    border-radius: 12px;
    border: 2px dashed rgba(168, 85, 247, 0.4);
    box-shadow: inset 0 0 30px rgba(147, 51, 234, 0.1);
}

.army-empty-state-icon {
    font-size: 52px;
    margin-bottom: 14px;
    opacity: 0.7;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.5));
    animation: emptyFloat 4s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.army-empty-state-text {
    color: #c4b5fd;
    margin-bottom: 18px;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* ===== Stats Bar ===== */
.army-stats-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 14px 0;
    margin-top: 12px;
    border-top: 1px solid var(--border-light);
}

.army-stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.army-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.army-stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   MODAL STYLES - Compact & Colorful
   Fits on one mobile screen
   ============================================ */

.army-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.army-modal-overlay.active { display: flex; }

.army-modal-content {
    background: linear-gradient(145deg, #2d2825 0%, #1a1614 100%);
    border: 3px solid;
    border-image: linear-gradient(180deg, var(--gold-light), var(--gold-dark)) 1;
    border-radius: 16px;
    max-width: 340px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(212, 168, 83, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.army-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.army-modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.army-modal-body { padding: 16px 14px; }

/* Modal Header - Icon + Name inline */
.army-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.3);
}

.army-modal-unit-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(145deg, #3a3532 0%, #252220 100%);
    border: 2px solid var(--gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.army-modal-unit-icon .modal-icon { width: 32px; height: 32px; }

.army-modal-title-area { flex: 1; }

.army-modal-unit-name {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.army-modal-unit-subtitle {
    color: var(--text-secondary);
    font-size: 11px;
}

.army-modal-stars {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.army-modal-stars .star { width: 12px; height: 12px; }

/* Level + XP - Compact */
.army-level-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.army-level-circle {
    width: 42px;
    height: 42px;
    background: linear-gradient(145deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: bold;
    color: var(--bg-dark);
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(212, 168, 83, 0.4);
}

.army-level-info { flex: 1; }

.army-level-label {
    font-size: 9px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.army-level-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.army-level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(212, 168, 83, 0.5);
}

.army-level-text {
    font-size: 9px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Stats Grid - Colorful */
.army-modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.army-modal-stat {
    padding: 8px 4px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Colorful stat backgrounds */
.army-modal-stat.hp-stat {
    background: linear-gradient(145deg, #4a1f1f 0%, #2d1515 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.army-modal-stat.atk-stat {
    background: linear-gradient(145deg, #4a3a1f 0%, #2d2415 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.army-modal-stat.def-stat {
    background: linear-gradient(145deg, #1f2f4a 0%, #151d2d 100%);
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.army-modal-stat.spd-stat {
    background: linear-gradient(145deg, #1f4a2f 0%, #152d1d 100%);
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.army-modal-stat.crit-stat {
    background: linear-gradient(145deg, #4a1f3a 0%, #2d1525 100%);
    border: 1px solid rgba(236, 72, 153, 0.4);
}
.army-modal-stat.pwr-stat {
    background: linear-gradient(145deg, #3a1f4a 0%, #25152d 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.army-modal-stat-icon {
    font-size: 14px;
    margin-bottom: 2px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.army-modal-stat-value {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    line-height: 1;
}

/* Stat value colors */
.army-modal-stat.hp-stat .army-modal-stat-value { color: #ef4444; }
.army-modal-stat.atk-stat .army-modal-stat-value { color: #f59e0b; }
.army-modal-stat.def-stat .army-modal-stat-value { color: #3b82f6; }
.army-modal-stat.spd-stat .army-modal-stat-value { color: #22c55e; }
.army-modal-stat.crit-stat .army-modal-stat-value { color: #ec4899; }
.army-modal-stat.pwr-stat .army-modal-stat-value { color: #a855f7; }

.army-modal-stat-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Ability Card - Compact */
.army-ability-card {
    background: linear-gradient(145deg, rgba(212, 168, 83, 0.15) 0%, rgba(212, 168, 83, 0.05) 100%);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.army-ability-name {
    font-size: 12px;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.army-ability-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Action Buttons - Compact */
.army-modal-actions {
    display: flex;
    gap: 8px;
}

.army-modal-btn {
    flex: 1;
    padding: 12px 10px;
    border: none;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.1s, filter 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.army-modal-btn:hover { filter: brightness(1.15); transform: translateY(-2px); }
.army-modal-btn:active { transform: scale(0.97); }

.army-modal-btn.primary {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.army-modal-btn.secondary {
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.army-modal-btn.danger {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.army-modal-btn .btn-icon { width: 12px; height: 12px; }

/* ===== SVG Icons ===== */
.svg-icon { display: inline-block; vertical-align: middle; }
.emblem-icon { width: 40px; height: 40px; color: var(--gold); }
.power-svg { width: 40px; height: 40px; color: var(--gold); }
.class-svg { width: 36px; height: 36px; }
.mini-svg { width: 24px; height: 24px; }
.stat-icon { width: 18px; height: 18px; opacity: 0.8; }
.modal-icon { color: var(--gold); }
.btn-icon { width: 14px; height: 14px; }
.ability-icon { width: 14px; height: 14px; }
.badge-icon { width: 12px; height: 12px; }
.empty-icon { width: 48px; height: 48px; opacity: 0.4; }

.star { width: 12px; height: 12px; fill: var(--gold); }
.star.empty { fill: var(--text-muted); opacity: 0.3; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .army-view { padding: 0 10px 110px; }
    .army-header { padding: 12px 0 20px; }
    .army-title { font-size: 20px; letter-spacing: 5px; }
    .army-power-display { padding: 14px 18px; gap: 12px; }
    .army-power-value { font-size: 26px; }

    /* Larger cards on mobile */
    .army-unit-card {
        width: 105px;
        height: 150px;
    }

    .army-card-header .army-unit-name { font-size: 10px; }
    .army-hp-badge { font-size: 10px; padding: 3px 7px; }
    .army-level-badge { font-size: 9px; }
    .army-class-icon { font-size: 38px; }
    .army-card-stat-value { font-size: 14px; }
    .army-card-stat-label { font-size: 8px; }

    .army-barracks-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .army-mini-card .army-mini-icon { font-size: 26px; }
    .army-mini-card .army-mini-name { font-size: 9px; }
    .army-mini-card .army-mini-level { font-size: 9px; }

    .army-modal-content { max-width: 100%; max-height: 90vh; }
    .army-modal-body { padding: 20px 16px; }
}

@media (max-width: 380px) {
    .army-unit-card {
        width: 95px;
        height: 135px;
    }
    .army-formation-grid { gap: 8px; }
    .army-barracks-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (max-width: 340px) {
    .army-unit-card {
        width: 85px;
        height: 120px;
    }
    .army-card-header .army-unit-name { font-size: 9px; }
    .army-class-icon { font-size: 32px; }
    .army-card-stat-value { font-size: 12px; }
    .army-barracks-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   MOBILE PERFORMANCE - Disable Animations
   Keeps visual look, removes CPU-heavy effects
   ============================================ */

@media (max-width: 768px) {
    /* Stop all rotating/moving animations */
    .army-view::after,
    .army-view::before {
        animation: none !important;
    }

    /* Power display - remove rotating gradient */
    .army-power-display::before {
        animation: none !important;
        background: radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 70%) !important;
    }

    .army-power-display::after {
        animation: none !important;
        opacity: 0.5 !important;
        transform: none !important;
    }

    /* Header - stop glow animations */
    .army-header::before {
        animation: none !important;
    }

    .army-header::after {
        animation: none !important;
    }

    /* Emblem - stop glow pulse */
    .army-header-emblem {
        animation: none !important;
    }

    /* Title - stop shimmer */
    .army-title {
        animation: none !important;
    }

    /* Section header orb - stop floating */
    .army-section-header::before {
        animation: none !important;
    }

    /* Crystals - stop pulse */
    .army-corner .crystal-glow {
        animation: none !important;
        filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7)) !important;
    }

    /* Power value - stop pulse */
    .army-power-value {
        animation: none !important;
    }

    /* Empty state icon - stop float */
    .army-empty-state-icon {
        animation: none !important;
    }

    /* Action button - simplify hover (no shimmer) */
    .army-action-btn::before {
        display: none !important;
    }

    /* Cards - reduce hover effect for performance */
    .army-unit-card:hover {
        transform: translateY(-4px) !important;
    }

    .army-mini-card:hover {
        transform: translateY(-3px) !important;
    }
}

/* Also respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .army-view *,
    .army-view::before,
    .army-view::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   ARMY TABS - Barracks / Missions Toggle
   ============================================ */

/* ============================================
   ARMY TABS - Premium Glassmorphism Design
   ============================================ */
.army-tabs {
    display: flex;
    gap: 10px;
    margin: 0 16px 20px;
    padding: 8px;
    background: rgba(30, 20, 45, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(168, 85, 247, 0.03);
    position: relative;
}

/* Subtle top glow line */
.army-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 83, 0.5) 50%,
        transparent 100%);
    border-radius: 1px;
}

.army-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(168, 85, 247, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow */
.army-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.army-tab .tab-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.3));
    transition: all 0.3s ease;
}

.army-tab .tab-label {
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 13px;
}

.army-tab .tab-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.army-tab:hover {
    color: var(--text-primary);
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.15);
}

.army-tab:hover::before {
    opacity: 1;
}

.army-tab:hover .tab-icon {
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}

.army-tab.active {
    background: linear-gradient(135deg,
        rgba(212, 168, 83, 0.25) 0%,
        rgba(168, 85, 247, 0.15) 100%);
    color: var(--gold-light);
    border-color: rgba(212, 168, 83, 0.4);
    box-shadow:
        0 4px 20px rgba(212, 168, 83, 0.25),
        0 0 30px rgba(168, 85, 247, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 15px rgba(212, 168, 83, 0.05);
}

.army-tab.active::before {
    opacity: 1;
    background: radial-gradient(ellipse at 50% 0%,
        rgba(212, 168, 83, 0.1) 0%,
        transparent 70%);
}

.army-tab.active .tab-icon {
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.6));
    color: var(--gold);
}

.army-tab.active .tab-label {
    text-shadow: 0 0 15px rgba(212, 168, 83, 0.4);
}

/* Mission Table Container within Army View */
.army-view .mission-table-container {
    margin: 0;
    padding: 0;
}

/* Override mission table background within army view */
.army-view .mission-table {
    background: transparent;
    margin: 0;
    padding: 16px;
}

/* ============================================
   MOBILE RESPONSIVE TABS
   ============================================ */

@media (max-width: 480px) {
    .army-tabs {
        margin: 0 12px 16px;
        padding: 6px;
        gap: 8px;
    }

    .army-tab {
        padding: 12px 14px;
        gap: 8px;
    }

    .army-tab .tab-icon {
        font-size: 18px;
    }

    .army-tab .tab-label {
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .army-tab:hover {
        transform: none; /* Disable lift on mobile for better UX */
    }
}
