/* === ОБЩИЙ СБРОС И БАЗА === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1030 50%, #0f0f23 100%);
    background-attachment: fixed;
    color: #e0dde8;
    min-height: 100vh;
    padding: 16px;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/static/bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.06;
    pointer-events: none;
    z-index: -1;
}
.container { max-width: 1400px; margin: 0 auto; }

/* === ШАПКА === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(30, 20, 50, 0.7);
    backdrop-filter: blur(12px);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(140, 100, 200, 0.2);
    border-radius: 8px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { width: 36px; height: 36px; }
.logo h1 { font-size: 1.4rem; font-weight: 500; color: #d0c0e8; }
#userInfo { display: flex; align-items: center; gap: 10px; }
#loginBtn {
    background: #5865F2;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
}
#loginBtn::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    background-image: url('/static/discord.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}
#loginBtn:hover { background: #4752C4; }
#userPanel {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(40, 25, 60, 0.6);
    padding: 4px 10px 4px 14px;
    backdrop-filter: blur(8px);
    border-radius: 30px;
}
#userPanel img { width: 28px; height: 28px; border-radius: 50%; }
#userName { color: #d0c0e8; font-weight: 500; }
#userPanel button {
    background: rgba(160, 90, 110, 0.7);
    color: #e0dde8;
    border: none;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 20px;
}
#userPanel button:hover { background: rgba(180, 100, 120, 0.8); }

/* === НАВИГАЦИЯ === */
.main-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.nav-btn {
    background: rgba(40, 25, 60, 0.6);
    color: #e0dde8;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}
.nav-btn.active { background: rgba(120, 80, 180, 0.8); }
.nav-btn:hover { background: rgba(100, 70, 150, 0.7); }

/* === СЕКЦИИ === */
.section { display: none; }
.section.active { display: block; }

/* === КАРТОЧКИ И СЕТКИ === */
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chat-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card {
    background: rgba(25, 18, 40, 0.65);
    backdrop-filter: blur(12px);
    padding: 18px;
    border-radius: 12px;
    border-bottom: 1px solid rgba(120, 80, 180, 0.2);
}
.card h2 {
    color: #d0c0e8;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(120, 80, 180, 0.2);
}

/* === ФОРМЫ === */
input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 10px;
    background: rgba(20, 15, 35, 0.7);
    border: 1px solid rgba(140, 100, 200, 0.2);
    border-radius: 8px;
    color: #e0dde8;
    font-size: 0.9rem;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    background: rgba(30, 20, 50, 0.8);
    box-shadow: 0 0 0 2px rgba(140, 100, 200, 0.3);
    border-color: #a080d0;
}
input::placeholder, textarea::placeholder { color: rgba(200, 180, 220, 0.35); }

/* === ВСЕ КНОПКИ В СТИЛЕ TGUI (прямоугольные) === */
button,
input[type="submit"],
input[type="button"],
a.tgui-pagebutton,
.tab,
.nav-btn,
.post-action-btn,
.follow-btn,
.message-btn,
.social-links a,
#loginBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: rgba(40, 25, 60, 0.8);
    color: #e0dde8;
    border: 1px solid rgba(140, 100, 200, 0.25);
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background-color 0.15s ease, border-color 0.15s ease,
                transform 0.2s cubic-bezier(0.25, 0.1, 0.15, 1.25),
                box-shadow 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.tab:hover,
.nav-btn:hover,
.post-action-btn:hover,
.follow-btn:hover,
.message-btn:hover,
.social-links a:hover,
#loginBtn:hover {
    background-color: rgba(60, 40, 80, 0.85);
    border-color: #a080d0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(120, 80, 180, 0.4);
    transform: translateY(-2px);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active,
.tab:active,
.nav-btn:active,
.post-action-btn:active,
.follow-btn:active,
.message-btn:active,
.social-links a:active,
#loginBtn:active {
    background-color: rgba(80, 50, 110, 0.9);
    border-color: #c0a0e0;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(120, 80, 180, 0.4);
}

button:disabled,
input[type="submit"]:disabled,
input[type="button"]:disabled {
    background-color: rgba(30, 20, 45, 0.6);
    border-color: rgba(100, 80, 140, 0.2);
    color: #777;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Активные вкладки */
.tab.active,
.nav-btn.active {
    background-color: rgba(120, 80, 180, 0.8);
    border-color: #a080d0;
    color: #fff;
}

/* === КНОПКИ СОЦСЕТЕЙ (цвета) === */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}
.social-links a { min-width: 120px; }
.social-links a.website,
a.tgui-pagebutton.website { background-color: #ff6b6b; border-color: #ff6b6b; }
.social-links a.website:hover,
a.tgui-pagebutton.website:hover { background-color: #e05555; border-color: #e05555; box-shadow: 0 4px 12px rgba(255,107,107,0.4); }
.social-links a.discord,
a.tgui-pagebutton.discord { background-color: #5865F2; border-color: #5865F2; }
.social-links a.discord:hover,
a.tgui-pagebutton.discord:hover { background-color: #4752C4; border-color: #4752C4; box-shadow: 0 4px 12px rgba(88,101,242,0.4); }
.social-links a.telegram,
a.tgui-pagebutton.telegram { background-color: #27A7E7; border-color: #27A7E7; }
.social-links a.telegram:hover,
a.tgui-pagebutton.telegram:hover { background-color: #1d8ec9; border-color: #1d8ec9; box-shadow: 0 4px 12px rgba(39,167,231,0.4); }
.social-links a.wiki,
a.tgui-pagebutton.wiki { background-color: #4CAF50; border-color: #4CAF50; }
.social-links a.wiki:hover,
a.tgui-pagebutton.wiki:hover { background-color: #388E3C; border-color: #388E3C; box-shadow: 0 4px 12px rgba(76,175,80,0.4); }
.social-links a.boosty,
a.tgui-pagebutton.boosty { background-color: #F15A29; border-color: #F15A29; }
.social-links a.boosty:hover,
a.tgui-pagebutton.boosty:hover { background-color: #d14a1f; border-color: #d14a1f; box-shadow: 0 4px 12px rgba(241,90,41,0.4); }
.social-links a.github,
a.tgui-pagebutton.github { background-color: #24292e; border-color: #24292e; }
.social-links a.github:hover,
a.tgui-pagebutton.github:hover { background-color: #1a1f23; border-color: #1a1f23; box-shadow: 0 4px 12px rgba(36,41,46,0.4); }

/* Кнопка ОСЩ (Blueshield) */
.follow-btn,
button.follow-btn {
    background-color: #5865F2;
    border-color: #5865F2;
    color: #fff;
}
.follow-btn:hover,
button.follow-btn:hover {
    background-color: #4752C4;
    border-color: #4752C4;
}
.follow-btn.unfollow {
    background-color: rgba(160, 90, 110, 0.8);
    border-color: rgba(180, 110, 130, 0.5);
}

/* Кнопка лайка */
.post-action-btn.liked { color: #e06080; border-color: #e06080; background-color: rgba(224, 96, 128, 0.15); }

/* === РЕЗУЛЬТАТЫ И УВЕДОМЛЕНИЯ === */
.result {
    margin-top: 14px;
    padding: 12px;
    background: rgba(20, 15, 35, 0.5);
    border-radius: 8px;
    border-left: 3px solid #a080d0;
}
.error { color: #e08090; font-weight: 500; }
.success { color: #80c090; font-weight: 500; }

/* === ТОП ИГРОКОВ === */
.top-player {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 3px;
    background: rgba(30, 20, 50, 0.4);
    border-radius: 6px;
}
.top-player:nth-child(1) { border-left: 3px solid #c0a0e0; }
.top-player:nth-child(2) { border-left: 3px solid #a090b0; }
.top-player:nth-child(3) { border-left: 3px solid #b08090; }

/* === СТАТИСТИКА === */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.stat-item { background: rgba(30, 20, 50, 0.5); padding: 14px 8px; text-align: center; border-radius: 8px; }
.stat-value { font-size: 1.6rem; font-weight: 500; color: #c4b5e0; }
.stat-label { color: rgba(200, 180, 220, 0.6); font-size: 0.75rem; text-transform: uppercase; }
#myBalance { font-size: 1.8rem; font-weight: 500; text-align: center; padding: 14px; background: rgba(30, 20, 50, 0.5); border-radius: 12px; }
#myBalance strong { color: #c4b5e0; }

/* === ИКОНКИ МОНЕТ === */
.coin-icon-text { width: 14px; height: 14px; display: inline-block; vertical-align: middle; margin: 0 2px; }
.coin-icon-header { width: 22px; height: 22px; display: inline-block; vertical-align: middle; margin-right: 5px; }
.coin-icon-result { width: 16px; height: 16px; display: inline-block; vertical-align: middle; margin: 0 2px; }

/* === СЛОТ-МАШИНА === */
.slot-machine { display: flex; justify-content: center; gap: 8px; padding: 15px; background: rgba(20, 15, 35, 0.7); border-radius: 12px; margin-bottom: 12px; }
.slot-reel { width: 70px; height: 70px; background: rgba(30, 20, 50, 0.8); display: flex; align-items: center; justify-content: center; border: 2px solid rgba(140, 100, 200, 0.3); border-radius: 8px; }
.slot-reel img { width: 50px; height: 50px; object-fit: contain; }
.slot-spinning { animation: slotSpin 0.1s infinite; }
@keyframes slotSpin { 0% { transform: translateY(0); } 100% { transform: translateY(-5px); } }

/* === ЧАТ === */
.chat-messages { max-height: 300px; overflow-y: auto; margin-bottom: 12px; padding: 8px; background: rgba(20, 15, 35, 0.5); border-radius: 8px; }
.chat-message { display: flex; gap: 10px; padding: 8px; border-bottom: 1px solid rgba(120, 80, 180, 0.1); }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; }
.chat-content { flex: 1; }
.chat-username { color: #a080d0; font-weight: 500; margin-bottom: 2px; }
.chat-text { color: #e0dde8; word-break: break-word; }
.chat-time { color: rgba(200, 180, 220, 0.5); font-size: 0.7rem; margin-top: 2px; }
.chat-input-area { display: flex; gap: 8px; }
.chat-input-area textarea { flex: 1; resize: none; height: 40px; }

/* === ПОСТЫ === */
.post { background: rgba(25, 18, 40, 0.7); border-radius: 12px; padding: 16px; margin-bottom: 16px; border: 1px solid rgba(120, 80, 180, 0.2); }
.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.post-author-info { flex: 1; }
.post-author-name { font-weight: 600; color: #d0c0e8; }
.post-author-nick { font-size: 0.8rem; color: rgba(200, 180, 220, 0.7); }
.post-time { font-size: 0.7rem; color: rgba(200, 180, 220, 0.5); }
.post-content { margin-bottom: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.post-image { max-width: 100%; max-height: 400px; border-radius: 8px; margin-bottom: 12px; }
.post-actions { display: flex; gap: 20px; margin-top: 8px; }
.comments-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(120, 80, 180, 0.2); }
.comment { display: flex; gap: 10px; padding: 8px 0; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; }
.comment-content { flex: 1; background: rgba(20, 15, 35, 0.5); padding: 8px 12px; border-radius: 12px; }
.comment-author { font-weight: 500; color: #a080d0; margin-bottom: 4px; }
.comment-text { color: #e0dde8; }
.create-post-card { margin-bottom: 20px; }
.post-form textarea { min-height: 80px; }
.image-upload-label { display: inline-block; background: rgba(100, 70, 150, 0.7); padding: 8px 16px; border-radius: 8px; cursor: pointer; margin-right: 10px; }
#postImage { display: none; }
.image-preview { max-width: 200px; max-height: 200px; margin: 10px 0; }
.image-preview img { max-width: 100%; border-radius: 8px; }

/* === ПРОФИЛЬ === */
.profile-header { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; border: 3px solid #a080d0; }
.profile-info { flex: 1; }
.profile-name { font-size: 2rem; margin-bottom: 8px; color: #d0c0e8; }
.profile-stats { display: flex; gap: 20px; margin: 16px 0; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.5rem; font-weight: 600; color: #c4b5e0; }
.profile-stat-label { color: rgba(200, 180, 220, 0.7); }
.profile-bio { background: rgba(25, 18, 40, 0.7); padding: 16px; border-radius: 12px; margin-bottom: 24px; }

/* === ПОИСК === */
.search-results { display: grid; gap: 8px; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: rgba(30, 20, 50, 0.5); border-radius: 8px; }
.search-avatar { width: 48px; height: 48px; border-radius: 50%; }

/* === СТАТУС СЕРВЕРА === */
.server-info { text-align: center; margin-bottom: 2rem; }
.server-info .description { font-size: 1rem; line-height: 1.6; color: #ccc; background: rgba(255, 255, 255, 0.05); padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; }
.server-status-card { background: rgba(25, 18, 40, 0.8); backdrop-filter: blur(12px); padding: 16px 20px; border-radius: 12px; margin-bottom: 16px; border: 1px solid rgba(120, 80, 180, 0.2); }
.server-status-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1rem; font-weight: 500; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #666; }
.status-dot.online { background: #4CAF50; box-shadow: 0 0 8px #4CAF50; }
.server-players { font-size: 0.9rem; color: #ccc; margin-bottom: 6px; }
.progress-bar-bg { width: 100%; height: 10px; background: rgba(255, 255, 255, 0.1); border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #4CAF50, #8BC34A); border-radius: 5px; transition: width 0.5s ease; width: 0%; }
.server-info-row { display: flex; gap: 20px; font-size: 0.8rem; color: #aaa; }

/* === БАНЫ === */
.ban-card { transition: background 0.2s; }
.ban-card:hover { background: rgba(35, 25, 55, 0.8) !important; }

/* === ДИАГРАММА === */
.playtime-chart { max-width: 350px; margin: 20px auto; text-align: center; background: rgba(25, 18, 40, 0.7); border-radius: 12px; padding: 16px; }
.playtime-chart h3 { color: #d0c0e8; margin-bottom: 12px; }

/* === ЭКОНОМИКА === */
.economy-tabs { display: flex; gap: 4px; margin-bottom: 16px; }

/* === АДАПТИВ === */
@media (max-width: 1000px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .bottom-row { grid-template-columns: 1fr; }
    .header { flex-direction: column; gap: 10px; }
    .stats-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
}

/* === СКРОЛЛБАР === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(30, 20, 50, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(120, 80, 180, 0.5); }

.chart-tab {
    padding: 6px 14px;
    border: 1px solid #444;
    background: #2a2a3e;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.chart-tab:hover {
    background: #3a3a5e;
    color: #fff;
}

.chart-tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

#dayPicker {
    padding: 6px 10px;
    border: 1px solid #444;
    background: #2a2a3e;
    color: #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

#dayPicker:focus {
    outline: none;
    border-color: #3498db;
}

.chart-tab {
    padding: 8px 16px;
    border: 1px solid #555;
    background: #2a2a3e;
    color: #aaa;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.chart-tab:hover {
    background: #3a3a5e;
    color: #fff;
}

.chart-tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

#dayPicker {
    padding: 6px 10px;
    border: 1px solid #555;
    background: #2a2a3e;
    color: #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

#onlineChart {
    width: 100% !important;
    max-width: 100%;
    height: 350px !important;
    max-height: 350px;
    background: rgba(20, 20, 35, 0.5);
    border-radius: 8px;
    margin-top: 15px;
}

.card {
    overflow: hidden;
}