:root {
    --bg: #060912;
    --bg-secondary: #0d1224;
    --surface: rgba(21, 28, 49, 0.85);
    --surface-strong: rgba(27, 35, 61, 0.95);
    --card: #10182f;
    --muted: #8ea0c2;
    --muted-2: #6f7b9b;
    --text: #e6eefc;
    --accent: #5df7c2;
    --accent-2: #6fb3ff;
    --shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
    --radius: 16px;
    --radius-sm: 10px;
    --blur: blur(14px);
}

/* Не переопределяем box-sizing глобально, чтобы не ломать старую сетку */

body.page-shell {
    margin: 0;
    padding: 0;
    font-family: "Space Grotesk", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 20% 20%, rgba(96, 179, 255, 0.12), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(93, 247, 194, 0.18), transparent 35%),
        linear-gradient(135deg, #060912 0%, #05070f 100%);
    min-height: 100vh;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

.page-shell {
    display: block;
}

/* Центруем шапку и контент, ограничиваем ширину */
.site-header,
.main_bg {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}

html, body, body.page-shell {
    background: linear-gradient(135deg, #060912 0%, #05070f 100%) !important;
    min-height: 100%;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text);
}

/* Базовые параметры: фон и цвет текста, размеры оставляем как в исходной теме */
body {
    min-height: 100vh;
    background: transparent;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: #7ff8cf;
    opacity: 0.92;
}

.site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 32px;
    background: linear-gradient(120deg, rgba(15, 19, 33, 0.75), rgba(10, 13, 25, 0.7));
    backdrop-filter: var(--blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: url('/css/items/logo.png') center center / cover no-repeat, linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow);
    position: relative;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* RF facts */
.rf-facts {
    position: relative;
    margin-top: 16px;
    padding: 20px 20px 16px 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(32, 44, 76, 0.4), rgba(12, 20, 38, 0.8));
    border: 1px solid rgba(93, 247, 194, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.rf-facts::before,
.rf-facts::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.18;
    pointer-events: none;
}

.rf-facts::before {
    top: -60px;
    left: -40px;
    background: radial-gradient(circle, rgba(93, 247, 194, 0.35), transparent 60%);
}

.rf-facts::after {
    bottom: -80px;
    right: -40px;
    background: radial-gradient(circle, rgba(111, 179, 255, 0.35), transparent 60%);
}

.rf-facts__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
}

.rf-facts__pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.rf-facts__next {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(120deg, rgba(93, 247, 194, 0.22), rgba(111, 179, 255, 0.18));
    border: 1px solid rgba(93, 247, 194, 0.45);
    color: var(--text);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 10px 30px rgba(93, 247, 194, 0.12);
}

.rf-facts__next:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 38px rgba(93, 247, 194, 0.18);
    opacity: 0.95;
}

.rf-facts__next:active {
    transform: translateY(0);
}

.rf-facts__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.rf-fact-card {
    position: relative;
    padding: 14px 16px 14px 16px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, rgba(12, 18, 34, 0.8), rgba(20, 32, 58, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.rf-fact-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(93, 247, 194, 0.08), rgba(111, 179, 255, 0.06));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rf-fact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
    border-color: rgba(93, 247, 194, 0.35);
}

.rf-fact-card:hover::after {
    opacity: 1;
}

.rf-fact-card__badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(93, 247, 194, 0.3), rgba(111, 179, 255, 0.25));
    color: var(--text);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.rf-fact-card__text {
    position: relative;
    z-index: 2;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Mobile/responsive tweaks */
@media (max-width: 992px) {
    .site-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .site-nav {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }
    .site-meta {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
        font-size: 11px;
    }
    #audio-toggle {
        bottom: 12px;
        right: 12px;
        padding: 6px 10px;
        font-size: 12px;
    }
    .rf-facts__grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .rf-fact-card {
        padding: 12px 12px 12px 12px;
    }
}

@media (max-width: 640px) {
    .site-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    .site-meta {
        display: none !important;
        visibility: hidden;
        height: 0;
    }
    .main_body_modules {
        border-radius: 12px;
    }
    .main_body_modules_title {
        flex-wrap: wrap;
        gap: 6px;
    }
    .rf-facts__grid {
        grid-template-columns: 1fr;
    }
    .rf-fact-card {
        font-size: 13px;
    }

    /* Выпадайки поверх контента на мобильных */
    .nav-dropdown {
        position: static;
    }
    .nav-dropdown-menu {
        position: fixed;
        top: 70px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: 60vh;
        overflow-y: auto;
        box-shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
    }
}

@media (max-width: 480px) {
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
    }
    body {
        padding-top: 120px;
    }
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav a,
.site-nav .pill {
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-size: 13px;
}

.site-nav a:hover,
.site-nav .pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    display: none;
    flex-direction: column;
    background: var(--surface-strong);
    padding: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: auto;
    z-index: 2000;
}

.nav-dropdown-menu a {
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    border: none;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.07);
}

.site-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.meta-pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.meta-pill.muted {
    color: var(--muted-2);
}

.meta-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Стили контейнеров оставляем из исходного main.css, чтобы не ломать сетку */

.main_body_modules_title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    margin-bottom: 12px;
}

.main_body_modules_title .bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(93, 247, 194, 0.5);
}

/* Скругляем основной контейнер главной колонки */
.main_body_modules {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(170deg, rgba(24, 34, 52, 0.9), rgba(18, 26, 44, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.main_body_modules_content {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.module_action_title {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 10px;
}

.module_action_ {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.module_list_border,
.quest_content,
.module_sheet_body {
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.list_separator {
    height: 1px;
    margin: 12px 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.footer_menu,
.footer_info,
.copyright {
    color: var(--muted);
}

.footer_menu a {
    color: var(--text);
    font-weight: 600;
}

.navbar,
.navbar-inverse {
    display: none; /* legacy bootstrap nav off */
}

.module_sheet_captain,
.panel-default > .panel-heading {
    background: var(--surface-strong) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: var(--radius-sm);
}

.panel {
    background: transparent;
    border: none;
    box-shadow: none;
}

.panel-body {
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.news_list_header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 2fr 1fr 0.6fr;
    gap: 8px;
    align-items: center;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.news_list_show {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px dashed rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.news_list_date_name {
    color: var(--accent);
}

.header_logo {
    height: 120px;
    margin: 8px 0 20px;
    background: radial-gradient(circle at 30% 30%, rgba(93, 247, 194, 0.12), transparent 40%),
        radial-gradient(circle at 70% 40%, rgba(111, 179, 255, 0.2), transparent 50%);
    border-radius: var(--radius);
}

@media (max-width: 1024px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav {
        width: 100%;
    }
    .news_list_header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-header {
        padding: 14px 18px;
    }
    .brand-name {
        font-size: 18px;
    }
    .site-nav {
        gap: 6px;
    }
    .site-nav a,
    .site-nav .pill {
        padding: 8px 10px;
    }
}
:root {
