/* r223.css (#1014 / #1064) — Cohesive AAA Dark-Fantasy Polish + Target Fidelity across ALL 6 Slices (Desktop + Phone):
   1. Enforces uniform editorial serif (Alegreya) across ALL narrative subtitles, lore, bullets, and notices; sans strictly for controls.
   2. Unifies Desktop (>= 1041px) width on one consistent 1180px grid + transparent .chapter-divider (eliminates Slice 2 bottom box peek).
   3. Slice 4 Callings: 4px chamfered left-accent skill plaques (zero 999px cramping), 3-tier selected hierarchy (Calling > Path > Ancestry/Body),
      full-height Fighter portrait (0px dead void), crisp Stalker/Mage medallions, muted Monk glow, distinct dashed locked Ancestries.
   4. Slice 3 Realms: subtle inner dark vignette framing Thalenyr painting + unified seamless card border on Phone (0 horizontal divider seam).
   5. Mobile (<= 699px): 3-line target-phone Hero headline protecting faces, 88px top-aligned crest, subtle left-rule eyebrow, visual 44px sticky PLAY,
      inline BODY row + 132px seamless R31 Fighter portrait (zero #000 bottom box), breathable Slice 2 top clearance & compact bottom spacing, crisp WebGPU/top links.
   Honors EVERY owner lock (content.js verbatim copy, .chapter-divider, 0 step badges, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   1. GLOBAL TYPOGRAPHY, TRANSPARENT DIVIDERS, 3-TIER CALLINGS HIERARCHY & PLAQUES
   ============================================================================ */
/* Editorial serif across ALL narrative lead subtitles, card lore, Realm laws, and notices */
html:root body section#journey .head p.lead,
html:root body section#realms .head p.lead,
html:root body section#callings .head p.lead,
html:root body section#intro p.lead,
html:root body #hero .cta-notes .promo,
html:root body #world .s-copy p,
html:root body #journey figcaption p,
html:root body section#realms #realm-card p.law,
html:root body section#realms #realm-card ul li,
html:root body #callings #calling-panel .adv-card p.about,
html:root body section#callings #lock-note,
html:root body section#play.final .final-copy p.final-member-note,
html:root body footer#account.foot .foot-tagline,
html:root body footer#account.foot .foot-legal {
  font-family: var(--body) !important;
}

/* Eliminate faint box background behind .chapter-divider */
html:root body .chapter-divider,
html:root body .chapter-divider.chapter-divider-sub {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Crisp unboxed WebGPU caveat + readable Back to top link */
html:root body section#play.final .final-copy p.req,
html:root body #play .final-copy p.req {
  display: inline-block !important;
  background: rgba(10, 8, 5, 0.58) !important;
  border: 0 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  padding: 3px 12px !important;
  margin-top: 8px !important;
  color: rgba(232, 220, 196, 0.90) !important;
  font-family: var(--ui-sans) !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.98) !important;
}
html:root body footer#account.foot a[href="#top"] {
  color: #d8bc7c !important;
}

/* Chamfered Dark-Fantasy Skill Preview Plaques (replaces cramped 999px SaaS ovals) */


/* 3-Tier Visual Hierarchy in Slice 4: Calling Tab > Path Tile > Subordinate Ancestry/Body Toggle */
html:root body section#callings #calling-row > button.calling[aria-selected="true"] {
  border: 1.5px solid #f0cf82 !important;
  background: linear-gradient(180deg, rgba(84, 60, 25, 0.92) 0%, rgba(28, 20, 11, 0.98) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 242, 198, 0.34), 0 4px 12px rgba(0, 0, 0, 0.50) !important;
  color: #fff8e8 !important;
}
html:root body #callings #calling-panel .adv-row .adv-btn[aria-selected="true"] {
  border: 1px solid rgba(232, 199, 122, 0.68) !important;
  background: linear-gradient(180deg, rgba(64, 46, 20, 0.72) 0%, rgba(26, 19, 11, 0.92) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 198, 0.20) !important;
  color: #fbf1d9 !important;
}
html:root body #callings #calling-panel button.cp-chip[aria-checked="true"],
html:root body #callings #calling-panel .cp-desk .cp-trow button.cp-chip[aria-checked="true"],
html:root body #callings #calling-panel .cp97 .cp-toggle .cp-trow button.cp-chip[aria-checked="true"],
html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip[aria-checked="true"],
html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type button.cp-chip[aria-checked="true"] {
  background: rgba(218, 180, 108, 0.12) !important;
  background-image: none !important;
  border: 1px solid rgba(218, 180, 108, 0.56) !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 196, 0.10) !important;
  color: #f3e6ca !important;
}

/* Crisp locked medallions (STALKER & MAGE stay clearly readable), muted Monk glow, distinct locked Ancestries */
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] {
  opacity: 0.88 !important;
  filter: none !important;
  color: #c2b49a !important;
  border-color: rgba(186, 158, 108, 0.24) !important;
}
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] .medal img {
  filter: saturate(0.84) brightness(0.98) !important;
  opacity: 0.94 !important;
}
html:root body #callings #calling-panel .adv-row .adv-btn:nth-child(4) img {
  filter: saturate(0.68) brightness(0.90) sepia(0.14) !important;
}
html:root body #callings #calling-panel button.cp-chip[aria-checked="false"]:is([data-v="dwarf"], [data-v="halfling"]),
html:root body #callings #calling-panel button.cp-chip[aria-checked="false"]:has(.cp-lock) {
  opacity: 0.78 !important;
  color: #8f826f !important;
  border: 1px dashed rgba(186, 158, 104, 0.28) !important;
  background: rgba(9, 7, 5, 0.84) !important;
}

/* ============================================================================
   2. DESKTOP (>= 700px): INNER REALM VIGNETTE & SLICE RHYTHM
   ============================================================================ */
@media (min-width: 700px) {
  html:root body section#realms .realm-media .realm-pics {
    position: relative !important;
  }
  html:root body section#realms .realm-media .realm-pics::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    box-shadow: inset 0 0 42px rgba(10, 8, 5, 0.62) !important;
    pointer-events: none !important;
    z-index: 5 !important;
  }
}

/* ============================================================================
   3. DESKTOP (>= 1041px): UNIFIED 1180PX GRID, FULL-HEIGHT FIGHTER & BALANCED FOLDS
   ============================================================================ */
@media (min-width: 1041px) {
  html:root body #journey .wrap,
  html:root body #realms .wrap,
  html:root body #callings .wrap {
    width: min(1180px, calc(100% - 80px)) !important;
    max-width: 1180px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  html:root body #journey .j-swipe,
  html:root body #journey #game-band,
  html:root body #journey #journey-grid,
  html:root body section#realms #realm-tabs,
  html:root body section#realms #realm-stage,
  html:root body section#callings #calling-row,
  html:root body section#callings #calling-panel,
  html:root body .chapter-divider,
  html:root body .chapter-divider.chapter-divider-sub {
    width: min(1180px, calc(100% - 80px)) !important;
    max-width: 1180px !important;
  }
  html:root body #journey .j-swipe,
  html:root body #journey #game-band,
  html:root body #journey #journey-grid,
  html:root body section#realms #realm-tabs,
  html:root body section#realms #realm-stage,
  html:root body section#callings #calling-row,
  html:root body section#callings #calling-panel {
    width: 100% !important;
  }
  html:root body footer#account.foot .wrap {
    width: min(1240px, calc(100% - 80px)) !important;
    max-width: 1240px !important;
  }

  /* Center new waist-up Creator Fighter cleanly without cutting off head */
  html:root body #game-band figure.frame:first-child .clip img {
    object-position: 50% 24% !important;
  }

  /* Slice 2 -> 3 -> 4 vertical spacing & balanced column bottoms */
  html:root body section#journey.band {
    padding: 82px 0 18px !important;
  }
  html:root body section#realms.band {
    padding: 100px 0 92px !important;
  }
  html:root body section#realms .realm-media,
  html:root body section#realms .realm-pics,
  html:root body section#realms #realm-card {
    height: 332px !important;
    min-height: 332px !important;
    max-height: 332px !important;
    box-sizing: border-box !important;
  }
  html:root body section#realms #realm-card {
    padding: 22px 28px !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  html:root body section#callings.band {
    padding: 158px 0 2px !important;
  }
  html:root body section#callings #calling-panel {
    grid-template-columns: 604px minmax(0, 1fr) !important;
    gap: 24px !important;
    padding: 20px 24px !important;
    align-items: stretch !important;
  }
  html:root body #callings #calling-panel .calling-base {
    grid-template-columns: 238px minmax(340px, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
  html:root body #callings #calling-panel .calling-base > .adv-media.base-fig {
    height: 100% !important;
    min-height: 344px !important;
    max-height: none !important;
    align-self: stretch !important;
  }
  html:root body #callings #calling-panel .calling-base > .adv-media.base-fig > img.fig {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 8% !important;
  }
  html:root body #callings .lock-note#lock-note {
    margin: 12px auto 6px !important;
    padding-top: 8px !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 48px !important;
    min-height: 48px !important;
    padding: 6px 24px !important;
    margin: 0 auto !important;
  }
  html:root body section#play.final {
    padding: 138px 0 112px !important;
  }
}

/* ============================================================================
   4. MOBILE (<= 699px): TARGET-PHONE 3-LINE HERO, 44PX PLAY, SEAMLESS REALMS & 132PX R31 PORTRAIT
   ============================================================================ */
@media (max-width: 699px) {
  /* Sticky header compact PLAY visual plate matched to menu button height */
  html:root body.scrolled:not(.at-cta) header#bar.bar:not(.open) a.btn.btn-play {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    background-size: 100% 100% !important;
  }

  /* Target-Phone Hero: top-aligned 88px crest, cleared subject face, unboxed left-rule eyebrow, 3-line H1 */
  html:root body #hero .hero-poster,
  html:root body #hero .hero-canvas {
    object-position: 50% 34% !important;
  }
  html:root body #hero .hero-logo {
    top: 12px !important;
  }
  html:root body #hero .hero-logo .emblem,
  html:root body #hero .hero-logo .emblem .sse-emblem,
  html:root body #hero .hero-logo .emblem canvas {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    flex: 0 0 88px !important;
  }
  html:root body #hero .hero-logo .emblem img {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    inset: 0 !important;
  }
  html:root body #hero .hero-logo .wordmark {
    font-size: 26px !important;
    margin-top: 6px !important;
  }
  html:root body section#hero.hero .hero-copy p#hero-eyebrow.eyebrow {
    border: 0 !important;
    border-left: 2px solid rgba(232, 199, 122, 0.72) !important;
    border-radius: 2px !important;
    background: linear-gradient(90deg, rgba(10, 8, 5, 0.84) 0%, rgba(10, 8, 5, 0.24) 100%) !important;
    padding: 4px 12px !important;
  }
  html:root body section#hero.hero .hero-copy h1#hero-title {
    font-size: 24px !important;
    line-height: 1.14 !important;
    text-align: left !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
  }
  html:root body section#hero.hero .hero-copy h1#hero-title span:first-child,
  html:root body section#hero.hero .hero-copy h1#hero-title span:last-child {
    display: inline !important;
  }
  html:root body #hero .cta-notes .promo {
    max-width: 31ch !important;
    margin: 0 auto !important;
  }
  html:root body #hero .hero-dots,
  html:root body #hero .motion-toggle {
    border-radius: 3px !important;
    border: 1px solid rgba(218, 180, 108, 0.36) !important;
    background: rgba(12, 9, 6, 0.84) !important;
  }

  /* Slice 2 top clearance & compact Slice 2 -> 3 cadence */
  html:root body section#journey.band {
    padding: 74px 0 12px !important;
  }
  html:root body section#realms.band {
    padding: 174px 0 0 !important;
  }

  /* Fuse Thalenyr artwork and lore text into ONE seamless card (zero horizontal seam) */
  html:root body section#realms .realm-media {
    border-bottom: 0 !important;
    border-radius: 3px 3px 0 0 !important;
    box-shadow: none !important;
  }
  html:root body section#realms .realm-media::after,
  html:root body section#realms .realm-media .realm-pics::after {
    height: 56px !important;
    background: linear-gradient(180deg, rgba(21, 16, 12, 0) 0%, #15100c 100%) !important;
  }
  html:root body section#realms #realm-card {
    border-top: 0 !important;
    border-radius: 0 0 3px 3px !important;
    margin-top: 0 !important;
  }

  /* Slice 4 Mobile: 120px seamless R31 portrait (no black box), inline BODY row, >=44px skills (R32) */
  html:root body section#callings.band {
    padding: 84px 0 0 !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 {
    gap: 4px !important;
    padding: 4px 11px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-fig {
    position: relative !important;
    flex: 0 0 120px !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: radial-gradient(ellipse 46% 58% at 50% 52%, rgba(218, 180, 108, 0.14) 0%, rgba(21, 16, 12, 0) 72%) !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-fig::after {
    display: none !important;
    content: none !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-fig > img,
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig > img,
  html:root body #callings #calling-panel .cp97 .cp-dfig > img {
    height: 116px !important;
    max-height: 116px !important;
    width: auto !important;
    object-fit: contain !important;
    -webkit-mask-image: radial-gradient(ellipse 45% 48% at 50% 50%, #000 62%, rgba(0, 0, 0, 0) 99%) !important;
    mask-image: radial-gradient(ellipse 45% 48% at 50% 50%, #000 62%, rgba(0, 0, 0, 0) 99%) !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 0 !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type .cp-tlabel {
    grid-column: auto !important;
    width: auto !important;
    margin: 0 6px 0 0 !important;
  }
  html:root body section#callings .lock-note#lock-note {
    margin: 2px auto 0 !important;
    padding: 2px 10px !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 16px !important;
  }
  html:root body section#play.final {
    padding: 80px 16px 46px !important;
  }
}
