/*
 * Светлая тема сайта. Включается атрибутом <html data-theme="light"> (кнопка в шапке, js/empires.js;
 * выбор хранится в localStorage «ep_theme», до отрисовки его читает inline-скрипт в main.tpl.php).
 *
 * Тёмная тема — основная, её стили лежат в empires.css, heroes-list.css, hero-page.css, news.css.
 * Здесь только переопределения для светлой: сначала переменные, затем поверхности (панели, поля) и цвета текста.
 * Баннер (#ep_hero, .ep_hp_banner) остаётся тёмным — на нём картинка и белый текст, поэтому внутри него
 * переменные возвращены к тёмным значениям.
 */

/* Кнопка переключения (видна в обеих темах) ================================= */

.ep_theme_btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--ep-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #f5c04a;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .25s;
}
.ep_theme_btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(96, 165, 250, .7); transform: rotate(18deg); }
.ep_theme_btn:focus-visible { outline: 2px solid var(--ep-sky); outline-offset: 2px; }
.ep_theme_btn .ep_ico_moon { display: none; }

:root[data-theme="light"] .ep_theme_btn { background: rgba(37, 99, 235, .07); color: #2563eb; }
:root[data-theme="light"] .ep_theme_btn:hover { background: rgba(37, 99, 235, .14); border-color: #2563eb; }
:root[data-theme="light"] .ep_theme_btn .ep_ico_sun { display: none; }
:root[data-theme="light"] .ep_theme_btn .ep_ico_moon { display: block; }

/* Плавная смена темы (класс ставит js на время переключения) */
.ep_theme_fade, .ep_theme_fade * {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease !important;
}

/* Переменные ================================================================ */

:root[data-theme="light"] {
    color-scheme: light;

    --ep-bg:          #edf1f8;
    --ep-bg-2:        #ffffff;
    --ep-bar:         rgba(255, 255, 255, .9);
    --ep-line:        rgba(30, 64, 120, .14);
    --ep-accent:      #2563eb;
    --ep-accent-hi:   #1d4ed8;
    --ep-sky:         #2563eb;
    --ep-text-inv:    #1e293b;
    --ep-muted-inv:   #64748b;
    --ep-shadow:      0 10px 30px rgba(30, 64, 120, .14);

    --ep-ink:         #0f2246;   /* заголовки и выделенный текст на панелях */
    --ep-body:        #334155;   /* основной текст на панелях */
    --ep-soft:        rgba(30, 64, 120, .05);   /* вложенные плашки */
    --ep-panel-bg:    #ffffff;
    --ep-panel-shadow: 0 2px 4px rgba(30, 64, 120, .05), 0 8px 24px rgba(30, 64, 120, .08);
}

/* Баннер остаётся тёмным: возвращаем ему тёмные значения переменных */
:root[data-theme="light"] #ep_hero,
:root[data-theme="light"] .ep_hp_banner {
    --ep-bg:          #0a1428;
    --ep-line:        rgba(126, 162, 230, .22);
    --ep-sky:         #60a5fa;
    --ep-text-inv:    #e8eefc;
    --ep-muted-inv:   #9fb0cf;
}

:root[data-theme="light"] { background: var(--ep-bg); }
:root[data-theme="light"] body.ep_theme {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 420px at 12% 0, rgba(96, 165, 250, .10), transparent 70%) fixed no-repeat,
        radial-gradient(800px 380px at 92% 30%, rgba(245, 192, 74, .07), transparent 70%) fixed no-repeat,
        var(--ep-bg);
    color: var(--ep-body);
}
:root[data-theme="light"] #layout {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 10px;
}
:root[data-theme="light"] #layout footer { margin-top: auto; }
:root[data-theme="light"] #ep_hero,
:root[data-theme="light"] .ep_hp_banner { box-shadow: 0 10px 30px -12px rgba(15, 34, 70, .45); }
:root[data-theme="light"] #ep_hero { box-shadow: none; }

/* Баннер вверху страницы — дневной пейзаж (макет !-design/top-1.png, static/theme/empires/top-light-*,
   нарезает system/tools/theme_images.php). Текст остаётся белым: затемнение по центру под ним сохранено,
   а низ уходит не в тёмный, как в тёмной теме, а в светлый фон страницы. Шапка героя (.ep_hp_banner) — своя. */
:root[data-theme="light"] #ep_hero {
    background-image: url("/static/theme/empires/top-light-1920.jpg");
    background-image: -webkit-image-set(url("/static/theme/empires/top-light-1920.webp") type("image/webp"), url("/static/theme/empires/top-light-1920.jpg") type("image/jpeg"));
    background-image: image-set(url("/static/theme/empires/top-light-1920.webp") type("image/webp"), url("/static/theme/empires/top-light-1920.jpg") type("image/jpeg"));
    background-position: center 45%;
}
:root[data-theme="light"] #ep_hero::before {
    background:
        radial-gradient(ellipse 55% 70% at 50% 42%, rgba(7, 16, 36, .55) 0%, rgba(7, 16, 36, 0) 100%),
        linear-gradient(180deg, rgba(10, 20, 40, .35) 0%, rgba(10, 20, 40, 0) 30%, rgba(237, 241, 248, 0) 55%, #edf1f8 100%);
}
@media screen and (max-width: 960px) {
    :root[data-theme="light"] #ep_hero {
        background-image: url("/static/theme/empires/top-light-960.jpg");
        background-image: -webkit-image-set(url("/static/theme/empires/top-light-960.webp") type("image/webp"), url("/static/theme/empires/top-light-960.jpg") type("image/jpeg"));
        background-image: image-set(url("/static/theme/empires/top-light-960.webp") type("image/webp"), url("/static/theme/empires/top-light-960.jpg") type("image/jpeg"));
    }
}

/* Шапка ===================================================================== */

:root[data-theme="light"] #ep_header {
    background: var(--ep-bar);
    box-shadow: 0 1px 0 rgba(30, 64, 120, .06), 0 6px 22px rgba(30, 64, 120, .10);
}
:root[data-theme="light"] #ep_header nav .menu > li > a { color: #334155; }
:root[data-theme="light"] #ep_header nav .menu > li:hover > a { color: var(--ep-ink); background: rgba(37, 99, 235, .06) !important; }
:root[data-theme="light"] #ep_header nav .menu > li.active > a {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0) 0%, rgba(37, 99, 235, .10) 100%) !important;
}
:root[data-theme="light"] #ep_header nav .menu ul {
    background: #fff;
    box-shadow: 0 14px 34px rgba(30, 64, 120, .18);
}
:root[data-theme="light"] #ep_header nav .menu ul li a,
:root[data-theme="light"] #ep_header nav .menu li.active ul li a { color: #334155; }
:root[data-theme="light"] #ep_header nav .menu ul li:hover > a { background-color: rgba(37, 99, 235, .08); color: var(--ep-ink); }
:root[data-theme="light"] #ep_header nav .menu li ul li.active > a { color: #1d4ed8; }

/* Выбор героя */
:root[data-theme="light"] .ep_hero_pick .select2-container--default .select2-selection--single {
    background-color: rgba(30, 64, 120, .04);
}
:root[data-theme="light"] .ep_hero_pick .select2-container--default .select2-selection--single:hover,
:root[data-theme="light"] .ep_hero_pick .select2-container--open .select2-selection--single {
    border-color: #2563eb;
    background-color: #fff;
}
:root[data-theme="light"] .ep_hero_pick .select2-container--default .select2-selection--single .select2-selection__rendered { color: #1e293b; }
:root[data-theme="light"] .ep_hero_pick .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #64748b; }
:root[data-theme="light"] .ep_hero_pick .select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: #64748b; }
:root[data-theme="light"] .ep_hero_pick .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-bottom-color: #64748b; }
:root[data-theme="light"] .ep_hero_pick .select2-dropdown { background: #fff; box-shadow: 0 14px 34px rgba(30, 64, 120, .18); }
:root[data-theme="light"] .ep_hero_pick .select2-dropdown .select2-search--dropdown .select2-search__field { background: #f3f6fc; color: #1e293b; }
:root[data-theme="light"] .ep_hero_pick .select2-dropdown .select2-results__option { color: #334155; }
:root[data-theme="light"] .ep_hero_pick .select2-dropdown .select2-results__option[aria-selected=true] { background: rgba(37, 99, 235, .10); color: var(--ep-ink); }
:root[data-theme="light"] .ep_hero_pick .select2-dropdown .select2-results__option--highlighted[aria-selected] { background: var(--ep-accent); color: #fff; }

/* Вход / профиль в шапке */
:root[data-theme="light"] #ep_header #widget_pos_header .menu > li > a { color: #1e293b; }
:root[data-theme="light"] #ep_header #widget_pos_header .menu > li > a:hover { background: rgba(37, 99, 235, .07); }
:root[data-theme="light"] #ep_header .menu-header li.user_add > a { color: #fff; }
:root[data-theme="light"] #ep_header #widget_pos_header .menu-notices .wrap .counter { border-color: #fff; }
:root[data-theme="light"] #ep_header .widget_user_avatar:hover .user_info { background: rgba(37, 99, 235, .07); }
:root[data-theme="light"] #ep_header .widget_user_avatar .user_info .name a { color: #1e293b; }
:root[data-theme="light"] #ep_header #widget_pos_header .widget_user_avatar .menu { background: #fff; box-shadow: 0 14px 34px rgba(30, 64, 120, .18); }
:root[data-theme="light"] #ep_header #widget_pos_header .widget_user_avatar .menu > li > a { color: #334155; }
:root[data-theme="light"] #ep_header #widget_pos_header .widget_user_avatar .menu > li:hover,
:root[data-theme="light"] #ep_header #widget_pos_header .widget_user_avatar .menu > li > a:hover { background-color: rgba(37, 99, 235, .08); }

:root[data-theme="light"] #logo a,
:root[data-theme="light"] #logo > span { filter: drop-shadow(0 2px 3px rgba(15, 34, 70, .35)); }

/* Баннер: внутри тёмный, но подвал и крошки уже на нём — ничего менять не нужно */

/* Тело страницы ============================================================= */

:root[data-theme="light"] #body section article { box-shadow: var(--ep-panel-shadow); }
:root[data-theme="light"] #body section h1 { color: var(--ep-ink); }

/* Все «тёмные панели» становятся белыми карточками */
:root[data-theme="light"] .ep_theme .widget,
:root[data-theme="light"] .ep_theme .widget_tabbed,
:root[data-theme="light"] .ep_theme .widget.ep_pop_widget,
:root[data-theme="light"] .ep_theme .widget:has(> .body > .menu-toolbar),
:root[data-theme="light"] .ep_theme .widget_tabbed:has(.relevants),
:root[data-theme="light"] .ep_layout_hero aside .widget_tabbed,
:root[data-theme="light"] #body section article:has(.heroes_icon, .heroes_list),
:root[data-theme="light"] #body section article:has(.ep_news_list, .ep_news_head, .ep_news_empty) {
    border-color: var(--ep-line);
    background: var(--ep-panel-bg);
    box-shadow: var(--ep-panel-shadow);
    color: var(--ep-body);
}
:root[data-theme="light"] .ep_theme .widget.ep_pop_widget { -webkit-backdrop-filter: none; backdrop-filter: none; }

:root[data-theme="light"] .ep_theme .widget > .title,
:root[data-theme="light"] .ep_theme aside .widget > .title,
:root[data-theme="light"] .ep_layout_hero aside .widget > .title { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .widget > .title .links a { color: #2563eb; }
:root[data-theme="light"] .ep_theme .widget > .title .links a:hover { color: var(--ep-ink); }

:root[data-theme="light"] :where(.ep_theme .widget > .body) a { color: #1d4ed8; }
:root[data-theme="light"] :where(.ep_theme .widget > .body) a:hover { color: var(--ep-ink); }

:root[data-theme="light"] .ep_theme .widget_tabbed .tabs ul li a.active,
:root[data-theme="light"] .ep_theme .widget_tabbed .tabs ul li a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .widget_tabbed .widgets .body,
:root[data-theme="light"] .ep_theme .widget_html_block,
:root[data-theme="light"] .ep_theme .widget_text_block,
:root[data-theme="light"] .ep_layout_hero aside .widget > .body { color: var(--ep-body); }
:root[data-theme="light"] .ep_layout_hero aside .widget a { color: #1d4ed8; }
:root[data-theme="light"] .ep_layout_hero aside .widget a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .ep_layout_hero aside .widget .field label { color: var(--ep-muted-inv); }

/* Панель действий и меню в виджетах */
:root[data-theme="light"] #body .menu.menu-toolbar li a {
    background-color: var(--ep-soft);
    color: #334155;
}
:root[data-theme="light"] #body .menu.menu-toolbar li a:hover { border-color: #2563eb; background-color: rgba(37, 99, 235, .10); color: var(--ep-ink); }
:root[data-theme="light"] #body aside .menu li a,
:root[data-theme="light"] #body aside .menu li span.item,
:root[data-theme="light"] #body section .widget .menu li a { color: #334155; }
:root[data-theme="light"] #body aside .menu li:hover,
:root[data-theme="light"] #body aside .menu li.active,
:root[data-theme="light"] #body section .widget .menu li:hover,
:root[data-theme="light"] #body section .widget .menu li.active { background: rgba(37, 99, 235, .08); }
:root[data-theme="light"] #body aside .menu li:hover > a,
:root[data-theme="light"] #body aside .menu li.active > a,
:root[data-theme="light"] #body section .widget .menu li:hover > a { color: var(--ep-ink); }

/* Поля форм в виджетах */
:root[data-theme="light"] .ep_theme .widget .input,
:root[data-theme="light"] .ep_theme .widget input.form-control,
:root[data-theme="light"] .ep_theme .widget select,
:root[data-theme="light"] .ep_theme .widget textarea,
:root[data-theme="light"] .ep_layout_hero aside .widget .input {
    border-color: rgba(30, 64, 120, .22);
    background: #f7f9fd;
    color: #1e293b;
}
:root[data-theme="light"] .ep_theme .widget .input:focus,
:root[data-theme="light"] .ep_theme .widget input.form-control:focus,
:root[data-theme="light"] .ep_theme .widget textarea:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); background: #fff; }
:root[data-theme="light"] .ep_layout_hero aside .widget .button:not(.button-submit) { border-color: rgba(37, 99, 235, .35); background: rgba(37, 99, 235, .08); color: #1d4ed8; }

/* Служебный текст, комментарии, форум */
:root[data-theme="light"] .ep_theme .widget .date,
:root[data-theme="light"] .ep_theme .widget .details,
:root[data-theme="light"] .ep_theme .widget .text-muted { color: #64748b !important; }
:root[data-theme="light"] .ep_theme .widget_comments_list .item,
:root[data-theme="light"] .ep_theme .widget_activity_list .item,
:root[data-theme="light"] .ep_theme .widget-posts-item,
:root[data-theme="light"] .ep_theme .widget-posts-item.odd { border-bottom-color: rgba(30, 64, 120, .10); }
:root[data-theme="light"] .ep_theme .widget_comments_list .item .title,
:root[data-theme="light"] .ep_theme .widget_activity_list .item .title { color: var(--ep-body); }
:root[data-theme="light"] .ep_theme .widget .author { color: var(--ep-ink) !important; }
:root[data-theme="light"] .ep_theme .widget .author:hover { color: #2563eb !important; }
:root[data-theme="light"] .ep_theme .widget-posts-title a { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .widget-posts-title a:hover { color: #2563eb; }
:root[data-theme="light"] .ep_theme .widget-posts-content { color: #475569; }
:root[data-theme="light"] .ep_theme .widget-posts-details,
:root[data-theme="light"] .ep_theme .widget-posts-author,
:root[data-theme="light"] .ep_theme .widget-posts-date { color: #64748b; }
:root[data-theme="light"] .ep_theme .widget-posts-date span { color: #334155; }

/* Календарь-виджет */
:root[data-theme="light"] .ep_theme .widget .cal-widget {
    --c-line:  rgba(30, 64, 120, .14);
    --c-soft:  rgba(30, 64, 120, .05);
    --c-text:  #334155;
    --c-muted: #64748b;
    --c-accent: #2563eb;
}
:root[data-theme="light"] .ep_theme .widget .cal-widget__item { background: color-mix(in srgb, var(--t) 16%, #fff); }
:root[data-theme="light"] .ep_theme .widget .cal-widget__item a { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .widget .cal-widget__item a:hover { color: #2563eb; }

/* Подвал: внизу страницы полоса с пейзажем — нижняя часть макета !-design/bottom-light.png
   (static/theme/empires/footer-light-*.webp|jpg, в git не входят; нарезает system/tools/theme_images.php). Сверху полоса растворяется в фоне страницы,
   панель подвала лежит на ней полупрозрачной.
   body — свой контекст наложения (z-index: 0), чтобы полоса с z-index: -1 была над фоном body, но под контентом. */
:root[data-theme="light"] body.ep_theme { position: relative; z-index: 0; }
:root[data-theme="light"] body.ep_theme::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(150px, 16vw, 307px);   /* 16vw — пропорции картинки 1920×307 */
    background-image: url("/static/theme/empires/footer-light-1920.jpg");
    background-image: -webkit-image-set(url("/static/theme/empires/footer-light-1920.webp") type("image/webp"), url("/static/theme/empires/footer-light-1920.jpg") type("image/jpeg"));
    background-image: image-set(url("/static/theme/empires/footer-light-1920.webp") type("image/webp"), url("/static/theme/empires/footer-light-1920.jpg") type("image/jpeg"));
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 45%);
    mask-image: linear-gradient(180deg, transparent 0, #000 45%);
    pointer-events: none;
}
@media screen and (max-width: 960px) {
    :root[data-theme="light"] body.ep_theme::after {
        background-image: url("/static/theme/empires/footer-light-960.jpg");
        background-image: -webkit-image-set(url("/static/theme/empires/footer-light-960.webp") type("image/webp"), url("/static/theme/empires/footer-light-960.jpg") type("image/jpeg"));
        background-image: image-set(url("/static/theme/empires/footer-light-960.webp") type("image/webp"), url("/static/theme/empires/footer-light-960.jpg") type("image/jpeg"));
    }
}
:root[data-theme="light"] #layout { padding-bottom: 24px; }
:root[data-theme="light"] #layout footer {
    border-color: rgba(255, 255, 255, .7);
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: var(--ep-panel-shadow);
}
:root[data-theme="light"] #layout footer a { color: #1d4ed8; }
:root[data-theme="light"] #layout footer a:hover { color: var(--ep-ink); }

/* Карточки героев остаются тёмными: возвращаем им белый текст поверх правила ссылок виджета */
:root[data-theme="light"] .ep_pop_card,
:root[data-theme="light"] .ep_pop_card:hover { color: #fff; }

/* Список героев ============================================================= */

:root[data-theme="light"] #body section article:has(.heroes_icon, .heroes_list) h1,
:root[data-theme="light"] #body section article:has(.ep_news_list, .ep_news_head, .ep_news_empty) h1 { color: var(--ep-ink); }
:root[data-theme="light"] #body section article:has(.heroes_icon, .heroes_list) .category_description,
:root[data-theme="light"] #body section article:has(.ep_news_list, .ep_news_empty) .category_description { color: #475569; }
:root[data-theme="light"] #body section article:has(.heroes_icon, .heroes_list) .category_description a { color: #1d4ed8; }

:root[data-theme="light"] #controller_wrap:has(.heroes_icon) .content_datasets ul li > a,
:root[data-theme="light"] #controller_wrap:has(.heroes_icon) .content_datasets ul li > div { background: var(--ep-soft); color: #334155; }
:root[data-theme="light"] #controller_wrap:has(.heroes_icon) .content_datasets ul li > a:hover { background: rgba(37, 99, 235, .10); color: var(--ep-ink); }
:root[data-theme="light"] #controller_wrap:has(.heroes_icon) .content_datasets ul li.active > a,
:root[data-theme="light"] #controller_wrap:has(.heroes_icon) .content_datasets ul li.active > div { background: var(--ep-accent); color: #fff; }

:root[data-theme="light"] .content_categories ul.heroes_icon li a {
    background: linear-gradient(180deg, #ffffff, #eef3fb);
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(30, 64, 120, .08);
}
:root[data-theme="light"] .content_categories ul.heroes_icon li.active a { color: var(--ep-ink); background: color-mix(in srgb, var(--e) 14%, #fff); }

:root[data-theme="light"] .heroes-filter.filter-panel { background: #f6f8fd; color: #334155; }
:root[data-theme="light"] .heroes-filter .filter-link a { color: #334155; }
:root[data-theme="light"] .heroes-filter .filter-link a:hover { background: rgba(37, 99, 235, .08); color: var(--ep-ink); }
:root[data-theme="light"] .heroes-filter .filter-close a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .heroes-filter .ft_checkbox:hover .title { color: var(--ep-ink); }
:root[data-theme="light"] .heroes-filter .ft_checkbox input[type=checkbox] { background: #b6c3da; }
:root[data-theme="light"] .heroes-filter .ft_checkbox input[type=checkbox]:checked { background: var(--ep-accent); }
:root[data-theme="light"] .heroes-filter .input_checkbox_list label span { background: #fff; color: #334155; }
:root[data-theme="light"] .heroes-filter .input_checkbox_list label:hover span { color: var(--ep-ink); }
:root[data-theme="light"] .heroes-filter .chosen-container .chosen-drop { background: #fff; box-shadow: 0 10px 24px rgba(30, 64, 120, .18); }
:root[data-theme="light"] .heroes-filter .chosen-container .chosen-results { color: #334155; color-scheme: light; }
:root[data-theme="light"] .heroes-filter .chosen-container .chosen-results li.result-selected { color: #2563eb; }
:root[data-theme="light"] .heroes-filter .chosen-container-single .chosen-single div b { filter: none; }
:root[data-theme="light"] .heroes-filter input.form-control::placeholder,
:root[data-theme="light"] .heroes-filter .chosen-container-multi .chosen-choices li.search-field input[type=text] { color: #94a3b8; }
:root[data-theme="light"] .heroes-filter .buttons .link a:hover { color: var(--ep-ink); }

:root[data-theme="light"] .heroes_note { color: #475569; }
:root[data-theme="light"] .heroes_note a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .heroes_list a.ep_pop_name { color: #fff; }
:root[data-theme="light"] .heroes_list a.heroes_cmp { border-color: rgba(30, 64, 120, .22); background: rgba(255, 255, 255, .85); color: #334155; }
:root[data-theme="light"] .heroes_list a.heroes_cmp:hover { background: color-mix(in srgb, var(--e) 55%, #fff); color: #fff; }
:root[data-theme="light"] .heroes_list a.heroes_cmp[id^="del,"] { border-color: var(--e); background: var(--e); color: #fff; }
:root[data-theme="light"] .tooltip-block { background: #fff; color: #334155; box-shadow: 0 6px 16px rgba(30, 64, 120, .2); }

/* Новости =================================================================== */

:root[data-theme="light"] .ep_news_list,
:root[data-theme="light"] .ep_news_head,
:root[data-theme="light"] .ep_news_text,
:root[data-theme="light"] .ep_news_list--widget {
    --nw-text:  #334155;
    --nw-muted: #64748b;
    --nw-line:  rgba(30, 64, 120, .14);
}
:root[data-theme="light"] #body section article:has(.ep_news_list, .ep_news_head, .ep_news_empty) { --nw-text: #334155; --nw-muted: #64748b; --nw-line: rgba(30, 64, 120, .14); }
:root[data-theme="light"] .ep_theme .widget:has(.ep_news_list--widget),
:root[data-theme="light"] .ep_theme .widget:has(.ep_feat_main),
:root[data-theme="light"] .ep_theme .relevants { --nw-text: #334155; --nw-muted: #64748b; --nw-line: rgba(30, 64, 120, .14); }

:root[data-theme="light"] .ep_news_meta a:hover,
:root[data-theme="light"] .ep_theme .widget .ep_news_meta a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .ep_news_card { background: #fafbfe; }
:root[data-theme="light"] .ep_news_card:hover { background: #fff; border-color: rgba(37, 99, 235, .45); box-shadow: 0 6px 18px rgba(30, 64, 120, .10); }
:root[data-theme="light"] .ep_news_thumb { background: #dfe7f4; }
:root[data-theme="light"] #body section .ep_news_title a,
:root[data-theme="light"] #body .ep_news_list--widget .ep_news_title a { color: var(--ep-ink); }
:root[data-theme="light"] #body section .ep_news_title a:hover,
:root[data-theme="light"] #body .ep_news_list--widget .ep_news_title a:hover { color: #2563eb; }
:root[data-theme="light"] .ep_news_teaser { color: #475569; }
:root[data-theme="light"] #body section article:has(.ep_news_list) .pagebar_current { background: var(--ep-soft); color: #334155; }
:root[data-theme="light"] #body section article:has(.ep_news_list) .pagebar a.pagebar_page:hover { color: var(--ep-ink); }
:root[data-theme="light"] #body section article:has(.ep_news_list) .pagebar .pagebar_current { color: #fff; }

:root[data-theme="light"] .ep_news_brief { color: var(--ep-ink); background: rgba(30, 64, 120, .06); }
:root[data-theme="light"] .ep_news_text a { color: #1d4ed8; }
:root[data-theme="light"] .ep_news_text a:hover { color: var(--ep-ink); }
:root[data-theme="light"] #body section .ep_news_text h2,
:root[data-theme="light"] #body section .ep_news_text h3,
:root[data-theme="light"] .ep_news_text strong,
:root[data-theme="light"] .ep_news_text b { color: var(--ep-ink); }
:root[data-theme="light"] .ep_news_text blockquote { background: #f3f6fc; color: #334155; }
:root[data-theme="light"] .ep_news_text .rating_widget { background: #f3f6fc; }
:root[data-theme="light"] .ep_news_text .rating_widget .score span { color: var(--ep-ink) !important; }
/* Белый фон и чёрный текст, зашитые редактором в содержимое новости, снова допустимы */
:root[data-theme="light"] .ep_news_text [style*="color: rgb(0, 0, 0)"],
:root[data-theme="light"] .ep_news_text [style*="color: rgb(36, 64, 97)"],
:root[data-theme="light"] .ep_news_text [style*="color:#000"],
:root[data-theme="light"] .ep_news_text [style*="color: #000"] { color: inherit !important; }

:root[data-theme="light"] .ep_theme .widget_tabbed:has(.relevants) .tabs ul li a.active { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .relevants .relevants_list_item { background: #fafbfe; }
:root[data-theme="light"] .ep_theme .relevants .relevants_list_item .title a { color: var(--ep-ink); }
:root[data-theme="light"] .ep_theme .relevants .relevants_list_item .title a:hover { color: #2563eb; }
:root[data-theme="light"] .ep_theme .relevants .relevants_list_item .info_bar a:hover { color: var(--ep-ink); }

:root[data-theme="light"] #body section article:has(.ep_news_head) #comments_widget > ul li a { color: var(--ep-ink); }
:root[data-theme="light"] #body section article:has(.ep_news_head) #comments_widget a { color: #1d4ed8; }
:root[data-theme="light"] #body section article:has(.ep_news_head) #comments_widget a:hover { color: var(--ep-ink); }

:root[data-theme="light"] .ep_theme .widget a.ep_feat_item { background: #fafbfe; color: #334155; }
:root[data-theme="light"] .ep_theme .widget a.ep_feat_item.is-active { background: rgba(37, 99, 235, .08); color: var(--ep-ink); }

/* Страница героя ============================================================ */

:root[data-theme="light"] .ep_hp {
    --hp-panel: #fff;
    --hp-line:  rgba(30, 64, 120, .14);
    color: var(--ep-body);
}
:root[data-theme="light"] .ep_hp_banner { --hp-line: rgba(126, 162, 230, .2); }

:root[data-theme="light"] .ep_hp_tabs { background: rgba(255, 255, 255, .94); box-shadow: 0 6px 18px rgba(30, 64, 120, .10); }
:root[data-theme="light"] .ep_hp_tab { color: #475569; }
:root[data-theme="light"] .ep_hp_tab:hover { color: var(--ep-ink); background: rgba(37, 99, 235, .07); }
:root[data-theme="light"] .ep_hp_tab.active { color: var(--ep-ink); background: rgba(37, 99, 235, .09); }
:root[data-theme="light"] .ep_hp_tab.is_in_compare { color: color-mix(in srgb, var(--hp-el) 70%, #0f2246); }
:root[data-theme="light"] .ep_hp_panes { color: var(--ep-body); }
:root[data-theme="light"] .ep_hp_panes a { color: #1d4ed8; }
:root[data-theme="light"] .ep_hp_panes a:hover { color: var(--ep-ink); }

:root[data-theme="light"] .ep_hp_panel,
:root[data-theme="light"] .ep_hp_extra > h2 + *,
:root[data-theme="light"] .ep_hp_panes a.ep_hp_link {
    background: #fff;
    border-color: var(--ep-line);
    box-shadow: var(--ep-panel-shadow);
    color: var(--ep-body);
}
:root[data-theme="light"] .ep_hp_extra { color: var(--ep-body); }
:root[data-theme="light"] .ep_hp_extra a { color: #1d4ed8; }
:root[data-theme="light"] .ep_hp_extra .content_item_props table td { color: var(--ep-body); border-color: rgba(30, 64, 120, .10); }

:root[data-theme="light"] #body section .ep_hp_panel_title,
:root[data-theme="light"] #body section .ep_hp_sub h3,
:root[data-theme="light"] .ep_hp_skill_head b,
:root[data-theme="light"] .ep_hp_ability_head b,
:root[data-theme="light"] .ep_hp_kv_v,
:root[data-theme="light"] .ep_hp_kv_v a,
:root[data-theme="light"] .ep_hp_stat b,
:root[data-theme="light"] .ep_hp_stage_n,
:root[data-theme="light"] .ep_hp_stage_title,
:root[data-theme="light"] .ep_hp_stage_card li b,
:root[data-theme="light"] .ep_hp_panes .ep_hp_costumes a,
:root[data-theme="light"] .ep_hp_panes a.ep_hp_link { color: var(--ep-ink); }
:root[data-theme="light"] .ep_hp_panes a.ep_hp_link:hover { color: var(--ep-ink); border-color: #2563eb; }
:root[data-theme="light"] .ep_hp_panes .ep_hp_costumes a:hover { background: rgba(37, 99, 235, .07); color: var(--ep-ink); }
:root[data-theme="light"] .ep_hp_text,
:root[data-theme="light"] .ep_hp_stage_card li { color: var(--ep-body); }
:root[data-theme="light"] .ep_hp_mat small { color: #64748b; }
:root[data-theme="light"] .ep_hp_gold { color: #b7791f; }
:root[data-theme="light"] .ep_hp_stats,
:root[data-theme="light"] .ep_hp_stage_card { background: #f3f6fc; }
:root[data-theme="light"] .ep_hp_calc select { background: #f7f9fd; color: #1e293b; }
:root[data-theme="light"] .ep_hp_effects li a,
:root[data-theme="light"] .ep_hp_effects li span { background: rgba(37, 99, 235, .07); color: #1e3a8a; }
:root[data-theme="light"] .ep_hp_panes .ep_hp_effects li a:hover { color: var(--ep-ink); }
:root[data-theme="light"] .ep_hp_costume_thumb { background: radial-gradient(circle at 50% 40%, rgba(var(--hp-el-rgb), .35), #1a2a4d 75%); }
:root[data-theme="light"] .ep_hp_panes a.ep_hp_btn { background: rgba(37, 99, 235, .10); color: #1d4ed8; }
:root[data-theme="light"] .ep_hp_panes a.ep_hp_btn:hover { background: var(--ep-accent); color: #fff; }
:root[data-theme="light"] .ep_hp_bar_info b { color: var(--ep-ink); }
:root[data-theme="light"] .ep_hp_tag { color: color-mix(in srgb, var(--hp-el) 60%, #0f2246); }
:root[data-theme="light"] .ep_hp_banner .ep_hp_tag { color: var(--hp-el); }

/* Иконки/значки внутри баннера и на цветных плашках сохраняют белый текст */
:root[data-theme="light"] .ep_hp_banner .ep_hp_kv_v,
:root[data-theme="light"] .ep_hp_banner .ep_hp_stat b,
:root[data-theme="light"] .ep_hp_banner .ep_hp_skill_head b { color: #fff; }

/* Мобильное меню (до 1240px) ================================================ */

@media screen and (max-width: 1240px) {
    :root[data-theme="light"] #ep_header { background: #fff; }
    :root[data-theme="light"] .ep_menu_btn { background: rgba(37, 99, 235, .07); color: #1e293b; }
    :root[data-theme="light"] .ep_menu_btn:hover { background: rgba(37, 99, 235, .14); }
    :root[data-theme="light"] #ep_header nav {
        background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
        box-shadow: -20px 0 50px rgba(15, 34, 70, .25);
    }
    :root[data-theme="light"] .ep_drawer_head { color: var(--ep-ink); }
    :root[data-theme="light"] .ep_drawer_close { background: rgba(30, 64, 120, .07); }
    :root[data-theme="light"] .ep_drawer_close:hover { background: rgba(30, 64, 120, .14); }
    :root[data-theme="light"] .ep_drawer_close::before,
    :root[data-theme="light"] .ep_drawer_close::after { background: #1e293b; }
    :root[data-theme="light"] #ep_header nav .menu > li > a { color: #1e293b; }
    :root[data-theme="light"] #ep_header nav .menu > li:hover > a { background: rgba(37, 99, 235, .07) !important; }
    :root[data-theme="light"] #ep_header nav .menu > li.active > a {
        color: #1d4ed8;
        background: linear-gradient(90deg, rgba(37, 99, 235, .16) 0%, rgba(37, 99, 235, .03) 100%) !important;
        box-shadow: inset 3px 0 0 #2563eb;
    }
    :root[data-theme="light"] .ep_sub_toggle { background-color: rgba(30, 64, 120, .06); }
    :root[data-theme="light"] .ep_sub_toggle:hover { background-color: rgba(30, 64, 120, .12); }
    :root[data-theme="light"] #ep_header nav .menu ul li a,
    :root[data-theme="light"] #ep_header nav .menu li.active ul li a { color: #475569; }
}
