/* ==========================================================================
   WOS CALC — ARCTIC COMMAND CENTER (FULL THEME v7)
   Подключать ПОСЛЕДНИМ в <head>: <link rel="stylesheet" href="./css/arctic-theme.css?v=7">
   ========================================================================== */

:root {
    --arc-bg: #eef2f6;
    --arc-surface: #ffffff;
    --arc-surface-2: #f8fafc;
    --arc-surface-hover: #f1f5f9;
    --arc-nav-bg: rgba(255, 255, 255, 0.88);
    --arc-border: rgba(15, 23, 42, 0.11);
    --arc-border-strong: rgba(2, 132, 199, 0.35);
    --arc-text: #0f172a;
    --arc-text-muted: #475569;
    --arc-accent: #0284c7;
    --arc-accent-hover: #0369a1;
    --arc-accent-soft: rgba(2, 132, 199, 0.12);
    --arc-green: #16a34a;
    --arc-red: #dc2626;
    --arc-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --arc-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --arc-radius: 12px;
    --arc-radius-lg: 16px;
    --arc-max-width: 1600px;
    --arc-max-width: min(1600px, 95vw);
}

html body.dark-mode {
    --arc-bg: #080d17;
    --arc-surface: #0f1726;
    --arc-surface-2: #152033;
    --arc-surface-hover: #1b2840;
    --arc-nav-bg: rgba(10, 16, 28, 0.88);
    --arc-border: rgba(148, 163, 184, 0.15);
    --arc-border-strong: rgba(56, 189, 248, 0.4);
    --arc-text: #f1f5f9;
    --arc-text-muted: #94a3b8;
    --arc-accent: #38bdf8;
    --arc-accent-hover: #7dd3fc;
    --arc-accent-soft: rgba(56, 189, 248, 0.14);
    --arc-green: #22c55e;
    --arc-red: #f87171;
    --arc-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --arc-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.28);
}

/* --------------------------------------------------------------------------
   1. БАЗА
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) {
    background-color: var(--arc-bg) !important;
    color: var(--arc-text) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html body:is(*, .dark-mode) .main-menu-chain {
    display: none !important;
}

/* --------------------------------------------------------------------------
   2. ЛИПКАЯ ВЕРХНЯЯ ПАНЕЛЬ (NAVBAR)
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) .arc-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    background: var(--arc-nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--arc-border);
}

html body:is(*, .dark-mode) .arc-navbar-inner {
    max-width: var(--arc-max-width);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Бренд */
html body:is(*, .dark-mode) .arc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

html body:is(*, .dark-mode) .arc-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

html body:is(*, .dark-mode) .arc-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

html body:is(*, .dark-mode) .arc-brand-title {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.4px;
    color: var(--arc-text);
}

html body:is(*, .dark-mode) .arc-brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--arc-accent);
}

/* Главные кнопки навигации внутри navbar */
/* Увеличенные главные кнопки в верхней панели */
html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons {
    width: auto !important;
    margin: 0 !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    background-image: none !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: var(--arc-text-muted) !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0.1px !important;
    padding: 9px 18px !important;
    min-height: 42px !important;
    min-width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) .arc-navbar .arc-nav-ico {
    font-size: 17px;
    line-height: 1;
}

/* Подменю событий прямо внутри верхней липкой панели (НЕ трогаем display, им управляет JS) */
html body:is(*, .dark-mode) .arc-navbar .event-submenu {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

html body:is(*, .dark-mode) .arc-navbar .event-submenu .event-btn {
    background-image: none !important;
    background-color: var(--arc-surface-2) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 9px !important;
    color: var(--arc-text) !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 8px 13px !important;
    min-height: 38px !important;
    min-width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    filter: none !important;
    animation: none !important;
    box-shadow: none !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) .arc-navbar .event-submenu .event-btn::before {
    display: none !important;
}

html body:is(*, .dark-mode) .arc-navbar .event-submenu .event-btn:hover {
    background-color: var(--arc-surface-hover) !important;
    border-color: var(--arc-accent) !important;
    color: var(--arc-accent) !important;
    transform: none !important;
}

html body:is(*, .dark-mode) .arc-navbar .event-submenu .event-btn.active,
html body:is(*, .dark-mode) .arc-navbar .event-submenu .event-btn.menu-active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
}

html body:is(*, .dark-mode) .arc-navbar .event-submenu .arc-back-pill {
    background-color: transparent !important;
    border-color: var(--arc-border-strong) !important;
    color: var(--arc-text-muted) !important;
}

html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn::before {
    display: none !important;
}

html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn:hover {
    background: var(--arc-surface-hover) !important;
    color: var(--arc-text) !important;
    border-color: var(--arc-border) !important;
    transform: none !important;
}

html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn.active,
html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn.menu-active {
    background: var(--arc-accent-soft) !important;
    color: var(--arc-accent) !important;
    border-color: var(--arc-border-strong) !important;
    box-shadow: none !important;
}

/* Переключатели языка и темы внутри navbar (отменяем старый position: absolute) */
html body:is(*, .dark-mode) .arc-navbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

html body:is(*, .dark-mode) .arc-navbar .lang-switch,
html body:is(*, .dark-mode) .arc-navbar .theme-switch {
    position: static !important;
    top: auto !important;
    right: auto !important;
    height: 34px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--arc-surface-2) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 999px !important;
    color: var(--arc-text) !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    box-shadow: none !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) .arc-navbar .lang-switch:hover,
html body:is(*, .dark-mode) .arc-navbar .theme-switch:hover {
    border-color: var(--arc-accent) !important;
    background: var(--arc-surface-hover) !important;
    transform: none !important;
}

/* --------------------------------------------------------------------------
   3. АРКТИЧЕСКИЙ БАННЕР, ЕДИНЫЙ СТЕКЛЯННЫЙ ДОК И ОДНОСТРОЧНЫЕ СОБЫТИЯ
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) .main-menu-top.arc-hero {
    background-image:
        linear-gradient(180deg, rgba(8, 13, 23, 0.72) 0%, rgba(8, 13, 23, 0.92) 100%),
        url('/Images/background/Backgound_desctop.png') !important;
    background-size: cover !important;
    background-position: center 35% !important;
    min-height: auto !important;
    padding: 18px 16px !important;
    border-bottom: 1px solid var(--arc-border);
    box-shadow: none !important;
}

html body:not(.dark-mode) .main-menu-top.arc-hero {
    background-image:
        linear-gradient(180deg, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0.74) 100%),
        url('/Images/background/Backgound_desctop.png') !important;
}

html body:is(*, .dark-mode) .arc-hero-inner {
    max-width: var(--arc-max-width);
    width: 100%;
    margin: 0 auto;
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 14px;
}

html body:is(*, .dark-mode) .arc-hero-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

html body:is(*, .dark-mode) .arc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.9px;
    color: #7dd3fc;
    text-transform: uppercase;
}

html body:is(*, .dark-mode) .arc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

html body:is(*, .dark-mode) .arc-hero-subtitle {
    margin-top: 3px;
    font-size: 13.5px;
    color: rgba(241, 245, 249, 0.82);
}

/* Единый стеклянный док (Toolbar Dock) */
html body:is(*, .dark-mode) .main-menu-top .main-menu-checkboxes.arc-dock {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    border-radius: 14px !important;
    padding: 8px 14px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28) !important;
}

html body:is(*, .dark-mode) .arc-dock-sep {
    width: 1px;
    height: 20px;
    background: rgba(148, 163, 184, 0.25);
}

/* Настоящие чекбоксы, стилизованные под арктические тумблеры */
html body:is(*, .dark-mode) .arc-switch-item {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    width: auto !important;
    cursor: pointer;
}

html body:is(*, .dark-mode) .arc-switch-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative;
    width: 36px !important;
    height: 20px !important;
    min-width: 36px;
    border-radius: 999px !important;
    background: rgba(148, 163, 184, 0.35) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    cursor: pointer;
    margin: 0 !important;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

html body:is(*, .dark-mode) .arc-switch-input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

html body:is(*, .dark-mode) #saveDataCheckbox.arc-switch-input:checked {
    background: #10b981 !important;
    border-color: #34d399 !important;
}

html body:is(*, .dark-mode) #horizontalScrollCheckbox.arc-switch-input:checked {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
}

html body:is(*, .dark-mode) .arc-switch-input:checked::after {
    transform: translateX(16px);
}

html body:is(*, .dark-mode) .arc-dock .checkbox-label {
    color: #f1f5f9 !important;
    text-shadow: none !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    cursor: pointer;
}

/* Кнопки внутри дока */
html body:is(*, .dark-mode) .arc-dock-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) .arc-dock-btn-info {
    background: rgba(56, 189, 248, 0.14) !important;
    border: 1px solid rgba(56, 189, 248, 0.38) !important;
    color: #e0f2fe !important;
}

html body:is(*, .dark-mode) .arc-dock-btn-info:hover {
    background: rgba(56, 189, 248, 0.26) !important;
    color: #ffffff !important;
}

html body:is(*, .dark-mode) .arc-dock-btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(248, 113, 113, 0.4) !important;
    color: #fecaca !important;
}

html body:is(*, .dark-mode) .arc-dock-btn-danger:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    color: #ffffff !important;
}

/* ПОДМЕНЮ СОБЫТИЙ — строго в ОДНУ строку на десктопе */
html body:is(*, .dark-mode) .main-menu-top .event-submenu {
    width: 100% !important;
    margin: 0 !important;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
}

html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn {
    background-image: none !important;
    background-color: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
    border-radius: 10px !important;
    color: #f1f5f9 !important;
    font-family: inherit !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 8px 13px !important;
    min-height: 38px !important;
    min-width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    filter: none !important;
    animation: none !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn::before {
    display: none !important;
}

html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn:hover {
    background-color: rgba(30, 41, 59, 0.95) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn.active,
html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn.menu-active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: #7dd3fc !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28), 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

html body:is(*, .dark-mode) .main-menu-top .event-submenu .arc-back-pill {
    background-color: rgba(148, 163, 184, 0.16) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: #cbd5e1 !important;
}

@media screen and (max-width: 1120px) {
    html body:is(*, .dark-mode) .main-menu-top .event-submenu {
        flex-wrap: wrap !important;
    }
}

/* --------------------------------------------------------------------------
   4. "ПОЛЕЗНОЕ" (#usefulMenu) — КАРТОЧКИ С КАТЕГОРИЯМИ И ПОИСКОМ
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) #usefulMenu[style*="flex"],
html body:is(*, .dark-mode) #usefulMenu[style*="block"] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: var(--arc-max-width) !important;
    margin: 22px auto 32px auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

html body:is(*, .dark-mode) .arc-useful-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

html body:is(*, .dark-mode) .arc-search-box {
    position: relative;
    flex: 1 1 320px;
    max-width: 460px;
}

html body:is(*, .dark-mode) .arc-search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.65;
    pointer-events: none;
}

html body:is(*, .dark-mode) .arc-search-input {
    width: 100% !important;
    height: 42px;
    padding: 0 14px 0 40px !important;
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 12px !important;
    font-size: 13.5px !important;
    box-shadow: var(--arc-shadow-sm);
    box-sizing: border-box;
}

html body:is(*, .dark-mode) .arc-search-input:focus {
    border-color: var(--arc-accent) !important;
    box-shadow: 0 0 0 3px var(--arc-accent-soft) !important;
    outline: none !important;
}

html body:is(*, .dark-mode) .arc-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

html body:is(*, .dark-mode) .arc-filter-pill {
    background: var(--arc-surface) !important;
    color: var(--arc-text-muted) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 999px !important;
    padding: 7px 14px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.18s ease;
}

html body:is(*, .dark-mode) .arc-filter-pill:hover {
    color: var(--arc-text) !important;
    border-color: var(--arc-accent) !important;
}

html body:is(*, .dark-mode) .arc-filter-pill.active {
    background: var(--arc-accent-soft) !important;
    color: var(--arc-accent) !important;
    border-color: var(--arc-border-strong) !important;
}

html body:is(*, .dark-mode) .arc-cat-section {
    margin-bottom: 26px;
}

html body:is(*, .dark-mode) .arc-cat-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--arc-text-muted);
    margin-bottom: 12px;
    padding-left: 2px;
}

html body:is(*, .dark-mode) .arc-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 14px;
}

html body:is(*, .dark-mode) .arc-tool-card {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    text-align: left !important;
    width: 100% !important;
    padding: 18px !important;
    margin: 0 !important;
    background: var(--arc-surface) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: var(--arc-radius-lg) !important;
    box-shadow: var(--arc-shadow-sm) !important;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

html body:is(*, .dark-mode) .arc-tool-card:hover {
    background: var(--arc-surface-hover) !important;
    border-color: var(--arc-accent) !important;
    transform: translateY(-3px);
    box-shadow: var(--arc-shadow) !important;
}

html body:is(*, .dark-mode) .arc-card-featured {
    border-color: var(--arc-border-strong) !important;
    background: linear-gradient(145deg, var(--arc-surface) 0%, var(--arc-accent-soft) 100%) !important;
}

html body:is(*, .dark-mode) .arc-tool-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

html body:is(*, .dark-mode) .arc-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--arc-surface-2);
    border: 1px solid var(--arc-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

html body:is(*, .dark-mode) .arc-tool-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: #0284c7;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
}

html body:is(*, .dark-mode) .arc-tool-arrow {
    color: var(--arc-text-muted);
    font-size: 15px;
    transition: transform 0.18s ease, color 0.18s ease;
}

html body:is(*, .dark-mode) .arc-tool-card:hover .arc-tool-arrow {
    color: var(--arc-accent);
    transform: translateX(3px);
}

html body:is(*, .dark-mode) .arc-tool-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--arc-text);
    margin-bottom: 5px;
    line-height: 1.3;
}

html body:is(*, .dark-mode) .arc-tool-desc {
    font-size: 12.5px;
    color: var(--arc-text-muted);
    line-height: 1.45;
}

/* --------------------------------------------------------------------------
   5. ЭТАПЫ СОБЫТИЙ (перебиваем ID-правила для #frostKingMenu и остальных)
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) #frostKingMenu[style*="block"],
html body:is(*, .dark-mode) #frostKingMenu[style*="flex"],
html body:is(*, .dark-mode) #svsMenu[style*="block"],
html body:is(*, .dark-mode) #svsMenu[style*="flex"],
html body:is(*, .dark-mode) #armsMenu[style*="block"],
html body:is(*, .dark-mode) #armsMenu[style*="flex"],
html body:is(*, .dark-mode) #armsRaceMenu[style*="block"],
html body:is(*, .dark-mode) #armsRaceMenu[style*="flex"],
html body:is(*, .dark-mode) #officersMenu[style*="block"],
html body:is(*, .dark-mode) #officersMenu[style*="flex"],
html body:is(*, .dark-mode) #allianceMenu[style*="block"],
html body:is(*, .dark-mode) #allianceMenu[style*="flex"],
html body:is(*, .dark-mode) #allianceBattleMenu[style*="block"],
html body:is(*, .dark-mode) #allianceBattleMenu[style*="flex"],
html body:is(*, .dark-mode) #AdminEventMenu[style*="block"],
html body:is(*, .dark-mode) #AdminEventMenu[style*="flex"],
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu)[style*="block"],
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu)[style*="flex"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: var(--arc-max-width) !important;
    margin: 18px auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

/* Карточка выбора навыка Валерии / Бальдра над этапами */
html body:is(*, .dark-mode) .stage-menu > div:has(select) {
    flex: 0 0 100% !important;
    max-width: 560px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 0 auto 8px auto !important;
    padding: 10px 18px !important;
    background-color: var(--arc-surface) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: var(--arc-radius) !important;
    box-shadow: var(--arc-shadow-sm) !important;
}

html body:is(*, .dark-mode) .stage-menu > div:has(select) label {
    margin: 0 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--arc-text) !important;
}

html body:is(*, .dark-mode) .stage-menu > div:has(select) select {
    width: auto !important;
    min-width: 190px !important;
    max-width: 260px !important;
    margin: 0 !important;
}

/* Кнопки этапов и подменю гайдов */
html body:is(*, .dark-mode) #frostKingMenu .btn,
html body:is(*, .dark-mode) #frostKingMenu .menu-button,
html body:is(*, .dark-mode) #svsMenu .btn,
html body:is(*, .dark-mode) #armsMenu .btn,
html body:is(*, .dark-mode) #armsRaceMenu .btn,
html body:is(*, .dark-mode) #officersMenu .btn,
html body:is(*, .dark-mode) #allianceMenu .btn,
html body:is(*, .dark-mode) #allianceBattleMenu .btn,
html body:is(*, .dark-mode) #AdminEventMenu .btn,
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu) .btn,
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu) .menu-button,
html body:is(*, .dark-mode) .stage-btn,
html body:is(*, .dark-mode) .guides-main-buttons .btn,
html body:is(*, .dark-mode) .guide-submenu .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-width: 125px;
    margin: 0 !important;
    padding: 10px 18px !important;
    background-image: none !important;
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    box-shadow: var(--arc-shadow-sm) !important;
    transition: all 0.18s ease !important;
}

html body:is(*, .dark-mode) #frostKingMenu .btn:hover,
html body:is(*, .dark-mode) #frostKingMenu .menu-button:hover,
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu) .btn:hover,
html body:is(*, .dark-mode) .stage-btn:hover,
html body:is(*, .dark-mode) .guides-main-buttons .btn:hover,
html body:is(*, .dark-mode) .guide-submenu .btn:hover {
    background-color: var(--arc-surface-hover) !important;
    border-color: var(--arc-accent) !important;
    color: var(--arc-accent) !important;
    transform: translateY(-1px);
}

html body:is(*, .dark-mode) #frostKingMenu .btn.active,
html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu) .btn.active,
html body:is(*, .dark-mode) .stage-btn.active,
html body:is(*, .dark-mode) .guides-main-buttons .btn.active,
html body:is(*, .dark-mode) .guide-submenu .btn.active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}

/* --------------------------------------------------------------------------
   6. ЦЕНТРИРОВАНИЕ КОНТЕНТА, ТАБЛИЦЫ, ВКЛАДКИ, ФОРМЫ И МОДАЛКИ
   -------------------------------------------------------------------------- */
html body:is(*, .dark-mode) .table-container,
html body:is(*, .dark-mode) .fire-crystal-calculator,
html body:is(*, .dark-mode) .hero-upgrade-calculator,
html body:is(*, .dark-mode) .pet-upgrade-calculator,
html body:is(*, .dark-mode) .hero-gear-calculator,
html body:is(*, .dark-mode) .solar-troops-calculator,
html body:is(*, .dark-mode) #governorGearCalculator,
html body:is(*, .dark-mode) #talismanCalculator,
html body:is(*, .dark-mode) #expertCalculator,
html body:is(*, .dark-mode) #squadFormation,
html body:is(*, .dark-mode) #globalResourcesHub,
html body:is(*, .dark-mode) #bearHeroesContainer,
html body:is(*, .dark-mode) .information-block,
html body:is(*, .dark-mode) .guides-main-buttons,
html body:is(*, .dark-mode) .guide-submenu,
html body:is(*, .dark-mode) #guidesContent,
html body:is(*, .dark-mode) .guide-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: var(--arc-max-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
}

html body:is(*, .dark-mode) .table-responsive {
    min-width: 0 !important;
}

html body:is(*, .dark-mode) #guidesContent,
html body:is(*, .dark-mode) .guide-content {
    max-width: 960px !important;
    margin-top: 20px !important;
    margin-bottom: 24px !important;
    padding: 28px 32px !important;
    background-color: var(--arc-surface) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: var(--arc-radius-lg) !important;
    box-shadow: var(--arc-shadow-sm) !important;
    line-height: 1.7;
}

/* Таблицы (не трогает .bear-heroes-table и .pdf-table) */
html body:is(*, .dark-mode) #dataTable,
html body:is(*, .dark-mode) .heroes-table,
html body:is(*, .dark-mode) .pet-results-table,
html body:is(*, .dark-mode) .results-table,
html body:is(*, .dark-mode) .building-table,
html body:is(*, .dark-mode) .hero-upgrade-table,
html body:is(*, .dark-mode) .recommendation-table,
html body:is(*, .dark-mode) .skills-table {
    background-color: var(--arc-surface) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: var(--arc-radius) !important;
    overflow: hidden;
    border: 1px solid var(--arc-border) !important;
    box-shadow: var(--arc-shadow-sm) !important;
}

html body:is(*, .dark-mode) #dataTable th,
html body:is(*, .dark-mode) .heroes-table th,
html body:is(*, .dark-mode) .pet-results-table th,
html body:is(*, .dark-mode) .results-table th,
html body:is(*, .dark-mode) .building-table th,
html body:is(*, .dark-mode) .hero-upgrade-table th,
html body:is(*, .dark-mode) .recommendation-table th,
html body:is(*, .dark-mode) .skills-table th,
html body:is(*, .dark-mode) #recommendationResources th {
    background-color: var(--arc-surface-2) !important;
    color: var(--arc-text-muted) !important;
    border: none !important;
    border-bottom: 1px solid var(--arc-border) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 10px !important;
}

html body:is(*, .dark-mode) #dataTable td,
html body:is(*, .dark-mode) .heroes-table td,
html body:is(*, .dark-mode) .pet-results-table td,
html body:is(*, .dark-mode) .results-table td,
html body:is(*, .dark-mode) .building-table td,
html body:is(*, .dark-mode) .hero-upgrade-table td,
html body:is(*, .dark-mode) .recommendation-table td,
html body:is(*, .dark-mode) .skills-table td,
html body:is(*, .dark-mode) #recommendationResources td {
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
    border: none !important;
    border-bottom: 1px solid var(--arc-border) !important;
    padding: 11px 10px !important;
}

html body:is(*, .dark-mode) #dataTable tbody tr:hover td,
html body:is(*, .dark-mode) .pet-results-table tbody tr:hover td,
html body:is(*, .dark-mode) .results-table tbody tr:hover td,
html body:is(*, .dark-mode) .recommendation-table tbody tr:hover td {
    background-color: var(--arc-surface-hover) !important;
}

html body:is(*, .dark-mode) #dataTable tbody tr:last-child td,
html body:is(*, .dark-mode) .pet-results-table tbody tr:last-child td,
html body:is(*, .dark-mode) .results-table tbody tr:last-child td {
    border-bottom: none !important;
}

html body:is(*, .dark-mode) .event-total-row td {
    background-color: var(--arc-surface-2) !important;
    font-weight: 700 !important;
}

html body:is(*, .dark-mode) #eventTotal {
    color: var(--arc-green) !important;
    font-size: 1.1em;
}

/* Вкладки (tabs) */
html body:is(*, .dark-mode) .tab-btn,
html body:is(*, .dark-mode) .talisman-tab,
html body:is(*, .dark-mode) .gear-tab,
html body:is(*, .dark-mode) .expert-tab,
html body:is(*, .dark-mode) .hero-gear-tab,
html body:is(*, .dark-mode) .pet-tab,
html body:is(*, .dark-mode) .skill-tab,
html body:is(*, .dark-mode) .expert-subtab {
    background-color: var(--arc-surface) !important;
    color: var(--arc-text-muted) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: var(--arc-shadow-sm) !important;
}

html body:is(*, .dark-mode) .tab-btn:hover:not(.active),
html body:is(*, .dark-mode) .talisman-tab:hover:not(.active),
html body:is(*, .dark-mode) .gear-tab:hover:not(.active),
html body:is(*, .dark-mode) .expert-tab:hover:not(.active),
html body:is(*, .dark-mode) .hero-gear-tab:hover:not(.active),
html body:is(*, .dark-mode) .pet-tab:hover:not(.active) {
    background-color: var(--arc-surface-hover) !important;
    color: var(--arc-text) !important;
    border-color: var(--arc-accent) !important;
}

html body:is(*, .dark-mode) .tab-btn.active,
html body:is(*, .dark-mode) .talisman-tab.active,
html body:is(*, .dark-mode) .gear-tab.active,
html body:is(*, .dark-mode) .expert-tab.active,
html body:is(*, .dark-mode) .hero-gear-tab.active,
html body:is(*, .dark-mode) .pet-tab.active,
html body:is(*, .dark-mode) .skill-tab.active,
html body:is(*, .dark-mode) .expert-subtab.active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    border-bottom: none !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.32) !important;
}

/* Поля ввода и селекты */
html body:is(*, .dark-mode) .form-control,
html body:is(*, .dark-mode) .form-select,
html body:is(*, .dark-mode) .task-input,
html body:is(*, .dark-mode) input[type="number"],
html body:is(*, .dark-mode) input[type="text"]:not(.arc-search-input),
html body:is(*, .dark-mode) select,
html body:is(*, .dark-mode) .custom-select-display,
html body:is(*, .dark-mode) .current-gear-display,
html body:is(*, .dark-mode) .squad-number-input,
html body:is(*, .dark-mode) #squadCount {
    background-color: var(--arc-surface-2) !important;
    color: var(--arc-text) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 8px !important;
}

html body:is(*, .dark-mode) select option {
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
}

html body:is(*, .dark-mode) .custom-options {
    background-color: var(--arc-surface) !important;
    border: 1px solid var(--arc-border-strong) !important;
    border-radius: 10px !important;
    box-shadow: var(--arc-shadow) !important;
    margin-top: 4px;
}

/* Карточки, алерты, аккордеоны и модалки */
html body:is(*, .dark-mode) .information-block,
html body:is(*, .dark-mode) .gear-total-results,
html body:is(*, .dark-mode) .hero-gear-total-results,
html body:is(*, .dark-mode) .expert-total-results,
html body:is(*, .dark-mode) .recommendation-resources,
html body:is(*, .dark-mode) .solar-troops-calculator,
html body:is(*, .dark-mode) #squadFormation .checkbox-line,
html body:is(*, .dark-mode) #percentageControls .slider-with-buttons {
    background-color: var(--arc-surface) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: var(--arc-radius-lg) !important;
    box-shadow: var(--arc-shadow-sm) !important;
    padding: 20px !important;
}

html body:is(*, .dark-mode) .alert,
html body:is(*, .dark-mode) div[class*="alert-"],
html body:is(*, .dark-mode) .gear-tab-info,
html body:is(*, .dark-mode) .skill-requirements,
html body:is(*, .dark-mode) #chestRecommendation {
    background-color: var(--arc-accent-soft) !important;
    border: 1px solid var(--arc-border-strong) !important;
    border-left: 4px solid var(--arc-accent) !important;
    border-radius: var(--arc-radius) !important;
    color: var(--arc-text) !important;
}

html body:is(*, .dark-mode) .alert *,
html body:is(*, .dark-mode) .gear-tab-info *,
html body:is(*, .dark-mode) .skill-requirements * {
    color: var(--arc-text) !important;
    font-weight: 500 !important;
}

html body:is(*, .dark-mode) .alert strong,
html body:is(*, .dark-mode) .gear-tab-info strong {
    color: var(--arc-accent) !important;
    font-weight: 700 !important;
}

html body:is(*, .dark-mode) #globalResourcesHub .accordion-item {
    background-color: var(--arc-surface) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: var(--arc-radius) !important;
    margin-bottom: 10px;
    overflow: hidden;
}

html body:is(*, .dark-mode) #globalResourcesHub .accordion-body {
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
}

html body:is(*, .dark-mode) #globalResourcesHub .accordion-button {
    background-color: var(--arc-surface-2) !important;
    color: var(--arc-text) !important;
    font-weight: 600;
}

html body:is(*, .dark-mode) #globalResourcesHub .accordion-button:not(.collapsed) {
    background-color: var(--arc-accent-soft) !important;
    color: var(--arc-accent) !important;
}

html body:is(*, .dark-mode) .plan-modal .plan-content,
html body:is(*, .dark-mode) #textPlanModal .plan-content,
html body:is(*, .dark-mode) .modal-content {
    background-color: var(--arc-surface) !important;
    color: var(--arc-text) !important;
    border: 1px solid var(--arc-border-strong) !important;
    border-radius: var(--arc-radius-lg) !important;
    box-shadow: var(--arc-shadow) !important;
}

html body:is(*, .dark-mode) .plan-text-content,
html body:is(*, .dark-mode) #planTextContent {
    background-color: var(--arc-surface-2) !important;
    color: var(--arc-text) !important;
    border: 1px solid var(--arc-border) !important;
    border-radius: 10px !important;
}

/* --------------------------------------------------------------------------
   7. МОБИЛЬНАЯ АДАПТАЦИЯ
   -------------------------------------------------------------------------- */
@media screen and (max-width: 900px) {
    html body:is(*, .dark-mode) .arc-navbar-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }

    html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons {
        order: 3;
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    html body:is(*, .dark-mode) .arc-navbar .main-menu-buttons .event-btn {
        flex: 1 1 44%;
        justify-content: center;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
}

@media screen and (max-width: 768px) {
    html body:is(*, .dark-mode) .arc-hero-bar {
        flex-direction: column;
        align-items: stretch;
    }

    html body:is(*, .dark-mode) .main-menu-top .main-menu-checkboxes.arc-dock {
        width: 100%;
        justify-content: center;
        gap: 8px;
        padding: 10px !important;
    }

    html body:is(*, .dark-mode) .arc-dock-sep {
        display: none;
    }

    html body:is(*, .dark-mode) .main-menu-top .event-submenu .event-btn {
        flex: 1 1 44%;
        font-size: 12px !important;
        padding: 8px 10px !important;
        white-space: normal !important;
    }

    html body:is(*, .dark-mode) .arc-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    html body:is(*, .dark-mode) .arc-tool-card {
        padding: 14px !important;
    }

    html body:is(*, .dark-mode) .arc-tool-desc {
        font-size: 11.5px;
    }

    html body:is(*, .dark-mode) #frostKingMenu .btn,
    html body:is(*, .dark-mode) #frostKingMenu .menu-button,
    html body:is(*, .dark-mode) .stage-menu:not(#usefulMenu) .btn,
    html body:is(*, .dark-mode) .stage-btn {
        flex: 1 1 44% !important;
        min-width: 0 !important;
        font-size: 12.5px !important;
        padding: 9px 10px !important;
    }

    html body:is(*, .dark-mode) #guidesContent,
    html body:is(*, .dark-mode) .guide-content {
        padding: 18px 14px !important;
        border-radius: 12px !important;
    }
}

@media screen and (max-width: 460px) {
    html body:is(*, .dark-mode) .arc-tools-grid {
        grid-template-columns: 1fr;
    }
}
/* ==========================================================================
   ТАКТИЧЕСКИЙ СОВЕТНИК — RPG-СЦЕНА (ТАИНСТВЕННЫЙ СТРАТЕГ)
   ========================================================================== */
html body:is(*, .dark-mode) #tacticalAdvisorContainer {
    width: 100% !important;
    min-width: 0 !important;
    max-width: var(--arc-max-width) !important;
    margin: 22px auto 36px auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

.rpg-stage {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 18% 15%, rgba(56, 189, 248, 0.14), transparent 48%),
                linear-gradient(165deg, #070d19 0%, #0d1626 55%, #09111f 100%);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 20px;
    padding: 22px 24px 28px 24px;
    color: #f1f5f9;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    animation: rpgFadeStage 0.45s ease-out;
}

.rpg-mist-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 85% 90%, rgba(14, 165, 233, 0.12), transparent 55%),
        radial-gradient(ellipse at 10% 80%, rgba(99, 102, 241, 0.1), transparent 50%);
    animation: rpgMistPulse 7s ease-in-out infinite alternate;
}

.rpg-topbar,
.rpg-dialogue-row,
.rpg-stage-content {
    position: relative;
    z-index: 2;
}

/* Верхняя панель статуса */
.rpg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.rpg-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpg-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
}

.rpg-topbar-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #7dd3fc;
}

.rpg-topbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.rpg-counter-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.rpg-counter-pill.ready {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.rpg-counter-pill.empty {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.rpg-gen-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
}

.rpg-gen-picker label {
    margin: 0;
    color: #cbd5e1 !important;
}

.rpg-gen-picker select {
    width: auto !important;
    min-width: 140px;
    background-color: rgba(15, 23, 42, 0.85) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

/* Силуэт советника и окно диалога */
.rpg-dialogue-row {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
}

.rpg-portrait-wrap {
    position: relative;
    width: 132px;
    height: 144px;
    flex-shrink: 0;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.16), rgba(2, 6, 23, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.35);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.18);
    animation: rpgSilhouetteEmerge 0.9s ease-out;
}

.rpg-portrait-wrap.is-speaking {
    border-color: rgba(125, 211, 252, 0.75);
    box-shadow: 0 0 32px rgba(56, 189, 248, 0.35);
}

.rpg-portrait-img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rpg-portrait-svg-holder,
.rpg-hood-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.rpg-eye {
    animation: rpgEyeGlow 3.2s ease-in-out infinite;
}

.rpg-dialogue-box {
    flex: 1;
    min-height: 126px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left: 3px solid #38bdf8;
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rpg-speaker-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #38bdf8;
    margin-bottom: 6px;
}

.rpg-dialogue-text-wrap {
    font-size: 15.5px;
    line-height: 1.6;
    color: #f8fafc;
}

.rpg-cursor {
    display: inline-block;
    color: #38bdf8;
    margin-left: 2px;
    animation: rpgBlink 0.9s steps(2, start) infinite;
}

.rpg-skip-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #64748b;
    text-align: right;
    transition: opacity 0.25s ease;
}

/* Плавное всплытие контента из тумана */
.rpg-stage-content.rpg-emerge {
    animation: rpgEmergeFromMist 0.5s ease-out both;
}

/* Кнопки выбора в Сцене 1 */
.rpg-choice-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.rpg-choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f8fafc;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rpg-choice-btn.primary {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.32), rgba(37, 99, 235, 0.28));
    border-color: rgba(56, 189, 248, 0.55);
}

.rpg-choice-btn:hover {
    transform: translateY(-2px);
    border-color: #38bdf8;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.rpg-choice-ico {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.rpg-choice-title {
    font-weight: 700;
    font-size: 14.5px;
    color: #f8fafc;
}

.rpg-choice-sub {
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Карточки 4 режимов (Сцена 2) */
.rpg-modes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.rpg-mode-card {
    text-align: left;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #f1f5f9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rpg-mode-card.active-mode {
    border-color: rgba(56, 189, 248, 0.55);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 132, 199, 0.22) 100%);
}

.rpg-mode-card.active-mode:hover {
    transform: translateY(-3px);
    border-color: #7dd3fc;
    box-shadow: 0 10px 28px rgba(56, 189, 248, 0.25);
}

.rpg-mode-card.locked-mode {
    opacity: 0.72;
}

.rpg-mode-card.locked-mode:hover {
    opacity: 0.92;
    border-color: rgba(148, 163, 184, 0.45);
}

.rpg-mode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rpg-mode-icon {
    font-size: 24px;
}

.rpg-mode-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.rpg-mode-badge.live {
    background: #0284c7;
    color: #ffffff;
}

.rpg-mode-badge.soon {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

.rpg-mode-title {
    font-size: 16px;
    font-weight: 800;
    color: #f8fafc;
}

.rpg-mode-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.45;
}

/* Карточки формы и отчёта внутри RPG-сцены */
.rpg-stage .adv-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.rpg-stage .adv-card,
.rpg-stage .adv-stat-tile,
.rpg-stage .adv-joiner-card,
.rpg-stage .adv-recs-card {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 16px;
    color: #f1f5f9;
}

.rpg-stage .adv-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpg-stage .adv-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #7dd3fc;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.rpg-stage .adv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rpg-stage .adv-field label,
.rpg-stage .adv-checkbox-row label {
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1 !important;
    margin: 0;
}

.rpg-stage .adv-card input[type="text"],
.rpg-stage .adv-card select {
    background-color: rgba(2, 6, 23, 0.7) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

.rpg-stage .adv-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.rpg-stage .adv-cap-summary {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.rpg-stage .adv-cap-pill {
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    font-size: 11.5px;
    color: #94a3b8;
}

.rpg-stage .adv-cap-pill strong {
    font-size: 15px;
    color: #38bdf8;
    margin-top: 2px;
}

.rpg-stage .adv-submit-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.rpg-stage .adv-primary-btn {
    padding: 11px 28px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.rpg-stage .adv-secondary-btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    color: #cbd5e1 !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

/* Отчёт */
.rpg-stage .adv-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.rpg-stage .adv-stat-tile {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rpg-stage .adv-stat-tile span,
.rpg-stage .adv-stat-tile small {
    font-size: 12px;
    color: #94a3b8;
}

.rpg-stage .adv-stat-tile strong {
    font-size: 20px;
    font-weight: 800;
    color: #38bdf8;
}

.rpg-stage .adv-recs-card {
    border-left: 4px solid #38bdf8;
    margin-bottom: 16px;
}

.rpg-stage .adv-recs-title {
    font-weight: 700;
    font-size: 14px;
    color: #7dd3fc;
    margin-bottom: 8px;
}

.rpg-stage .adv-recs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rpg-stage .adv-rec-item {
    display: flex;
    gap: 8px;
    font-size: 13.5px;
    color: #e2e8f0;
}

.rpg-stage .adv-rally-card {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.9) 0%, rgba(2, 132, 199, 0.24) 100%);
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}

.rpg-stage .adv-joiner-card.no-heroes {
    border-style: dashed;
}

.rpg-stage .adv-squad-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rpg-stage .adv-squad-badge {
    font-weight: 700;
    font-size: 13.5px;
    padding: 4px 12px;
    border-radius: 999px;
}

.rpg-stage .adv-squad-badge.rally {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
}

.rpg-stage .adv-squad-badge.joiner {
    background: rgba(148, 163, 184, 0.16);
    color: #f1f5f9;
}

.rpg-stage .adv-squad-cap {
    font-size: 12.5px;
    color: #94a3b8;
    font-weight: 600;
}

.rpg-stage .adv-section-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 16px 0 10px 2px;
}

.rpg-stage .adv-joiners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.rpg-stage .adv-heroes-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.rpg-stage .adv-hero-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
}

.rpg-stage .adv-hero-slot.is-captain {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.rpg-stage .adv-hero-slot.empty {
    opacity: 0.6;
    border-style: dashed;
}

/* Главный Сбор: крупные горизонтальные портреты 96×96 */
.rpg-stage .adv-rally-card .adv-slot-avatar {
    width: 96px;
    height: 96px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f172a;
    border: 2px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.rpg-stage .adv-rally-card .adv-slot-name {
    font-size: 17px;
    margin-bottom: 3px;
}

.rpg-stage .adv-rally-card .adv-slot-meta {
    font-size: 13px;
}

/* Отряды присоединения: портрет 90×90 сверху, бейджи и имя по центру снизу */
.rpg-stage .adv-joiner-card .adv-hero-slot {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 12px 10px;
}

.rpg-stage .adv-joiner-card .adv-slot-avatar {
    width: 90px;
    height: 90px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f172a;
    border: 2px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.rpg-stage .adv-joiner-card .adv-hero-slot.is-captain .adv-slot-avatar {
    border-color: #22c55e;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.3);
}

.rpg-stage .adv-joiner-card .adv-slot-info {
    width: 100%;
}

.rpg-stage .adv-joiner-card .adv-slot-badges {
    justify-content: center;
}

.rpg-stage .adv-slot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rpg-stage .adv-slot-info { min-width: 0; flex: 1; }
.rpg-stage .adv-slot-name { font-weight: 700; font-size: 14.5px; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpg-stage .adv-slot-meta { font-size: 12px; color: #94a3b8; }
.rpg-stage .adv-slot-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rpg-stage .adv-slot-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.rpg-stage .adv-slot-badge.captain { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.rpg-stage .adv-slot-badge.widget  { background: rgba(168, 85, 247, 0.22); color: #d8b4fe; }
.rpg-stage .adv-slot-badge.ok      { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.rpg-stage .adv-slot-badge.warn    { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }

.rpg-stage .adv-empty-heroes-note {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.55);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    font-size: 13.5px;
}

.rpg-stage .adv-empty-heroes-note small {
    font-weight: 400;
    font-size: 12px;
    color: #94a3b8;
}

.rpg-stage .adv-troops-box {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 13px;
}

.rpg-stage .adv-troops-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 4px;
}

.rpg-stage .adv-troops-foot {
    font-size: 12px;
    color: #94a3b8;
}

/* Анимации */
@keyframes rpgFadeStage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rpgSilhouetteEmerge {
    0% { opacity: 0; filter: blur(8px) brightness(0.4); transform: scale(0.94); }
    100% { opacity: 1; filter: blur(0) brightness(1); transform: scale(1); }
}

@keyframes rpgEmergeFromMist {
    0% { opacity: 0; filter: blur(6px); transform: translateY(12px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes rpgMistPulse {
    from { opacity: 0.65; }
    to { opacity: 1; }
}

@keyframes rpgEyeGlow {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

@keyframes rpgBlink {
    to { visibility: hidden; }
}

/* Адаптивность */
@media screen and (max-width: 1100px) {
    .rpg-stage .adv-form-grid,
    .rpg-stage .adv-summary-strip,
    .rpg-stage .adv-joiners-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .rpg-stage { padding: 16px 14px 20px 14px; }
    .rpg-dialogue-row { flex-direction: column; align-items: stretch; gap: 14px; }
    .rpg-portrait-wrap { width: 104px; height: 112px; margin: 0 auto; }
    .rpg-choice-row,
    .rpg-modes-grid,
    .rpg-stage .adv-heroes-trio { grid-template-columns: 1fr; }
    .rpg-stage .adv-joiner-card .adv-hero-slot {
        flex-direction: row;
        text-align: left;
    }
    .rpg-stage .adv-joiner-card .adv-slot-badges {
        justify-content: flex-start;
    }
    .rpg-stage .adv-rally-card .adv-slot-avatar,
    .rpg-stage .adv-joiner-card .adv-slot-avatar {
        width: 72px;
        height: 72px;
    }
}
/* Кликабельная плашка счётчика героев в шапке советника */
.rpg-counter-pill {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.rpg-counter-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.rpg-counter-pill.empty {
    animation: rpgPulseWarn 2.2s ease-in-out infinite;
}

.rpg-pill-action {
    opacity: 0.9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Плашка быстрого перехода в Магию героев на экране операций */
.rpg-empty-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
}

.rpg-empty-cta-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #fef3c7;
    flex: 1 1 300px;
}

.rpg-empty-cta-btn {
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid rgba(251, 191, 36, 0.6);
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #0f172a;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.rpg-empty-cta-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

@keyframes rpgPulseWarn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}