/* «Infernal Gothic»: an optional look. Everything hangs on html[data-infernal-active="true"] and only repaints
   existing elements (pictures, colours, obsidian glass, silver edges, thorns, rubies, fonts); the layout and content
   stay. Dark: black obsidian and black metal, a blood-red gradient for main actions, silver gothic corners, rubies,
   a crimson glow. Light: ash-grey marble, silver frames, bordeaux accents, cold metal highlights, dark text, a
   scarlet glow. Buttons are the owner's own plates (cut from her sheet): compact ones for everyday actions, the
   winged and crowned plate only for Premium. Fonts: UnifrakturCook (only the big logo), Cinzel Decorative (section
   titles), Cormorant Garamond (character names), Manrope (interface). Phones: no blur, lighter shadows. */

html[data-infernal-active="true"] body:not(.admin-mode) {
  --infernal-silver: #b9b9c2;
  --infernal-silver-deep: #6e6e78;
  --infernal-ruby: #c4101e;
  --infernal-wine: #5a0610;
  --infernal-text: #ece8e8;
  --infernal-muted: #a9a2a4;
  --infernal-accent: #d4cfd0;
  --infernal-glass: rgba(12, 10, 11, 0.66);
  --infernal-glass-strong: rgba(8, 6, 7, 0.92);
  --infernal-glass-row: rgba(22, 18, 20, 0.56);
  --infernal-edge: rgba(190, 190, 200, 0.55);
  --infernal-edge-soft: rgba(190, 190, 200, 0.24);
  /* the glow: crimson (багровое) in the dark */
  --infernal-glow: 0 0 16px rgba(150, 8, 22, 0.42);
  --infernal-glow-strong: 0 0 22px rgba(185, 12, 28, 0.65);
  --infernal-neon: 0 0 0 1px rgba(190, 190, 200, 0.45), 0 0 12px rgba(150, 8, 22, 0.6);
  --infernal-glow-rgb: 150, 8, 22;
  --infernal-sheen: linear-gradient(165deg, rgba(230, 230, 236, 0.09), rgba(230, 230, 236, 0.02) 40%, rgba(230, 230, 236, 0) 65%);
  --infernal-inner: inset 0 1px 0 rgba(220, 220, 228, 0.16), inset 0 0 18px rgba(150, 8, 22, 0.1);
  --infernal-drop: 0 16px 34px -18px rgba(0, 0, 0, 0.92);
  --infernal-blur: blur(14px) saturate(120%);
  --infernal-picture: image-set(
    url("assets/seasonal/infernal/background-dark.avif") type("image/avif"),
    url("assets/seasonal/infernal/background-dark.webp") type("image/webp")
  );
  --infernal-chat: var(--infernal-picture);
  --infernal-banner: image-set(
    url("assets/seasonal/infernal/banner-dark.avif") type("image/avif"),
    url("assets/seasonal/infernal/banner-dark.webp") type("image/webp")
  );
  --infernal-veil: linear-gradient(180deg, rgba(4, 3, 3, 0.3), rgba(4, 3, 3, 0.6));
  --infernal-divider-img: url("assets/seasonal/infernal/divider-dark.webp");
  --infernal-wings-img: url("assets/seasonal/infernal/wings-dark.webp");
  --infernal-small-img: url("assets/seasonal/infernal/divider-small-dark.webp");
  --infernal-corner-tr-img: url("assets/seasonal/infernal/corner-tr-dark.webp");
  --infernal-corner-bl-img: url("assets/seasonal/infernal/corner-bl-dark.webp");
  --infernal-crest-img: url("assets/seasonal/infernal/crescent-dark.webp");
  --infernal-crown-img: url("assets/seasonal/infernal/thorn-crest-dark.webp");
  --card-bg: rgba(12, 10, 11, 0.66);
  --card-border: rgba(190, 190, 200, 0.55);
  --nav-bg: rgba(8, 6, 7, 0.72);
  --text-main: #ece8e8;
  --text-muted: #a9a2a4;
  --accent-neon: #d4cfd0;
  --accent-pink: #c4101e;
  --accent-purple: #c4101e;
  --lux-neon-text: 0 0 6px rgba(235, 230, 232, 0.35), 0 0 16px rgba(150, 8, 22, 0.55);
  --lux-neon-icon: drop-shadow(0 0 5px rgba(235, 230, 232, 0.4)) drop-shadow(0 0 12px rgba(150, 8, 22, 0.55));
  --lux-neon-box: 0 0 0 1px rgba(190, 190, 200, 0.2), 0 0 20px rgba(150, 8, 22, 0.45), inset 0 1px 0 rgba(220, 220, 228, 0.1);
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) {
  --infernal-silver: #6c6c76;
  --infernal-silver-deep: #45454d;
  --infernal-ruby: #b3101c;
  --infernal-wine: #6b0f1a;
  --infernal-text: #1d1a1b;
  --infernal-muted: #4d4649;
  --infernal-accent: #6b0f1a;
  --infernal-glass: rgba(232, 232, 235, 0.66);
  --infernal-glass-strong: rgba(238, 238, 241, 0.94);
  --infernal-glass-row: rgba(240, 240, 243, 0.6);
  --infernal-edge: rgba(110, 110, 122, 0.6);
  --infernal-edge-soft: rgba(110, 110, 122, 0.3);
  /* the glow: scarlet (алое) on the grey */
  --infernal-glow: 0 0 16px rgba(235, 25, 40, 0.28);
  --infernal-glow-strong: 0 0 22px rgba(240, 30, 45, 0.45);
  --infernal-neon: 0 0 0 1px rgba(110, 110, 122, 0.5), 0 0 12px rgba(235, 25, 40, 0.32);
  --infernal-glow-rgb: 235, 25, 40;
  --infernal-sheen: linear-gradient(165deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.18) 40%, rgba(255, 255, 255, 0) 65%);
  --infernal-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 18px rgba(200, 200, 210, 0.25);
  --infernal-drop: 0 16px 34px -20px rgba(30, 30, 36, 0.45);
  --infernal-picture: image-set(
    url("assets/seasonal/infernal/background-light.avif") type("image/avif"),
    url("assets/seasonal/infernal/background-light.webp") type("image/webp")
  );
  --infernal-banner: image-set(
    url("assets/seasonal/infernal/banner-light.avif") type("image/avif"),
    url("assets/seasonal/infernal/banner-light.webp") type("image/webp")
  );
  --infernal-veil: linear-gradient(180deg, rgba(236, 236, 238, 0.24), rgba(228, 228, 232, 0.5));
  --infernal-divider-img: url("assets/seasonal/infernal/divider-light.webp");
  --infernal-wings-img: url("assets/seasonal/infernal/wings-light.webp");
  --infernal-small-img: url("assets/seasonal/infernal/divider-small-light.webp");
  --infernal-corner-tr-img: url("assets/seasonal/infernal/corner-tr-light.webp");
  --infernal-corner-bl-img: url("assets/seasonal/infernal/corner-bl-light.webp");
  --infernal-crest-img: url("assets/seasonal/infernal/crescent-light.webp");
  --infernal-crown-img: url("assets/seasonal/infernal/thorn-crest-light.webp");
  --card-bg: rgba(232, 232, 235, 0.66);
  --card-border: rgba(110, 110, 122, 0.6);
  --nav-bg: rgba(236, 236, 239, 0.8);
  --text-main: #1d1a1b;
  --text-muted: #4d4649;
  --accent-neon: #6b0f1a;
  --accent-pink: #b3101c;
  --accent-purple: #b3101c;
  --lux-neon-text: 0 0 6px rgba(255, 255, 255, 0.85), 0 0 14px rgba(235, 25, 40, 0.22);
  --lux-neon-icon: drop-shadow(0 0 4px rgba(255, 255, 255, 0.85)) drop-shadow(0 0 10px rgba(235, 25, 40, 0.3));
  --lux-neon-box: 0 0 0 1px rgba(110, 110, 122, 0.3), 0 0 16px rgba(235, 25, 40, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ---------- Шрифты ---------- */

html[data-infernal-active="true"] body:not(.admin-mode),
html[data-infernal-active="true"] body:not(.admin-mode) * {
  font-family: "Manrope", "Montserrat", system-ui, sans-serif;
}

/* Section titles: Cinzel Decorative (no Cyrillic: Russian titles take Cormorant from the same list). */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .section-title, .home-section-head .section-title, h1:not(.logo), h2, h3, .world-card-copy h3, .achievement-sheet-title
) {
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
}

/* Character names: Cormorant Garamond. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .catalog-card-overlay strong, .npc-card-overlay strong, .story-card-overlay strong, .sheet-identity h2,
  .site-chat-title, .home-user-name
) {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-weight: 700 !important;
}

/* Small captions under names and section notes: Cormorant in italics (the interface stays Manrope). */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-section-note, .tagline, .catalog-card-overlay span, .npc-card-overlay span, .story-card-overlay span
) {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-style: italic;
  letter-spacing: 0.02em !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.sheet-identity blockquote, blockquote, .relationship-thought) {
  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-style: italic;
  font-size: 1.08em;
}

/* ---------- Фон: готические арки, обсидиан (пепельный мрамор), розы и шипы во весь экран ---------- */

html[data-infernal-active="true"] body:not(.admin-mode):not(.site-chat-body),
html[data-infernal-active="true"] body:not(.admin-mode):not(.site-chat-body) > .app-container {
  background: transparent !important;
}

html[data-infernal-active="true"] body:not(.admin-mode):not(.site-chat-body)::before {
  background: var(--infernal-picture) center / cover no-repeat !important;
  filter: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode):not(.site-chat-body)::after {
  background: var(--infernal-veil) !important;
}

html[data-infernal-active="true"] :is(.winter-brand-art, .halloween-brand-art, .winter-fx, .halloween-fx, .winter-shimmer, .halloween-shimmer, .winter-logo-icon, .halloween-logo-icon, .glow-bg, .glow-bg-secondary) {
  display: none !important;
}

/* ---------- Шапка: арка из шипов с рубинами, замок, луна и герои; логотип в середине ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) .header {
  position: relative;
  isolation: isolate;
  aspect-ratio: 3 / 1;
  min-height: 200px !important;
  overflow: hidden;
  background: #0d0909 !important;
  border-bottom: 1px solid var(--infernal-edge) !important;
  box-shadow: 0 1px 0 var(--infernal-edge-soft), 0 12px 30px -14px rgba(var(--infernal-glow-rgb), 0.55) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header {
  background: #efeff0 !important;
}

.infernal-brand-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--infernal-banner) center 30% / cover no-repeat;
}

html:not([data-infernal-active="true"]) .infernal-brand-art {
  display: none;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header::before {
  content: none;
}

/* A thin silver line with the theme's glow along the bottom edge. */
html[data-infernal-active="true"] body:not(.admin-mode) .header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--infernal-silver) 25%, #d0d0d5 50%, var(--infernal-silver) 75%, transparent);
  box-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.85);
  filter: none;
  animation: none;
}

/* The logo and the motto stand in the picture's middle, between its two ruby ornaments. */
html[data-infernal-active="true"] body:not(.admin-mode) .header > .brand {
  position: absolute !important;
  left: 50%;
  top: 54%;
  z-index: 2;
  transform: translate(-50%, -50%);
  margin: 0 !important;
  text-align: center;
  align-items: center;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header > .header-actions {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  margin-left: auto;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header .logo {
  position: relative;
  width: fit-content;
  margin: 0 auto !important;
  font-size: 54px !important;
  line-height: 1.05 !important;
  font-family: "UnifrakturCook", "Cinzel Decorative", Georgia, serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  background: linear-gradient(180deg, #ffffff 0%, #d6d6dc 40%, #8e8e99 66%, #e2e2e8 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  text-shadow: none !important;
  filter: drop-shadow(0 0 10px rgba(var(--infernal-glow-rgb), 0.6)) drop-shadow(0 2px 4px rgba(6, 4, 4, 0.7)) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header .logo {
  background: linear-gradient(180deg, #2a2a30 0%, #0e0d10 55%, #4a4a52 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.85)) drop-shadow(0 0 6px rgba(247, 247, 248, 0.9)) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline {
  color: #dddde1 !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: 0 1px 6px rgba(6, 4, 4, 0.9), 0 0 10px rgba(var(--infernal-glow-rgb), 0.45) !important;
  font-size: 16px !important;
  letter-spacing: 0.12em !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header .tagline {
  color: #640e14 !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.95) !important;
}

/* A thorned silver line with rubies under the motto. */
html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline::after {
  content: "";
  display: block;
  width: 210px;
  max-width: 100%;
  height: 22px;
  margin: 6px auto 0;
  background: var(--infernal-small-img) center / contain no-repeat;
  filter: drop-shadow(0 0 5px rgba(var(--infernal-glow-rgb), 0.6));
}

/* ---------- Разделители (шипы с рубинами, демонические крылья) и рубиновые метки заголовков ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) .home-view .home-section + .home-section {
  position: relative;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-view .home-section + .home-section::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -20px;
  width: min(300px, 72%);
  height: 30px;
  transform: translateX(-50%);
  pointer-events: none;
  background: var(--infernal-divider-img) center / contain no-repeat;
  opacity: 0.92;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-view .home-section + .home-section:nth-child(odd)::before {
  width: min(120px, 40%);
  height: 46px;
  top: -30px;
  background-image: var(--infernal-wings-img);
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-view .home-section-head {
  position: relative;
  border-left-color: transparent !important;
}

/* (not inside the collection panel: its head starts with a back button) */
html[data-infernal-active="true"] body:not(.admin-mode) .home-view .home-section-head:not(.home-collection-panel *)::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 12px;
  height: 16px;
  margin-top: -8px;
  pointer-events: none;
  background: url("assets/seasonal/infernal/ruby.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(var(--infernal-glow-rgb), 0.8));
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.section-title, .home-section-head .section-title) {
  color: var(--infernal-text) !important;
  text-shadow: 0 0 12px rgba(var(--infernal-glow-rgb), 0.4), 0 2px 8px rgba(6, 4, 4, 0.6) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.section-title, .home-section-head .section-title) {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.95) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.home-see-all, .catalog-heading-row span) {
  color: var(--infernal-silver) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.home-see-all, .catalog-heading-row span) {
  color: #9d171f !important;
}

/* ---------- Обсидиановое (мраморное) стекло: серебряная кромка, свечение, шипастые углы с розами ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .subscription-panel, .home-user-list, .home-collection-panel, .settings-profile-panel,
  .subscription-status-card, .premium-plan-card, .author-level-card, .user-hooks-panel,
  .empty-state-panel, .storage-panel, .slot-detail-block, .referral-card, .user-npc-form,
  .cabinet-npc-card, .cabinet-world-group, .character-sheet-panel, .miti-confirm-card,
  .welcome-modal-panel, .user-auth-panel
),
html[data-infernal-active="true"] body:not(.admin-mode) .achievement-sheet .achievement-sheet-card {
  /* Two corners only (top right, bottom left): the top-left corner is where back buttons and titles live. */
  background:
    var(--infernal-corner-tr-img) right 2px top 2px / 44px no-repeat,
    var(--infernal-corner-bl-img) left 2px bottom 2px / 44px no-repeat,
    var(--infernal-sheen),
    var(--infernal-glass) !important;
  border-color: var(--infernal-edge) !important;
  box-shadow: var(--infernal-inner), var(--infernal-drop), var(--infernal-neon) !important;
  -webkit-backdrop-filter: var(--infernal-blur);
  backdrop-filter: var(--infernal-blur);
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.miti-confirm-card, .welcome-modal-panel, .user-auth-panel),
html[data-infernal-active="true"] body:not(.admin-mode) .achievement-sheet .achievement-sheet-card {
  background:
    var(--infernal-corner-tr-img) right 2px top 2px / 44px no-repeat,
    var(--infernal-corner-bl-img) left 2px bottom 2px / 44px no-repeat,
    var(--infernal-sheen),
    var(--infernal-glass-strong) !important;
}

/* Small or crowded surfaces get no corners. */
html[data-infernal-active="true"] body:not(.admin-mode) .author-level-card {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .character-sheet-panel {
  background: var(--infernal-sheen), var(--infernal-glass-strong) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.settings-row, .slot-detail-npc-list, .referral-stats div, .form-group, .toast) {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: var(--infernal-inner) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .toast {
  background: var(--infernal-sheen), var(--infernal-glass-strong) !important;
}

/* ---------- Карточки с фото: серебряная кромка и готическая арка; фото не трогается ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .npc-card, .story-card, .catalog-card, .home-character-card, .home-media-card, .home-photo-card,
  .home-video-card, .world-card, .cabinet-npc-tile, .user-hook-card
) {
  border-color: var(--infernal-edge) !important;
  box-shadow: var(--infernal-neon), 0 10px 22px -12px rgba(var(--infernal-glow-rgb), 0.55), var(--infernal-drop) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .npc-card, .story-card, .catalog-card, .home-character-card, .home-media-card, .home-photo-card,
  .home-video-card, .world-card, .cabinet-npc-tile, .user-hook-card
):is(:hover, .active, .selected) {
  border-color: #bcbcc2 !important;
  box-shadow: 0 0 0 1px #bcbcc2, 0 12px 26px -10px rgba(var(--infernal-glow-rgb), 0.7), var(--infernal-glow-strong), var(--infernal-drop) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.catalog-card-overlay strong, .npc-card-overlay strong, .story-card-overlay strong) {
  color: #efeff0 !important;
  text-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.5), 0 2px 6px rgba(6, 4, 4, 0.9) !important;
}

/* ---------- Серебро и кровь вместо фиолетового: подписи, значки, метки, вкладки, поля ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .nav-item, .nav-icon, .field-label, .field-counter, .section-subtitle, .settings-version, .create-text,
  .catalog-mode-icon, .settings-main-title, .sub-nav-item, .segment-btn, .theme-switcher button, .home-card-stat,
  .home-media-badge, .settings-username-field, .settings-history-head p, .settings-history-head span,
  .catalog-tab, .home-rank, .sheet-tags span, .relationship-scene span
) {
  color: var(--infernal-accent) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .sheet-identity blockquote::before {
  color: var(--infernal-ruby) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-rank, .home-card-stat, .home-media-badge, .catalog-tab, .sub-nav-item.active, .btn-admin-crown,
  .catalog-create-icon, .avatar-wrapper, .preview-image-container, .settings-username-field, .sheet-tags span,
  .relationship-scene span
) {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: var(--infernal-inner), 0 0 10px rgba(var(--infernal-glow-rgb), 0.2) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.catalog-tab.active, .sub-nav-item.active) {
  color: var(--infernal-text) !important;
  border-color: var(--infernal-edge) !important;
  background: linear-gradient(180deg, rgba(var(--infernal-glow-rgb), 0.32), rgba(108, 15, 22, 0.18)), var(--infernal-glass-row) !important;
  box-shadow: var(--infernal-inner), var(--infernal-glow-strong) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.catalog-tab.active, .sub-nav-item.active) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 229, 231, 0.7)) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .btn-admin-crown {
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(input[type="search"], input[type="text"], textarea, select, .catalog-search-input) {
  border-color: var(--infernal-edge-soft) !important;
  caret-color: var(--infernal-ruby);
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(input[type="search"], .catalog-search-input) {
  background: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .sheet-stat-bar i {
  background: linear-gradient(90deg, #bcbcc2, #c01823 60%, #6c0f16) !important;
  box-shadow: 0 0 8px rgba(var(--infernal-glow-rgb), 0.5) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.sheet-card, .sheet-identity blockquote, .sheet-topbar) {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
}

/* ---------- Сердца отношений: обсидиановое окно, кровавые полосы, сердце в рубине ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) .relationship-card {
  background: var(--infernal-sheen), var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge) !important;
  box-shadow: var(--infernal-inner), var(--infernal-drop), var(--infernal-glow) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.relationship-status, .relationship-desire, .relationship-thought) {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .relationship-feelings i,
html[data-infernal-active="true"] body:not(.admin-mode) .relationship-energy::before {
  background: linear-gradient(90deg, #bcbcc2, #c01823 60%, #6c0f16) !important;
}

/* Author level badges: blood instead of the violet plate (the gold rim of the level stays). */
html[data-infernal-active="true"] body:not(.admin-mode) .author-level-badge {
  background-color: rgba(108, 15, 22, 0.55) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .author-level-badge {
  background-color: rgba(108, 15, 22, 0.82) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .avatar-preview-card .preview-image-container {
  position: relative;
  z-index: 1;
  border-color: var(--infernal-silver) !important;
}

/* The place numbers in the authors' list: a silver ring instead of the lilac one. */
html[data-infernal-active="true"] body:not(.admin-mode) .home-author-row > b {
  border-color: var(--infernal-edge) !important;
  color: var(--infernal-text) !important;
  box-shadow: 0 0 8px rgba(var(--infernal-glow-rgb), 0.25) !important;
}

/* The heart turns from pink neon to ruby (its shape and cracks keep the meaning). */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.relationship-heart-art, .relationship-heart svg) {
  filter: hue-rotate(25deg) saturate(1.25) brightness(0.95) drop-shadow(0 0 10px rgba(var(--infernal-glow-rgb), 0.55));
}

/* ---------- Кнопки: таблички с листа владелицы (обсидиан и кровавый мрамор, серебряные шипы, рубины) ----------
   Everyday buttons: the compact plate (a ruby at each end, a short thorn) stretched to the button's width by
   border-image; its tips reach a few pixels outside the box. The crowned, winged plate is only for Premium. */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan
) {
  min-height: 38px;
  background: transparent !important;
  border: 0 solid transparent !important;
  border-image-source: url("assets/seasonal/infernal/btn-primary-dark.webp") !important;
  border-image-slice: 44 89 36 89 fill !important;
  border-image-width: 21px 42px 17px 42px !important;
  border-image-outset: 9px var(--infernal-ox, 13px) 5px var(--infernal-ox, 13px) !important;
  border-image-repeat: stretch !important;
  border-radius: 16px !important;
  color: #f4eeee !important;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(var(--infernal-glow-rgb), 0.55) !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 4px rgba(var(--infernal-glow-rgb), 0.35));
  transition: filter 0.25s ease;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan
) {
  border-image-source: url("assets/seasonal/infernal/btn-primary-light.webp") !important;
  border-image-slice: 42 87 39 89 fill !important;
  border-image-width: 20px 41px 19px 42px !important;
  border-image-outset: 8px var(--infernal-ox, 12px) 7px var(--infernal-ox, 13px) !important;
  color: #1d1a1b !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

/* Hover: the plate from the sheet's hover row, with the glow (crimson in the dark, scarlet on the grey). */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan
):is(:hover, :focus-visible):not(:disabled) {
  border-image-source: url("assets/seasonal/infernal/btn-hover-dark.webp") !important;
  border-image-slice: 40 89 36 89 fill !important;
  border-image-width: 19px 42px 17px 42px !important;
  border-image-outset: 7px var(--infernal-ox, 13px) 5px var(--infernal-ox, 13px) !important;
  filter: drop-shadow(0 0 9px rgba(var(--infernal-glow-rgb), 0.75));
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan
):is(:hover, :focus-visible):not(:disabled) {
  border-image-source: url("assets/seasonal/infernal/btn-hover-light.webp") !important;
  border-image-slice: 41 89 38 89 fill !important;
  border-image-width: 20px 42px 18px 42px !important;
  border-image-outset: 8px var(--infernal-ox, 13px) 6px var(--infernal-ox, 13px) !important;
  color: #6b0f1a !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan, .btn-premium, .subscription-actions button, .premium-activate
):active {
  transform: translateY(1px);
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan, .btn-premium, .subscription-actions button, .premium-activate
):focus-visible {
  outline: 2px solid var(--infernal-silver);
  outline-offset: 6px;
}

/* Disabled: the sheet's grey plate. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan, .subscription-actions button, .premium-activate
):disabled {
  border-image-source: url("assets/seasonal/infernal/btn-disabled-dark.webp") !important;
  border-image-slice: 35 89 36 89 fill !important;
  border-image-width: 17px 42px 17px 42px !important;
  border-image-outset: 5px var(--infernal-ox, 13px) 5px var(--infernal-ox, 13px) !important;
  color: rgba(236, 232, 232, 0.5) !important;
  text-shadow: none !important;
  filter: none;
  opacity: 0.85;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .primary-action, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button, .world-start-form button,
  .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan, .subscription-actions button, .premium-activate
):disabled {
  border-image-source: url("assets/seasonal/infernal/btn-disabled-light.webp") !important;
  color: rgba(29, 26, 27, 0.45) !important;
}

/* Secondary buttons with words: the sheet's black (dark) or smoky (light) plate. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.sheet-secondary-btn, .header-auth-button, .world-back-button, .slot-detail-refresh) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-image-source: url("assets/seasonal/infernal/btn-secondary-dark.webp") !important;
  border-image-slice: 40 89 37 89 fill !important;
  border-image-width: 19px 42px 18px 42px !important;
  border-image-outset: 7px var(--infernal-ox, 12px) 6px var(--infernal-ox, 12px) !important;
  border-image-repeat: stretch !important;
  color: #ece8e8 !important;
  box-shadow: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.sheet-secondary-btn, .header-auth-button, .world-back-button, .slot-detail-refresh) {
  border-image-source: url("assets/seasonal/infernal/btn-secondary-light.webp") !important;
  border-image-outset: 7px var(--infernal-ox, 13px) 6px var(--infernal-ox, 13px) !important;
  color: #f2f0f0 !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.sheet-secondary-btn, .header-auth-button, .world-back-button, .slot-detail-refresh):hover {
  filter: drop-shadow(0 0 8px rgba(var(--infernal-glow-rgb), 0.7));
}

/* Square icon buttons (back, close, menu, plus): the sheet's square silver frame with rubies. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .settings-history-back, .sheet-close, .sheet-x, .achievement-sheet-close, .world-icon-button,
  .slot-detail-back, .site-chat-back, .site-chat-menu, .site-chat-plus, .welcome-modal-close,
  .media-viewer-close
) {
  background: url("assets/seasonal/infernal/icon-frame-dark.webp") center / 100% 100% no-repeat !important;
  border-color: transparent !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #e8333f !important;
  filter: drop-shadow(0 0 4px rgba(var(--infernal-glow-rgb), 0.4));
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .settings-history-back, .sheet-close, .sheet-x, .achievement-sheet-close, .world-icon-button,
  .slot-detail-back, .site-chat-back, .site-chat-menu, .site-chat-plus, .welcome-modal-close,
  .media-viewer-close
) {
  background-image: url("assets/seasonal/infernal/icon-frame-light.webp") !important;
  color: #7a0f1a !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .settings-history-back, .sheet-close, .sheet-x, .achievement-sheet-close, .world-icon-button,
  .slot-detail-back, .site-chat-back, .site-chat-menu, .site-chat-plus, .welcome-modal-close,
  .media-viewer-close
):hover {
  filter: drop-shadow(0 0 8px rgba(var(--infernal-glow-rgb), 0.8));
}

/* Small choice buttons (theme: moon / sun / auto) stay small glass. */
html[data-infernal-active="true"] body:not(.admin-mode) .theme-switcher button {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge) !important;
  box-shadow: var(--infernal-inner) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.theme-switcher button.active, .theme-switcher button:hover) {
  border-color: var(--infernal-silver) !important;
  box-shadow: var(--infernal-inner), var(--infernal-glow-strong) !important;
}

/* ---------- Premium: корона, крылья, рубин и золотая отделка ---------- */

/* The header pill: the gold-trimmed plate with short wing stubs and the crown over it. */
html[data-infernal-active="true"] body:not(.admin-mode) .btn-premium,
html[data-infernal-active="true"] body:not(.admin-mode) .btn-premium:is([data-subscription="general"], [data-subscription="basic"], [data-subscription="premium"]) {
  background: transparent !important;
  border: 0 solid transparent !important;
  border-image-source: url("assets/seasonal/infernal/btn-premium-compact-dark.webp") !important;
  border-image-slice: 38 63 38 67 fill !important;
  border-image-width: 15px 25px 15px 27px !important;
  border-image-outset: 5px var(--infernal-ox, 11px) 5px var(--infernal-ox, 11px) !important;
  border-image-repeat: stretch !important;
  border-radius: 14px !important;
  padding-inline: 20px !important;
  color: #f1cf7a !important;
  -webkit-text-fill-color: #f1cf7a !important;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(var(--infernal-glow-rgb), 0.5) !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 5px rgba(var(--infernal-glow-rgb), 0.45));
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .btn-premium,
html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .btn-premium:is([data-subscription="general"], [data-subscription="basic"], [data-subscription="premium"]) {
  border-image-source: url("assets/seasonal/infernal/btn-premium-compact-light.webp") !important;
  border-image-slice: 38 67 38 72 fill !important;
  border-image-width: 15px 27px 15px 29px !important;
  color: #4a0a12 !important;
  -webkit-text-fill-color: #4a0a12 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .btn-premium svg {
  color: #f1cf7a !important;
  filter: none !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .btn-premium svg {
  color: #8a6a2a !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .btn-premium:hover {
  filter: drop-shadow(0 0 9px rgba(var(--infernal-glow-rgb), 0.8));
}

/* Purchase buttons in the subscription panel: the full plate with wings and the crown above. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.subscription-actions button, .premium-activate) {
  position: relative;
  min-height: 42px;
  margin-inline: 46px;
  background: transparent !important;
  border: 0 solid transparent !important;
  border-image-source: url("assets/seasonal/infernal/btn-premium-dark.webp") !important;
  border-image-slice: 76 163 48 162 fill !important;
  border-image-width: 36px 78px 23px 77px !important;
  border-image-outset: 24px 60px 11px 58px !important;
  border-image-repeat: stretch !important;
  border-radius: 16px !important;
  color: #f1cf7a !important;
  -webkit-text-fill-color: #f1cf7a !important;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(var(--infernal-glow-rgb), 0.5) !important;
  box-shadow: none !important;
  filter: drop-shadow(0 0 6px rgba(var(--infernal-glow-rgb), 0.5));
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.subscription-actions button, .premium-activate) {
  border-image-source: url("assets/seasonal/infernal/btn-premium-light.webp") !important;
  border-image-slice: 74 164 49 163 fill !important;
  border-image-width: 35px 78px 23px 78px !important;
  border-image-outset: 23px 58px 11px 56px !important;
  color: #4a0a12 !important;
  -webkit-text-fill-color: #4a0a12 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.subscription-actions button, .premium-activate)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -30px;
  width: 50px;
  height: 32px;
  transform: translateX(-50%);
  pointer-events: none;
  background: url("assets/seasonal/infernal/premium-crown-dark.webp") center bottom / contain no-repeat;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.subscription-actions button, .premium-activate)::after {
  background-image: url("assets/seasonal/infernal/premium-crown-light.webp");
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.subscription-actions button, .premium-activate):hover:not(:disabled) {
  filter: drop-shadow(0 0 10px rgba(var(--infernal-glow-rgb), 0.85));
}

.infernal-switch input:checked + span {
  border-color: rgba(190, 190, 200, 0.9);
  background: linear-gradient(135deg, rgba(196, 16, 30, 0.85), rgba(90, 6, 16, 0.85));
}

.infernal-switch input:checked + span::after {
  background: linear-gradient(135deg, #f4f4f6, #a9a9b1);
  box-shadow: 0 0 10px rgba(196, 16, 30, 0.85);
}

/* ---------- Меню: обсидиановое стекло, активный пункт с рубином ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) .bottom-nav,
html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode) .site-chat-nav {
  background: var(--infernal-sheen), var(--nav-bg) !important;
  -webkit-backdrop-filter: var(--infernal-blur);
  backdrop-filter: var(--infernal-blur);
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: 0 -1px 0 var(--infernal-edge-soft), 0 -10px 26px -16px rgba(var(--infernal-glow-rgb), 0.55) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .nav-item.active {
  color: #bcbcc2 !important;
  text-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.8);
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .nav-item {
  color: #3e383a !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .nav-item.active {
  color: #8a141c !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
}

@media (min-width: 1100px) {
  html[data-infernal-active="true"] body:not(.admin-mode):not(.setting-play-mode) .bottom-nav {
    box-shadow: 1px 0 0 var(--infernal-edge-soft), 10px 0 30px -18px rgba(var(--infernal-glow-rgb), 0.55) !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode):not(.setting-play-mode) .bottom-nav .nav-item.active {
    background: linear-gradient(180deg, rgba(var(--infernal-glow-rgb), 0.3), rgba(108, 15, 22, 0.14)) !important;
    box-shadow: inset 0 0 0 1px rgba(153, 153, 163, 0.6), 0 0 14px rgba(var(--infernal-glow-rgb), 0.45);
    border-radius: 12px;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .nav-item.active::before {
    background: linear-gradient(180deg, #d0d0d5, var(--infernal-silver), var(--infernal-ruby)) !important;
    box-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.85) !important;
  }

  html[data-infernal-active="true"] body.theme-light:not(.admin-mode):not(.setting-play-mode) .bottom-nav .nav-item.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(229, 229, 231, 0.75)) !important;
    box-shadow: inset 0 0 0 1px rgba(119, 119, 131, 0.6), 0 0 14px rgba(var(--infernal-glow-rgb), 0.25) !important;
  }

  /* A small ruby at the end of the active item. */
  html[data-infernal-active="true"] body:not(.admin-mode):not(.setting-play-mode) .bottom-nav .nav-item.active::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    width: 10px;
    height: 14px;
    margin-top: -7px;
    pointer-events: none;
    background: url("assets/seasonal/infernal/ruby.svg") center / contain no-repeat;
  }

  /* The silver crescent with hanging rubies under the menu items. */
  html[data-infernal-active="true"] body:not(.admin-mode):not(.setting-play-mode) .bottom-nav::after {
    content: "";
    display: block;
    flex: 0 0 auto;
    align-self: center;
    width: 52px;
    height: 90px;
    margin-top: 22px;
    pointer-events: none;
    background: var(--infernal-crest-img) center / contain no-repeat;
    opacity: 0.92;
    filter: drop-shadow(0 0 6px rgba(var(--infernal-glow-rgb), 0.45));
  }
}

@media (min-width: 768px) {
  html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode):not(.setting-play-mode) .site-chat-nav {
    box-shadow: 1px 0 0 var(--infernal-edge-soft), 10px 0 30px -18px rgba(var(--infernal-glow-rgb), 0.55) !important;
  }

  html[data-infernal-active="true"] .site-chat-nav .nav-item.active::before {
    background: linear-gradient(180deg, #d0d0d5, var(--infernal-silver), var(--infernal-ruby));
    box-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.85);
  }
}

/* ---------- Чат: тот же фон с арками ---------- */

html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode),
html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode) .site-chat-shell {
  background: var(--infernal-veil), var(--infernal-chat) center / cover no-repeat, #0d0909 !important;
}

html[data-infernal-active="true"] body.site-chat-body.theme-light:not(.admin-mode),
html[data-infernal-active="true"] body.site-chat-body.theme-light:not(.admin-mode) .site-chat-shell {
  background: var(--infernal-veil), var(--infernal-chat) center / cover no-repeat, #efeff0 !important;
}

html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode) .site-chat-header {
  background: var(--infernal-sheen), var(--infernal-glass) !important;
  border-color: var(--infernal-edge-soft) !important;
  -webkit-backdrop-filter: var(--infernal-blur);
  backdrop-filter: var(--infernal-blur);
}

html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode) .site-chat-bubble {
  background: var(--infernal-sheen), var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge-soft) !important;
  color: var(--infernal-text) !important;
  box-shadow: var(--infernal-inner), 0 0 12px rgba(var(--infernal-glow-rgb), 0.18);
}

html[data-infernal-active="true"] body.site-chat-body:not(.admin-mode) .site-chat-message.user .site-chat-bubble {
  background: linear-gradient(180deg, rgba(196, 196, 199, 0.14), rgba(196, 196, 199, 0.02)), rgba(65, 45, 47, 0.9) !important;
  border-color: rgba(153, 153, 163, 0.65) !important;
  color: #efeff0 !important;
}

html[data-infernal-active="true"] body.site-chat-body.theme-light:not(.admin-mode) .site-chat-message.user .site-chat-bubble {
  background: linear-gradient(180deg, #ffffff, rgba(233, 233, 235, 0.94)) !important;
  border-color: rgba(119, 119, 131, 0.7) !important;
  color: #372728 !important;
}

/* ---------- Телефоны и планшеты: без размытия и без больших теней ---------- */

@media (max-width: 1099px), (pointer: coarse) {
  html[data-infernal-active="true"] body:not(.admin-mode) {
    --infernal-blur: none;
    --infernal-glass: rgba(19, 13, 14, 0.82);
    --infernal-glass-row: rgba(32, 22, 23, 0.64);
    --nav-bg: rgba(13, 9, 9, 0.93);
  }

  html[data-infernal-active="true"] body.theme-light:not(.admin-mode) {
    --infernal-glass: rgba(247, 247, 247, 0.88);
    --infernal-glass-row: rgba(248, 248, 249, 0.74);
    --nav-bg: rgba(247, 247, 247, 0.95);
  }

  html[data-infernal-active="true"] body:not(.admin-mode) :is(
    .subscription-panel, .home-user-list, .home-collection-panel, .settings-profile-panel,
    .subscription-status-card, .premium-plan-card, .author-level-card, .user-hooks-panel,
    .empty-state-panel, .storage-panel, .slot-detail-block, .referral-card, .user-npc-form,
    .cabinet-npc-card, .cabinet-world-group
  ),
  html[data-infernal-active="true"] body:not(.admin-mode) :is(.settings-row, .slot-detail-npc-list, .referral-stats div, .form-group) {
    box-shadow: 0 0 0 1px var(--infernal-edge-soft), 0 0 8px rgba(var(--infernal-glow-rgb), 0.22) !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) :is(
    .npc-card, .story-card, .catalog-card, .home-character-card, .home-media-card, .home-photo-card,
    .home-video-card, .world-card, .cabinet-npc-tile, .user-hook-card
  ) {
    box-shadow: 0 0 0 1px var(--infernal-edge-soft), 0 6px 14px -8px rgba(var(--infernal-glow-rgb), 0.55) !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) :is([data-glow="creator"], [data-frame="ghost"], .author-level-badge.perk-absolute) {
    will-change: transform;
  }
}

@media (max-width: 767px) {
  /* The whole picture (window, moon, castle) at the screen's width: the header is a third of the width tall.
     (aspect-ratio with a fixed min-height would widen it past the screen, so the height comes from 100vw.) */
  html[data-infernal-active="true"] body:not(.admin-mode) .header {
    aspect-ratio: auto;
    min-height: calc(100vw / 3) !important;
  }

  .infernal-brand-art {
    background-position: center;
  }

  /* The buttons stand on the right, so the logo goes back into the row on the left (it never sits under them). */
  html[data-infernal-active="true"] body:not(.admin-mode) .header > .brand {
    position: relative !important;
    left: auto;
    top: auto;
    transform: none;
    align-self: center;
    text-align: left;
    align-items: flex-start;
    min-width: 0;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header .logo {
    margin: 0 !important;
    font-size: 32px !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline {
    font-size: 11px !important;
    letter-spacing: 0.04em !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline::after {
    width: 130px;
    height: 14px;
    margin: 3px 0 0;
    background-position: left center;
  }
}

/* ---------- Окно фото и видео, плитки NPC, вкладки, выбор «меньше/средне/больше», поиск ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-backdrop {
  background: rgba(5, 4, 4, 0.82);
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .media-viewer-backdrop {
  background: rgba(234, 234, 236, 0.8);
}

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-panel {
  background: var(--infernal-sheen), var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge) !important;
  box-shadow: var(--infernal-inner), var(--infernal-drop), var(--infernal-glow) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-frame {
  background: rgba(7, 5, 5, 0.9);
}

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-copy h3 {
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-copy p {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .media-viewer-close {
  background: var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge) !important;
  color: var(--infernal-text) !important;
}

/* Personal NPC tiles: obsidian glass instead of lilac, a ruby letter instead of the violet ball. */
html[data-infernal-active="true"] body:not(.admin-mode) .cabinet-npc-tile {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .cabinet-npc-tile-letter {
  background: radial-gradient(circle at 35% 30%, #ff0011, #c01823 55%, #392729) !important;
  color: #efeff0 !important;
  box-shadow: 0 0 0 1px var(--infernal-edge), 0 0 14px rgba(var(--infernal-glow-rgb), 0.5) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.cabinet-npc-tile-delete, .cabinet-npc-tile-actions button, .cabinet-npc-tile-edit) {
  background: var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
  color: var(--infernal-accent) !important;
}

/* Cabinet tabs and the small choice buttons («Меньше / Средне / Больше»): small, neat glass. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.sub-nav-item, .segment-btn) {
  background: var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .segment-btn.active {
  color: var(--infernal-text) !important;
  background: linear-gradient(180deg, rgba(var(--infernal-glow-rgb), 0.32), rgba(108, 15, 22, 0.14)), var(--infernal-glass-row) !important;
  border-color: var(--infernal-edge) !important;
  box-shadow: inset 0 0 0 1px var(--infernal-edge-soft), 0 0 10px rgba(var(--infernal-glow-rgb), 0.35) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .segment-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 229, 231, 0.7)) !important;
}

/* The search line: no white box inside the glass field. */
html[data-infernal-active="true"] body:not(.admin-mode) :is([class*="search"]) :is(input, textarea),
html[data-infernal-active="true"] body:not(.admin-mode) input[type="search"] {
  background: transparent !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .world-card .world-lock-badge {
  background: var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge) !important;
  color: var(--infernal-text) !important;
}

/* Light theme: the site's own texts are plum and its small marks pink; here they are near-black and bordeaux. */
html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .settings-row, .form-group, .input-wrapper, .field-content, textarea.form-input, .home-user-row, .home-user-list,
  .home-media-author, .avatar-meaning-note, .field-limit-total, .settings-grid, .cabinet-personalities-panel,
  .avatar-preview-card, .preview-image-container
) {
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.home-section-note, .home-media-author, .avatar-meaning-note, .field-limit-total) {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.settings-row-icon, .input-icon) {
  color: var(--infernal-ruby) !important;
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header-auth-button {
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .cabinet-personalities-panel {
  box-shadow: var(--infernal-inner) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .sub-nav {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
  border-bottom-color: var(--infernal-edge-soft) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(.catalog-create-cta, .catalog-create-cta *) {
  color: #640e14 !important;
  text-shadow: none !important;
}

/* The site paints some labels with -webkit-text-fill-color (it wins over color): follow the theme's color. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .primary-action, .btn-premium, .sheet-chat-btn, .catalog-create-cta, .btn-save-settings,
  .subscription-actions button, .welcome-modal-actions button:first-child, .user-hook-actions .user-hook-start,
  .story-card-action, .btn-change-avatar, .saved-create-btn, .slot-detail-select, .settings-profile-save-btn, .world-card-copy button,
  .world-start-form button, .world-composer button, .site-chat-send, .site-chat-empty-action, #user-npc-create-save, #slot-detail-npc-add, #referral-copy, .referral-share, .premium-select-plan, .segment-btn,
  .sub-nav-item, .catalog-tab
),
html[data-infernal-active="true"] body:not(.admin-mode) :is(.catalog-create-cta, .btn-premium, .sub-nav-item, .catalog-tab) * {
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .view-pane {
  color: var(--infernal-text);
}

html[data-infernal-active="true"] body:not(.admin-mode) .world-card {
  background: var(--infernal-sheen), var(--infernal-glass) !important;
  border-color: var(--infernal-edge) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .world-card-copy h3 {
  color: var(--infernal-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .world-card-copy :is(.world-author, p) {
  color: var(--infernal-muted) !important;
}

/* The site's light theme puts the card heart on a dark plate; here it stands bare on the photo. */
html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .catalog-favorite {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(9, 9, 13, 0.75), 0 1px 3px rgba(9, 9, 13, 0.6) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .catalog-favorite.active {
  color: #ff0011 !important;
}

/* Reduced motion: the buttons stop moving on press. */
@media (prefers-reduced-motion: reduce) {
  html[data-infernal-active="true"] body:not(.admin-mode) * {
    transition: none !important;
  }
}

/* Empty lists («пока пуст», «скоро появятся»): the look's own glass, not the site's pink card. */
html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card {
  background: var(--infernal-sheen), var(--infernal-glass) !important;
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card b {
  color: var(--infernal-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card span {
  color: var(--infernal-muted) !important;
}

/* ---------- Остатки фиолетового и розового самого сайта: рамки, подписи, кнопки-ссылки, свечения ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-see-all, .home-collection-back, .home-author-search, .avatar-meaning-note, .slot-detail-hero, .slot-detail-avatar,
  .slot-detail-clear, .sheet-portrait-wrap, .sheet-author-metrics > div, .sheet-actions, .premium-panel, .premium-back,
  .premium-hero, .premium-section-title, .premium-benefits article, .premium-extra-card, .terms-panel,
  .roleplay-mode-card, .roleplay-mode-card i, .subscription-meta div, .subscription-note, .settings-history-panel,
  .user-hooks-add, .user-hooks-context, .author-character-count, .author-npc-note, .story-detail, .story-back-link,
  .story-info-block, .story-expects, .story-tip, .secondary-action, .world-hearts-button, .photo-uploader,
  .form-field, .form-input, .participant-builder, .participant-add, .behavior-panel, .character-season-note
) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-author-search, .home-author-search span, .story-back-link, .premium-section-title, .author-npc-note,
  .subscription-note, .user-hooks-add, .participant-add, .character-season-note, .terms-content :is(h3, h4),
  #premium-terms, .secondary-action
) {
  color: var(--infernal-accent) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .premium-panel p, .premium-footer-links p, .subscription-status-card p, .welcome-modal-panel p, .photo-uploader p
) {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .premium-back, .world-hearts-button, .story-tip, .user-hooks-add, .participant-add, .subscription-status-badge
) {
  background: var(--infernal-sheen), var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-collection-back, .premium-panel, .premium-back, .premium-extra-card, .secondary-action, .style-option.active,
  .settings-avatar-wrap img
) {
  box-shadow: var(--infernal-inner), var(--infernal-glow) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .avatar-meaning-note, .story-detail-copy h1, .sheet-author-metrics strong
) {
  text-shadow: 0 0 10px rgba(var(--infernal-glow-rgb), 0.35) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .avatar-meaning-note {
  border-left-color: var(--infernal-ruby) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .nav-new-indicator {
  background: var(--infernal-ruby) !important;
  box-shadow: 0 0 8px rgba(var(--infernal-glow-rgb), 0.8) !important;
}

/* The Premium page: the violet night-city picture turns blood red; its cards are obsidian glass. */
html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero {
  background: var(--infernal-glass-strong) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero > img {
  filter: hue-rotate(85deg) saturate(1.15) brightness(0.9);
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .premium-hero > img {
  filter: hue-rotate(85deg) saturate(0.9) brightness(1.05);
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.premium-benefits article, .premium-extra-card, .premium-panel, .terms-panel) {
  background: var(--infernal-sheen), var(--infernal-glass) !important;
}

/* Phones: the logo stands on the left over the heroes, so a soft veil behind it keeps the motto readable. */
@media (max-width: 767px) {
  html[data-infernal-active="true"] body:not(.admin-mode) .header > .brand {
    padding: 4px 10px 2px;
    border-radius: 14px;
    background: radial-gradient(ellipse at 45% 50%, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.3) 60%, transparent 78%);
  }

  html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header > .brand {
    background: radial-gradient(ellipse at 45% 50%, rgba(240, 240, 243, 0.82), rgba(240, 240, 243, 0.45) 60%, transparent 78%);
  }
}

/* The page column's thin violet ring (from the wide-screen frame) becomes the theme's silver. */
@media (min-width: 768px) {
  html[data-infernal-active="true"] body:not(.admin-mode) .app-container {
    box-shadow: 0 0 0 1px var(--infernal-edge-soft), 0 24px 80px rgba(0, 0, 0, 0.55) !important;
  }
}

/* ---------- Infernal 02: шапка, прозрачные панели каталога, неон выбранного раздела, остатки розового ---------- */

/* Header: the logo and the motto in the middle (no veil behind them), the buttons in a row at the bottom right. */
html[data-infernal-active="true"] body:not(.admin-mode) .header > .brand,
html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header > .brand {
  position: absolute !important;
  left: 50% !important;
  top: 46% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  text-align: center !important;
  align-items: center !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header .logo {
  margin: 0 auto !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header .logo {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline::after {
  margin: 4px auto 0 !important;
  background-position: center !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .header > .header-actions {
  position: absolute !important;
  right: 16px;
  bottom: 12px;
  top: auto !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px !important;
}

@media (max-width: 767px) {
  html[data-infernal-active="true"] body:not(.admin-mode) .header > .brand,
  html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .header > .brand {
    top: 34% !important;
  }

  /* (the small thorned line under the motto stays on wide screens: on a phone the buttons need the room) */
  html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline::after {
    display: none !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header .logo {
    font-size: 34px !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header .tagline {
    font-size: 11px !important;
    white-space: nowrap;
  }


  html[data-infernal-active="true"] body:not(.admin-mode) .header > .header-actions {
    right: 12px;
    bottom: 8px;
    gap: 12px !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header > .header-actions > * {
    min-height: 28px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .header > .header-actions .header-auth-button {
    padding: 4px 16px !important;
  }
}

/* Catalog and cabinet bars (sections, genres): no coloured plate and no visible border, only the buttons. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.catalog-tabs, .sub-nav) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* The chosen section, genre, tab or menu item: a neon rim and glow — crimson in the dark, scarlet on the grey. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .catalog-tab.active, .sub-nav-item.active, .segment-btn.active, .theme-switcher button.active
) {
  border-color: rgba(var(--infernal-neon-rgb), 0.95) !important;
  box-shadow:
    inset 0 0 10px rgba(var(--infernal-neon-rgb), 0.35),
    0 0 0 1px rgba(var(--infernal-neon-rgb), 0.85),
    0 0 14px rgba(var(--infernal-neon-rgb), 0.75),
    0 0 28px rgba(var(--infernal-neon-rgb), 0.4) !important;
  text-shadow: 0 0 8px rgba(var(--infernal-neon-rgb), 0.7) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .nav-item.active {
  text-shadow: 0 0 8px rgba(var(--infernal-neon-rgb), 0.95), 0 0 16px rgba(var(--infernal-neon-rgb), 0.6) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .nav-item.active :is(svg, .nav-icon) {
  filter: drop-shadow(0 0 6px rgba(var(--infernal-neon-rgb), 0.9)) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) {
  --infernal-neon-rgb: 190, 12, 30;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) {
  --infernal-neon-rgb: 255, 36, 24;
}

/* The character card: its button bar has the card's own colour (not a beige band). */
html[data-infernal-active="true"] body:not(.admin-mode) .sheet-actions {
  background: var(--infernal-glass-strong) !important;
  border-top-color: var(--infernal-edge-soft) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .sheet-stat-bar {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .sheet-stat-bar {
  background: rgba(110, 110, 122, 0.22) !important;
}

/* The site's own pink headings and marks (light theme) and lilac rims: bordeaux / the theme's silver. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .sheet-tabs .active, .sheet-identity h2, .sheet-heart, .sheet-section h3, .sheet-card h3, .settings-achievements h3,
  .user-hooks-head h3, .user-story-history-title, .author-media-head h3, .story-detail-copy h1, .photo-preview,
  .photo-preview :is(b, span), .extra-photo-pick, .behavior-panel h3, .setting-row b, .style-option.active,
  .style-option.active span, .npc-stat-row b, .settings-row i, .personality-name
) {
  color: var(--infernal-accent) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) :is(
  .sheet-tabs .active, .sheet-identity h2, .sheet-heart, .sheet-section h3, .sheet-card h3, .settings-achievements h3,
  .user-hooks-head h3, .user-story-history-title, .author-media-head h3, .story-detail-copy h1, .behavior-panel h3,
  .personality-name
) {
  color: #7a0f1a !important;
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .personality-name {
  background: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .active-dot {
  background: var(--infernal-ruby) !important;
  box-shadow: 0 0 6px rgba(var(--infernal-neon-rgb), 0.9) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .author-level-badge, .cabinet-personalities-panel, .cabinet-npc-panel, .cabinet-characters-panel, .cabinet-saved-panel,
  .cabinet-saved-detail-panel, .author-profile-card, .photo-preview, .extra-photo-pick, .style-option, .pwa-network-status
) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .world-chat-error {
  color: #e0242e !important;
}

/* «Активировать» on the Premium page: the site stretches it to the full width, so here it takes the compact crowned
   plate (short wing stubs, no long wings past the card's edge) and the crown sits in its own room above it. */
html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero .premium-activate,
html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .premium-hero .premium-activate {
  margin: 30px 0 0 !important;
  border-image-source: url("assets/seasonal/infernal/btn-premium-compact-dark.webp") !important;
  border-image-slice: 38 63 38 67 fill !important;
  border-image-width: 18px 30px 18px 32px !important;
  border-image-outset: 6px var(--infernal-ox, 13px) 6px var(--infernal-ox, 13px) !important;
}

html[data-infernal-active="true"] body.theme-light:not(.admin-mode) .premium-hero .premium-activate {
  border-image-source: url("assets/seasonal/infernal/btn-premium-compact-light.webp") !important;
  border-image-slice: 38 67 38 72 fill !important;
  border-image-width: 18px 32px 18px 34px !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero .premium-activate::after {
  top: -28px !important;
  width: 44px !important;
  height: 28px !important;
}

@media (max-width: 767px) {
  html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero .premium-activate {
    width: calc(100% - 28px) !important;
    margin-inline: 14px !important;
  }
}

/* Text buttons on the secondary plate (back to the worlds list, refresh from the card): room for the plate. */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.world-back-button, .slot-detail-refresh) {
  min-height: 36px !important;
  padding: 6px 24px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

/* Phones: the plates' side tips stay inside the screen and clear of each other; the card's buttons get room. */
@media (max-width: 767px) {
  html[data-infernal-active="true"] body:not(.admin-mode) {
    --infernal-ox: 3px;
  }

  html[data-infernal-active="true"] body:not(.admin-mode) .sheet-actions {
    column-gap: 14px !important;
    row-gap: 16px !important;
    padding-inline: 12px !important;
  }

  /* the wide gothic capitals fit the half-width plates on one line */
  html[data-infernal-active="true"] body:not(.admin-mode) .sheet-actions button {
    font-size: 11px !important;
    letter-spacing: 0 !important;
    padding-inline: 10px !important;
    white-space: nowrap;
  }
}

/* The Premium page title was lilac: the theme's own text with its glow. */
html[data-infernal-active="true"] body:not(.admin-mode) .premium-panel :is(h1, h2) {
  color: var(--infernal-text) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: 0 0 10px rgba(var(--infernal-neon-rgb), 0.55) !important;
}

/* Empty lists («пока пуст», «скоро появятся»): the theme's own glass, not the site's pink card. */
html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card {
  background: var(--infernal-sheen), var(--infernal-glass) !important;
  border-color: var(--infernal-edge-soft) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card b {
  color: var(--infernal-text) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-placeholder-card span {
  color: var(--infernal-muted) !important;
}

/* The Premium page: the look's own picture behind «MiTi Premium» (the site's violet night city is hidden); a soft
   dark band at the bottom keeps the words readable. */
html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.62) 100%),
    image-set(
      url("assets/seasonal/infernal/premium.avif") type("image/avif"),
      url("assets/seasonal/infernal/premium.webp") type("image/webp")
    ) center / cover no-repeat,
    #0b0a0e !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero > img {
  display: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero-content strong {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 14px rgba(0, 0, 0, 0.5) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero-content span {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* What Premium gives: the look's own colours (the site's light theme paints them pink and plum). */
html[data-infernal-active="true"] body:not(.admin-mode) .premium-benefits article span {
  color: var(--accent-pink) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-benefits article b {
  color: var(--text-main) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-benefits article small {
  color: var(--text-muted) !important;
}

/* ---------- Остатки стандартной фиолетовой темы (формы, анкета, подписка, правила, миры, точки) ---------- */

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .form-field, .form-input, .form-textarea, .photo-uploader, .participant-builder, .participant-add, .behavior-panel,
  .style-option, .roleplay-mode-card, .roleplay-mode-card > i, .section-container, .gameplay-section, .settings-history-panel,
  .author-profile-card, .terms-panel, .terms-meta, .premium-panel, .premium-back, .premium-hero, .premium-benefits > article,
  .premium-section-title, .world-composer, .world-mode-switch > button, .world-hearts-button, .sheet-portrait-wrap,
  .subscription-meta > div, .subscription-status-badge, .home-collection-back, .secondary-action, .catalog-tabs, .sheet-card, .sheet-stat-bar, .sheet-tabs, .sheet-actions, .sheet-identity > blockquote, .sheet-close,
  .sheet-x, .settings-history-back, .avatar-meaning-note, .extra-photo-pick, .photo-preview, .user-hooks-add,
  .referral-link-row > button, .author-level-badge, .home-user-row > b
) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .subscription-status-badge, .premium-back, .world-hearts-button, .user-hooks-add, .referral-link-row > button,
  .participant-add, .world-mode-switch > button, .style-option, .roleplay-mode-card, .photo-uploader, .secondary-action,
  .behavior-panel, .participant-builder, .terms-panel, .premium-benefits > article, .extra-photo-pick, .sheet-stat-bar,
  .sheet-hooks button, .sheet-hook, .user-hook-card
) {
  background: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .field-label, .field-label > small, .field-counter, .create-text, .behavior-panel > h3, .sheet-card > h3,
  .sheet-section > h3, .sheet-identity > h2, .sheet-heart, .subscription-status-card > h3, .terms-content > h3,
  .terms-content > h4, .user-hooks-head > h3, .user-story-history-title, .settings-history-head > b, .setting-row > b,
  .photo-preview > b, .style-option > span, .premium-section-title, .roleplay-mode-card > i, .world-mode-switch > span,
  .home-user-row > b, .extra-photo-pick, .home-collection-back, .secondary-action, .settings-row-icon, .input-icon
) {
  color: var(--infernal-accent) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .sheet-identity > p, .sheet-section > p, .sheet-stat > span, .terms-content p, .terms-content ul, .terms-content li,
  .subscription-status-card > p, .subscription-note, .premium-footer-links > p, .extra-photos > p, .photo-uploader > p,
  .home-section-note, .home-media-author, .roleplay-mode-card > span, .setting-row > span, .photo-preview > span, .terms-meta,
  .avatar-meaning-note, .sheet-identity > blockquote
) {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .settings-avatar-wrap > img:not(.dragon-frame-overlay), .catalog-favorite, .sheet-portrait-wrap, .style-option.active,
  .home-collection-back, .secondary-action, .premium-panel, .premium-back
) {
  box-shadow: 0 0 0 1px var(--infernal-edge-soft) !important;
}

/* small marks and bars: the look's own colour instead of violet */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.notice-dot, .nav-new-indicator) {
  background: var(--infernal-ruby) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .sheet-stat-bar > i {
  background: linear-gradient(90deg, var(--infernal-accent), var(--infernal-ruby)) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.style-option.active, .world-mode-switch > button.active, .roleplay-mode-card.active) {
  border-color: var(--infernal-accent) !important;
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .btn-premium > svg {
  color: var(--infernal-accent) !important;
  filter: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.form-input, .form-textarea, .world-composer > textarea, .settings-motto > textarea) {
  color: var(--infernal-text) !important;
  caret-color: var(--infernal-accent);
}

/* (second pass) panels the light theme paints pink, violet glows on words, the plain words inside violet blocks */
html[data-infernal-active="true"] body:not(.admin-mode) :is(.author-profile-card, .section-container, .gameplay-section, .form-field, .world-composer) {
  background: var(--infernal-glass) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .home-media-card {
  background-color: transparent !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.home-collection-back, .home-media-author, .sheet-portrait-wrap) {
  background: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-hero {
  box-shadow: 0 0 0 1px var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.settings-motto > textarea, .world-composer > textarea) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .sheet-tabs .active, .avatar-meaning-note, .catalog-card-overlay > strong, .catalog-favorite, .photo-preview,
  .photo-preview > span, .setting-row > span, .sheet-close, .sheet-x, .subscription-status-badge, .tagline
) {
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .nav-new-indicator, .participant-add, .roleplay-mode-card, .sheet-stat, .sheet-stat-bar, .sheet-tabs, .terms-content,
  .user-hooks-add, .world-mode-switch > button, #world-mode-switch > button, .settings-history-back, .subscription-status-badge,
  .sheet-close, .sheet-x, .photo-preview, #home-collection-author-search span, #catalog-create-character small,
  #sheet-author-metrics strong, .premium-footer-links button, .participant-builder-head b, .story-tip b
) {
  color: var(--infernal-accent) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.premium-title-row h2, .story-detail-copy p) {
  color: var(--infernal-text) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .premium-title-row p, #sheet-author-metrics span, #sheet-preferences span, .roleplay-mode-card small,
  .subscription-meta span, .story-info-block p, .story-tip p
) {
  color: var(--infernal-muted) !important;
  text-shadow: none !important;
}

/* (third pass) tabs, marks, profile fields and counters still in the site's violet; the chosen ones keep their neon */
html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-rank, .home-card-stat, .author-level-badge, .author-level-mark, .home-media-badge, .sub-nav-item:not(.active),
  .sub-nav-item:not(.active) b, .catalog-mode-icon, .catalog-tab:not(.active), .cat-icon, .catalog-create-icon,
  .catalog-create-cta, .catalog-create-cta span, .catalog-create-cta b, .catalog-create-cta small, .catalog-create-arrow,
  .btn-change-avatar, .premium-activate, .premium-benefits article span, .premium-benefits article b, .primary-action,
  .settings-main-title, #sheet-author-metrics strong, .subscription-meta strong, .subscription-meta b, .story-tip b,
  #world-play-title
) {
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-rank, .home-see-all, .home-media-badge, .avatar-wrapper, .section-subtitle, .segment-btn:not(.active),
  .catalog-mode-icon, .catalog-tab:not(.active), .catalog-create-icon, .settings-profile-save-btn, .settings-username-field,
  .sub-nav-item:not(.active)
) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .home-rank, .preview-image-container, .catalog-tab:not(.active), .catalog-create-icon, .settings-profile-save-btn,
  .section-container, .gameplay-section, .subscription-status-badge, .world-composer > textarea, .sub-nav-item:not(.active)
) {
  box-shadow: 0 0 0 1px var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(
  .section-subtitle, .segment-btn:not(.active), .sub-nav-item:not(.active), .sub-nav-item:not(.active) b, .catalog-mode-icon,
  .settings-username-field, .settings-username-field > span, .settings-main-title, .settings-version, .theme-switcher button,
  .theme-auto, .referral-card > span, .settings-tab-note, .empty-state-panel, h3 > small, .user-hooks-note, .author-level-mark,
  .subscription-meta strong, .subscription-meta b, .settings-row > b, .settings-row > i, .settings-motto > span,
  .settings-subscription-line, .romance-status, .slider-value, .icon-back
) {
  color: var(--infernal-accent) !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) #world-play-title {
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(.avatar-wrapper, .preview-image-container) {
  background-color: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-panel {
  background: var(--infernal-glass) !important;
}

/* the catalog bars stay bare in every look (as the owner chose for Infernal): only their buttons show */
html[data-infernal-active="true"] body:not(.admin-mode) .catalog-tabs {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(#author-character-form-title, #user-character-form-title, .sheet-tabs .active) {
  text-shadow: none !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) :is(#subscription-page-subtitle, #author-page-subtitle) {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body:not(.admin-mode) .premium-benefits article span {
  color: var(--infernal-accent) !important;
}
/* ---------- «Переписка» (смс) в цветах оформления ---------- */

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) {
  --sms-blue: var(--infernal-accent);
  --sms-blue-soft: var(--infernal-edge-soft);
  --sms-blue-glow: transparent;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) :is(.sms-shell, .site-chat-header, .site-chat-avatar, .site-chat-composer textarea, .sms-day) {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) :is(.sms-title span, .sms-title span.typing) {
  color: var(--infernal-accent) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) .sms-log .site-chat-message.user .site-chat-bubble {
  background: var(--infernal-ruby) !important;
  border-color: var(--infernal-accent) !important;
  color: #ffffff !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) .sms-log .site-chat-message.assistant .site-chat-bubble {
  border-color: var(--infernal-edge-soft) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) :is(.sms-time, .sms-hint, .sms-day) {
  color: var(--infernal-muted) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) .sms-buy {
  background: var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge-soft) !important;
  color: var(--infernal-text) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) :is(.sms-buy-action, .sms-settings-actions button[type="submit"]) {
  background: var(--infernal-ruby) !important;
  color: #ffffff !important;
  border: 1px solid var(--infernal-accent) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) .sms-settings-card {
  background: var(--infernal-glass-strong) !important;
  border-color: var(--infernal-edge-soft) !important;
  color: var(--infernal-text) !important;
  box-shadow: none !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) :is(.sms-settings-card select, .sms-settings-card input[type="text"], .sms-settings-actions button) {
  border-color: var(--infernal-edge-soft) !important;
  color: var(--infernal-text) !important;
  background: var(--infernal-glass-row) !important;
}

html[data-infernal-active="true"] body.sms-chat-body:not(.admin-mode) .sms-settings-card p {
  color: var(--infernal-muted) !important;
}

/* ---------- Телефоны: свои копии фона и шапки (вертикальные, лёгкие) ---------- */

@media (max-width: 767px), (max-width: 1099px) and (orientation: portrait) {
  html[data-infernal-active="true"] body:not(.admin-mode) {
    --infernal-picture: image-set(
      url("assets/seasonal/infernal/background-dark-phone.avif") type("image/avif"),
      url("assets/seasonal/infernal/background-dark-phone.webp") type("image/webp")
    );
    --infernal-banner: image-set(
      url("assets/seasonal/infernal/banner-dark-m.avif") type("image/avif"),
      url("assets/seasonal/infernal/banner-dark-m.webp") type("image/webp")
    );
  }

  html[data-infernal-active="true"] body.theme-light:not(.admin-mode) {
    --infernal-picture: image-set(
      url("assets/seasonal/infernal/background-light-phone.avif") type("image/avif"),
      url("assets/seasonal/infernal/background-light-phone.webp") type("image/webp")
    );
    --infernal-banner: image-set(
      url("assets/seasonal/infernal/banner-light-m.avif") type("image/avif"),
      url("assets/seasonal/infernal/banner-light-m.webp") type("image/webp")
    );
  }
}

/* ---------- ПК и планшет боком: свои фоны 16:9 ---------- */

@media (min-width: 1100px), (min-width: 768px) and (orientation: landscape) {
  html[data-infernal-active="true"] body:not(.admin-mode) {
    --infernal-picture: image-set(
      url("assets/seasonal/infernal/background-dark-pc.avif") type("image/avif"),
      url("assets/seasonal/infernal/background-dark-pc.webp") type("image/webp")
    );
  }

  html[data-infernal-active="true"] body.theme-light:not(.admin-mode) {
    --infernal-picture: image-set(
      url("assets/seasonal/infernal/background-light-pc.avif") type("image/avif"),
      url("assets/seasonal/infernal/background-light-pc.webp") type("image/webp")
    );
  }
}
