/* r212.css (#1014) — Dual-Viewport 6-Slice Sync + Single-Screen R31/R32 Mobile Callings + Dream Loop Polish.
   Loaded after r211.css. Honors ALL owner locks (copy, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   A. DESKTOP HERO & DREAM LOOP TARGET.PNG POLISH
   ============================================================================ */
@media (min-width: 700px) {
  /* Lift right-side crowd/mage illumination while keeping crisp dark radial behind left hero copy */
  html:root body #hero .hero-shade {
    background:
      radial-gradient(ellipse 52% 48% at 18% 72%, rgba(8, 6, 4, 0.78) 0%, rgba(8, 6, 4, 0.42) 56%, rgba(8, 6, 4, 0) 100%),
      linear-gradient(90deg, rgba(8, 6, 4, 0.72) 0%, rgba(8, 6, 4, 0.36) 34%, rgba(8, 6, 4, 0.04) 50%, rgba(8, 6, 4, 0) 60%),
      linear-gradient(180deg, rgba(8, 6, 4, 0.76) 0%, rgba(8, 6, 4, 0.18) 15%, rgba(8, 6, 4, 0) 48%, rgba(10, 8, 5, 0.18) 84%, rgba(16, 12, 9, 0.76) 94%, #120e0a 100%) !important;
  }

  /* Subtle left-feathered dark-smoke band behind ul.hero-facts matching target.png */
  html:root body #hero ul.hero-facts {
    background: linear-gradient(90deg, rgba(12, 9, 6, 0.62) 0%, rgba(12, 9, 6, 0.42) 68%, rgba(12, 9, 6, 0) 100%) !important;
    padding: 10px 28px 10px 16px !important;
    margin: 14px 0 0 -16px !important;
    border-top: 1px solid rgba(232, 199, 122, 0.16) !important;
    border-bottom: 1px solid rgba(232, 199, 122, 0.12) !important;
    border-image: linear-gradient(90deg, rgba(232, 199, 122, 0.24) 0%, rgba(232, 199, 122, 0.14) 65%, transparent 100%) 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }

  /* ============================================================================
     B. DESKTOP SLICE 2 & SLICE 3 FIXES
     ============================================================================ */
  /* Lift shadow detail on real twilight Soul Well & Anwel Town captures */
  html:root body #game-band figure.frame .clip img,
  html:root body #journey-grid figure.frame .clip img {
    filter: none !important;
  }
  html:root body #game-band figure.frame:nth-child(2) .clip img {
    filter: brightness(1.06) contrast(0.97) saturate(1.06) !important;
  }
  html:root body #journey-grid figure.frame:first-child .clip img {
    filter: brightness(1.16) contrast(0.95) saturate(1.08) !important;
  }
  html:root body #game-band figure.frame .clip::after,
  html:root body #journey-grid figure.frame .clip::after {
    box-shadow: inset 0 0 18px rgba(8, 6, 4, 0.28) !important;
  }

  /* Clear div3 diamond point cleanly above y=2764 sticky navbar in Slice 3 while keeping #callings.head at y~3680 in Slice 4 */
  html:root body section#journey.band {
    padding: 62px 0 4px !important;
  }
  html:root body #journey .wrap {
    max-width: 988px !important;
  }
  html:root body #journey .head {
    margin-bottom: 6px !important;
  }
  html:root body #game-band {
    margin-bottom: 6px !important;
  }
  html:root body section#realms.band {
    padding: 106px 0 72px !important;
  }

  /* Restore self-explanatory 1 / 5 pill counter inside desktop Realm stage */
  html:root body #realms .realm-counter {
    display: inline-flex !important;
    align-items: center !important;
    position: absolute !important;
    right: 14px !important;
    bottom: 12px !important;
    z-index: 6 !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    background: rgba(12, 9, 6, 0.78) !important;
    border: 1px solid rgba(232, 199, 122, 0.36) !important;
    color: #f2e4c4 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
  }

  /* Clearly distinguish locked Ancestries (DWARF / HALFLING) from unlocked ELF */
  html:root body #callings #calling-panel button.cp-chip:has(svg):not([aria-checked="true"]) {
    opacity: 0.74 !important;
    border-color: rgba(218, 180, 108, 0.20) !important;
    background: rgba(14, 11, 8, 0.56) !important;
    color: #bfb094 !important;
  }
}

/* Wide desktop (>= 1041px): zero brown bottom strip inside 432px .realm-media */
@media (min-width: 1041px) {
  html:root body #realms .realm-media {
    height: 432px !important;
    min-height: 432px !important;
    max-height: 432px !important;
  }
  html:root body #realms .realm-pics {
    aspect-ratio: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 432px !important;
  }
  html:root body #realms .realm-pics img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* Tablet 700..1040px (e.g. 844px): let .realm-media grow naturally with tall #realm-card */
@media (min-width: 700px) and (max-width: 1040px) {
  html:root body #realms .realm-media {
    height: auto !important;
    min-height: 432px !important;
    max-height: none !important;
  }
  html:root body #realms .realm-pics {
    aspect-ratio: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 432px !important;
  }
  html:root body #realms .realm-pics img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* ============================================================================
   C. MOBILE 390x844 HERO, HEADER, SINGLE-SCREEN R31/R32 CALLINGS & UNIFIED FOOTER
   ============================================================================ */
@media (max-width: 699px) {
  /* Sticky Header: never show redundant bare-text SIGN IN on mobile; match PLAY visual height to 44px .menu-btn */
  html:root body header#bar.bar .bar-end a.bar-sign,
  html:root body.scrolled header#bar.bar .bar-end a.bar-sign,
  html:root body.scrolled.at-cta header#bar.bar .bar-end a.bar-sign {
    display: none !important;
  }
  html:root body header#bar.bar .bar-end {
    gap: 10px !important;
  }
  html:root body.scrolled:not(.at-cta) header#bar.bar a.btn.btn-play {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 20px !important;
    background-size: 100% 100% !important;
  }

  /* Hero Slice 0 (0..844): 120px emblem with clear canvas spacing, bold antique-gold wordmark, clear priestess framing */
  html:root body #hero .hero-logo {
    margin: 12px auto 0 !important;
    padding: 0 16px !important;
    gap: 6px !important;
  }
  html:root body #hero .hero-logo::before {
    width: 360px !important;
    height: 230px !important;
    background: radial-gradient(ellipse 58% 54% at 50% 46%, rgba(8, 6, 4, 0.84) 0%, rgba(8, 6, 4, 0.44) 54%, rgba(8, 6, 4, 0) 100%) !important;
  }
  html:root body #hero .hero-logo .emblem {
    width: 120px !important;
    height: 120px !important;
    flex: 0 0 120px !important;
    margin: 0 auto 14px !important;
  }
  html:root body #hero .hero-logo .emblem img,
  html:root body #hero .hero-logo .emblem canvas {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
  }
  html:root body #hero .hero-logo .wordmark {
    margin: 6px auto 0 !important;
    font-size: 24px !important;
    letter-spacing: 0.16em !important;
    color: #f7e8c6 !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95) !important;
  }
  html:root body #hero .hero-logo .wordmark span {
    color: #ebd08e !important;
  }
  html:root body #hero .hero-shade {
    background: linear-gradient(180deg, rgba(8, 6, 4, 0.82) 0%, rgba(8, 6, 4, 0.36) 20%, rgba(8, 6, 4, 0.02) 38%, rgba(8, 6, 4, 0.14) 55%, rgba(10, 8, 5, 0.82) 74%, #120e0a 100%) !important;
  }
  html:root body #hero .hero-copy {
    padding: 0 18px 56px !important;
  }
  html:root body #hero #hero-eyebrow.eyebrow {
    margin: 0 0 8px !important;
  }
  html:root body #hero h1#hero-title {
    font-size: clamp(25px, 7.1vw, 29px) !important;
    margin: 0 0 14px !important;
  }
  html:root body #hero h1#hero-title span:first-child {
    color: #fbf0d8 !important;
  }
  html:root body #hero h1#hero-title span:last-child {
    color: #eed18f !important;
  }
  html:root body #hero .hero-cta {
    margin: 0 0 10px !important;
  }
  html:root body #hero .hero-dots,
  html:root body #hero .motion-toggle {
    bottom: 22px !important;
  }

  /* 6-Slice Vertical Cadence on 390x844 (target docH <= 5056px, 6 clean unclipped slices) */
  /* Slice 1 (844..1688): #world + div2 */
  html:root body section#world.band .sunder {
    min-height: 736px !important;
    height: 736px !important;
  }

  /* Slice 2 (1688..2532): INTO THE BREACH full card + carousel + div3 */
  html:root body section#journey.band {
    padding: 116px 0 144px !important;
  }

  /* Slice 3 (2532..3376): THE REALMS heading + stacked tabs + painting + full THALENYR card + div4 */
  html:root body section#realms.band {
    padding: 66px 0 8px !important;
  }
  html:root body #realms .head {
    margin-bottom: 6px !important;
  }
  html:root body #realms .head h2 {
    font-size: 26px !important;
    margin-bottom: 2px !important;
  }
  html:root body #realms #realm-tabs {
    margin-bottom: 6px !important;
    gap: 6px !important;
  }
  html:root body #realms #realm-tabs > button.tab {
    min-height: 44px !important;
    padding: 4px 10px !important;
  }
  html:root body #realms .realm-media {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
  }
  html:root body #realms .dots {
    margin: 3px 0 3px !important;
    padding: 0 !important;
  }
  html:root body #realms #realm-card {
    padding: 11px 16px !important;
  }
  html:root body #realms #realm-card ul {
    gap: 6px !important;
  }

  /* Slice 4 (3376..4220): ENTIRE FOUR CALLINGS fits inside ONE 390x844 phone screen (R31 top portrait + R32 >=44px controls) */
  html:root body section#callings.band {
    padding: 70px 0 8px !important;
  }
  html:root body #callings .head {
    margin-bottom: 5px !important;
  }
  html:root body #callings .head h2 {
    font-size: 24px !important;
    margin-bottom: 2px !important;
  }
  html:root body #callings .head > p.lead {
    font-size: 13px !important;
    line-height: 1.24 !important;
  }
  html:root body #callings #calling-row {
    gap: 6px !important;
    margin-bottom: 5px !important;
  }
  html:root body #callings #calling-row > button.calling {
    min-height: 46px !important;
    padding: 4px 9px !important;
    gap: 7px !important;
  }
  html:root body #callings #calling-row > button.calling > img,
  html:root body #callings #calling-row > button.calling .medal,
  html:root body #callings #calling-row > button.calling .medal > img {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
  }
  html:root body #callings #calling-row > button.calling small.medal-cap {
    font-size: 13px !important;
    padding: 2px 7px !important;
    letter-spacing: 0.02em !important;
  }
  html:root body #callings #calling-panel {
    padding: 6px 10px 8px !important;
    gap: 2px !important;
  }
  html:root body #callings #calling-panel .cp97 .cp-view.v0 {
    padding: 4px 6px !important;
    gap: 4px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 {
    gap: 4px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-top {
    gap: 4px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig {
    flex: 0 0 136px !important;
    height: 136px !important;
    min-height: 136px !important;
    max-height: 136px !important;
    margin: 0 !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig > img,
  html:root body #callings #calling-panel .cp97 .cp-dfig > img {
    height: 132px !important;
    max-height: 132px !important;
    width: auto !important;
    object-fit: contain !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-text {
    gap: 2px !important;
    padding: 0 !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-text h3 {
    font-size: 19px !important;
    margin: 0 !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-text p.role {
    margin: 0 0 2px !important;
    line-height: 1.2 !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-skills {
    margin: 0 !important;
    gap: 6px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-toggle {
    margin: 0 !important;
    padding-top: 5px !important;
    gap: 4px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow {
    gap: 6px !important;
    row-gap: 4px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow + .cp-trow {
    margin-top: 2px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type {
    grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr) !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-toggle .cp-trow:last-of-type .cp-tlabel {
    grid-column: auto !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-tlabel {
    margin: 0 !important;
    font-size: 13px !important;
    width: auto !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-paths {
    min-height: 44px !important;
    padding: 5px 12px !important;
    margin-top: 2px !important;
  }
  html:root body #callings #lock-note.lock-note {
    margin-top: 4px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    line-height: 1.32 !important;
  }

  /* Slice 5 (max-scroll ~ 4202..5046, docH <= 5056 -> 6 slices!): #play + unified left-aligned mobile footer */
  html:root body section#play.final {
    padding: 36px 16px 14px !important;
    min-height: 0 !important;
  }
  html:root body #play .final-copy {
    padding: 8px 14px 4px !important;
  }
  html:root body #play .final-copy h2 {
    margin: 4px 0 12px !important;
  }
  html:root body #play .final-actions {
    gap: 8px !important;
  }
  html:root body #play .final-member-note,
  html:root body #play .final-req {
    margin-top: 8px !important;
  }
  html:root body footer#account.foot {
    padding: 14px 18px 12px !important;
  }
  html:root body footer#account.foot .foot-grid {
    align-items: flex-start !important;
    gap: 8px !important;
  }
  html:root body footer#account.foot .foot-grid,
  html:root body footer#account.foot .foot-legal,
  html:root body footer#account.foot .foot-meta {
    padding-inline: 0 !important;
  }
  html:root body footer#account.foot .foot-brand {
    max-width: none !important;
    margin: 0 !important;
    justify-content: flex-start !important;
  }
  html:root body footer#account.foot .foot-notes {
    align-items: flex-start !important;
    text-align: left !important;
  }
  html:root body footer#account.foot .foot-notes h3 {
    margin: 0 0 2px !important;
  }
  html:root body footer#account.foot .foot-links {
    justify-items: start !important;
    gap: 0 14px !important;
    margin: 2px 0 !important;
  }
  html:root body footer#account.foot .foot-links a {
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    min-height: 44px !important;
  }
  html:root body footer#account.foot .foot-links a.foot-play-link {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #f3d284 !important;
    font-weight: 700 !important;
    min-width: 0 !important;
    width: auto !important;
  }
  html:root body footer#account.foot .foot-legal {
    margin-top: 4px !important;
    padding: 8px 0 !important;
  }
  html:root body footer#account.foot .foot-legal p {
    text-align: left !important;
  }
  html:root body footer#account.foot .foot-meta {
    padding: 6px 0 0 !important;
  }
}
