/* ==========================================================================
   FASOOLLKA — общие стили всех страниц
   Две темы: data-theme="hell" (Ад) и data-theme="heaven" (Рай).
   Цвета каждой темы задаются переменными в разделе 2.
   Стили отдельных страниц: home.css, cinema.css, rating.css
   ========================================================================== */

/* ---------- 1. Шрифты (лежат в assets/fonts, интернет не нужен) ---------- */
@font-face { font-family: "UnifrakturCook"; src: url("../fonts/unifrakturcook-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Uncial Antiqua"; src: url("../fonts/uncial-antiqua-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* подписи входа в меню на фоне главной (с 24.10.2026, только кириллица): ад — Ruslan Display (острые древние буквы),
   рай — Triodion (буквы церковных книг); оба — SIL Open Font License, с Google Fonts через fontsource */
@font-face { font-family: "Ruslan Display"; src: url("../fonts/ruslan-display-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Triodion"; src: url("../fonts/triodion-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-cyrillic-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-cyrillic-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-cyrillic-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-cyrillic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url("../fonts/onest-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* тема «Сакура» (с 30.10.2026): Manrope — текст, Unbounded — заголовки и надпись FASOOLLKA (fontsource, OFL) */
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-cyrillic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-cyrillic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-cyrillic-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-cyrillic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-cyrillic-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 2. Цвета тем ---------- */
:root {
    --ui: "Manrope", "Onest", "Segoe UI", system-ui, sans-serif;
    --serif: "Manrope", "Onest", system-ui, sans-serif;     /* заголовки (до 30.10.2026 — Cormorant) */
    --display: "Unbounded", "Manrope", system-ui, sans-serif;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* пятно света за курсором на панели: свойства не наследуются — при движении мыши
   браузер пересчитывает только саму панель, а не всё, что внутри неё */
@property --mx { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }
@property --my { syntax: "<length-percentage>"; inherits: false; initial-value: -50%; }

/* Тема «Сакура» (с 30.10.2026): data-theme="hell" — НОЧЬ, data-theme="heaven" — ДЕНЬ
   (ключи прежние, чтобы не трогать сохранённый выбор зрителей и весь код; прежние цвета ада и рая — архив fasoollka_etap9zs.zip) */
:root[data-theme="hell"] {
    color-scheme: dark;
    --bg: #0d0a1c;
    --text: #f6ecf7;
    --text-soft: #cfc1de;
    --text-faint: #9a8db4;
    --accent: #ff6f91;
    --accent-hot: #ff8fab;
    --accent-pale: #ffd6e2;
    --accent-deep: #9b2c55;
    --link: #ff9fbc;

    --panel-bg: linear-gradient(180deg, rgba(30, 23, 58, .74), rgba(16, 12, 34, .7));
    --panel-border: rgba(255, 150, 180, .22);
    --panel-shadow: 0 24px 60px -24px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 200, 220, .08);
    --panel-radius: 22px;
    --panel-spot: rgba(255, 111, 145, .14);

    --ledge: linear-gradient(90deg, transparent 0%, #9b2c55 10%, #ff6f91 34%, #ffe3ec 50%, #ff6f91 66%, #9b2c55 90%, transparent 100%);
    --ledge-glow: 0 0 8px rgba(255, 111, 145, .9), 0 0 20px rgba(255, 111, 145, .45);
    --ledge-h: 2px;

    --btn-bg: linear-gradient(180deg, #ff93ad 0%, #ff5f87 52%, #d93a66 100%);
    --btn-text: #ffffff;
    --btn-glow: 0 0 0 1px rgba(255, 210, 222, .35) inset, 0 10px 30px -8px rgba(255, 80, 130, .7);
    --ghost-border: rgba(255, 150, 180, .45);
    --ghost-bg: rgba(30, 22, 60, .42);

    --chip-bg: rgba(255, 111, 145, .15);
    --row-today: linear-gradient(90deg, rgba(255, 111, 145, .3), rgba(255, 111, 145, 0));
    --thumb-img: var(--asset-bg-hell, url("../img/bg-hell.jpg"));
    --avatar-glow: drop-shadow(0 0 10px rgba(255, 111, 145, .5));
    --bubble-bg: #1d1736;
    --bubble-border: #ff6f91;

    --wm-font: var(--display);
    --wm-weight: 800;
    --wm-size: min(8.6vw, 16vh);
    --wm-track: 0em;
    --wm-fill: linear-gradient(0deg, #ff6f91 0%, #ff9fbc 35%, #ffe3ec 60%, #ffffff 100%);
    --wm-glow: #ff6f91;
    --wm-stroke: transparent;
    --wm-opacity: .96;

    --fog-color: 26, 20, 58;
    --fog-hi: 255, 150, 190;

    --surface: #17122d;                 /* сплошной фон окон */
    --surface-2: #211a3f;
    --line: rgba(255, 170, 200, .16);
    --ch-mark: #ff6f91;                 /* контраст к фону окна ≈ 6 : 1 */
    --ch-hot: #ffd6e2;
    --ch-wash: rgba(255, 111, 145, .14);
    --ch-grid: rgba(255, 190, 215, .13);
    --overlay: radial-gradient(120% 90% at 50% 55%, rgba(30, 22, 62, .86), rgba(8, 6, 18, .95));
    --gold: #ffd27a;
    --tiktok: #ffffff;
    --medal-1: linear-gradient(135deg, #fff4d6, #ffd27a 45%, #c98a1e);
    --medal-2: linear-gradient(135deg, #f3f3f8, #c3c3d6 50%, #6e6e88);
    --medal-3: linear-gradient(135deg, #ffd9c4, #d98a5c 50%, #7a3c1c);
}

:root[data-theme="heaven"] {
    color-scheme: light;
    --bg: #fff5f7;
    --text: #2b1d2a;
    --text-soft: #5e4a5c;
    --text-faint: #8a7487;
    --accent: #e23d66;
    --accent-hot: #ff6f91;
    --accent-pale: #ffe3ea;
    --accent-deep: #a3254a;
    --link: #c2335a;

    --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 246, 249, .72));
    --panel-border: rgba(226, 61, 102, .18);
    --panel-shadow: 0 24px 60px -28px rgba(120, 40, 80, .35), inset 0 1px 0 rgba(255, 255, 255, .95);
    --panel-radius: 22px;
    --panel-spot: rgba(255, 200, 215, .5);

    --ledge: linear-gradient(90deg, transparent 0%, #ffb3c4 10%, #ff8fab 35%, #ffffff 50%, #ff8fab 65%, #ffb3c4 90%, transparent 100%);
    --ledge-glow: 0 0 8px rgba(255, 170, 195, .9), 0 0 20px rgba(255, 255, 255, .9);
    --ledge-h: 3px;

    --btn-bg: linear-gradient(180deg, #ff7f9c 0%, #f04b72 55%, #d33260 100%);
    --btn-text: #ffffff;
    --btn-glow: 0 0 0 1px rgba(255, 255, 255, .45) inset, 0 10px 28px -8px rgba(226, 61, 102, .6);
    --ghost-border: rgba(226, 61, 102, .45);
    --ghost-bg: rgba(255, 255, 255, .58);

    --chip-bg: rgba(255, 111, 145, .14);
    --row-today: linear-gradient(90deg, rgba(255, 143, 171, .38), rgba(255, 143, 171, 0));
    --thumb-img: var(--asset-bg-heaven, url("../img/bg-heaven.jpg"));
    --avatar-glow: drop-shadow(0 0 10px rgba(255, 170, 195, .9));
    --bubble-bg: #ffffff;
    --bubble-border: #ff8fab;

    --wm-font: var(--display);
    --wm-weight: 800;
    --wm-size: min(8.6vw, 16vh);
    --wm-track: 0em;
    --wm-fill: linear-gradient(0deg, #a3254a 0%, #e23d66 40%, #ff6f91 70%, #2b1d2a 71%, #2b1d2a 100%);
    --wm-glow: #ffb3c4;
    --wm-stroke: transparent;
    --wm-opacity: .97;

    --fog-color: 255, 238, 244;
    --fog-hi: 255, 255, 255;

    --surface: #fffafb;
    --surface-2: #fdeef3;
    --line: rgba(226, 61, 102, .18);
    --ch-mark: #d6335c;                 /* контраст к белому ≈ 4.6 : 1 */
    --ch-hot: #7a1838;
    --ch-wash: rgba(214, 51, 92, .12);
    --ch-grid: rgba(120, 40, 70, .14);
    --overlay: radial-gradient(120% 90% at 50% 40%, rgba(255, 250, 252, .88), rgba(255, 224, 234, .94));
    --gold: #c98a1e;
    --tiktok: #111111;
    --medal-1: linear-gradient(135deg, #fffbe6, #f1cf6c 45%, #b07a1c);
    --medal-2: linear-gradient(135deg, #ffffff, #d6dae6 50%, #8e95a8);
    --medal-3: linear-gradient(135deg, #fff1e4, #e2a77a 50%, #9a5a2c);
}

/* ---------- 3. Базовые настройки ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }
html.page-home, .page-home body { height: 100%; }
.page-home body { overflow: hidden; }            /* главная помещается на одном экране */

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color .6s ease, color .6s ease;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }

.profile__name, .preloader__mark, .page-title { font-variant-ligatures: none; font-feature-settings: "liga" 0, "dlig" 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* показываем только то, что относится к текущей теме */
:root[data-theme="hell"] .only-heaven,
:root[data-theme="heaven"] .only-hell { display: none !important; }

/* ---------- 4. Фон-сцена ---------- */
.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
}

.scene__world {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility .8s;
}
:root[data-theme="hell"] .scene__world--hell,
:root[data-theme="heaven"] .scene__world--heaven { opacity: 1; visibility: visible; }
/* мир, который сейчас не показан, убран совсем: его анимации и слои не тратят кадр (fx.js) */
.scene__world[hidden] { display: none; }

.scene__world--hell   { --ar: 2560 / 1441; --img: var(--asset-bg-hell, url("../img/bg-hell.jpg")); }
.scene__world--heaven { --ar: 2560 / 1441; --img: var(--asset-bg-heaven, url("../img/bg-heaven.jpg")); }

/* Картинка всегда закрывает экран целиком (как background-size: cover),
   а все эффекты внутри неё стоят в процентах — поэтому точно попадают в портал, луч, арку */
.scene__box {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100vw, calc(100vh * var(--ar)));
    aspect-ratio: var(--ar);
    /* сдвиг за мышкой (параллакс) fx.js дописывает прямо сюда — только у видимого мира */
    transform: translate3d(-50%, -50%, 0) scale(1.05);
}
.scene__zoom {
    position: absolute;
    inset: 0;
    transform-origin: 50% 35%;
    animation: kenBurns 46s ease-in-out infinite alternate;
    will-change: transform;
}
.scene__img {
    position: absolute;
    inset: 0;
    background: var(--img) center / 100% 100% no-repeat;
}
.scene__zoom > * { position: absolute; pointer-events: none; }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Все места эффектов заданы в процентах картинки 2560×1441 (с 30.10.2026 — тема «Сакура», картинки владельца:
   озеро, ворота тории в воде, Фудзи; день и ночь — одна раскладка):
   ночь (data-theme="hell") — луна (48.9 %, 16.7 %), ворота (63.5…77 % × 42…62 %), фонари у их опор (66.2, 68.7,
   73.4, 76 % × 56…58 %), святилище справа (94.4 %, 56.8 %), огни острова (50 %, 56.8 %), лунная дорожка
   (51.2 %, 70.5 %), отражение ворот (71.2 %, 70 %); день (data-theme="heaven") — солнце у левого края (2 %, 36 %).
   Исходники и скрипт — исходники_фона\ (s1_upscale.py); прежние картинки — было_сакура_1\, ада и рая — было_ад_и_рай\ */

/* ===== НОЧЬ ===== */
/* сияние вокруг луны медленно «дышит» */
.sk-moon {
    left: 48.9%; top: 16.7%;
    width: 16%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 250, 235, .55) 0%, rgba(220, 225, 255, .22) 18%, rgba(160, 170, 255, .08) 38%, transparent 62%);
    mix-blend-mode: screen;
    animation: skBreath 7s ease-in-out infinite;
}
/* тёплые фонари у ворот, святилища и огни острова мерцают, как свечи */
.sk-lamp {
    width: 3.2%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 214, 140, .75) 0%, rgba(255, 150, 70, .32) 22%, rgba(255, 110, 60, .1) 45%, transparent 68%);
    mix-blend-mode: screen;
    animation: skFlicker 2.6s ease-in-out infinite alternate;
}
/* дорожка луны и отражение ворот на воде переливаются */
.sk-water {
    left: 51.2%; top: 70.5%;
    width: 5%;
    height: 21%;
    transform: translate(-50%, -50%);
    background: repeating-linear-gradient(180deg, rgba(255, 245, 220, .5) 0 2px, transparent 2px 9px);
    -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, transparent 100%);
            mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, transparent 100%);
    mix-blend-mode: screen;
    animation: skShimmer 3.2s ease-in-out infinite;
}

/* ===== ДЕНЬ ===== */
/* солнце светит из-за левого края: мягкое сияние */
.sk-sun {
    left: 2%; top: 36%;
    width: 60%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 252, 235, .55) 0%, rgba(255, 228, 220, .22) 25%, transparent 60%);
    mix-blend-mode: screen;
    animation: skBreath 9s ease-in-out infinite;
}
/* лучи света от солнца слева */
.sk-rays {
    left: 2%; top: 36%;
    width: 90%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .16) 0deg 4deg, transparent 4deg 16deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 60%);
            mask-image: radial-gradient(circle, #000 0%, transparent 60%);
    mix-blend-mode: screen;
    animation: skRays 120s linear infinite;
}

/* ===== ОБА ===== */
/* дымка у подножия горы медленно плывёт (одна бесшовная текстура едет по кругу) */
.sk-mist {
    left: 0; top: 41%;
    width: 100%;
    height: 18%;
    overflow: hidden;
    opacity: .4;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 65%, transparent);
            mask-image: linear-gradient(180deg, transparent, #000 35%, #000 65%, transparent);
}
.sk-mist::before {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 200%;
    height: 100%;
    background: var(--asset-fx-smoke, url("../img/fx-smoke.webp")) 0 0 / 50% 100% repeat-x;
    animation: skDrift 140s linear infinite;
}
.scene__world--hell .sk-mist { opacity: .22; filter: hue-rotate(200deg) brightness(.8); }
@keyframes skBreath { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.97); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } }
@keyframes skFlicker { 0% { opacity: .65; } 40% { opacity: 1; } 55% { opacity: .8; } 100% { opacity: .95; } }
@keyframes skShimmer { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scaleX(.94); } 50% { opacity: 1; transform: translate(-50%, -50%) scaleX(1.06); } }
@keyframes skRays { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes skDrift { to { transform: translateX(-50%); } }

/* Лёгкий фон (с 16.10.2026): на экране, который выше, чем шире (телефон, планшет «стоя»), видна только середина
   картинки — не больше 46 % её ширины (параллакс ±14 px — с запасом). Грузится середина (50 % ширины, вся высота,
   те же пиксели, WebP): bg-hell-m.webp (ночь), bg-heaven-m.webp (день) — с 30.10.2026 сакура: 0,55 → 0,15 МБ и 0,46 → 0,11.
   Она ложится ровно на свои 50 %, края картинки за экраном пустые. Тот же порог — sceneSrc() в fx.js.
   С 30.10.2026 (фоны владельца: ворота тории справа, на 63…77 % ширины) кусок — не середина, а 45…95 %, и весь фон со
   слоями сдвинут на 20 % влево: посередине «стоячего» экрана — ворота (иначе на телефоне было бы одно небо) */
@media (max-aspect-ratio: 17 / 20) {
    .scene__world--hell   { --img: var(--asset-bg-hell-m, url("../img/bg-hell-m.webp")); }
    .scene__world--heaven { --img: var(--asset-bg-heaven-m, url("../img/bg-heaven-m.webp")); }
    .scene__zoom { inset: 0 20% 0 -20%; }
    .scene__img { background-size: 50% 100%; background-position: 90% 0; }
}
.scene__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Дымка / облака внизу */
.scene__fog {
    position: absolute;
    left: -50%;
    width: 200%;
    bottom: -6vh;
    height: 38vh;
    z-index: 4;
    background:
        radial-gradient(18% 60% at 10% 70%, rgba(var(--fog-color), .55), transparent 70%),
        radial-gradient(22% 50% at 32% 80%, rgba(var(--fog-color), .45), transparent 70%),
        radial-gradient(16% 60% at 55% 75%, rgba(var(--fog-color), .5), transparent 70%),
        radial-gradient(24% 55% at 78% 85%, rgba(var(--fog-color), .45), transparent 70%),
        radial-gradient(14% 50% at 95% 70%, rgba(var(--fog-color), .5), transparent 70%);
    animation: drift 60s linear infinite;
}
.scene__fog--front {
    z-index: 5;
    height: 26vh;
    opacity: .7;
    animation-duration: 38s;
    animation-direction: reverse;
    background:
        radial-gradient(20% 60% at 20% 90%, rgba(var(--fog-hi), .22), transparent 70%),
        radial-gradient(18% 50% at 60% 95%, rgba(var(--fog-color), .5), transparent 70%),
        radial-gradient(24% 60% at 88% 90%, rgba(var(--fog-hi), .18), transparent 70%);
}
:root[data-theme="heaven"] .scene__fog { opacity: .95; }
:root[data-theme="heaven"] .scene__fog--front { opacity: .85; }

.scene__vignette {
    position: absolute;
    inset: 0;
    z-index: 6;
}
:root[data-theme="hell"] .scene__vignette {
    background:
        radial-gradient(120% 90% at 50% 38%, transparent 50%, rgba(5, 3, 15, .65) 100%),
        linear-gradient(180deg, rgba(8, 6, 20, .35) 0%, transparent 14%, transparent 78%, rgba(13, 10, 28, .65) 100%);
}
:root[data-theme="heaven"] .scene__vignette {
    background:
        radial-gradient(120% 90% at 50% 40%, transparent 58%, rgba(160, 60, 100, .18) 100%),
        linear-gradient(180deg, rgba(255, 245, 247, .35) 0%, transparent 14%);
}

/* ---------- 7. Панели ---------- */
.panel {
    position: relative;
    padding: clamp(14px, 2vh, 20px) clamp(14px, 1.2vw, 20px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
            backdrop-filter: blur(10px) saturate(1.2);
    transition: border-color .4s ease, background .6s ease, border-radius .6s var(--ease-out);
    opacity: 0;
    animation: panelIn .9s var(--ease-out) forwards;
    animation-delay: var(--d, .9s);
}
/* Верхний край панели — светящийся «карниз», по нему ходит аватар */
.panel::after {
    content: "";
    position: absolute;
    left: 10px; right: 10px; top: -1px;
    height: var(--ledge-h);
    border-radius: 3px;
    background: var(--ledge);
    box-shadow: var(--ledge-glow);
    pointer-events: none;
}
:root[data-theme="hell"] .panel::after { animation: ledgeHeat 5s ease-in-out infinite; }
/* Пятно света за курсором */
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -50%), var(--panel-spot), transparent 70%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.panel:hover::before { opacity: 1; }
.panel.is-lit::after { filter: brightness(1.8); }

.col--left .panel:nth-child(1)  { --d: .8s; }
.col--left .panel:nth-child(2)  { --d: .95s; }
.col--right .panel:nth-child(1) { --d: .85s; }
.col--right .panel:nth-child(2) { --d: 1s; }
.col--left .panel  { --from: -40px; }
.col--right .panel { --from: 40px; }

.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(20px, 2.4vh, 25px);
    line-height: 1.1;
    letter-spacing: .01em;
    margin-bottom: clamp(8px, 1.4vh, 14px);
}
.panel__more { font-size: 13px; color: var(--link); white-space: nowrap; }
.panel__more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 9. Кнопки ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    padding: 0 26px;
    border-radius: var(--panel-radius);
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
    transition: transform .25s var(--ease-out), box-shadow .3s ease, filter .3s ease;
}
:root[data-theme="heaven"] .btn { border-radius: 999px; }
.btn--small { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--primary {
    color: var(--btn-text);
    background: var(--btn-bg);
    box-shadow: var(--btn-glow);
}
/* Огонь / сияние, поднимающееся при наведении */
.btn--primary::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateY(100%);
    transition: transform .5s var(--ease-out);
}
:root[data-theme="hell"] .btn--primary::before { background: linear-gradient(0deg, #ffc2c8, #ff3b52 45%, rgba(255, 20, 50, 0)); }
:root[data-theme="heaven"] .btn--primary::before { background: linear-gradient(0deg, #ffffff, #fff4c8 55%, rgba(255, 255, 255, 0)); }
.btn--primary:hover::before { transform: translateY(35%); }
/* Блик (едет через transform: 475 % своей ширины = 190 % ширины кнопки) */
.btn--primary::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: translateX(0) skewX(-20deg);
    animation: shine 5s ease-in-out infinite;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn--ghost {
    color: var(--text);
    border: 1px solid var(--ghost-border);
    background: var(--ghost-bg);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--accent-hot); box-shadow: 0 0 22px -4px var(--accent); }

/* Кнопка «YouTube» у записи стрима, залитой на канал «Fasoollka Archive» (с 11.10.2026; «Летопись», игры, главная).
   Отдельная ссылка рядом с записью (не внутри неё); знак YouTube — всегда своего красного */
.ytbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--ghost-bg);
    color: var(--text-soft);
    font: 700 13px / 1 var(--ui);
    white-space: nowrap;
    transition: border-color .2s ease, color .2s ease, box-shadow .3s ease;
}
:root[data-theme="heaven"] .ytbtn { border-radius: 999px; }
.ytbtn .ico { font-size: 18px; color: #ff0000; }
.ytbtn:hover, .ytbtn:focus-visible { border-color: #ff2b3a; color: var(--text); box-shadow: 0 6px 20px -10px rgba(255, 0, 0, .8); outline: none; }

/* точка «в эфире»: от неё расходится круг. Круг — ::before (растёт через transform),
   сама точка ещё раз рисуется сверху ::after, поэтому круг её не перекрывает */
.live-dot {
    position: relative;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.live-dot::before,
.live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.live-dot::before { background: var(--accent); opacity: 0; animation: livePing 1.8s ease-out infinite; }
.live-dot::after { background: inherit; }
@keyframes livePing { 0% { opacity: 1; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(3); } }
.btn--primary .live-dot { background: var(--btn-text); }

/* ---------- 16. Живой аватар (живёт на краю таймера и летает) ----------
   .avatar — рамка ровно по фигуре (над ней пузырь с фразой), холст с моделькой и крыльями больше рамки;
   размеры и положение задаёт home.js. С 24.10.2026 щелчки проходят сквозь аватар (pointer-events: none):
   погладить и взять его home.js ловит сам — по рамке (см. «Погладить или перетащить»). */
.avatar {
    position: fixed;
    left: 0; top: 0;
    z-index: 20;
    width: 90px;
    height: 140px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .6s ease;
    will-change: transform;
}
.avatar.is-ready { opacity: 1; }
/* взяли, подержав над ссылкой, — чуть светлеет: «держу» */
.avatar.is-held .avatar__cv { filter: var(--avatar-glow) brightness(1.18); }

/* кнопка «Спрятать / Вернуть аватар» — слева от переключателя миров (главная) */
.avatoggle {
    position: fixed;
    top: calc(clamp(10px, 1.8vh, 20px) + 8px);
    right: calc(clamp(10px, 1.4vw, 24px) + 64px);
    z-index: 25;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid var(--panel-border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    opacity: 0;
    animation: dropIn .9s var(--ease-out) .7s forwards;
}
.is-back .avatoggle { animation-delay: .15s; }
.avatoggle img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 20%; transition: filter .3s ease, opacity .3s ease; }
.avatoggle:hover { border-color: var(--accent); }
.avatoggle:focus-visible { outline-offset: 4px; }
/* спрятан — бледный портрет и косая черта */
.avatoggle.is-off img { filter: grayscale(1); opacity: .55; }
.avatoggle__off {
    position: absolute;
    left: 50%; top: 50%;
    width: 2px; height: 120%;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 1.5px var(--surface);
    transform: translate(-50%, -50%) rotate(45deg) scaleY(0);
    transition: transform .3s var(--ease-out);
}
.avatoggle.is-off .avatoggle__off { transform: translate(-50%, -50%) rotate(45deg) scaleY(1); }
.avatoggle__label {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    padding: 6px 11px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .35s var(--ease-out);
}
.avatoggle:is(:hover, :focus-visible) .avatoggle__label { opacity: 1; transform: none; }
/* холст: поворачивается к направлению ходьбы и полёта (rotateY) — это тоже задаёт home.js */
.avatar__cv {
    position: absolute;
    pointer-events: none;
    filter: var(--avatar-glow);
    will-change: transform;
}

.avatar__bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    max-width: 220px;
    width: max-content;
    padding: 8px 13px;
    border-radius: 14px;
    background: var(--bubble-bg);
    border: 1.5px solid var(--bubble-border);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5), 0 0 16px -4px var(--bubble-border);
    transform: translateX(calc(-50% + var(--shift, 0px))) translateY(6px) scale(.7);
    transform-origin: 50% 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .35s var(--ease-out);
}
.avatar__bubble::after {
    content: "";
    position: absolute;
    left: calc(50% - var(--shift, 0px));
    top: 100%;
    width: 12px; height: 12px;
    background: var(--bubble-bg);
    border-right: 1.5px solid var(--bubble-border);
    border-bottom: 1.5px solid var(--bubble-border);
    transform: translate(-50%, -6px) rotate(45deg);
}
.avatar__bubble.is-on { opacity: 1; transform: translateX(calc(-50% + var(--shift, 0px))) translateY(0) scale(1); }
/* у верхнего края экрана пузырь с фразой показывается под аватаром */
.avatar__bubble.is-below { bottom: auto; top: calc(100% + 8px); transform-origin: 50% 0; }
.avatar__bubble.is-below::after { top: auto; bottom: 100%; transform: translate(-50%, 6px) rotate(225deg); }
/* ---------- 17. Слои эффектов поверх сайта ---------- */
.front-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    pointer-events: none;
}
.flash {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    opacity: 0;
}
:root[data-theme="hell"] .flash { background: radial-gradient(120% 100% at 50% 20%, rgba(120, 90, 200, .5), rgba(10, 6, 30, .4)); }
:root[data-theme="heaven"] .flash { background: radial-gradient(120% 100% at 50% 30%, rgba(255, 255, 255, .95), rgba(255, 220, 232, .6)); }
.flash.is-on { animation: flash .7s ease-out; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 50;
    padding: 11px 18px;
    border-radius: 12px;
    background: var(--bubble-bg);
    border: 1px solid var(--bubble-border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Плавная смена темы (круг от переключателя) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }
/* Сам круг и есть переход: в момент смены мира «кругом» переходы CSS выключены (fx.js, applyTheme;
   15.10.2026). Иначе ~95 переходов цвета и скруглений (цвет текста у body наследуют все элементы,
   у панелей — скругление с размытием фона) каждый кадр пересчитывали стили и перерисовывали страницу,
   пока растёт круг, — смена мира подлагивала */
:root.is-switching,
:root.is-switching *,
:root.is-switching *::before,
:root.is-switching *::after { transition: none !important; }

/* ---------- 18. Экран загрузки ---------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: var(--bg);
    transition: opacity .8s ease, visibility .8s;
}
:root[data-theme="hell"] .preloader { background: radial-gradient(60% 50% at 50% 50%, #2a1f4f, #0d0a1c 70%); }
:root[data-theme="heaven"] .preloader { background: radial-gradient(60% 50% at 50% 50%, #ffffff, #ffe3ea 70%); }
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader[hidden] { display: none; }     /* после исчезновения убирается совсем (home.js) — его анимация больше не крутится */
.preloader__mark {
    font-family: var(--wm-font);
    font-weight: var(--wm-weight);
    font-size: clamp(44px, 8vw, 88px);
    line-height: 1;
    color: transparent;
    background: var(--wm-fill);
    background-size: 100% 300%;
    -webkit-background-clip: text;
            background-clip: text;
    animation: fireRise 2s linear infinite;
}
:root[data-theme="heaven"] .preloader__mark { background-size: 300% 100%; animation: goldShine 3s ease-in-out infinite; }
.preloader__bar { width: 220px; height: 2px; border-radius: 2px; background: rgba(127, 127, 127, .25); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--ledge); box-shadow: var(--ledge-glow); transition: width .3s ease; }
.preloader__text { font-size: 14px; color: var(--text-faint); }
.preloader__text span::after { content: "…"; }

/* Пока идёт загрузка, вступительные анимации стоят на паузе */
:root:not(.is-loaded) :is(.panel, .sigil, .gate) { animation-play-state: paused; }

/* Повторный заход в этой вкладке (с 10.10.2026; класс is-back ставит скрипт в <head>, layout_head):
   без экрана загрузки, панели и переключатель появляются почти сразу (тот же порядок, короче) */
.is-back .preloader { display: none; }
.is-back .panel { animation-duration: .5s; animation-delay: max(0s, calc(var(--d, .9s) - .7s)); }
.is-back .realm { animation-delay: .1s; }

/* ---------- 19. Анимации ---------- */
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.profile__ava::before { animation-name: spinPlain; }
@keyframes spinPlain { to { transform: rotate(360deg); } }

@keyframes fireRise { from { background-position: 50% 0%; } to { background-position: 50% 150%; } }
@keyframes goldShine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(50%); } }
@keyframes ledgeHeat { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }   /* только прозрачность — без перерисовки панели */
@keyframes panelIn { from { opacity: 0; transform: translateX(var(--from, 0)) translateY(var(--fromY, 14px)); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes shine { 0%, 70% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(475%) skewX(-20deg); } }
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 var(--accent); }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes tick { from { transform: translateY(-30%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes lavaFlow { from { background-position: 0 0, 0 0; } to { background-position: 40px 0, 0 0; } }
@keyframes goldFlow { from { background-position: 200% 0, 0 0; } to { background-position: -100% 0, 0 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 20px)); } }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- 24. Облегчённый режим для слабых компьютеров (включается сам) ----------
   fx.js всё время следит за частотой кадров и, если не тянет, понижает уровень:
   .is-lite — без размытия панелей, без самых тяжёлых слоёв фона, частиц вдвое меньше;
   .is-min (вместе с .is-lite) — фон почти неподвижный, частиц вчетверо меньше.
   Уровень можно задать и вручную: адрес ?fx=0 (всё) … ?fx=3 (минимум) */
.is-lite :is(.panel, .chatline, .btn--ghost, .theme-switch, .modal, .menu-overlay, .subhead__back, .subnav, .field input, .field select) { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root.is-lite[data-theme="hell"] { --panel-bg: linear-gradient(180deg, rgba(30, 23, 58, .92), rgba(16, 12, 34, .9)); }
:root.is-lite[data-theme="heaven"] { --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 246, 249, .88)); }
/* на слабых компьютерах — без самых тяжёлых слоёв фона */
.is-lite :is(.sk-mist, .sk-rays, .sk-water) { display: none; }
.is-min .scene__zoom > :not(.scene__img) { display: none; }
.is-min .scene__fog { animation: none; }
.is-min .panel::after { animation: none; }

/* ---------- 25. Для тех, у кого отключены анимации в системе ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   26. Общие детали: значки, переключатель миров, окна, карточки ссылок
   ========================================================================== */
.ico { width: 1em; height: 1em; flex-shrink: 0; fill: currentColor; }

/* ---------- Переключатель День / Ночь (до 30.10.2026 — Ад / Рай): маленький значок того мира, куда ведёт.
   Ночью — солнце (лучи вращаются), днём — месяц со звёздочками ---------- */
.realm {
    position: fixed;
    top: clamp(10px, 1.8vh, 20px);
    right: clamp(10px, 1.4vw, 24px);
    z-index: 25;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    opacity: 0;
    animation: dropIn .9s var(--ease-out) .5s forwards;
}
.realm--inline { position: relative; top: auto; right: auto; width: 46px; height: 46px; animation: none; opacity: 1; flex-shrink: 0; }
.realm__icon { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s var(--ease-out); }
.realm:hover .realm__icon { transform: scale(1.12); }
.realm:active .realm__icon { transform: scale(.92); }
/* фон другого мира ещё грузится (fx.js, prepWorld) — значок мигает, круг смены мира начнётся, как только загрузится */
.realm.is-busy .realm__icon { animation: realmBusy .8s ease-in-out infinite alternate; }
@keyframes realmBusy { to { opacity: .4; transform: scale(.9); } }
/* детали значка — картинки одной сетки 64×64 друг на друге; точки вращения — в процентах этой сетки */
.realm__icon > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.realm:focus-visible { outline-offset: 5px; border-radius: 50%; }
.realm__label {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    padding: 6px 11px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transform: translate(8px, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .35s var(--ease-out);
}
.realm:hover .realm__label, .realm:focus-visible .realm__label { opacity: 1; transform: translate(0, -50%); }
/* на внутренних страницах кнопка в правом углу — подпись под ней прижата к правому краю
   (по центру она вылезала за экран, и на телефоне страница прокручивалась вбок) */
.realm--inline .realm__label { right: 0; left: auto; top: calc(100% + 10px); transform: translate(0, -6px); }
.realm--inline:hover .realm__label, .realm--inline:focus-visible .realm__label { transform: translate(0, 0); }

/* путь в день (с 30.10.2026): солнце, лучи медленно вращаются */
.rs-glow { transform-origin: 50% 50%; animation: realmGlow 3s ease-in-out infinite; }
.rs-glow circle { fill: rgba(255, 214, 120, .35); }
.rs-rays { transform-origin: 50% 50%; animation: spinPlain 16s linear infinite; }
.realm:hover .rs-rays { animation-duration: 4s; }
.rs-rays path { fill: none; stroke: #ffb547; stroke-width: 3.2; stroke-linecap: round; }
.rs-disc circle { fill: #ffd56b; stroke: #f39a2e; stroke-width: 1.6; filter: drop-shadow(0 0 4px rgba(255, 200, 90, .9)); }
/* путь в ночь: месяц с двумя звёздочками */
.rm-glow { transform-origin: 50% 50%; animation: realmGlow 3.4s ease-in-out infinite; }
.rm-glow circle { fill: rgba(255, 143, 171, .28); }
.rm-moon { transform-origin: 50% 50%; animation: moonRock 4s ease-in-out infinite; }
.rm-moon path { fill: #fff1d6; stroke: #2b1d2a; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(255, 160, 190, .9)); }
.rm-star { animation: realmTwinkle 2.6s ease-in-out infinite; }
.rm-star path { fill: #ff6f91; }
.rm-star--1 { transform-origin: 75% 25%; }
.rm-star--2 { transform-origin: 84% 52%; animation-delay: -1.3s; }
@keyframes moonRock { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes realmGlow { 0%, 100% { opacity: .6; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes realmTwinkle { 0%, 100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- Окна (О себе, Донат, Стрим) ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: clamp(10px, 3vh, 32px) 16px;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
}
.modal.is-open { opacity: 1; visibility: visible; }
/* закрытое окно убрано совсем (раньше display: grid перебивал атрибут hidden, и анимации
   внутри невидимых окон работали каждый кадр) */
.modal[hidden] { display: none; }
.modal__dialog {
    position: relative;
    width: min(880px, 100%);
    max-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    padding: clamp(20px, 3vh, 34px) clamp(18px, 3vw, 38px);
    border-radius: calc(var(--panel-radius) * 1.2);
    background: var(--surface);
    border: 1px solid var(--panel-border);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .8), var(--ledge-glow);
    transform: translateY(26px) scale(.97);
    transition: transform .5s var(--ease-out);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}
:root[data-theme="hell"] .modal__dialog { background: radial-gradient(120% 80% at 50% 0%, #2a070c, var(--surface) 60%); }
:root[data-theme="heaven"] .modal__dialog { background: radial-gradient(120% 80% at 50% 0%, #ffffff, var(--surface) 60%); }
.modal.is-open .modal__dialog { transform: none; }
.modal__dialog::before {
    content: "";
    position: absolute;
    left: 24px; right: 24px; top: 0;
    height: var(--ledge-h);
    background: var(--ledge);
    box-shadow: var(--ledge-glow);
    border-radius: 3px;
}
.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: var(--ghost-bg);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: transform .3s var(--ease-out), border-color .2s ease;
}
.modal__close:hover { transform: rotate(90deg); border-color: var(--accent-hot); }
.modal__title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(30px, 4.4vh, 42px);
    line-height: 1.05;
    margin-bottom: 6px;
    padding-right: 44px;
}
.modal__lead { color: var(--text-soft); max-width: 60ch; margin-bottom: clamp(16px, 2.4vh, 24px); }
.modal__section + .modal__section { margin-top: clamp(20px, 3vh, 30px); }
.modal__h {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.1;
    margin-bottom: 12px;
}
.modal__h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- Карточки ссылок ---------- */
.links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: 10px;
}
.linkcard {
    --brand: var(--accent);
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: calc(var(--panel-radius) * .8);
    border: 1px solid var(--line);
    background: var(--ghost-bg);
    transition: border-color .25s ease, transform .3s var(--ease-out), box-shadow .3s ease, background .25s ease;
}
.linkcard:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 30px -14px var(--brand); }
.linkcard__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 22px;
}
.linkcard__icon--light { color: #111; }
/* светлые значки (с 10.10.2026 здесь, а не в home.css: ими пользуется и страница для рекламодателей) */
.linkcard__icon--tiktok { background: #111 !important; }
.linkcard__icon--wtv, .linkcard__icon--memealerts, .linkcard__icon--kick { color: #111; }
.linkcard__text { min-width: 0; display: flex; flex-direction: column; }
.linkcard__name { font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.linkcard__note { font-size: 12.5px; color: var(--text-faint); line-height: 1.3; }
.linkcard__go { color: var(--text-faint); font-size: 16px; transition: color .2s ease, transform .3s var(--ease-out); }
.linkcard:hover .linkcard__go { color: var(--brand); transform: translate(2px, -2px); }

/* ---------- Шапка всех страниц (с 30.10.2026 — по макету темы «Сакура», и на главной) ----------
   Слева логотип, справа — ряд разделов, «В эфире» и переключатель «День / Ночь». Не хватает места — ряд разделов
   сжимается и листается (колонка 0…свой размер) */
.subhead {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: clamp(14px, 2.4vh, 24px) clamp(16px, 3vw, 48px) 0;
}
.subhead__logo { display: flex; flex-direction: column; justify-self: start; color: var(--text); line-height: 1; white-space: nowrap; }
.subhead__logo-t { font: 800 clamp(20px, 1.7vw, 26px)/1 var(--display); letter-spacing: .02em; }
.subhead__logo-t span { color: var(--accent); }
.subhead__logo-s { margin-top: 6px; font: 700 11px/1 var(--ui); letter-spacing: .32em; color: var(--text-faint); }
.subhead__logo:hover .subhead__logo-t span { color: var(--accent-hot); }
.subhead .subnav { justify-self: end; max-width: 100%; /* не шире своей колонки: иначе ряд наезжал на логотип; не помещается — листается */ }
.subhead__end { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; }
/* «День / Ночь» — таблетка из двух половин, выделена текущая (с 30.10.2026) */
.realm--pill {
    position: relative; top: auto; right: auto;
    display: inline-flex; width: auto; height: auto; padding: 4px; gap: 2px;
    border-radius: 14px; border: 1px solid var(--ghost-border); background: var(--ghost-bg);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 1; animation: none;
}
.realm__opt { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; font: 700 13px/1 var(--ui); color: var(--text-soft); white-space: nowrap; transition: background-color .25s ease, color .25s ease; }
.realm__opt .ico { font-size: 15px; }
:root[data-theme="heaven"] .realm__opt--day, :root[data-theme="hell"] .realm__opt--night { color: #fff; background: var(--btn-bg); box-shadow: var(--btn-glow); }
.realm--pill:hover .realm__opt:not(:is(:root[data-theme="heaven"] .realm__opt--day, :root[data-theme="hell"] .realm__opt--night)) { color: var(--text); }
.realm--pill:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 3px; border-radius: 14px; }
/* «В эфире» (с 15.10.2026): идёт стрим — плашка рядом с переключателем миров, ведёт на главную с плеером */
.subhead__live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 13px 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 46, 77, .55);
    background: color-mix(in srgb, #ff2e4d 14%, var(--ghost-bg));
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color .2s ease, transform .3s var(--ease-out);
}
.subhead__live[hidden] { display: none; }
.subhead__live:hover, .subhead__live:focus-visible { border-color: #ff2e4d; transform: translateY(-1px); outline: none; }
.subhead__live .live-dot, .subhead__live .live-dot::before { background: #ff2e4d; }
.subhead__live-n { font-variant-numeric: tabular-nums; color: var(--text-soft); }
/* Разделы сайта (с 10.10.2026, layout_subhead): одна «таблетка» с размытием фона — не у каждой
   ссылки своё (размытие поверх живого фона дорого); не помещается — листается вбок (пальцем,
   колесом мыши — fx.js), края гаснут маской, открытый раздел — выделен и прокручен в середину */
.subnav {
    grid-column: 2;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid var(--ghost-border);
    background: var(--ghost-bg);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
}
.subnav__list {
    position: relative;
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 3px;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-radius: inherit;
}
.subnav__list::-webkit-scrollbar { display: none; }
.subnav.is-l .subnav__list { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px); mask-image: linear-gradient(90deg, transparent, #000 32px); }
.subnav.is-r .subnav__list { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.subnav.is-l.is-r .subnav__list { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.subnav__list > li { flex-shrink: 0; }
.subnav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-soft);
    transition: color .2s ease, background-color .25s ease;
}
.subnav__link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 9%, transparent); }
.subnav__link:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: -2px; }
.subnav__link.is-on { color: var(--btn-text); background: var(--btn-bg); }
.subnav__link .ico { font-size: 12px; opacity: .65; }
/* «Предложка» (9.11.2026): у кнопки — уголок вниз, нажатие открывает выбор .subpop из двух ссылок (место ставит fx.js) */
.subnav__link[data-pop]::after, .site-nav a[data-pop]::after {   /* .site-nav — шапка «Всех записей» */
    content: "";
    width: 6px; height: 6px;
    margin: -3px 0 0 1px;
    border: solid currentColor; border-width: 0 1.6px 1.6px 0;
    transform: rotate(45deg);
    opacity: .7;
    transition: transform .25s ease, margin .25s ease;
}
.site-nav a[data-pop] { gap: 7px; }
.subnav__link[data-pop][aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 9%, transparent); }
.site-nav a[data-pop][aria-expanded="true"] { background: var(--chip); }
:is(.subnav__link, .site-nav a)[data-pop][aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
.subpop {
    position: absolute;
    z-index: 30;
    display: grid;
    gap: 4px;
    width: min(300px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--ghost-border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 1.4rem 3rem -1rem rgba(60, 20, 40, .45);
    animation: subpopIn .22s var(--ease-out) both;
}
.subpop[hidden] { display: none; }
/* пока выбор открыт, шапка — над содержимым страницы (у кинотеатра и др. свой z-index 10 ниже по странице), но под окнами (60) */
.subhead:has(> .subpop:not([hidden])) { z-index: 47; }
@keyframes subpopIn { from { opacity: 0; transform: translateY(-6px); } }
.subpop__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--text);
    transition: background-color .2s ease;
}
.subpop__item:hover, .subpop__item:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.subpop__item:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: -2px; }
.subpop__ico {
    flex: none;
    display: grid; place-items: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--btn-bg);
    color: var(--btn-text, #fff);
    font-size: 16px;
}
.subpop__t { display: grid; gap: 2px; min-width: 0; }
.subpop__t b { font-weight: 700; font-size: 14px; line-height: 1.25; }
.subpop__t small { font-size: 12.5px; line-height: 1.3; color: var(--text-soft); }
/* телефон и узкое окно: «На главную» и переключатель — первой строкой, разделы — второй, по середине
   (не помещаются — во всю ширину и листаются) */
@media (max-width: 900px) {
    .subhead { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
    .subhead .subnav { justify-self: stretch; max-width: none; }
    .subhead__end { grid-column: 2; }
    .subnav { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; }
}
@media (max-width: 420px) {
    .subhead__live-n { display: none; }
}

/* ---------- Нижняя панель на телефоне (с 15.10.2026, layout_tabbar) ----------
   Главная, кинотеатр, игры, летопись, рейтинг и переключатель миров — под большим пальцем. Верхний переключатель
   на телефоне спрятан (он висел в углу поверх содержимого); круг смены мира расходится от кнопки панели (fx.js).
   Фон панели — почти сплошной, без размытия: размытие поверх живого фона пересчитывалось бы каждый кадр */
.tabbar { display: none; }
:root[data-theme="hell"] { --tab-bg: rgba(20, 15, 40, .95); --tab-on: #ff8fab; --tab-glow: rgba(255, 111, 145, .55); }
:root[data-theme="heaven"] { --tab-bg: rgba(255, 252, 253, .96); --tab-on: #e23d66; --tab-glow: rgba(255, 143, 171, .6); }
@media (max-width: 760px) {
    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
        background: var(--tab-bg);
        border-top: 1px solid var(--panel-border);
        box-shadow: 0 -12px 28px -14px rgba(0, 0, 0, .7);
    }
    .tabbar__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: 52px;
        padding: 4px 2px;
        border: 0;
        border-radius: 12px;
        background: none;
        color: var(--text-soft);
        font: 600 12px/1.1 var(--ui);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color .2s ease, background-color .2s ease;
    }
    .tabbar__item .ico { font-size: 22px; }
    .tabbar__t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tabbar__item:active { background: color-mix(in srgb, var(--text) 9%, transparent); }
    .tabbar__item:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: -2px; }
    .tabbar__item.is-on { color: var(--tab-on); }
    .tabbar__item.is-on::before {
        content: "";
        position: absolute;
        top: -5px;
        left: 26%;
        right: 26%;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--tab-on);
        box-shadow: 0 0 10px var(--tab-glow);
    }
    .tabbar__realm .ico { color: var(--accent-hot); filter: drop-shadow(0 0 6px var(--tab-glow)); }
    .tabbar__realm.is-busy .ico { animation: tabBusy .8s ease-in-out infinite alternate; }
    @keyframes tabBusy { to { opacity: .35; transform: scale(.85); } }
    /* верхний переключатель — в панели */
    #themeSwitch { display: none; }
    /* содержимое не уходит под панель; сообщения — над ней */
    body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media print { .tabbar { display: none !important; } body { padding-bottom: 0 !important; } }
.page-title {
    font-family: var(--wm-font);
    font-weight: var(--wm-weight);
    line-height: .95;
    color: transparent;
    background: var(--wm-fill);
    -webkit-background-clip: text;
            background-clip: text;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--wm-glow) 55%, transparent));
}
:root[data-theme="hell"] .page-title {
    background-image: linear-gradient(0deg, #b0101e 0%, #ff3b3b 26%, #ffd0c4 46%, #ff6a5a 62%, #e01828 80%, #b0101e 100%);
    background-size: 100% 300%;
    animation: fireRise 3s linear infinite;
    filter: drop-shadow(0 3px 0 rgba(20, 0, 2, .85)) drop-shadow(0 0 22px rgba(255, 0, 30, .6));
}
:root[data-theme="heaven"] .page-title { filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .9)) drop-shadow(0 0 20px rgba(255, 236, 170, .9)); }
:root[data-theme="heaven"] .page-title { background-size: 300% 100%; animation: goldShine 6s ease-in-out infinite; }

/* ---------- Кнопки-фильтры и поля ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--ghost-bg);
    color: var(--text-soft);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .25s ease, box-shadow .25s ease;
}
.chip:hover { color: var(--text); border-color: var(--ghost-border); }
.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"] { color: var(--btn-text); background: var(--btn-bg); border-color: transparent; box-shadow: var(--btn-glow); }
.chip__n { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.field {
    position: relative;
    display: flex;
    align-items: center;
}
.field .ico { position: absolute; z-index: 2; left: 15px; font-size: 18px; color: var(--text-faint); pointer-events: none; }
.field input, .field select {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 44px;
    border-radius: 999px;
    border: 1px solid var(--ghost-border);
    background: var(--ghost-bg);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field select { padding-left: 16px; appearance: none; cursor: pointer; }
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.empty {
    padding: 24px;
    text-align: center;
    color: var(--text-soft);
}
.muted { color: var(--text-faint); }

/* ---------- Аватарка зрителя (с 15.10.2026): картинка с Twitch в кружке ----------
   Под картинкой — буква ника: пока картинка грузится, если её нет или она не загрузилась (onerror убирает <img>).
   Размер — --ava (по умолчанию 28px). Разметка — ava_html() в includes/avatars.php и FX.ava() в fx.js */
.ava {
    --ava: 28px;
    position: relative;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: var(--ava);
    height: var(--ava);
    border-radius: 50%;
    overflow: hidden;
    background: var(--chip-bg);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--text-soft);
    font-size: calc(var(--ava) * .46);
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
.ava b { font-weight: inherit; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Шапка внутренних страниц: надпись и крупный заголовок на фоне (с 30.10.2026, по макету темы «Сакура») ----------
   Кинотеатр, игры. Слева — надпись (k), заголовок Unbounded (последнее слово — em, цветом), строка о странице;
   справа — кнопки. Фон страницы просвечивает, слева под текстом — мягкая подложка цвета мира */
.pagehero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    flex-wrap: wrap;
    padding: clamp(28px, 6vh, 70px) clamp(16px, 3vw, 48px) clamp(18px, 3vh, 30px);
}
.pagehero::before {
    content: "";
    position: absolute;
    inset: -10px -60px 0;
    z-index: -1;
    background: radial-gradient(closest-side at 32% 55%, color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 45%, transparent) 55%, transparent);
    pointer-events: none;
}
.pagehero__k { font: 700 13px/1.3 var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.pagehero__t { margin: 8px 0 12px; font: 800 clamp(36px, 4.6vw, 64px)/1.02 var(--display); letter-spacing: -.01em; color: var(--text); }
.pagehero__t em { font-style: normal; color: var(--accent); }
:root[data-theme="hell"] .pagehero__t em { text-shadow: 0 0 30px rgba(255, 111, 145, .55); }
.pagehero .pagehero__lead { max-width: 640px; margin: 0; font-size: 16px; color: var(--text-soft); text-align: left; }
.pagehero__lead b { color: var(--text); }
.pagehero__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.pagehero__acts .btn { height: 48px; padding: 0 22px; border-radius: 16px; font-weight: 800; }
@media (max-width: 600px) {
    .pagehero { padding-top: 20px; }
    .pagehero__acts { width: 100%; }
    .pagehero__acts .btn { flex: 1; justify-content: center; }
}
/* Тема «Сакура» (с 30.10.2026): крупные заголовки остальных страниц — как в макете (Unbounded, без курсива, золота и неона) */
:is(.chron__title, .statp__title, .rating__title, .cosp__title, .page-title) {
    font-family: var(--display) !important; font-style: normal !important; font-weight: 800 !important; letter-spacing: -.01em;
    color: var(--text) !important; background: none !important; -webkit-text-fill-color: currentColor !important;
    filter: none !important; animation: none !important; text-shadow: none !important;
}
:root[data-theme="hell"] :is(.chron__title, .statp__title, .rating__title, .cosp__title, .page-title) { text-shadow: 0 0 30px rgba(255, 111, 145, .35) !important; }
:is(.chron__kicker, .statp__kicker, .cosp__kicker) { color: var(--accent) !important; }
:root .chron__hero { background: var(--panel-bg) !important; box-shadow: var(--panel-shadow) !important; border: 1px solid var(--panel-border); }
:root .chron__seal svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)) !important; }
:root :is(.chron__seal-line, .chron__seal-tick, .chron__seal-star) { stroke: var(--accent) !important; }
:root .chron__seal-year { fill: var(--text-soft) !important; }
:root .chron__seal-disc { fill: var(--surface) !important; stroke: var(--accent) !important; }
:root .chron__seal-glass { fill: var(--accent) !important; }
/* ==========================================================================
   Тема «Сакура» — общий вид всех страниц, 1 в 1 по макету (с 30.10.2026, варианты_дизайна\сакура):
   панели — светлое (днём) / тёмно-лиловое (ночью) стекло без светящегося карниза, кнопки и поля скруглены,
   шапка — логотип, ряд разделов таблеткой, «День / Ночь»; на телефоне — «гамбургер» и нижняя панель
   ========================================================================== */
:root[data-theme="heaven"] {
    --panel-bg: rgba(255, 255, 255, .74);
    --panel-border: rgba(255, 255, 255, .8);
    --panel-shadow: 0 1.4rem 3.2rem -2rem rgba(130, 45, 80, .45);
    --ghost-bg: rgba(255, 255, 255, .82);
    --ghost-border: rgba(255, 255, 255, .9);
    --btn-bg: linear-gradient(180deg, #ff6a8c 0%, #f4476f 100%);
    --btn-glow: 0 .7rem 1.6rem -.8rem rgba(240, 60, 105, .75);
    --accent: #ec3f68;
    --line: rgba(160, 60, 95, .14);
    --surface: #fffafc;
}
:root[data-theme="hell"] {
    --panel-bg: rgba(26, 20, 52, .74);
    --panel-border: rgba(255, 160, 195, .13);
    --panel-shadow: 0 1.4rem 3.2rem -1.8rem rgba(0, 0, 0, .8);
    --ghost-bg: rgba(28, 22, 54, .78);
    --ghost-border: rgba(255, 160, 195, .18);
    --btn-bg: linear-gradient(180deg, #ff7a9b 0%, #ff5c86 100%);
    --btn-glow: 0 .7rem 1.6rem -.8rem rgba(255, 90, 140, .8);
    --surface: #17122d;
}
.panel { border-radius: 24px; -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.panel::after { display: none; }
.btn { border-radius: 16px; font-weight: 800; }
:root[data-theme="heaven"] .btn { border-radius: 16px; }
.btn--primary::before { display: none; }
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 1rem 2rem -.9rem rgba(240, 60, 105, .85); }
.btn--ghost:hover { box-shadow: 0 .8rem 1.8rem -1rem color-mix(in srgb, var(--accent) 70%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.modal__dialog { border-radius: 28px; }
:root[data-theme="hell"] .modal__dialog { background: radial-gradient(120% 80% at 50% 0%, #2a2150, var(--surface) 60%); }
:root[data-theme="heaven"] .modal__dialog { background: #fffafc; }
.modal__dialog::before { display: none; }
.modal__title, .modal__h { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; }
.modal__title { font-size: clamp(26px, 3.6vh, 36px); }
.modal__h { font-size: 20px; }

/* экран загрузки: надпись как логотип */
.preloader__mark { font: 800 clamp(40px, 7vw, 76px)/1 var(--display); color: var(--text); background: none; -webkit-background-clip: border-box; background-clip: border-box; animation: preIn 1.6s ease-in-out infinite alternate; }
.preloader__mark span { color: var(--accent); }
:root[data-theme="heaven"] .preloader__mark { animation: preIn 1.6s ease-in-out infinite alternate; }
@keyframes preIn { from { opacity: .55; transform: scale(.98); } to { opacity: 1; transform: none; } }
.preloader__bar span { background: var(--btn-bg); box-shadow: none; }

/* шапка: размеры как в макете (таблетка разделов 48 px) */
.subhead { padding: clamp(14px, 2.6vh, 26px) clamp(16px, 3vw, 48px) 0; gap: 20px; }
.subhead__logo-t { font-size: clamp(22px, 1.75vw, 28px); letter-spacing: .01em; }
.subhead__logo-s { margin-top: 7px; font-size: 11px; letter-spacing: .42em; }
.subnav { border-color: var(--ghost-border); background: var(--ghost-bg); box-shadow: 0 .8rem 2rem -1.4rem rgba(120, 40, 70, .5); border-radius: 18px; }
.subnav__list { padding: 4px; gap: 4px; border-radius: 18px; }
.subnav__link { height: 38px; padding: 0 14px; border-radius: 13px; font-weight: 700; font-size: 14px; }
:root[data-theme="heaven"] .subnav__link.is-on { background: #2b1d2a; color: #fff; }
:root[data-theme="hell"] .subnav__link.is-on { background: var(--btn-bg); color: #fff; box-shadow: var(--btn-glow); }
.realm--pill { padding: 4px; border-radius: 18px; border-color: var(--ghost-border); background: var(--ghost-bg); box-shadow: 0 .8rem 2rem -1.4rem rgba(120, 40, 70, .5); }
.realm__opt { height: 38px; padding: 0 14px; border-radius: 13px; font-weight: 800; font-size: 14px; }
.subhead__end { gap: 12px; }
.subhead__menu { display: none; }
/* 9.11.2026: разделов 11 (добавлена «Предложка») — плотнее уже с 1600 px (было с 1240) */
@media (max-width: 1600px) {
    .subhead__logo-s { display: none; }
    .subnav__link { padding: 0 10px; font-size: 13.5px; }
}
@media (max-width: 1440px) {
    .subhead { gap: 14px; }
    .subnav__list { gap: 2px; }
    .subnav__link { padding: 0 8px; font-size: 13px; }
}
@media (max-width: 1100px) {
    .subhead { grid-template-columns: minmax(0, 1fr) auto; }
}
/* телефон (как в 5_телефон.png): логотип и «гамбургер»; разделы выпадают списком, «День / Ночь» — в нижней панели */
@media (max-width: 760px) {
    .subhead { position: relative; z-index: 46; grid-template-columns: minmax(0, 1fr) auto; padding-top: 16px; }
    .subhead__logo-s { display: block; letter-spacing: .5em; }
    .subhead__menu {
        display: grid;
        place-content: center;
        gap: 4px;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 1px solid var(--ghost-border);
        border-radius: 15px;
        background: var(--ghost-bg);
        cursor: pointer;
        box-shadow: 0 .8rem 1.6rem -1.2rem rgba(120, 40, 70, .6);
    }
    .subhead__menu i { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s var(--ease-out), opacity .2s ease; }
    .subhead.is-menu .subhead__menu i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .subhead.is-menu .subhead__menu i:nth-child(2) { opacity: 0; }
    .subhead.is-menu .subhead__menu i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .subhead .subnav {
        position: absolute;
        top: calc(100% + 8px);
        right: 16px;
        left: auto;
        width: min(260px, calc(100vw - 32px));
        background: var(--surface);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: 0 1.4rem 3rem -1rem rgba(60, 20, 40, .45);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(.98);
        transform-origin: 100% 0;
        transition: opacity .2s ease, transform .3s var(--ease-out), visibility .3s;
    }
    .subhead.is-menu .subnav { opacity: 1; visibility: visible; transform: none; }
    .subhead .subnav__list { flex-direction: column; overflow: visible; -webkit-mask-image: none !important; mask-image: none !important; padding: 6px; }
    .subhead .subnav__link { width: 100%; height: 44px; font-size: 15px; }
    .subhead__live { height: 38px; }
}

/* нижняя панель телефона — как в макете: значок в скруглённом квадрате, открытый раздел — розовый */
@media (max-width: 760px) {
    .tabbar { padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 0; box-shadow: 0 -10px 30px -16px rgba(120, 40, 70, .45); }
    .tabbar__item { gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
    .tabbar__item .ico { width: 34px; height: 30px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 18px; box-sizing: border-box; color: var(--text-soft); }
    .tabbar__item.is-on { color: var(--accent); }
    .tabbar__item.is-on .ico { background: var(--btn-bg); color: #fff; box-shadow: var(--btn-glow); }
    .tabbar__item.is-on::before { display: none; }
    .tabbar__realm .ico { color: var(--text-soft); filter: none; }
}

/* поля поиска и выпадающие списки — как в макете: плоские, скруглённые на 14 px */
.field input, .field select { border-radius: 14px; }
.chip { height: 38px; padding: 0 14px; border-radius: 12px; border-color: transparent; background: none; font-weight: 700; color: var(--text-soft); }
.chip:hover { background: color-mix(in srgb, var(--text) 7%, transparent); border-color: transparent; }
:root[data-theme="heaven"] :is(.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"]) { background: #2b1d2a; color: #fff; box-shadow: none; }
:root[data-theme="hell"] :is(.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"]) { background: var(--btn-bg); color: #fff; box-shadow: var(--btn-glow); }
.chip__n { font-size: inherit; opacity: 1; }
.chip__n::before { content: "· "; }
/* внутренние страницы: фон слева и снизу приглушён (как в макетах кинотеатра и игр) — заголовки и обложки читаются */
:root[data-theme="hell"]:not(.page-home) .scene__vignette {
    background: linear-gradient(90deg, rgba(14, 10, 30, .6) 0%, rgba(14, 10, 30, .28) 45%, rgba(14, 10, 30, .12) 100%),
                linear-gradient(180deg, rgba(14, 10, 30, .1) 0%, rgba(14, 10, 30, .3) 32%, rgba(14, 10, 30, .82) 70%, #0d0a1c 100%);
}
:root[data-theme="heaven"]:not(.page-home) .scene__vignette {
    background: linear-gradient(90deg, rgba(255, 244, 247, .62) 0%, rgba(255, 244, 247, .2) 50%, rgba(255, 244, 247, 0) 100%),
                linear-gradient(180deg, rgba(255, 244, 247, 0) 26%, rgba(255, 244, 247, .72) 62%, #fff5f7 100%);
}
:root:not(.page-home) .scene__fog { display: none; }
/* лучи из-за ворот днём — мягче */
.sk-rays { opacity: .55; }
/* Остальные страницы («Летопись», «Рекорды», рейтинг, «Воплощения», рекламодателям) — как кинотеатр и игры:
   во всю ширину с полями 48 px, слева надпись, крупный заголовок (последнее слово — цветом, title_em) и строка */
:root main:is(.chron, .statp, .rating, .cosp) { width: 100%; max-width: none; padding-inline: clamp(16px, 3vw, 48px); }
:root :is(.statp__hero, .rating__hero, .cosp__hero) { text-align: left; margin-bottom: clamp(18px, 3vh, 26px); padding-top: clamp(26px, 5.4vh, 46px); }
:root :is(.chron__kicker, .statp__kicker, .cosp__kicker, .rating__kicker) { font: 700 13px/1.3 var(--ui) !important; letter-spacing: .2em !important; text-transform: uppercase; color: var(--accent) !important; }
:root :is(.chron__title, .statp__title, .rating__title, .cosp__title) { font-size: clamp(32px, 3.6vw, 58px) !important; line-height: 1.05 !important; margin: 10px 0 12px !important; padding: 0 !important; display: block; }
:is(.chron__title, .statp__title, .rating__title, .cosp__title) em { font-style: normal; color: var(--accent); }
:root[data-theme="hell"] :is(.chron__title, .statp__title, .rating__title, .cosp__title) em { text-shadow: 0 0 30px rgba(255, 111, 145, .55); }
:root :is(.statp__lead, .rating__lead, .cosp__lead) { margin: 0; max-width: 72ch; font-size: 16px; text-align: left; }
.cosp__bar { justify-content: flex-start !important; }
/* «Летопись»: шапка прямо на фоне, печать справа */
:root .chron__hero { grid-template-columns: 1fr auto !important; grid-template-areas: "intro seal" "stats stats" !important; padding: clamp(26px, 5.4vh, 46px) 0 clamp(16px, 2.2vh, 20px) !important; background: none !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
:root .chron__hero::before, :root .chron__hero::after { display: none !important; }
:root .chron__seal { width: clamp(120px, 11vw, 170px); }
/* плитки с цифрами («Рекорды», «Летопись», рекламодателям): цифры — как на главной */
.sttile::after { display: none !important; }
:root .sttile { border-radius: 20px; }
:root .sttile__v { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; }
:root :is(.stbox__title, .chronmap__title, .evts__title, .guests__title, .board__title, .side__title, .month__title) { font-family: var(--display) !important; font-weight: 800 !important; letter-spacing: -.01em; }
@media (max-width: 760px) {
    :root .chron__hero { grid-template-columns: 1fr !important; grid-template-areas: "intro" "stats" !important; }
    :root .chron__seal { display: none; }
}:root :is(.stbox__title, .chronmap__title, .evts__title, .guests__title, .board__title, .side__title) { font-size: clamp(20px, 1.6vw, 24px) !important; line-height: 1.2 !important; }
/* рейтинг: плитки с цифрами — как «Фасолька в цифрах» */
.tile::after { display: none !important; }
:root .tile { border-radius: 20px; }
:root .tile__n { font-family: var(--display); font-weight: 800; color: var(--text) !important; text-shadow: none !important; }