/* r221.css (#1014 / #1064) — AAA Dark-Fantasy Polish Pass across ALL 6 Slices (Desktop + Phone):
   - Fixes .sk-play aspect collapse (flex: 0 0 20px; flex-shrink: 0 -> crisp 20px circle)
   - Unifies Slices 2, 3, 4 on ONE crisp 1160px grid & double-bevel dark antique-brass container frame
   - Re-establishes clear hierarchy: primary FIGHTER/WARRIOR gold glow vs subordinate bronze HUMAN/MALE, stronger lock dimming (0.66)
   - Brightens Stone Realm medallion + .rof contrast + adds 5px SPHERES ↗ arrow spacing
   - Desktop: seamless top header fade at scrollY=0, single promo ornament, equal hero-facts padding,
     chamfered 3px dots/scroll controls, balanced 336px Realms split & framed Warrior Path card (w1440 H <= 5400px)
   - Mobile: hides top-right PLAY at scrollY=0 & on Slice 5 (shown 40px ONLY on scrolled Slices 1-4),
     centers Phone Hero spine + clears shade window over mages/rift, restores 6px-gap split BODY buttons & 44px chamfered skills
   Honors EVERY owner lock (content.js verbatim copy, .chapter-divider, 0 step badges, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   1. GLOBAL SHAPE GRAMMAR, UNIFIED BRONZE CODEX CONTAINERS, & CONTROL HIERARCHY
   ============================================================================ */
/* Fix Squished Oval & Text Clipping on Cleaving Strike / Anchor Guard */


/* Uniform architectural double-bevel dark bronze-gold container grammar across Slices 2, 3, and 4 */
html:root body #journey figure.frame,
html:root body section#realms .realm-media,
html:root body section#realms #realm-card,
html:root body section#callings #calling-panel {
  border-image: none !important;
  border: 1px solid rgba(218, 180, 108, 0.34) !important;
  border-radius: 3px !important;
  background-color: #15100c !important;
  background-image: linear-gradient(180deg, rgba(28, 21, 15, 0.94) 0%, rgba(16, 12, 9, 0.98) 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(218, 180, 108, 0.11),
    inset 0 1px 0 rgba(255, 240, 198, 0.12),
    0 16px 34px rgba(0, 0, 0, 0.68) !important;
}

/* Subordinate checked secondary option toggles (HUMAN / MALE) vs glowing primary Calling/Path tabs */
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"] {
  background: rgba(62, 46, 24, 0.72) !important;
  background-image: none !important;
  border: 1px solid rgba(226, 192, 118, 0.68) !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 196, 0.14) !important;
  color: #f4e6c6 !important;
}

/* Stronger visual lock state on gated Callings & Ancestries (MAGE, STALKER, DWARF, HALFLING) */
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] {
  opacity: 0.66 !important;
  filter: saturate(0.45) !important;
  color: #8f8472 !important;
  border-color: rgba(168, 148, 114, 0.18) !important;
}
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] .medal img {
  filter: grayscale(0.45) brightness(0.76) !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.66 !important;
  color: #8f8472 !important;
  border-color: rgba(168, 148, 114, 0.16) !important;
  background: rgba(13, 10, 7, 0.88) !important;
}

/* Brighten dark Stone Realm medallion + improve "Realm of" contrast + Spheres arrow breathing */
html:root body section#realms #realm-tabs > button#realm-tab-stone::before {
  filter: brightness(1.62) contrast(1.16) saturate(1.06) !important;
}
html:root body section#realms #realm-tabs > button.tab .rof {
  color: #cbbba0 !important;
  opacity: 0.94 !important;
}
html:root body header#bar.bar nav.bar-nav a[href="spheres.html"]::after,
html:root body footer#account.foot .foot-links a[href="spheres.html"]::after {
  margin-left: 5px !important;
}

/* ============================================================================
   2. DESKTOP (>= 700px): SEAMLESS TOP BAR DISSOLVE, UNIFIED HERO FACTS, & FRAMED ADV-CARD
   ============================================================================ */
@media (min-width: 700px) {
  /* Seamless gradient top fade at scrollY=0 (eliminates hard horizontal line behind wordmark) */
  html:root body:not(.scrolled) header#bar.bar:not(.solid) {
    background: linear-gradient(180deg, rgba(10, 8, 5, 0.72) 0%, rgba(10, 8, 5, 0.24) 64%, rgba(10, 8, 5, 0) 100%) !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  /* Single clean ornament on Hero Promo (keep diamond gem only, remove extra border-left stroke) */
  html:root body #hero .cta-notes .promo {
    border: 0 !important;
    border-left: 0 !important;
    padding: 5px 14px 5px 10px !important;
    background: linear-gradient(90deg, rgba(10, 8, 5, 0.78) 0%, rgba(10, 8, 5, 0.36) 82%, rgba(10, 8, 5, 0) 100%) !important;
  }

  /* Even divider rhythm on REAL-TIME / FIVE / FOUR facts */
  html:root body #hero ul.hero-facts li {
    padding: 0 28px !important;
  }
  html:root body #hero ul.hero-facts li:first-child {
    padding-left: 0 !important;
    padding-right: 28px !important;
  }
  html:root body #hero ul.hero-facts li:last-child {
    padding-left: 28px !important;
    padding-right: 0 !important;
  }

  /* Consistent chamfered 3px dark-fantasy controls on Hero bottom-right/center */
  html:root body #hero .hero-dots,
  html:root body #hero .motion-toggle,
  html:root body #hero a.scroll-cue {
    border-radius: 3px !important;
    border: 1px solid rgba(218, 180, 108, 0.36) !important;
    background: rgba(12, 9, 6, 0.86) !important;
  }
  html:root body #hero .hero-dots {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 82px !important;
    height: 32px !important;
    padding: 0 12px !important;
  }

  /* Framed Warrior Path sub-card closing right-column vertical dead space */
  html:root body #callings #calling-panel .adv-card {
    padding: 14px 16px !important;
    gap: 16px !important;
    align-items: center !important;
    border: 1px solid rgba(218, 180, 108, 0.24) !important;
    border-radius: 3px !important;
    background: linear-gradient(180deg, rgba(28, 21, 14, 0.62) 0%, rgba(14, 10, 7, 0.90) 100%) !important;
  }
  html:root body #callings #calling-panel .adv-card .adv-media.figure {
    width: 194px !important;
    min-width: 194px !important;
    height: 244px !important;
    min-height: 244px !important;
  }
  html:root body #callings #calling-panel .adv-card p.about {
    font-size: 16px !important;
    line-height: 1.48 !important;
  }

  /* Slice 5 Dark Scrim behind WebGPU requirement line + clean breathing room */
  html:root body section#play.final .final-copy p.req {
    display: inline-block !important;
    padding: 4px 12px !important;
    border-radius: 2px !important;
    background: rgba(10, 8, 5, 0.66) !important;
    color: #cfc3ab !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.96) !important;
  }
}

/* ============================================================================
   3. DESKTOP (>= 1041px): EXACT 1160px COLUMN ALIGNMENT & ZERO HOLLOW VOIDS
   ============================================================================ */
@media (min-width: 1041px) {
  html:root body #journey .wrap,
  html:root body #realms .wrap,
  html:root body #callings .wrap {
    width: min(1160px, 100% - 48px) !important;
    max-width: 1160px !important;
  }
  html:root body section#realms #realm-tabs,
  html:root body section#callings #calling-row {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html:root body section#callings #calling-row {
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Slice 2 Card 1: frame Creator CHOOSE YOUR ANCESTRY card + Priest without top/bottom cutoff */
  html:root body #game-band figure.frame:first-child .clip img {
    object-position: 50% 42% !important;
  }

  /* Slice 3 Realms: balanced 346px height + div4 bottom clearance keeping Slice 4 cleanly below sticky bar */
  html:root body section#realms.band {
    padding: 98px 0 162px !important;
  }
  html:root body section#realms .realm-media,
  html:root body section#realms #realm-card {
    height: 346px !important;
    min-height: 346px !important;
    max-height: 346px !important;
    box-sizing: border-box !important;
  }
  html:root body section#realms #realm-card {
    padding: 20px 24px !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  /* Slice 4 Callings: wider skill column (0 truncation!) + clear FOUR CALLINGS below sticky bar (H <= 5400px) */
  html:root body section#callings.band {
    padding: 120px 0 14px !important;
  }
  html:root body section#callings #calling-panel {
    grid-template-columns: 544px minmax(0, 1fr) !important;
    gap: 22px !important;
    padding: 20px 22px !important;
  }
  html:root body #callings #calling-panel .calling-base {
    grid-template-columns: 218px minmax(282px, 1fr) !important;
    gap: 18px !important;
    padding-right: 0 !important;
  }
  html:root body #callings #calling-panel .calling-base > .adv-media.base-fig {
    min-height: 342px !important;
  }
  html:root body section#play.final {
    padding: 72px 0 56px !important;
  }
  html:root body footer#account.foot {
    padding-bottom: 16px !important;
  }
}

/* ============================================================================
   4. MOBILE (<= 699px): CLEAN SCROLLY=0 TOP BAR, CENTERED PHONE HERO SPINE, SPLIT BODY
   ============================================================================ */
@media (max-width: 699px) {
  /* Hide sticky header PLAY on Slice 0 (not scrolled) and Slice 5 (at-cta); show 40px PLAY ONLY on Slices 1-4 */
  html:root body:not(.scrolled) header#bar.bar a.btn.btn-play,
  html:root body:not(.scrolled) header#bar.bar:not(.cta-gone):not(.open) a.btn.btn-play,
  html:root body.at-cta header#bar.bar a.btn.btn-play,
  html:root body.scrolled.at-cta header#bar.bar a.btn.btn-play,
  html:root body.at-cta header#bar.bar.cta-gone:not(.open) a.btn.btn-play {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  html:root body.scrolled:not(.at-cta) header#bar.bar:not(.open) a.btn.btn-play {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: auto !important;
    min-width: 88px !important;
    max-width: 132px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    font-size: 11px !important;
  }
  html:root body:not(.scrolled) header#bar.bar:not(.solid):not(.open) {
    background: linear-gradient(180deg, rgba(10, 8, 5, 0.56) 0%, rgba(10, 8, 5, 0) 100%) !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  /* Centered Phone Hero Spine + clear shade window uncovering reaching woman & mages */
  html:root body #hero .hero-poster,
  html:root body #hero .hero-canvas {
    object-position: 50% 34% !important;
  }
  html:root body #hero .hero-shade {
    background:
      radial-gradient(ellipse 68% 22% at 50% 18%, rgba(8, 6, 4, 0.44) 0%, rgba(8, 6, 4, 0) 100%),
      linear-gradient(180deg, rgba(8, 6, 4, 0.58) 0%, rgba(8, 6, 4, 0.14) 22%, rgba(8, 6, 4, 0) 34%, rgba(8, 6, 4, 0.04) 50%, rgba(8, 6, 4, 0.72) 64%, rgba(12, 9, 6, 0.96) 80%, #120e0a 100%) !important;
  }
  html:root body #hero .hero-logo {
    top: 16px !important;
  }
  html:root body #hero .hero-logo .emblem,
  html:root body #hero .hero-logo .emblem .sse-emblem {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    flex: 0 0 100px !important;
  }
  html:root body #hero .hero-logo .emblem canvas {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
  }
  html:root body #hero .hero-logo .emblem img {
    width: 62px !important;
    height: 62px !important;
    max-width: 62px !important;
    max-height: 62px !important;
    inset: 19px !important;
  }
  html:root body #hero .hero-logo .wordmark {
    font-size: 27px !important;
    line-height: 1.06 !important;
    margin-top: 8px !important;
  }
  html:root body #hero .hero-copy {
    align-items: center !important;
    text-align: center !important;
    padding: 0 18px 60px !important;
  }
  html:root body section#hero.hero .hero-copy p#hero-eyebrow.eyebrow {
    margin: 0 auto 7px !important;
    border-radius: 3px !important;
    border: 1px solid rgba(232, 199, 122, 0.34) !important;
    background: rgba(10, 8, 5, 0.76) !important;
    padding: 4px 12px !important;
  }
  html:root body section#hero.hero .hero-copy h1#hero-title {
    font-size: 25px !important;
    line-height: 1.13 !important;
    text-align: center !important;
    margin: 0 auto 12px !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;
  }
  html:root body #hero .hero-dots {
    height: 28px !important;
    padding: 0 12px !important;
    bottom: 24px !important;
  }

  /* Restore separate 6px-gap FEMALE / MALE buttons + crisp chamfered 44px skill triggers */
  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 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-right: 1px solid rgba(196, 168, 112, 0.24) !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type button.cp-chip[aria-checked="true"] {
    border: 1px solid rgba(226, 192, 118, 0.68) !important;
    border-right: 1px solid rgba(226, 192, 118, 0.68) !important;
  }

  /* Phone Slice 3-5 rhythm: clear sticky bar cleanly above FOUR CALLINGS & keep H <= 5064px (6 slices) */
  html:root body section#realms.band {
    padding: 158px 0 0 !important;
  }
  html:root body section#callings.band {
    padding: 102px 0 0 !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 {
    gap: 4px !important;
    padding: 8px 12px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-text .role {
    margin-bottom: 8px !important;
  }
  html:root body section#play.final {
    padding: 26px 16px 10px !important;
  }
  html:root body section#play.final .final-copy p.req {
    display: inline-block !important;
    padding: 4px 10px !important;
    border-radius: 2px !important;
    background: rgba(10, 8, 5, 0.66) !important;
    color: #cfc3ab !important;
  }
  html:root body footer#account.foot .wrap.foot-meta {
    padding-bottom: 10px !important;
  }
}
