/* Контейнер для баз (работает и на странице, и в модалке) */
.bases-container, #bases-mount {
    font-family: 'Cuprum', sans-serif;
    color: #c5d1c0;
    width: 100%;
    padding: 10px;
}

.bases-container .bases-grid, #bases-mount .bases-grid {
    /* стили для грида уже есть */
}
/* ========================================== */
/* УБЕЖИЩА ФРАКЦИЙ (BASES)                    */
/* ========================================== */
#bases-mount {
    font-family: 'Cuprum', sans-serif;
    color: #c5d1c0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.bases-topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.bases-back-btn {
    color: #c49a45;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    border: 1px solid #3e4a36;
    padding: 6px 12px;
    border-radius: 2px;
    transition: 0.2s;
}
.bases-back-btn:hover { background: #c49a45; color: #000; }

.bases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.base-card {
    background: linear-gradient(135deg, rgba(30, 35, 28, 0.95), rgba(15, 18, 12, 0.98));
    border: 2px solid #3b2b1e;
    outline: 1px solid #5e6b4d;
    outline-offset: -4px;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9);
    position: relative;
}

.base-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #2a3022;
    padding-bottom: 10px;
}

.base-icon {
    width: 45px;
    height: 45px;
    background: #0a0c08;
    border: 1px solid #c49a45;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #c49a45;
    border-radius: 2px;
}

.base-title h3 {
    margin: 0;
    font-family: 'Forum', serif;
    font-size: 16px;
    color: #e6dcc5;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.base-level {
    font-family: 'News Cycle', sans-serif;
    font-size: 11px;
    color: #7f8a75;
}

.base-progress-bar {
    height: 6px;
    background: #0a0c08;
    border: 1px solid #3e4a36;
    border-radius: 2px;
    overflow: hidden;
}
.base-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4b946b, #c49a45);
    transition: width 0.3s;
}
.base-progress-text {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #7f8a75;
    text-align: right;
    margin-top: -8px;
}

.base-res-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    padding: 8px;
    border-radius: 2px;
}
.base-res-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: #141610;
    border: 1px solid #3e4a36;
    padding: 2px 6px;
    border-radius: 2px;
}
.base-res-item img { width: 16px; height: 16px; object-fit: contain; }

.base-actions {
    display: flex;
    gap: 8px;
}
.base-btn {
    flex: 1;
    padding: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid;
    background: transparent;
    transition: 0.2s;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.base-btn.donate { border-color: #4CAF50; color: #4CAF50; }
.base-btn.donate:hover { background: #4CAF50; color: #000; }
.base-btn.raid { border-color: #ff5252; color: #ff5252; }
.base-btn.raid:hover:not(:disabled) { background: #ff5252; color: #000; }
.base-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.base-log {
    background: rgba(0,0,0,0.3);
    border-top: 1px dashed #3e4a36;
    padding-top: 8px;
    font-family: 'News Cycle', sans-serif;
    font-size: 11px;
}
.base-log-title { color: #7f8a75; text-transform: uppercase; margin-bottom: 5px; font-size: 9px; letter-spacing: 1px; }
.base-log-item { display: flex; justify-content: space-between; padding: 2px 0; }
.base-log-item.positive { color: #4CAF50; }
.base-log-item.negative { color: #ff5252; }
.base-log-empty { color: #555; font-style: italic; }

/* Модалка вклада */
.donate-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(10, 12, 8, 0.9);
    backdrop-filter: blur(4px);
    z-index: 100001;
    align-items: center; justify-content: center;
    padding: 20px;
}
.donate-modal.active { display: flex; }
.donate-card {
    background: #1a1e16;
    border: 2px solid #3b2b1e;
    outline: 1px solid #c49a45;
    outline-offset: -4px;
    border-radius: 4px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,1);
}
.donate-close {
    position: absolute; top: 10px; right: 15px;
    background: none; border: none; color: #8b4513; font-size: 20px; cursor: pointer;
}
.donate-close:hover { color: #c49a45; }
.donate-card h2 {
    font-family: 'Forum', serif; color: #c49a45; font-size: 18px;
    text-transform: uppercase; text-align: center; margin: 0 0 15px 0;
    border-bottom: 1px solid #3e4a36; padding-bottom: 10px;
}
.donate-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-bottom: 1px solid #1f241b;
}
.donate-row img { width: 32px; height: 32px; object-fit: contain; }
.donate-info { flex: 1; }
.donate-name { font-family: 'Forum', serif; font-size: 13px; color: #e6dcc5; }
.donate-qty { font-size: 10px; color: #7f8a75; font-family: 'News Cycle', sans-serif; }
.donate-input {
    width: 60px; background: #141610; border: 1px solid #3e4a36;
    color: #e6dcc5; padding: 4px; text-align: center;
    font-family: 'Courier New', monospace; border-radius: 2px;
}
.donate-actions {
    display: flex; gap: 10px; justify-content: flex-end; margin-top: 15px;
}
.donate-actions button {
    padding: 8px 16px; font-family: 'Oswald', sans-serif; font-size: 11px;
    text-transform: uppercase; border-radius: 2px; cursor: pointer; border: 1px solid;
}
.donate-cancel { border-color: #777; color: #999; background: transparent; }
.donate-cancel:hover { background: #777; color: #fff; }
.donate-submit { border-color: #4CAF50; color: #4CAF50; background: transparent; }
.donate-submit:hover { background: #4CAF50; color: #000; }
/* Подсветка ресурсов, которые можно внести */
.base-res-item.can-donate {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.base-res-item.can-donate img {
    filter: drop-shadow(0 0 3px #4CAF50);
}

.my-qty-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #4CAF50;
    color: #000;
    font-size: 9px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    padding: 1px 4px;
    border-radius: 8px;
    border: 1px solid #1a1e16;
    z-index: 2;
}

/* Убедимся, что у .base-res-item есть position: relative для бейджа */
.base-res-item {
    position: relative; /* добавить, если ещё нет */
}

/* Подсветка всей карточки, если игроку есть что сдать */
.base-card.can-donate-card {
    border-color: #4b946b;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 15px rgba(75, 148, 107, 0.25);
    transition: box-shadow 0.3s, border-color 0.3s;
}

/* Усилим свечение при наведении */
.base-card.can-donate-card:hover {
    border-color: #8bc34a;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 25px rgba(139, 195, 74, 0.45);
}

/* Маленький значок-индикатор в углу карточки */
.base-card.can-donate-card::after {
    content: '\f0a1'; /* иконка "hand-holding" или "box-open" из FontAwesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 14px;
    color: #8bc34a;
    opacity: 0.7;
    pointer-events: none;
    animation: basePulse 2s infinite ease-in-out;
}

@keyframes basePulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}