/* Общие настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: radial-gradient(circle, rgba(36, 11, 54, 1) 0%, rgba(10, 5, 18, 1) 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1400px;
    /* Немного увеличил, чтобы влезло три колонки */
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Шапка */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.logo-area {
    display: flex;
    align-items: flex-end;
    font-weight: 800;
    font-size: 32px;
    color: #fff;
    text-transform: uppercase;
    text-decoration: none;
}

.logo-svg {
    width: 55px;
    filter: drop-shadow(0 0 12px rgba(142, 68, 173, 0.8));
    transition: 0.3s;
}

.logo-area:hover .logo-svg {
    filter: drop-shadow(0 0 15px rgba(142, 68, 173, 1));
}

nav {
    display: flex;
    gap: 40px;
}

nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    transition: 0.3s;
}

nav a:hover {
    color: #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #8e44ad;
}

.steam-login {
    font-weight: 700;
    padding: 10px 25px;
    border: 2px solid #8e44ad;
    border-radius: 30px;
    color: #8e44ad;
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.3s;
}

.steam-login:hover {
    background: #8e44ad;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.7);
}

.layout-wrapper {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.content-left {
    flex: 2.5;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-right {
    flex: 1;
    position: sticky;
    top: 20px;
}

.card {
    background: rgba(20, 10, 35, 0.6);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 20px;
    padding: 30px;
    transition: 0.3s;
}

.card:hover {
    background: rgba(21, 10, 38, 0.65);
    border-color: rgba(142, 68, 173, 0.4);
}

.card h2 {
    margin-bottom: 25px;
    font-size: 22px;
    color: #fff;
    text-align: center;
}

.hero-banner img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(142, 68, 173, 0.3);
}

/* Ряд под баннером (Сервера и Лидеры) */
.bottom-row {
    display: flex;
    gap: 20px;
    flex: 1;
}

.bottom-row .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Список серверов */
.server-list {
    display: flex;
    flex-direction: column;
}

.server-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(142, 68, 173, 0.1);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: 0.3s;
}

.server-row:hover {
    background: rgba(142, 68, 173, 0.1);
    border-color: rgba(142, 68, 173, 0.4);
}

.server-info.name {
    font-weight: 700;
    flex: 2;
}

.server-info.score,
.server-info.players {
    flex: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(142, 68, 173, 0.15);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 12px;
    transition: 0.3s;
}

.lb-row:hover {
    background: rgba(142, 68, 173, 0.1);
    border-color: rgba(142, 68, 173, 0.4);
}

.lb-rank {
    font-size: 18px;
    font-weight: 800;
    color: #8e44ad;
    width: 35px;
}

.lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-stats {
    text-align: right;
    line-height: 1.2;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid rgba(142, 68, 173, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lb-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: background 0.3s ease;
}

.lb-table tr:last-child td {
    border-bottom: none;
}

.lb-table tr:hover td {
    background: rgba(142, 68, 173, 0.1);
}

/* Медали для Топ-3 */
.rank-1 { color: #FFD700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); font-weight: 800; font-size: 20px; }
.rank-2 { color: #C0C0C0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.5); font-weight: 800; font-size: 20px; }
.rank-3 { color: #CD7F32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.5); font-weight: 800; font-size: 20px; }
.rank-default { color: rgba(255, 255, 255, 0.3); font-weight: 700; }

.join-btn {
    border: 1px solid #fff;
    color: #fff;
    padding: 5px 15px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
}

.join-btn:hover {
    background: #fff;
    color: #111;
}

/* --- СТИЛИ ЧАТА --- */
.chat-card {
    height: 800px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #8e44ad;
    border-radius: 10px;
}

.chat-msg-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(142, 68, 173, 0.3);
}

.chat-name {
    font-size: 11px;
    font-weight: 700;
    color: #8e44ad;
    display: block;
}

.chat-text {
    font-size: 13px;
    color: #eee;
    word-break: break-word;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

.chat-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
}

.chat-input-wrapper button {
    background: #8e44ad;
    border: none;
    color: #fff;
    border-radius: 5px;
    padding: 5px 12px;
    cursor: pointer;
}

/* Заглушки и лоадер */
.placeholder-line {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    border-radius: 3px;
}

.w-100 {
    width: 100%;
}

.w-70 {
    width: 70%;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(142, 68, 173, 0.1);
    border-top: 3px solid #8e44ad;
    border-radius: 50%;
    animation: spin 1s linear infinite;

}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 120px;
}

/* --- Стили для профиля игрока --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(20, 10, 35, 0.8);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: 0.3s;
}

.stat-card:hover {
    background: rgba(21, 10, 38, 0.65);
    border-color: rgba(142, 68, 173, 0.4);
}

.stat-title {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
}

.sortable {
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.sortable:hover {
    color: #8e44ad !important;
}

.sort-icon {
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.7;
    display: inline-block;
    width: 10px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/*на мобилках всё в одну колонку */
@media (max-width: 1000px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .bottom-row {
        flex-direction: column;
    }

    .content-right {
        position: static;
        width: 100%;
    }
}