/* style.css*/

@media (max-width: 480px) {

  .wrap {
    padding: 12px 10px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero-title {
    font-size: 20px;
  }

  .hero-subtitle {
    font-size: 13px;
  }

  .ip-card {
    flex-direction: column;
    text-align: center;
  }

  /* игроки таблицы */
  .lb-table-wrapper {
    overflow-x: auto;
  }

  .lb-table {
    min-width: 650px;
  }

  /* leaderboard строки  */
  .lb-player-name {
    font-size: 12px;
  }

  .lb-player-avatar {
    width: 28px;
    height: 28px;
  }

  /* Гриды секций */
  .hero {
    grid-template-columns: 1fr !important;
  }

  .guides-layout {
    grid-template-columns: 1fr !important;
  }

  /* Статы */
  .lb-stat-card {
    padding: 8px;
  }
  .lb-stat-value {
    font-size: 16px;
  }

}

@media (max-width: 480px) {
  body::before {
    opacity: 0.35 !important;
    animation: none !important;
  }

  .plugin-card,
  .shop-card {
    box-shadow: none !important;
  }
}


@media (max-width: 720px) {

    .nav-menu {
        position: fixed;
        top: 91px; /* под шапкой */
        left: 0;
        width: 100%;
        height: auto;
        background: rgba(10,10,15,0.95);
        backdrop-filter: blur(8px);
        padding: 20px 0;
        display: none;
        flex-direction: column; /* список сверху вниз */
        gap: 15px;
        z-index: 999;
        animation: menuFade 0.3s ease forwards;
    }

    .nav-menu.open {
        display: flex !important;
    }

  .nav-menu a {
    color: #fff;
    padding: 12px 20px;
    font-size: 18px;
    text-decoration: none;

    opacity: 0;
    transform: translateX(-20px);
  }

  .nav-menu.open a {
    animation: menuItemFade 0.35s ease forwards;
  }

  .nav-menu.open a:nth-child(1) { animation-delay: 0.05s; }
  .nav-menu.open a:nth-child(2) { animation-delay: 0.10s; }
  .nav-menu.open a:nth-child(3) { animation-delay: 0.15s; }
  .nav-menu.open a:nth-child(4) { animation-delay: 0.20s; }
  .nav-menu.open a:nth-child(5) { animation-delay: 0.25s; }
  .nav-menu.open a:nth-child(6) { animation-delay: 0.30s; }
  .nav-menu.open a:nth-child(7) { animation-delay: 0.35s; }
  .nav-menu.open a:nth-child(8) { animation-delay: 0.40s; }

  @keyframes menuItemFade {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
  }
}



/* circuit.css */
@media (max-width: 900px) {
  .circuit-wrapper {
    grid-template-columns: 1fr;
    height: auto;
  }

  .circuit-sidebar {
    width: 100%;
    order: 2;
  }

  .circuit-workspace {
    height: 420px;
    order: 1;
  }
}

@media (max-width: 600px) {
  #circuit-canvas {
    height: 320px;
  }
}


/* card.css */
@media (max-width: 600px) {
  #player-profile-section {
    padding: 12px;
  }

  #pp-name {
    font-size: 18px;
  }

  #pp-avatar {
    width: 110px;
    height: 110px;
  }

  .pp-card {
    padding: 12px;
  }

  .pp-card .pp-value {
    font-size: 16px;
  }
}

/* БУРГЕР МЕНЮ */
@media (max-width: 600px) {

    #player-profile-section {
        padding: 10px;
        border-radius: 20px;
    }

    #pp-avatar {
        width: 95px;
        height: 95px;
    }

    #pp-name {
        font-size: 18px;
    }

    .pp-card {
        padding: 5px;
        border-radius: 14px;
        font-size: 14px;
    }

    .pp-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Бейджи */
    .pp-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Кнопка "Назад"  */
    #pp-back {
        font-size: 16px !important;
        padding: 12px 16px !important;
        left: -420px;
        top: 340px;
    }
}


/* === Фиксация шапки на мобильных === */
@media (max-width: 720px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 99%;
    z-index: 9999;
    background: rgba(10,10,20,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  /* Чтобы контент не залезал под шапку */
  body {
    padding-top: 90px; /* высота твоей шапки */
  }
}



/* ======= MOBILE NAVIGATION ======= 
@media (max-width: 720px) {

  .burger {
    display: block;
    cursor: pointer;
    padding: 6px;
    z-index: 999;
  }

  .main-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(5,5,10,0.98);
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
  }

  /* скрытое состояние 
  .main-nav.closed {
    display: none;
  }
}

*/

/* МАГАЗИН */

/* Планшеты */
@media (max-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Телефоны */
@media (max-width: 640px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .shop-card-inner {
    padding: 14px;
  }

  .shop-card-title {
    font-size: 16px;
  }

  .shop-buy-btn {
    font-size: 15px;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .shop-card {
    max-width: 100%;
  }

  .shop-buy-btn {
    width: 100%;
  }
}




/* mobile tweaks */

@media (max-width: 720px) {
  .leaderboard-header {
    align-items: flex-start;
  }

  .lb-filters {
    justify-content: flex-start;
  }

  .lb-table th:nth-child(4),
  .lb-table td:nth-child(4),
  .lb-table th:nth-child(5),
  .lb-table td:nth-child(5) {
    display: none; /* скрыть K/D на очень маленьких экранах */
  }
}



/* МОДАЛКА НОВОСТЕЙ */
@media (min-width: 320px) and (max-width: 480px) {
  .map-modal__panel {
    inset: 12px;
    width: calc(100% - 24%);
    height: calc(100% - 24px);
    border-radius: 20px;
  }

  .map-modal__content {
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    overflow-y: auto;
  }

  .map-modal__left {
    flex: none;
    width: 100%;
    height: auto;
  }

  .map-modal__map {
    height: 46vh;
    min-height: 240px;
    border-radius: 18px;
  }

  .map-modal__right {
    flex: none;
    width: 100%;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .map-modal__grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .map-modal__monuments {
    width: calc(50% - 4px);
    justify-content: space-between;
  }
}


/* ========== АДАПТИВНЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ========== */

@media (max-width: 768px) {
    .ofer-page {
        padding: 10px 8px !important;
    }
    
    .ofer-header {
        padding: 25px 15px !important;
        margin-bottom: 20px !important;
        border-radius: 16px !important;
    }
    
    .ofer-title {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    
    .ofer-subtitle {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    .ofer-date {
        font-size: 12px !important;
        padding: 8px 12px !important;
        margin-top: 12px !important;
    }
    
    .ofer-container {
        padding: 20px 15px !important;
        border-radius: 16px !important;
    }
    
    .ofer-container h1 {
        font-size: 18px !important;
        margin: 25px 0 15px !important;
        padding-bottom: 8px !important;
        padding-left: 25px !important;
    }
    
    .ofer-container h1::before {
        left: 0 !important;
        font-size: 18px !important;
    }
    
    .ofer-container h2 {
        font-size: 16px !important;
        margin: 20px 0 12px !important;
        padding-left: 12px !important;
    }
    
    .ofer-container h3 {
        font-size: 15px !important;
        margin: 18px 0 10px !important;
    }
    
    .ofer-container p {
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: left !important;
        margin: 10px 0 !important;
    }
    
    .ofer-notice,
    .ofer-warning {
        padding: 18px !important;
        margin: 18px 0 !important;
        border-radius: 12px !important;
    }
    
    .ofer-notice-icon {
        float: none !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
        display: block !important;
    }
    
    /* Таблицы на мобильных - делаем прокрутку */
    .ofer-table-wrapper {
        overflow-x: auto !important;
        margin: 15px -15px !important;
        padding: 0 15px !important;
    }
    
    .ofer-table {
        min-width: 600px !important;
        font-size: 13px !important;
    }
    
    .ofer-table th,
    .ofer-table td {
        padding: 12px 10px !important;
    }
    
    /* Списки */
    .ofer-container ul,
    .ofer-container ol {
        padding-left: 20px !important;
        margin: 15px 0 !important;
    }
    
    .ofer-container li {
        font-size: 14px !important;
        margin: 8px 0 !important;
    }
    
    .ofer-container ul li::before {
        left: -18px !important;
    }
    
    .ofer-container ol li::before {
        left: -22px !important;
    }
    
    /* Контакты */
    .ofer-contacts {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .ofer-contact-item {
        width: 100% !important;
        padding: 12px !important;
    }
    
    /* Подпись */
    .ofer-signature {
        padding: 20px 15px !important;
        margin-top: 30px !important;
    }
    
    .ofer-signature h2 {
        font-size: 18px !important;
    }
    
    /* Кнопка назад */
    .ofer-back-btn {
        position: fixed !important;
        top: 70px !important;
        left: 10px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
        z-index: 1000 !important;
        backdrop-filter: blur(20px) !important;
        background: rgba(0, 0, 0, 0.8) !important;
    }
    
    .ofer-back-btn i {
        font-size: 16px !important;
    }
    
    /* Оглавление и кнопка оглавления */
    .ofer-toc-toggle {
        display: none !important;
    }
    
    .ofer-toc {
        display: none !important;
    }
    
    /* Прогресс-бар */
    .ofer-progress {
        top: 60px !important;
    }
    
    /* Блоки внутри секций */
    .ofer-section {
        padding: 12px 10px !important;
        margin: 8px 0 !important;
    }
    
    /* Котировки */
    .ofer-quote {
        padding: 15px !important;
        margin: 15px 0 !important;
        font-size: 13px !important;
    }
}

/* мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .ofer-title {
        font-size: 20px !important;
    }
    
    .ofer-subtitle {
        font-size: 13px !important;
    }
    
    .ofer-container {
        padding: 15px 12px !important;
    }
    
    .ofer-container h1 {
        font-size: 17px !important;
        padding-left: 22px !important;
    }
    
    .ofer-container h2 {
        font-size: 15px !important;
    }
    
    .ofer-container p {
        font-size: 13px !important;
    }
    
    .ofer-table {
        min-width: 500px !important;
        font-size: 12px !important;
    }
    
    .ofer-table th,
    .ofer-table td {
        padding: 10px 8px !important;
    }
    
    .ofer-notice,
    .ofer-warning {
        padding: 15px !important;
    }
    
    .ofer-back-btn {
        top: 65px !important;
        left: 8px !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    .ofer-section {
        padding: 10px 8px !important;
    }
}

/* Планшеты (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .ofer-page {
        padding: 15px !important;
    }
    
    .ofer-header {
        padding: 30px 25px !important;
    }
    
    .ofer-title {
        font-size: 26px !important;
    }
    
    .ofer-subtitle {
        font-size: 16px !important;
    }
    
    .ofer-container {
        padding: 30px 25px !important;
    }
    
    .ofer-container h1 {
        font-size: 22px !important;
    }
    
    .ofer-container h2 {
        font-size: 19px !important;
    }
    
    .ofer-toc {
        width: 240px !important;
        right: 15px !important;
    }
    
    .ofer-back-btn {
        left: 15px !important;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .ofer-header {
        padding: 15px 20px !important;
    }
    
    .ofer-title {
        font-size: 20px !important;
        margin-bottom: 5px !important;
    }
    
    .ofer-subtitle {
        font-size: 13px !important;
        margin-bottom: 5px !important;
    }
    
    .ofer-container {
        padding: 15px 20px !important;
    }
    
    .ofer-back-btn {
        top: 60px !important;
    }
    
    .ofer-progress {
        top: 50px !important;
    }
}

/* ========== АДАПТИВНОСТЬ ДЛЯ ЭЛЕМЕНТОВ МАГАЗИНА ========== */

@media (max-width: 768px) {
    .shop-ofer-notice {
        flex-direction: column !important;
        padding: 12px 15px !important;
        margin: 15px 0 !important;
        text-align: center !important;
        gap: 10px !important;
    }
    
    .shop-ofer-notice-icon {
        margin: 0 auto !important;
        font-size: 22px !important;
    }
    
    .shop-ofer-notice-text {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }
    
    .shop-ofer-link {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        margin: 15px 0 !important;
    }
    
    /* Адаптация магазина в целом */
    #shop .panel-header h2 {
        font-size: 22px !important;
    }
    
    #shop .panel-header p {
        font-size: 14px !important;
    }
    
    .shop-filters {
        overflow-x: auto !important;
        padding-bottom: 10px !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .shop-filter-btn {
        white-space: nowrap !important;
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 12px !important;
    }
}

/* Маленькие мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .shop-ofer-notice {
        padding: 10px 12px !important;
        margin: 12px 0 !important;
    }
    
    .shop-ofer-notice-text {
        font-size: 12px !important;
    }
    
    .shop-ofer-link {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    .shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    #shop .panel-header h2 {
        font-size: 20px !important;
    }
}

/* ========== ОБЩИЕ УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНЫХ ========== */

/* Улучшение читаемости на мобильных */
@media (max-width: 768px) {
    .ofer-container * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .ofer-term {
        font-size: 13px !important;
        padding: 3px 6px !important;
    }
}

/* Улучшение прокрутки на iOS */
@supports (-webkit-touch-callout: none) {
    .ofer-container {
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Предотвращение масштабирования при фокусе на мобильных */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Улучшение кликабельных элементов на мобильных */
@media (max-width: 768px) {
    .ofer-toc-link,
    .shop-ofer-link,
    .shop-filter-btn,
    .ofer-back-btn {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    a, button {
        cursor: pointer !important;
    }
}

/* Анимации для мобильных */
@media (max-width: 768px) {
    .ofer-container {
        animation: fadeInUpMobile 0.6s ease !important;
    }
    
    @keyframes fadeInUpMobile {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* отображения длинных слов */
@media (max-width: 768px) {
    .ofer-container {
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
        -moz-hyphens: auto !important;
    }
}

/* ========== НАСТРОЙКИ ДЛЯ IOS ========== */

@supports (-webkit-touch-callout: none) {
    .ofer-back-btn {
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .ofer-container {
        padding-bottom: env(safe-area-inset-bottom) !important;
    }
}

/* ========== ТЕМНЫЙ РЕЖИМ И ЭКОНОМИЯ ЭНЕРГИИ ========== */

@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .ofer-container {
        background: rgba(5, 5, 8, 0.95) !important;
    }
    
    .ofer-notice,
    .ofer-warning {
        background: rgba(0, 0, 0, 0.6) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ofer-container,
    .ofer-back-btn,
    .ofer-section {
        animation: none !important;
        transition: none !important;
    }
}

/* ========== ПЕЧАТЬ ========== */

@media print {
    .ofer-back-btn,
    .ofer-toc-toggle,
    .ofer-toc,
    .ofer-progress,
    .site-footer,
    .shop-ofer-notice {
        display: none !important;
    }
    
    .ofer-page {
        padding: 0 !important;
        background: white !important;
    }
    
    .ofer-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        color: black !important;
        background: white !important;
    }
    
    .ofer-header {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
    
    .ofer-title {
        color: black !important;
    }
}

/* ========== ДОП ДЛЯ МОБИЛЬНОЙ АДАПТАЦИИ ========== */

/* Скрыть на мобильных */
.mobile-hide {
    display: none !important;
}

@media (min-width: 769px) {
    .mobile-hide {
        display: block !important;
    }
}

/* Показать только на мобильных */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
}
