/* ======================== Общие стили ======================== */
body {
    font-family: 'Tektur', sans-serif;
    margin: 0;
    background-color: #1f1f1f;
}

.header .btn,
.header a {
    font-family: 'Tektur', sans-serif;
}

/* ======================== Хедер ======================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* логотип слева, кнопки и меню справа */
    padding: 15px 30px;
    background: transparent;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    transition: background 0.3s ease;
    z-index: 1000;
}

.header.scrolled {
    background: #171717;
}

/* -------- Левая часть хедера -------- */
.header-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px; /* расстояние между иконкой и названием */
    margin-left: 90px;
}

.logo-icon {
    width: 60px;
    height: 60px;
}

.logo-text {
    width: 250px;
    height: 60px;
}

/* -------- Кнопки навигации -------- */
.nav-links .btn {
    background: transparent;
    color: white;
    border: none;
    min-width: 160px;
    height: 45px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-left: 12px;
    text-decoration: none;
    transition: color 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

.btn:hover {
    color: #bdbdbd;
}

.btn:hover .btn-icon,
.btn:hover .btn-shop,
.btn:hover .btn-help,
.btn:hover .btn-gl {
    filter: brightness(0.7);
    opacity: 0.8;
}

/* -------- Правая часть хедера -------- */
.header-right {
    display: flex;
    align-items: center;
    margin-right: 90px;
}
.header-right2 {
    display: flex;
    align-items: center;
    margin-right: 90px;
}
/* ======================== Кнопки ======================== */
.btn {
    background: transparent;
    color: white;
    border: none;
    min-width: 140px;
    height: 45px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    color: #bdbdbd;
}

.btn:hover .btn-icon {
    filter: brightness(70%);
    opacity: 0.8;
}

.btn-icon {
    width: 25px;
    height: 25px;
    fill: white;
}

.btn-gl {
    width: 25px;
    height: 22px;
}

.btn-shop {
    width: 30px;
    height: 20px;
}

.btn-help {
    width: 35px;
    height: 16px;
}

/* ======================== Выпадающее меню ======================== */
.auth-dropdown {
    margin-right: 90px;
    position: relative;
}

.auth-menu {
    display: none;
    position: absolute;
    top: 85px;
    right: 150px;
    width: 260px;
    background-color: rgba(63, 63, 63, 0.9);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 100;
}

.auth-menu.auth-logged {
    width: 180px;
    padding: 15px;
}

/* -------- Форма логина -------- */
.login-form {
    display: flex;
    flex-direction: column;
}

.login-form input {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.register-text {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #ccc;
}

.register-text a {
    color: #ff9800;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.register-text a:hover {
    color: #ffa733;
}

/* ======================== Профиль ======================== */
#profile-buttons {
    display: none;
    gap: 8px;
}

#profile-btn {
    position: relative;
    min-width: 160px;
    justify-content: flex-start;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#profile-btn .alt-text {
    display: none;
}

#profile-btn .username {
    display: inline;
}

#profile-btn:hover .username {
    display: none;
}

#profile-btn:hover .alt-text {
    display: inline;
    color: #bdbdbd;
}

#logout-btn {
    min-width: 45px;
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#logout-btn .btn-icon {
    width: 25px;
    height: 25px;
    color: red;
}


/* ---- Окно регистрации ---- */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0; /* top/right/bottom/left = 0 */
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

/* окно */
.modal-content {
  position: relative;
  width: 420px;
  max-width: 100%;
  background: #1f1f1f;
  padding: 26px;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  transform: translateY(-8px);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* закрывашка */
.close-btn {
  position: absolute;
  right: 14px;
  top: 10px;
  background: transparent;
  border: none;
  color: #bbb;
  font-size: 22px;
  cursor: pointer;
}
.close-btn:hover { color: #fff; }

/* ошибки формы */
.form-error {
  background: rgba(255,80,80,0.08);
  color: #ffb3b3;
  border: 1px solid rgba(255,80,80,0.15);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}

/* input-group */
.input-group { position: relative; margin: 10px 0; }
.input-group input {
  width: 100%;      /* растягивается на ширину контейнера */
  max-width: 100%;  /* чтобы не выходило за контейнер */
  padding: 10px 12px 10px 44px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #2b2b2b;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box; /* важно, чтобы padding учитывался в ширине */
}
.input-group input:focus { outline: none; border-color: #898989; }

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #cfcfcf;
  opacity: 0.9;
}
/* Центрируем заголовок модального окна */
#register-modal .modal-content h2 {
    text-align: center;
    margin-top: 0;       /* убираем лишний отступ сверху */
    margin-bottom: 20px; /* отступ снизу для формы */
    font-size: 24px;     /* при необходимости подкорректировать */
    font-weight: 700;
}
/* checkbox */
.checkbox-group {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: #ccc;
  font-size: 13px;
}
.checkbox-group a { color: #ff9800; text-decoration: none; font-weight: 600; }
.checkbox-group a:hover { text-decoration: underline; }

/* кнопка */
.modal-content .btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ff9800;
  color: #111;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.modal-content .btn:hover { background: #ffa733; }
/* Модал для правил — боковая панель справа */
.rules-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(200%); /* изначально спрятана справа */
    width: 400px;
    max-width: 90%;
    height: 90%;
    background: #1f1f1f;
    border-radius: 12px 0 0 12px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    padding: 26px;
    overflow-y: auto;
    color: #fff;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    z-index: 2100;
}
.rules-content {
    max-height: calc(100% - 60px);
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 10px;

    font-size: 12px; /* размер шрифта */
    line-height: 1; /* межстрочный интервал */
    color: #fff; /* цвет текста */
}

/* Панель открыта */
.rules-panel.show {
    transform: translateY(-50%) translateX(120%);
    opacity: 1;
}

/* Скролл для длинного текста */
.rules-content {
    max-height: calc(100% - 1px);
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 10px;
}

/* Кнопка закрытия */
.rules-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 22px;
    cursor: pointer;
}
.rules-panel .close-btn:hover { color: #fff; }

/* ======================== Слайдшоу ======================== */
.slideshow {
    min-height: 100vh; /* минимум на весь экран */
    height: auto; 
    position: relative;
    overflow: hidden;
    background: rgb(165, 22, 22);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 40px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s;
}

.slide.active {
    opacity: 1;
}

/* ======================== Новости и помощь ======================== */
.news-wrapper,
.help-wrapper {
    max-width: 1050px;
    margin-left: 120px;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.news-wrapper.visible,
.help-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.news-wrapper.hidden,
.help-wrapper.hidden {
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
}

/* Блок помощи */
.help-wrapper {
    display: none;
    max-height: 400px;
    padding: 20px;
    margin-top: 30px; 
    background-color: #161616;
    border-radius: 10px;
    color: white;
    font-size: 18px;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.help-wrapper.visible {
    display: block;
}

/* Новости */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    min-height: 350px;
}

.news-item {
    display: flex;
    background: #171717;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease;
}

.news-text {
    color: #fff;
    padding: 0 0 10px 20px;
    display: flex;
    flex-direction: column;
}
.news-text p {
    color: #fff;
    margin: 0;
    display: -webkit-box;       /* для многоточия на нескольких строках */
    -webkit-line-clamp: 3;      /* показываем только 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;           /* скрываем лишний текст */
    text-overflow: ellipsis;    /* показываем "..." */
}
.news-item img {
    width: 404px;
    height: 226px;
    object-fit: cover;
    border-radius: 10px;
}

.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.news-pagination #page-info {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

.arrow-icon {
    width: 20px;
    height: 15px;
    filter: invert(0);
    transition: filter 0.3s ease;
}

.btn:hover .arrow-icon {
    filter: invert(0.7);
}

/* -------- Анимации входа/выхода новостей -------- */
.news-item.exit-left {
    opacity: 0;
    transform: translateX(-100%);
}

.news-item.exit-right {
    opacity: 0;
    transform: translateX(100%);
}

.news-item.enter-left {
    opacity: 0;
    transform: translateX(-100%);
    animation: enterFromLeft 0.4s forwards;
}

.news-item.enter-right {
    opacity: 0;
    transform: translateX(100%);
    animation: enterFromRight 0.4s forwards;
}

@keyframes enterFromLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes enterFromRight {
    to { opacity: 1; transform: translateX(0); }
}

/* ======================== Футер ======================== */
.footer {
    background: #171717;
    color: white;
    padding: 1px 20px 20px;
    margin-top: 40px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
    gap: 30px;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-nav a {
    color: #ddd;
    text-decoration: none;
}

.footer-nav a:hover {
    color: #585858;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
    font-size: 14px;
    color: #aaa;
}


/* Контейнер профиля */
.profile-container {
  display: flex;
  margin-top: 90px; /* чтобы не перекрывал хедер */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  gap: 20px;
  color: white;
  font-family: 'Tektur', sans-serif;
}

/* Левая панель */
.sidebar {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-btn {
  background: #222;
  border: none;
  color: white;
  padding: 2px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.3s;
}

.menu-btn.active,
.menu-btn:hover {
  background: #ff9800;
  color: #111;
}

/* Правая панель контента */
.profile-content {
  flex: 1;
  background: #161616;
  padding: 20px;
  border-radius: 10px;
  min-height: 400px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Кнопка Пополнить */
.profile-content .btn {
  background: #ff9800;
  color: #111;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.profile-content .btn:hover {
  background: #ffa733;
}
#profile-buttons2 {
    display: none;
    gap: 8px;
}

#profile-btn2 {
    position: relative;
    min-width: 160px;
    justify-content: flex-start;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#profile-btn2 img,
#profile-btn2 .username,
#profile-btn2 .alt-text {
    filter: none; 
    color: #ffffff; 
}
/* ======================== Мобильная адаптация (до 768px) ======================== */
@media screen and (max-width: 768px) {

  /* --- Логотип --- */
  .logo-link { margin-left: 10px; }
  .logo-icon { display: block; width: 50px; height: 50px; }
  .logo-text { display: none; }

  /* --- Хедер --- */
  .header-left { gap: 10px; }
  .header-right,
  .header-right2 { margin-right: 10px; }

  /* --- Слайдшоу --- */
  .slide { font-size: 24px; padding: 10px; }

  /* --- Новости и помощь --- */
  .news-wrapper, .help-wrapper {
    margin-left: 10px;
    margin-right: 10px;
    max-width: 100%;
  }

  .news-item img { width: 100%; height: auto; border-radius: 8px; }

  /* --- Модальные окна --- */
  .modal-content { width: 90%; padding: 20px; }
  .rules-panel { width: 80%; }

  /* --- Кнопки --- */
  .btn { min-width: auto; width: 100%; justify-content: center; }

  /* --- Профиль --- */
  #profile-buttons, #profile-buttons2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  #profile-btn, #profile-btn2 { min-width: auto; padding-left: 8px; }
  #user-balance { font-size: 12px; }

  /* --- Мобильное меню --- */
  #mobile-menu a.btn,
  #mobile-menu button.btn {
    font-size: 16px;
    padding: 12px;
    border-radius: 6px;
    background: #222;
    color: #fff;
    text-align: left;
  }
  #mobile-menu a.btn:hover,
  #mobile-menu button.btn:hover {
    background: #ff9800;
    color: #111;
  }

  /* --- Скрытие десктопных кнопок и показ гамбургера --- */
  .header-left > a.btn{
    display: none !important;
  }
  #sidebar-toggle { display: inline-flex; }
}

/* ======================== Десктопная адаптация (от 769px) ======================== */
@media screen and (min-width: 769px) {
  /* Скрываем гамбургер */
  #sidebar-toggle { display: none; }
  .logo-icon {
        display: none; /* Скрываем иконку на ПК */
    }
}
/* ======================== Мобильная адаптация кнопки Войти ======================== */
@media screen and (max-width: 768px) {
    #auth-btn {
        display: inline-flex;
        margin: 0 10px; /* делаем отступ только по бокам, без "выброса" за экран */
        flex-shrink: 1; /* позволяет кнопке ужиматься при маленьких экранах */
        max-width: calc(100% - 65px); /* чтобы не вылезала за экран */
    }

    .header {
        padding: 15px 20px; /* уменьшаем padding хедера, чтобы кнопка поместилась */
        justify-content: space-between;
    }

    .header-right, .header-right2 {
        margin-right: 0; /* убираем фиксированные 90px */
    }
}
/* Мобильное выпадающее меню авторизации */
@media screen and (max-width: 768px) {
  .auth-menu {
    position: fixed;
    top: 80px; /* чуть ниже хедера */
    left: 20px;
    right: 40px; /* отступ от правого края */
    width: 280px; /* ширина панели */
    max-width: 80%;
    background-color: rgba(63, 63, 63, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 2000;
    display: none;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .auth-menu.show {
    display: flex;
    transform: translateX(0);
    opacity: 1;
  }
}
/* Мобильная адаптация профиля */
@media screen and (max-width: 768px) {
    #profile-buttons, #profile-buttons2 {
        flex-direction: row;       /* все в один ряд */
        flex-wrap: nowrap;         /* запрет переносов */
        align-items: center;
        justify-content: flex-end; /* выравниваем по правому краю */
        gap: 6px;
        overflow: hidden;          /* обрезаем лишнее */
        width: auto;               /* ширина под контент */
        padding: 0 20px; 
    }

    #profile-btn, #profile-btn2 {
        min-width: 0;              /* чтобы имя могло сжиматься */
        padding-left: 8px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    #profile-btn img, #profile-btn2 img {
        flex-shrink: 1;            /* иконка не сжимается */
        width: 20px;               /* можно уменьшить для мобильных */
        height: 20px;
    }

    #profile-btn .username, #profile-btn2 .username {
        white-space: nowrap;       /* не переносим текст */
        overflow: hidden;          /* скрываем лишнее */
        text-overflow: ellipsis;   /* показываем ... при нехватке места */
        max-width: 100px;          /* регулируем максимальную ширину */
        flex-shrink: 1;            /* имя может сжиматься */
    }

    #profile-btn .alt-text, #profile-btn2 .alt-text {
        display: none;             /* при ховере можно показывать, но на мобиле скрываем */
    }

    /* Скрываем баланс на мобильных */
    #user-balance {
        display: none;
    }
}
/* ==== ПАНЕЛЬ ПОЛНОЙ НОВОСТИ ==== */
.news-detail-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1f1f1f;
    color: #fff;
    display: none; /* скрыта по умолчанию */
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* контент сверху */
    padding: 40px 20px;
    overflow-y: auto; /* вертикальный скролл */
    z-index: 2500;
    box-sizing: border-box;
}

.news-detail-wrapper img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.news-detail-wrapper h2 {
    margin-bottom: 15px;
    font-size: 28px;
    text-align: center;
}

.news-detail-wrapper p {
    max-width: 100%;         /* убираем ограничение ширины */
    overflow: visible;       /* текст полностью виден */
    text-overflow: clip;     /* отключаем многоточие */
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    display: block;
    text-align: justify;
    line-height: 1.5;
    font-size: 18px;
}

/* Кнопка закрытия */
.close-detail-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 2600;
}

.close-detail-btn:hover {
    color: #ff9800;
}