:root {
    --primary-color: #f24941;
    --primary-hover-color: #d93a34;
    --admin-role-color: #e74c3c;
    --judge-role-color: #3498db; 
    --president-role-color: #f1c40f; 
    --dark-bg: #131316;
    --light-bg: #1e1e24;
    --border-color: #303038;
    --text-color: #e5e5e5;
    --text-muted-color: #8c8c9a;
    --font-family: 'Montserrat', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 12px;
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-bg);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--primary-color); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* === HEADER === */
.main-header {
    background: rgba(30, 30, 36, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    position: relative; 
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img { height: 28px; margin-right: 10px; }
.nav-wrapper { display: flex; align-items: center; }
.main-nav {
    display: flex;
    gap: 30px;
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
}

.nav-link {
    color: var(--text-muted-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.nav-link.active, .nav-link:hover { color: white; }
.auth-section { display: flex; align-items: center; gap: 20px; }

.user-info { display: flex; align-items: center; cursor: pointer; position: relative; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary-color); margin-left: 10px; }
.dropdown-menu { display: none; position: absolute; top: 55px; right: 0; background: var(--light-bg); border-radius: var(--border-radius); overflow: hidden; min-width: 200px; border: 1px solid var(--border-color); box-shadow: 0 8px 25px rgba(0,0,0,0.3); z-index: 1001;}
.dropdown-item { display: flex; align-items: center; padding: 12px 15px; color: var(--text-color); text-decoration: none; transition: background-color 0.2s ease; }
.dropdown-item i { margin-right: 10px; }
.dropdown-item:hover, .dropdown-item.active { background-color: var(--primary-color); }

.mobile-nav-toggle {
    display: none; 
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* === HERO & LANDING === */
.hero-section, .server-info-section { position: relative; overflow: hidden; padding: 60px 0; }
.hero-background { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19, 19, 22, 0.8) 0%, var(--dark-bg) 100%); z-index: -1; }
.server-info-section .hero-background { background: var(--dark-bg); }
.hero-landing { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-bottom: 80px; box-sizing: border-box; }
.hero-landing .hero-title { font-size: 72px; font-weight: 800; margin: 0 0 15px 0; }
.hero-landing .hero-subtitle { font-size: 22px; margin-bottom: 40px; }
.hero-landing .hero-main-button { margin-top: 0; margin-bottom: 0; }
.scroll-down-arrow { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); font-size: 28px; color: rgba(255, 255, 255, 0.3); animation: bounce 2s infinite; transition: color 0.3s ease; z-index: 10; }
.scroll-down-arrow:hover { color: rgba(255, 255, 255, 0.7); }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(-10px); } 60% { transform: translateX(-50%) translateY(-5px); } }

/* === SERVER INFO === */
.server-info-section { padding-top: 80px; padding-bottom: 80px; }
.server-info-section .container { max-width: 1000px; position: relative; z-index: 2; }
.section-title { text-align: center; font-size: 36px; font-weight: 700; margin-bottom: 40px; color: var(--text-color); }
.server-info-section .hero-details-wrapper { margin-bottom: 60px; }
.server-info-section .hero-description { font-size: 18px; color: var(--text-muted-color); max-width: 700px; margin: 0 auto 50px auto; text-align: center; }
.server-info-section .hero-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; max-width: 1000px; margin: 0 auto; }
.server-info-section .feature-item { background: var(--dark-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 25px; text-align: center; transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease; }
.server-info-section .feature-item:hover { transform: translateY(-5px); border-color: var(--primary-color); }
.server-info-section .feature-icon { font-size: 36px; color: var(--primary-color); margin-bottom: 15px; display: inline-block; }
.server-info-section .feature-item h3 { font-size: 20px; font-weight: 600; color: var(--text-color); margin: 0 0 10px 0; }
.server-info-section .feature-item p { font-size: 14px; color: var(--text-muted-color); margin: 0; line-height: 1.5; }
.server-info-section .hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; margin-bottom: 60px; }
.server-info-section .stat { text-align: center; }
.server-info-section .stat-number { font-size: 32px; font-weight: 700; margin-bottom: 5px; word-break: break-all; }
.server-info-section .stat-number.ip-address { font-size: 18px; font-weight: 500; font-family: 'Courier New', Courier, monospace; color: var(--text-muted-color); cursor: pointer; transition: color 0.2s ease; }
.server-info-section .stat-number.ip-address:hover { color: var(--text-color); }
.server-info-section .stat-label { color: var(--text-muted-color); font-size: 14px; }

/* === RULES SECTION === */
.rules-section { padding: 60px 0; position: relative; z-index: 2; }
.rules-content { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px 40px; max-width: 900px; margin: 0 auto; counter-reset: rules-counter; }
.rules-content h1 { text-align: center; margin-top: 0; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.rules-content h2 { font-size: 24px; margin-top: 40px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); color: var(--primary-color); }
.rules-content h3 { font-size: 20px; margin-top: 30px; margin-bottom: 10px; color: var(--text-color); }
.rules-content p { margin-bottom: 15px; color: var(--text-muted-color); }
.rules-content p strong { color: var(--text-color); }
.rules-list { list-style: none; padding-left: 0; margin-left: 0; margin-bottom: 15px; color: var(--text-muted-color); }
.rules-list > li { counter-increment: rules-counter; margin-bottom: 10px; position: relative; padding-left: 35px; }
.rules-list > li::before { content: counter(rules-counter) "."; position: absolute; left: 0; top: 0; font-weight: 600; color: var(--primary-color); min-width: 25px; text-align: right; padding-right: 10px; }
.rules-start-11 { counter-reset: rules-counter 10; }
.rules-start-21 { counter-reset: rules-counter 20; }
.rules-start-31 { counter-reset: rules-counter 30; }
.rules-start-41 { counter-reset: rules-counter 40; }
.rules-list ul { list-style: disc; margin-left: 20px; padding-left: 20px; margin-top: 10px; margin-bottom: 10px; }
.rules-list ul li::before { content: ""; padding-right: 0; min-width: 0; }
.rules-list ul li { padding-left: 0; counter-increment: none; }
.rules-content table { width: 100%; margin: 20px 0; border-collapse: collapse; background-color: var(--dark-bg); }
.rules-content th, .rules-content td { border: 1px solid var(--border-color); padding: 10px 15px; text-align: left; }
.rules-content th { background-color: var(--light-bg); color: var(--text-color); font-weight: 600; }
.rules-content td { color: var(--text-muted-color); }
.rule-forbidden { color: #e74c3c; }
.rule-allowed { color: #2ecc71; }
.rules-important { background-color: rgba(241, 196, 15, 0.1); border-left: 3px solid var(--president-role-color); padding: 15px; margin: 20px 0; border-radius: 4px; color: var(--text-color); }

/* === UI ELEMENTS === */
.btn { padding: 12px 25px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover-color); transform: translateY(-3px); }
.btn-large { padding: 15px 35px; font-size: 18px; }
.btn-secondary { background-color: var(--light-bg); color: var(--text-muted-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: #2a2a30; color: white; }
.btn-danger { background-color: var(--admin-role-color); color: white; }
.btn-danger:hover { background-color: #c0392b; }
.btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: none; justify-content: center; align-items: center; z-index: 2000; padding: 20px;}
.modal-content { background: var(--light-bg); padding: 30px; border-radius: var(--border-radius); border: 1px solid var(--border-color); width: 100%; max-width: 500px; position: relative; box-sizing: border-box; }
.close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; color: var(--text-muted-color); font-size: 24px; cursor: pointer; z-index: 2001; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; text-align: left; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; background: var(--dark-bg); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-color); box-sizing: border-box; font-size: 16px; font-family: var(--font-family); }
.form-group textarea { resize: none; }
.error-message { color: #e74c3c; text-align: center; margin-top: 15px; min-height: 1em; }
input[type="file"] { position: relative; overflow: hidden; display: inline-block; vertical-align: middle; width: auto; padding: 0; border: none; background: none; font-size: 14px; color: var(--text-muted-color); }
input[type="file"]::file-selector-button { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-color); cursor: pointer; font-weight: 600; transition: all 0.3s ease; background-color: var(--light-bg); color: var(--text-muted-color); font-family: var(--font-family); margin-right: 15px; font-size: 14px; }
input[type="file"]::file-selector-button:hover { background-color: #2a2a30; color: white; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* === DASHBOARD LAYOUT === */
.dashboard-section { padding: 40px 0; }
.dashboard-content { display: flex; gap: 30px; align-items: flex-start; }
.dashboard-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 100px; }
.dashboard-nav { background: var(--light-bg); border-radius: var(--border-radius); padding: 10px; border: 1px solid var(--border-color); }
.nav-item { display: flex; align-items: center; padding: 15px; border-radius: 8px; font-weight: 500; cursor: pointer; color: var(--text-muted-color); transition: all 0.2s ease; text-decoration: none; }
.nav-item i { margin-right: 15px; width: 20px; text-align: center; }
.nav-item:hover { background: #2a2a30; color: white; }
.nav-item.active { background: var(--primary-color); color: white; }
.nav-item.disabled { color: #555; cursor: not-allowed; }
.dashboard-main { flex-grow: 1; min-width: 0; }
.dashboard-page { display: none; }
.dashboard-page.active { display: block; }

/* === PROFILE STYLES === */
.profile-card { 
    background: var(--light-bg); 
    border-radius: var(--border-radius); 
    border: 1px solid var(--border-color); 
    padding: 30px; 
    width: 100%; 
    box-sizing: border-box; 
    min-height: 400px; /* Фикс: чтобы не прыгало при загрузке */
    display: flex;
    flex-direction: column;
}
.page-card { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; width: 100%; box-sizing: border-box; }

.profile-header { text-align: center; }
.profile-avatar-large { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--primary-color); }
.profile-username { font-size: 28px; font-weight: 700; margin-top: 10px; margin-bottom: 8px; word-break: break-word; }

/* Роли и Статус */
.roles-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.role-badge { padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; text-transform: uppercase; }
.role-badge.player { background-color: rgba(255, 255, 255, 0.1); color: var(--text-muted-color); }
.role-badge.admin { background-color: rgba(231, 76, 60, 0.2); color: var(--admin-role-color); }
.role-badge.judge { background-color: rgba(52, 152, 219, 0.2); color: var(--judge-role-color); }
.role-badge.president { background-color: rgba(241, 196, 15, 0.2); color: var(--president-role-color); }

.profile-status-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; font-size: 14px; padding: 4px 12px; border-radius: 20px; transition: all 0.3s ease; }
.profile-status-badge.online { color: #2ecc71; background-color: rgba(46, 204, 113, 0.15); }
.profile-status-badge.offline { color: #95a5a6; background-color: rgba(149, 165, 166, 0.15); }
.profile-status-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background-color: currentColor; margin-right: 5px;}

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: left; margin-top: 30px; border-top: 1px solid var(--border-color); padding-top: 30px; }
.stat-item { background: var(--dark-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 20px; display: flex; align-items: center; gap: 15px; transition: all 0.3s ease; min-width: 0; }
.stat-item:hover { transform: translateY(-5px); border-color: var(--primary-color); box-shadow: 0 5px 15px rgba(0, 168, 107, 0.1); }
.stat-icon { font-size: 24px; color: var(--primary-color); }
.stat-info { min-width: 0; }
.stat-info h3 { margin: 0; font-size: 22px; color: white; overflow-wrap: break-word; word-break: normal; }
.stat-info p { margin: 5px 0 0; color: var(--text-muted-color); font-size: 14px; }

/* === PLAYERS & FRIENDS LISTS (ИСПРАВЛЕНО) === */
.player-status { font-size: 12px; font-weight: 500; }
.player-status.online { color: #2ecc71; }
.player-status.offline { color: #95a5a6; }

.players-page-card { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; width: 100%; box-sizing: border-box; }
.search-bar-container { position: relative; margin-bottom: 20px; }
.search-bar-container .fa-search { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: var(--text-muted-color); }
#player-search-input { width: 100%; padding: 12px 12px 12px 40px; background: var(--dark-bg); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-color); box-sizing: border-box; font-size: 16px; }

.players-list, .friends-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }

/* ИСПРАВЛЕНО: Используем Grid для стабильного расположения 3-х элементов: Аватар, Инфо, Кнопки */
.player-item, .friend-item { 
    display: grid;
    grid-template-columns: auto 1fr auto; /* Аватар (auto), Инфо (растяг), Кнопки (auto) */
    align-items: center; 
    gap: 15px; 
    background: var(--dark-bg); 
    padding: 15px; 
    border-radius: var(--border-radius); 
    border: 1px solid var(--border-color); 
    text-decoration: none; 
    transition: all 0.2s ease; 
    cursor: pointer; 
}

.player-item:hover, .friend-item:hover { transform: translateY(-3px); border-color: var(--primary-color); }

.player-avatar, .friend-avatar { width: 50px; height: 50px; border-radius: 50%; }

.player-info, .friend-info { 
    display: flex; 
    flex-direction: column; 
    gap: 2px; 
    min-width: 0; /* Важно для обрезки текста */
}

.player-name, .friend-name { 
    font-size: 16px; 
    font-weight: 600; 
    color: var(--text-color); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; /* Троеточие если длинный ник */
}

.no-players { text-align: center; color: var(--text-muted-color); padding: 40px 20px; grid-column: 1 / -1; }

.profile-friend-actions .btn { padding: 10px 20px; font-size: 14px; }

.friends-card { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; width: 100%; box-sizing: border-box; }
.friends-card h2 { border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }

.friends-list { margin-bottom: 30px; }

/* Кнопки действий в списке друзей */
.friend-actions { display: flex; gap: 8px; }
.friend-actions .btn { padding: 6px 12px; font-size: 12px; }

.no-friends-placeholder { color: var(--text-muted-color); padding: 20px 0; }

/* Мини-список друзей в профиле */
.profile-friends-card { 
    /* ИСПРАВЛЕНО: Делаем фон прозрачным или убираем его, чтобы блок был серым как вся карточка */
    background: transparent; 
    border-radius: var(--border-radius); 
    padding: 20px 0 0 0; /* Убираем лишние отступы и фон */
    margin-top: 20px; 
    border: none;
    border-top: 1px solid var(--border-color); /* Только линия сверху */
    min-height: 90px; 
    display: flex;
    flex-direction: column;
}
.profile-friends-card.hidden { display: none; }

.profile-friends-card h3 { margin-top: 0; padding-bottom: 10px; margin-bottom: 20px; text-align: left; border: none; }
.profile-friends-minimal-list { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-friends-minimal-list .friend-avatar-link { display: block; position: relative; transition: transform 0.2s ease; }
.profile-friends-minimal-list .friend-avatar-link:hover { transform: scale(1.1); z-index: 10; }
.profile-friends-minimal-list .friend-avatar-small { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--border-color); }

.back-button { display: inline-block; margin-bottom: 20px; color: var(--text-muted-color); text-decoration: none; font-weight: 500; transition: color 0.2s ease; }
.back-button:hover { color: var(--text-color); }
.back-button i { margin-right: 8px; }

/* === NOTIFICATIONS === */
.notification-bell { position: relative; color: var(--text-muted-color); font-size: 20px; cursor: pointer; transition: color 0.2s ease; }
.notification-bell:hover { color: var(--text-color); }
.notification-count { position: absolute; top: -5px; right: -8px; background-color: var(--admin-role-color); color: white; font-size: 10px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid var(--dark-bg); }
.notification-dropdown { display: none; position: absolute; top: 55px; right: 0; background: var(--light-bg); border-radius: var(--border-radius); width: 450px; border: 1px solid var(--border-color); box-shadow: 0 8px 25px rgba(0,0,0,0.3); z-index: 1001; overflow: hidden; }
.notification-header { padding: 15px; font-weight: 600; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.notification-list { max-height: 400px; overflow-y: auto; }
.notification-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 15px; align-items: flex-start; padding: 15px; border-bottom: 1px solid var(--border-color); }
.notification-item:last-child { border-bottom: none; }
.notification-item .friend-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 0; flex-shrink: 0; }
.notification-icon-container { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background-color: rgba(255, 255, 255, 0.05); font-size: 18px; color: var(--text-muted-color); flex-shrink: 0; }
.court-notification .notification-icon-container { color: var(--judge-role-color); background-color: rgba(52, 152, 219, 0.1); }
.notification-info { min-width: 0; flex: 1; overflow: hidden; }
.notification-text { font-size: 14px; line-height: 1.4; word-break: break-word; white-space: normal; overflow-wrap: break-word; }
.notification-text strong { color: var(--primary-color); }
.notification-text em { font-style: italic; color: var(--text-muted-color); opacity: 0.8; }
.notification-timer { font-size: 12px; color: var(--text-muted-color); margin-top: 4px; white-space: nowrap; }

/* Кнопки в уведомлениях */
.notification-actions-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.notification-actions-row .btn { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn-action-link { display: inline-block; width: auto; padding: 5px 15px; font-size: 12px; margin-top: 8px; }

.notification-empty { padding: 40px 15px; text-align: center; color: var(--text-muted-color); }

/* === LOADERS & UTILS === */
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--dark-bg); display: flex; justify-content: center; align-items: center; z-index: 9999; opacity: 1; transition: opacity 0.3s ease; pointer-events: auto; }
.preloader.preloader-hidden { opacity: 0; pointer-events: none; }
.preloader-spinner { width: 40px; height: 40px; border: 4px solid var(--border-color); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.is-loading .dashboard-content, body.is-loading .hero-section, body.is-loading .server-info-section, body.is-loading .rules-section { visibility: hidden; opacity: 0; }
body.is-loaded .dashboard-content, body.is-loaded .hero-section, body.is-loaded .server-info-section, body.is-loaded .rules-section { visibility: visible; opacity: 1; transition: opacity 0.3s ease; }
.hidden { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.dropdown-menu.is-active, .notification-dropdown.is-active { display: block; }
.w-100 { width: 100%; }
.notification-header-count { color: var(--text-muted-color); font-weight: 500; }
.spinner-centered { margin: 50px auto; }
.mt-20 { margin-top: 20px; }
.mt-15 { margin-top: 15px; }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after { content: ''; position: absolute; width: 16px; height: 16px; top: 50%; left: 50%; margin-left: -8px; margin-top: -8px; border: 2px solid transparent; border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; }
.btn-loading i.fa-spinner { color: white; animation: spin 1s linear infinite; }

/* === BANK, EXCHANGE, ETC (Остальные стили без изменений) === */
.bank-page-card { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; text-align: center; width: 100%; box-sizing: border-box; }
#create-card-btn { margin-top: 20px; }
.bank-page-content { display: flex; flex-direction: column; gap: 30px; }
.bank-top-section { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.balance-card { background: var(--light-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 30px; text-align: center; height: 100%; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; }
.balance-label { font-size: 16px; color: var(--text-muted-color); margin-bottom: 10px; }
.balance-amount { font-size: 54px; font-weight: 700; color: white; word-break: break-all; }
.history-card { background: var(--light-bg); border-radius: var(--border-radius); border: 1px solid var(--border-color); padding: 30px; width: 100%; box-sizing: border-box; }
.transaction-history-list { margin-top: 20px; max-height: 500px; overflow-y: auto; padding-right: 10px; }
.transaction-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border-color); }
.transaction-item:last-child { border-bottom: none; }
.transaction-details { display: flex; align-items: center; gap: 15px; }
.transaction-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.transaction-icon.deposit { background-color: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.transaction-icon.withdraw, .transaction-icon.transfer-out { background-color: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.transaction-icon.transfer-in { background-color: rgba(52, 152, 219, 0.15); color: #3498db; }
.transaction-title { font-weight: 500; }
.transaction-date { font-size: 12px; color: var(--text-muted-color); }
.transaction-amount { font-weight: 700; font-size: 18px; text-align: right; }
.transaction-amount.positive { color: #2ecc71; }
.transaction-amount.negative { color: #e74c3c; }
.no-transactions { text-align: center; color: var(--text-muted-color); padding: 40px 20px; }
.credit-card { width: 100%; max-width: 400px; aspect-ratio: 1.58; margin: 0 auto; border-radius: 15px; background: linear-gradient(45deg, #111111 0%, #1e1e24 100%); color: white; padding: 25px; box-sizing: border-box; position: relative; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); font-family: 'Courier New', Courier, monospace; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.card-logo { font-weight: 700; font-size: 20px; font-family: var(--font-family); display: flex; align-items: center; gap: 10px; }
.logo-img-small { height: 24px; margin-right: 8px; }
.card-chip { display: none; }
.card-number { font-size: 22px; letter-spacing: 3px; text-align: center; word-break: keep-all; white-space: nowrap; cursor: pointer; user-select: none; }
.card-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.card-owner-label { display: none; }
.card-owner-name { font-size: 16px; color: var(--text-muted-color); }
.balance-amount .currency-symbol { font-size: 0.7em; vertical-align: middle; }
.card-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.card-subtitle { font-size: 12px; font-weight: 400; color: var(--text-muted-color); font-family: var(--font-family); }
.card-currency { font-size: 20px; font-weight: 700; color: var(--text-color); font-family: var(--font-family); }
.card-brand { font-size: 22px; font-weight: 700; color: var(--text-color); }

/* === MEDIA QUERIES (Mobile Optimization) === */
@media (max-width: 992px) {
    /* ... (остальное без изменений) ... */
    .container {
        padding: 0 15px; /* Чуть меньше отступы по краям для большего места */
        width: 100%;
        max-width: 100vw; /* Жесткое ограничение ширины */
        overflow-x: hidden; /* Скрываем возможный вылет за границы */
    }
    
    .auth-section { 
        position: static; 
        transform: none; 
        margin-left: auto; 
    }

    .main-nav { 
        position: static; 
        transform: none; 
        margin: 0 auto; 
    }

    .main-header .container { 
        justify-content: flex-start; 
    }

    .nav-wrapper { 
        flex-grow: 1; 
    }

    .bank-top-section { 
        grid-template-columns: 1fr; 
    }

    .balance-amount { 
        font-size: 42px; /* Чуть меньше шрифт, чтобы не ломало */
    }

    .notification-dropdown { 
        width: 90vw; 
        max-width: 380px;
        right: -50px; /* Корректировка положения на малых экранах */
    }

    /* --- Фикс Layout Dashboard (Проблема пустого места) --- */
    .dashboard-content { 
        display: flex;
        flex-direction: column;
        align-items: stretch; /* ВАЖНО: Растягивает элементы на всю ширину */
        gap: 20px;
    }

    .dashboard-sidebar { 
        width: 100%; 
        position: static; 
    }

    .dashboard-main {
        width: 100%;
        min-width: 0; /* Разрешает сжиматься flex-дочерним элементам */
    }

    /* Фикс ширины всех карточек */
    .friends-card, 
    .players-page-card, 
    .page-card, 
    .profile-card, 
    .bank-page-card, 
    .history-card,
    .dashboard-nav { 
        width: 100%; 
        box-sizing: border-box; 
        padding: 20px 15px; /* Чуть меньше padding внутри карточек */
    }

    .hero-landing .container { 
        width: 100%; 
        padding: 0 20px; 
        box-sizing: border-box; 
    }

    /* --- Фикс Биржи (Проблема растягивания) --- */
    .exchange-terminal {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
        width: 100%;
        max-width: 100%; /* Критично для предотвращения растягивания */
        gap: 15px;
    }

    .terminal-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
        width: 100%;
        box-sizing: border-box;
    }

    .total-assets-info { 
        text-align: left; 
    }

    .total-assets-value { 
        font-size: 24px; 
    }

    /* Самый главный фикс графика */
    .chart-panel {
        width: 100%;
        max-width: 100%; /* Не дает графику распирать контейнер */
        height: 350px; 
        min-height: 350px;
        overflow: hidden; /* Обрезает всё, что вылезает */
        position: relative;
    }

    #exchange-chart-container {
        width: 100% !important; /* Принудительная ширина */
        height: 100%;
        min-height: 350px;
        overflow: hidden;
    }

    .trade-panel {
        width: 100%;
        box-sizing: border-box;
    }

    .trade-tabs {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    /* ... (остальное без изменений) ... */
    .container { 
        padding: 0 15px; 
        width: 100%;
    }
    
    /* --- Хедер и Логотип --- */
    .main-header .container { 
        flex-wrap: wrap; 
        justify-content: space-between; 
        position: relative;
    }

    .logo { 
        flex-grow: 0; 
        margin-right: 0; 
        z-index: 1002; /* Поверх открытого меню */
    }

    .mobile-nav-toggle { 
        display: block; 
        margin-left: auto; 
        z-index: 1002; /* Поверх открытого меню */
    }

    /* --- ГЛАВНОЕ МОБИЛЬНОЕ МЕНЮ --- */
    .nav-wrapper { 
        display: none; 
        flex-direction: column; 
        position: fixed; /* Фиксируем меню */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* На всю высоту экрана */
        background: var(--dark-bg); 
        padding: 80px 20px 40px 20px; /* Отступ сверху для хедера */
        box-sizing: border-box;
        overflow-y: auto; /* Прокрутка ВНУТРИ меню */
        z-index: 1001;
    }

    .nav-wrapper.active { 
        display: flex; 
    }

    .main-nav { 
        position: static; 
        transform: none; 
        flex-direction: column; 
        text-align: center; 
        gap: 20px; 
        width: 100%; 
        margin: 0 0 30px 0; 
    }

    .main-nav .nav-link {
        font-size: 18px; /* Шрифт покрупнее для пальцев */
        display: block;
        padding: 10px;
    }

    .auth-section { 
        flex-direction: column; 
        gap: 25px; 
        width: 100%; 
        position: static; 
        transform: none; 
        padding-right: 0; 
        margin-left: 0; 
        align-items: center;
    }

    /* --- ИСПРАВЛЕНИЕ ПРОФИЛЯ (Аккордеон) --- */
    #user-info {
        flex-direction: column;
        width: 100%;
    }

    #user-info img.user-avatar {
        width: 60px;
        height: 60px;
        margin: 10px auto;
    }

    #user-info span#user-name {
        font-size: 18px;
        font-weight: 600;
    }

    /* Меню профиля теперь встраивается в поток, а не висит поверх */
    #user-info .dropdown-menu { 
        position: static; /* Статичное позиционирование */
        transform: none; 
        width: 100%;
        margin-top: 15px;
        background: rgba(255, 255, 255, 0.05); /* Выделяем фон */
        border: none;
        box-shadow: none;
        display: none;
    }

    #user-info .dropdown-menu.is-active {
        display: block;
        animation: fadeIn 0.3s ease; /* Плавное появление */
    }
    
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

    /* --- ИСПРАВЛЕНИЕ УВЕДОМЛЕНИЙ (Центрирование) --- */
    .notification-dropdown { 
        position: fixed !important; /* Жестко фиксируем */
        top: 80px !important; /* Отступ от верха */
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important; /* Центрируем по горизонтали */
        width: 92vw !important; /* 92% ширины экрана */
        max-width: 400px;
        max-height: 70vh; /* Чтобы не уходило за низ экрана */
        overflow-y: auto;
        z-index: 2005; /* Самый высокий слой */
        box-shadow: 0 10px 100px rgba(0,0,0,0.7); /* Глубокая тень */
        border: 1px solid var(--border-color);
    }
    
    /* --- ДЭШБОРД И ПРОЧЕЕ (Сохраняем предыдущие фиксы) --- */
    .dashboard-section { padding: 20px 0; }

    .dashboard-nav { 
        display: grid;
        grid-template-columns: 1fr 1fr; 
        gap: 8px;
        padding: 10px; 
    }

    .nav-item { 
        flex-direction: column; 
        padding: 12px; 
        text-align: center; 
        width: 100%; 
        box-sizing: border-box; 
        font-size: 13px;
    }
    
    .nav-item i {
        margin-right: 0;
        margin-bottom: 8px;
        font-size: 20px;
    }
    
    .profile-stats { grid-template-columns: 1fr; } 
    .players-list, .friends-list { grid-template-columns: 1fr; }
    
    .credit-card { 
        width: 100%; 
        max-width: 100%; 
        padding: 20px; 
        height: auto;
        min-height: 200px;
    }

    .card-number { 
        font-size: 18px; 
        margin: 20px 0;
    }
}