/* Sacralib Codex V2.4 — design kit art recovery / correct image framing.
 * All selectors are scoped to the authenticated owner's V2 preview.
 * No style leaks into the normal website or the admin editor.
 */
body.codex-site-v2-current {
  --sv23-paper: #f8f3e9;
  --sv23-surface: #f5eedf;
  --sv23-ink: #29241e;
  --sv23-muted: #756a5c;
  --sv23-wood: #90673b;
  --sv23-line: #d8c6a9;
  background-image: url('/assets/codex-v23-art/left-scenery.webp?v=24'),
                    url('/assets/codex-v23-art/right-scenery.webp?v=24'),
                    linear-gradient(180deg,#faf5ec,#f2ebdd) !important;
  background-size: clamp(72px,6.5vw,112px) auto,
                   clamp(72px,6.5vw,112px) auto, auto !important;
  background-position: left 115px, right 115px, center top !important;
  background-repeat: no-repeat,no-repeat,no-repeat !important;
}
/* Proper isolated brand mark — not a screenshot rectangle or a cropped logo. */
body.codex-site-v2-current .codex-navbar .brand-mark {
  width:54px!important;height:54px!important;min-width:54px!important;
  background: url('/assets/codex-v24-art/brand-mark.webp?v=24') center/contain no-repeat!important;
  border:0!important;box-shadow:none!important;flex-shrink:0;
}
body.codex-site-v2-current .codex-navbar .brand-mark > :is(img,svg) {
  visibility:hidden!important;
}
/* Kit banners are transparent; no hard-edged white paper cutout. */
body.codex-site-v2-current .cv2-banner,
body.codex-site-v2-current .cv2-banners .cv2-banner {
  background: url('/assets/codex-v23-art/flag.webp?v=24') center top/contain no-repeat!important;
  width:clamp(66px,6vw,101px)!important;
  height:218px!important;
  filter:drop-shadow(2px 5px 4px rgba(40,25,15,.22))!important;
}
body.codex-site-v2-current .cv2-banner-right { transform:scaleX(-1)!important; }
/* Cropped icons in v2.3 had parchment corners baked into the images.
 * The original UI kit icons have been isolated, padded and saved with real alpha. */
body.codex-site-v2-current img.sv23-art-icon {
  display:block; object-fit:contain!important;object-position:center center!important;
  mix-blend-mode:normal!important;flex-shrink:0;
  background:transparent!important;border:0!important;
  filter:drop-shadow(0 1px 1px rgba(59,40,20,.08));
}
body.codex-site-v2-home .sv2-quick-item > .sv23-art-icon {
  width:48px!important;height:48px!important;
}
body.codex-site-v2-home .sv2-category-header .sv23-art-icon {
  width:48px!important;height:48px!important;
}
body.codex-site-v2-home .sv2-category h3 {
  font:700 clamp(15px,1.19vw,18px)/1.16 Georgia,serif!important;
  letter-spacing:-.018em!important;
  overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;
}
body.codex-site-v2-home .sv2-category-header {gap:7px!important;}
/* The six card headings must not split a word like ЭКИПИРОВКА in the middle. */
@media(min-width:1351px) {
 body.codex-site-v2-home .page-shell {padding-inline:clamp(28px,4.25vw,68px)!important;}
 body.codex-site-v2-home .sv2-category-grid {grid-template-columns:repeat(6,minmax(0,1fr))!important;}
}
@media(min-width:821px) and (max-width:1350px) {
 body.codex-site-v2-home .sv2-category-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
body.codex-site-v2-home .sv2-category,
body.codex-site-v2-home .sv2-panel,
body.codex-article-v2-active .cv2-layout .cv2-side-panel {
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.54),0 4px 13px rgba(79,51,28,.13)!important;
}
body.codex-site-v2-home .sv2-category:hover {
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.55),0 8px 20px rgba(68,42,19,.18)!important;
}
body.codex-site-v2-home .sv2-quick-strip {box-shadow:0 3px 10px rgba(64,45,25,.14)!important;}
body.codex-site-v2-home .sv2-quick-item {background:linear-gradient(135deg,#fffaf0,#f5ebde)!important;}
body.codex-site-v2-home .sv2-live-card {overflow:hidden;isolation:isolate;}
body.codex-site-v2-home .sv2-online::before {
  background-image:url('/assets/codex-v23-art/live-city.webp?v=24')!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
}
body.codex-site-v2-home .sv2-find-player::before {
  background-image:url('/assets/codex-v23-art/live-player.webp?v=24')!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
}
body.codex-site-v2-home .sv2-chaos::before {
  background-image:url('/assets/codex-v23-art/live-monster.webp?v=24')!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
}
/* The article map promo is portrait-like. V2.3 wrongly zoomed a 3.6:1 panorama
 * to fill a tall 200px sidebar; that cropped almost all of the content. */
body.codex-article-v2-active .cv2-layout .cv2-map-card {
  background:linear-gradient(0deg,rgba(12,18,24,.91),rgba(12,18,24,.02) 78%),
    url('/assets/codex-v24-art/map-card.webp?v=24') center center/cover no-repeat!important;
  min-height:191px!important;
}
/* Preserve game UI, maps and full-size illustrations: only decorative promotional
 * images are allowed to cover; actual article screenshots keep their proportions. */
body.codex-article-v2-active .cv2-layout .article-body figure.content-image img,
body.codex-article-v2-active .cv2-layout .article-body .content-world-map img {
  max-width:100%!important;height:auto!important;object-fit:contain!important;
}
body.codex-article-v2-active .cv2-layout .cv2-related-thumb[src$='.png'],
body.codex-article-v2-active .cv2-layout .cv2-related-thumb[src$='.webp'] {
  object-position:center!important;
}
@media(max-width:820px) {
 body.codex-site-v2-current {background-image:linear-gradient(#faf5eb,#eee2d0)!important;}
 body.codex-site-v2-current .cv2-banner {display:none!important;}
 body.codex-site-v2-current .codex-navbar .brand-mark {
   width:42px!important;height:42px!important;min-width:42px!important;
 }
}
@media(max-width:620px) {
 body.codex-site-v2-home .sv2-category h3 {font-size:14px!important;}
 body.codex-site-v2-home .sv2-category-header .sv23-art-icon {width:38px!important;height:38px!important;}
}
@media(prefers-reduced-motion:reduce) {
 body.codex-site-v2-current .sv2-category {transition:none!important;}
}
