/* =============================================
   ШРИФТ
   ============================================= */

@font-face {
    font-family: Versus;
    src: url("fonts/versus-ultra_RUS_BY_LYAJKA.otf") format("opentype");
}

:root {
    --red:         #f65152;
    --red-dim:     rgba(246, 81, 82, 0.15);
    --black:       #0a0a0a;
    --dark:        #111111;
    --dark2:       #181818;
    --gray:        rgba(255, 255, 255, 0.08);
    --gray-border: rgba(255, 255, 255, 0.12);
    --white:       #ffffff;
    --text:        rgba(255, 255, 255, 0.8);
}

/* =============================================
   СБРОС И БАЗА
   ============================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--black);
    color: var(--white);
    font-family: "Raleway", sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3 {
    margin: 0;
    font-family: Versus, "Raleway", sans-serif;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

/* =============================================
   НАВИГАЦИОННАЯ ПАНЕЛЬ
   ============================================= */

/* Навбар всегда поверх всех элементов */
.w3-top {
    z-index: 1000;
}

.navbar-brand {
    font-size: 16px;
}

.navbar-icon {
    width: 18px;
    margin-right: 3px;
    margin-bottom: 5px;
    vertical-align: middle;
}

.w3-bar .w3-button {
    padding: 16px;
}

/* =============================================
   ЗАГРУЗОЧНЫЙ ЭКРАН
   ============================================= */

.loader {
    position: fixed;
    inset: 0;
    background: var(--black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--red);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.active { display: flex; }
.hidden { display: none !important; }

/* =============================================
   ГЛАВНЫЙ ЭКРАН (Hero)
   ============================================= */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

/* Слой 1 — фоновое изображение с анимацией зума */
.hero-bg {
    position: absolute;
    inset: 0;
    background: url("images/bg.png") center / cover no-repeat;
    transform: scale(1.05);
    animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1.05); }
    to   { transform: scale(1.12); }
}

/* Слой 2 — тёмный градиент поверх фона */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 50%,
        rgba(0, 0, 0, 0.80) 100%
    );
}

/* Слой 3 — контент */
.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 24px 40px; /* верхний отступ — под навбар */
    animation: heroFadeIn 1s ease both;
}

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

/* Логотип */
.hero-logo {
    width: clamp(280px, 55vw, 760px);
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 32px rgba(246, 81, 82, 0.25));
    margin-bottom: 16px;
}

/* Подзаголовок */
.hero-sub {
    font-size: clamp(13px, 1.6vw, 18px);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 36px;
    font-weight: 600;
}

/* Версия сервера */
.hero-version {
    margin-top: 14px;
    font-size: clamp(12px, 1.2vw, 15px);
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.15em;
}

/* Стрелка прокрутки вниз */
.hero-scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 22px;
    z-index: 2;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* =============================================
   КНОПКА IP
   Используется в Hero и в секции CTA
   ============================================= */

.ip-btn {
    position: relative;
    width: 220px;
    height: 48px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--red);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease;
}

.ip-btn svg {
    position: absolute;
    left: 0;
    top: 0;
    fill: none;
    stroke: #fff;
    stroke-dasharray: 160 560;
    stroke-dashoffset: 160;
    transition: stroke-dashoffset 0.8s ease;
}

.ip-btn:hover { background: var(--red); }
.ip-btn:hover svg { stroke-dashoffset: -560; }

.ip-btn span {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: "Raleway", sans-serif;
}

/* =============================================
   ОБЩЕЕ ДЛЯ СЕКЦИЙ
   Все секции используют .section-inner для
   ограничения ширины и одинаковых отступов
   ============================================= */

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 80px);
}

.section-title {
    font-family: Versus, sans-serif;
    font-size: clamp(28px, 4.5vw, 56px);
    color: var(--white);
    text-align: center;
    margin-bottom: 12px;
}

.section-title .accent { color: var(--red); }

.section-lead {
    text-align: center;
    color: var(--text);
    font-size: clamp(14px, 1.5vw, 17px);
    max-width: 620px;
    margin: 0 auto 56px;
}

/* =============================================
   ОПИСАНИЕ СЕРВЕРА
   Секция с карточками характеристик
   ============================================= */

.section-about {
    background: var(--dark);
    padding: clamp(60px, 10vh, 120px) 0;
    position: relative;
}

/* Красная линия-разделитель сверху секции */
.section-about::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--red), transparent);
    margin-bottom: clamp(60px, 10vh, 120px);
}

/* Сетка карточек */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(220px, 22vw, 280px), 1fr));
    gap: 20px;
}

/* Карточка */
.card {
    background: var(--gray);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: clamp(24px, 3vw, 36px);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

/* Красная линия снизу карточки — появляется при наведении */
.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.card:hover {
    border-color: var(--red);
    background: var(--red-dim);
    transform: translateY(-4px);
}

.card:hover::after { transform: scaleX(1); }

.card-icon {
    /* font-size: clamp(28px, 3.5vw, 40px); */
    margin-bottom: 14px;
}

.card h3 {
    font-size: clamp(16px, 1.8vw, 22px);
    color: var(--white);
    margin-bottom: 10px;
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    text-align: center;
}

.card p {
    font-size: clamp(13px, 1.3vw, 15px);
    color: var(--text);
    line-height: 1.65;
}

/* Ссылка внутри карточки */
.card-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--red);
    font-size: clamp(13px, 1.3vw, 15px);
    font-weight: 600;
    letter-spacing: 0.04em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.card-link:hover { border-color: var(--red); }

/* =============================================
   ГАЛЕРЕЯ
   ============================================= */

.section-gallery {
    background: url("images/bg2.png") center / cover no-repeat fixed;
    padding: clamp(60px, 10vh, 120px) 0;
    position: relative;
}

/* Тёмный оверлей поверх фона галереи */
.section-gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

/* Контент галереи поверх оверлея */
.section-gallery .section-inner {
    position: relative;
    z-index: 1;
}

/* Сетка фотографий */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(220px, 30vw, 320px), 1fr));
    gap: 16px;
}

/* Элемент галереи */
.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    aspect-ratio: 4 / 3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.85);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
    filter: brightness(1);
}

/* Подпись появляется при наведении */
.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: white;
    font-size: clamp(12px, 1.3vw, 15px);
    font-weight: 600;
    padding: 20px 14px 10px;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-label { opacity: 1; }

/* =============================================
   ПРИЗЫВ К ДЕЙСТВИЮ (CTA)
   ============================================= */

.section-cta {
    background: var(--dark2);
    padding: clamp(60px, 10vh, 100px) 0;
    position: relative;
}

/* Красная линия-разделитель сверху */
.section-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--red), transparent);
}

.cta-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cta-inner h2 {
    font-size: clamp(24px, 4vw, 48px);
    color: var(--white);
}

.cta-inner > p {
    font-size: clamp(14px, 1.5vw, 17px);
    color: var(--text);
    margin-bottom: 12px;
}

.cta-ip { margin-top: 8px; }

/* =============================================
   ПОДВАЛ
   ============================================= */

.site-footer {
    background: #000;
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-up {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: border-color 0.3s, color 0.3s;
}

.footer-up:hover {
    border-color: var(--red);
    color: var(--red);
}

.footer-socials {
    display: flex;
    gap: 20px;
    font-size: 22px;
}

.footer-socials a {
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.3s;
}

.footer-socials a:hover .fa-telegram{ color: #24A1DE; }
.footer-socials a:hover .fa-vk{ color: #0077FF; }
.footer-socials a:hover .fa-discord{ color: #5865F2; }

.footer-copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.08em;
}

/* =============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ ПРИ СКРОЛЛЕ
   Отвечает класс "reveal"
   ============================================= */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   ВАГОНЕТКА (Анимированная)
   ============================================= */

/* 1. Рельсы бегут влево, создавая эффект движения вправо */
.card:hover .rails-scroll {
    animation: railMove 0.25s linear infinite;
}

@keyframes railMove {
    0%   { transform: translateX(0px); }
    100% { transform: translateX(-16px); }
}

/* 2. Сама вагонетка уезжает вправо через 0.5с с ускорением */
.card:hover .minecart-group {
    animation: cartLeave 1.5s ease-in forwards;
    animation-delay: 0.5s; /* Задержка перед стартом */
}

@keyframes cartLeave {
    0%   { transform: translateX(0); }
    100% { transform: translateX(400px); } /* Улетает за правую границу */
}

/* 3. Колёса вращаются */
.card:hover .wheel-left,
.card:hover .wheel-right {
    animation: wheelSpin 0.4s linear infinite;
}

/* Центрирование точек вращения для колес */
.wheel-left { transform-origin: 80px 63px; }
.wheel-right { transform-origin: 108px 63px; }

@keyframes wheelSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =============================================
   АЛМАЗЫ — веер при наведении
   ============================================= */

/* Контейнер для центрирования алмазов */
.diamond-wrapper {
    position: relative;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    /*margin-bottom: 14px;*/
}

/* Базовый стиль для всех алмазов */
.diamond-img {
    position: absolute;
    height: 60px; /* Настройте размер под себя */
    width: auto;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Боковые алмазы по умолчанию скрыты и находятся в центре */
.d-left, .d-right {
    opacity: 0;
    z-index: 1;
}

/* Центральный алмаз всегда виден и чуть выше уровнем */
.d-center {
    position: relative;
    z-index: 2;
}

/* --- Анимация при наведении на КАРТОЧКУ --- */

/* Левый алмаз вылетает влево и наклоняется */
.card:hover .d-left {
    opacity: 1;
    transform: translate(-35px, 8px) rotate(-25deg);
}

/* Правый алмаз вылетает вправо и наклоняется */
.card:hover .d-right {
    opacity: 1;
    transform: translate(35px, 8px) rotate(25deg);
}

/* Центральный алмаз немного подпрыгивает */
.card:hover .d-center {
    transform: translateY(-5px);
}

/* =============================================
   КОНВЕЙЕР — лента и ресурсы
   ============================================= */

.conveyor-container {
    position: relative;
    width: 100%;
    margin-bottom: 14px; /* Отступ до заголовка H3 */
}

/* Лента (движение влево-вправо для имитации бесконечности) */
.belt-scroll {
    transition: transform 0.3s linear;
}

.card:hover .belt-scroll {
    animation: beltMove 0.5s linear infinite;
}

@keyframes beltMove {
    from { transform: translateX(-16px); }
    to   { transform: translateX(0); } /* Смещение на шаг паттерна */
}

/* Ресурсы */
.resource-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: hidden;
}

.res-img {
    position: absolute;
    width: 22px;
    height: auto;
    bottom: 6px;
    opacity: 0;
}

/* Запуск анимации ресурсов при наведении на карточку */
.card:hover .res-gold { animation: resImgMove 3s linear infinite 0s; }
.card:hover .res-bone { animation: resImgMove 3s linear infinite 1s; }
.card:hover .res-iron { animation: resImgMove 3s linear infinite 2s; }

@keyframes resImgMove {
    0% { 
        opacity: 0; 
        left: 10%; 
    }
    10% { 
        opacity: 1; 
    }
    80% { 
        opacity: 1; 
    }
    90% {
        opacity: 0;
    }
    100% { 
        opacity: 0; 
        left: 90%; /* 110% ширины контейнера — это всегда его конец */
    }
}