/* ============================================
   ФЭНТЕЗИЙНЫЙ ДИЗАЙН - ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ
   ============================================ */

@import url('/shared/css/ui/tokens.css');
@import url('/shared/css/ui/layout.css');
@import url('/shared/css/ui/buttons.css');
@import url('/shared/css/ui/cards.css');
@import url('/shared/css/ui/header.css');
@import url('/shared/css/ui/footer.css');

:root {
    --title-font: var(--body-font);
    --body-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Фэнтезийная цветовая палитра - темные коричневые тона */
    --color-heroes: #8b6b47;      /* Средний коричневый */
    --color-beasts: #a67c52;      /* Теплый коричневый */
    --color-demons: #7a5a3a;      /* Темный коричневый */
    --color-spirits: #6b5a4a;     /* Глубокий коричневый */
    --color-undead: #5a4a3a;      /* Очень темный коричневый */
    --color-dragons: #c9a961;     /* Золотистый коричневый */
    --color-orcs: #9b7a5a;        /* Теплый коричневый */
    --color-weapons: #7a6f62;     /* Песочный коричневый */
    --color-traps: #5a5047;       /* Темный песочный */
    --color-artifacts: #daa835;   /* Золотой коричневый */
    --color-spells: #8b6f3a;      /* Оливковый коричневый */
    --color-catacombs: #6a5a4a;   /* Холодный коричневый */

    /* Основные фэнтезийные цвета */
    --primary-color: #c9a961;     /* Золотой коричневый */
    --secondary-color: #8b6b47;   /* Средний коричневый */
    --accent-color: #a67c52;      /* Теплый коричневый */
    
    /* Фоны */
    --dark-bg: #0f0e0b;           /* Очень темный коричневый-черный */
    --dark-card: #1a1813;         /* Темный коричневый */
    --text-light: #e5dcd0;        /* Светлый кремово-бежевый */
    --text-muted: #b5a892;        /* Мутный бежевый */
    --border-color: #3a332a;      /* Граница коричневая */

    /* Переходы и анимации */
    --transition: all 0.3s ease;
    --shadow: 0 4px 15px rgba(201, 169, 97, 0.2);
    --anchor-header-gap: 16px;
}

/* Оптимизация производительности */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

video {
    max-width: 100%;
    height: auto;
}

body {
    font-family: var(--body-font);
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    padding-top: 0;
}

/* ============================================
   КАСТОМНЫЙ КУРСОР
   ============================================ */
@media (hover: hover) and (pointer: fine) {
    body.custom-cursor-enabled {
        cursor: none;
    }

    body.custom-cursor-enabled * {
        cursor: none !important;
    }

    .custom-cursor-dot,
    .custom-cursor-ring {
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        opacity: 0;
        z-index: 2147483647;
        transform: translate(-50%, -50%);
        transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
        will-change: transform, opacity;
    }

    .custom-cursor-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: radial-gradient(circle at 30% 30%, #ffe8bd 0%, var(--primary-color) 60%, #b88a3f 100%);
        box-shadow: 0 0 6px rgba(201, 169, 97, 0.7);
        transition: opacity 0.15s ease, width 0.2s cubic-bezier(0.4, 0, 0.2, 1), height 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    }

    .custom-cursor-ring {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 1px solid rgba(201, 169, 97, 0.6);
        background: radial-gradient(circle, rgba(201, 169, 97, 0.12) 0%, rgba(201, 169, 97, 0) 70%);
        box-shadow: 0 0 10px rgba(201, 169, 97, 0.3), inset 0 0 6px rgba(201, 169, 97, 0.15);
        transition: opacity 0.15s ease, transform 0.12s ease-out, width 0.2s cubic-bezier(0.4, 0, 0.2, 1), height 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .custom-cursor-ring.cursor-hover {
        width: 28px;
        height: 28px;
        border-color: rgba(201, 169, 97, 0.9);
        background: radial-gradient(circle, rgba(201, 169, 97, 0.2) 0%, rgba(201, 169, 97, 0) 75%);
        box-shadow: 0 0 16px rgba(201, 169, 97, 0.5), inset 0 0 10px rgba(201, 169, 97, 0.25);
    }

    .custom-cursor-dot.cursor-hover {
        width: 7px;
        height: 7px;
        box-shadow: 0 0 12px rgba(201, 169, 97, 1);
    }

}

@media (prefers-reduced-motion: reduce) {
    .custom-cursor-dot,
    .custom-cursor-ring {
        transition: none;
    }
}

/* ============================================
   КОНТЕЙНЕР
   ============================================ */

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

/* ============================================
   ЗАГОЛОВКИ И ТЕКСТ
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: var(--title-font);
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; border-bottom: 2px solid var(--primary-color); padding-bottom: 0.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.nav-link,
.section-link,
.footer-legal-link,
.bottom-nav-item,
.section-header-link a {
    font-family: var(--title-font);
}

.header .logo-text,
.selector-btn,
.selector-dropdown-header {
    font-family: var(--body-font);
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ============================================
   КНОПКИ
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: rgba(20, 18, 15, 0.75);
    border: 1px solid rgba(201, 169, 97, 0.4);
    color: rgba(255, 236, 191, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 25px rgba(201, 169, 97, 0.15), inset 0 1px 0 rgba(255, 236, 191, 0.1);
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 236, 191, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    color: #fff3d2;
    border-color: rgba(212, 154, 61, 0.9);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.3), rgba(166, 124, 82, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 35px rgba(212, 154, 61, 0.4), inset 0 1px 0 rgba(255, 236, 191, 0.15);
    text-decoration: none;
}

.btn-secondary {
    background: rgba(20, 18, 15, 0.75);
    border: 1px solid rgba(201, 169, 97, 0.4);
    color: rgba(255, 236, 191, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 25px rgba(201, 169, 97, 0.15), inset 0 1px 0 rgba(255, 236, 191, 0.1);
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 236, 191, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    color: #fff3d2;
    border-color: rgba(212, 154, 61, 0.9);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.3), rgba(166, 124, 82, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 35px rgba(212, 154, 61, 0.4), inset 0 1px 0 rgba(255, 236, 191, 0.15);
    text-decoration: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ============================================
   HEADER / НАВИГАЦИЯ
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(180deg, rgba(15, 14, 11, 0.98) 0%, rgba(15, 14, 11, 0.96) 100%);
    border-bottom: 2px solid rgba(201, 169, 97, 0.4);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.30), inset 0 -1px 0 rgba(255, 215, 125, 0.25);
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
    contain: layout style;
    backdrop-filter: blur(8px);
}

.header .container.header-container-full {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding-left: clamp(12px, 2vw, 24px);
    padding-right: clamp(12px, 2vw, 24px);
}

.header-content {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    justify-items: center;
    align-items: center;
    padding: 0.85rem 0;
    gap: clamp(0.8rem, 1.5vw, 2rem);
    grid-template-areas:
        "logo-image logo nav selector menu";
}

.cart-icon-wrapper {
    margin-left: auto;
}

/* Адаптация для экранов 1024px - 1200px */
@media (min-width: 1024px) and (max-width: 1200px) {
    .header-content {
        gap: clamp(0.4rem, 0.8vw, 0.6rem);
        grid-template-columns: auto auto 1fr auto auto;
        padding: 0.7rem 0;
    }

    .logo-text {
        font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    }

    .nav-menu {
        gap: clamp(0.5rem, 1vw, 0.8rem);
        padding: 0 clamp(0.3rem, 0.6vw, 0.5rem);
    }

    .nav-link {
        font-size: clamp(0.75rem, 1.2vw, 0.85rem);
        padding: 0.35rem 0.5rem;
    }

    .selector-btn {
        font-size: clamp(0.75rem, 1.2vw, 0.85rem);
        padding: 0.5rem 0.7rem;
    }

    .cart-icon svg {
        width: clamp(20px, 3.5vw, 24px);
        height: clamp(20px, 3.5vw, 24px);
    }

    .game-selector {
        flex-shrink: 1;
        min-width: 0;
    }

    .cart-icon-wrapper {
        flex-shrink: 0;
    }
}

/* Фиксированная кнопка корзины для планшетов - по умолчанию скрыта */
.cart-button-tablet-fixed {
    display: none !important;
}

/* Планшеты (768px - 1023px): header в один ряд без текста ЭНТУЗИАСТ */
@media (min-width: 768px) and (max-width: 1023px) {
    .header-content {
        display: grid !important;
        grid-template-columns: auto 1fr auto auto auto !important;
        grid-template-areas: "logo-image nav selector cart menu" !important;
        gap: clamp(0.8rem, 1.5vw, 1.2rem);
        align-items: center;
        padding: 0.6rem 0;
        min-height: 56px;
    }

    .logo-image {
        width: 44px;
        flex-shrink: 0;
        grid-area: logo-image;
        justify-self: start;
    }

    .nav-menu {
        display: flex !important;
        gap: 0.9rem;
        flex-wrap: nowrap;
        white-space: nowrap;
        grid-area: nav;
        justify-self: center;
        padding: 0;
    }

    .nav-link {
        font-size: 0.76rem;
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .game-selector {
        display: block !important;
        grid-area: selector;
        justify-self: center;
    }

    .selector-btn {
        font-size: 0.74rem;
        padding: 0.45rem 0.75rem;
        white-space: nowrap;
    }

    .cart-button {
        padding: 0.5rem 0.75rem;
        gap: 0.6rem;
    }

    .cart-button-text {
        display: inline;
        font-size: 0.74rem;
    }

    /* На планшете скрыть кнопку корзины из header и показать фиксированную над back-to-top */
    .cart-icon-wrapper {
        display: none !important;
    }

    /* Скрыть логотип ЭНТУЗИАСТ на планшете */
    .logo {
        display: none !important;
    }

    /* Фиксированная кнопка корзины над back-to-top */
    .cart-button-tablet-fixed {
        display: flex !important;
        position: fixed;
        right: max(16px, env(safe-area-inset-right));
        bottom: calc(max(52px, env(safe-area-inset-bottom)) + 70px);
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
        border-radius: 999px;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(201, 169, 97, 0.8);
        background: linear-gradient(135deg, rgba(212, 154, 61, 0.98), rgba(136, 90, 43, 0.98));
        box-shadow: 0 16px 28px rgba(0, 0, 0, 0.5), 0 0 30px rgba(201, 169, 97, 0.25), inset 0 1px 0 rgba(255, 240, 202, 0.2);
        z-index: 2600;
        pointer-events: auto;
        cursor: pointer;
        padding: 0;
        gap: 0;
        margin: 0;
        font-size: 0;
        transition: all 0.3s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .cart-button-tablet-fixed:active {
        transform: scale(0.92);
    }

    .cart-button-tablet-fixed:hover {
        background: linear-gradient(135deg, rgba(212, 154, 61, 1), rgba(136, 90, 43, 1));
        box-shadow: 0 20px 32px rgba(0, 0, 0, 0.6), 0 0 40px rgba(201, 169, 97, 0.35), inset 0 1px 0 rgba(255, 240, 202, 0.3);
    }

    .cart-button-tablet-fixed svg {
        width: 28px;
        height: 28px;
        stroke-width: 2;
        stroke: currentColor;
        color: #fff3d2;
    }

    /* Badge для количества товаров на tablet cart button */
    .cart-button-tablet-fixed .cart-badge-tablet {
        position: absolute;
        top: -6px;
        right: -6px;
        min-width: 24px;
        height: 24px;
        border-radius: 50%;
        background: linear-gradient(135deg, #d4a052, #e6b85c);
        border: 2px solid rgba(15, 14, 11, 0.95);
        color: #fff3d2;
        font-size: 0.7rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .cart-button-tablet-fixed .cart-badge-tablet.hidden {
        display: none;
    }
}


/* ============================================
   КНОПКА КОРЗИНА
   ============================================ */

.cart-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 0.4rem;
    color: #c9a961;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    position: relative;
}

.cart-button:hover {
    background: rgba(201, 169, 97, 0.1);
    border-color: rgba(201, 169, 97, 0.6);
}

.cart-button:active {
    transform: scale(0.98);
}

.cart-button-text {
    display: inline-block;
}

.cart-button-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.cart-button .cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d4af37;
    color: #0f0e0b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    z-index: 10;
}

.cart-button .cart-badge.hidden {
    display: none;
}

/* На мобильных устройствах скрыть кнопку КОРЗИНА из header */
@media (max-width: 640px) {
    .cart-icon-wrapper {
        display: none;
    }
}

.logo-image {
    grid-area: logo-image;
    justify-self: start;
    width: auto;
}

.logo-img {
    max-width: 62px;
    height: auto;
    background: transparent;
    border: none;
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
    grid-area: logo;
    justify-self: start;
}

.logo-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.4));
    transition: filter 0.3s ease;
}

.logo:hover .logo-icon {
    filter: drop-shadow(0 0 15px rgba(201, 169, 97, 0.8));
}

.logo-text {
    background: linear-gradient(135deg, #c9a961, #a67c52);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 1.05rem;
}

/* ============================================
   ВЫПАДАЮЩЕЕ МЕНЮ
   ============================================ */

.game-selector {
    position: relative;
    flex: 0 0 auto;
    grid-area: selector;
    justify-self: center;
    min-width: 0;
    max-width: 100%;
}

.game-selector-mobile {
    position: relative;
    display: none;
}

.selector-btn {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.2), rgba(166, 124, 82, 0.2));
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.45rem 0.85rem;
    border-radius: 0.28rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(0.68rem, 1.2vw, 0.78rem);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.45px;
}

.selector-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.3), rgba(166, 124, 82, 0.3));
}

.selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    margin-top: 0.5rem;
    min-width: 200px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.selector-dropdown-header {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .selector-dropdown-header {
        display: none !important;
    }
}

.selector-item {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--text-light);
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.selector-item:hover,
.selector-item:focus-visible,
.selector-item.active {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.selector-item.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.selector-item.disabled:hover {
    background: transparent;
}

.selector-item.selector-item--public-disabled,
span.selector-item.selector-item--public-disabled {
    cursor: not-allowed;
    opacity: 0.55;
    color: rgba(230, 222, 206, 0.55);
}

.selector-item.selector-item--public-disabled:hover,
span.selector-item.selector-item--public-disabled:hover {
    background: rgba(180, 50, 50, 0.22);
    color: #ffb4b4;
}

/* ============================================
   NAV МЕНЮ
   ============================================ */

.nav-menu {
    display: flex;
    gap: clamp(1.5rem, 2.5vw, 3rem);
    flex: 1;
    justify-content: center;
    grid-area: nav;
    padding: 0 clamp(0.5rem, 1.5vw, 2rem);
    flex-wrap: nowrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: var(--text-light);
    transition: all 0.3s ease;
    position: relative;
    font-weight: 600;
    font-size: clamp(0.75rem, 1.4vw, 0.85rem);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding-bottom: 0.25rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
    color: var(--primary-color);
    text-decoration: none;
}

/* ============================================
   AGE RATING BADGE
   ============================================ */

.age-rating {
    display: none;
}

/* ============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================ */

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    grid-area: menu;
    justify-self: end;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    border: 1px solid rgba(201, 169, 97, 0.45);
    background: rgba(15, 14, 11, 0.72);
}

.mobile-menu {
    display: none;
    background: var(--dark-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: fixed;
    top: var(--header-h, 64px);
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: calc(100vh - var(--header-h, 64px));
    overflow-y: auto;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.mobile-menu .mobile-selector {
    padding: 0.55rem 1rem 0.25rem;
}

.mobile-selector-link {
    display: block;
    width: 100%;
    padding: 0.45rem 0.7rem;
    border-radius: 0.48rem;
    border: 1px solid rgba(201, 169, 97, 0.4);
    background: rgba(18, 14, 12, 0.55);
    color: #f1e3c2;
    font-size: 0.74rem;
    line-height: 1.25;
    text-decoration: none;
    text-align: center;
}

.mobile-selector-link.disabled {
    margin-top: 0.4rem;
    opacity: 0.65;
    pointer-events: none;
}

.mobile-nav-link {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-light);
    transition: var(--transition);
    text-decoration: none;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible,
.mobile-nav-link.active {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* ============================================
   HERO (верхний блок главной: свечение + контент)
   ============================================ */

.hero {
    position: relative;
    height: auto;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0;
    margin-top: 0;
    border-radius: 0;
    background: linear-gradient(180deg, 
        rgba(201, 169, 97, 0.5) 0%,
        rgba(201, 169, 97, 0.4) 25%,
        rgba(201, 169, 97, 0.3) 45%,
        rgba(201, 169, 97, 0.2) 60%,
        rgba(201, 169, 97, 0.1) 75%,
        rgba(15, 14, 11, 0.4) 85%,
        rgba(15, 14, 11, 0.7) 92%,
        #0f0e0b 100%
    ) !important;
    z-index: 1;
    isolation: isolate;
    padding: clamp(3rem, 8vw, 6rem) 0;
}

body.page-home {
    background: #0f0e0b;
}

/* Remove hero glow completely */
body.page-home .hero-gold-glow {
    display: none;
}

body.page-home .hero-gold-glow__pulse {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    color: white;
    max-width: 800px;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(212, 154, 61, 0.6), 0 0 20px rgba(107, 165, 71, 0.4);
    animation: slideInDown 0.8s ease;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: var(--text-light);
    animation: slideInUp 0.8s ease 0.2s both;
    font-weight: 300;
    letter-spacing: 1px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-home .hero-gold-glow {
        animation: none;
        opacity: 0.32;
        transform: none;
        filter: blur(40px);
        box-shadow: none;
        transition: none;
        will-change: auto;
    }

    body.page-home .hero-gold-glow__pulse {
        animation: none !important;
        opacity: 0.38;
        transform: none;
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    position: relative;
    z-index: 2;
    margin-top: 0;
    background: var(--dark-bg);
    /* Убираем “дырку” с фоном body над футером:
       футер больше не имеет margin-top, поэтому добавляем пространство внутрь main-content */
    padding: 0 0 6rem;
}

body.page-has-hero .main-content > .container {
    padding-top: 0;
}

/* Верхняя маска main-content для бесшовного перехода с видео (только когда hero не внутри main) */
.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(180deg, rgba(15, 14, 11, 0.5) 0%, var(--dark-bg) 100%);
    pointer-events: none;
}

body.page-has-hero .main-content::before {
    display: none;
}

/* Главная (index): один базовый фон страницы — body + прозрачные main/footer
   (иначе fantasy.css даёт градиент на body, main — плашка, footer — холодный slate) */
html:has(body.page-home) {
    background-color: var(--dark-bg);
}

body.page-home {
    background-color: var(--dark-bg);
    background-image: none;
}

body.page-home .main-content {
    background: transparent;
}

body.page-home .footer {
    background: transparent;
    border-top: 1px solid rgba(201, 169, 97, 0.22);
}

/* Главная: в hero нет фото/видео — отключаем псевдо из fantasy для .hero */
body.page-home .hero::before {
    content: none;
}

body.page-home .hero-gold-glow {
    opacity: 0.48;
}

/* Главная: overflow:hidden — размытый хвост не должен раздувать scrollWidth и «дёргать» шапку/скроллбар */
body.page-home .main-content > .hero {
    overflow: hidden;
    isolation: isolate;
}

body.page-home .main-content > .container {
    z-index: auto;
}

/* ============================================
   СЕКЦИИ
   ============================================ */

.game-description,
.cards-gallery,
.stats,
.about-section,
.page-reveal-section {
    margin-bottom: 4rem;
}

.page-reveal-section {
    margin-top: clamp(4rem, 8vw, 6rem);
}

/* Якорь для кнопки «вниз»: заголовок остаётся под фиксированной шапкой (scroll-margin + --header-h) */
.game-description h2 {
    scroll-margin-top: calc(var(--header-h, 64px) + var(--anchor-header-gap, 16px));
}

/* Премиум reveal: элементы не "видны заранее"
   Без transition на opacity/transform — иначе конфликт с @keyframes и мигание при скролле */
.point-item,
.tip-item,
.about-section,
.rules-subsection:not(#card-types),
.rule-block,
.example-block,
.table-of-contents,
.card-type-block {
    opacity: 1;
    transform: none;
}

/* П.4 «Типы карт»: анимация по блокам .card-type-block, не вся секция целиком */
#card-types.rules-subsection {
    opacity: 1;
    transform: none;
}

.animated.point-item,
.animated.tip-item,
.animated.about-section,
.animated.rules-subsection,
.animated.rule-block,
.animated.example-block,
.animated.table-of-contents,
.animated.card-type-block {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .point-item,
    .tip-item,
    .about-section,
    .rules-subsection,
    .rule-block,
    .example-block,
    .table-of-contents,
    .card-type-block {
        opacity: 1;
        transform: none;
    }

    #card-types.rules-subsection {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-description p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    color: rgba(220, 215, 210, 0.9);
}

/* ============================================
   ГАЛЕРЕЯ КАРТ (ГЛАВНАЯ)
   ============================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-item {
    text-align: center;
    cursor: pointer;
    width: 100%;
}

.card-preview {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    aspect-ratio: 372 / 347;
    width: 100%;
    background: var(--dark-bg);
}

.card-preview:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.3);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
    display: block;
}

.card-preview:hover .card-image {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.card-preview:hover .card-overlay {
    opacity: 1;
}

.card-preview {
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-preview:hover {
    transform: scale(1.08);
}

.card-type {
    padding: 0.5rem 1rem;
    border-radius: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.card-type-hybrid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-type-hybrid .card-type {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.type-heroes { background: var(--color-heroes); color: white; }
.type-beasts { background: var(--color-beasts); color: white; }
.type-demons { background: var(--color-demons); color: white; }
.type-spirits { background: var(--color-spirits); color: white; }
.type-undead { background: var(--color-undead); color: white; }
.type-dragons { background: var(--color-dragons); color: white; }
.type-orcs { background: var(--color-orcs); color: white; }
.type-weapons { background: var(--color-weapons); color: white; }
.type-traps { background: var(--color-traps); color: white; }
.type-artifacts { background: var(--color-artifacts); color: white; }
.type-spells { background: var(--color-spells); color: white; }
.type-catacombs { background: var(--color-catacombs); color: white; }

.card-name {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============================================
   QUICK RULES SECTION
   ============================================ */

.quick-rules-section {
    text-align: left;
    margin-bottom: 3rem;
}

.section-header-link {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-link {
    display: inline-block;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(201, 169, 97, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 169, 97, 0.3);
    transition: color 0.22s ease, border-color 0.22s ease;
}

.section-link:hover {
    color: rgba(255, 236, 191, 1);
    border-color: rgba(201, 169, 97, 0.6);
    text-decoration: none;
}

.section-intro {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(220, 215, 210, 0.9);
    margin-bottom: 2rem;
    max-width: 800px;
}

.cards-gallery h2,
.game-description h2 {
    text-align: left;
}

/* ============================================
   HOME CTA BOARD
   ============================================ */

.home-cta-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.cta-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(15, 14, 11, 0.6);
    border: 1px solid rgba(201, 169, 97, 0.3);
    border-radius: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
}

.cta-block.animated {
    opacity: 1;
    transform: translateY(0);
}

.cta-block::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cta-block:hover {
    transform: translateY(-6px);
    border-color: rgba(201, 169, 97, 0.6);
    box-shadow: 0 12px 32px rgba(201, 169, 97, 0.2);
    background: rgba(15, 14, 11, 0.8);
    text-decoration: none;
}

.cta-block:hover::before {
    opacity: 1;
}

.cta-block-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: rgba(201, 169, 97, 0.9);
    background: rgba(201, 169, 97, 0.1);
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.cta-block:hover .cta-block-icon {
    transform: scale(1.1);
    background: rgba(201, 169, 97, 0.2);
    color: rgba(255, 236, 191, 1);
}

.cta-block-title {
    font-family: var(--title-font);
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255, 236, 191, 0.95);
    margin: 0 0 0.75rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cta-block-desc {
    font-size: 0.95rem;
    color: rgba(201, 169, 97, 0.8);
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.cta-block-arrow {
    font-size: 1.5rem;
    color: rgba(201, 169, 97, 0.6);
    font-weight: 700;
    margin-top: auto;
    transition: transform 0.3s ease, color 0.3s ease;
}

.cta-block:hover .cta-block-arrow {
    transform: translateX(5px);
    color: rgba(255, 236, 191, 1);
}

@media (max-width: 519px) {
    .home-cta-board {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .cta-block {
        padding: 1.5rem 1.25rem;
    }
    
    .cta-block-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .cta-block-title {
        font-size: 1.2rem;
    }
    
    .cta-block-desc {
        font-size: 0.9rem;
    }
}

/* ============================================
   СТАТИСТИКА
   ============================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: none;
}

.stat-item.animated {
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(220, 38, 38, 0.2));
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* ============================================
   ПРАВИЛА
   ============================================ */

.rules-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.rules-tab-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    padding: 0.8rem 1.5rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.rules-tab-btn:hover,
.rules-tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.rules-section {
    display: none;
}

.rules-section.active {
    display: block;
}

.infographic-flow {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Если блок не заполнен через JS (например, при ошибке/старых данных) */
.infographic-flow:empty {
    display: none;
}

.flow-step {
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.flow-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    display: none;
}

@media (min-width: 768px) {
    .flow-arrow {
        display: block;
    }
}

.key-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.point-item {
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.3rem;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.point-item.animated {
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.point-item:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(5px);
}

.point-icon {
    font-size: 2rem;
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}

.point-icon img {
    width: 1em;
    height: 1em;
    display: block;
    object-fit: contain;
}

.point-item h4 {
    margin-bottom: 0.5rem;
}

.point-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ============================================
   ТАБЛИЦА СОДЕРЖАНИЯ
   ============================================ */

.table-of-contents {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06), rgba(15, 14, 11, 0.55));
    padding: 2rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(201, 169, 97, 0.22);
    margin-bottom: 2rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.table-of-contents ul {
    list-style: none;
    columns: 2;
    column-gap: 1.4rem;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
    break-inside: avoid;
}

.table-of-contents a {
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.table-of-contents a:hover {
    text-decoration: none;
    color: #ffe6b6;
    background: rgba(201, 169, 97, 0.14);
}

/* ============================================
   ПРАВИЛА - ПОДСЕКЦИИ
   ============================================ */

.rules-subsection {
    margin-bottom: 2rem;
    padding: 1.7rem 1.6rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.045), rgba(139, 92, 246, 0.045));
    border-radius: 0.85rem;
    border: 1px solid rgba(201, 169, 97, 0.22);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

/* Оглавление правил: якорь не прячется под фиксированной шапкой */
.rules-subsection[id] {
    scroll-margin-top: calc(var(--header-h, 64px) + var(--anchor-header-gap));
}

.rule-block {
    margin-bottom: 1.2rem;
    padding: 1.35rem 1.25rem;
    background: rgba(15, 14, 11, 0.36);
    border-radius: 0.8rem;
    border: 1px solid rgba(201, 169, 97, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 236, 191, 0.05);
}

.rule-block h4,
.example-block h4 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.rule-block ul,
.rule-block ol {
    margin-left: 2rem;
}

.rule-block li {
    margin-bottom: 0.5rem;
}

.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.phase {
    padding: 1rem;
    background: rgba(201, 169, 97, 0.1);
    border-radius: 0.3rem;
    border: 1px solid var(--border-color);
}

.phase h4 {
    margin-bottom: 0.5rem;
}

.phase p {
    font-size: 0.95rem;
}

.card-type-block {
    padding: 1.5rem;
    background: rgba(201, 169, 97, 0.08);
    border-radius: 0.3rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.card-type-block h4 {
    color: var(--primary-color);
}

.rules-heading-with-icon {
    display: flex;
    align-items: flex-start;
    gap: 0.42rem;
    line-height: 1.35;
}

.rules-heading-with-icon .rules-heading-icon-img {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    object-fit: contain;
    margin-top: 0.1em;
}

.rules-heading-with-icon > span {
    min-width: 0;
    flex: 1;
}

.rules-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    vertical-align: middle;
}

.rules-download-btn-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    object-fit: contain;
}

.example-block {
    padding: 1.35rem 1.25rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(15, 14, 11, 0.34));
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: 0.85rem;
    margin-bottom: 1.6rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
}

.example-block strong {
    color: #22c55e;
}

/* ============================================
   ЗАГРУЗКИ
   ============================================ */

.rules-downloads {
    text-align: center;
    padding: 2rem;
    background: transparent;
    border-radius: 0.5rem;
    margin-top: 2rem;
}

/* ============================================
   КАРТЫ (СТРАНИЦА КАРТ)
   ============================================ */

.cards-controls {
    margin-bottom: 2rem;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-input-wrap {
    position: relative;
}

.search-box-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.85;
}

.search-box .search-input-wrap input {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 2.5rem;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    color: var(--text-light);
    font-size: 1rem;
}

.search-box .search-input-wrap input::placeholder {
    color: var(--text-muted);
}

.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-light);
}

.filter-group select {
    padding: 0.6rem;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 0.3rem;
    cursor: pointer;
    height: auto;
}

#resetFilters {
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    line-height: normal;
    height: auto;
    box-sizing: border-box;
    min-height: 0;
}

.cards-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.card-tab-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    padding: 0.6rem 1rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
}

.card-tab-btn:hover,
.card-tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   СЕТКА КАРТ
   ============================================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 425px+ (большие телефоны) - 3 карты в ряд */
@media (min-width: 425px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 768px+ (планшеты) - 4 карты в ряд */
@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 1024px+ (ПК) - 5 карт в ряд */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.card-container {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-container:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.card-container:hover .card-img {
    transform: scale(1.05);
}

.card-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-info h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card-type {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-stats {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-stat-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.card-stat-icon {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.card-stat-text {
    min-width: 0;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.card-ability {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.card-note {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.card-note--hybrid {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.card-note-hybrid-text {
    min-width: 0;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal.closing {
    opacity: 0;
}

.modal-content {
    background: var(--dark-card);
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    width: 90vw;
    display: flex;
    flex-direction: column;
}

.modal.closing .modal-content {
    animation: modalOut 0.24s ease forwards;
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--secondary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 0.3rem;
    margin: 1rem;
    z-index: 1001;
}

.modal-body {
    padding: 2rem;
    padding-top: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.modal-card-image {
    width: 100%;
    border-radius: 0.8rem;
    max-height: 100%;
    object-fit: cover;
    grid-column: 1;
    grid-row: 1 / -1;
    border: 1px solid rgba(201, 169, 97, 0.35);
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 236, 191, 0.08);
    filter: saturate(1.05) contrast(1.04);
    align-self: center;
}

@keyframes modalIn {
    from { opacity: 0; transform: perspective(1000px) rotateY(-90deg); }
    to { opacity: 1; transform: perspective(1000px) rotateY(0deg); }
}

@keyframes modalOut {
    from { opacity: 1; transform: perspective(1000px) rotateY(0deg); }
    to { opacity: 0; transform: perspective(1000px) rotateY(90deg); }
}

.modal-card-info {
    grid-column: 2;
}

.modal-card-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.modal-stats {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.3rem;
}

#modalCardStats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.95rem;
}

#modalCardStats .modal-card-stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.modal-stat-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

#modalCardStats .modal-stat-label strong {
    font-weight: 600;
}

.card-ability {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 1rem 0;
}

/* ============================================
   УТИЛИТЫ
   ============================================ */

.text-center {
    text-align: center;
}

#noResults {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: linear-gradient(180deg, rgba(26, 24, 19, 0.88) 0%, rgba(15, 14, 11, 0.96) 100%);
    border-top: 1px solid rgba(201, 169, 97, 0.2);
    margin-top: 0;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    text-align: center;
    width: 100%;
    flex-wrap: wrap;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    flex: 0 0 auto;
    text-align: center;
}

/* На экранах 1024px и выше - все в одну строку */
@media (min-width: 1024px) {
    .footer-content {
        flex-wrap: nowrap;
        gap: 1.5rem;
    }
}

/* На экранах до 1023px - две строки */
@media (max-width: 1023px) {
    .footer-content {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0.6rem 0.8rem;
        align-items: center;
        width: 100%;
    }

    /* Первая строка: VK Telegram design & dev by vladkragv ✦ (слева) | 14+ (справа) */
    .footer-links {
        grid-row: 1;
        grid-column: 1;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .footer-age-rating {
        grid-row: 1;
        grid-column: 2;
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        padding: clamp(0.15rem, 0.4vw, 0.2rem) clamp(0.3rem, 0.7vw, 0.4rem);
        min-width: clamp(32px, 6vw, 36px);
        justify-self: end;
    }

    /* Вторая строка: © 2026 ЭНТУЗИАСТ — ККИ (слева) | Язык: Русский (справа) */
    .footer-copyright {
        grid-row: 2;
        grid-column: 1;
        text-align: left;
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
        margin: 0;
        justify-self: start;
    }

    .footer-lang {
        grid-row: 2;
        grid-column: 2;
        justify-self: end;
    }

    /* Третья строка: Политика и Соглашение (по центру на всю ширину) */
    .footer-legal {
        grid-row: 3;
        grid-column: 1 / -1;
        justify-self: center;
        margin-top: 0.3rem;
    }
}

.footer-content > p,
.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    flex: 0 0 auto;
    text-align: center;
}

.footer-content > div {
    margin: 0;
    flex: 0 0 auto;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-link {
    color: var(--text-light);
    font-weight: 600;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: rgba(181, 168, 146, 0.88);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--text-light);
    text-decoration: none;
}

.footer-byline {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(181, 168, 146, 0.55);
    white-space: nowrap;
}

.footer-byline-link {
    color: rgba(181, 168, 146, 0.55);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-byline-link:hover {
    color: rgba(181, 168, 146, 0.8);
}

/* Footer Legal Links */
.footer-legal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-legal-link {
    color: rgba(181, 168, 146, 0.65);
    font-size: 0.7rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer-legal-link:hover {
    color: rgba(201, 169, 97, 0.9);
    text-decoration: none;
}

.footer-legal-separator {
    color: rgba(181, 168, 146, 0.4);
    font-size: 0.7rem;
}

.footer-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.footer-lang-label {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(181, 168, 146, 0.75);
}

/* Custom Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(201, 169, 97, 0.28);
    background: rgba(15, 14, 11, 0.55);
    color: rgba(229, 220, 208, 0.92);
    border-radius: 0.35rem;
    padding: 0.2rem 0.4rem 0.2rem 0.35rem;
    font-size: 0.75rem;
    min-width: 112px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 120;
}

.lang-dropdown-btn:hover {
    border-color: rgba(201, 169, 97, 0.5);
    background: rgba(15, 14, 11, 0.7);
    color: rgba(255, 236, 191, 1);
}

.lang-dropdown-btn:focus {
    outline: none;
    border-color: rgba(212, 154, 61, 0.6);
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.15);
}

.lang-dropdown-current {
    flex: 1;
    text-align: left;
}

.lang-dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: rgba(201, 169, 97, 0.7);
}

.lang-dropdown[aria-expanded="true"] .lang-dropdown-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 0;
    min-width: 100%;
    background: linear-gradient(180deg, rgba(26, 24, 19, 0.98) 0%, rgba(15, 14, 11, 0.99) 100%);
    border: 1px solid rgba(201, 169, 97, 0.35);
    border-radius: 0.4rem;
    padding: 0.35rem 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(201, 169, 97, 0.1);
    z-index: 130;
}

.lang-dropdown[aria-expanded="true"] .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    margin: 0;
    padding: 0;
}

.lang-dropdown-option {
    display: block;
    padding: 0.5rem 0.8rem;
    color: rgba(229, 220, 208, 0.9);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.lang-dropdown-option:hover {
    background: linear-gradient(90deg, rgba(201, 169, 97, 0.25), rgba(166, 124, 82, 0.2));
    color: rgba(255, 236, 191, 1);
}

.lang-dropdown-option:focus {
    outline: none;
    background: linear-gradient(90deg, rgba(201, 169, 97, 0.3), rgba(166, 124, 82, 0.25));
    color: rgba(255, 236, 191, 1);
}

.lang-dropdown-item:first-child .lang-dropdown-option {
    border-radius: 0.3rem 0.3rem 0 0;
}

.lang-dropdown-item:last-child .lang-dropdown-option {
    border-radius: 0 0 0.3rem 0.3rem;
}

.footer-age-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 14, 11, 0.4);
    color: rgba(181, 168, 146, 0.85);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.22rem 0.5rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(201, 169, 97, 0.28);
    box-shadow: none;
    text-align: center;
    min-width: 2.25rem;
}



/* ============================================
   СТРАНИЦА "О ИГРЕ"
   ============================================ */

.about-section,
.page-reveal-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(201, 169, 97, 0.22);
    border-radius: 0.5rem;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.about-hero {
    position: relative;
    overflow: hidden;
    border-radius: 0.9rem;
    border: 1px solid rgba(201, 169, 97, 0.35);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 236, 191, 0.06) inset;
}

.about-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(880px 320px at 15% 20%, rgba(212, 154, 61, 0.28), transparent 60%),
        radial-gradient(780px 320px at 80% 30%, rgba(201, 169, 97, 0.22), transparent 60%),
        linear-gradient(135deg, rgba(15, 14, 11, 0.35), rgba(15, 14, 11, 0.85));
    pointer-events: none;
}

.about-hero > * {
    position: relative;
    z-index: 1;
}

.about-hero-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.about-hero-card {
    padding: 1.2rem 1.1rem;
    background: rgba(15, 14, 11, 0.55);
    border: 1px solid rgba(201, 169, 97, 0.22);
    border-radius: 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 236, 191, 0.06);
}

.about-hero-card h3 {
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.cta-panel {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.8rem;
    margin-top: 1.4rem;
    justify-content: center;
    align-items: center;
}

.cta-btn {
    min-height: 46px;
    white-space: nowrap;
}

.cta-buy,
.cta-tg,
.cta-vk {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    background: linear-gradient(135deg, #d8b56a, #b88a3f) !important;
}

.cta-buy {
    color: #ffffff !important;
}

.cta-tg {
    color: #ffffff !important;
}

.cta-vk {
    color: #ffffff !important;
}

.cta-buy::after {
    content: "";
    position: absolute;
    top: -120%;
    left: -40%;
    width: 35%;
    height: 320%;
    transform: rotate(22deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%);
}

.cta-tg::after,
.cta-vk::after,
.hero .btn-primary::after {
    content: "";
    position: absolute;
    top: -120%;
    left: -40%;
    width: 35%;
    height: 320%;
    transform: rotate(22deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%);
    animation: none;
}

.hero .btn-primary {
    position: relative;
    overflow: hidden;
    background: rgba(15, 14, 11, 0.85);
    border-color: rgba(201, 169, 97, 0.4);
    color: rgba(255, 236, 191, 0.95);
    box-shadow: 0 0 20px rgba(201, 169, 97, 0.15), inset 0 1px 0 rgba(255, 236, 191, 0.1);
    width: min(100%, 360px);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn-secondary {
    width: min(100%, 360px);
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.85rem;
}

/* Ссылка-кнопка: не наследовать подчёркивание и смену цвета текста от глобального a:hover */
.hero a.btn-primary:hover,
.hero a.btn-primary:focus-visible {
    color: #fff3d2;
    border-color: rgba(212, 154, 61, 0.95);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.26), rgba(166, 124, 82, 0.22));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 154, 61, 0.4);
    text-decoration: none;
}

.cta-panel .cta-btn:hover,
.cta-panel .cta-btn:focus-visible,
.cta-panel .cta-btn:active {
    background: linear-gradient(135deg, #d8b56a, #b88a3f) !important;
    border-color: rgba(255, 236, 191, 0.55) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(212, 154, 61, 0.28);
    text-decoration: none;
}

@keyframes premiumShine {
    0% { left: -45%; }
    100% { left: 140%; }
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    color: rgba(255, 236, 191, 0.95);
    max-width: 70ch;
    padding: 1.2rem 1.5rem;
    background: rgba(15, 14, 11, 0.4);
    border-left: 3px solid var(--primary-color);
    border-radius: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.strategy-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
}

.tip-item {
    padding: 1.5rem 1.3rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.12), rgba(139, 92, 246, 0.08));
    border: 2px solid rgba(201, 169, 97, 0.25);
    border-radius: 0.6rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tip-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tip-item:hover::before {
    opacity: 1;
}

.tip-item:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.18), rgba(139, 92, 246, 0.12));
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.25);
}

.tip-item p {
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(255, 236, 191, 0.9);
    margin: 0;
}

.tip-item:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 197, 94, 0.2));
    border-color: var(--primary-color);
}

.about-item-heading {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 0.9rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.about-item-heading__icon {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(201, 169, 97, 0.3));
}

.about-item-heading__icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin-top: 0.08em;
    object-fit: contain;
}

.about-item-heading__text {
    flex: 1;
    min-width: 0;
}

.faq {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    padding: 1.5rem;
    background: light-dark(rgba(139, 92, 246, 0.05), rgba(139, 92, 246, 0.1));
    border-left: 4px solid var(--primary-color);
    border-radius: 0.3rem;
}

.faq-item h4.about-item-heading {
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: var(--text-muted);
    margin: 0;
}

.contact-section {
    text-align: center;
    scroll-margin-top: calc(var(--header-h, 64px) + var(--anchor-header-gap, 20px));
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}

/* Мобильные устройства: 3 кнопки в 3 ряда */
@media (max-width: 767px) {
    .contact-cards {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

.contact-card {
    display: block;
    text-decoration: none;
    color: var(--text-light);
    padding: 1.15rem 1.1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(15, 14, 11, 0.6), rgba(15, 14, 11, 0.92));
    border: 1px solid rgba(201, 169, 97, 0.22);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 154, 61, 0.7);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.4), 0 10px 24px rgba(212, 154, 61, 0.12);
}

.contact-card-top {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 169, 97, 0.14);
    border: 1px solid rgba(201, 169, 97, 0.22);
    font-size: 1.1rem;
}

.contact-icon img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.contact-title {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.contact-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.contact-cta {
    margin-top: 0.8rem;
    font-weight: 700;
    color: #ffe6b6;
}

.contact-legal {
    margin-top: 0.85rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(201, 169, 97, 0.16);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.8rem;
    font-size: 0.76rem;
    line-height: 1.35;
    color: rgba(232, 223, 205, 0.62);
}

.contact-legal span,
.contact-legal a {
    opacity: 0.86;
}

.contact-legal a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted rgba(232, 223, 205, 0.34);
}

.contact-legal a:hover {
    opacity: 1;
    border-bottom-color: rgba(232, 223, 205, 0.62);
}

@media (max-width: 768px) {
    .about-hero-grid {
        grid-template-columns: 1fr;
    }

    .contact-cards {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .contact-legal {
        justify-content: flex-start;
        font-size: 0.74rem;
    }
}

/* ============================================
   ГЛОБАЛЬНЫЕ АДАПТИВНЫЕ ПЕРЕМЕННЫЕ
   ============================================ */

:root {
    /* Адаптивные отступы */
    --spacing-xs: clamp(0.25rem, 0.8vw, 0.5rem);
    --spacing-sm: clamp(0.5rem, 1vw, 1rem);
    --spacing-md: clamp(0.75rem, 1.5vw, 1.5rem);
    --spacing-lg: clamp(1rem, 2vw, 2rem);
    --spacing-xl: clamp(1.5rem, 3vw, 3rem);
    
    /* Адаптивные размеры шрифтов */
    --font-size-xs: clamp(0.7rem, 1.5vw, 0.8rem);
    --font-size-sm: clamp(0.8rem, 1.8vw, 0.95rem);
    --font-size-base: clamp(0.9rem, 2vw, 1.1rem);
    --font-size-lg: clamp(1.1rem, 2.5vw, 1.3rem);
    --font-size-xl: clamp(1.3rem, 3vw, 1.6rem);
    --font-size-2xl: clamp(1.6rem, 4vw, 2rem);
    --font-size-3xl: clamp(2rem, 5vw, 2.5rem);
    
    /* Минимальные размеры для касания */
    --touch-target: min(44px, 6vw);
}

/* Применяем адаптивные переменные */
* {
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 2.5vw, 18px);
    overflow-x: hidden;
}

body {
    font-size: var(--font-size-base);
    line-height: clamp(1.4, 2.5vw, 1.6);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p, li, td, th {
    font-size: var(--font-size-base);
}

/* Кнопки с адаптивными размерами */
.btn,
button,
input[type="submit"],
input[type="button"] {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1.25rem);
    font-size: var(--font-size-sm);
}

/* Адаптивные отступы секций */
.section {
    padding: var(--spacing-lg) var(--spacing-md);
}

/* Адаптивные контейнеры */
.container {
    padding: 0 clamp(1rem, 2vw, 2rem);
    max-width: clamp(100%, 95vw, 1200px);
}

/* ============================================
   АДАПТИВНОСТЬ - ПЛАНШЕТЫ (1024px и ниже)
   ============================================ */

@media (max-width: 1024px) {
    .container {
        padding: 0 clamp(0.75rem, 1.5vw, 1.5rem);
    }

    h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); }
    h2 { font-size: clamp(1.4rem, 3.5vw, 1.8rem); }
    h3 { font-size: clamp(1.2rem, 2.8vw, 1.4rem); }

    .hero-title {
        font-size: clamp(4rem, 14vw, 7rem);
        font-weight: 900;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: clamp(0.75rem, 1.5vw, 0.9rem);
        max-width: 100%;
        margin: 0 auto;
        line-height: 1.4;
        padding: 0 1rem;
    }
}

/* Планшеты (768px - 1023px): 4 героя в ряд */
@media (min-width: 768px) and (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
        max-width: 100%;
    }
}

/* Средние и большие телефоны (375px - 767px): 3 карты в ряд */
@media (min-width: 375px) and (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.8rem;
        max-width: 100%;
        padding: 0;
    }

    .gallery-item {
        min-width: 0;
    }

    .card-preview {
        width: 100%;
    }
}

/* Маленькие телефоны (до 374px): 2 карты в ряд */
@media (max-width: 374px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        max-width: 100%;
        padding: 0;
    }

    .gallery-item {
        min-width: 0;
    }

    .card-preview {
        width: 100%;
    }
}

/* ============================================
   АДАПТИВНОСТЬ - МОБИЛЬНЫЕ УСТРОЙСТВА (768px и ниже)
   ============================================ */

@media (max-width: 768px) {
    /* Шапкой управляет JS (header-compact), не media-запреты */
    .header-content {
        gap: clamp(0.5rem, 1.2vw, 0.8rem);
        padding: clamp(0.5rem, 1vw, 0.8rem) 0;
        min-height: clamp(56px, 8vw, 64px);
    }

    .mobile-menu.active {
        display: block;
    }

    .age-rating {
        display: none;
    }

    h1 { font-size: clamp(1.4rem, 4vw, 1.8rem); }
    h2 { font-size: clamp(1.1rem, 3vw, 1.3rem); padding-bottom: clamp(0.2rem, 0.5vw, 0.3rem); }
    h3 { font-size: clamp(0.95rem, 2.5vw, 1.1rem); }
    h4 { font-size: clamp(0.85rem, 2vw, 0.95rem); }

    .hero-title {
        font-size: clamp(4.5rem, 15vw, 7rem);
        font-weight: 900;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        max-width: 100%;
        margin: 0 auto;
        line-height: 1.4;
        white-space: normal;
        padding: 0 1rem;
    }

    .hero-subtitle br {
        display: block;
    }

    /* Кнопка "↑" стоит сразу после .stats, поэтому уменьшаем нижний отступ,
       чтобы она была ближе к блоку "20–40 Минут". */
    .stats {
        margin-bottom: 1.2rem;
    }

    /* Правила (Краткие/Подробные) - адаптив */
    .rules-tabs {
        margin-bottom: 1.2rem;
    }

    /* Улучшенная читаемость для about-секций на мобильных */
    .about-content p {
        font-size: 0.92rem;
        line-height: 1.75;
        margin-bottom: 1.2rem;
        padding: 1rem;
    }

    .strategy-tips {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .tip-item {
        padding: 1.2rem 1rem;
    }

    .tip-item p {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .about-item-heading {
        font-size: 1rem;
        gap: 0.6rem;
        margin-bottom: 0.7rem;
    }

    .about-item-heading__icon {
        width: 22px;
        height: 22px;
    }

    .rules-tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .key-points {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .point-item {
        padding: 1.1rem 1rem;
    }

    .rules-downloads {
        padding: 1.2rem;
        margin-top: 1.5rem;
    }

    .gallery-item {
        margin-bottom: 0.5rem;
    }

    .infographic-flow {
        flex-direction: column;
    }

    .cards-controls {
        grid-template-columns: 1fr;
        flex-wrap: wrap;
        gap: 1rem;
    }


    .card-item {
        padding: 0.5rem;
    }
    
    .card-img {
        height: 150px;
        object-fit: cover;
    }

    .search-box {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .search-box .search-input-wrap input {
        padding: 0.6rem 0.6rem 0.6rem 2.35rem;
        font-size: 16px;
        width: 100%;
    }

    .filter-group {
        font-size: 0.9rem;
        flex: 1;
        min-width: 150px;
    }

    .filter-group select,
    .filter-group input {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .footer {
        padding: 0.7rem 0;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
    }

    /* Первая строка: VK Telegram design & dev by vladkragv ✦ | 14+ */
    .footer-links {
        order: 1;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
    }

    .footer-age-rating {
        order: 1;
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        padding: clamp(0.15rem, 0.4vw, 0.2rem) clamp(0.3rem, 0.7vw, 0.4rem);
        min-width: clamp(32px, 6vw, 36px);
        margin-left: 0.3rem;
    }

    /* Вторая строка: © 2026 ЭНТУЗИАСТ — ККИ (слева) | Язык: Русский (справа) */
    .footer-bottom-row {
        order: 2;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }

    .footer-bottom-row > p {
        text-align: left;
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
        margin: 0;
        color: var(--text-muted);
    }

    .footer-lang {
        display: inline-flex;
    }

    .footer-age-rating {
        grid-area: badge;
        font-size: 0.75rem;
        padding: 0.18rem 0.4rem;
        min-width: 36px;
        line-height: 1;
    }

    .footer-content > .footer-lang {
        grid-column: 1 / -1;
        justify-content: center;
        margin-top: 0.15rem;
    }

    /* Держим единый основной фон main-content до самого футера */
    .main-content {
        background: var(--dark-bg);
    }

    .table-of-contents ul {
        columns: 1;
    }

    .modal-content {
        width: 95vw;
        max-width: 95vw;
        max-height: 85vh;
        overflow-y: auto;
        padding: 0;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
        padding-top: 3.5rem;
    }

    .modal-card-image {
        grid-column: 1;
        grid-row: 1;
        max-height: 250px;
        margin-bottom: 0;
    }

    .modal-card-info {
        grid-column: 1;
    }

    .modal-card-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    .modal-stats {
        margin: 0.8rem 0;
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    #modalCardStats {
        gap: 0.3rem;
    }

    .card-ability {
        font-size: 0.85rem;
        margin: 0.8rem 0;
    }

    .btn {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        padding: clamp(0.45rem, 1vw, 0.6rem) clamp(0.6rem, 1.5vw, 1rem);
        min-height: var(--touch-target);
        width: 100%;
        margin-top: clamp(0.5rem, 1vw, 0.8rem);
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2;
    }

    .stat-item {
        padding: 0.8rem 0.3rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
}

/* На ПК делаем аналогичное “затухание” main-content к футеру,
   чтобы зелено-коричневый фон был только внутри footer. */
@media (min-width: 769px) {
    .main-content {
        background: var(--dark-bg);
    }
}

/* ============================================
   АДАПТИВНОСТЬ - МАЛЕНЬКИЕ МОБИЛЬНЫЕ (480px и ниже)
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 0 clamp(0.5rem, 1.5vw, 0.75rem);
    }

    .header-content {
        padding: clamp(0.4rem, 0.8vw, 0.5rem) 0;
        gap: clamp(0.25rem, 0.6vw, 0.3rem);
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "logo nav menu";
        min-height: clamp(48px, 7vw, 56px);
    }

    .logo {
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    }

    .menu-toggle {
        font-size: clamp(1.1rem, 2.5vw, 1.3rem);
        width: var(--touch-target);
        height: var(--touch-target);
    }

    .mobile-menu {
        top: 52px;
        max-height: calc(100vh - 52px);
    }

    h1 { 
        font-size: clamp(1.1rem, 3.5vw, 1.3rem);
        margin-bottom: clamp(0.4rem, 1vw, 0.6rem);
    }

    h2 { 
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        padding-bottom: clamp(0.2rem, 0.5vw, 0.3rem);
        margin-bottom: clamp(0.4rem, 1vw, 0.6rem);
        border-bottom: 1px solid var(--primary-color);
    }

    h3 { font-size: clamp(0.85rem, 2vw, 0.95rem); }
    h4 { font-size: clamp(0.75rem, 1.8vw, 0.85rem); }
    h5 { font-size: clamp(0.7rem, 1.5vw, 0.8rem); }

    p { margin-bottom: clamp(0.4rem, 1vw, 0.6rem); font-size: 0.9rem; }

    .hero {
        min-height: clamp(45vh, 60vw, 50vh);
        padding: clamp(1.2rem, 3vw, 2rem) clamp(0.6rem, 1.5vw, 1rem);
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(0.6rem, 1.4vw, 0.7rem);
        max-width: 100%;
        padding: 0 0.5rem;
        line-height: 1.4;
    }

    .btn {
        font-size: clamp(0.8rem, 2vw, 0.95rem);
        padding: clamp(0.5rem, 1.2vw, 0.7rem) clamp(0.7rem, 1.5vw, 1rem);
        min-height: var(--touch-target);
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2;
    }

    .btn-primary {
        width: 100%;
        margin-top: clamp(0.5rem, 1.2vw, 0.8rem);
    }

    .key-points {
        margin: clamp(0.8rem, 2vw, 1.2rem) 0;
        gap: clamp(0.6rem, 1.5vw, 0.9rem);
    }

    .point-item {
        padding: clamp(0.7rem, 1.5vw, 1rem) clamp(0.6rem, 1.2vw, 0.9rem);
    }

    .rules-tabs {
        gap: clamp(0.4rem, 1vw, 0.7rem);
        margin-bottom: clamp(0.6rem, 1.5vw, 1rem);
    }

    .gallery-item {
        margin-bottom: 0;
}

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

/* Очень маленькие экраны (до 374px): только логотип и кнопка селектора */
@media (max-width: 374px) {
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 0;
        min-height: 48px;
    }

    .logo-image {
        width: 32px;
        flex-shrink: 0;
    }

    .logo-img {
        max-width: 32px;
    }

    .logo {
        display: flex;
        flex-shrink: 0;
    }

    .logo-text {
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .game-selector {
        display: block;
        flex-shrink: 0;
    }

    .selector-btn {
        padding: 0.35rem 0.75rem;
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
        min-width: auto;
        min-height: auto;
        width: auto;
        height: auto;
        border-radius: 0.35rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .selector-btn::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 12h4'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M15 13h2'/%3E%3Cpath d='M18 11h2'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        pointer-events: none;
    }

    .nav-menu,
    .cart-icon-wrapper,
    .menu-toggle {
        display: none;
    }
}

/* Средние мобильные экраны (375px - 424px): логотип, текст, кнопка селектора */
@media (min-width: 375px) and (max-width: 424px) {
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 0;
        min-height: 52px;
    }

    .logo-image {
        width: 36px;
        flex-shrink: 0;
    }

    .logo-img {
        max-width: 36px;
    }

    .logo {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
    }

    .logo-text {
        font-size: clamp(0.7rem, 1.8vw, 0.8rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .game-selector {
        display: block;
        flex-shrink: 0;
    }

    .selector-btn {
        padding: 0.35rem 0.75rem;
        font-size: clamp(0.7rem, 1.6vw, 0.8rem);
        min-width: auto;
        min-height: auto;
        width: auto;
        height: auto;
        border-radius: 0.35rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .selector-btn::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 12h4'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M15 13h2'/%3E%3Cpath d='M18 11h2'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        pointer-events: none;
    }

    .nav-menu,
    .cart-icon-wrapper,
    .menu-toggle {
        display: none;
    }
}

/* Большие мобильные экраны (425px - 767px): логотип, текст, кнопка селектора */
@media (min-width: 425px) and (max-width: 767px) {
    .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        padding: 0.6rem 0;
        min-height: 56px;
    }

    .logo-image {
        width: 40px;
        flex-shrink: 0;
    }

    .logo-img {
        max-width: 40px;
    }

    .logo {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .logo-text {
        font-size: clamp(0.72rem, 2vw, 0.82rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    .game-selector {
        display: block !important;
        flex-shrink: 0;
    }

    .selector-btn {
        padding: 0.38rem 0.8rem;
        font-size: clamp(0.72rem, 1.6vw, 0.82rem);
        min-width: auto;
        min-height: auto;
        width: auto;
        height: auto;
        border-radius: 0.35rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .selector-btn::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 12h4'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M15 13h2'/%3E%3Cpath d='M18 11h2'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .nav-menu,
    .cart-icon-wrapper,
    .menu-toggle {
        display: none !important;
    }
}

/* Диапазон 481px - 767px: кнопка "Настолка:" с текстом справа */
@media (min-width: 481px) and (max-width: 767px) {
    .header-content {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.8rem;
        padding: 0.6rem 0;
        min-height: 56px;
        grid-template-areas: none;
        grid-template-columns: none;
    }

    .logo-image {
        width: 40px;
        flex-shrink: 0;
    }

    .logo-img {
        max-width: 40px;
    }

    .logo {
        flex: 1;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .logo-text {
        font-size: clamp(0.75rem, 2.2vw, 0.85rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    .game-selector {
        display: block !important;
        flex-shrink: 0;
    }

    .selector-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: clamp(0.75rem, 1.8vw, 0.85rem) !important;
        min-width: auto !important;
        min-height: 40px !important;
        width: auto !important;
        height: auto !important;
        border-radius: 0.3rem !important;
        position: relative;
        display: flex !important;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        color: var(--text-light) !important;
        text-indent: 0 !important;
        overflow: visible !important;
    }

    .selector-btn::before {
        display: none !important;
    }

    .selector-btn::after {
        display: none !important;
    }

    .nav-menu,
    .cart-icon-wrapper,
    .menu-toggle {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .header-content {
        grid-template-columns: auto 1fr auto auto !important;
        grid-template-areas: "logo-image nav selector menu" !important;
        justify-items: start;
        gap: 1rem;
    }

    .logo,
    .logo-text {
        display: none !important;
    }

    .nav-menu {
        justify-self: start;
        gap: 0.8rem;
        align-items: center;
        padding: 0;
        white-space: nowrap;
    }

    .nav-link {
        font-size: 0.86rem;
    }

    .game-selector {
        justify-self: end;
    }

    .cart-icon-wrapper {
        justify-self: end;
    }
}

/* Общее правило для скрытия корзины на всех мобильных устройствах до 767px */
@media (max-width: 767px) {
    .cart-icon-wrapper {
        display: none !important;
    }

    .game-selector {
        display: block !important;
        flex-shrink: 0;
    }

    .selector-btn {
        padding: 0;
        font-size: 0;
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        color: transparent;
        text-indent: -9999px;
        overflow: hidden;
    }

    .selector-btn::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a961' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M6 12h4'/%3E%3Cpath d='M8 10v4'/%3E%3Cpath d='M15 13h2'/%3E%3Cpath d='M18 11h2'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        text-indent: 0;
    }

    .selector-dropdown {
        position: fixed !important;
        top: 70px !important;
        left: auto !important;
        right: 0 !important;
        bottom: auto !important;
        transform: none !important;
        min-width: auto;
        max-width: 100%;
        width: auto;
        z-index: 9999 !important;
    }

    .selector-dropdown::before {
        display: none;
    }

    .game-selector:hover .selector-dropdown,
    .game-selector.open .selector-dropdown,
    .game-selector:focus-within .selector-dropdown {
        transform: none !important;
    }
}

    .gallery-item .card-preview {
        height: 180px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(0.4rem, 1vw, 0.6rem);
        margin-bottom: clamp(0.6rem, 1.5vw, 0.95rem);
    }

    .stat-item {
        padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.2rem, 0.6vw, 0.3rem);
    }

    .stat-number {
        font-size: clamp(1rem, 3vw, 1.2rem);
    }

    .stat-label {
        font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    }


    .card-item {
        padding: clamp(0.25rem, 0.6vw, 0.4rem);
    }
    
    .card-img {
        height: clamp(90px, 22vw, 120px);
        object-fit: cover;
    }
    
    .card-info h4 {
        font-size: clamp(0.65rem, 1.5vw, 0.75rem);
        margin: clamp(0.2rem, 0.6vw, 0.3rem) 0;
    }
    
    .card-info .card-type {
        font-size: clamp(0.55rem, 1.2vw, 0.65rem);
        padding: clamp(0.15rem, 0.4vw, 0.2rem) clamp(0.3rem, 0.8vw, 0.4rem);
    }
    
    .card-stats {
        font-size: clamp(0.6rem, 1.3vw, 0.7rem);
        gap: clamp(0.2rem, 0.5vw, 0.3rem);
    }
    
    .card-stats .card-stat-row {
        flex-shrink: 1;
    }

    .search-box {
        gap: clamp(0.2rem, 0.5vw, 0.3rem);
        flex-direction: column;
    }

    .search-box .search-input-wrap input {
        padding: clamp(0.35rem, 0.8vw, 0.45rem) clamp(0.3rem, 0.8vw, 0.45rem) clamp(0.35rem, 0.8vw, 0.45rem) clamp(1.8rem, 4vw, 2.25rem);
        font-size: clamp(13px, 2.5vw, 14px);
        width: 100%;
        min-height: var(--touch-target);
    }

    .search-box button {
        padding: clamp(0.35rem, 0.8vw, 0.45rem) clamp(0.4rem, 1vw, 0.6rem);
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
        min-height: var(--touch-target);
    }

    .filter-group {
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
        padding: clamp(0.2rem, 0.5vw, 0.3rem) clamp(0.4rem, 1vw, 0.6rem);
    }

    .filter-group label {
        display: block;
        margin-bottom: clamp(0.2rem, 0.5vw, 0.3rem);
        font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    }

    .filter-group select,
    .filter-group input {
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
        padding: clamp(0.2rem, 0.5vw, 0.3rem);
        width: 100%;
        min-height: var(--touch-target);
    }

    .infographic-flow {
        padding: clamp(0.4rem, 1vw, 0.6rem);
        gap: clamp(0.5rem, 1.2vw, 0.8rem);
    }

    .flow-item {
        padding: clamp(0.4rem, 1vw, 0.6rem);
    }

    .flow-item h4 {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    }

    .footer-content {
        padding: clamp(0.15rem, 0.4vw, 0.25rem) 0;
        grid-template-columns: 1fr auto;
        gap: clamp(0.2rem, 0.5vw, 0.3rem) clamp(0.3rem, 0.8vw, 0.45rem);
    }

    .footer-content > p {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        text-align: center;
    }

    .footer-links {
        gap: clamp(0.25rem, 0.6vw, 0.35rem);
    }

    .footer-age-rating {
        font-size: clamp(0.6rem, 1.3vw, 0.7rem);
        padding: clamp(0.12rem, 0.3vw, 0.16rem) clamp(0.25rem, 0.6vw, 0.35rem);
        min-width: clamp(30px, 5vw, 34px);
        line-height: 1;
    }

    .footer-link,
    .footer-byline {
        font-size: clamp(0.65rem, 1.5vw, 0.76rem);
    }

    .mobile-nav-link {
        padding: clamp(0.45rem, 1vw, 0.6rem) clamp(0.55rem, 1.2vw, 0.8rem);
        font-size: clamp(0.8rem, 1.8vw, 0.9rem);
        min-height: var(--touch-target);
    }

    .modal-content {
        max-width: 95%;
        max-height: 85vh;
        overflow-y: auto;
        padding: clamp(0.5rem, 1.2vw, 0.8rem);
        border-radius: 0.3rem;
    }

    .form-group label {
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    }

    .form-input,
    .form-textarea {
        padding: clamp(0.35rem, 0.8vw, 0.45rem);
        font-size: clamp(13px, 2.5vw, 14px);
        min-height: var(--touch-target);
    }

    .game-description {
        padding: clamp(0.7rem, 1.5vw, 1rem) clamp(0.3rem, 0.8vw, 0.5rem);
    }

    .game-description p {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        line-height: clamp(1.3, 2vw, 1.4);
    }

    /* Cards page specific adaptations */
    .cards-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: clamp(0.3rem, 0.8vw, 0.5rem);
        margin: clamp(0.5rem, 1.2vw, 0.8rem) calc(-1 * clamp(0.5rem, 1.2vw, 0.75rem));
        padding-left: clamp(0.5rem, 1.2vw, 0.75rem);
        padding-right: clamp(0.5rem, 1.2vw, 0.75rem);
    }

    .card-tab-btn {
        font-size: clamp(0.6rem, 1.3vw, 0.7rem);
        padding: clamp(0.3rem, 0.7vw, 0.4rem) clamp(0.4rem, 0.9vw, 0.6rem);
        white-space: nowrap;
        flex-shrink: 0;
        min-height: var(--touch-target);
    }

    /* Rules page specific adaptations */
    .rules-section {
        padding: clamp(0.7rem, 1.5vw, 1rem) clamp(0.3rem, 0.8vw, 0.5rem);
        margin-bottom: clamp(1rem, 2vw, 1.5rem);
    }

    .rules-section h3 {
        font-size: clamp(0.8rem, 1.8vw, 0.95rem);
        margin-bottom: clamp(0.3rem, 0.8vw, 0.5rem);
    }

    .rules-section p {
        font-size: clamp(0.75rem, 1.8vw, 0.85rem);
        line-height: clamp(1.3, 2vw, 1.4);
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЙ АДАПТИВ (ПЛАНШЕТЫ/ТЕЛЕФОНЫ)
   ============================================ */

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 clamp(0.8rem, 1.5vw, 1rem);
    }

    h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
    h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); }

    .header-content {
        gap: clamp(0.7rem, 1.2vw, 1rem);
        padding: clamp(0.5rem, 0.9vw, 0.7rem) 0;
    }

    .nav-menu {
        gap: clamp(1rem, 1.8vw, 1.4rem);
        padding: 0 clamp(0.4rem, 0.8vw, 0.6rem);
    }

    .hero {
        min-height: clamp(70vh, 85vw, 78vh);
    }

    .hero-title {
        font-size: clamp(2.2rem, 6vw, 3.5rem);
        letter-spacing: clamp(0.6px, 0.1vw, 0.8px);
    }

    .hero-subtitle {
        font-size: clamp(0.85rem, 2.2vw, 1.1rem);
        margin-bottom: clamp(1rem, 2vw, 1.5rem);
        max-width: 100%;
        line-height: 1.4;
        padding: 0 1rem;
    }

    .main-content {
        /* На мобилках/планшетах не даём проявляться фону body над футером */
        padding: clamp(1rem, 2vw, 1.5rem) 0 clamp(4rem, 8vw, 6rem);
        /* На правилах/страницах с коротким контентом main-content может быть
           короче viewport и тогда сверху “вылезает” фон body (который визуально
           похож на футер). Увеличиваем min-height, чтобы пустые зоны были
           именно фоном main-content, а не body. */
        min-height: calc(100vh - clamp(200px, 25vw, 240px));
    }

    body.page-has-hero .main-content {
        padding: 0 0 clamp(4rem, 8vw, 6rem);
    }

    body.page-has-hero .main-content > .container {
        padding-top: clamp(1rem, 2vw, 1.5rem);
    }

    .card-image {
        height: clamp(170px, 22vw, 210px);
    }

    .header-content {
        gap: clamp(0.7rem, 1.2vw, 1rem);
    }

    .cards-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: clamp(0.3rem, 0.7vw, 0.45rem);
        padding-bottom: clamp(0.3rem, 0.7vw, 0.45rem);
        scrollbar-width: thin;
    }

    .card-tab-btn {
        flex: 0 0 auto;
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
        padding: clamp(0.35rem, 0.8vw, 0.45rem) clamp(0.5rem, 1vw, 0.65rem);
        line-height: 1.2;
        min-height: var(--touch-target);
    }

    .rules-tabs {
        gap: clamp(0.4rem, 0.9vw, 0.6rem);
    }

    .rules-tab-btn {
        flex: 1 1 clamp(180px, 25vw, 220px);
        min-height: var(--touch-target);
        font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    }

    .table-of-contents {
        padding: clamp(0.9rem, 1.5vw, 1.2rem);
    }

    .table-of-contents ul {
        columns: 1;
    }

    .filters-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(0.5rem, 1.2vw, 0.8rem);
    }

    #resetFilters {
        align-self: stretch;
    }

    .btn {
        min-height: var(--touch-target);
        padding: clamp(0.4rem, 0.9vw, 0.5rem) clamp(0.6rem, 1.2vw, 0.85rem);
        font-size: clamp(0.75rem, 1.6vw, 0.85rem);
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .hero {
        min-height: 64vh;
        padding: 1rem 0.6rem;
    }

    .hero-content {
        max-width: 92%;
    }

    .hero .btn-primary {
        width: min(100%, 360px);
    }

    .card-image {
        height: 180px;
    }

    .header-content {
        gap: 0.75rem;
    }

    .cards-controls {
        margin-bottom: 1rem;
    }

    .search-box .search-input-wrap input,
    .filter-group select {
        min-height: 42px;
        font-size: 0.95rem;
    }

    .filters-section {
        grid-template-columns: 1fr;
    }

    .rules-tab-btn,
    .card-tab-btn,
    .mobile-nav-link {
        min-height: 42px;
    }

    .about-section,
    .page-reveal-section,
    .rules-subsection,
    .point-item,
    .tip-item,
    .faq-item {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        gap: 0.8rem;
    }
}

/* ============================================
   АДАПТИВНОСТЬ - ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (360px и ниже)
   ============================================ */

@media (max-width: 360px) {
    .container {
        padding: 0 clamp(0.4rem, 1.2vw, 0.5rem);
    }

    h1 { font-size: clamp(1rem, 3.5vw, 1.15rem); }
    h2 { font-size: clamp(0.85rem, 2.5vw, 0.95rem); }
    p, li { font-size: clamp(0.75rem, 2vw, 0.82rem); }

    .hero-title {
        font-size: clamp(1.15rem, 4vw, 1.3rem);
    }

    .hero-subtitle {
        font-size: clamp(0.75rem, 2vw, 0.82rem);
        max-width: 100%;
        padding: 0 0.5rem;
    }


    .card-image {
        height: clamp(140px, 35vw, 180px);
    }

    .footer {
        margin-top: 0;
        padding: clamp(0.5rem, 1.2vw, 0.65rem) 0;
    }
    
    .btn {
        font-size: clamp(0.7rem, 1.8vw, 0.75rem);
        padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.5rem, 1.2vw, 0.7rem);
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2;
    }
}

/* ============================================
   UI POLISH OVERRIDES (ГЛАВНАЯ)
   ============================================ */

/* У героев на главной не показываем бейдж "Герой" при ховере */
.cards-gallery .card-overlay {
    display: none !important;
}

/* Кнопка выбора настолки в стиле сайта */
.selector-btn {
    position: relative;
    border-radius: 0.8rem;
    border: 1px solid rgba(201, 169, 97, 0.55);
    background:
        linear-gradient(135deg, rgba(201, 169, 97, 0.22), rgba(166, 124, 82, 0.16)),
        rgba(24, 18, 14, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 236, 191, 0.15),
        0 6px 14px rgba(0, 0, 0, 0.34);
    padding: 0.72rem 1.35rem;
    font-weight: 600;
    letter-spacing: 0.7px;
}

.selector-btn::after {
    content: "";
    display: none;
}

.selector-btn:hover {
    color: #ffe6b6;
    border-color: rgba(212, 154, 61, 0.95);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 236, 191, 0.2),
        0 10px 22px rgba(212, 154, 61, 0.22);
}

.selector-dropdown {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px) scale(0.98);
    border-radius: 0.7rem;
    min-width: 240px;
    background: linear-gradient(180deg, rgba(34, 26, 21, 0.98), rgba(18, 14, 12, 0.98));
    border: 1px solid rgba(201, 169, 97, 0.35);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* «Мост» над зазором кнопка↔панель — курсор не теряет :hover на .game-selector */
.selector-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 14px;
}

.game-selector:hover .selector-dropdown,
.game-selector.open .selector-dropdown,
.game-selector:focus-within .selector-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Кнопка "наверх": единое положение и стиль для desktop/mobile */
.back-to-top {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 999px;
    margin: 0;
    display: none !important;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 169, 97, 0.6);
    background: linear-gradient(145deg, rgba(212, 154, 61, 0.95), rgba(136, 90, 43, 0.95));
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 240, 202, 0.08) inset;
    z-index: 2500;
    pointer-events: auto;
}

.back-to-top.is-visible {
    display: flex !important;
}

.back-to-top:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 26px rgba(212, 154, 61, 0.4), 0 0 0 1px rgba(255, 240, 202, 0.15) inset;
}

@media (max-width: 768px) {
    .section-placeholder-image {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: auto;
    }
}

@media (max-width: 1024px) {
    .section-placeholder-image {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: auto;
    }
}

/* ============================================
   RESPONSIVE HEADER + HOME GRID FIXES
   ============================================ */

.header-content {
    min-height: 68px;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

/* Placeholder images with fantasy border */
.section-placeholder-image,
.about-section-image {
    max-width: 600px;
    width: 100%;
    height: auto;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.8rem;
    border: 3px solid var(--primary-color);
    box-shadow:
        0 0 0 1px rgba(201, 169, 97, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(201, 169, 97, 0.1);
    display: block;
}

.logo-img {
    max-width: 58px;
}

.logo-text {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
}

.nav-link,
.selector-btn,
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.main-content > .hero {
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.hero {
    overflow: hidden;
    background: var(--dark-bg);
}


.main-content {
    margin-top: 0;
    padding-top: calc(var(--header-h, 64px) + 2rem);
}

body.page-has-hero .main-content {
    padding-top: 0;
    padding-bottom: 6rem;
}

body.page-has-hero .main-content > .container {
    padding-top: 2rem;
}

/* Галерея героев: появление при скролле, золото и глубина в стиле сайта */
.cards-gallery .gallery-grid {
    perspective: 1280px;
}

.cards-gallery .gallery-item {
    opacity: 0;
    animation: none !important;
    will-change: opacity;
    transition: opacity 0.6s ease-out;
}

.cards-gallery .gallery-item .card-preview {
    transition: border-color 0.45s ease, box-shadow 0.45s ease, transform 0.4s ease-out;
}

.cards-gallery .gallery-item:hover .card-preview {
    transform: scale(1.03);
}

.cards-gallery .gallery-item.animated {
    opacity: 1;
    animation: none !important;
}

.cards-gallery .gallery-item.animated .card-preview {
    animation: heroCardAura 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0s;
}

@keyframes heroGalleryReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 56px, -28px) scale(0.86) rotateX(11deg);
        filter: blur(16px) brightness(0.42) saturate(0.75);
    }
    28% {
        opacity: 0.72;
        transform: translate3d(0, 18px, -6px) scale(0.96) rotateX(4deg);
        filter: blur(4px) brightness(0.92) saturate(0.95);
    }
    52% {
        opacity: 1;
        transform: translate3d(0, -5px, 4px) scale(1.03) rotateX(-1deg);
        filter: blur(0) brightness(1.14) saturate(1.08);
    }
    70% {
        transform: translate3d(0, 3px, 0) scale(1.006) rotateX(0.4deg);
        filter: blur(0) brightness(1.05) saturate(1.03);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
        filter: blur(0) brightness(1) saturate(1);
    }
}

@keyframes heroCardAura {
    0% {
        box-shadow:
            0 6px 18px rgba(0, 0, 0, 0.55),
            0 0 0 1px rgba(58, 51, 42, 0.9);
    }
    40% {
        box-shadow:
            0 14px 36px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(201, 169, 97, 0.65),
            0 0 28px rgba(201, 169, 97, 0.35),
            0 0 52px rgba(212, 165, 116, 0.22);
    }
    100% {
        box-shadow:
            0 8px 22px rgba(0, 0, 0, 0.48),
            0 0 0 1px rgba(201, 169, 97, 0.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cards-gallery .gallery-grid {
        perspective: none;
    }

    .cards-gallery .gallery-item {
        transform: none;
        filter: none;
        will-change: auto;
    }

    .cards-gallery .gallery-item.animated {
        animation: none !important;
        opacity: 1;
    }

    .cards-gallery .gallery-item.animated .card-preview {
        animation: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    }
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "logo-image logo menu";
        gap: 0.65rem;
        min-height: 62px;
        padding: 0.5rem 0;
    }

    .logo-image {
        display: block;
        width: 42px;
    }

    .logo {
        min-width: 0;
        justify-self: start;
        gap: 0.5rem;
    }

    .logo-text {
        display: inline;
        font-size: clamp(0.72rem, 2vw, 0.8rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.hide-mobile-logo-text .logo-text {
        display: none;
    }

    /* Очень узкие экраны: только иконка, без длинного названия */
    @media (max-width: 360px) {
        .header .logo-text {
            display: none !important;
        }
    }

    .menu-toggle {
        display: inline-flex;
        position: fixed;
        top: 10px;
        right: 12px;
        width: 44px;
        height: 44px;
        border-radius: 0.55rem;
        border: 1px solid rgba(201, 169, 97, 0.45);
        background: rgba(15, 14, 11, 0.88);
        z-index: 1450;
    }

    .mobile-menu {
        top: 62px;
        max-height: calc(100vh - 62px);
    }

    .rules-tabs {
        position: relative;
        z-index: 5;
        margin-top: 0.4rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .rules-tab-btn {
        width: 100%;
        min-height: 44px;
    }

    .card-image {
        height: clamp(150px, 26vw, 230px);
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .stat-item {
        padding: 1rem 0.7rem;
    }

    .stat-number {
        font-size: clamp(1.35rem, 5vw, 1.75rem);
    }

    .stat-label {
        font-size: clamp(0.82rem, 3vw, 0.95rem);
    }
}

/* Умная шапка: compact включается через JS */
body.header-compact .header-content {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo-image logo menu";
    gap: 0.75rem;
}

body.header-compact .logo {
    justify-self: center;
}

body.header-compact .nav-menu,
body.header-compact .game-selector {
    display: none !important;
}

body:not(.header-compact) .logo-image {
    justify-self: start;
}

body.header-compact .logo-image {
    justify-self: start;
}

body.header-compact .menu-toggle {
    justify-self: end;
}

.card-preview,
.card-container,
.modal-content,
.logo-image,
.card-img,
.modal-card-image {
    position: relative;
    z-index: 4;
}

.game-description,
.cards-gallery,
.stats,
.about-section,
.page-reveal-section,
.rules-section,
.rules-tabs,
.cards-controls,
.cards-grid,
.footer,
.hero-content {
    position: relative;
    z-index: 5;
}

@media (max-width: 768px) {
    .about-section,
    .rules-subsection:not(#card-types),
    #card-types.rules-subsection,
    .rule-block,
    .example-block,
    .point-item,
    .tip-item,
    .faq-item,
    .table-of-contents,
    .card-type-block {
        backdrop-filter: none;
    }
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none !important;
    }

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

    .game-selector {
        display: block !important;
        justify-self: end;
    }

    .header-content {
        grid-template-columns: auto auto 1fr auto auto;
    }
}

/* Гибкая адаптивность: "резиновая" подстройка */
:root {
    --fluid-gap: clamp(0.6rem, 1.2vw, 1.2rem);
}

.header-content {
    gap: var(--fluid-gap);
}

.hero-title {
    font-size: clamp(1.9rem, 6.4vw, 4.5rem);
}

.hero-subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.3rem);
    max-width: 100%;
}

.nav-link {
    font-size: clamp(0.75rem, 1vw, 0.85rem) !important;
    min-height: 40px;
}

.selector-btn {
    font-size: clamp(0.75rem, 1vw, 0.85rem) !important;
}

.header-content {
    align-items: center !important;
}

.logo-image {
    justify-self: start !important;
    align-self: center !important;
}

.menu-toggle {
    justify-self: end !important;
    align-self: center !important;
}

.logo {
    align-self: center !important;
}

.btn,
.rules-tab-btn,
.card-tab-btn,
.nav-link,
.mobile-nav-link {
    min-height: 40px;
}

.gallery-grid {
    gap: clamp(0.75rem, 1.6vw, 2rem);
}

.card-image {
    height: clamp(165px, 22vw, 280px);
}

@media (max-width: 420px) {
    .rules-tabs {
        margin-top: -0.2rem;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
}

@media (max-width: 768px) {
    .logo {
        justify-self: center !important;
        align-items: center;
    }

    .menu-toggle {
        position: static !important;
        top: auto !important;
        right: auto !important;
    }
}

/* ============================================
   TARGETED MOBILE/TABLET FIXES
   ============================================ */

/* Планшеты: модалка карты как на >=769px (без ужатого изображения) */
@media (min-width: 601px) and (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr 1fr;
        gap: 1.2rem;
        padding: 1.5rem;
        padding-top: 2rem;
    }

    .modal-card-image {
        grid-column: 1;
        grid-row: 1 / -1;
        max-height: none;
        height: 100%;
        min-height: 280px;
        object-fit: cover;
        margin-bottom: 0;
    }

    .modal-card-info {
        grid-column: 2;
    }
}

/* Телефоны: текст в CTA-кнопках должен влезать */
@media (max-width: 768px) {
    .cta-panel {
        width: 100%;
    }

    .cta-btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        padding: 0.65rem 0.9rem;
        font-size: 0.82rem;
    }
}

/* Маленькие экраны: "Купить игру" сверху, две остальные снизу */
@media (max-width: 768px) {
    .cta-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
        align-items: stretch;
    }

    .cta-buy {
        grid-column: 1 / -1;
    }

    .cta-tg,
    .cta-vk {
        grid-column: span 1;
    }
}

/* ============================================
   PREMIUM MOBILE MENU
   ============================================ */
body.mobile-menu-open {
    overflow: hidden;
}

.menu-toggle {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.menu-toggle:hover,
.menu-toggle.is-active {
    border-color: rgba(212, 154, 61, 0.95);
    background: linear-gradient(135deg, rgba(212, 154, 61, 0.22), rgba(166, 124, 82, 0.22));
    box-shadow: 0 10px 22px rgba(212, 154, 61, 0.25);
}

.menu-toggle.is-active {
    transform: scale(1.03);
}

.mobile-menu {
    top: calc(var(--header-h, 64px) + 8px);
    left: 10px;
    right: 10px;
    max-height: calc(100vh - var(--header-h, 64px) - 18px);
    padding: 0.75rem;
    border: 1px solid rgba(201, 169, 97, 0.35);
    border-radius: 1rem;
    background:
        radial-gradient(120% 90% at 10% 0%, rgba(212, 154, 61, 0.18), transparent 62%),
        linear-gradient(180deg, rgba(31, 24, 19, 0.98), rgba(16, 13, 10, 0.98));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 236, 191, 0.07) inset;
    overflow: auto;
    overscroll-behavior: contain;
}

.mobile-menu.active,
.mobile-menu.mobile-menu--closing {
    display: block;
}

.mobile-menu.active {
    animation: mobileMenuReveal 0.22s ease-out;
}

.mobile-menu.mobile-menu--closing {
    animation: mobileMenuHide 0.22s ease-in forwards;
    pointer-events: none;
}

@keyframes mobileMenuReveal {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes mobileMenuHide {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu.active {
        animation: none;
    }

    .mobile-menu.mobile-menu--closing {
        animation: none;
        opacity: 0;
    }
}

.mobile-menu .mobile-selector {
    padding: 0.15rem 0.15rem 0.35rem;
}

.mobile-selector-link {
    border-radius: 0.72rem;
    border: 1px solid rgba(201, 169, 97, 0.48);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.14), rgba(18, 14, 12, 0.72));
    color: #f4e3bc;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 0.62rem 0.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 236, 191, 0.12);
}

.mobile-selector-link.disabled {
    opacity: 0.62;
}

.mobile-nav-link {
    margin-top: 0.45rem;
    padding: 0.82rem 0.95rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(201, 169, 97, 0.28);
    background: rgba(17, 13, 10, 0.58);
    color: #f0e3cb;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    font-size: 0.84rem;
    line-height: 1.2;
    transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #1d160c;
    border-color: rgba(212, 154, 61, 0.95);
    background: linear-gradient(135deg, #e2bf74 0%, #c39246 100%);
    box-shadow: 0 8px 18px rgba(212, 154, 61, 0.3);
    text-decoration: none;
}

/* Язык в выезжающем меню (компактно, второстепенно к ссылкам навигации) */
.mobile-menu .footer-lang.footer-lang--in-drawer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.35rem 0.2rem 0.1rem;
    border-top: 1px solid rgba(201, 169, 97, 0.14);
    gap: 0;
}

.mobile-menu .footer-lang.footer-lang--in-drawer .footer-lang-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-menu .footer-lang.footer-lang--in-drawer .footer-lang-select {
    width: auto;
    max-width: 9.5rem;
    min-width: 0;
    min-height: 30px;
    margin: 0;
    padding: 0.2rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
    border-radius: 0.45rem;
    border: 1px solid rgba(201, 169, 97, 0.22);
    background: rgba(10, 8, 6, 0.65);
    color: rgba(210, 198, 172, 0.82);
    box-shadow: none;
    opacity: 0.9;
    z-index: 1;
}

.mobile-menu .footer-lang.footer-lang--in-drawer .footer-lang-select:focus {
    outline: none;
    border-color: rgba(212, 154, 61, 0.45);
    color: #f0e3cb;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu {
        left: 8px;
        right: 8px;
    }
}

@media (max-width: 600px) {
    .mobile-menu {
        top: calc(var(--header-h, 64px) + 6px);
        max-height: calc(100vh - var(--header-h, 64px) - 12px);
        border-radius: 0.9rem;
        padding: 0.65rem;
    }

    .mobile-nav-link {
        font-size: 0.8rem;
        padding: 0.75rem 0.85rem;
    }
}

@media (max-width: 767px) {
    .header-content {
        min-height: 58px;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        gap: 0.8rem;
        grid-template-columns: auto auto 1fr auto auto;
        grid-template-areas: "logo-image logo nav selector menu";
    }

    .logo {
        display: flex !important;
        font-size: 0.8rem;
    }

    .nav-menu {
        gap: 0.8rem;
        padding: 0;
        align-items: center;
        justify-content: flex-start;
    }

    .nav-link {
        font-size: clamp(0.7rem, 1.5vw, 0.78rem) !important;
        min-height: 34px;
        padding-bottom: 0.1rem;
    }

    .selector-btn {
        font-size: clamp(0.7rem, 1.5vw, 0.78rem) !important;
        padding: 0.4rem 0.6rem;
    }

    .game-selector {
        justify-self: end;
    }
}

/* Точные брейкпоинты сетки Карт (страница cards) */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 425px) and (max-width: 767px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 424px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   PRINT (PDF)
   ============================================ */
@media print {
    /* Скрываем элементы управления интерфейсом */
    .rules-tabs,
    .rules-downloads,
    .mobile-menu,
    .menu-toggle,
    .back-to-top {
        display: none !important;
    }

    /* Убираем подсветки и не даём “разъезжаться” фону */
    body,
    .header,
    .main-content {
        background: var(--dark-bg) !important;
    }

    /* Вариант: только краткие правила (body.print-quick — скрыть подробный блок) */
    body.print-quick #detailed-rules {
        display: none !important;
    }
    body.print-quick #quick-rules {
        display: block !important;
    }

    /* Вариант: только подробные правила */
    body.print-full #quick-rules {
        display: none !important;
    }
    body.print-full #detailed-rules {
        display: block !important;
    }

    .page-reveal-section {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    /* Печатный отступы */
    @page {
        margin: 14mm;
    }
}

/* ============================================
   TLHEADER FONT TARGETS
   ============================================ */

/* Header / шапка */
.nav-link,
.selector-item,
.mobile-nav-link,
.mobile-selector-link {
    font-family: var(--title-font);
}

/* Главная */
.hero-title,
.game-description h2,
.cards-gallery h2 {
    font-family: var(--title-font);
}

/* Правила: краткие и подробные */
#quick-rules > h2,
#detailed-rules > h2,
.rules-subsection > h3,
.point-item h4 {
    font-family: var(--title-font);
}

/* Карты: каталог, названия карт и модалка */
.cards-controls h2,
.card-info h4,
.modal-card-info h3 {
    font-family: var(--title-font);
}

/* Главная: имена карточек в галерее */
.card-name {
    font-family: var(--title-font);
}

/* Об игре, каталог карт, правила */
.about-section h2,
.page-reveal-section h2 {
    font-family: var(--title-font);
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-transition-screen {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    z-index: 5000;
    background:
        radial-gradient(120% 80% at 50% 20%, rgba(212, 154, 61, 0.14), transparent 52%),
        linear-gradient(180deg, rgba(10, 8, 7, 0.04), rgba(10, 8, 7, 0.16));
    transform: translateZ(0);
    transition: opacity 0.34s ease;
    will-change: opacity;
}

.page-transition-screen.active {
    opacity: 1;
}

body.page-entering .main-content,
body.page-entering .hero,
body.page-entering .header,
body.page-entering .footer {
    animation: pageFadeIn 0.32s ease both;
    will-change: opacity, transform;
}

body.page-leaving .main-content,
body.page-leaving .hero,
body.page-leaving .header,
body.page-leaving .footer {
    animation: pageFadeOut 0.32s ease both;
    will-change: opacity, transform;
}

@keyframes pageFadeIn {
    from {
        opacity: 0.86;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0.88;
        transform: translateY(-6px);
    }
}

/* Уведомление о офлайн-режиме */
.offline-notification {
    position: fixed;
    top: 14px;
    left: 50%;
    right: auto;
    width: min(100%, 420px);
    transform: translateX(-50%) translateY(-120%);
    background: rgba(17,15,11,0.96);
    border: 1px solid rgba(201,169,97,0.25);
    color: #ece6da;
    padding: 10px 14px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    border-radius: 18px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: default;
    user-select: none;
    touch-action: pan-y;
}

.offline-notification.visible {
    transform: translateX(-50%) translateY(0);
}

.offline-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.offline-notification-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.offline-notification-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.offline-notification-close {
    display: none;
}

.offline-notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.offline-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Анимация свайпа */
.offline-notification.swiping {
    transition: none;
}

.offline-notification.swipe-up {
    transform: translateY(-100%);
}

.offline-notification.swipe-left {
    transform: translateX(-100%);
}

.offline-notification.swipe-right {
    transform: translateX(100%);
}

/* Нижнее мобильное меню */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--dark-card), rgba(45, 36, 31, 1.2));
    border-top: clamp(1px, 0.3vw, 2px) solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(201, 169, 97, 0.15);
    z-index: 2500;
    padding: clamp(6px, 1.5vw, 8px) 0;
    max-width: 100vw;
    overflow: hidden;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    flex: 1;
    min-width: 0;
    max-width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.5vw, 4px);
    text-decoration: none;
    color: var(--text-muted);
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    transition: all 0.3s ease;
    padding: clamp(4px, 1vw, 6px) clamp(2px, 0.5vw, 4px);
    border: none;
    background: none;
    cursor: pointer;
}

.bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item svg {
    width: clamp(18px, 5vw, 24px);
    height: clamp(18px, 5vw, 24px);
    stroke: currentColor;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item:hover svg,
.bottom-nav-item.active svg {
    stroke: var(--primary-color);
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    position: relative;
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(16px, 4vw, 30px);
    height: clamp(2px, 0.5vw, 3px);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 0 0 2px 2px;
}

.cart-nav-item {
    position: relative;
}

.cart-nav-item .cart-badge-bottom {
    position: absolute;
    top: clamp(2px, 0.5vw, 4px);
    right: clamp(4px, 1.5vw, 12px);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--dark-bg);
    font-size: clamp(0.55rem, 2vw, 0.7rem);
    font-weight: 700;
    min-width: clamp(12px, 3vw, 16px);
    height: clamp(12px, 3vw, 16px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(1px, 0.5vw, 3px);
    box-shadow: 0 2px 6px rgba(201, 169, 97, 0.4);
    flex-shrink: 0;
}

.cart-nav-item .cart-badge-bottom.hidden {
    display: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 767px) {
    .bottom-nav {
        display: flex !important;
        z-index: 2300;
    }

    .back-to-top {
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(clamp(55px, 14vw, 70px) + 12px);
        width: clamp(36px, 9vw, 42px);
        height: clamp(36px, 9vw, 42px);
        min-width: clamp(36px, 9vw, 42px);
        min-height: clamp(36px, 9vw, 42px);
        font-size: clamp(0.9rem, 2.2vw, 1rem);
        z-index: 2400;
    }

    .nav-menu {
        display: none;
    }

    .game-selector {
        display: none;
    }

    .game-selector-mobile {
        display: block;
    }

    /* Скрыть фиксированную кнопку корзины на мобильных */
    .cart-button-tablet-fixed {
        display: none !important;
    }

    body {
        padding-bottom: clamp(55px, 14vw, 70px);
    }
}

/* Планшеты (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0;
    }

    /* На планшете: корзина только иконка без текста */
    .cart-button-text {
        display: none;
    }

    .cart-button {
        padding: 0.5rem 0.75rem;
        gap: 0;
    }

    /* Сдвинуть корзину правее */
    .cart-icon-wrapper {
        margin-left: auto;
        margin-right: clamp(0.5rem, 1vw, 1rem);
    }
}

/* Очень маленькие экраны (до 374px) */
@media (max-width: 374px) {
    .bottom-nav {
        padding: clamp(4px, 1vw, 6px) 0;
    }

    .bottom-nav-item {
        gap: clamp(1px, 0.3vw, 2px);
        padding: clamp(3px, 0.8vw, 5px) clamp(1px, 0.3vw, 3px);
        font-size: clamp(0.55rem, 2.5vw, 0.65rem);
    }

    .bottom-nav-item svg {
        width: clamp(16px, 4.5vw, 20px);
        height: clamp(16px, 4.5vw, 20px);
    }

    .bottom-nav-item.active::after {
        width: clamp(12px, 3vw, 20px);
        height: clamp(1.5px, 0.4vw, 2px);
    }

    .cart-nav-item .cart-badge-bottom {
        top: clamp(1px, 0.3vw, 3px);
        right: clamp(3px, 1vw, 8px);
        min-width: clamp(10px, 2.5vw, 14px);
        height: clamp(10px, 2.5vw, 14px);
        font-size: clamp(0.5rem, 1.8vw, 0.6rem);
    }

    body {
        padding-bottom: clamp(50px, 13vw, 60px);
    }
}

/* Средние мобильные экраны (375px - 480px) */
@media (min-width: 375px) and (max-width: 480px) {
    .bottom-nav {
        padding: clamp(5px, 1.2vw, 7px) 0;
    }

    .bottom-nav-item {
        gap: clamp(2px, 0.4vw, 3px);
        padding: clamp(4px, 1vw, 6px) clamp(2px, 0.5vw, 4px);
        font-size: clamp(0.6rem, 2vw, 0.7rem);
    }

    .bottom-nav-item svg {
        width: clamp(18px, 4.8vw, 22px);
        height: clamp(18px, 4.8vw, 22px);
    }
}

/* Большие мобильные экраны (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .bottom-nav {
        padding: clamp(6px, 1.5vw, 8px) 0;
    }

    .bottom-nav-item {
        gap: clamp(3px, 0.6vw, 4px);
        padding: clamp(5px, 1.2vw, 7px) clamp(3px, 0.8vw, 5px);
        font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    }

    .bottom-nav-item svg {
        width: clamp(20px, 5vw, 24px);
        height: clamp(20px, 5vw, 24px);
    }
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }

    .game-selector-mobile {
        display: none;
    }

    body {
        padding-bottom: 0;
    }
}

@media (max-width: 768px) {
    .offline-notification {
        padding: 14px 16px;
    }

    .offline-notification-text {
        font-size: 13px;
    }

    .offline-notification-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}


.hero-intro {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    padding: 3rem 0 2rem;
}

.hero-copy {
    max-width: 540px;
}

.hero-copy .eyebrow {
    display: inline-flex;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hero-copy h2 {
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    line-height: 1.03;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
}

.hero-text,
.hero-copy p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 44rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.8rem;
}

.hero-actions .btn {
    min-width: 180px;
}

    .hero-notes {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.85rem;
        margin-top: 1.8rem;
        color: var(--text-muted);
        font-size: 0.95rem;
    }

    .hero-notes span {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.8rem 1rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(201, 169, 97, 0.1);
    }

    .hero-preview {
        margin-top: 3rem;
        display: grid;
        place-items: center;
    }

    .hero-banner {
        position: relative;
        width: min(100%, 620px);
        min-height: 420px;
        border-radius: 2rem;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(15, 14, 11, 0.1));
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 32px 75px rgba(0, 0, 0, 0.24);
    }

    .hero-banner::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(circle at 25% 20%, rgba(201, 169, 97, 0.18), transparent 25%),
                    radial-gradient(circle at 85% 80%, rgba(59, 173, 255, 0.12), transparent 18%);
    }

    .hero-banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .section-header {
        display: grid;
        gap: 1rem;
        margin-bottom: 1.6rem;
        max-width: 56rem;
    }

    .section-header .eyebrow {
        display: inline-flex;
        text-transform: uppercase;
        letter-spacing: 0.24em;
        color: var(--text-muted);
        font-size: clamp(1.6rem, 2vw, 2.4rem);
        line-height: 1.1;
    }

    .section-header h2 {
        font-size: clamp(2.2rem, 4vw, 3.6rem);
        line-height: 1.04;
        margin: 0;
        color: var(--text);
    }

    .section-header p {
        margin: 0;
        color: var(--text-muted);
        max-width: 44rem;
    }

    .why-grid {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 1.5rem;
    }

    .why-card {
        padding: 2rem;
        border-radius: 1.8rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.03);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    }

    .why-card h3 {
        margin-bottom: 0.9rem;
    }

    .why-card p {
        line-height: 1.75;
        color: var(--text-muted);
        font-size: 0.98rem;
    }

    .hero-card-image {
        position: relative;
        overflow: hidden;
        border-radius: 1.5rem;
        min-height: 180px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .hero-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.4s ease;
    }

    .hero-card:hover .hero-card-image img {
        transform: scale(1.06) rotate(0.35deg);
    }

    .hero-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
        border-color: rgba(201, 169, 97, 0.18);
    }

    .purchase-gallery {
        display: grid;
        gap: 0.85rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 1.5rem;
    }

    .purchase-gallery img {
        width: 100%;
        height: 142px;
        object-fit: cover;
        border-radius: 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .purchase-list {
        list-style: none;
        padding: 0;
        margin: 1.5rem 0 0;
        display: grid;
        gap: 0.85rem;
    }

    .purchase-list li {
        position: relative;
        padding-left: 2.2rem;
        color: var(--text-muted);
        line-height: 1.7;
    }

    .purchase-list li::before {
        content: "•";
        position: absolute;
        left: 0;
        top: 0.25rem;
        color: var(--primary-color);
        font-size: 1.25rem;
        line-height: 1;
    }

    .hero-visual-overlay {
        position: absolute;
        inset: 0;
        border-radius: 2rem;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0 3rem;
}

.hero-card {
    padding: 1.8rem;
    border-radius: 1.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-card h3 {
    font-size: 1.2rem;
}

.hero-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

.catacombs-section {
    margin: 3rem 0;
}

.catacombs-card {
    padding: 2rem;
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(18, 14, 10, 0.98), rgba(9, 7, 5, 0.98));
    border: 1px solid rgba(201, 169, 97, 0.12);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.catacombs-card p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}

.catacombs-details {
    display: grid;
    gap: 1rem;
}

.catacombs-details strong {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--text-light);
}

.box-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.box-item {
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: grid;
    gap: 0.9rem;
}

.box-icon {
    font-size: 1.8rem;
}

.features-grid,
.steps-grid,
.review-grid,
.grid-three {
    display: grid;
    gap: 1.4rem;
}

.features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 2rem 0 3rem;
}

.feature-card,
.step-item,
.box-item,
.review-card,
.purchase-card,
.cta-card,
.hero-block {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.6rem;
    padding: 1.75rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.feature-card:hover,
.step-item:hover,
.box-item:hover,
.review-card:hover,
.purchase-card:hover,
.cta-card:hover,
.hero-block:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.16);
}

.feature-card h3,
.step-item h3,
.box-item strong,
.hero-block h2,
.review-card span {
    margin: 1rem 0 0.45rem;
    color: var(--text);
}

.feature-card p,
.step-item p,
.box-item p,
.review-card p,
.purchase-card p {
    color: var(--text-muted);
}

.step-item {
    display: grid;
    gap: 1rem;
    padding: 2rem;
}

.step-item strong {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 700;
}

.split-block {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    margin: 2.5rem 0;
}

.split-content h2 {
    margin-bottom: 1rem;
}

.hero-list {
    margin: 1.4rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.85rem;
    color: var(--text-muted);
}

.hero-list li::marker {
    color: var(--accent);
}

.video-card {
    position: relative;
    border-radius: 1.6rem;
    overflow: hidden;
    min-height: 260px;
    background: linear-gradient(180deg, rgba(7, 13, 23, 0.95), rgba(14, 22, 38, 0.95));
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.box-highlights {
    margin-bottom: 2.5rem;
}

.grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.box-item strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.65rem;
}

.cta-focus {
    margin: 2rem 0 3rem;
}

.cta-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cta-card p {
    max-width: 40rem;
}

.home-cta-board {
    margin: 2rem 0 3rem;
    padding: 2rem;
    border-radius: 2rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08), rgba(15, 13, 10, 0.96));
    border: 1px solid rgba(201, 169, 97, 0.12);
    box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.16);
}

.home-cta-board .cta-card {
    background: rgba(16, 14, 10, 0.72);
    padding: 2rem;
    border-radius: 1.75rem;
}

.reviews-section {
    margin-bottom: 2.5rem;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}

.review-card {
    padding: 1.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.75rem;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audience-list {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.audience-list span {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(201, 169, 97, 0.12);
    line-height: 1.8;
}

.review-card span {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.purchase-block {
    margin-bottom: 3rem;
}

.purchase-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.25rem;
    align-items: stretch;
}

.purchase-details {
    display: grid;
    gap: 1rem;
}

.purchase-price span {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.purchase-price strong {
    font-size: clamp(2rem, 4vw, 2.6rem);
    color: var(--text);
}

.purchase-badge {
    display: grid;
    gap: 0.8rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(56, 97, 165, 0.12);
}

.purchase-badge span {
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-tertiary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 169, 97, 0.2);
    color: var(--text-light);
}

.btn-tertiary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.price-block {
    margin-bottom: 3rem;
}

.price-card {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 1.25rem;
    align-items: center;
    padding: 2rem;
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(20, 18, 15, 0.92), rgba(18, 16, 13, 0.98));
    border: 1px solid rgba(201, 169, 97, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.price-values {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 1rem;
}

.price-card strong {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-color);
}

.price-visual {
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(201, 169, 97, 0.08);
    color: var(--text-light);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
}

.price-card p {
    margin-bottom: 1.5rem;
}

.btn-scroll-to-purchase,
.btn-primary,
.btn-secondary,
.btn-tertiary {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 960px) {
    .hero-intro,
    .split-block,
    .purchase-card,
    .features-grid,
    .review-grid,
    .price-card,
    .heroes-grid,
    .box-list,
    .purchase-gallery,
    .grid-three {
        grid-template-columns: 1fr;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .home-cta-board .cta-card,
    .price-card,
    .review-card,
    .box-item,
    .hero-card,
    .catacombs-card {
        padding: 1.6rem;
    }

    .hero-intro {
        padding-top: 2rem;
    }

    .hero-visual {
        min-height: 320px;
    }
}

@media (max-width: 680px) {
    .hero-copy h2 {
        font-size: clamp(2.2rem, 9vw, 3.4rem);
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .feature-card,
    .box-item,
    .step-item,
    .review-card,
    .purchase-card,
    .cta-card {
        padding: 1.4rem;
    }

    .features-grid,
    .steps-grid,
    .review-grid,
    .grid-three,
    .purchase-card {
        gap: 1rem;
    }
}

.hero-stats {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stat-item {
    padding: 1.35rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item strong {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
}

.video-section {
    margin: 2rem 0;
}

.video-preview {
    position: relative;
    border-radius: 1.8rem;
    overflow: hidden;
    min-height: 320px;
    background: rgba(0, 0, 0, 0.22);
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 190px;
}

.contact-section {
    margin: 2rem 0;
}

.contact-card {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
    .stats-grid,
    .features-grid,
    .grid-three,
    .review-grid,
    .purchase-card,
    .hero-intro,
    .split-block,
    .video-preview {
        grid-template-columns: 1fr;
    }
}
