/* Мобильные стили - max-width: 668px */
@media screen and (max-width: 668px) {
  /* Предотвращаем горизонтальный скролл */
  html {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
  }
  
  .main {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  
  /* Кнопки в шапке - всегда видимы на мобильных */
  .header {
    min-height: 70px;
    padding: 10px 8px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .header-wrapper {
    max-width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .header-buttons-wrapper {
    display: flex;
    gap: 6px;
    position: static;
    transform: none;
    flex-direction: row;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    padding: 0;
    flex-shrink: 0;
  }

  .header-burger-button-wrapper {
    display: none;
  }

  .header-nav {
    display: none;
  }

  .header-social-buttons-wrapper {
    display: none;
  }

  .header-lang {
    display: none;
  }

  .header-button.header-enter-button,
  .header-button.header-register-button {
    display: flex;
    height: 48px;
    min-height: 48px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .header-logo {
    height: 46px;
    flex-shrink: 1;
    min-width: 0;
  }

  .header-logo img {
    height: 46px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  /* Скрываем баннер и промо на мобильных */
  .banner-wrapper {
    display: none;
  }

  .promo-section {
    display: none;
  }

  .main {
    margin-top: 70px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .base-block {
    padding: 0px 16px;
    row-gap: 24px;
    margin-top: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: visible;
    box-sizing: border-box;
  }

  .h2-base-title {
    margin-bottom: 20px;
    font-size: 26px;
    line-height: 33px;
  }

  /* Prize Fund на мобильных */
  .prize-fund-wrapper {
    margin-top: 0;
  }


  .prize-fund {
    width: auto;
    display: flex;
    column-gap: 8px;
    height: 36px;
    padding: 6px 24px;
    border-radius: 16px 16px 0 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0em;
  }

  .prize-fund::before {
    border-radius: 16px 16px 0 0;
  }

  .prize-fund-desktop-section {
    display: none;
    background: #252536;
  }

  .prize-fund-mobile-section {
    display: block;
  }

  .prize-fund-mobile-second-block-text {
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0em;
    display: flex;
    column-gap: 4px;
    padding: 4px 8px;
    margin-bottom: 16px;
    border-radius: 4px;
    background: #1E1E2C;
  }

  .prize-fund-mobile-second-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #252536;
    box-shadow: 0px 2px 2px 0px #00000099;
    border-radius: 0px 0px 8px 8px;
    padding: 0px 8px 8px 8px;
  }

  .prize-fund-mobile-second-block-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0px;
    margin: 12px 0px;
  }

  .prize-fund-mobile-second-block-button {
    height: 40px;
    width: 100%;
  }

  /* Navigation */
  .navigation {
    border-radius: 8px;
    margin: 32px 8px 0px 8px;
  }

  .navigation-menu .menu-item {
    flex-direction: column;
    height: 64px;
  }

  .navigation-menu .menu-item::before {
    border-width: 1px;
  }

  .navigation-menu .menu-item:first-child::before {
    border-radius: 8px 0px;
  }

  .navigation-menu .menu-item:last-child::before {
    border-radius: 0px 8px;
  }

  .navigation-menu .menu-item img {
    margin-right: 0px;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
  }

  .navigation-menu .menu-item .menu-item-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 12px;
    letter-spacing: 0px;
  }

  /* Зеркало */
  .zerkalo-section-btn_wrapper-header {
    padding: 30px 10px;
    margin: 20px 0;
  }

  .zerkalo-section-btn_wrapper-header p {
    font-size: 16px;
  }

  .btn-zerkalo {
    font-size: 15px;
    padding: 14px 18px;
    width: 100%;
    text-align: center;
    margin: 20px 0 0;
  }

  /* Текст */
  .text-and-articles-block-title {
    font-size: 20px;
    line-height: 24px;
  }

  .text-block-second-content {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 20px;
  }

  .text-block-second-content h1 {
    font-size: 26px;
    line-height: 33px;
    margin: 20px 0 15px;
  }

  .text-block-second-content h2 {
    font-size: 22px;
    line-height: 28px;
    margin: 18px 0 12px;
  }

  .text-block-second-content h3 {
    font-size: 18px;
    line-height: 24px;
    margin: 15px 0 10px;
  }

  .text-block-second-button {
    font-size: 16px;
    line-height: 16px;
  }

  /* Артикли */
  .articles-header-wrapper {
    padding: 16px 16px 16px 16px;
  }

  .articles-item {
    padding: 12px;
    flex: 0 0 100%;
  }

  /* Блок автора */
  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    margin: 20px auto;
  }

  .author-box img,
  .author-avatar {
    margin-right: 0;
    margin-bottom: 20px;
    width: 120px;
    height: 120px;
  }

  .author-info {
    max-width: 100%;
  }

  .author-info h3 {
    font-size: 20px;
  }

  .author-info p {
    font-size: 14px;
  }

  /* Преимущества */
  .advantages-content {
    padding: 12px;
  }

  .advantages-item {
    flex: 0 0 100%;
  }

  /* Reviews */
  .review {
    margin-bottom: 32px;
  }

  .faq-content,
  .review-content {
    margin-bottom: 20px;
  }

  .faq-item,
  .review-item {
    padding: 16px;
  }

  .faq-item-title,
  .review-item-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 300;
    line-height: 16px;
    letter-spacing: 0px;
    color: #8A8AAE;
  }

  /* Отзывы на мобильных */
  .review-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .review-item-name {
    font-size: 16px;
  }

  .review-item-rating .star {
    font-size: 14px;
  }

  .review-item-date {
    font-size: 12px;
    align-self: flex-end;
    margin-top: -24px;
  }

  .review-item-content {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Footer */
  .footer {
    margin: 0px 20px;
  }

  .footer-content-first-part {
    justify-content: center;
    padding: 20px 0px;
  }

  .footer-content-second-part {
    justify-content: center;
    padding: 20px 0px;
    flex-direction: column;
  }

  .footer-content-second-part .footer-second-part-item:nth-child(1) {
    order: 2;
  }

  .footer-content-second-part .footer-second-part-item:nth-child(2) {
    max-width: 100%;
    order: 3;
  }

  .footer-content-second-part .footer-second-part-item:nth-child(3) {
    order: 1;
  }

  .footer-nav {
    justify-content: center;
  }

  .footer-second-part-item-text {
    font-size: 10px;
  }

  .footer-lang .choose-lang-list {
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    bottom: -130px;
    left: -10px;
    transform-origin: bottom right;
  }

  /* Стили для игр на мобильных */
  .games-grid-section {
    margin: 15px 8px;
    padding: 15px 8px;
  }

  .games-grid-title {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .games-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 3px;
  }

  .game-card {
    border-radius: 6px;
  }

  .game-card-title {
    font-size: 10px;
    padding: 6px 4px 2px;
    line-height: 1.2;
  }

  .game-card-provider {
    font-size: 8px;
    padding: 0 4px 6px;
  }

  .game-card-btn {
    padding: 5px 8px;
    font-size: 9px;
  }

  .game-card-buttons {
    gap: 4px;
    padding: 6px;
  }

  /* Кнопка "Еще игры" на мобильных */
  .more-games-button-wrapper {
    margin-top: 20px;
    padding: 0 10px 15px;
  }

  .more-games-button {
    width: 100%;
    justify-content: center;
    padding: 14px 30px;
    font-size: 16px;
    border-radius: 10px;
  }
  
  /* Баннеры в контенте - адаптация для мобильных */
  .content-image-wrapper {
    margin: 20px 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .content-banner-img {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(182, 51, 254, 0.15);
    object-fit: cover;
  }
  
  .content-banner-img:active {
    transform: scale(0.98);
  }
  /* Любые изображения и SVG внутри текстового блока не должны выходить за экран */
  .text-block-second-content img,
  .text-block-second-content svg,
  .text-block-second img,
  .text-block-second svg {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  
  /* Адаптивные таблицы */
  .text-block-second-content {
    overflow-x: visible;
  }
  
  /* Скроллируемый контейнер для таблиц */
  .table-wrapper,
  .info-table-wrapper {
    width: calc(100vw - 32px);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px -16px;
    padding: 0 16px;
    box-sizing: border-box;
  }
  
  .info-table {
    width: 100%;
    min-width: 480px;
    margin: 0;
    font-size: 10px;
    table-layout: auto;
  }
  
  .info-table th {
    padding: 8px 6px;
    font-size: 10px;
    white-space: normal;
    word-break: break-word;
  }
  
  .info-table td {
    padding: 6px 4px;
    font-size: 9px;
    white-space: normal;
    word-break: break-word;
  }
  
  /* Все изображения */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Длинные ссылки в таблицах переносятся и не растягивают колонку */
  .info-table .table-link {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  /* Текст в контенте */
  .text-block-second-content p,
  .text-block-second-content h2,
  .text-block-second-content h3,
  .text-block-second-content h4 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* Очень маленькие экраны */
@media screen and (max-width: 480px) {
  /* Гарантируем отсутствие горизонтального скролла */
  html {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  body, .main {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .base-block {
    padding: 0px 12px;
    overflow-x: visible;
  }
  
  .header-button.header-enter-button,
  .header-button.header-register-button {
    height: 44px;
    min-height: 44px;
    padding: 0 16px;
    font-size: 14px;
  }

  .header-logo {
    height: 44px;
  }

  .header-logo img {
    height: 44px;
  }

  .header {
    min-height: 70px;
    padding: 10px 12px;
  }

  .main {
    margin-top: 70px;
  }

  .author-box {
    padding: 15px;
  }

  .author-box img,
  .author-avatar {
    width: 100px;
    height: 100px;
  }

  .author-info h3,
  .author-info h4 {
    font-size: 18px;
  }

  .author-info p {
    font-size: 13px;
  }

  .btn-zerkalo {
    font-size: 14px;
    padding: 12px 16px;
  }

  .zerkalo-section-btn_wrapper-header {
    padding: 20px 10px;
  }

  /* Игры на очень маленьких экранах */
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .games-grid-title {
    font-size: 18px;
  }

  .game-card-title {
    font-size: 10px;
  }

  .game-card-provider {
    font-size: 8px;
  }
  
  /* Баннеры в контенте */
  .content-image-wrapper {
    margin: 20px 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .content-banner-img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 6px;
  }
  
  /* Таблицы на маленьких экранах */
  .table-wrapper,
  .info-table-wrapper {
    width: calc(100vw - 24px);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px -12px;
    padding: 0 12px;
    box-sizing: border-box;
  }
  
  .info-table {
    width: 100%;
    min-width: 420px;
    font-size: 9px;
  }
  
  .info-table th {
    padding: 6px 4px;
    font-size: 8px;
  }
  
  .info-table td {
    padding: 5px 3px;
    font-size: 7px;
  }
  
  /* Адаптивность для встроенных в текст изображений */
  .content-image-wrapper[style*="float"] {
    float: none !important;
    margin: 20px auto !important;
    max-width: 100% !important;
  }
  
  /* Адаптивность для промо-секции с картинкой справа */
  .promo-content[style*="display: flex"] {
    flex-direction: column !important;
  }
  
  .promo-image[style*="flex: 0 0 400px"] {
    flex: 1 1 auto !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }
  
  .promo-text[style*="flex: 1"] {
    min-width: 100% !important;
  }
}

