/* Общие стили и темная тема в стиле CS2 */
:root {
    --bg-dark: #0d0e12;
    --card-bg: #161920;
    --accent-orange: #de9b35;
    --accent-blue: #235ecf;
    --text-light: #f5f5f7;
    --text-gray: #9a9da4;
}

/* Разрешаем прокрутку, но полностью скрываем сам скроллбар */
html {
    scroll-behavior: smooth;
    /* Убираем полосы прокрутки в IE и Edge */
    -ms-overflow-style: none;  
    /* Убираем полосы прокрутки в Firefox */
    scrollbar-width: none;  
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* overflow-y: scroll позволяет JS двигать страницу, но скроллбар не покажется */
    overflow-y: scroll; 
}

/* Скрываем скроллбар в браузерах на движке WebKit (Chrome, Safari, Opera, Brave, новый Edge) */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    background: transparent; /* На всякий случай делаем фон прозрачным */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

/* --- ЗАСТАВКА (HERO SECTION) --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle, rgba(22,25,32,0.4) 0%, rgba(13,14,18,1) 100%),
                url('https://images.unsplash.com/photo-1542751371-adc38448a05e?q=80&w=1920') no-repeat center center/cover;
    padding: 20px;
}

/* Эффект оранжево-синего свечения CS2 */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(222, 155, 53, 0.1) 0%, rgba(35, 94, 207, 0.1) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(222, 155, 53, 0.3);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Слайд должен занимать всю высоту экрана */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; /* Плавное перетекание */
    z-index: 1;
}

.hero-slide.active {
    opacity: 1; /* Только активный слайд становится видимым */
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.ts-btn {
    color: #ffffff;
    background: linear-gradient(135deg, #2a4d7c 0%, #1c355e 100%);
    border: 2px solid #315b91;
    box-shadow: 0 0 15px rgba(49, 91, 145, 0.4);
}

.ts-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #37639e 0%, #224173 100%);
    border-color: #00f5ff;
    box-shadow: 0 0 25px rgba(0, 245, 255, 0.6);
}

.ts-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

/* Анимация динамика */
.ts-btn:hover .ts-icon {
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}

/* Кнопка скролла */
.scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Отступ внутри для иконки, если она есть */
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 50px; /* Скругление 50px делает бока идеально полукруглыми при любом размере */
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 50px; /* Фиксируем одинаковую высоту для обеих кнопок */
}

#toTeamsBtn {
    color: #0d1117;
    background: linear-gradient(135deg, #ffe082 0%, #ffb300 50%, #ff8f00 100%);
    border: 2px solid #ffb300;
    box-shadow: 0 0 15px rgba(255, 179, 0, 0.3);
}

#toTeamsBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(255, 179, 0, 0.6);
    background: linear-gradient(135deg, #fff2cc 0%, #ffc107 50%, #ffa000 100%);
}

#toTeamsBtn:active {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(255, 179, 0, 0.4);
}

.scroll-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(222, 155, 53, 0.6);
}

/* --- РАЗДЕЛ С КОМАНДАМИ --- */
.main-content {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent-orange);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Сетка команд */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Карточка команды */
.team-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    background-color: #1c202a;
    border-color: rgba(222, 155, 53, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.team-card:hover::before {
    opacity: 1;
}

.team-logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Контейнер для логотипа (блок, в котором лежит картинка) */
.team-logo {
    width: 100px;        /* Жесткая ширина круга (поменяйте под свой дизайн) */
    height: 100px;       /* Жесткая высота (должна быть равна ширине) */
    border-radius: 50%;  /* Делаем сам контейнер идеальным кругом */
    overflow: hidden;    /* Всё, что выходит за пределы круга, будет скрыто */
    
    /* Дополнительно: можно добавить красивую рамку или тень */
    border: 3px solid rgba(255, 255, 255, 0.2); 
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    
    /* Для центрирования контейнера, если нужно */
    margin: 0 auto; 
}

/* Стили для самой картинки <img> внутри контейнера */
.team-logo img {
    width: 100%;         /* Растягиваем картинку на 100% ширины контейнера */
    height: 100%;        /* Растягиваем картинку на 100% высоты контейнера */
    
    /* Самое главное свойство! */
    object-fit: cover;   /* Растягивает фото, заполняя круг, сохраняя пропорции */
    
    object-position: center; /* Центрирует изображение внутри круга */
    display: block;      /* Убирает лишние отступы снизу */
}

.team-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fff;
}

.click-hint {
    font-size: 0.8rem;
    color: var(--accent-orange);
    margin-top: 15px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- МОДАЛЬНОЕ ОКНО --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(7, 8, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid rgba(222, 155, 53, 0.2);
    border-radius: 12px;
    max-width: 900px; /* Окно остается просторным */
    width: 100%;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--accent-orange);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.modal-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.modal-title-container h2 {
    font-size: 2rem;
    color: #fff;
}

.modal-body h3 {
    font-size: 1.1rem;
    color: var(--accent-orange);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.modal-description {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Стили состава команды */
.roster-list {
    list-style: none;
    display: grid;
    /* Увеличили минимальную ширину плитки до 240px, чтобы текст помещался свободно */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 15px;
}

/* Плитка игрока */
.roster-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px 12px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 95px; /* Задаем красивую высоту плитки */
    transition: all 0.2s ease;
}

.roster-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Стили для контейнера с ФИО игрока */
.player-full-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #9a9da4; /* Имя и фамилия будут аккуратного серого цвета */
    line-height: 1.4;
}

.player-full-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #9a9da4;
    line-height: 1.4;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis; /* Если имя окажется экстремально длинным, оно аккуратно сократится с троеточием */
    white-space: nowrap; /* СТРОГО запрещаем перенос имени на новую строку */
}

/* Стиль конкретно для никнейма — строго белый и жирный */
.player-full-name .player-nickname {
    color: #ffffff !important;
    font-weight: 800;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.15);
    display: inline;
}

/* Базовый стиль роли игрока */
.player-role {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 10px; /* Делаем аккуратный отступ от имени */
}

/* Цвета ролей (не зависят от цвета ника) */
.role-captain {
    color: #ffd700 !important;
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.05);
}

.role-awp {
    color: #ff4500 !important;
    border: 1px solid rgba(255, 69, 0, 0.2);
    background: rgba(255, 69, 0, 0.05);
}

.role-rifler {
    color: #23cf5f !important;
    border: 1px solid rgba(35, 207, 95, 0.2);
    background: rgba(35, 207, 95, 0.05);
}

.role-entry {
    color: #cd7f32 !important;
    border: 1px solid rgba(205, 127, 50, 0.4);
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.15);
}

.role-support {
    color: #238ecf !important;
    border: 1px solid rgba(35, 142, 207, 0.2);
    background: rgba(35, 142, 207, 0.05);
}

.role-coach {
    color: #9b35de !important;
    border: 1px solid rgba(155, 53, 222, 0.2);
    background: rgba(155, 53, 222, 0.05);
}

.role-lurker {
    background-color: rgba(0, 201, 167, 0.12);
    color: #00c9a7;
    border: 1px solid rgba(0, 201, 167, 0.4);
    box-shadow: 0 0 8px rgba(0, 201, 167, 0.15);
}

.role-default {
    color: #9a9da4 !important;
    border: 1px solid rgba(154, 157, 164, 0.2);
}

/* Контейнер для отображения ролей игрока в списке */
.player-roles-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* --- СТИЛИ ДЛЯ ЗАПАСНЫХ ИГРОКОВ --- */
.substitute-item {
    background: rgba(255, 255, 255, 0.015); /* Чуть темнее основного состава */
    border: 1px dashed rgba(154, 157, 164, 0.2); /* Пунктирная рамка подчеркивает статус запаса */
    opacity: 0.75; /* Легкая прозрачность в обычном состоянии */
    transition: all 0.25s ease;
}

.substitute-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-orange); /* При наведении подсвечивается оранжевым */
    opacity: 1; /* Становится ярким */
    transform: translateY(-2px); /* Легкое всплытие */
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .modal-content { padding: 25px; }
    .modal-header { flex-direction: column; text-align: center; }
}
