/* ═══════════════════════════════════════════════════════════
   🏜️ CRIMSON DESERT FOOTER · CRD GAME V3.1
   Единый стиль с архивом и страницей материала
═══════════════════════════════════════════════════════════ */

#footer { display: none !important; }

/* ═══════════════════════════════════════════
   ОСНОВНОЙ КОНТЕЙНЕР
═══════════════════════════════════════════ */
.cd-footer {
    position: relative;
    background: 
        linear-gradient(180deg, #15130e 0%, #0d0c0a 100%);
    border-top: 1px solid rgba(174, 137, 84, 0.2);
    padding: 60px 20px 40px;
    margin-top: 60px;
    font-family: 'Open Sans', sans-serif;
    color: #8a7d6e;
    overflow: hidden;
}

/* Золотистая линия сверху (как у архива) */
.cd-footer::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 50%;
    transform: translateX(-50%);
    width: 80%; 
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(174, 137, 84, 0.5) 50%, 
        transparent 100%);
    box-shadow: 0 0 8px rgba(174, 137, 84, 0.3);
}

/* Декоративный ромб сверху по центру */
.cd-footer::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #ae8954;
    box-shadow: 0 0 10px rgba(174, 137, 84, 0.6);
}

/* ═══════════════════════════════════════════
   EYEBROW + ЗАГОЛОВОК ФУТЕРА (опционально)
═══════════════════════════════════════════ */
.cd-footer-eyebrow {
    text-align: center;
    color: #ae8954;
    font-family: 'Russo One', sans-serif;
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 35px;
}

/* ═══════════════════════════════════════════
   ПРАВОВЫЕ ССЫЛКИ
═══════════════════════════════════════════ */
.cd-footer-nav {
    display: flex; 
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap; 
    gap: 18px;
    margin: 0 auto 30px; 
    padding-bottom: 35px;
    max-width: 900px;
    border-bottom: 1px solid rgba(174, 137, 84, 0.15);
    text-align: center;
    position: relative;
}

/* Один ромб по центру линии под ссылками */
.cd-footer-nav::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 5px;
    height: 5px;
    background: #ae8954;
    box-shadow: 0 0 6px rgba(174, 137, 84, 0.5);
    pointer-events: none;
}

.cd-footer-nav-link {
    color: #8a7d6e; 
    font-family: 'Russo One', sans-serif;
    font-size: 11px; 
    text-decoration: none;
    letter-spacing: 2.5px; 
    text-transform: uppercase;
    position: relative; 
    padding: 6px 4px;
    transition: color 0.25s ease;
}
.cd-footer-nav-link::after {
    content: ''; 
    position: absolute; 
    left: 0; 
    bottom: 0;
    width: 100%; 
    height: 1px; 
    background: #ae8954;
    transform: scaleX(0); 
    transform-origin: center;
    transition: transform 0.25s ease;
    box-shadow: 0 0 6px rgba(174, 137, 84, 0.4);
}
.cd-footer-nav-link:hover { color: #c5b8aa; }
.cd-footer-nav-link:hover::after { transform: scaleX(1); }

.cd-footer-nav-sep { 
    color: #ae8954; 
    font-size: 8px; 
    user-select: none;
    opacity: 0.5;
    transform: rotate(45deg);
    display: inline-block;
}

/* ═══════════════════════════════════════════
   СОЦСЕТИ — визуальный центр футера
═══════════════════════════════════════════ */
.cd-sns-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    margin: 0 auto 30px;
    padding: 35px 0;
    max-width: 900px;
    border-bottom: 1px solid rgba(174, 137, 84, 0.15);
    flex-wrap: wrap;
    position: relative;
}

/* Ромб по центру линии под соцсетями */
.cd-sns-area::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 5px;
    height: 5px;
    background: #ae8954;
    box-shadow: 0 0 6px rgba(174, 137, 84, 0.5);
    pointer-events: none;
}

.cd-sns {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
    padding: 0;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Убираем декоративные псевдо-элементы у иконок */
.cd-sns::before,
.cd-sns::after {
    content: none !important;
    display: none !important;
}

.cd-sns img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
    filter: saturate(0.75) brightness(0.85);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.cd-sns:hover {
    transform: translateY(-4px);
}

.cd-sns:hover img {
    filter: saturate(1) brightness(1.1) drop-shadow(0 0 8px rgba(174, 137, 84, 0.5));
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════
   НИЖНЯЯ ЧАСТЬ — КОПИРАЙТ
═══════════════════════════════════════════ */
.cd-footer-inner { 
    max-width: 1280px; 
    margin: 0 auto; 
}

/* Старый разделитель больше не нужен — линия теперь у .cd-sns-area */
.cd-footer-divider {
    display: none;
}

.cd-footer-bottom { 
    text-align: center; 
    margin-bottom: 25px;
    padding-top: 20px;
}

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

.cd-copy-line { 
    color: #8a7d6e; 
    font-size: 12px; 
    margin: 0 0 6px; 
    letter-spacing: 0.5px;
}
.cd-copy-line strong {
    color: #c5b8aa; 
    font-family: 'Russo One', sans-serif; 
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
}

.cd-copy-sub { 
    color: #6a5d4e; 
    font-size: 10px; 
    margin: 0; 
    font-style: italic;
    letter-spacing: 1px;
}

.cd-powered {
    text-align: center; 
    color: #5a4f43; 
    font-size: 9px;
    font-family: 'Russo One', sans-serif;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding-top: 20px; 
    margin-top: 20px;
    border-top: 1px solid rgba(174, 137, 84, 0.08);
}
.cd-powered a { 
    color: #8a7d6e; 
    text-decoration: none; 
    transition: color 0.25s ease;
}
.cd-powered a:hover { 
    color: #ae8954; 
}

/* ═══════════════════════════════════════════
   КНОПКА "НАВЕРХ" — Crimson Desert style
═══════════════════════════════════════════ */
button#btnScrollTop,
body button#btnScrollTop,
#casing button#btnScrollTop {
    position: fixed !important;
    bottom: 40px !important;
    right: 40px !important;
    width: 48px !important;
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(20, 17, 13, 0.85) !important;
    background-color: rgba(20, 17, 13, 0.85) !important;
    background-image: none !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(174, 137, 84, 0.5) !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.5) !important;
    cursor: pointer !important;
    z-index: 999 !important;
    opacity: 0;
    visibility: hidden;
    transition: 
        opacity 0.3s ease,
        visibility 0.3s ease,
        background-color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    outline: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    min-width: 0 !important;
    max-width: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    font-family: inherit !important;
    font-weight: normal !important;
    overflow: visible !important;
}

/* Прячем PNG-иконку */
button#btnScrollTop img {
    display: none !important;
}

/* Стрелка вверх через CSS */
button#btnScrollTop::before {
    content: '' !important;
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    border-top: 2px solid #ae8954 !important;
    border-right: 2px solid #ae8954 !important;
    transform: rotate(-45deg) translate(-2px, 2px) !important;
    transition: border-color 0.25s ease, transform 0.25s ease !important;
    pointer-events: none !important;
}

/* L-уголок (в состоянии покоя) */
button#btnScrollTop::after {
    content: '' !important;
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    width: 8px !important;
    height: 8px !important;
    border-top: 1px solid rgba(174, 137, 84, 0.6) !important;
    border-left: 1px solid rgba(174, 137, 84, 0.6) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}
button#btnScrollTop.is-visible::after {
    opacity: 1 !important;
}

/* Hover */
button#btnScrollTop:hover,
button#btnScrollTop:focus,
button#btnScrollTop:active {
    background: #ae8954 !important;
    background-color: #ae8954 !important;
    background-image: none !important;
    border-color: #ae8954 !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(174, 137, 84, 0.4) !important;
    outline: 0 !important;
    transform: translateY(-4px) !important;
}
button#btnScrollTop:hover::before,
button#btnScrollTop:focus::before {
    border-top-color: #14110d !important;
    border-right-color: #14110d !important;
    transform: rotate(-45deg) translate(-2px, 0) !important;
}
button#btnScrollTop:hover::after {
    opacity: 0 !important;
}

button#btnScrollTop.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ═══════════════════════════════════════════
   АДАПТИВ
═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .cd-footer { 
        padding: 45px 16px 30px;
        margin-top: 40px;
    }
    .cd-footer-eyebrow {
        font-size: 10px;
        letter-spacing: 3px;
        margin-bottom: 28px;
    }
    .cd-footer-nav { 
        gap: 12px 16px; 
        margin-bottom: 25px; 
        padding-bottom: 28px; 
    }
    .cd-footer-nav-link { 
        font-size: 10px;
        letter-spacing: 2px;
    }
    .cd-sns-area {
        gap: 28px;
        padding: 28px 0;
        margin-bottom: 25px;
    }
    .cd-sns {
        width: 40px;
        height: 40px;
    }
    .cd-sns img {
        width: 34px;
        height: 34px;
    }
    .cd-copy-line { font-size: 11px; }
    .cd-copy-sub { font-size: 9px; }
    .cd-powered { 
        font-size: 8px;
        letter-spacing: 2px;
    }

    button#btnScrollTop {
        bottom: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
    }
    button#btnScrollTop::before {
        width: 11px !important;
        height: 11px !important;
        transform: rotate(-45deg) translate(-1px, 1px) !important;
    }
    button#btnScrollTop:hover::before {
        transform: rotate(-45deg) translate(-1px, 0) !important;
    }
}

@media (max-width: 480px) {
    .cd-footer-nav { 
        flex-direction: column; 
        gap: 10px; 
    }
    .cd-footer-nav-sep { display: none; }
    .cd-sns-area { gap: 22px; }
    .cd-copy-line { font-size: 11px; }
    .cd-copy-sub { font-size: 9px; }
}

/* ═══════════════════════════════════════════
   REDUCED MOTION
═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .cd-sns,
    .cd-sns img,
    .cd-footer-nav-link::after,
    button#btnScrollTop {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════
   ЕДИНЫЙ ОТСТУП ПЕРЕД ФУТЕРОМ НА ВСЕХ СТРАНИЦАХ
═══════════════════════════════════════════ */

/* 1. Обнуляем margin-bottom у всех "последних" блоков на разных страницах */
.crd-info,
.crd-home section:last-child,
.crd-home > div:last-child > section:last-child,
#content > *:last-child,
.page-content-wrapper > *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 2. Обнуляем padding-bottom у #casing на форуме и других модулях */
#casing {
    padding-bottom: 0 !important;
}

/* 3. Задаём ЕДИНЫЙ отступ через футер */
footer.cd-footer {
    margin-top: 10px !important;     /* ← регулируй здесь */
    padding-top: 50px !important;
}

footer.cd-footer .cd-footer-nav {
    margin-top: 20px !important;
}