/* Общие стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Запрещаем прокрутку всей страницы */
html, body {
    height: 100%;
    overflow: hidden;
}

/* Фон страницы – градиент с текстурой (CS:GO стиль) */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
	background: linear-gradient(135deg, #0a0f1e 0%, #1a2a4f 100%);
}

/* Контейнер – вертикальная flex-колонка на всю высоту */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Заголовки не сжимаются */
h1, .hint {
    flex-shrink: 0;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #4fc3f7;
    font-size: 2.2rem;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
    border: 1px solid #444;
    border-radius: 8px;
    background-color: rgba(38, 39, 49, 0.75);
}

.hint {
    text-align: center;
    margin-bottom: 15px;
    color: #eeecec;
    font-style: italic;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: rgba(38, 39, 49, 0.75);
    padding: 5px;
}

/* Обёртка таблицы – именно она прокручивается */
.table-wrapper {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge */
	border-radius: 8px;
}
.table-wrapper::-webkit-scrollbar {
    display: none;                /* Chrome/Safari/Opera */
}

/* Сама таблица – обычная, без display: block */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a2332;
    border-radius: 8px;
    table-layout: auto;          /* колонки сами определяют ширину */
}

/* Заголовки приклеиваются */
.ranking-table thead tr th {
    position: sticky;
    top: 0;
    background: #2c3e50;
    z-index: 10;
}

/* Ячейки */
.ranking-table td {
    padding: 0px 8px;
    vertical-align: middle;
    text-align: center;
	height: 44px;
	border-bottom: 1px solid #2d3d50;
    color: #eeecec;
}

/* Выравнивание текста в некоторых колонках */
.ranking-table td:nth-child(2) {  /* Никнейм */
    text-align: left;
}

.ranking-table td:nth-child(3) { /* Звание и очки */
    text-align: left;
	width: 150px;
}

.ranking-table td:nth-child(7) { /* Любимое оружие */
    width: 300px;
}

/* Шапка */
.ranking-table th {
    font-weight: bold;
    color: #64b5f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    border-bottom: 2px solid #444;
	height: 44px;
}

/* Подсветка призовых мест */
.gold-row {
    background-color: #ffd700;
    border-left: 5px solid #b8860b;
}
.silver-row {
    background-color: #c0c0c0;
    border-left: 5px solid #8a9597;
}
.bronze-row {
    background-color: #cd7f32;
    border-left: 5px solid #ac6116;
}
.gold-row td,
.silver-row td,
.bronze-row td {
    color: #080808;
}

/* Фон под ником — только для призовых мест */
.gold-row .nickname-bg,
.silver-row .nickname-bg,
.bronze-row .nickname-bg {
    background: rgba(0, 0, 0, 0.6); /* Полупрозрачный чёрный фон */
    padding: 0px 8px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Стили для цвета ника по команде */
.team-tr {
    color: #ff6b6b;
}

.team-ct {
    color: #4dabf7;
}

.team-neutral {
    color: #eeecec;
}

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

/* Медали */
.medal-emoji {
    font-size: 1.5em;
    vertical-align: middle;
	text-shadow: 1px 1px 5px black;
}

/* Стили для аватарки */
.avatar {
    width: 32px; /* или любой размер, который тебе нравится */
    vertical-align: middle;
    margin-right: 4px; /* отступ справа от аватарки */
    object-fit: cover; /* чтобы аватарка не искажалась */
    border: 1px solid #444; /* опционально: рамка */
}

/* Флаги */
.flag {
    width: 20px;
    height: 14px;
    vertical-align: middle;
    margin-right: 10px;
    object-fit: cover;
    object-position: center;
}

/* Иконка ранга */
.rank-icon {
    height: 26px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
}

/* Блок любимого оружия */
.weapon-pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}
.weapon-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.weapon-icon {
    max-height: 30px;
    width: auto;
    border-radius: 4px;
    border: 1px solid #444;
    background-color: #f2f2f2;
    object-fit: contain;
}
.weapon-kills {
    white-space: nowrap;
}
.spacer {
    flex-grow: 1;
}

/* Модальное окно (ранги) */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}
.modal-content {
    background-color: #1a2332;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    position: relative;
    color: #eeecec;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: #2c3e50;
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: #64b5f6;
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #4fc3f7;
}
.close {
    float: right;
    font-size: 32px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}
.close:hover {
    color: #fff;
}
.rank-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.rank-table th {
    background: #2c3e50;
    padding: 4px;
    text-align: center;
    font-weight: bold;
    color: #64b5f6;
    border-bottom: 2px solid #444;
}
.rank-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #2d3d50;
    vertical-align: middle;
}
.rank-table td:nth-child(1) {
    text-align: center;
}
.rank-table tr:nth-child(even) {
    background-color: #222f42;
}
.rank-icon-large {
    width: auto;
    height: 26px;
    vertical-align: middle;
}

/* Ссылка в подсказке */
.hint a {
    color: #64b5f6;
    text-decoration: none;
}
.hint a:hover {
    color: #4fc3f7;
    text-decoration: underline;
    cursor: pointer;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .ranking-table th,
    .ranking-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    .flag {
        width: 24px;
        height: 20px;
        margin-right: 5px;
    }
    .rank-icon {
        height: 20px;
        margin-right: 5px;
    }
    .weapon-icon {
        max-height: 24px;
    }
    .weapon-kills {
        font-size: 0.7rem;
    }
    h1 {
        font-size: 1.4rem;
    }
}