@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0a0d14;
    --card-bg: rgba(18, 24, 38, 0.85);
    --border-color: rgba(255, 215, 0, 0.25);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.45);
    --player-cyan: #00e5ff;
    --player-glow: rgba(0, 229, 255, 0.4);
    --enemy-red: #ff3344;
    --enemy-glow: rgba(255, 51, 68, 0.4);
    --health-green: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Outfit', sans-serif;
    color: #f1f5f9;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Master Game Container */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: hidden;
}

/* Canvas Area */
#canvas-container {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ================= TOP HUD ================= */
#top-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(180deg, rgba(8, 11, 19, 0.96) 0%, rgba(8, 11, 19, 0.8) 70%, transparent 100%);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    z-index: 20;
    pointer-events: none;
}

#top-hud > * {
    pointer-events: auto;
}

/* Statue Health Displays */
.statue-status {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 280px;
}

.statue-info {
    flex: 1;
}

.statue-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.statue-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.player-side .statue-avatar {
    background: linear-gradient(135deg, #09405c, #0d638f);
    border-color: var(--player-cyan);
    box-shadow: 0 0 15px var(--player-glow);
}

.player-side .statue-header span:first-child {
    color: var(--player-cyan);
    text-shadow: 0 0 8px var(--player-glow);
}

.enemy-side .statue-avatar {
    background: linear-gradient(135deg, #5c0d18, #8f0d23);
    border-color: var(--enemy-red);
    box-shadow: 0 0 15px var(--enemy-glow);
}

.enemy-side .statue-header span:first-child {
    color: var(--enemy-red);
    text-shadow: 0 0 8px var(--enemy-glow);
}

.health-track {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
}

.health-fill {
    height: 100%;
    width: 100%;
    transition: width 0.25s ease-out;
}

#player-statue-bar {
    background: linear-gradient(90deg, #059669, #10b981);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

#enemy-statue-bar {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Center HUD (Gold, Population, Controls) */
#center-hud {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.75);
    padding: 6px 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.resource-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 800;
}

.gold-badge {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.coin-icon {
    display: inline-block;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.pop-badge {
    color: #94a3b8;
}

.hud-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 12px;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: #ffd700;
    transform: translateY(-2px);
}

/* ================= TACTICAL STANCE ORDERS (TOP RIGHT) ================= */
#stance-hud {
    position: absolute;
    top: 82px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}

.stance-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.stance-btn:hover {
    transform: translateX(-4px);
    border-color: rgba(255, 215, 0, 0.6);
    color: #fff;
}

.stance-btn.active[data-stance="defend"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.2));
    border-color: #10b981;
    color: #6ee7b7;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.stance-btn.active[data-stance="attack"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(185, 28, 28, 0.2));
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.stance-btn.active[data-stance="retreat"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(29, 78, 216, 0.2));
    border-color: #3b82f6;
    color: #93c5fd;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.stance-btn.exit-castle-btn {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.45), rgba(161, 98, 7, 0.35));
    border-color: #ffd700;
    color: #fef08a;
    box-shadow: 0 0 16px rgba(234, 179, 8, 0.6);
    animation: exitCastlePulse 1.2s infinite alternate ease-in-out;
}
.stance-btn.exit-castle-btn:hover {
    border-color: #ffffff;
    box-shadow: 0 0 24px rgba(250, 204, 21, 0.95);
}
@keyframes exitCastlePulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(234, 179, 8, 0.4); }
    100% { transform: scale(1.05); box-shadow: 0 0 24px rgba(234, 179, 8, 0.9); }
}

.stance-btn.emergency-call-btn {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.75), rgba(234, 179, 8, 0.85)) !important;
    border: 2px solid #ffd700 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.85), inset 0 0 10px rgba(255, 215, 0, 0.5) !important;
    animation: emergencyCallPulse 0.85s infinite alternate ease-in-out !important;
    cursor: pointer;
}
.stance-btn.emergency-call-btn:hover {
    border-color: #ffffff !important;
    box-shadow: 0 0 30px rgba(234, 179, 8, 1) !important;
}
@keyframes emergencyCallPulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(56, 189, 248, 0.7); border-color: #38bdf8; }
    100% { transform: scale(1.08); box-shadow: 0 0 32px rgba(234, 179, 8, 1); border-color: #ffd700; }
}

/* ================= BOTTOM DECK (UNIT RECRUITMENT) ================= */
#bottom-hud {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
    padding: 8px 14px;
    background: rgba(10, 15, 26, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.unit-card {
    position: relative;
    width: 90px;
    height: 104px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 6px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.unit-card:hover:not(.disabled) {
    transform: translateY(-8px) scale(1.04);
    border-color: var(--gold);
    box-shadow: 0 8px 24px var(--gold-glow);
}

.unit-card.disabled {
    opacity: 0.45;
    filter: grayscale(0.8);
    cursor: not-allowed;
}

.hotkey-badge {
    position: absolute;
    top: 5px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unit-icon {
    font-size: 32px;
    margin-top: 8px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.unit-title {
    font-size: 11px;
    font-weight: 800;
    color: #f1f5f9;
    text-align: center;
    line-height: 1.1;
}

.unit-cost {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 800;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Cooldown Fill Overlay */
.cd-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: rgba(0, 0, 0, 0.75);
    pointer-events: none;
    transition: height 0.1s linear;
}

/* ================= MANUAL CONTROL OVERLAY ================= */
#controlled-unit-panel {
    position: absolute;
    bottom: 135px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 2px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    padding: 10px 22px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 25;
    animation: bounceIn 0.3s ease-out;
}

@keyframes bounceIn {
    0% { transform: translate(-50%, 20px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

.ctrl-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctrl-badge {
    background: #ffd700;
    color: #000;
    font-weight: 900;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
}

.ctrl-name {
    font-weight: 800;
    font-size: 15px;
    color: #fff;
}

.ctrl-hp {
    font-size: 13px;
    color: #10b981;
    font-weight: 700;
}

.ctrl-hints {
    font-size: 12px;
    color: #94a3b8;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 12px;
}

.ctrl-btn {
    background: #ef4444;
    border: none;
    color: #fff;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.ctrl-btn:hover {
    background: #dc2626;
}

/* ================= TOAST NOTIFICATION ================= */
.toast {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #f8fafc;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.warning {
    border-color: #ef4444;
    color: #fca5a5;
}

/* ================= MODALS & MENUS ================= */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 24px;
    padding: 36px 44px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.2);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 900;
    color: #ffd700;
    margin-bottom: 14px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.modal-desc {
    font-size: 15px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.primary-btn {
    background: linear-gradient(135deg, #ffd700, #b7791f);
    color: #0a0d14;
    border: none;
    padding: 12px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hidden {
    display: none !important;
}

/* Tutorial / Help Dialog Content */
.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
    margin-bottom: 24px;
    font-size: 13px;
}

.help-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-item b {
    color: #ffd700;
    display: block;
    margin-bottom: 3px;
}

/* ================= DIFFICULTY SELECTOR ================= */
.difficulty-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 18px 0 24px;
}

.diff-btn {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 10px;
    color: #cbd5e1;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.diff-btn .diff-stars {
    font-size: 14px;
}

.diff-btn .diff-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.diff-btn .diff-sub {
    font-size: 11px;
    opacity: 0.75;
}

.diff-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.diff-btn.active[data-diff="easy"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.15));
    border-color: #10b981;
    color: #a7f3d0;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.diff-btn.active[data-diff="medium"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.15));
    border-color: #f59e0b;
    color: #fde68a;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.diff-btn.active[data-diff="hard"] {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.15));
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Top HUD Difficulty Badge */
.diff-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.diff-badge.easy { color: #34d399; border-color: #34d399; }
.diff-badge.medium { color: #fbbf24; border-color: #fbbf24; }
.diff-badge.hard { color: #f87171; border-color: #f87171; }

/* ================= CHEAT SYSTEM STYLES ================= */
.cheat-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(217, 119, 6, 0.2)) !important;
    border-color: #ffd700 !important;
    color: #ffd700 !important;
    font-weight: 800 !important;
    animation: goldShimmer 2.5s infinite;
}

@keyframes goldShimmer {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.7); }
}

.cheat-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.cheat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.cheat-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.cheat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
}

.cheat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cheat-card-info b {
    color: #ffd700;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.cheat-card-info p {
    font-size: 12px;
    color: #94a3b8;
}

.cheat-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.cheat-toggle-btn.active {
    background: #10b981;
    border-color: #059669;
    color: #fff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.cheat-target-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.cheat-target-selector .target-label {
    font-size: 13px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.target-btn-group {
    display: flex;
    gap: 6px;
}

.target-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.target-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.target-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #ffd700;
    color: #000;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
    font-weight: 900;
}

.target-btn[data-target="enemy"].active {
    background: linear-gradient(135deg, #ef4444, #991b1b);
    border-color: #fca5a5;
    color: #fff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.target-btn[data-target="both"].active {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: #c4b5fd;
    color: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}

/* Cheat Unit Spawn Panel */
.cheat-unit-spawn-panel {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.spawn-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.spawn-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.spawn-qty-selector {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spawn-qty-selector .qty-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
}

.spawn-qty-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.spawn-qty-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.spawn-qty-btn.active {
    background: #38bdf8;
    color: #000;
    border-color: #bae6fd;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.spawn-panel-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.spawn-btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.cheat-spawn-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cheat-spawn-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.35);
}

.cheat-spawn-btn:active {
    transform: scale(0.96);
}

/* Active Cheats HUD Indicator */
#active-cheats-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 8px;
}

.cheat-pill {
    font-size: 10px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    animation: pulse 1.8s infinite;
}

.cheat-pill.gold {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.cheat-pill.cd {
    background: #38bdf8;
    color: #000;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.cheat-pill.pop {
    background: #c084fc;
    color: #000;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

.cheat-pill.spell {
    background: #34d399;
    color: #000;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.cheat-pill.gem {
    background: #ec4899;
    color: #fff;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

.cheat-pill.upgrade {
    background: #f97316;
    color: #fff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6);
}

.cheat-pill.spy {
    background: #38bdf8;
    color: #000;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.cheat-pill.statue {
    background: #eab308;
    color: #000;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.6);
}

.cheat-pill.heart {
    background: linear-gradient(135deg, #ef4444, #be123c);
    color: #fff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.cheat-pill.hitting {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: #000;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}

.cheat-pill.enemy-pill {
    background: linear-gradient(135deg, #881337, #4c0519);
    color: #fecdd3;
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
}

/* ================= ENEMY INTEL SPY RADAR HUD ================= */
#enemy-spy-hud {
    position: absolute;
    bottom: 85px;
    right: 250px;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid rgba(56, 189, 248, 0.6);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.35);
    backdrop-filter: blur(12px);
    padding: 10px 14px;
    z-index: 25;
    color: #f8fafc;
    font-family: inherit;
    animation: fadeIn 0.3s ease;
    transition: all 0.25s ease;
}

#enemy-spy-hud.collapsed {
    padding: 6px 12px;
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(56, 189, 248, 0.2);
}

#enemy-spy-hud.collapsed .spy-body {
    display: none !important;
}

#enemy-spy-hud.collapsed .spy-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.spy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    padding-bottom: 7px;
    margin-bottom: 8px;
}

.spy-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.spy-toggle-collapse-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.spy-toggle-collapse-btn:hover {
    background: #38bdf8;
    color: #000;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

.spy-title {
    font-size: 13px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.spy-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
}

.spy-badge.defend {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.spy-badge.attack {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
    border: 1px solid #ef4444;
}

.spy-badge.retreat {
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    border: 1px solid #f59e0b;
}

.spy-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.spy-label {
    color: #94a3b8;
    font-weight: 600;
}

.spy-val {
    color: #e2e8f0;
    font-weight: 700;
    text-align: right;
}

.spy-army-breakdown {
    font-size: 10px;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px dashed rgba(56, 189, 248, 0.3);
    line-height: 1.4;
}

/* ================= CRYSTAL BALL SPELLS DOCK ================= */
#spells-hud {
    position: absolute;
    bottom: 120px;
    left: 18px;
    display: grid;
    grid-template-columns: repeat(5, auto);
    gap: 8px 10px;
    z-index: 22;
    background: rgba(15, 23, 42, 0.88);
    padding: 8px 12px 6px;
    border-radius: 20px;
    border: 2px solid rgba(0, 229, 255, 0.35);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#spells-hud.collapsed {
    padding: 6px 12px;
    gap: 0;
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 215, 0, 0.3);
}

#spells-hud.collapsed .spell-orb-card {
    display: none !important;
}

#spells-hud.collapsed #spell-page-control {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#spell-page-control {
    grid-column: span 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 2px;
}

.spell-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spell-toggle-collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid #ffd700;
    color: #ffd700;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.spell-toggle-collapse-btn:hover {
    background: #ffd700;
    color: #000;
    transform: scale(1.12);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.spell-nav-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #4ade80 0%, #22c55e 50%, #15803d 100%);
    border: 2.5px solid #000;
    color: #000;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.spell-nav-circle-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(74, 222, 128, 1), inset 0 2px 6px rgba(255, 255, 255, 0.9);
}

#spell-page-indicator {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #4ade80;
    background: rgba(0, 0, 0, 0.55);
    padding: 3px 9px;
    border-radius: 10px;
    border: 1px solid rgba(74, 222, 128, 0.45);
}

.spell-orb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spell-orb-card.hidden-by-page {
    display: none !important;
}

.spell-orb-card:hover:not(.disabled) {
    transform: translateY(-6px) scale(1.08);
}

.spell-orb-card.disabled {
    opacity: 0.4;
    filter: grayscale(0.85);
    cursor: not-allowed;
}

/* Crystal Sphere Styling inspired by Wizard Shop */
.orb-sphere {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #a5f3fc 0%, #38bdf8 30%, #0369a1 70%, #082f49 100%);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(56, 189, 248, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.spell-orb-card:hover:not(.disabled) .orb-sphere {
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(255, 255, 255, 0.9), 0 0 24px rgba(56, 189, 248, 0.9);
}

/* Wooden Base Bowl */
.orb-wood-base {
    width: 44px;
    height: 9px;
    background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
    border: 1px solid #92400e;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

/* Icon inside sphere */
.orb-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    z-index: 2;
    transition: transform 0.2s;
}

.spell-orb-card:hover:not(.disabled) .orb-icon {
    transform: scale(1.15);
}

/* Glass Glint reflection */
.orb-glint {
    position: absolute;
    top: 6px;
    left: 10px;
    width: 14px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    transform: rotate(-35deg);
    pointer-events: none;
    z-index: 3;
}

/* Stock badge like the photo [0] [3] */
.orb-stock-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f59e0b;
    border: 1.5px solid #fff;
    color: #000;
    font-size: 11px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

/* Key label */
.orb-key-badge {
    position: absolute;
    bottom: 6px;
    left: -2px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffd700;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 4px;
    z-index: 5;
}

/* Radial Cooldown Overlay */
.orb-cd-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    font-size: 13px;
    font-weight: 800;
}

.spell-orb-card.spell-active .orb-sphere {
    border-color: #ffd700;
    box-shadow: 0 0 20px #ffd700, inset 0 0 15px rgba(255, 215, 0, 0.8);
    animation: spellPulse 1s infinite alternate;
}

@keyframes spellPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* ========================================================
   SKIN-THEMED SPELL CRYSTAL ORBS
   "dan spell sekarang saat memakai skin spellnya juga ikut terpasang skinnya"
   ======================================================== */
.spell-orb-card .orb-skin-badge {
    position: absolute;
    bottom: 2px;
    right: -2px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.78);
    border-radius: 50%;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 5;
    pointer-events: none;
    transition: transform 0.2s;
}

.spell-orb-card:hover .orb-skin-badge {
    transform: scale(1.25);
}

/* LEAF THEMED SPELLS (🍃 Skin Daun) */
#spells-hud.spell-skin-leaf .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #86efac 0%, #22c55e 35%, #15803d 70%, #052e16 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(187, 247, 208, 0.9), 0 0 16px rgba(74, 222, 128, 0.7) !important;
    border-color: #86efac !important;
}
#spells-hud.spell-skin-leaf .orb-wood-base {
    background: linear-gradient(180deg, #14532d 0%, #052e16 100%) !important;
    border-color: #22c55e !important;
}
#spells-hud.spell-skin-leaf .spell-orb-card:hover:not(.disabled) .orb-sphere {
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(255, 255, 255, 0.95), 0 0 24px rgba(74, 222, 128, 0.95) !important;
}

/* VOLTAIC THEMED SPELLS (⚡ Skin Voltaic) */
#spells-hud.spell-skin-voltaic .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #e0f2fe 0%, #38bdf8 30%, #0284c7 65%, #0f172a 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(254, 240, 138, 0.95), 0 0 18px rgba(56, 189, 248, 0.9) !important;
    border-color: #38bdf8 !important;
}
#spells-hud.spell-skin-voltaic .orb-wood-base {
    background: linear-gradient(180deg, #0369a1 0%, #0f172a 100%) !important;
    border-color: #38bdf8 !important;
}
#spells-hud.spell-skin-voltaic .spell-orb-card:hover:not(.disabled) .orb-sphere {
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(255, 255, 255, 1), 0 0 26px rgba(56, 189, 248, 1) !important;
}

/* FIRE THEMED SPELLS (🔥 Skin Api) */
#spells-hud.spell-skin-fire .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #fed7aa 0%, #f97316 35%, #c2410c 70%, #431407 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(254, 215, 170, 0.9), 0 0 16px rgba(249, 115, 22, 0.7) !important;
    border-color: #fdba74 !important;
}
#spells-hud.spell-skin-fire .orb-wood-base {
    background: linear-gradient(180deg, #7c2d12 0%, #431407 100%) !important;
    border-color: #ea580c !important;
}

/* ICE THEMED SPELLS (❄️ Skin Es) */
#spells-hud.spell-skin-ice .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #e0f2fe 0%, #38bdf8 35%, #0284c7 70%, #082f49 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(255, 255, 255, 0.9), 0 0 16px rgba(56, 189, 248, 0.75) !important;
    border-color: #bae6fd !important;
}
#spells-hud.spell-skin-ice .orb-wood-base {
    background: linear-gradient(180deg, #0c4a6e 0%, #082f49 100%) !important;
    border-color: #38bdf8 !important;
}

/* BOMB THEMED SPELLS (💣 Skin Bom) */
#spells-hud.spell-skin-bomb .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #fde68a 0%, #d97706 35%, #78350f 70%, #1c1917 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(253, 230, 138, 0.9), 0 0 16px rgba(245, 158, 11, 0.7) !important;
    border-color: #fbbf24 !important;
}

/* VAMPIRE THEMED SPELLS (🧛 Skin Vampire) */
#spells-hud.spell-skin-vampire .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #fecdd3 0%, #e11d48 35%, #881337 70%, #1c050c 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(254, 205, 211, 0.9), 0 0 16px rgba(225, 29, 72, 0.75) !important;
    border-color: #fb7185 !important;
}

/* SAVAGE THEMED SPELLS (🦴 Skin Savage) */
#spells-hud.spell-skin-savage .orb-sphere {
    background: radial-gradient(circle at 35% 35%, #a7f3d0 0%, #10b981 35%, #065f46 70%, #1c1917 100%) !important;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(254, 240, 138, 0.9), 0 0 16px rgba(16, 185, 129, 0.75) !important;
    border-color: #fef08a !important;
}
#spells-hud.spell-skin-savage .orb-wood-base {
    background: linear-gradient(180deg, #422006 0%, #1c1917 100%) !important;
    border-color: #d97706 !important;
}

/* HD Active Button Glow */
.hud-btn.hd-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(14, 165, 233, 0.15)) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ================= LEVEL SELECTOR MODAL (LEVEL 1 - 100) ================= */
.level-modal-card {
    max-width: 840px !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.level-scroll-wrap {
    overflow-y: auto;
    max-height: 52vh;
    padding: 12px;
    margin: 14px 0 18px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.level-scroll-wrap::-webkit-scrollbar {
    width: 6px;
}
.level-scroll-wrap::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.lvl-cell {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 8px 2px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.lvl-cell:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
    transform: translateY(-2px);
}

.lvl-cell.current {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
    color: #fff;
}

.lvl-cell.completed {
    border-color: rgba(34, 197, 94, 0.6);
    color: #86efac;
}

.lvl-cell.boss {
    background: linear-gradient(135deg, #7f1d1d, #450a0a);
    border: 1.5px solid #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.lvl-cell.boss-100 {
    background: linear-gradient(135deg, #b45309, #78350f, #991b1b);
    border: 2px solid #ffd700;
    color: #ffd700;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
    font-weight: 900;
    animation: bossPulse 1.2s infinite alternate;
}

@keyframes bossPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* Enemy Spell Warning Banner */
.enemy-spell-banner {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(153, 27, 27, 0.95));
    border: 2px solid #f87171;
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
    z-index: 50;
    animation: bannerDrop 0.3s ease-out;
}

@keyframes bannerDrop {
    0% { transform: translateX(-50%) translateY(-30px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Emergency Reinforcements Warning Banner (Patung HP < 1000) */
.emergency-warning-banner {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.98), rgba(127, 29, 29, 0.98), rgba(15, 23, 42, 0.98));
    border: 3px solid #f87171;
    border-radius: 20px;
    padding: 10px 28px;
    z-index: 60;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.9), inset 0 0 20px rgba(254, 202, 202, 0.3);
    animation: emergencyStrobe 0.8s infinite alternate, bannerDrop 0.35s ease-out;
    pointer-events: none;
    max-width: 90vw;
}

@keyframes emergencyStrobe {
    0% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(245, 158, 11, 0.5);
        border-color: #f87171;
    }
    100% {
        box-shadow: 0 0 45px rgba(239, 68, 68, 1), 0 0 65px rgba(245, 158, 11, 0.9);
        border-color: #fbbf24;
    }
}

.emergency-warning-banner.player-reinforcement {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.98), rgba(30, 58, 138, 0.98), rgba(15, 23, 42, 0.98));
    border: 3px solid #38bdf8;
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.9), inset 0 0 20px rgba(186, 230, 253, 0.4);
    animation: playerStrobe 0.8s infinite alternate, bannerDrop 0.35s ease-out;
}

@keyframes playerStrobe {
    0% {
        box-shadow: 0 0 20px rgba(56, 189, 248, 0.8), 0 0 40px rgba(234, 179, 8, 0.5);
        border-color: #38bdf8;
    }
    100% {
        box-shadow: 0 0 45px rgba(56, 189, 248, 1), 0 0 65px rgba(234, 179, 8, 0.9);
        border-color: #ffd700;
    }
}

.emergency-warning-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.emergency-warning-icon {
    font-size: 28px;
    animation: pulseIcon 0.5s infinite alternate ease-in-out;
}

@keyframes pulseIcon {
    from { transform: scale(1); }
    to { transform: scale(1.25); }
}

.emergency-warning-textbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.emergency-warning-title {
    font-size: 16px;
    font-weight: 900;
    color: #fef08a;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(239, 68, 68, 0.9);
    text-transform: uppercase;
}

.emergency-warning-detail {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* ================= GEMS & TIME BADGES ================= */
.gems-badge {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.35));
    border-color: #c084fc !important;
    color: #e9d5ff !important;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
}
.gems-badge:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(126, 34, 206, 0.5));
    transform: translateY(-1px);
}

.time-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.time-badge.day {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.time-badge.night {
    background: linear-gradient(135deg, #312e81, #1e1b4b);
    border-color: #818cf8;
    color: #c7d2fe;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.5);
    animation: nightGlow 2s infinite alternate;
}
@keyframes nightGlow {
    from { box-shadow: 0 0 8px rgba(129, 140, 248, 0.4); }
    to { box-shadow: 0 0 16px rgba(129, 140, 248, 0.8); }
}

.diff-badge.insane {
    background: linear-gradient(135deg, #991b1b, #581c87);
    border-color: #f43f5e;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.7);
    animation: insanePulse 1s infinite alternate;
}
@keyframes insanePulse {
    from { transform: scale(1); filter: brightness(1); }
    to { transform: scale(1.05); filter: brightness(1.25); }
}

.diff-btn.insane {
    border-color: #f43f5e !important;
}
.diff-btn.insane.active {
    background: linear-gradient(135deg, #881337, #4c0519) !important;
    border-color: #fb7185 !important;
    box-shadow: 0 0 15px rgba(251, 113, 133, 0.6) !important;
}

/* ================= WIZARD ARMORY & SHOP MODAL ================= */
.shop-modal-card {
    max-width: 860px !important;
    width: 95% !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 24px 28px !important;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.shop-wizard-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-wizard-avatar {
    font-size: 38px;
    background: rgba(249, 115, 22, 0.2);
    border: 2px solid #f97316;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    overflow-x: auto;
}

.shop-tab-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.shop-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.shop-tab-btn.active {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    border-color: #d8b4fe;
    color: #fff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.shop-content-area {
    overflow-y: auto;
    max-height: 52vh;
    padding: 6px 4px;
}

/* Shop Spell Cards Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.shop-item-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.shop-item-card:hover {
    border-color: #ffd700;
    background: rgba(30, 41, 59, 0.85);
    transform: translateY(-2px);
}

.shop-item-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-item-icon {
    font-size: 26px;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.shop-item-title {
    font-weight: 800;
    font-size: 14px;
    color: #f8fafc;
}

.shop-item-desc {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.4;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.shop-item-stock {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 700;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #9333ea, #6b21a8);
    border: 1px solid #c084fc;
    color: #fff;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-buy-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

/* Skins Grid */
.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.skin-card {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: all 0.2s;
}

.skin-card.fire-theme {
    border-color: #f97316;
    background: linear-gradient(145deg, rgba(43, 17, 4, 0.8), rgba(15, 23, 42, 0.9));
}

.skin-card.ice-theme {
    border-color: #38bdf8;
    background: linear-gradient(145deg, rgba(8, 47, 73, 0.8), rgba(15, 23, 42, 0.9));
}

.skin-card.bomb-theme {
    border-color: #f59e0b;
    background: linear-gradient(145deg, rgba(69, 26, 3, 0.8), rgba(15, 23, 42, 0.9));
}

.skin-card.vampire-theme {
    border-color: #e11d48;
    background: linear-gradient(145deg, rgba(76, 5, 25, 0.85), rgba(15, 23, 42, 0.9));
}

.skin-card.equipped {
    border-color: #ffd700 !important;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.4) !important;
}

.skin-preview-box {
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Upgrades Tree */
.upgrade-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 10px;
}

.upgrade-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.upgrade-card.maxed {
    border-color: #ffd700;
    background: rgba(30, 41, 59, 0.9);
}

.upgrade-info {
    flex: 1;
}

.upgrade-stars {
    display: flex;
    gap: 4px;
    font-size: 14px;
    margin: 3px 0;
}

.upgrade-btn {
    background: linear-gradient(135deg, #ffd700, #b45309);
    border: none;
    color: #000;
    font-weight: 800;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.upgrade-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.upgrade-btn.disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Controlled Unit Star & 2X Damage Panel */
#controlled-unit-panel {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.92);
    border: 2px solid #ffd700;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.45), inset 0 0 15px rgba(255, 215, 0, 0.15);
    border-radius: 16px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 80;
    backdrop-filter: blur(8px);
    animation: pulseControlledPanel 2s infinite ease-in-out;
}

@keyframes pulseControlledPanel {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
    }
    50% {
        box-shadow: 0 0 32px rgba(255, 215, 0, 0.65);
    }
}

.ctrl-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctrl-badge {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #0a0d14;
    font-weight: 800;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.ctrl-name {
    color: #ffd700;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.8px;
}

.ctrl-hp {
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
}

.ctrl-hints {
    font-size: 12px;
    color: #cbd5e1;
}

.ctrl-btn {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid #ef4444;
    color: #fca5a5;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* ==========================================================================
   SKIN SAVAGE & SHOP SKINS STYLING
   ========================================================================== */
.skin-card.savage-theme {
    border-color: #10b981;
    background: linear-gradient(145deg, rgba(20, 45, 30, 0.9), rgba(45, 26, 12, 0.85), rgba(15, 23, 42, 0.95));
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.skin-card.savage-theme:hover {
    box-shadow: 0 6px 26px rgba(16, 185, 129, 0.4);
}

.skin-card.leaf-theme {
    border-color: #4ade80;
    background: linear-gradient(145deg, rgba(20, 60, 30, 0.9), rgba(6, 40, 20, 0.85), rgba(15, 23, 42, 0.95));
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.25);
}

.skin-card.leaf-theme:hover {
    box-shadow: 0 6px 26px rgba(74, 222, 128, 0.45);
}

.skin-card.voltaic-theme {
    border-color: #38bdf8;
    background: linear-gradient(145deg, rgba(8, 47, 73, 0.9), rgba(15, 23, 42, 0.95), rgba(2, 132, 199, 0.25));
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.skin-card.voltaic-theme:hover {
    box-shadow: 0 6px 26px rgba(56, 189, 248, 0.55);
}

.skin-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.skin-avatar.savage {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, rgba(45, 26, 12, 0.85) 100%);
    border-color: #10b981;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
}

.skin-avatar.leaf {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.4) 0%, rgba(5, 46, 22, 0.85) 100%);
    border-color: #4ade80;
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.5);
}

.skin-avatar.voltaic {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
}

.skin-avatar.fire {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.35) 0%, rgba(67, 20, 7, 0.85) 100%);
    border-color: #f97316;
}

.skin-avatar.ice {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(8, 47, 73, 0.85) 100%);
    border-color: #38bdf8;
}

.skin-avatar.bomb {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(69, 26, 3, 0.85) 100%);
    border-color: #f59e0b;
}

.skin-avatar.vampire {
    background: radial-gradient(circle, rgba(225, 29, 72, 0.35) 0%, rgba(76, 5, 25, 0.85) 100%);
    border-color: #e11d48;
}

/* ==========================================================================
   ORIENTATION OVERLAY (Mobile & Tablet Portrait Suggestion)
   ========================================================================== */
.orientation-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(5, 10, 20, 0.94);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInOverlay 0.3s ease;
}

.orientation-overlay.hidden {
    display: none !important;
}

.orientation-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.25);
}

.orient-icon {
    font-size: 44px;
    margin-bottom: 14px;
    animation: rotatePhone 2.2s infinite ease-in-out;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.orientation-card h2 {
    color: #ffd700;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.orientation-card p {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.orient-btn {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #0b0f19;
    font-weight: 800;
    font-size: 13px;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s;
}

.orient-btn:active {
    transform: scale(0.96);
}

/* ==========================================================================
   MOBILE VIRTUAL GAMEPAD (Controlled Unit on Touchscreens)
   ========================================================================== */
.mobile-ctrl-dpad {
    position: fixed;
    bottom: 96px;
    left: 0;
    right: 0;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 18px;
    z-index: 1000;
}

.mobile-ctrl-dpad.hidden {
    display: none !important;
}

.dpad-left-cluster,
.dpad-action-cluster {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.touch-btn {
    min-width: 60px;
    height: 54px;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    transition: transform 0.08s, background-color 0.08s;
}

.touch-btn:active {
    transform: scale(0.92);
    background: rgba(255, 215, 0, 0.35);
    border-color: #ffd700;
}

.touch-btn.attack {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.9));
    border-color: #fca5a5;
    min-width: 82px;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.touch-btn.block {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(29, 78, 216, 0.9));
    border-color: #93c5fd;
    min-width: 80px;
}

.touch-btn.exit {
    background: rgba(100, 116, 139, 0.8);
    border-color: #cbd5e1;
    min-width: 64px;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS FOR LOW-END DEVICES
   ========================================================================== */
* {
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
}

canvas#gameCanvas {
    will-change: transform;
    transform: translateZ(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN: TABLETS & MOBILE PHONES
   ========================================================================== */

/* Tablets & Small Laptops (<= 1024px) */
@media screen and (max-width: 1024px) {
    #top-hud {
        padding: 6px 12px;
        font-size: 13px;
    }

    .statue-status {
        min-width: 130px;
    }

    .statue-avatar {
        font-size: 20px;
    }

    .hud-actions {
        gap: 4px;
    }

    .hud-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .unit-card {
        min-width: 62px;
        padding: 4px;
    }

    .unit-avatar {
        font-size: 20px;
    }

    .spell-orb-card {
        width: 48px;
        height: 60px;
    }

    .orb-sphere {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    #controlled-unit-panel {
        bottom: 86px;
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* Mobile Screens (<= 768px) */
@media screen and (max-width: 768px) {
    #top-hud {
        flex-wrap: wrap;
        padding: 4px 8px;
        gap: 4px;
        justify-content: space-between;
    }

    #player-statue-box,
    #enemy-statue-box {
        min-width: 110px;
        padding: 4px 6px;
    }

    #center-hud {
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .hud-actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hud-btn {
        white-space: nowrap;
        padding: 4px 7px;
        font-size: 10px;
    }

    /* Stances & Unit Cards Dock */
    #bottom-deck {
        padding: 4px;
        gap: 6px;
    }

    .stance-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .unit-card {
        min-width: 52px;
        padding: 2px 4px;
    }

    .unit-name {
        font-size: 9px;
    }

    .unit-cost {
        font-size: 9px;
    }

    /* Spells Tray */
    #spells-hud {
        left: 6px;
        gap: 4px;
    }

    .spell-orb-card {
        width: 40px;
        height: 52px;
    }

    .orb-sphere {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .orb-key-badge {
        display: none; /* Hide keyboard keys on mobile */
    }

    .orb-stock-badge {
        font-size: 9px;
        padding: 1px 4px;
    }

    /* Modals on Mobile */
    .modal-content,
    .shop-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        padding: 14px;
    }

    .skins-grid,
    .upgrade-list,
    .shop-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile virtual controls */
    .mobile-ctrl-dpad {
        bottom: 78px;
        padding: 0 10px;
    }

    .touch-btn {
        min-width: 50px;
        height: 46px;
        font-size: 11px;
    }

    .touch-btn.attack {
        min-width: 66px;
    }

    .touch-btn.block {
        min-width: 66px;
    }

    .touch-btn.exit {
        min-width: 54px;
    }
}

/* Mobile Landscape (< 520px height) */
@media screen and (max-height: 520px) and (orientation: landscape) {
    #top-hud {
        padding: 2px 8px;
        height: auto;
    }

    .statue-status {
        padding: 2px 6px;
        min-width: 100px;
    }

    .statue-avatar {
        font-size: 16px;
    }

    .health-track {
        height: 6px;
    }

    .hud-btn {
        padding: 2px 6px;
        font-size: 10px;
    }

    #bottom-deck {
        padding: 2px;
    }

    .unit-card {
        min-width: 46px;
        padding: 2px;
    }

    .unit-avatar {
        font-size: 16px;
    }

    .spell-orb-card {
        width: 36px;
        height: 44px;
    }

    .orb-sphere {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .orb-wood-base {
        height: 6px;
    }

    #controlled-unit-panel {
        bottom: 58px;
        padding: 4px 10px;
    }

    .ctrl-hints {
        display: none; /* Hide long desktop keyboard hints on mobile landscape */
    }

    .mobile-ctrl-dpad {
        bottom: 58px;
    }

    .touch-btn {
        height: 40px;
        font-size: 10px;
    }
}

/* ========================================================
   MIX SKIN & ENEMY SKIN SELECTOR STYLES
   ======================================================== */
.mix-skin-shop-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.45), rgba(15, 23, 42, 0.85));
    border: 2px solid #a855f7;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.25);
}

.mix-skin-shop-banner.mix-active-bar {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(88, 28, 135, 0.45));
    border-color: #34d399;
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.2);
}

.enemy-skin-shop-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(244, 63, 94, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.skin-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.skin-card-actions .shop-buy-btn {
    flex: 1;
    min-width: 110px;
    text-align: center;
    padding: 6px 10px;
    font-size: 11px;
}

.shop-buy-btn.mix-add {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    border-color: #c084fc;
}

.shop-buy-btn.mix-remove {
    background: linear-gradient(135deg, #be123c, #e11d48);
    border-color: #fda4af;
}

.shop-buy-btn.set-enemy {
    background: linear-gradient(135deg, #334155, #475569);
    border-color: #94a3b8;
    color: #f1f5f9;
}

.shop-buy-btn.set-enemy:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
    border-color: #fb7185;
}

.shop-buy-btn.enemy-active {
    background: linear-gradient(135deg, #991b1b, #dc2626);
    border-color: #f87171;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.skin-enemy-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    border: 1px solid rgba(254, 202, 202, 0.4);
}

/* Enemy Skin Selector on Start Screen */
.enemy-skin-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.enemy-skin-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 10px;
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.enemy-skin-btn:hover {
    border-color: #f43f5e;
    color: #fff;
    transform: translateY(-1px);
    background: rgba(30, 41, 59, 0.9);
}

.enemy-skin-btn.active {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.3), rgba(15, 23, 42, 0.9));
    border-color: #f43f5e;
    color: #ffe4e6;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
    font-weight: 800;
}



