/* ============================================================
   ЯРУГА 2026 — единая дизайн-система
   Трофи-рейд · графит + янтарь
   ============================================================ */

:root {
    /* Палитра */
    --amber:        #ea580c;   /* основной акцент */
    --amber-deep:   #c2410c;   /* hover */
    --amber-soft:   #fff3ea;   /* мягкая подложка */
    --ink:          #1a1714;   /* почти чёрный графит */
    --ink-soft:     #2e2a25;
    --slate:        #6f6a64;   /* вторичный текст */
    --line:         #e9e4dd;   /* границы */
    --paper:        #ffffff;
    --bg:           #f6f4f1;

    /* Тени */
    --shadow-sm:  0 1px 3px rgba(26,23,20,0.06), 0 1px 2px rgba(26,23,20,0.04);
    --shadow-md:  0 6px 20px rgba(26,23,20,0.08);
    --shadow-lg:  0 18px 50px rgba(26,23,20,0.14);
    --shadow-amber: 0 12px 28px rgba(234,88,12,0.28);

    /* Геометрия */
    --r-sm: 12px;
    --r-md: 18px;
    --r-lg: 26px;
    --r-pill: 999px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--ink-soft);
    position: relative;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Затемнённый фон-картинка */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(26,23,20,0.76) 0%, rgba(26,23,20,0.60) 100%),
        url('/images/background-v2.jpg');
    background-image:
        linear-gradient(180deg, rgba(26,23,20,0.76) 0%, rgba(26,23,20,0.60) 100%),
        image-set(
            url('/images/background-v2.webp') type('image/webp'),
            url('/images/background-v2.jpg') type('image/jpeg')
        );
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    position: relative;
    z-index: 1;
}

/* Карточки-секции */
.hero-section,
.info-section,
.gallery-section,
.sponsors-section,
.application-header,
.application-form,
.form-info,
.admin-header,
.admin-content {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
}

/* ===================== HERO ===================== */
.hero-section {
    border-radius: var(--r-lg);
    padding: 56px 56px 48px;
    margin-bottom: 26px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--amber) 0%, #fdba74 100%);
}

.main-title {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    color: var(--ink);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    line-height: 1.02;
}
.main-title { /* акцентная подсветка через фон у первого слова не нужна — оставляем читаемым */ }

.subtitle {
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    color: var(--amber);
    margin-bottom: 36px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero-content {
    display: flex;
    gap: 48px;
    align-items: center;
    margin-top: 36px;
    text-align: left;
}

.hero-text { flex: 1; }

.hero-text h2 {
    color: var(--ink);
    margin-bottom: 16px;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
}

.hero-text p {
    color: var(--slate);
    line-height: 1.65;
    margin-bottom: 18px;
    font-size: 1.02rem;
}

.features {
    list-style: none;
    margin-top: 22px;
    display: grid;
    gap: 12px;
}
.features li {
    color: var(--ink);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.features i {
    color: var(--paper);
    background: var(--amber);
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(234,88,12,0.35);
    margin-right: 0;
}

.cta-section {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* ===================== КНОПКИ ===================== */
.apply-button,
.reglament-button,
.participants-button,
.routes-button,
.results-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--paper);
    padding: 17px 32px;
    font-size: 1.12rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--r-pill);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
    border: none;
    width: 100%;
    text-align: center;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.apply-button {
    background: linear-gradient(135deg, var(--amber) 0%, #f97316 100%);
    box-shadow: var(--shadow-amber);
}
.apply-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(234,88,12,0.4);
}

.participants-button {
    background: var(--ink);
    box-shadow: 0 10px 22px rgba(26,23,20,0.28);
}
.participants-button:hover {
    transform: translateY(-4px);
    background: var(--ink-soft);
}

.routes-button {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    box-shadow: 0 10px 22px rgba(13,148,136,0.30);
}
.routes-button:hover { transform: translateY(-4px); }

.results-button {
    background: linear-gradient(135deg, #2f6e43 0%, #3a8a57 100%);
    box-shadow: 0 10px 22px rgba(47,110,67,0.32);
}
.results-button:hover { transform: translateY(-4px); }

.reglament-button {
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.reglament-button:hover {
    transform: translateY(-4px);
    border-color: var(--amber);
    color: var(--amber-deep);
    box-shadow: var(--shadow-md);
}

.cta-note {
    color: var(--slate);
    font-size: 0.9rem;
    margin-top: 16px;
    text-align: center;
}

/* ===================== ИНФО / СТАТИСТИКА ===================== */
.info-section {
    border-radius: var(--r-lg);
    padding: 46px 40px;
    margin-bottom: 26px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.info-section h2 {
    color: var(--ink);
    margin-bottom: 34px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}
.stat-item {
    flex: 1;
    min-width: 220px;
    padding: 30px 24px;
    background: linear-gradient(180deg, #ffffff 0%, var(--amber-soft) 100%);
    border-radius: var(--r-md);
    text-align: center;
    border: 1px solid var(--line);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.stat-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}
.stat-item i {
    font-size: 2.2rem;
    color: var(--amber);
    margin-bottom: 8px;
}
.stat-item span {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--ink);
    margin: 6px 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-item p {
    color: var(--slate);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ===================== ГАЛЕРЕЯ ===================== */
.gallery-section {
    border-radius: var(--r-lg);
    padding: 46px 40px;
    margin-bottom: 26px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.gallery-section h2 {
    color: var(--ink);
    margin-bottom: 34px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}
.gallery-section h2 i { color: var(--amber); margin-right: 10px; }

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 1000px;
}
.carousel-track-container {
    overflow: hidden;
    width: 100%;
    border-radius: var(--r-md);
}
.carousel-track {
    --visible-slides: 1;
    display: flex;
    transition: transform 0.6s var(--ease);
    will-change: transform;
}
.carousel-track.carousel-track-static { justify-content: center; }
.carousel-slide {
    flex: 0 0 calc(100% / var(--visible-slides));
    min-width: 0;
    padding: 0 8px;
}
.carousel-slide img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.4s var(--ease);
}
.carousel-slide img:hover { transform: scale(1.02); }

.carousel-btn {
    background: rgba(255,255,255,0.95);
    color: var(--ink);
    border: 1px solid var(--line);
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    transition: all 0.25s var(--ease);
    box-shadow: var(--shadow-md);
}
.carousel-btn:hover {
    background: var(--amber);
    color: var(--paper);
    transform: scale(1.08);
}
.prev-btn { left: -16px; }
.next-btn { right: -16px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    gap: 9px;
}
.carousel-dots[hidden], .carousel-btn[hidden] { display: none; }
.dot, .carousel-dot {
    width: 10px; height: 10px;
    border-radius: var(--r-pill);
    background: #cfd4da;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    border: none;
    padding: 0;
}
.dot.active, .carousel-dot.active {
    background: var(--amber);
    width: 28px;
}

.gallery-loading {
    text-align: center;
    padding: 50px;
    color: var(--slate);
    width: 100%;
}
.gallery-loading i { color: var(--amber); margin-right: 8px; }

.gallery-open-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    cursor: zoom-in;
    color: inherit;
}
.gallery-open-button:focus-visible {
    outline: 3px solid rgba(234, 88, 12, 0.72);
    outline-offset: 4px;
}
.gallery-open-button img { display: block; }

body.lightbox-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 68px 76px 56px;
    background: rgba(14, 13, 12, 0.94);
    color: #fff;
    overscroll-behavior: contain;
    touch-action: pan-y;
    animation: gallery-lightbox-fade-in 180ms ease-out;
}
.gallery-lightbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 4px solid rgba(255,255,255,0.24);
    border-top-color: var(--amber);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: gallery-lightbox-spin 0.8s linear infinite;
    transition: opacity 120ms ease;
}
.gallery-lightbox.is-loading::after { opacity: 1; }

.gallery-lightbox-figure {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: calc(100vw - 152px);
    max-height: calc(100vh - 124px);
    max-height: calc(100dvh - 124px);
    margin: 0;
}
.gallery-lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
    opacity: 0;
    transform: scale(0.985);
    transition: opacity 180ms ease, transform 220ms ease;
    user-select: none;
    -webkit-user-drag: none;
}
.gallery-lightbox-figure img.is-ready {
    opacity: 1;
    transform: scale(1);
}
.gallery-lightbox-figure figcaption {
    max-width: min(760px, calc(100vw - 48px));
    margin-top: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0,0,0,0.54);
    color: rgba(255,255,255,0.92);
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: center;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.20);
    background: rgba(20,18,17,0.62);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    background: var(--amber);
    border-color: var(--amber);
    transform: scale(1.06);
}
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
    outline: 3px solid rgba(255,255,255,0.92);
    outline-offset: 3px;
}
.gallery-lightbox-close {
    top: 18px;
    right: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}
.gallery-lightbox-nav {
    top: 50%;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 1.75rem;
    transform: translateY(-50%);
}
.gallery-lightbox-nav:hover { transform: translateY(-50%) scale(1.06); }
.gallery-lightbox-prev { left: 20px; }
.gallery-lightbox-next { right: 20px; }
.gallery-lightbox-nav[hidden] { display: none; }
.gallery-lightbox-counter {
    position: absolute;
    z-index: 3;
    top: 24px;
    left: 24px;
    min-width: 58px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(20,18,17,0.62);
    color: rgba(255,255,255,0.92);
    font-size: 0.88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    backdrop-filter: blur(8px);
}

@keyframes gallery-lightbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes gallery-lightbox-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .gallery-lightbox {
        padding: 70px 12px 52px;
        background: rgba(14, 13, 12, 0.97);
    }
    .gallery-lightbox-figure {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 122px);
        max-height: calc(100dvh - 122px);
    }
    .gallery-lightbox-figure img {
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
        border-radius: 9px;
    }
    .gallery-lightbox-close {
        top: max(14px, env(safe-area-inset-top));
        right: 14px;
        width: 44px;
        height: 44px;
    }
    .gallery-lightbox-counter {
        top: max(18px, env(safe-area-inset-top));
        left: 14px;
    }
    .gallery-lightbox-nav {
        top: auto;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 48px;
        height: 48px;
        transform: none;
        background: rgba(20,18,17,0.78);
    }
    .gallery-lightbox-nav:hover { transform: scale(1.06); }
    .gallery-lightbox-prev { left: calc(50% - 60px); }
    .gallery-lightbox-next { right: calc(50% - 60px); }
    .gallery-lightbox-figure figcaption {
        max-width: calc(100vw - 32px);
        margin-top: 10px;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-lightbox,
    .gallery-lightbox-figure img,
    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        animation: none;
        transition: none;
    }
}

/* ===================== СПОНСОРЫ ===================== */
.sponsors-section {
    border-radius: var(--r-lg);
    padding: 46px 40px;
    margin-bottom: 26px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    width: 100%;
}
.sponsors-section h2 {
    color: var(--ink);
    margin-bottom: 34px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}
.sponsors-section h2 i { color: var(--amber); margin-right: 10px; }

.sponsors-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: stretch;
    margin: 30px auto 10px;
    width: 100%;
}
@media (max-width: 992px)  { .sponsors-section { padding: 36px 22px; } .sponsors-grid { gap: 14px; } }
@media (max-width: 768px)  { .sponsors-section { padding: 30px 16px; } .sponsors-grid { gap: 12px; } .sponsors-section h2 { font-size: 1.6rem; } }
@media (max-width: 576px)  { .sponsors-section { padding: 24px 12px; } .sponsors-grid { gap: 10px; } }
@media (max-width: 400px)  { .sponsors-grid { gap: 8px; } }

.sponsor-item {
    background: var(--paper);
    padding: 16px 10px;
    border-radius: var(--r-sm);
    transition: all 0.3s var(--ease);
    border: 1px solid var(--line);
    width: 160px;
    max-width: 100%;
    flex: 0 1 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}
.sponsor-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--amber);
}
@media (max-width: 768px) { .sponsor-item { padding: 12px 6px; flex-basis: calc((100% - 24px) / 3); } }
@media (max-width: 576px) { .sponsor-item { padding: 10px 5px; flex-basis: calc((100% - 20px) / 3); } }
@media (max-width: 480px) { .sponsor-item { padding: 9px 4px; } }
@media (max-width: 400px) { .sponsor-item { padding: 7px 3px; flex-basis: calc((100% - 16px) / 3); } }

.sponsor-logo {
    width: 100px; height: 100px;
    object-fit: contain;
    border-radius: var(--r-sm);
    transition: transform 0.3s var(--ease);
    background-color: var(--paper);
    padding: 10px;
}
.sponsor-item:hover .sponsor-logo { transform: scale(1.05); }
@media (max-width: 768px) { .sponsor-logo { width: 80px; height: 80px; } }
@media (max-width: 576px) { .sponsor-logo { width: 70px; height: 70px; } }
@media (max-width: 480px) { .sponsor-logo { width: 60px; height: 60px; padding: 5px; } }
@media (max-width: 400px) { .sponsor-logo { width: 50px; height: 50px; } }

.sponsor-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    text-align: center;
    word-break: break-word;
}
@media (max-width: 768px) { .sponsor-name { font-size: 0.85rem; } }
@media (max-width: 576px) { .sponsor-name { font-size: 0.78rem; } }
@media (max-width: 480px) { .sponsor-name { font-size: 0.7rem; } }

.sponsor-placeholder {
    width: 100px; height: 100px;
    background: linear-gradient(135deg, var(--amber) 0%, #f97316 100%);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper);
    font-size: 2rem;
}
@media (max-width: 768px) { .sponsor-placeholder { width: 80px; height: 80px; font-size: 1.8rem; } }
@media (max-width: 576px) { .sponsor-placeholder { width: 70px; height: 70px; font-size: 1.5rem; } }
@media (max-width: 480px) { .sponsor-placeholder { width: 60px; height: 60px; font-size: 1.3rem; } }
@media (max-width: 400px) { .sponsor-placeholder { width: 50px; height: 50px; font-size: 1.1rem; } }

.sponsor-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.sponsor-item img { max-width: 100%; height: auto; min-height: 80px; object-fit: contain; }

/* ===================== ФОРМА ЗАЯВКИ (общая) ===================== */
.application-header {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 32px;
    text-align: center;
    border: 1px solid var(--line);
    border-bottom: none;
}
.application-header h1 { color: var(--ink); margin-top: 16px; font-weight: 700; }

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--amber);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 600;
    transition: gap 0.25s var(--ease);
}
.back-button:hover { gap: 12px; }

.application-form {
    padding: 42px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    margin-bottom: 26px;
    border: 1px solid var(--line);
    border-top: none;
    box-shadow: var(--shadow-md);
}
.form-group { margin-bottom: 26px; }
.form-group label {
    display: block;
    color: var(--ink);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.02rem;
}
.form-group label i { margin-right: 10px; color: var(--amber); }
.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s var(--ease);
    background: var(--paper);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(234,88,12,0.12);
}

.form-actions { display: flex; gap: 18px; margin-top: 36px; }
.submit-button, .cancel-button {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    text-align: center;
}
.submit-button {
    background: linear-gradient(135deg, var(--amber) 0%, #f97316 100%);
    color: var(--paper);
    box-shadow: var(--shadow-amber);
}
.submit-button:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(234,88,12,0.4); }
.cancel-button { background: #eef1f4; color: var(--slate); }
.cancel-button:hover { background: #e2e7ec; }

/* Сообщения / статусы */
.error-message { color: #e53e3e; font-size: 0.9rem; margin-top: 5px; display: none; }
.number-status { margin-top: 6px; font-size: 0.9rem; padding: 6px 12px; border-radius: 8px; display: none; }
.number-status.available { background: #d8f5e3; color: #1c6b40; display: block; }
.number-status.taken,
.number-status.error { background: #fde2e2; color: #8a2a2a; display: block; }
.response-message { margin-top: 20px; padding: 15px; border-radius: var(--r-sm); display: none; }
.response-message.success { background: #d8f5e3; color: #1c6b40; display: block; }
.response-message.error { background: #fde2e2; color: #8a2a2a; display: block; }

/* ===================== АДМИНКА ===================== */
.admin-header {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 32px;
    text-align: center;
    border: 1px solid var(--line);
    border-bottom: none;
}
.admin-header h1 { color: var(--ink); margin: 18px 0; font-weight: 700; }
.admin-header h1 i { margin-right: 14px; color: var(--amber); }
.admin-stats {
    background: var(--amber);
    color: var(--paper);
    padding: 10px 22px;
    border-radius: var(--r-pill);
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    box-shadow: var(--shadow-amber);
}
.admin-content {
    padding: 0 32px 32px;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    border: 1px solid var(--line);
    border-top: none;
    box-shadow: var(--shadow-md);
}
.admin-section {
    margin: 36px 0;
    padding: 30px;
    background: #fafbfc;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    border-left: 4px solid var(--amber);
}
.admin-section h2 { color: var(--ink); margin-bottom: 20px; font-size: 1.4rem; font-weight: 700; }
.admin-section h2 i { margin-right: 10px; color: var(--amber); }

.table-container { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.admin-table th {
    background: var(--ink);
    color: var(--paper);
    padding: 14px;
    text-align: left;
    font-weight: 600;
    border: none;
    font-size: 0.92rem;
}
.admin-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.admin-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.admin-table td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.admin-table tbody tr { transition: background 0.2s var(--ease); }
.admin-table tbody tr:hover { background: var(--amber-soft); }

.board-number { font-weight: 700; color: var(--amber); font-size: 1.05rem; font-family: 'JetBrains Mono', monospace; }
.category-badge {
    display: inline-block;
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--amber) 0%, #f97316 100%);
    color: var(--paper);
    border-radius: var(--r-pill);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Табы */
.category-tabs { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.tab-button {
    padding: 10px 22px;
    background: #eef1f4;
    border-radius: var(--r-pill);
    cursor: pointer;
    color: var(--ink-soft);
    transition: all 0.25s var(--ease);
    border: none;
    font-weight: 500;
}
.tab-button:hover { background: #e2e7ec; }
.tab-button.active { background: var(--amber); color: var(--paper); box-shadow: var(--shadow-amber); }

.category-table { display: none; }
.category-table h3 { color: var(--ink); margin-bottom: 18px; font-size: 1.25rem; font-weight: 700; }

.empty-message { text-align: center; padding: 44px; color: var(--slate); }
.empty-message i { margin-right: 10px; color: var(--amber); }

/* ===================== ИНФО-БЛОК ФОРМЫ ===================== */
.form-info {
    border-radius: var(--r-lg);
    padding: 32px;
    margin-top: 26px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.form-info h3 { color: var(--ink); margin-bottom: 20px; font-weight: 700; }
.form-info ul { list-style: none; }
.form-info li { margin-bottom: 14px; color: var(--slate); display: flex; align-items: baseline; gap: 10px; }
.form-info li i { margin-right: 6px; color: var(--amber); min-width: 18px; }
.form-info a { color: var(--amber); text-decoration: none; font-weight: 600; transition: color 0.25s var(--ease); }
.form-info a:hover { color: var(--amber-deep); text-decoration: underline; }

/* ===================== ФУТЕР ===================== */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: var(--paper);
}

.main-footer {
    background: rgba(26, 23, 20, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(234,88,12,0.4);
    border-radius: var(--r-lg);
    padding: 28px 24px;
    margin-top: 40px;
    color: var(--paper);
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1180px;
    margin: 0 auto;
}
.footer-left, .footer-center, .footer-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.footer-left { align-items: flex-start; text-align: left; }
.footer-logo { max-width: 78px; height: auto; margin-bottom: 10px; }

.admin-link {
    color: var(--amber);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.85;
    transition: opacity 0.25s var(--ease);
    margin-top: 5px;
    display: inline-block;
}
.admin-link:hover { opacity: 1; text-decoration: underline; }

.footer-center { align-items: center; }
.footer-center p { margin: 0; font-size: 1rem; }

.footer-right { align-items: flex-end; text-align: right; }
.footer-address {
    margin-bottom: 10px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}
.footer-address i { color: var(--amber); font-size: 1rem; }

.footer-vk-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #0077ff;
    color: var(--paper);
    padding: 9px 16px;
    border-radius: var(--r-pill);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s var(--ease);
    border: 1px solid transparent;
}
.footer-vk-link i { font-size: 1.2rem; }
.footer-vk-link:hover {
    background-color: #005bb5;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 119, 255, 0.35);
}

/* ===================== АДАПТАЦИЯ ===================== */
@media screen and (max-width: 768px) {
    .container { padding: 18px 12px 32px; }
    .hero-section { padding: 34px 22px; }
    .subtitle { margin-bottom: 26px; }
    .hero-content { flex-direction: column; gap: 30px; text-align: center; }
    .hero-text { text-align: center; }
    .features { text-align: left; max-width: 320px; margin: 20px auto; }
    .cta-section { flex: 0 0 auto; width: 100%; max-width: 420px; margin: 0 auto; }
    .apply-button, .reglament-button, .participants-button, .routes-button, .results-button { padding: 15px 28px; font-size: 1.05rem; }
    .stats { flex-direction: column; gap: 14px; }
    .stat-item { min-width: 100%; }
    .stat-item span { font-size: 2.3rem; }
    .gallery-section { padding: 28px 20px; }
    .carousel-slide img { height: 210px; }
    .carousel-btn { width: 42px; height: 42px; }
    .prev-btn { left: 6px; }
    .next-btn { right: 6px; }
    .application-header { padding: 22px; }
    .application-header h1 { font-size: 1.5rem; margin-top: 14px; }
    .application-form { padding: 24px; }
    .form-actions { flex-direction: column; gap: 12px; }
    .submit-button, .cancel-button { width: 100%; }
    .form-info { padding: 22px; }
    .form-info li { font-size: 0.95rem; word-break: break-word; align-items: flex-start; }
    .form-info a { word-break: break-word; }
    .admin-header { padding: 22px; }
    .admin-content { padding: 0 16px 16px; }
    .admin-section { padding: 22px; margin: 22px 0; }
    .category-tabs { gap: 6px; }
    .tab-button { padding: 9px 16px; font-size: 0.9rem; }
    .admin-table th, .admin-table td { padding: 11px; font-size: 0.88rem; }
    .admin-section > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .footer-container { flex-direction: column; gap: 24px; }
    .footer-left, .footer-center, .footer-right { width: 100%; align-items: center !important; text-align: center !important; }
    .footer-address { justify-content: center; white-space: normal; word-break: break-word; }
    .footer-logo { max-width: 70px; }
}

@media screen and (max-width: 480px) {
    .hero-section { padding: 26px 16px; }
    .apply-button, .reglament-button, .participants-button, .routes-button, .results-button { padding: 13px 22px; font-size: 1rem; }
    .stat-item { padding: 22px; }
    .stat-item span { font-size: 2rem; }
    .carousel-slide img { height: 170px; }
    .back-button { font-size: 0.9rem; }
    .category-badge { padding: 4px 11px; font-size: 0.78rem; }
    .footer-address { font-size: 0.85rem; flex-wrap: wrap; justify-content: center; }
    .footer-vk-link { padding: 7px 13px; font-size: 0.85rem; }
    .footer-center p { font-size: 0.9rem; }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container { max-width: 95%; }
    .hero-content { gap: 32px; }
    .cta-section { flex: 0 0 270px; }
    .carousel-slide img { height: 230px; }
}

/* Тач-кликабельность */
@media (hover: none) and (pointer: coarse) {
    .tab-button, .submit-button, .cancel-button,
    .apply-button, .reglament-button, .participants-button, .routes-button, .results-button,
    .back-button, .admin-link, .carousel-btn {
        min-height: 44px;
    }
    .form-group input, .form-group select { font-size: 16px; }
}

/* Появление секций */
@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-section, .info-section, .gallery-section, .sponsors-section, .main-footer {
    animation: rise 0.6s var(--ease) both;
}
.info-section    { animation-delay: 0.05s; }
.gallery-section { animation-delay: 0.1s; }
.sponsors-section{ animation-delay: 0.15s; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Smaller static background for mobile networks. */
@media (max-width: 768px) {
    body::before {
        background-image:
            linear-gradient(180deg, rgba(26,23,20,0.78) 0%, rgba(26,23,20,0.64) 100%),
            url('/images/background-v2-mobile.jpg');
        background-image:
            linear-gradient(180deg, rgba(26,23,20,0.78) 0%, rgba(26,23,20,0.64) 100%),
            image-set(
                url('/images/background-v2-mobile.webp') type('image/webp'),
                url('/images/background-v2-mobile.jpg') type('image/jpeg')
            );
        background-attachment: scroll;
    }
}
