/* r224.css (#1014 / #1064) — Architectural & Hierarchy Unification Pass across ALL 6 Slices (Desktop + Phone):
   1. Fixes ANCHOR GUARD border disparity bug (symmetric 4-sided 1px hairline border + circular .sk-play + explicit "CLICK TO PREVIEW").
   2. Unifies Desktop (>= 1041px) on ONE strict 1240px horizontal axis (Header brand, Hero, Sundering, Breach, Realms, Callings, Dividers, Footer).
   3. Fixes Footer SPHERES -> arrow 14px gap on Desktop & Mobile (clean 4px inline gap matching Header).
   4. Slice 3 Realms: restores "REALM OF" label hierarchy, fixes STONE vertical split thumbnail (24% 64%), dusk-harmonizes Thalenyr, eliminates Desktop card void.
   5. Slice 4 Callings: clear locked MAGE/STALKER & DWARF/HALFLING recession, separated 8px desktop BODY grid, muted Path rings, generous top clearance,
      and full-bleed vaulted sanctuary backdrop behind uncropped R31 Mobile Fighter portrait + aligned 50/50 BODY grid.
   6. Hero / Sticky Header: smoothed Slice 1 sky blend, rounded desktop SEE THE WORLD, Notch-safe 78px Mobile crest + 999px smoke eyebrow/dots,
      2-line Promo wrap, and crisp 40px chamfered gold Mobile sticky PLAY (zero pinched wings).
   Strictly honors EVERY owner lock (content.js verbatim copy, .chapter-divider, 0 step badges, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   1. SKILL PLAQUES (0 ASYMMETRIC BORDERS!), LOCKED/MUTED CALLINGS, REALM LABELS & FOOTER ARROW
   ============================================================================ */
/* Fix ANCHOR GUARD brighter-border disparity: identical 4-sided 1px hairline border + circular gold .sk-play badge */

html:root body #callings #calling-panel .calling-base dt::after {
  content: " \00B7  CLICK TO PREVIEW" !important;
  font-size: 9.5px !important;
  letter-spacing: 0.08em !important;
  color: rgba(218, 192, 138, 0.80) !important;
}
html:root body #callings #calling-panel .cp97 .cp-skills .cp-slabel::after {
  content: " \00B7  TAP TO PREVIEW" !important;
  font-size: 9px !important;
  letter-spacing: 0.08em !important;
  color: rgba(218, 192, 138, 0.82) !important;
}

/* Clearly distinguish locked MAGE/STALKER tabs + DWARF/HALFLING vs unlocked PRIEST/ELF + muted Path ring glow */
html:root body section#callings #calling-row > button.calling[aria-selected="false"]:not(.locked) {
  opacity: 1 !important;
  background: rgba(26, 19, 12, 0.88) !important;
  border: 1px solid rgba(218, 180, 108, 0.34) !important;
  color: #f2e4c8 !important;
}
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] {
  opacity: 0.76 !important;
  filter: none !important;
  background: rgba(9, 7, 5, 0.78) !important;
  border: 1px dashed rgba(176, 150, 102, 0.24) !important;
  color: #ada089 !important;
}
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] .medal img {
  filter: saturate(0.56) brightness(0.88) !important;
  opacity: 0.90 !important;
}
html:root body section#callings #calling-row > button.calling.locked small.medal-cap,
html:root body section#callings #calling-row > button.calling.locked small.medal-cap.lock-cap {
  color: #d0b06a !important;
}
html:root body #callings #calling-panel button.cp-chip[aria-checked="false"]:not([data-v="dwarf"]):not([data-v="halfling"]):not(:has(.cp-lock)) {
  background: rgba(30, 22, 14, 0.88) !important;
  border: 1px solid rgba(218, 180, 108, 0.36) !important;
  color: #eadec6 !important;
  opacity: 1 !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.72 !important;
  color: #938672 !important;
  border: 1px dashed rgba(176, 150, 102, 0.24) !important;
  background: rgba(8, 6, 4, 0.72) !important;
}
html:root body #callings #calling-panel .adv-row .adv-btn img {
  filter: saturate(0.62) brightness(0.92) !important;
}

/* Slice 3 Realms: Restore "REALM OF" label hierarchy, fix STONE thumbnail split, & harmonize Thalenyr twilight */
html:root body section#realms #realm-tabs > button.tab .rof {
  display: block !important;
  font-family: var(--ui-sans) !important;
  font-size: 8.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: rgba(214, 194, 152, 0.78) !important;
  line-height: 1.12 !important;
  margin-bottom: 1px !important;
}
html:root body section#realms #realm-tabs > button#realm-tab-stone::before {
  background-position: 24% 64% !important;
  background-size: 235% !important;
  filter: brightness(1.42) contrast(1.12) saturate(1.04) !important;
}
html:root body section#realms .realm-pics img {
  filter: brightness(0.84) contrast(1.08) saturate(0.85) sepia(0.09) !important;
}

/* Fix Footer SPHERES -> arrow 14px gap (match tight 4px Header spacing) & refine membership underline */
html:root body footer#account.foot .foot-links a[href="spheres.html"],
html:root body footer#account.foot .foot-notes .foot-links a[href="spheres.html"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  width: auto !important;
}
html:root body footer#account.foot .foot-links a[href="spheres.html"]::after,
html:root body footer#account.foot .foot-notes .foot-links a[href="spheres.html"]::after {
  margin-left: 0 !important;
}
html:root body a.membership-inline-link,
html:root body section#play.final .final-copy a.membership-inline-link {
  text-underline-offset: 3px !important;
}

/* ============================================================================
   2. DESKTOP (>= 700px): SOFT HERO GHOST & SCROLL CUE, SMOOTHER WORLD TOP FADE, SEPARATED BODY
   ============================================================================ */
@media (min-width: 700px) {
  html:root body #hero .hero-cta .btn-ghost {
    border-radius: 6px !important;
  }
  html:root body #hero a.scroll-cue {
    background: rgba(10, 8, 5, 0.88) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.78) !important;
  }
  html:root body section#world.band .sunder::before {
    height: 68px !important;
    background: linear-gradient(180deg, rgba(14, 11, 8, 0.90) 0%, rgba(14, 11, 8, 0.36) 54%, rgba(14, 11, 8, 0) 100%) !important;
  }

  /* Match desktop BODY row to separated ANCESTRY cards above + clear locked/unlocked hierarchy */
  html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type {
    gap: 8px !important;
  }
  html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip,
  html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip:first-of-type,
  html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip:last-of-type {
    border-radius: 3px !important;
    border: 1px solid rgba(218, 180, 108, 0.36) !important;
    border-right: 1px solid rgba(218, 180, 108, 0.36) !important;
    border-left: 1px solid rgba(218, 180, 108, 0.36) !important;
  }
  html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip[aria-checked="true"] {
    border-color: rgba(218, 180, 108, 0.58) !important;
  }

  /* Position medallion absolutely on left so stacked REALM OF + Name align cleanly */
  html:root body section#realms #realm-tabs > button.tab {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0 14px 0 64px !important;
    text-align: left !important;
    gap: 0 !important;
  }
  html:root body section#realms #realm-tabs > button.tab::before {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
  }
}

/* ============================================================================
   3. DESKTOP (>= 1041px): SINGLE 1240PX AXIS ACROSS ALL 6 SLICES, 0PX REALMS VOID, CLEAR CALLINGS
   ============================================================================ */
@media (min-width: 1041px) {
  html:root body header#bar.bar,
  html:root body #hero .hero-copy {
    padding-left: max(58px, calc(50% - 620px)) !important;
    padding-right: max(58px, calc(50% - 620px)) !important;
  }
  html:root body #world .s-copy {
    left: 0 !important;
    right: 0 !important;
    padding-left: max(58px, calc(50% - 620px)) !important;
    padding-right: max(58px, calc(50% - 620px)) !important;
  }
  html:root body section#world.band .sunder .s-marks {
    right: max(58px, calc(50% - 620px)) !important;
  }
  html:root body #journey .wrap,
  html:root body #realms .wrap,
  html:root body #callings .wrap,
  html:root body .chapter-divider,
  html:root body .chapter-divider.chapter-divider-sub,
  html:root body footer#account.foot .wrap,
  html:root body footer#account.foot .wrap.foot-grid,
  html:root body footer#account.foot .wrap.foot-legal,
  html:root body footer#account.foot .wrap.foot-meta {
    width: min(1240px, calc(100% - 116px)) !important;
    max-width: 1240px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !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;
    max-width: 100% !important;
  }
  html:root body #game-band figure.frame:first-child .clip img {
    object-position: 50% 2% !important;
  }

  /* Slice 2 -> 3 -> 4 vertical spacing: zero empty card void & clear sticky header clearance */
  html:root body section#journey.band {
    padding: 80px 0 18px !important;
  }
  html:root body section#realms.band {
    padding: 100px 0 126px !important;
  }
  html:root body section#realms .realm-media,
  html:root body section#realms .realm-pics,
  html:root body section#realms #realm-card {
    height: 318px !important;
    min-height: 318px !important;
    max-height: 318px !important;
    box-sizing: border-box !important;
  }
  html:root body section#realms #realm-card {
    display: flex !important;
    flex-direction: column !important;
    padding: 20px 28px 18px !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }
  html:root body section#realms #realm-card h3 {
    margin: 0 0 2px !important;
  }
  html:root body section#realms #realm-card .element {
    margin: 0 0 8px !important;
    padding-bottom: 8px !important;
  }
  html:root body section#realms #realm-card ul {
    flex: 0 0 auto !important;
    height: auto !important;
    gap: 6px !important;
    margin: 2px 0 0 !important;
  }
  html:root body section#callings.band {
    padding: 168px 0 0 !important;
  }
  html:root body section#callings .head {
    margin-bottom: 10px !important;
  }
  html:root body section#callings #calling-row {
    margin-bottom: 12px !important;
  }
  html:root body section#callings #calling-panel {
    grid-template-columns: 628px minmax(0, 1fr) !important;
    gap: 24px !important;
    padding: 12px 24px !important;
  }
  html:root body #callings #calling-panel .calling-base {
    grid-template-columns: 244px minmax(360px, 1fr) !important;
    gap: 20px !important;
  }
  html:root body section#callings .lock-note#lock-note {
    margin: 4px auto 0 !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 36px !important;
    min-height: 36px !important;
    padding: 2px 0 !important;
  }
  html:root body section#play.final {
    padding: 132px 0 124px !important;
  }
}

/* ============================================================================
   4. MOBILE (<= 699px): TARGET-PHONE CAPSULES & 2-LINE PROMO, CHAMFERED PLAY, FULL-BLEED R31 & 50/50 BODY
   ============================================================================ */
@media (max-width: 699px) {
  /* Chamfered brushed-gold sticky bar PLAY button matched 1:1 to 40px .menu-btn (zero pinched wings) */
  html:root body.scrolled:not(.at-cta) header#bar.bar:not(.open) a.btn.btn-play {
    background-color: transparent !important;
    background-image: linear-gradient(180deg, #eed392 0%, #c79c46 52%, #9a7226 100%) !important;
    border: 1px solid #f6dfa4 !important;
    border-radius: 3px !important;
    box-shadow: inset 0 1px 0 rgba(255, 250, 228, 0.58), 0 2px 8px rgba(0, 0, 0, 0.65) !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 15px !important;
    color: #160e04 !important;
    font-weight: 700 !important;
    letter-spacing: 0.10em !important;
  }

  /* Target-Phone Hero: notch-safe 78px crest, pill eyebrow/dots, 2-line promo, darker behind right faces */
  html:root body #hero .hero-shade {
    background:
      radial-gradient(ellipse 68% 22% at 50% 17%, rgba(8, 6, 4, 0.44) 0%, rgba(8, 6, 4, 0) 100%),
      linear-gradient(180deg, rgba(8, 6, 4, 0.56) 0%, rgba(8, 6, 4, 0.10) 22%, rgba(8, 6, 4, 0) 34%, rgba(8, 6, 4, 0.14) 49%, rgba(8, 6, 4, 0.84) 65%, rgba(12, 9, 6, 0.97) 80%, #120e0a 100%) !important;
  }
  html:root body #hero .hero-logo {
    top: 20px !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,
  html:root body #hero .hero-logo .emblem img {
    width: 78px !important;
    height: 78px !important;
    max-width: 78px !important;
    max-height: 78px !important;
    flex: 0 0 78px !important;
    inset: 0 !important;
  }
  html:root body #hero .hero-logo .wordmark {
    font-size: 25px !important;
    margin-top: 6px !important;
  }
  html:root body section#hero.hero .hero-copy p#hero-eyebrow.eyebrow {
    border-radius: 999px !important;
    border: 1px solid rgba(218, 180, 108, 0.30) !important;
    border-left: 1px solid rgba(218, 180, 108, 0.30) !important;
    background: rgba(10, 8, 5, 0.80) !important;
    padding: 4px 13px !important;
  }
  html:root body #hero .cta-notes .promo {
    max-width: 36ch !important;
    font-size: 12.2px !important;
    line-height: 1.35 !important;
    margin: 0 auto !important;
  }
  html:root body #hero .hero-dots {
    border-radius: 999px !important;
    border: 1px solid rgba(218, 180, 108, 0.28) !important;
    background: rgba(12, 9, 6, 0.80) !important;
  }
  html:root body #hero .motion-toggle {
    border-radius: 50% !important;
    border: 1px solid rgba(218, 180, 108, 0.30) !important;
    background: rgba(12, 9, 6, 0.80) !important;
  }

  /* Slice 1 touch smoothness & Slice 2 Creator crop framing */
  html:root body #journey .j-swipe figure.frame .clip img {
    object-position: 50% 42% !important;
  }

  /* Slice 3 Mobile: Stacked REALM OF label inside 2x2 outer realm tabs */
  html:root body section#realms #realm-tabs > button.tab:not(#realm-tab-thalenyr) {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-left: 52px !important;
    gap: 0 !important;
  }
  html:root body section#realms #realm-tabs > button.tab:not(#realm-tab-thalenyr)::before {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
  }

  /* Slice 4 Mobile: Full-bleed Vaulted Sanctuary Portrait Stage + exact 50/50 aligned BODY row */
  html:root body section#callings.band {
    padding: 84px 0 0 !important;
  }
  html:root body section#callings .head {
    margin-bottom: 6px !important;
  }
  html:root body section#callings .head h2 {
    margin-bottom: 3px !important;
  }
  html:root body section#callings #calling-row {
    margin-bottom: 4px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 {
    gap: 2px !important;
    padding: 3px 11px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-fig {
    position: relative !important;
    margin: -3px -11px 1px -11px !important;
    width: calc(100% + 22px) !important;
    flex: 0 0 96px !important;
    height: 96px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    border: 0 !important;
    border-radius: 3px 3px 0 0 !important;
    overflow: hidden !important;
    background: linear-gradient(180deg, rgba(16, 12, 8, 0.34) 0%, rgba(21, 16, 12, 0.72) 74%, #15100c 100%), url("art/hv-soul-well-900.webp") 50% 38% / cover no-repeat !important;
    background-image: linear-gradient(180deg, rgba(16, 12, 8, 0.34) 0%, rgba(21, 16, 12, 0.72) 74%, #15100c 100%), url("art/hv-soul-well-900.webp") !important;
    background-size: 100% 100%, cover !important;
    background-position: 0 0, 50% 38% !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: 92px !important;
    max-height: 92px !important;
    width: auto !important;
    object-fit: contain !important;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 84%, rgba(0, 0, 0, 0) 100%) !important;
    mask-image: linear-gradient(180deg, #000 0%, #000 84%, rgba(0, 0, 0, 0) 100%) !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle {
    margin-top: 2px !important;
    gap: 2px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type .cp-tlabel {
    grid-column: 1 / -1 !important;
    width: auto !important;
    margin: 1px 0 0 0 !important;
    font-size: 9.5px !important;
    line-height: 1.05 !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type button.cp-chip,
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type button.cp-chip:first-of-type,
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type button.cp-chip:last-of-type {
    border-radius: 3px !important;
    border: 1px solid rgba(218, 180, 108, 0.34) !important;
    border-left: 1px solid rgba(218, 180, 108, 0.34) !important;
    border-right: 1px solid rgba(218, 180, 108, 0.34) !important;
  }
  html:root body section#callings .lock-note#lock-note {
    margin: 4px auto 6px !important;
    padding: 2px 6px !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 28px !important;
    min-height: 28px !important;
    margin-top: 2px !important;
    padding: 0 16px !important;
  }
  html:root body section#callings.band + .chapter-divider img {
    height: 22px !important;
    max-height: 22px !important;
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }
  html:root body section#play.final {
    padding: 86px 16px 46px !important;
  }
}
