/* ===== main.css – базовый каркас нового дизайна (с интегрированными стилями core.css) ===== */

/* === ПЕРЕМЕННЫЕ (расширенные) === */
:root {
    /* Основной фон */
    --main-bg: rgba(26, 17, 12, 0.35);
    --main-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --main-border: 1.5px solid #8b5a2b;
    --main-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
    --main-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Основные цвета */
    --color-primary-dark: #5d2906;
    --color-primary: #8b4513;
    --color-primary-light: #a0522d;
    --color-secondary: #d2b48c;
    --color-secondary-light: #f5e6d3;
    --color-accent: #d2691e;
    --color-gold: #ffd700;
    --color-light: #f5e6d3;
    --color-dark: #5d2906;
    --color-success: #27ae60;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-info: #3498db;
    --color-purple: #9b59b6;
    --color-boost: #2196f3;
    --color-holiday: #9c27b0;

    /* Цвета рамок */
    --color-border-dark: #443e38;
    --color-border-light: #847165;
    --color-border-medium: #6b5a55;
    --color-border-extra-dark: #3b2c27;

    /* Градиенты */
    --gradient-card: linear-gradient(145deg, rgba(245, 230, 211, 0.92), rgba(212, 183, 143, 0.88));
    --gradient-card-light: linear-gradient(145deg, rgba(245, 230, 211, 0.88), rgba(234, 214, 184, 0.88));
    --gradient-card-dark: linear-gradient(145deg, rgba(59, 44, 39, 0.9), rgba(91, 41, 6, 0.85));
    --gradient-button: linear-gradient(145deg, #a0522d, #8b4513, #a0522d);
    --gradient-button-hover: linear-gradient(145deg, #8b4513, #5d2906, #8b4513);
    --gradient-nav: linear-gradient(to bottom, rgba(139, 69, 19, 0.95), rgba(160, 82, 45, 0.9));
    --gradient-gold: linear-gradient(145deg, #ffd700, #d4af37);
    --gradient-gold-shine: linear-gradient(90deg, #ffd700, #d4af37, #ffd700);
    --gradient-border: linear-gradient(45deg, #4b1f12, #6c3613, #3b2c27, #5a3e2b, #6b5a55);
    --gradient-progress-bg: linear-gradient(to right, rgba(59, 44, 39, 0.75), rgba(107, 90, 85, 0.65), rgba(59, 44, 39, 0.75));

    /* Тени */
    --shadow-small: 0 3px 10px rgba(139, 69, 19, 0.15);
    --shadow-medium: 0 5px 18px rgba(139, 69, 19, 0.3);
    --shadow-large: 0 8px 25px rgba(139, 69, 19, 0.4);
    --shadow-heavy: 0 12px 40px rgba(139, 69, 19, 0.35);
    --shadow-glow: 0 0 15px rgba(255, 215, 0, 0.25);
    --shadow-inset-light: inset 0 0 15px rgba(59, 44, 39, 0.08);
    --shadow-border: 0 0 0 0.5px rgba(59, 44, 39, 0.25), 0 0 20px rgba(107, 90, 85, 0.15);

    /* Скругления */
    --radius-small: 6px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --radius-round: 50%;

    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-xxl: 24px;

    /* Размеры */
    --border-width-thin: 1.5px;
    --border-width-medium: 2px;
    --border-width-thick: 3px;

    /* Анимации */
    --transition-default: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s ease;
    --transition-fast: all 0.25s ease;

    /* Чат */
    --chat-bg: rgba(26, 17, 12, 0.35);
    --chat-gold: #8b5a2b;
    --chat-gold-light: #ffd966;

}

/* === СБРОСЫ И БАЗОВЫЕ СТИЛИ === */
* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #b8860b #2b1e0e;
        font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
        font-size: 11px;
}
#chat-content * {
    font-size: unset;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #2b1e0e;
    border-radius: 10px;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-radius: 10px;
    border: 1px solid #d4af37;
    box-shadow: inset 0 0 4px rgba(255,215,0,0.2);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #d4af37, #b8860b);
    box-shadow: inset 0 0 8px gold;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
    color: var(--color-dark);
    background: transparent;
    line-height: 1.5;
}
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-default);
}
a:hover {
    color: var(--color-dark);
}

a, a:link, a:visited, a:active {
    color: #f39400;
    text-decoration: none;
}
a:hover{
    color: #f8d5a8;
    text-decoration: none;
}
/* === АНИМАЦИИ === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
@keyframes glow {
    0%, 100% { box-shadow: var(--shadow-glow); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.4); }
}
@keyframes bankBlink {
    0% { color: rgb(103, 45, 45); }
    50% { color: rgb(239, 0, 0); }
    100% { color: rgb(103, 45, 45); }
}
@keyframes borderShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes framePulse {
    0%, 100% { box-shadow: 0 0 0 0.5px rgba(59, 44, 39, 0.25), 0 0 20px rgba(107, 90, 85, 0.15), inset 0 0 15px rgba(59, 44, 39, 0.08); }
    50% { box-shadow: 0 0 0 0.5px rgba(107, 90, 85, 0.3), 0 0 25px rgba(132, 113, 101, 0.2), inset 0 0 20px rgba(107, 90, 85, 0.12); }
}
@keyframes cornerPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.03); }
}
@keyframes patinaMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}
@keyframes navGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes itemAppear {
    from { opacity: 0; transform: translateY(15px) rotateY(-90deg); }
    to { opacity: 1; transform: translateY(0) rotateY(0); }
}
@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes borderPulse {
    0%, 100% { border-color: #ffd700; }
    50% { border-color: #ffa500; }
}
@keyframes shine {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.8; }
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === ОСНОВНАЯ СЕТКА ИГРОВОГО ИНТЕРФЕЙСА (из main_new.css) === */
.bg, .bg_module {
    background-color: transparent !important;
    background-image: none !important;
}
.game-grid {
    display: grid;
    grid-template-columns: 130px 1fr 106px;
    grid-template-rows: auto 1fr auto;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}
.game-avatar { grid-column: 1; grid-row: 1; position: relative; z-index: 10; }
.game-topmenu { grid-column: 2; grid-row: 1; justify-self: center; align-self: start; z-index: 10; }
.game-logout { grid-column: 3; grid-row: 1; position: relative; z-index: 10; }
.game-logout img { position: absolute; top: 0; right: 5px; cursor: pointer; z-index: 9999; }
.game-left-menu { grid-column: 1; grid-row: 2; position: relative; z-index: 10; }
.game-main-frame {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    z-index: 5;
    overflow: hidden;
    border-radius: 15px;
    padding-bottom: 2px;
}
.game-right-menu { grid-column: 3; grid-row: 2; position: relative; z-index: 10; }
.game-footer {
    grid-column: 2;
    grid-row: 3;
    height: 0;
    overflow: visible;
    z-index: 20;
    pointer-events: none;
}
.game-footer > * { pointer-events: auto; }

.menu-above-chat {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.menu-above-chat > * { pointer-events: auto; }

#canvasAvatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 350px;
    height: 86px;
    user-select: none;
    outline: none;
}

/* === ОБЩИЕ КОМПОНЕНТЫ === */
#userCanvas > video{
    border-radius: 100%;
    max-width: 220px;
}
/* Заголовок страницы (общий) */
.page-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(139,69,19,0.9), rgba(160,82,45,0.8));
    border-radius: 12px;
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-small);
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-gold), var(--color-accent));
}
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}
.page-subtitle {
    font-size: 16px;
    color: #e8d0a9;
    max-width: 800px;
    margin: 0 auto;
}

/* Карточка */
.card {
    background: var(--gradient-card);
    border-radius: 10px;
    border: 1px solid var(--color-primary-light);
    box-shadow: var(--shadow-small);
    transition: transform var(--transition-default), box-shadow var(--transition-default);
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.4s ease-out;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}
.card-header {
    padding: 15px;
    background: linear-gradient(to right, rgba(210,180,140,0.25), rgba(245,230,211,0.25));
    border-bottom: 1px solid var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 15px;
}
.card-body { padding: 20px; }
.card-footer {
    padding: 15px;
    background: rgba(245,230,211,0.3);
    border-top: 1px solid var(--color-secondary);
}

#scroll-hide {
    overflow: hidden !important;
}
/* Кнопки */
.btn {
    padding: 10px 20px;
    background: var(--gradient-button);
    border: none;
    border-radius: 6px;
    color: #f5e6d3;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-default);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(139,69,19,0.25);
}
.btn:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139,69,19,0.35);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-sm { padding: 6px 12px; font-size: 0.9rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }
.btn-success { background: linear-gradient(145deg, var(--color-success), #229954); }
.btn-danger { background: linear-gradient(145deg, var(--color-danger), #c0392b); }
.btn-warning { background: linear-gradient(145deg, var(--color-warning), #e67e22); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-dark);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Прогресс-бар */
.progress-bar {
    height: 16px;
    background: rgba(210,180,140,0.25);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-primary);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    border-radius: 7px;
    transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

/* Таблица */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 15px 0;
    background: rgba(245,230,211,0.3);
    border-radius: 8px;
    overflow: hidden;
}
.table th {
    background: linear-gradient(145deg, rgba(139,69,19,0.9), rgba(160,82,45,0.85));
    color: var(--color-gold);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}
.table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(139,69,19,0.15);
    color: var(--color-dark);
}
.table tr:nth-child(even) { background: rgba(255,248,240,0.4); }
.table tr:hover { background: rgba(210,180,140,0.2); }

/* Фильтры */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(245,230,211,0.9);
    border-radius: 8px;
    border: 1px solid var(--color-primary-light);
}
.filter-btn {
    padding: 8px 16px;
    background: rgba(139,69,19,0.08);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    color: var(--color-dark);
    cursor: pointer;
    transition: all var(--transition-default);
    font-weight: 500;
}
.filter-btn:hover {
    background: rgba(139,69,19,0.15);
    transform: translateY(-1px);
}
.filter-btn.active {
    background: var(--color-primary);
    color: #f5e6d3;
    border-color: var(--color-dark);
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
    padding: 10px;
    background: rgba(245,230,211,0.5);
    border-radius: 8px;
}
.page-item {
    padding: 6px 12px;
    background: rgba(210,180,140,0.3);
    border: 1px solid var(--color-primary-light);
    border-radius: 4px;
    color: var(--color-dark);
    cursor: pointer;
    transition: all var(--transition-default);
}
.page-item:hover { background: rgba(210,180,140,0.5); }
.page-item.active {
    background: var(--color-primary);
    color: #f5e6d3;
    border-color: var(--color-dark);
}
.page-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(245,245,220,0.4);
    border-radius: 12px;
    border: 2px dashed var(--color-secondary);
    margin: 30px 0;
}
.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--color-secondary);
    opacity: 0.6;
}
.empty-title {
    font-size: 20px;
    color: var(--color-dark);
    margin-bottom: 10px;
}
.empty-text {
    color: var(--color-primary-light);
    max-width: 500px;
    margin: 0 auto;
}

/* Тултипы */
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: rgba(91,41,6,0.95);
    color: #f5e6d3;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--color-dark);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
}
.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(91,41,6,0.95) transparent transparent transparent;
}
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Цвета качества предметов */
.quality-0 { color: #acacac; }
.quality-1 { color: #38b728; }
.quality-2 { color: #0070dd; }
.quality-3 { color: #a335ee; }
.quality-4 { color: #ee3557; }
.quality-5 { color: #3ad3d3; }
.quality-6 { color: #ff8000; }
.quality-7 { color: #400d65; }

/* === ПОРТАЛЬНЫЕ МОДАЛЬНЫЕ ОКНА === */
.portal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}
.portal-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.portal-modal {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #2a1e15, #1f150e);
    border: 2px solid #b8860b;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px #d4af37 inset;
    color: #f5e6d3;
    font-family: inherit;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    overflow: hidden;
}
.portal-modal-overlay.active .portal-modal { transform: scale(1); }
.portal-modal-header {
    flex-shrink: 0;
    padding: 20px 25px 10px;
    border-bottom: 2px solid #b8860b;
    background: rgba(0,0,0,0.3);
    position: relative;
}
.portal-modal-header h3 {
    margin: 0;
    color: #ffd966;
    font-size: 26px;
    font-weight: 700;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}
.portal-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #b8860b;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}
.portal-modal-close span {
    display: block;
    width: 20px;
    height: 20px;
    position: relative;
}
.portal-modal-close span::before,
.portal-modal-close span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #f5e6d3;
    transform-origin: center;
    transition: background 0.2s;
}
.portal-modal-close span::before {
    transform: translateY(-50%) rotate(45deg);
}
.portal-modal-close span::after {
    transform: translateY(-50%) rotate(-45deg);
}
.portal-modal-close:hover {
    background: #b8860b;
}
.portal-modal-close:hover span::before,
.portal-modal-close:hover span::after {
    background: #1f140c;
}
.portal-modal-close:hover { background: #b8860b; }
.portal-modal-body {
    flex: 1 1 auto;
    padding: 20px 25px;
    overflow-y: auto;
    color: #f0e6d2;
}
.portal-modal-footer {
    flex-shrink: 0;
    padding: 15px 25px 20px;
    background: rgba(0,0,0,0.3);
    border-top: 2px solid #8b5a2b;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.portal-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 40px;
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 0 #3a281a;
}
.portal-btn-primary {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    color: #1f140c;
    border-color: #d4af37;
}
.portal-btn-primary:hover {
    background: linear-gradient(145deg, #8b5a2b, #b8860b);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #3a281a, 0 0 15px gold;
}
.portal-btn-secondary {
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #b8860b;
    color: #ffd966;
}
.portal-btn-secondary:hover {
    background: #b8860b;
    color: #1f140c;
    border-color: #ffd700;
}

/* ===== МОДАЛЬНЫЕ ОКНА РЮКЗАКА (backpack-modal) ===== */
.backpack-modal {
    color: var(--color-secondary-light);
}

.backpack-modal .item-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-large);
    border: 1px solid rgba(184, 134, 11, 0.3);
}

.backpack-modal .item-preview img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-medium);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
}

.backpack-modal .item-preview span {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.backpack-modal .quantity-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.backpack-modal .quantity-selector label {
    font-weight: 600;
    color: var(--color-gold);
    min-width: 80px;
}

.backpack-modal .quantity-selector input {
    width: 80px;
    padding: 8px 10px;
    background: var(--color-border-extra-dark);
    border: 2px solid var(--chat-gold);
    border-radius: var(--radius-medium);
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.backpack-modal .quantity-selector input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.backpack-modal .quantity-selector span {
    color: var(--color-secondary-light);
}

.backpack-modal .btn-small {
    padding: 8px 16px;
    background: var(--gradient-button);
    border: 2px solid var(--chat-gold);
    border-radius: var(--radius-medium);
    color: var(--color-secondary-light);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-default);
    margin-left: auto;
    box-shadow: var(--shadow-small);
}

.backpack-modal .btn-small:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 0 10px rgba(255, 215, 0, 0.2);
    color: var(--color-gold);
}

.backpack-modal .price-info {
    background: rgba(0, 0, 0, 0.25);
    padding: 16px;
    border-radius: var(--radius-large);
    margin: 16px 0;
    border-left: 4px solid var(--color-gold);
    font-size: 1rem;
    line-height: 1.6;
    color: #f0e6d2;
}

.backpack-modal .price-info #total-price {
    font-weight: 700;
    color: var(--color-gold);
    font-size: 1.2rem;
}

.backpack-modal .action-hint {
    margin: 20px 0 10px;
    font-weight: 600;
    color: var(--color-warning);
    text-align: center;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Адаптация для мобильных */
@media (max-width: 600px) {
    .backpack-modal .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .backpack-modal .btn-small {
        margin-left: 0;
        width: 100%;
    }
}

/* ===== ПАНЕЛЬ НАСТРОЕК РАЗДЕЛОВ РЮКЗАКА ===== */
.backpack-settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: linear-gradient(145deg, #2a1e15, #1f150e);
    border: 2px solid #b8860b;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px #d4af37 inset;
    color: #f5e6d3;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.backpack-settings-panel .panel-header {
    flex-shrink: 0;
    padding: 20px 25px 10px;
    border-bottom: 2px solid #b8860b;
    background: rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.backpack-settings-panel .panel-header h4 {
    margin: 0;
    color: #ffd966;
    font-size: 22px;
    font-weight: 700;
}

.backpack-settings-panel .panel-close {
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #b8860b;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #f5e6d3;
    font-size: 20px;
    line-height: 1;
}
.backpack-settings-panel .panel-close:hover {
    background: #b8860b;
    color: #1f140c;
}

.backpack-settings-panel .panel-body {
    flex: 1 1 auto;
    padding: 20px 25px;
    overflow-y: auto;
}

.backpack-settings-panel .panel-body .hint {
    margin: 0 0 15px;
    color: #d2b48c;
    font-style: italic;
    font-size: 14px;
}

.backpack-settings-panel .subgroups-sortable {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backpack-settings-panel .subgroup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(184,134,11,0.3);
    border-radius: 12px;
    transition: all 0.2s;
}
.backpack-settings-panel .subgroup-item:hover {
    background: rgba(0,0,0,0.4);
    border-color: #b8860b;
}

.backpack-settings-panel .drag-handle {
    cursor: grab;
    font-size: 20px;
    color: #d2b48c;
    user-select: none;
}
.backpack-settings-panel .subgroup-item.ui-sortable-helper .drag-handle {
    cursor: grabbing;
}

.backpack-settings-panel .subgroup-name {
    flex: 1;
    font-weight: 500;
    color: #f0e6d2;
}

.backpack-settings-panel .subgroup-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.backpack-settings-panel .subgroup-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.backpack-settings-panel .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f2e22;
    transition: .3s;
    border-radius: 34px;
    border: 2px solid #8b5a2b;
}

.backpack-settings-panel .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: #d2b48c;
    transition: .3s;
    border-radius: 50%;
}

.backpack-settings-panel input:checked + .toggle-slider {
    background-color: #b8860b;
}

.backpack-settings-panel input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #ffd966;
}

.backpack-settings-panel .panel-footer {
    flex-shrink: 0;
    padding: 15px 25px 20px;
    background: rgba(0,0,0,0.3);
    border-top: 2px solid #8b5a2b;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.backpack-settings-panel .btn-primary {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 40px;
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    color: #1f140c;
    border: 2px solid #d4af37;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #3a281a;
}
.backpack-settings-panel .btn-primary:hover {
    background: linear-gradient(145deg, #8b5a2b, #b8860b);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #3a281a, 0 0 15px gold;
}
/* === ПРОЧИЕ ЭЛЕМЕНТЫ === */
.chat-visibility-dropdown {
    position: absolute;
    bottom: 40px;
    left: 0;
    background: linear-gradient(145deg, #2a1e15, #1f150e);
    border: 2px solid #b8860b;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
    min-width: 200px;
    z-index: 1000;
    padding: 5px 0;
}
.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    color: #f5e6d3;
    cursor: pointer;
    transition: background 0.2s;
}
.dropdown-item:hover { background: rgba(184, 134, 11, 0.3); }
.dropdown-item .toggle-indicator {
    font-size: 18px;
    margin-left: 10px;
}

.game-footer {
    transition: height 0.2s ease;
}
.game-footer:has(.hor-menu-hidden) {
    height: 0 !important;
}

.chat-user-card.ally { border-left: 4px solid #2e8b57; }
.chat-user-card.enemy { border-left: 4px solid #c0392b; }
.chat-user-card.enemy { background: rgba(192, 57, 43, 0.1); }
.chat-user-card.ally { background: rgba(46, 139, 87, 0.1); }

/* ===== ИНТЕГРИРОВАННЫЕ СТИЛИ ИЗ CORE.CSS (bank-*) ===== */
.bgnew{
    background: url(/p/img/backgrounds/3_2560.jpg) center top / cover fixed no-repeat;
}
/* === ФОН СТРАНИЦЫ === */
.bank-bg_old {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 5px 5px 20px 5px !important;
    background: radial-gradient(ellipse at 20% 20%, rgba(210, 180, 140, 0.12) 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(139, 69, 19, 0.1) 0%, transparent 50%), linear-gradient(145deg, #3f2f1c 0%, #332612 20%, #2b1900 40%, #453407 70%, #a13e0f 100%);
    background-attachment: fixed;
    background-position: 0 4px;
    background-repeat: no-repeat;
    background-size: cover;
    border: var(--border-width-thick) solid var(--color-border-dark);
    border-radius: 0;
    box-shadow: var(--shadow-border), var(--shadow-inset-light);
    height: auto;
    border-radius: 15px;
}
.bank-bg_old::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212, 175, 55, 0.02) 2px, rgba(212, 175, 55, 0.02) 4px), radial-gradient(circle at 20% 30%, rgba(210, 180, 140, 0.05) 0%, transparent 20%), radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}
.bank-bg_old::after {
    content: '';
    position: absolute;
    top: -1.5px;
    left: -1.5px;
    right: -1.5px;
    bottom: -1.5px;
    background: var(--gradient-border);
    background-size: 400% 400%;
    border-radius: 0;
    z-index: -1;
    animation: borderShift 20s linear infinite;
    filter: blur(0.5px);
    opacity: 0.6;
}


/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.bank-bg {
    position: relative;
    height: 100vh;                /* фиксированная высота на всё окно */
    overflow: hidden !important;
    min-height: 0;                /* отменяет растягивание по min-height */

    /* Сохраняем исходные визуальные свойства */
    background: var(--main-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 5px !important;
    box-shadow: var(--main-shadow), var(--main-inner-glow);
    border: var(--main-border);
    transition: var(--main-transition);

    /* Убираем старое поведение overflow: hidden, оно мешает прокрутке */
}

.bank-bg:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.4), inset 0 0 30px rgba(212, 175, 55, 0.12);
}

/* ===== ДЕКОРАТИВНЫЙ СЛОЙ (бывший ::before) ===== */
.bank-bg__decor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;

    /* Копия фонового рисунка из ::before */
    background-image:
            repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212, 175, 55, 0.02) 2px, rgba(212, 175, 55, 0.02) 4px),
            radial-gradient(circle at 20% 30%, rgba(210, 180, 140, 0.05) 0%, transparent 20%),
            radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.05) 0%, transparent 30%);

    /* При необходимости можно добавить border-radius для соответствия контейнеру */
    border-radius: inherit;
}

/* ===== ОБЁРТКА ДЛЯ ОСНОВНОГО КОНТЕНТА ===== */
.bank-bg__content_head {
    position: relative;
    z-index: 2;                   /* поднимаем над декором */
    overflow: hidden;
    max-height: 20vh;
    padding: 5px;
}
.bank-bg__content {
    position: relative;
    z-index: 2;                   /* поднимаем над декором */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    padding: 5px 5px 75px 5px;
}

/* ===== УДАЛЯЕМ СТАРЫЙ ПСЕВДОЭЛЕМЕНТ ===== */
.bank-bg::before {
    display: none !important;     /* отключаем старый слой, если вдруг остался */
}

/* ===== ДОПОЛНИТЕЛЬНО: если нужна анимация патины (как в .bank-bg_old) ===== */
/* Если вы используете ::after для рамки, перенесите его в отдельный элемент */
.bank-bg__decor::after {
    content: '';
    position: absolute;
    top: -1.5px;
    left: -1.5px;
    right: -1.5px;
    bottom: -1.5px;
    background: var(--gradient-border);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: borderShift 20s linear infinite;
    filter: blur(0.5px);
    opacity: 0.2;
    pointer-events: none;
}

/* === КОНТЕЙНЕРЫ === */
.bank-container {
    max-width: 100%;
    margin: 0;
    padding: clamp(4px, 2vw, 6px);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}
.bank-main-content {
    margin: 0 clamp(12px, 2vw, 16px);
}

/* === НАВИГАЦИЯ === */
.bank-nav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px;
    background: var(--gradient-nav);
    border-radius: 10px;
    border: var(--border-width-thick) solid var(--color-primary-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.1);
    margin: 0 0 5px 0;
    position: relative;
    overflow: hidden;
}
.bank-nav-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, #8b4513, #d4af37, transparent);
}
.bank-nav-btn,
.bank-nav-btn-exit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(6px, 1.5vw, 6px) clamp(11px, 2vw, 4px);
    border: 1.5px solid transparent;
    border-radius: var(--radius-medium);
    font-weight: 600;
    text-decoration: none;
    font-size: clamp(0.65rem, 2vw, 0.85rem);
    transition: var(--transition-default);
    cursor: pointer;
    min-width: min-content;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-transform: uppercase;
    flex: 1;
    max-width: 120px;
}
.bank-nav-btn {
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #8b5a2b;
    color: #fff8e7 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
}
.bank-nav-btn-exit {
    background: linear-gradient(145deg, rgba(186, 4, 4, 0.92), rgba(237, 56, 1, 0.88));
    color: white;
    border-color: var(--color-primary-light);
    margin-left: auto;
}
.bank-nav-btn::before,
.bank-nav-btn-exit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    z-index: -1;
}
.bank-nav-btn:hover,
.bank-nav-btn-exit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 0 15px rgba(255, 215, 0, 0.15);
    text-decoration: none !important;
}
.bank-nav-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-gold);
    background: linear-gradient(145deg, rgb(241 127 10), rgb(255 231 206));
}
.bank-nav-btn-exit:hover {
    background: linear-gradient(145deg, rgb(255 15 15 / 92%), rgb(255 165 0 / 88%));
    border-color: #f38416;
    color: var(--color-gold);
}
.bank-nav-btn:hover::before,
.bank-nav-btn-exit:hover::before {
    left: 100%;
}
.bank-nav-btn-active {
    background: linear-gradient(145deg, rgb(241 127 10), rgb(129 59 10 / 90%));
    color: var(--color-gold) !important;
    border-color: #ffbf4b;
    box-shadow: 0 0 20px rgba(255, 191, 75, 0.4), inset 0 0 15px rgba(255, 215, 0, 0.2);
    position: relative;
    text-transform: uppercase;
}
.bank-nav-btn-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-gold), #d2691e, var(--color-gold), transparent);
    border-radius: 0 0 6px 6px;
}
.bank-nav-icon {
    margin-right: 8px;
    font-size: 1.1em;
    transition: transform 0.25s ease;
}
.bank-nav-btn:hover .bank-nav-icon {
    transform: scale(1.15);
}
.bank-nav-text {
    position: relative;
    z-index: 2;
}

/* === ЗАГОЛОВОК === */
.bank-header {
    background: linear-gradient(145deg, rgba(139, 69, 19, 0.92), rgba(160, 82, 45, 0.82), rgba(139, 69, 19, 0.92));
    border-radius: var(--radius-large);
    border: var(--border-width-medium) solid var(--color-primary);
    box-shadow: 0 4px 18px rgba(139, 69, 19, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.12);
    padding: 12px clamp(16px, 3vw, 24px);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.bank-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.25);
    margin-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.2;
}
.bank-subtitle {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: #ffebcd;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.bank-content {
    border-radius: var(--radius-large);
    padding: clamp(8px, 2.5vw, 12px);
    border: var(--border-width-medium) solid var(--color-primary-light);
    box-shadow: 0 5px 20px rgba(139, 69, 19, 0.15), inset 0 0 25px rgba(210, 180, 140, 0.08);
    position: relative;
    min-height: calc(100vh - 100px);
    background-attachment: fixed;
    margin: 0;
    background: radial-gradient(ellipse at 20% 20%, rgba(210, 180, 140, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 69, 19, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, #f5e6d3 0%, #e8d0a9 25%, #d4b78f 50%, #c19a6b 75%, #a0522d 100%);
}

/* === КНОПКИ (дополнительные) === */
.bank-button {
    padding: clamp(6px, 1.5vw, 8px) clamp(12px, 2.5vw, 14px);
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-medium);
    color: var(--color-secondary-light) !important;
    font-family: inherit;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-default);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-small);
    min-height: 44px;
}
.bank-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}
.bank-button:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium), 0 0 15px rgba(255, 215, 0, 0.15);
    color: var(--color-gold) !important;
}
.bank-button:hover::before {
    left: 100%;
}
.secondary-button {
    padding: 8px 16px;
    background: linear-gradient(to bottom, var(--color-secondary), #b99d7b);
    border: none;
    border-radius: 5px;
    color: var(--color-primary-dark);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}
.secondary-button:hover {
    background: linear-gradient(to bottom, #b99d7b, var(--color-primary-light));
    color: #fff;
    transform: translateY(-1px);
}

/* === КАРТОЧКИ === */
.bank-card,
.info-card-bank,
.stat-card {
    border-radius: var(--radius-large);
    border: var(--border-width-thin) solid var(--color-primary-light);
    box-shadow: 0 3px 15px rgba(139, 69, 19, 0.15);
    transition: var(--transition-fast);
}
.info-card-bank,
.stat-card {
    border-width: var(--border-width-medium);
    padding: clamp(16px, 2vw, 20px);
}
.bank-card {
    padding: clamp(14px, 2vw, 16px);
    margin-bottom: 16px;
}
.bank-card:hover,
.info-card-bank:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 22px rgba(139, 69, 19, 0.2), inset 0 0 0 0.5px rgba(255, 215, 0, 0.15);
}
.info-card-bank {
    position: relative;
    overflow: hidden;
}
.card-title-bank {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--color-primary-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === ТАБЛИЦЫ (bank) === */
.bank-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0;
    background: rgba(245, 230, 211, 0.25);
    border-radius: var(--radius-medium);
    overflow: hidden;
}
.bank-table tr:nth-child(even) {
    background: rgba(255, 248, 240, 0.4);
}
.bank-table tr:hover {
    background: rgba(210, 180, 140, 0.15);
    transform: translateX(3px);
    transition: var(--transition-fast);
}
.bank-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.15);
    vertical-align: middle;
    transition: var(--transition-fast);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
}
.bank-table td:first-child {
    font-weight: 600;
    color: var(--color-primary);
    width: 40%;
    white-space: nowrap;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.05);
    border-right: 1.5px solid rgba(139, 69, 19, 0.08);
}
.bank-table td:last-child {
    color: var(--color-primary-dark);
    font-weight: 500;
}

/* === ФОРМЫ === */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: 6px;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--color-secondary);
    border-radius: var(--radius-small);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    background: #f9f3e9;
    color: var(--color-primary-dark);
    transition: var(--transition-fast);
}
.form-input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(160, 82, 45, 0.1);
}
.form-input-disabled {
    background: #f0e6d6;
    color: var(--color-primary);
    cursor: not-allowed;
}

/* === ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ === */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
    margin: 16px 0;
}
.error-text {
    color: var(--color-danger);
    background: rgba(231, 76, 60, 0.08);
    padding: 8px;
    border-radius: var(--radius-small);
    border-left: 3px solid var(--color-danger);
    margin: 8px 0;
    font-size: 0.9rem;
}
.success-text {
    color: var(--color-success);
    background: rgba(39, 174, 96, 0.08);
    padding: 8px;
    border-radius: var(--radius-small);
    border-left: 3px solid var(--color-success);
    margin: 8px 0;
    font-size: 0.9rem;
}
.highlight {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.12), rgba(255, 140, 0, 0.08));
    border: 1.5px solid var(--color-gold);
}
.hover-glow:hover {
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.25);
}
.nav-icon {
    font-size: 1.1em;
    margin-right: 6px;
    vertical-align: middle;
}
.currency-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin: 0 2px;
}
.bank-blink {
    /* animation: bankBlink 4s linear infinite; */
}
.count-up {
    /* animation: countUp 0.4s ease-out; */
}
.interactive-value {
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 4px 8px;
    border-radius: 4px;
}
.interactive-value:hover {
    background: rgba(160, 82, 45, 0.08);
}
.small-label {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    display: block;
}

/* === БОНУСЫ === */
.bonus-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--color-primary);
    font-style: italic;
    background: rgba(245, 230, 211, 0.25);
    border-radius: var(--radius-medium);
    border: 1.5px dashed var(--color-secondary);
}
.bonus-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: rgba(139, 69, 19, 0.08);
    border-radius: var(--radius-small);
}
.bonus-stat-item { text-align: center; min-width: 85px; }
.bonus-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary-light);
}
.bonus-stat-label {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* === АДАПТИВНОСТЬ (частично, основное в phone.css) === */
@media (max-width: 1024px) {
    .money-row {
        display: grid;
    }
    .bank-buy-grid {
        grid-template-columns: 1fr;
    }
    .bank-container {
        padding: 5px;
        max-width: 89%;
    }
}
@media (max-width: 768px) {
    .bank-container {
        padding: 3px;
        max-width: 94%;
    }
    .bank-main-content {
        margin: 0 8px;
    }
    .bank-header {
        padding: 10px 12px;
    }
    .bank-content {
        padding: 8px;
        min-height: calc(100vh - 80px);
    }
    .bank-nav-container {
        flex-direction: column;
        gap: 8px;
    }
    .bank-nav-btn {
        width: 100%;
        max-width: none;
    }
    .bank-nav-btn-exit {
        margin-left: 0;
        order: 999;
    }
    .bank-bg {
        border-radius: 0;
    }
    .info-card-bank {
        padding: 14px;
    }
}
@media (max-width: 480px) {
    .bank-container {
        padding: 3px;
    }
    .bank-bg {
        border: 2px solid var(--color-border-dark);
    }
    .bank-npc-card {
        padding: 12px;
    }
    .bank-npc-image {
        max-width: 140px;
        max-height: 180px;
    }
    .bonus-items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .bonus-item-card {
        width: 65px;
        height: 65px;
    }
    .bonus-item-image {
        width: 55px;
        height: 55px;
    }
    .form-input {
        padding: 8px 10px;
    }
    .card-title-bank {
        font-size: 1rem;
    }
    .bank-table td {
        padding: 8px 10px;
    }
}

.w100{
    width: 100%;
}

/* ===== НОВЫЕ ПОРТАЛЬНЫЕ ДИАЛОГИ (Аукцион/Биржа) ===== */
.portal-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-modal {
    background: linear-gradient(145deg, #2a1e15, #1f150e);
    border: 2px solid #b8860b;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px #d4af37 inset;
    color: #f0e6d2;
    min-width: 300px;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.portal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #b8860b;
    padding-bottom: 10px;
}
.portal-modal-header h3 {
    margin: 0;
    color: #ffd966;
    font-weight: 700;
    font-size: 1.2rem;
}
.portal-modal-close {
    cursor: pointer;
    width: 30px; height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.portal-modal-close:hover { background: #b8860b; }
.portal-modal-close span:before,
.portal-modal-close span:after {
    content:'';
    position:absolute;
    width:16px; height:2px;
    background:#f0e6d2;
}
.portal-modal-close span:before { transform:rotate(45deg); }
.portal-modal-close span:after  { transform:rotate(-45deg); }

.portal-modal-body label { color: #ffd966; font-weight: 600; }
.portal-modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}
/* Эти классы уже есть, но продублируем для автономности */
.portal-btn {
    padding: 10px 25px;
    border-radius: 40px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.portal-btn-primary {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    color: #1f140c;
    border-color: #d4af37;
}
.portal-btn-primary:hover { background: linear-gradient(145deg, #8b5a2b, #b8860b); }
.portal-btn-secondary {
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border-color: #b8860b;
    color: #ffd966;
}
.portal-btn-secondary:hover { background: #b8860b; color:#1f140c; }

/* ===== Стилизованные кнопки +/− (из аукциона/магазина) ===== */
.quantity-control .qty-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #b8860b;
    border-radius: 50%;
    color: #ffd966;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    user-select: none;
    outline: none;
}

.quantity-control .qty-btn:hover:not(.left-disabled) {
    background: #b8860b;
    color: #1f140c;
    border-color: #ffd700;
}

.quantity-control .qty-btn.left-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Плавные переходы и общий контейнер */
.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== Портал-стиль ввода игровых денег ===== */
.money-input-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 30px;
    padding: 4px 12px;
    border: 1px solid #8b5a2b;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.money-field {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.money-input {
    width: 42px;
    padding: 6px 4px;
    text-align: center;
    background: transparent;
    border: none;
    color: #ffd966;
    font-weight: 700;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}

.money-input:focus {
    box-shadow: 0 0 0 1px #d4af37;
    border-radius: 6px;
}

.money-icon {
    height: 16px;
    vertical-align: middle;
    opacity: 0.9;
}

/* Контейнер всей панели суммы */
.money-summary {
    margin-top: 8px;
}

.money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.3);
}

.money-row:last-child {
    border-bottom: none;
}

.money-label {
    color: #ffd966;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 120px;
}

.money-value {
    color: #f0e6d2;
    font-weight: 500;
    text-align: right;
}

/* ===== Стилизация поля ввода количества (как в аукционе) ===== */
.styled-input.qty-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid #8b5a2b;
    border-radius: 30px;
    color: #fff;
    font-weight: 600;
    padding: 8px 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}
.styled-input.qty-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 8px gold;
}
.styled-input.qty-input::-webkit-inner-spin-button,
.styled-input.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==================== ТОСТЫ ==================== */
#game-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;               /* клики проходят сквозь пустую область */
    max-width: 400px;
    width: calc(100% - 40px);           /* на узких экранах не выходит за границы */
}

/* Анимация появления (добавлено) */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game-toast {
    background: rgba(26, 17, 12, 0.9);  /* чуть плотнее для читаемости */
    backdrop-filter: blur(10px);
    border: 2px solid #b8860b;
    border-radius: 12px;
    padding: 14px 44px 14px 16px;       /* увеличено для комфорта */
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 15px rgba(212,175,55,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 100%;
    color: #f5e6d3;
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(0);
    pointer-events: auto;
    animation: toastSlideIn 0.4s ease;
}

.game-toast.hiding {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;               /* чтобы нельзя было взаимодействовать во время исчезновения */
}

/* --- Иконка --- */
.game-toast .toast-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    line-height: 1;
}

/* --- Сообщение --- */
.game-toast .toast-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

/* --- Кнопка закрытия --- */
.game-toast .toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #f5e6d3;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.game-toast .toast-close:hover {
    background: #b8860b;
    color: #1f140c;
}

/* --- Цветовые типы с более выраженными тенями --- */
.game-toast.success {
    border-color: #27ae60;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 15px rgba(39,174,96,0.3);
}
.game-toast.success .toast-icon { color: #2ecc71; }

.game-toast.error {
    border-color: #e74c3c;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 15px rgba(231,76,60,0.3);
}
.game-toast.error .toast-icon { color: #e74c3c; }

.game-toast.info {
    border-color: #8b5a2b;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 15px rgba(139,90,43,0.2);
}
.game-toast.info .toast-icon { color: #ffd966; }

.game-toast.warning {
    border-color: #f39c12;
    box-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 15px rgba(243,156,18,0.3);
}
.game-toast.warning .toast-icon { color: #f39c12; }



.rank-icon, .titul-icon{
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    vertical-align: middle;
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    cursor: pointer;
    will-change: transform;
}

.rank-icon:hover, .titul-icon:hover {
    transform: scale(1.75);
    z-index: 5;
}


/* --- Адаптивность для мобильных --- */
@media (max-width: 480px) {
    #game-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;                /* растягиваем на всю ширину */
        align-items: stretch;           /* тосты заполняют контейнер */
    }
    .game-toast {
        min-width: auto;                /* убираем принудительную ширину */
        padding-right: 44px;            /* сохраняем место для кнопки */
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .money-input-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding: 4px 8px;
    }

    .money-input {
        width: 36px;
        font-size: 0.85rem;
        padding: 4px 2px;
    }

    .money-icon {
        height: 14px;
    }

    .money-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }

    .money-label {
        min-width: auto;
    }
}

