/* ===== FONTS & ROOT ===== */
@font-face {
    font-family: 'Exo 2';
    src: url('../font/Exo2-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --sidebar-bg: #111827;
    --slot-bg: #1f2937;
    --slot-border: #374151;
    --red: #ef4444;
    --red-dark: #7f1d1d;
    --blue: #38bdf8;
    --purple: #a855f7;
    --green: #22c55e;

    /* ===== НАСТРОЙКА UI РАМОК (9-SLICE КОНФИГУРАТОР) ===== */
    --frame-slice: 20;
    /* Базовый размер нарезки текстур */

    /* --- Мелкие элементы и кнопки (settings-btn, мелкие рамки) --- */
    --frame-xs-border: 20px;
    /* Физический размер рамки (для разметки) */
    --frame-xs-image: 20px;
    /* Визуальный размер рамки (масштаб пикселей) */
    --frame-xs-repeat: round;
    /* Режим повторения (repeat / round / stretch) */
    --frame-xs-padding: 4px;
    /* Внутренний отступ */

    /* --- Кнопки вкладок и переключатели --- */
    --frame-tab-border: 20px;
    /* Физический размер рамки */
    --frame-tab-image: 20px;
    /* Визуальный размер рамки */
    --frame-tab-repeat: round;
    /* Режим повторения */
    --frame-tab-padding: 6px;
    /* Внутренний отступ */

    /* --- Слоты товаров в магазине (картинка Item_Slot.png) --- */
    --frame-slot-border: 20px;
    /* Физический размер рамки */
    --frame-slot-image: 20px;
    /* Визуальный размер рамки */
    --frame-slot-repeat: round;
    /* Режим повторения */
    --frame-slot-padding: 0 4px;
    /* Внутренний отступ */

    /* --- Средние блоки (Карточки зданий, настройки, детали технологий) (frame_card.png) --- */
    --frame-md-border: 14px;
    /* Физический размер рамки */
    --frame-md-image: 48px;
    /* Визуальный размер рамки (масштаб пикселей) */
    --frame-md-repeat: repeat;
    /* repeat убирает размытие браузера */
    --frame-md-padding: 18px;
    /* Внутренний отступ контента */

    /* --- Крупные панели (Штаб, Схема базы, Инфраструктура) (frame_card.png) --- */
    --frame-lg-border: 16px;
    /* Физический размер рамки */
    --frame-lg-image: 52px;
    /* Визуальный размер рамки (масштаб пикселей) */
    --frame-lg-repeat: repeat;
    /* repeat убирает размытие браузера */
    --frame-lg-padding: 20px;
    /* Внутренний отступ контента */

    /* --- Главные экраны и оверлеи (frame_main.png) --- */
    --frame-overlay-border: 20px;
    /* Физический размер рамки */
    --frame-overlay-image: 40px;
    /* Визуальный размер рамки */
    --frame-overlay-repeat: round;
    /* Режим повторения */
    --frame-overlay-padding: 12px;
    /* Внутренний отступ контента */

    /* --- HUD плашки ресурсов (Золото, ДНК, Волны, Убийства) (Resource_Bar.png) --- */
    --hud-bar-width: 180px;
    /* Ширина плашки */
    --hud-bar-height: 45px;
    /* Высота плашки */
    --hud-bar-font-size: 1.4rem;
    /* Размер текста */
    --hud-icon-size: 34px;
    /* Размер иконки ресурса */
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #000;
    font-family: 'Exo 2', sans-serif;
    user-select: none;
    image-rendering: pixelated;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 360px;
    min-width: 360px;
    background: url('../pic/ui/ui_block/Sidebar_BG.png') repeat-y center top;
    background-size: 100% auto;
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* ===== TAB BAR ===== */
.tab-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    align-items: center;
    background: transparent;
    height: 120px;
    padding: 0;
    gap: 0;
}

.tab-btn {
    padding: 0;
    background: url('../pic/ui/ui_block/Button_Idle.png') no-repeat center;
    background-size: contain;
    border: none;
    image-rendering: pixelated;
    color: #94a3b8;
    cursor: pointer;
    font-family: 'Exo 2', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s, transform 0.15s;
    margin: 0;
    width: 104px;
    height: 104px;
    box-sizing: border-box;
    filter: brightness(0.55) saturate(0.4);
}

.tab-icon {
    height: 64px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s;
}

.tab-btn span {
    display: none;
}

/* Remove text labels */

.tab-btn:hover:not(.active) {
    background-image: url('../pic/ui/ui_block/Button_Hover.png');
    filter: brightness(0.85) saturate(0.8);
    transform: none;
}

.tab-btn.active {
    background-image: url('../pic/ui/ui_block/Button_Active.png');
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(56, 189, 248, 0.4));
    color: #fff;
    transform: none;
}

.tab-btn.locked {
    background-image: url('../pic/ui/ui_block/Button_Locked.png');
    cursor: not-allowed;
    filter: grayscale(1) brightness(0.4);
    opacity: 0.5;
}


.sidebar-header-mini {
    background: transparent;
    padding: 15px 16px;
    border-bottom: none;
}

.header-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.4rem;
    color: var(--red);
    margin: 0;
    text-shadow: 2px 2px 0 var(--red-dark);
}

.lang-selector {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: #374151;
    color: #fff;
    border-color: #6b7280;
}

.header-sub {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 700;
    margin-top: 3px;
}

.sidebar-content,
#tabContent {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-content::-webkit-scrollbar {
    width: 5px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #111827;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

/* ===== SECTION LABEL ===== */
.section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    font-weight: 800;
    padding: 10px 0 14px;
    background: url('../pic/ui/ui_block/Header_Separator.png') no-repeat bottom center;
    background-size: 100% 4px;
    border: none;
    margin-bottom: 5px;
}

/* ===== SHOP SLOTS ===== */
.shop-slot {
    background: transparent;
    border: var(--frame-slot-border) solid transparent;
    border-image: url('../pic/ui/ui_block/Item_Slot.png') var(--frame-slice) fill;
    border-image-width: var(--frame-slot-image);
    border-image-repeat: var(--frame-slot-repeat);
    padding: var(--frame-slot-padding);
    display: flex;
    align-items: center;
    gap: 14px;
    color: #f9fafb;
    transition: transform 0.1s;
    box-sizing: border-box;
}

.shop-slot:hover {
    filter: brightness(1.15);
}

.slot-locked {
    filter: grayscale(1);
    opacity: 0.7;
}

.slot-icon {
    width: 60px;
    height: 60px;
    background: url('../pic/ui/ui_block/Icon_Frame.png') no-repeat center;
    background-size: 100% 100%;
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.9rem;
    flex-shrink: 0;
}

.slot-info {
    flex: 1;
    min-width: 0;
}

.slot-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    color: #cbd5e1;
}

.lv-tag {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.5);
    color: #9ca3af;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    border: 1px solid #374151;
}

.slot-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.2;
    margin-top: 3px;
}

.base-status-panel {
    background: #030712;
    border: 2px solid #374151;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 5px;
}

.status-item {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
}

.stat-box {
    background-color: #142418;
    border: 24px solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') 20;
    border-image-width: 24px;
    border-image-repeat: stretch;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    padding: 0 8px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
    height: 80px;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    box-sizing: border-box;
}

.hud-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.status-item span {
    color: #60a5fa;
    font-family: 'Exo 2', sans-serif;
}

.price-icon {
    width: 26px;
    height: 26px;
    vertical-align: middle;
    margin-right: 2px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.5));
}

.ui-icon-pixel {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    image-rendering: pixelated;
}

.price-icon.dna {
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.5));
}

/* ===== ADMIN BUTTONS ===== */
.admin-btn {
    background: #1e293b;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    color: #e2e8f0;
    padding: 6px 12px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s, background-color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    box-sizing: border-box;
}

.admin-btn:hover {
    background: #2563eb;
    border-color: #60a5fa;
    color: #fff;
    transform: translateY(-2px) scale(1.05);
}

.admin-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.admin-btn.skip {
    background: linear-gradient(135deg, #312e81, #1e1b4b);
    border-color: #4338ca;
    color: #c7d2fe;
}

.admin-btn.skip:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
}

/* ===== BUTTONS ===== */
.btn-buy {
    background: url('../pic/ui/ui_block/Buy_Btn_Normal.png') no-repeat center;
    background-size: contain;
    border: none;
    color: #fff;
    padding: 0 16px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.05s;
    width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-buy:hover:not(:disabled) {
    transform: scale(1.05);
}

.btn-buy:active:not(:disabled) {
    background-image: url('../pic/ui/ui_block/Buy_Btn_Pressed.png');
    transform: scale(0.98);
}

.btn-buy:disabled {
    filter: grayscale(1);
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== SUPPORT PATREON BUTTON ===== */
.btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    background: linear-gradient(135deg, #f96854 0%, #e0533c 100%);
    box-shadow: 0 4px 0 #b33925;
    border: none;
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b33925, 0 0 15px rgba(249, 104, 84, 0.4);
    filter: brightness(1.1);
}

.btn-support:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b33925;
    filter: brightness(0.95);
}

.btn-support:hover .ui-icon-pixel-wrapper,
.btn-support:hover .ui-icon-pixel {
    animation: heartBeat 1.2s infinite ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.25); }
    28% { transform: scale(1); }
    42% { transform: scale(1.25); }
    70% { transform: scale(1); }
}

.lab-btn {
    background: #7c3aed;
    box-shadow: 0 3px 0 #4c1d95;
}

.lab-btn:hover:not(:disabled) {
    background: #a855f7;
    box-shadow: 0 1px 0 #4c1d95;
}

.lab-btn:disabled {
    background: #4b5563;
}

.turret-buy-btn {
    background: url('../pic/ui/ui_block/btn_buy_turret.png') no-repeat center;
    background-size: contain;
    border: none;
    color: #fff;
    padding: 0 14px;
    width: 321px;
    height: 51px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 1.4rem;
    gap: 8px;
    transition: transform 0.1s, filter 0.1s;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto 5px;
    align-content: center;
    font-family: 'Exo 2', sans-serif;
}

.turret-buy-btn * {
    pointer-events: none;
}

.turret-buy-btn:hover:not(:disabled) {
    filter: brightness(1.2);
    transform: scale(1.03);
}

.turret-buy-btn:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
}

.turret-hint {
    font-size: 0.65rem;
    color: #60a5fa;
    text-align: center;
    font-weight: 700;
    margin-top: 3px;
}

.active-select {
    border-color: #38bdf8 !important;
    background: #0f172a !important;
}

.wave-call-btn {
    background: url('../pic/ui/ui_block/Wave_Btn_Idle.png') no-repeat center;
    background-size: contain;
    border: none;
    color: #fff;
    padding: 0 15px;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    width: 296px;
    height: 90px;
    box-sizing: border-box;
    transition: transform 0.1s, filter 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    justify-content: center;
}

.wave-call-btn * {
    pointer-events: none;
}

.wave-call-btn:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.wave-call-btn:active:not(:disabled) {
    background-image: url('../pic/ui/ui_block/Wave_Btn_Push.png');
}

.wave-call-btn:disabled {
    background-image: url('../pic/ui/ui_block/Wave_Btn_Locked.png');
    color: #64748b;
    cursor: not-allowed;
}

.wave-call-btn-sub {
    font-size: 0.75rem;
    color: #fbbf24;
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    margin-top: 2px;
}

.wave-call-btn:disabled .wave-call-btn-sub {
    color: #475569;
}

/* Base pause view buttons */
.base-pause-notice {
    background: #0f172a;
    border: 2px solid #1e3a5f;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    color: #60a5fa;
}

.return-btn {
    background: linear-gradient(135deg, #374151, #1f2937);
    color: #f3f4f6;
    border: 2px solid #4b5563;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Fredoka One', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
    box-shadow: 0 4px 0 #0f172a;
    margin-top: 10px;
}

.return-btn:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0f172a;
}

.base-nav-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid #1e293b;
}


/* ===== RIGHT COLUMN LAYOUT ===== */
.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: #000;
}

.top-bar {
    height: 66px;
    background:
        url('../pic/ui/ui_block/Header_Separator.png') repeat-x top center,
        url('../pic/ui/ui_block/Header_Separator.png') repeat-x bottom center,
        url('../pic/ui/ui_block/Top_Bar_BG.png') repeat-x center;
    background-size: 100% 4px, 100% 4px, auto 100%;
    border-bottom: none;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    z-index: 10;
    flex-shrink: 0;
}

/* ===== MAIN AREA ===== */
.main-area {
    flex: 1;
    position: relative;
    background: #000;
    cursor: crosshair;
    overflow: hidden;
}

.main-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    /* Top and Left vignettes as requested by red markings */
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, transparent 60px),
        linear-gradient(to right, rgba(0, 0, 0, 0.55) 0%, transparent 80px);
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#bgCanvas {
    z-index: 1;
    pointer-events: none;
}

#bloodCanvas {
    z-index: 2;
    pointer-events: none;
}

#gameCanvas {
    z-index: 3;
}

/* ===== HUD (Consolidated) ===== */
.ui-coin-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.3));
}

.gold-c {
    color: #fde047;
    text-shadow: 2px 2px 0 #854d0e;
}

.dna-c {
    color: #a855f7;
    text-shadow: 2px 2px 0 #581c87;
}

.wave-c {
    color: #ef4444;
    text-shadow: 2px 2px 0 #7f1d1d;
}

.kill-c {
    color: #94a3b8;
}

.wall-c {
    color: #10b981;
    text-shadow: 2px 2px 0 #064e3b;
}

.wave-progress-bar {
    width: 250px;
    z-index: 10;
    pointer-events: none;
}

.wave-progress-bg {
    width: 100%;
    height: 20px;
    background: url('../pic/ui/ui_block/Wave_Progress_BG.png') no-repeat center;
    background-size: 100% 100%;
    border: none;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.wave-progress-fill {
    height: 100%;
    width: 0%;
    background: url('../pic/ui/ui_block/Wave_Progress_Fill.png') no-repeat left center;
    background-size: 250px 100%;
    border-radius: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wave-progress-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* ===== PAUSE INDICATOR ===== */
.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    font-family: 'Exo 2', sans-serif;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 4;
    text-align: center;
}

/* ===== BASE OVERLAY ===== */
.base-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: var(--frame-overlay-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_main.png') var(--frame-slice) fill;
    border-image-width: var(--frame-overlay-image);
    border-image-repeat: var(--frame-overlay-repeat);
    image-rendering: pixelated;
    padding: 8px;
}

#baseOverlay {
    overflow: hidden;
}

.base-overlay.visible {
    transform: translateX(0);
}

.base-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(56, 189, 248, 0.03) 38px, rgba(56, 189, 248, 0.03) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 38px, rgba(56, 189, 248, 0.03) 38px, rgba(56, 189, 248, 0.03) 40px);
    pointer-events: none;
}

.base-overlay-header {
    position: relative;
    background: url('../pic/ui/ui_block/Header_Panel.png') no-repeat center;
    background-size: 100% 100%;
    height: 90px;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.base-overlay-close {
    position: absolute;
    top: 25px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: url('../pic/ui/ui_block/Exit_Btn.png') no-repeat center;
    background-size: 100% 100%;
    border: none;
    color: transparent;
    cursor: pointer;
    transition: transform 0.15s;
}

.base-overlay-close:hover {
    transform: rotate(90deg) scale(1.1);
}

.base-overlay-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    margin: 0;
}

/* ===== BUILDING GRID ===== */
.base-buildings-grid {
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    height: 100%;
    box-sizing: border-box;
}

.overlay-status-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.status-chip {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #f1f5f9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.status-chip span {
    color: #38bdf8;
    filter: drop-shadow(0 0 5px #38bdf8);
}

.cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}


.building-card {
    border: var(--frame-md) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') 20 fill;
    border-image-width: 20px;
    border-image-repeat: round;
    image-rendering: pixelated;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s;
    position: relative;
    box-sizing: border-box;
}

.building-card:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.building-max {
    filter: hue-rotate(90deg) brightness(1.2);
}

.bld-icon {
    font-size: 3rem;
    line-height: 1;
}

.bld-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 800;
}

.bld-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    min-height: 2em;
    font-weight: 700;
}

.bld-btn {
    background: url('../pic/ui/ui_block/bld_btn_normal.png') no-repeat center;
    background-size: contain;
    border: none;
    color: #fff;
    padding: 0 12px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.1s, transform 0.1s;
    width: 180px;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px auto 0;
}

.bld-btn:hover:not(:disabled) {
    filter: brightness(1.2);
    transform: scale(1.03);
}

.bld-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.bld-btn:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
}

.building-max .bld-btn:disabled {
    filter: grayscale(1);
    opacity: 0.5;
}

/* ===== ORBITAL (SCI-FI HUD DESIGN) ===== */
.nuke-wrap {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.nuke-btn {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 16px !important;
    padding: 8px 22px !important;
    font-family: 'Exo 2', sans-serif !important;
    font-size: 1.15rem !important;
    color: #f3f4f6 !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    letter-spacing: 0.5px !important;
}

.nuke-btn:hover {
    transform: scale(1.03) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.nuke-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: repeating-linear-gradient(
        -45deg,
        rgba(239, 68, 68, 0.25),
        rgba(239, 68, 68, 0.25) 10px,
        rgba(239, 68, 68, 0.1) 10px,
        rgba(239, 68, 68, 0.1) 20px
    ) !important;
    pointer-events: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nuke-ready {
    background: rgba(127, 29, 29, 0.85) !important;
    border-color: #ef4444 !important;
    color: #fee2e2 !important;
    animation: npulse 1.5s infinite alternate !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.6), inset 0 0 12px rgba(239, 68, 68, 0.4) !important;
}

.nuke-ready:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.8), inset 0 0 15px rgba(239, 68, 68, 0.5) !important;
}

.nuke-ready .nuke-icon {
    animation: satellite-spin 4s infinite linear !important;
}

@keyframes npulse {
    0% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.4), inset 0 0 8px rgba(239, 68, 68, 0.2) !important;
        text-shadow: 0 0 5px rgba(254, 226, 226, 0.5) !important;
    }
    100% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.8), inset 0 0 16px rgba(239, 68, 68, 0.5) !important;
        text-shadow: 0 0 12px rgba(254, 226, 226, 0.9) !important;
    }
}

@keyframes satellite-spin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.08); }
}

.orb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* ===== TOOLTIP ===== */
.tooltip-hint {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.88);
    color: #fbbf24;
    padding: 7px 18px;
    border-radius: 18px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    z-index: 10;
    pointer-events: none;
    border: 2px solid #b45309;
    transition: opacity 0.5s;
    white-space: nowrap;
}

/* ===== TURRET POPUP ===== */
.upgrade-popup {
    position: fixed;
    z-index: 30;
    display: none;
    font-family: 'Exo 2', sans-serif;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
    min-width: 220px;
    box-sizing: border-box;

    /* 9-SLICE PREMIUM CARD UI */
    border: var(--frame-md-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-md-image);
    border-image-repeat: var(--frame-md-repeat);
    image-rendering: pixelated;
    padding: var(--frame-md-padding);
}

.upgrade-popup h3 {
    margin: 0 0 12px;
    color: #4ade80; /* Зеленый киберпанк вместо синего */
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
    font-family: 'Exo 2', sans-serif;
    letter-spacing: 0.5px;
}

.upgrade-popup button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    
    /* Зеленый стиль по умолчанию для улучшения */
    background: linear-gradient(135deg, #0f2d1a, #07190e);
    border: 2px solid #14532d;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.upgrade-popup button:hover:not(:disabled) {
    border-color: #4ade80; /* Ярко-зеленая рамка */
    background: linear-gradient(135deg, #14532d, #0f2d1a);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 222, 128, 0.25);
}

.upgrade-popup button:active:not(:disabled) {
    transform: translateY(1px);
}

.upgrade-popup button:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Оранжево-золотой стиль для кнопки продажи */
.upgrade-popup .sell-btn {
    background: linear-gradient(135deg, #3b2308, #1f1203);
    border-color: #78350f;
}

.upgrade-popup .sell-btn:hover:not(:disabled) {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #78350f, #3b2308);
    box-shadow: 0 6px 15px rgba(251, 191, 36, 0.25);
}

/* Красный стиль для кнопки отмены */
.upgrade-popup .close-popup {
    background: linear-gradient(135deg, #2e1010, #1a0808);
    border-color: #7f1d1d;
    margin-top: 12px;
}

.upgrade-popup .close-popup:hover:not(:disabled) {
    border-color: #f87171;
    background: linear-gradient(135deg, #7f1d1d, #2e1010);
    box-shadow: 0 6px 15px rgba(248, 113, 113, 0.25);
}

/* SCROLLBAR */
#tabContent::-webkit-scrollbar {
    width: 5px;
}

#tabContent::-webkit-scrollbar-track {
    background: #111827;
}

#tabContent::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.base-overlay::-webkit-scrollbar {
    width: 6px;
}

.base-overlay::-webkit-scrollbar-track {
    background: #0f172a;
}

.base-overlay::-webkit-scrollbar-thumb {
    background: 1e3a5f;
    border-radius: 3px;
}

/* ===== GAME OVER OVERLAY ===== */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 500;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    color: #fff;
    text-align: center;
}

.game-over-overlay.active {
    display: flex;
    animation: treeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.go-title {
    font-family: 'Fredoka One';
    font-size: 5rem;
    color: #ef4444;
    text-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
    margin: 0;
}

.go-stats {
    display: flex;
    gap: 40px;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px 45px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.go-stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.go-stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
}

.go-stat-val {
    font-family: 'Fredoka One';
    font-size: 2rem;
    color: #fde047;
}

.btn-restart {
    background: #ef4444;
    color: #fff;
    padding: 18px 45px;
    border-radius: 12px;
    font-family: 'Fredoka One';
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 6px 0 #991b1b;
    transition: 0.1s;
}

.btn-restart:hover {
    background: #f87171;
    transform: translateY(2px);
    box-shadow: 0 4px 0 #991b1b;
}

.btn-restart:active {
    transform: translateY(6px);
    box-shadow: none;
}


/* ===== ADMIN PANEL ===== */
/* ===== TECH TREE ===== */
.tree-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0e17;
    z-index: 100;
    display: none;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
    user-select: none;
}

.tree-overlay.active {
    display: flex;
    animation: treeIn 0.35s ease-out;
}

@keyframes treeIn {
    from {
        opacity: 0;
        transform: scale(1.1)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.tree-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 85px;
    padding: 0 40px;
    background: rgba(15, 23, 42, 0.98);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.tree-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 2rem;
    color: #38bdf8;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.tree-currency {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.6rem;
    color: #fde047;
}

.tree-close {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Exo 2', sans-serif;
    cursor: pointer;
    font-size: 1.1rem;
}

.tree-container {
    position: absolute;
    top: 85px;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    background: #020617;
    z-index: 10;
}

.tree-sidebar-categories {
    position: absolute;
    top: 85px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 20;
}

.tree-cat-btn {
    background: transparent;
    border: none;
    padding: 15px 25px;
    color: #94a3b8;
    text-align: left;
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tree-cat-btn:hover {
    background: rgba(56, 189, 248, 0.05);
    color: #fff;
}

.tree-cat-btn.active {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border-left: 4px solid #38bdf8;
    padding-left: 21px;
}

.tree-cat-btn span {
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.tree-pan-layer {
    width: 4000px;
    height: 3000px;
    position: absolute;
    transform-origin: 0 0;
    transition: none;
    background: radial-gradient(circle, #1e293b 1px, transparent 1px);
    background-size: 50px 50px;
}

.tree-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.tech-node {
    position: absolute;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Box-shadow doesn't work well with clip-path, using filter */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.8));
}

.tech-node:hover {
    transform: scale(1.15);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.8));
    z-index: 10;
}

.tech-node-inner {
    position: absolute;
    width: 64px;
    height: 64px;
    background: #0f172a;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: -1;
}
.tech-node:hover .tech-node-inner {
    background: #1e3a5f;
}

.tech-node-info {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    text-align: center;
    z-index: 6;
    backdrop-filter: blur(4px);
    pointer-events: none;
    transition: all 0.3s ease;
    font-family: 'Exo 2', sans-serif;
}

.tech-node:hover .tech-node-info {
    border-color: #38bdf8;
    color: #e0f2fe;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.node-bought {
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}
.node-bought .tech-node-inner {
    background: #022c22;
}
.node-bought .tech-node-info {
    border-color: #10b981;
    color: #a7f3d0;
}

.node-available {
    animation: nodePulse 2s infinite;
}
.node-available .tech-node-inner {
    background: #423b0a;
}
.node-available .tech-node-info {
    border-color: #fde047;
    color: #fef08a;
}

@keyframes nodePulse {
    0% { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(253, 224, 71, 0.9)); }
    100% { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.4)); }
}

.svg-connection {
    fill: none;
    stroke-width: 4;
    transition: all 0.5s ease;
    pointer-events: stroke;
}

.svg-connection:hover {
    stroke-width: 6;
}

.svg-connection-locked {
    stroke: #64748b;
    filter: url(#lockedGlow);
}

.svg-connection-unlocked {
    stroke: #38bdf8;
    stroke-dasharray: 10, 5;
    animation: flowLine 1.5s linear infinite;
    filter: url(#neonGlow);
}

@keyframes flowLine {
    to { stroke-dashoffset: -15; }
}

.node-details {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 320px;
    border: var(--frame-md-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-md-image);
    border-image-repeat: var(--frame-md-repeat);
    image-rendering: pixelated;
    padding: var(--frame-md-padding);
    z-index: 110;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: none;
    box-sizing: border-box;
}

.details-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #38bdf8;
}

.details-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 15px;
}

.details-lv {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: -10px;
}

.parent-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.parent-tag {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: 0.2s;
}

.parent-tag:hover {
    background: #ef4444;
    border-color: #f87171;
    color: #fff;
}

.details-cost {
    font-size: 1.4rem;
    font-family: 'Exo 2', sans-serif;
    color: #fde047;
    text-align: center;
    margin-top: 10px;
}

.details-btn {
    background: url('../pic/ui/ui_block/bld_btn_normal.png') no-repeat center;
    background-size: contain;
    border: none;
    color: #fff;
    padding: 0 12px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.1s, transform 0.1s;
    width: 180px;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 0;
}

.details-btn:hover:not(:disabled) {
    filter: brightness(1.2);
    transform: scale(1.03);
}

.details-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.details-btn:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== TREE EDITOR ===== */
.tree-editor-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 15px;
    z-index: 120;
    display: none;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.tree-editor-panel label {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.tree-editor-panel input,
.tree-editor-panel textarea {
    width: 100%;
    box-sizing: border-box;
    background: #020617;
    border: 1px solid #334155;
    color: #fde047;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Exo 2', sans-serif;
}

.editor-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row {
    display: flex;
    gap: 8px;
}

.row>div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.editor-header {
    font-family: 'Exo 2', sans-serif;
    color: #38bdf8;
    font-size: 1rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
    margin-bottom: 5px;
}

/* ===== TREE TEMPLATES ===== */
.tree-templates {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 180px;
    height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 15px;
    z-index: 120;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.templates-header {
    font-family: 'Exo 2', sans-serif;
    color: #38bdf8;
    font-size: 1rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.templates-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-node-item {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: grab;
    transition: 0.1s;
    position: relative;
}

.template-node-item:hover {
    background: #334155;
    border-color: #38bdf8;
}

.template-node-item::after {
    content: attr(data-label);
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.5rem;
    color: #94a3b8;
}

.templates-hint {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 8px;
    text-align: center;
}

.tree-templates.collapsed,
.tree-editor-panel.collapsed {
    height: auto;
    min-height: 0;
}

.tree-templates.collapsed .panel-body-wrap,
.tree-editor-panel.collapsed .panel-body-wrap {
    display: none;
}

.panel-toggle-icon {
    font-size: 0.8rem;
    pointer-events: none;
}

/* GENOME STUDIO v2.1 LAYOUT */
.editor-overlay {
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
}

.editor-left-sidebar {
    width: 260px;
    background: #020617;
    border-right: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-sidebar {
    width: 320px;
}

.templates-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-item:hover {
    background: #1e293b;
    border-color: #38bdf8;
    transform: translateX(5px);
}

.template-item.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

#zThumbWrap {
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    background-image: linear-gradient(45deg, #0f172a 25%, #1e293b 25%, #1e293b 50%, #0f172a 50%, #0f172a 75%, #1e293b 75%, #1e293b 100%);
    background-size: 10px 10px;
}

/* CRITICAL EDITOR REANIMATION */
.editor-main {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: 1px solid #1e293b;
}

/* ===== SETTINGS STYLES ===== */
.settings-btn {
    background: url('../pic/ui/ui_block/Button_Idle.png') no-repeat center;
    background-size: contain;
    border: none;
    image-rendering: pixelated;
    color: #e2e8f0;
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    position: relative;
    padding: 0;
    line-height: 1;
    box-sizing: border-box;
}

.settings-btn:hover {
    background-image: url('../pic/ui/ui_block/Button_Hover.png');
    color: #fff;
    transform: scale(1.08);
}

.settings-btn:active {
    transform: scale(0.95);
}

.settings-content-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 30px 40px;
    z-index: 10;
    position: relative;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 650px;
}

.settings-section {
    border: var(--frame-md-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-md-image);
    border-image-repeat: var(--frame-md-repeat);
    image-rendering: pixelated;
    padding: var(--frame-md-padding);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.settings-section-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.15rem;
    color: #38bdf8;
    font-weight: 800;
    border-bottom: 2px solid rgba(56, 189, 248, 0.2);
    padding-bottom: 10px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-label {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    color: #cbd5e1;
    font-weight: 700;
}

.settings-select {
    width: 180px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    background: #020617;
    border: 2px solid #334155;
    color: #fbbf24;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.settings-select:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.settings-select:focus {
    border-color: #38bdf8;
}

/* Switch styling */
.switch-container {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-container .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 2px solid #4b5563;
}

.switch-container .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #cbd5e1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.switch-container input:checked+.slider {
    background-color: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
}

.switch-container input:checked+.slider:before {
    transform: translateX(26px);
    background-color: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

/* ===== BASE COMMAND LAYOUT ===== */
/* ===== BASE COMMAND LAYOUT ===== */
/* ===== BASE COMMAND LAYOUT ===== */
.base-layout-container {
    display: grid;
    grid-template-columns: 310px 1fr 440px;
    gap: 16px;
    padding: 10px 20px;
    height: 100%;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.base-dashboard-panel {
    width: 100%;
    border: var(--frame-lg-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-lg-image);
    border-image-repeat: var(--frame-lg-repeat);
    image-rendering: pixelated;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    position: relative;
}

.base-infrastructure-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.base-infrastructure-panel .cards-wrapper {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding-right: 6px;
    padding-bottom: 20px;
}

.base-infrastructure-panel .cards-wrapper::-webkit-scrollbar {
    width: 6px;
}

.base-infrastructure-panel .cards-wrapper::-webkit-scrollbar-track {
    background: rgba(2, 6, 23, 0.5);
    border-radius: 3px;
}

.base-infrastructure-panel .cards-wrapper::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.3);
    border-radius: 3px;
}

.base-infrastructure-panel .cards-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.5);
}

/* ===== HOLOGRAPHIC BLUEPRINT SCHEMATIC ===== */
.base-schematic-panel {
    border: var(--frame-lg-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-lg-image);
    border-image-repeat: var(--frame-lg-repeat);
    image-rendering: pixelated;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
    position: relative;
}

.schematic-viewport {
    flex: 1;
    position: relative;
    background: #020703; /* Темный фосфорно-зеленый фон радара */
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.95), 0 0 10px rgba(74, 222, 128, 0.15);
    margin-top: 8px;
}

/* Перекрестие тактического радара в центре */
.schematic-viewport::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(74, 222, 128, 0.12);
    pointer-events: none;
    z-index: 1;
}
.schematic-viewport::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(74, 222, 128, 0.12);
    pointer-events: none;
    z-index: 1;
}

.schematic-grid-bg {
    position: absolute;
    top: calc(50% - 120px);
    left: calc(50% - 120px);
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 2px dashed rgba(74, 222, 128, 0.25);
    /* Концентрические кольца дальности радара + сетка */
    background-image: 
        radial-gradient(circle, transparent 20%, rgba(74, 222, 128, 0.08) 21%, rgba(74, 222, 128, 0.08) 22%, transparent 23%),
        radial-gradient(circle, transparent 45%, rgba(74, 222, 128, 0.08) 46%, rgba(74, 222, 128, 0.08) 47%, transparent 48%),
        radial-gradient(circle, transparent 70%, rgba(74, 222, 128, 0.08) 71%, rgba(74, 222, 128, 0.08) 72%, transparent 73%),
        linear-gradient(rgba(74, 222, 128, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 222, 128, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px, 24px 24px;
    pointer-events: none;
    z-index: 1;
}

/* Круговой сканирующий луч радара */
.radar-sweep {
    position: absolute;
    width: 240px;
    height: 240px;
    top: calc(50% - 120px);
    left: calc(50% - 120px);
    background: conic-gradient(from 0deg, rgba(74, 222, 128, 0.2) 0deg, rgba(74, 222, 128, 0) 120deg);
    border-radius: 50%;
    pointer-events: none;
    transform-origin: center center;
    animation: radarSweep 6s linear infinite;
    z-index: 1;
}

@keyframes radarSweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Стена как плазменный защитный барьер */
.schematic-wall-line {
    position: absolute;
    left: 32%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(74, 222, 128, 0.45);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6), 0 0 25px rgba(74, 222, 128, 0.3);
    pointer-events: none;
    z-index: 2;
}

/* Анимированный сканирующий импульс вдоль стены */
.schematic-wall-line::before {
    content: '';
    position: absolute;
    left: -6px;
    width: 15px;
    height: 30px;
    background: rgba(74, 222, 128, 0.8);
    filter: blur(4px);
    animation: wallScan 4s linear infinite;
}

@keyframes wallScan {
    0% { top: -30px; }
    100% { top: 100%; }
}

.schematic-wall-glow {
    position: absolute;
    left: 31%;
    bottom: 0;
    width: 9px;
    border-radius: 4px;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

.optimal-glow {
    background: linear-gradient(to top, rgba(74, 222, 128, 0.15), #4ade80);
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.7);
}

.warning-glow {
    background: linear-gradient(to top, rgba(234, 179, 8, 0.15), #eab308);
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.7);
}

.critical-pulse {
    background: linear-gradient(to top, rgba(239, 68, 68, 0.15), #ef4444);
    animation: alertFlash 1s infinite alternate;
}

@keyframes alertFlash {
    from {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.4);
    }
    to {
        box-shadow: 0 0 25px #ef4444, 0 0 40px rgba(239, 68, 68, 0.8);
    }
}

.schematic-wall-text {
    position: absolute;
    left: 32%;
    top: 12px;
    transform: translateX(-50%);
    font-family: 'Consolas', monospace;
    font-size: 10px;
    font-weight: bold;
    color: #4ade80; /* Зеленый текст */
    background: rgba(4, 15, 6, 0.95);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}

/* Сетка узлов радара */
.schematic-node-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
}

.sch-node {
    --bracket-color: rgba(74, 222, 128, 0.45);
    position: absolute;
    width: 78px;
    height: 78px;
    background: rgba(3, 11, 4, 0.92); /* Темно-зеленый фон */
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 4px; /* Тактический квадрат */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(74, 222, 128, 0.1);
    user-select: none;
    
    /* 4 угловые тактические скобки */
    background-image: 
        linear-gradient(to right, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to bottom, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to left, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to bottom, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to right, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to top, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to left, var(--bracket-color) 8px, transparent 8px),
        linear-gradient(to top, var(--bracket-color) 8px, transparent 8px);
    background-position: 
        0 0, 0 0,
        100% 0, 100% 0,
        0 100%, 0 100%,
        100% 100%, 100% 100%;
    background-repeat: no-repeat;
    background-size: 8px 2px, 2px 8px, 8px 2px, 2px 8px, 8px 2px, 2px 8px, 8px 2px, 2px 8px;
}

.sch-node:hover {
    --bracket-color: #4ade80;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.95), inset 0 0 15px rgba(74, 222, 128, 0.25);
    background: rgba(6, 22, 9, 0.95);
}

.sch-node.active {
    --bracket-color: #4ade80;
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.45), inset 0 0 8px rgba(74, 222, 128, 0.2);
}

.sch-node.locked {
    filter: grayscale(1) opacity(0.35);
    cursor: not-allowed;
    --bracket-color: rgba(74, 222, 128, 0.15);
}

.sch-node-pulse {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 4px;
    border: 2px solid currentColor;
    opacity: 0;
    pointer-events: none;
}

.sch-node.active:hover .sch-node-pulse {
    animation: ringPulse 1.5s infinite;
}

@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.sch-node-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.sch-node:hover .sch-node-icon {
    transform: scale(1.1);
}

.sch-node-label {
    font-size: 8px;
    font-weight: 800;
    color: #a7f3d0; /* Зеленый оттенок текста */
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sch-node-val {
    font-size: 9px;
    font-weight: 800;
    margin-top: 1px;
}

.sch-node-val.online {
    color: #4ade80;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
}

.sch-node-val.offline {
    color: #064e3b; /* Приглушенный зеленый в оффлайне */
}

/* Цвета свечения отдельных активных узлов */
.node-reactor.active {
    border-color: rgba(52, 211, 153, 0.4);
    color: #34d399;
}

.node-farm.active {
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.node-barracks.active {
    border-color: rgba(163, 230, 53, 0.4);
    color: #a3e635;
}

.node-medbay.active {
    border-color: rgba(5, 150, 105, 0.4);
    color: #059669;
}

.node-sandbags.active {
    border-color: rgba(132, 204, 22, 0.4);
    color: #84cc16;
}

.node-watchtower.active {
    border-color: rgba(163, 230, 53, 0.4);
    color: #a3e635;
}

.node-specialforces.active {
    border-color: rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

/* Волна клика на узел радара */
.node-ripple {
    position: absolute;
    border: 3px solid rgba(74, 222, 128, 0.85); /* Зеленая волна */
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: clickRipple 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 10;
}

@keyframes clickRipple {
    0% {
        width: 0px;
        height: 0px;
        opacity: 1;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

/* ===== DYNAMIC DIAGNOSTICS BADGES ===== */
.diag-badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 2px;
}

.diag-badge {
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.diag-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: currentColor;
}

.diag-badge.badge-yield {
    color: #fde047;
    border-color: rgba(253, 224, 71, 0.2);
}

.diag-badge.badge-repair {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
}

.diag-badge.badge-cooling {
    color: #34d399; /* Мятно-зеленый вместо голубого */
    border-color: rgba(52, 211, 153, 0.2);
}

.diag-badge.badge-troops {
    color: #84cc16; /* Салатово-оливковый вместо розового */
    border-color: rgba(132, 204, 22, 0.2);
}

.diag-badge-label {
    font-size: 8px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diag-badge-value {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== RETRO CRT TERMINAL ===== */
.terminal-log-box {
    flex: 1;
    background: #010502; /* Темно-зеленый военный фон логов */
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 10px;
    padding: 6px 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10px;
    overflow-y: auto;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    position: relative;
}

.terminal-log-box::-webkit-scrollbar {
    width: 4px;
}

.terminal-log-box::-webkit-scrollbar-track {
    background: #010502;
}

.terminal-log-box::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.25);
    border-radius: 2px;
}

.terminal-line {
    line-height: 1.3;
    letter-spacing: 0.5px;
    white-space: pre-wrap;
    text-shadow: 0 0 4px currentColor;
}

.cyan-line {
    color: #34d399; /* Мятно-зеленый оттенок вместо голубого */
}

.green-line {
    color: #4ade80;
}

.yellow-line {
    color: #fbbf24;
}

.red-line {
    color: #f87171;
}

.cursor-line {
    color: #4ade80;
}

.cursor-line::after {
    content: '█';
    animation: cursorBlink 0.8s infinite steps(2);
    margin-left: 2px;
}

@keyframes cursorBlink {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ===== GLASSMORPHIC UPGRADE CARDS ===== */
.building-card {
    border: var(--frame-md-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-md-image);
    border-image-repeat: var(--frame-md-repeat);
    image-rendering: pixelated;
    padding: var(--frame-md-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-sizing: border-box;
}

.building-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.building-card:hover .bld-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.building-max {
    background: rgba(6, 95, 70, 0.1);
}

.building-max::before {
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);
}

.building-locked {
    filter: brightness(0.5) grayscale(0.5);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.3);
}

.building-locked::before {
    display: none;
}

/* Card Focused/Highlighted Animation on Node click */
.building-card.focused-card {
    animation: cardFlashFocus 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes cardFlashFocus {
    0% {
        border-color: #fbbf24;
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.8), inset 0 0 15px rgba(251, 191, 36, 0.3);
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.bld-icon {
    font-size: 1.8rem;
    line-height: 1;
    transition: all 0.25s ease;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.1));
}

.bld-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Styled LED ratings */
.bld-stars {
    display: flex;
    gap: 3px;
    margin: 2px 0;
}

.led-star {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.led-star.on {
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24, inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.bld-desc {
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.3;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bld-spec {
    color: #4ade80; /* Зеленый цвет спецификаций */
    font-size: 0.7rem;
    font-family: 'Consolas', monospace;
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.bld-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    background: linear-gradient(135deg, #0e2e1a, #05160c); /* Темно-зеленый фон */
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.bld-btn:not(:disabled):hover {
    border-color: #4ade80;
    background: linear-gradient(135deg, #22c55e, #15803d); /* Зеленый градиент */
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bld-btn:disabled {
    opacity: 0.5;
    background: rgba(30, 41, 59, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
    color: #64748b;
    cursor: not-allowed;
}

.bld-btn .price-icon {
    width: 13px;
    height: 13px;
    margin: 0;
}

.dashboard-header {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.2rem;
    color: #4ade80; /* Зеленый цвет вместо голубого */
    font-weight: 800;
    border-bottom: 2px solid rgba(74, 222, 128, 0.25);
    padding-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-section-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.8rem;
    color: #a7f3d0; /* Светло-зеленый оттенок */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-progress-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: #022c22; /* Темно-зеленый фон */
    border: 1.5px solid #064e3b;
    border-radius: 8px;
    overflow: hidden;
}

.dashboard-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.dashboard-progress-bar.wall-bar {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.dashboard-progress-bar.garrison-bar {
    background: linear-gradient(90deg, #15803d, #22c55e); /* Зеленый градиент вместо синего */
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.dashboard-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.dashboard-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: linear-gradient(135deg, #0f2d1a, #07190e); /* Темно-зеленый вместо синего */
    border: 2px solid #14532d;
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.dashboard-btn:hover {
    border-color: #4ade80; /* Ярко-зеленый контур */
    background: linear-gradient(135deg, #14532d, #0f2d1a);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 222, 128, 0.25);
}

.dashboard-btn:active {
    transform: translateY(1px);
}

.sf-price {
    background: rgba(253, 224, 71, 0.15);
    border: 1px solid #fde047;
    color: #fde047;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.metrics-section {
    background: rgba(4, 15, 6, 0.5); /* Темно-зеленый полупрозрачный фон */
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: auto;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    color: #cbd5e1;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.metric-row:last-child {
    border-bottom: none;
}

/* ===== BASE COMMAND SIDEBAR ===== */
.sidebar-header-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-title {
    font-family: 'Fredoka One', 'Nunito', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #4ade80; /* Зеленый цвет сайдбара */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.base-pause-notice {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1.5px dashed rgba(239, 68, 68, 0.4);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: sidebarPulse 2s infinite alternate;
}

@keyframes sidebarPulse {
    0% {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.3);
    }

    100% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
        border-color: rgba(239, 68, 68, 0.65);
    }
}

.sidebar-infra-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-infra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: var(--frame-lg-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-lg-image);
    border-image-repeat: var(--frame-lg-repeat);
    image-rendering: pixelated;
    transition: all 0.2s;
    box-sizing: border-box;
    padding: var(--frame-lg-padding);
}

.sidebar-infra-item:hover {
    filter: brightness(1.2);
    transform: translateX(3px);
}

.sidebar-infra-item.infra-item-locked {
    filter: grayscale(1) opacity(0.5);
}

.sidebar-infra-item.infra-item-locked:hover {
    transform: none;
}

.infra-item-icon {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.infra-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.infra-item-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.infra-item-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.infra-status-locked {
    font-size: 0.55rem;
    color: #64748b;
    font-weight: 800;
    border: 1px solid #1e293b;
    padding: 1px 4px;
    border-radius: 4px;
    background: #020617;
    letter-spacing: 0.5px;
}

.infra-status-max {
    font-size: 0.55rem;
    color: #fde047;
    font-weight: 800;
    border: 1px solid rgba(253, 224, 71, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(253, 224, 71, 0.1);
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(253, 224, 71, 0.3);
}

.infra-status-lv {
    font-size: 0.55rem;
    color: #4ade80; /* Зеленый цвет вместо голубого */
    font-weight: 800;
    border: 1px solid rgba(74, 222, 128, 0.3);
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(74, 222, 128, 0.1);
    letter-spacing: 0.5px;
}

.infra-item-stars {
    font-size: 0.72rem;
    color: #fbbf24;
    letter-spacing: 2px;
}

.sidebar-tips-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-tip-box {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    border: var(--frame-md-border) solid transparent;
    border-image: url('../pic/ui/ui_block/frame_card.png') var(--frame-slice) fill;
    border-image-width: var(--frame-md-image);
    border-image-repeat: var(--frame-md-repeat);
    image-rendering: pixelated;
    box-sizing: border-box;
    padding: var(--frame-md-padding);
}

.tip-warning {
    color: #f87171;
    filter: sepia(0.5) hue-rotate(-40deg) saturate(2) brightness(1.2);
}

.tip-danger {
    color: #fdba74;
    filter: sepia(0.5) hue-rotate(-20deg) saturate(2) brightness(1.2);
}

.tip-info {
    color: #7dd3fc;
    filter: sepia(0.2) hue-rotate(180deg) saturate(2) brightness(1.2);
}

.tip-success {
    color: #86efac;
    filter: sepia(0.2) hue-rotate(80deg) saturate(2) brightness(1.2);
}

/* Custom Pixel Art Icons */
.ui-icon-pixel {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle;
}

/* Contextual sizing for pixel art icons */
.slot-icon .ui-icon-pixel {
    width: 38px !important;
    height: 38px !important;
}

.tech-node .ui-icon-pixel {
    width: 38px !important;
    height: 38px !important;
}

.bld-icon .ui-icon-pixel {
    width: 44px !important;
    height: 44px !important;
}

/* ===== UPGRADE AVAILABILITY INDICATORS (ABSOLUTE POSITIONING) ===== */
.btn-buy, .bld-btn, .dashboard-btn, .turret-buy-btn, .upgrade-popup button, .details-btn {
    position: relative !important;
}

.up-indicator-icon, .up-indicator-badge {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    width: 18px !important;
    height: 18px !important;
    z-index: 10 !important;
    pointer-events: none !important;
    display: block !important;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #0b0f17 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Exo 2', sans-serif !important;
    color: #fff !important;
    opacity: 1 !important;
    transition: opacity 0.5s ease !important;
}

.loading-screen.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
}

.loading-content {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.loading-logo-img {
    max-width: 280px !important;
    height: auto !important;
    animation: loader-pulse 2s infinite ease-in-out !important;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.4)) !important;
    margin-bottom: 10px !important;
}

.loading-title {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    letter-spacing: 2px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

.loading-bar-container {
    width: 300px !important;
    height: 12px !important;
    background: #1f2937 !important;
    border: 2px solid #374151 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

.loading-bar-fill {
    width: 0% !important;
    height: 100% !important;
    background: linear-gradient(90deg, #ef4444, #f97316) !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6) !important;
    transition: width 0.1s ease-out !important;
}

.loading-progress {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #9ca3af !important;
}

@keyframes loader-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}
