/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: rgb(19, 21, 29);
    color: white;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.8;
}

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

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    color: #ffcf78;
    margin-bottom: 15px;
}

/* Шапка */
header {
    padding: 20px 0 10px; /* Изменен padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
    height: 40px;
}

.header-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Иконки соцсетей */
.social-icons {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.social-icon {
    width: 30px;
    height: 30px;
    background-color: rgba(128 0 255);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s;
}

.btn-login {
    background: linear-gradient(45deg, #8fdb01, #00b2e1);
    box-shadow: 0 0 10px rgba(0, 168, 107, 0.5);
    animation: shimmer-green 2s infinite;
    background-size: 200% 200%;
}

.btn-register {
    background: linear-gradient(45deg, #ff8a00, #ff5722);
    box-shadow: 0 0 10px rgba(255, 138, 0, 0.5);
    animation: shimmer-orange 2s infinite;
    background-size: 200% 200%;
}

.btn-mirror {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-play {
    background: linear-gradient(45deg, #00a86b, #009688);
    box-shadow: 0 0 10px rgba(0, 168, 107, 0.5);
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 5px;
}

.btn-demo {
    background: linear-gradient(45deg, #ff8a00, #ff5722);
    box-shadow: 0 0 10px rgba(255, 138, 0, 0.5);
    padding: 8px 16px;
    font-size: 14px;
}

@keyframes shimmer-green {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer-orange {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === НОВОЕ: Стили для главной навигации === */
.main-navigation {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    margin-top: 15px; 
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
    background-color: orange;
    color: rgb(19, 21, 29);
    opacity: 1; 
}

/* Основной контент (Главная страница) */
.hero {
    padding: 30px 0;
    text-align: center;
}

.hero-buttons {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.promo-code {
    margin: 20px auto;
    max-width: 400px;
    padding: 15px;
    background-color: rgb(157 0 255 / 20%);
    border: 1px dashed #a500ff;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
}

.promo-code:hover {
    background-color: rgba(157 0 255 / 62%);
}

.promo-title {
    display: block;
    color: #ffe50a;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.promo-code-text {
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 18px;
}

.promo-code-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.promo-code-tooltip.show {
    opacity: 1;
}

/* Слайдер (Главная страница) */
.slider {
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 300px;
}

.slider-container {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider-dot.active {
    background-color: white;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.slider-arrow-left {
    left: 20px;
}

.slider-arrow-right {
    right: 20px;
}

/* Блок с игровыми картинками (Главная страница) */
.games-grid {
    margin: 40px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 20px;
}

.game-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.game-item:hover .game-overlay {
    opacity: 1;
}

.game-item:hover .game-image {
    transform: scale(1.05);
}

.game-title {
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.game-buttons {
    display: flex;
    gap: 10px;
}

/* Текстовый контент (Главная и внутренние) */
.content {
    padding: 40px 0;
    line-height: 1.8;
}

/* === НОВОЕ: Стили для контента внутренних страниц === */
.internal-page-content {
    padding: 40px 0;
    line-height: 1.8;
}

.internal-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px auto; /* Центрирование */
    display: block;
    max-height: 400px; 
    object-fit: cover;
    background-color: #333; /* Фон-заглушка */
}

.internal-page-content p {
    margin-bottom: 15px;
}

/* Футер */
footer {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-logo {
    height: 40px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* === НОВОЕ: Стили для легальных ссылок в футере === */
.footer-legal-links {
    display: flex;
    flex-direction: column; /* Вертикально */
    align-items: center; /* По центру */
    gap: 10px; 
    margin-top: 20px; 
}

.footer-legal-links a {
    color: white;
    opacity: 0.7; 
    font-size: 14px;
    text-decoration: none;
}

.footer-legal-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.copyright {
    margin-top: 20px;
    opacity: 0.7;
    font-size: 14px;
}

/* === НОВОЕ: Стили для Оглавления (TOC) === */
#table-of-contents {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.toc-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
    cursor: pointer;
    color: orange; /* Стиль заголовка */
    position: relative;
    padding-right: 25px;
}

.toc-title:after {
    content: "▼";
    position: absolute;
    right: 5px;
    top: 5px; /* Скорректировано */
    font-size: 0.7em;
    transition: transform 0.3s;
    color: white; /* Цвет стрелки */
}

.toc-title[data-state="closed"]:after {
    transform: rotate(-90deg);
}

.toc-content.hidden {
    display: none;
}

.toc ol {
    margin: 0;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    text-decoration: none;
    color: #FFF; /* Белый цвет для ссылок */
    font-style: italic;
}

.toc a:hover {
    text-decoration: underline;
    color: orange;
}

.level-2 {
    margin-left: 20px;
}

.level-3 {
    margin-left: 40px;
}

/* === Стили для Бургера === */
.burger-menu {
    display: none; /* Скрыт на десктопе */
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20;
    margin-left: 15px; /* Отступ от кнопок */
}

.burger-menu span {
    width: 28px;
    height: 3px;
    background-color: white;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    transform-origin: center; /* Добавлено для корректной анимации X */
}

/* Анимация бургера в "X" */
.burger-menu.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-menu.is-open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px); /* Плавное исчезание */
}
.burger-menu.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 800px) {
    .header-content {
        /* ПЕРЕОПРЕДЕЛЯЕМ оригинальные стили */
        flex-direction: row; /* Лого слева, кнопки/бургер справа */
        justify-content: space-between;
        align-items: center;
        gap: 10px; /* Уменьшим gap */
        flex-wrap: nowrap; /* Запретим перенос */
    }
    
    .header-buttons {
        margin-top: 0; /* Убираем отступ */
        flex-shrink: 0; /* Не даем кнопкам сжиматься */
        display: flex; /* Добавлено для .btn */
        align-items: center; /* Добавлено для .btn */
    }

    /* Уменьшаем кнопки в шапке на мобилке */
    .header-buttons .btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Скрываем соц. иконки на мобилке, чтобы освободить место */
    .social-icons {
        display: none;
    }

    /* Показываем бургер */
    .burger-menu {
        display: flex;
    }
    
    /* Скрываем навигацию по умолчанию на мобилке */
    .main-navigation {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 10px;
        
        /* Анимация скрытия/показа */
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        padding-top: 0;
        margin-top: 10px;
        background-color: rgb(19, 21, 29); /* Фон, если меню "выпадает" */
        transition: max-height 0.4s ease-out, visibility 0.4s ease-out, padding-top 0.4s ease-out;
    }
    
    /* Класс .is-open, который добавит JS */
    .main-navigation.is-open {
        max-height: 500px; /* Достаточная высота для 6 ссылок */
        visibility: visible;
        padding-top: 15px; /* Возвращаем отступ при открытии */
        border-top: 1px solid rgba(255, 255, 255, 0.1); /* Разделитель */
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }
    
    /* --- (Остальные стили из вашего @media) --- */
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .slider {
        height: 200px;
        margin-top: 30px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-links {
        gap: 15px;
        text-align: center;
    }
    
    .footer-social {
        flex-wrap: wrap;
        justify-content: center;
    }
}