/* r222.css (#1014 / #1064) — AAA Dark-Fantasy Polish + Target Fidelity Pass across ALL 6 Slices (Desktop + Phone):
   - Unifies container grammar across Slices 2, 3, and 4 on ONE crisp single-line border (removes nested inner hairlines & .adv-card box)
   - Differentiates Slice 4's 3 control families cleanly: 999px pill Skills (uppercase), 3px 2x2 Ancestry cards, joined binary Body switch
   - Enforces consistent serif prose across all narrative/legal copy (sans strictly for UI controls)
   - Removes disabled-button box around "Requires a WebGPU-enabled browser."
   - Aligns .chapter-divider flush to the 1045px inner column & puts div5 completely inside Slice 4 (0 peeking divider tip in Slice 5!)
   - Desktop: Dream Loop target-matched dark promo pill, translucent hero-facts bar, rounded hero chrome, balanced 306px Realms split
   - Mobile: visible THE REALMS eyebrow below sticky bar in Slice 3, left-aligned target-phone hero protecting faces, 44px Slice 1/header height
   Honors EVERY owner lock (content.js verbatim copy, .chapter-divider, 0 step badges, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   1. GLOBAL TYPOGRAPHY, SINGLE-BORDER CONTAINERS, 3-CONTROL GRAMMAR & WEBGPU CAPTION
   ============================================================================ */
/* Consistent serif prose across ALL narrative, lore, notice, and legal copy */
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;
}

/* Strip disabled-button border/box from "Requires a WebGPU-enabled browser." across desktop & phone */
html:root body section#play.final .final-copy p.req,
html:root body #play .final-copy p.req {
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 2px 0 0 !important;
  margin-top: 8px !important;
  color: rgba(214, 200, 174, 0.78) !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.96) !important;
}

/* Single cohesive outer bronze-gold container border across Slices 2, 3, and 4 (NO inner inset double-borders!) */
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.32) !important;
  border-radius: 3px !important;
  background-color: #15100c !important;
  background-image: linear-gradient(180deg, rgba(26, 20, 14, 0.94) 0%, rgba(15, 11, 8, 0.98) 100%) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.68) !important;
}
html:root body section#callings #calling-panel .cp97,
html:root body section#callings #calling-panel .cp97 .v0 {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Slice 4 hierarchy & readable metadata contrast */
html:root body section#callings #calling-panel .calling-base .role,
html:root body section#callings #calling-panel .adv-card .role,
html:root body section#callings #calling-panel .cp97 .v0 .role,
html:root body section#callings #calling-panel .role,
html:root body #callings #calling-panel .calling-base dt,
html:root body #callings #calling-panel .calling-base dt::after,
html:root body #callings #calling-panel .cp97 .cp-skills .cp-slabel,
html:root body #callings #calling-panel .cp97 .cp-skills .cp-slabel::after {
  color: #d8c396 !important;
  opacity: 1 !important;
}

/* Distinct Control 1: Interactive Skill Preview Pills (999px gold-tinted action triggers, consistent uppercase) */


/* Distinct Control 2: Ancestry 2x2 Selection Cards (crisp champagne border on checked, legible dashed lock on gated) */
html:root body #callings #calling-panel .cp-desk .cp-trow:first-of-type button.cp-chip,
html:root body #callings #calling-panel .cp97 .cp-toggle .cp-trow:first-of-type button.cp-chip {
  border-radius: 3px !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"] {
  background: rgba(218, 180, 108, 0.16) !important;
  background-image: none !important;
  border: 1px solid rgba(236, 208, 142, 0.82) !important;
  box-shadow: inset 0 1px 0 rgba(255, 240, 196, 0.16) !important;
  color: #fff8e8 !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.84 !important;
  color: #afa28b !important;
  border: 1px dashed rgba(196, 168, 112, 0.30) !important;
  background: rgba(13, 10, 7, 0.90) !important;
}
html:root body section#callings #calling-row > button.calling.locked[aria-selected="false"] {
  opacity: 0.78 !important;
  filter: saturate(0.45) !important;
  color: #aca08a !important;
  border-color: rgba(168, 148, 114, 0.22) !important;
}

/* Distinct Control 3: Body Binary Segmented Switch (both desktop & phone) */
html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type,
html:root body section#callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type {
  gap: 0 !important;
}
html:root body #callings #calling-panel .cp-desk .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:first-of-type {
  border-radius: 4px 0 0 4px !important;
  border-right-width: 0 !important;
}
html:root body #callings #calling-panel .cp-desk .cp-trow:last-of-type button.cp-chip:last-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: 0 4px 4px 0 !important;
  border-left: 1px solid rgba(196, 168, 112, 0.34) !important;
}
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"] {
  border: 1px solid rgba(236, 208, 142, 0.82) !important;
}

/* ============================================================================
   2. DESKTOP (>= 700px): DREAM TARGET HERO CHROME, SEAMLESS ADV-CARD, & DIVIDER WIDTH
   ============================================================================ */
@media (min-width: 700px) {
  /* Restore target.png dark rounded promo pill & translucent hero-facts container */
  html:root body #hero .cta-notes .promo {
    border-radius: 999px !important;
    border: 1px solid rgba(218, 180, 108, 0.24) !important;
    background: rgba(10, 8, 5, 0.78) !important;
    padding: 6px 16px !important;
  }
  html:root body #hero ul.hero-facts {
    background: linear-gradient(90deg, rgba(10, 8, 5, 0.82) 0%, rgba(10, 8, 5, 0.52) 72%, rgba(10, 8, 5, 0) 100%) !important;
    border-radius: 4px !important;
    padding: 12px 26px 12px 18px !important;
    margin: 14px 0 0 0 !important;
  }
  html:root body #hero ul.hero-facts li {
    padding: 0 26px !important;
  }
  html:root body #hero ul.hero-facts li:first-child {
    padding-left: 0 !important;
  }
  html:root body #hero ul.hero-facts li span,
  html:root body #hero ul.hero-facts li small {
    color: #d2c3a8 !important;
  }

  /* Restore target.png pill slide dots & circular pause/scroll controls */
  html:root body #hero .hero-dots {
    border-radius: 999px !important;
    height: 32px !important;
    padding: 0 14px !important;
    background: rgba(12, 9, 6, 0.84) !important;
    border: 1px solid rgba(218, 180, 108, 0.34) !important;
  }
  html:root body #hero .motion-toggle,
  html:root body #hero a.scroll-cue {
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(12, 9, 6, 0.84) !important;
    border: 1px solid rgba(218, 180, 108, 0.36) !important;
  }

  /* Align chapter dividers to the 1045px inner column of Slices 2, 3, and 4 */
  html:root body .chapter-divider,
  html:root body .chapter-divider.chapter-divider-sub {
    width: min(1045px, 100% - 96px) !important;
    max-width: 1045px !important;
  }

  /* Open seamless Warrior Path panel (no nested rectangular sub-box!) matching Slice 3 card */
  html:root body #callings #calling-panel .adv-card {
    border: 0 !important;
    border-top: 1px solid rgba(218, 180, 108, 0.18) !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    padding: 14px 0 0 !important;
    gap: 18px !important;
    align-items: center !important;
  }
  html:root body #callings #calling-panel .adv-card .adv-media.figure {
    width: 192px !important;
    min-width: 192px !important;
    height: 238px !important;
    min-height: 238px !important;
  }
}

/* ============================================================================
   3. DESKTOP (>= 1041px): EXACT COLUMN ALIGNMENT, ZERO BOTTOM VOIDS, & CLEAN DIV5 CLEARANCE
   ============================================================================ */
@media (min-width: 1041px) {
  /* Card 1 HUD-free Priest headroom crop */
  html:root body #game-band figure.frame:first-child .clip img {
    object-position: 50% 22% !important;
  }

  /* Desktop Slice 2 -> 3 -> 4 rhythm: div5 cleanly inside Slice 4 (<=4475) AND above Slice 5 scroll top */
  html:root body section#journey.band {
    padding: 86px 0 18px !important;
  }
  html:root body section#realms.band {
    padding: 104px 0 116px !important;
  }
  html:root body section#realms .realm-media,
  html:root body section#realms #realm-card {
    height: 306px !important;
    min-height: 306px !important;
    max-height: 306px !important;
    box-sizing: border-box !important;
  }
  html:root body section#realms #realm-card {
    padding: 18px 24px !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  html:root body section#callings.band {
    padding: 162px 0 2px !important;
  }
  html:root body section#callings #calling-panel {
    padding: 20px 22px !important;
  }
  html:root body #callings #calling-panel .calling-base > .adv-media.base-fig {
    height: 312px !important;
    min-height: 312px !important;
  }
  html:root body #callings #calling-panel .calling-base {
    grid-template-columns: 214px minmax(286px, 1fr) !important;
    gap: 18px !important;
    align-items: center !important;
  }
  html:root body #callings .lock-note#lock-note {
    margin: 12px auto 6px !important;
    padding-top: 10px !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 50px !important;
    min-height: 50px !important;
    padding: 8px 24px !important;
    margin: 0 auto !important;
  }
  html:root body section#play.final {
    padding: 142px 0 118px !important;
  }
  html:root body footer#account.foot {
    padding-bottom: 24px !important;
  }
}

/* ============================================================================
   4. MOBILE (<= 699px): TARGET-PHONE HERO, HEADER MATCH, REALMS EYEBROW & CLEAN DIV5 CLEARANCE
   ============================================================================ */
@media (max-width: 699px) {
  /* Uniform 40px header controls across Slices 1-4; 6px rounded hamburger */
  html:root body.scrolled:not(.at-cta) header#bar.bar:not(.open) a.btn.btn-play,
  html:root body header#bar.bar .menu-btn {
    height: 40px !important;
    min-height: 40px !important;
  }
  html:root body header#bar.bar .menu-btn {
    width: 40px !important;
    border-radius: 6px !important;
  }

  /* Match target-phone.png left-aligned Hero spine + clean margins protecting crowd faces */
  html:root body #hero .hero-poster,
  html:root body #hero .hero-canvas {
    object-position: 50% 26% !important;
  }
  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.06) 49%, rgba(8, 6, 4, 0.78) 65%, rgba(12, 9, 6, 0.96) 80%, #120e0a 100%) !important;
  }
  html:root body #hero .hero-copy {
    align-items: flex-start !important;
    text-align: left !important;
    padding: 0 22px 60px !important;
  }
  html:root body section#hero.hero .hero-copy p#hero-eyebrow.eyebrow {
    margin: 0 0 8px 0 !important;
    border-radius: 999px !important;
    border: 1px solid rgba(232, 199, 122, 0.34) !important;
    background: rgba(10, 8, 5, 0.78) !important;
    padding: 4px 13px !important;
  }
  html:root body section#hero.hero .hero-copy h1#hero-title {
    font-size: 23.5px !important;
    line-height: 1.14 !important;
    text-align: left !important;
    max-width: 15.5ch !important;
    margin: 0 0 14px 0 !important;
  }
  html:root body #hero .hero-cta {
    align-items: center !important;
    width: 100% !important;
  }
  html:root body #hero .cta-notes {
    width: 100% !important;
    text-align: center !important;
  }
  html:root body #hero .hero-dots {
    border-radius: 999px !important;
    height: 28px !important;
    padding: 0 13px !important;
    bottom: 24px !important;
  }
  html:root body #hero .motion-toggle {
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    bottom: 20px !important;
  }

  /* Slice 1 touch target height >= 44px */
  html:root body section#world.band .sunder .s-marks {
    height: 44px !important;
    min-height: 44px !important;
  }
  html:root body section#world.band .sunder .s-mark {
    height: 44px !important;
    min-height: 44px !important;
  }

  /* Tighten Slice 2 bottom gap & show THE REALMS eyebrow clearly below sticky bar in Slice 3 */
  html:root body section#journey.band {
    padding: 48px 0 6px !important;
  }
  html:root body section#realms.band {
    padding: 206px 0 0 !important;
  }
  html:root body section#realms .head {
    margin-bottom: 6px !important;
  }
  html:root body section#realms .realm-media,
  html:root body section#realms .realm-media .realm-pics {
    height: 156px !important;
    min-height: 156px !important;
    max-height: 156px !important;
  }
  html:root body section#realms #realm-card {
    padding: 10px 14px !important;
    gap: 5px !important;
  }

  /* Keep FOUR CALLINGS clear below bar AND div5 completely inside Slice 4 (above Slice 5 scroll top) */
  html:root body section#callings.band {
    padding: 84px 0 0 !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 {
    gap: 3px !important;
    padding: 5px 11px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-fig {
    flex: 0 0 92px !important;
    height: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig > img,
  html:root body #callings #calling-panel .cp97 .cp-dfig > img {
    height: 88px !important;
    max-height: 88px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-text .role {
    margin-bottom: 4px !important;
  }
  html:root body section#callings #calling-panel .cp97 .v0 .cp-paths {
    padding: 6px 10px !important;
  }
  html:root body section#callings .lock-note#lock-note {
    margin: 2px auto 0 !important;
    padding: 3px 10px !important;
  }
  html:root body section#callings.band + .chapter-divider {
    height: 36px !important;
    min-height: 36px !important;
    padding: 2px 16px !important;
  }

  /* Footer subtle top divider + bottom safe-area breathing room */
  html:root body section#play.final {
    padding: 84px 16px 50px !important;
  }
  html:root body footer#account.foot {
    border-top: 1px solid rgba(218, 180, 108, 0.22) !important;
  }
  html:root body footer#account.foot .wrap.foot-meta {
    padding-bottom: 14px !important;
  }
}
