/* r213.css (#1014) — Desktop Realms Void Fix + High-Contrast Active Tab + Mobile Slice 1 Full Painting + Filmic Polish.
   Loaded after r212.css. Honors ALL owner locks (copy, R08, R09, R31, R32, spheres.html links). */

/* ============================================================================
   1. GLOBAL HIGH-CONTRAST ACTIVE REALM TAB (DESKTOP + PHONE, R09 COMPATIBLE)
   ============================================================================ */
html:root body #realms #realm-tabs > button.tab[aria-selected="true"] {
  background-image: linear-gradient(180deg, rgba(62, 46, 20, 0.94) 0%, rgba(26, 19, 11, 0.98) 100%) !important;
  border: 1.5px solid #f0cf82 !important;
  box-shadow: inset 0 1px 0 rgba(255, 232, 172, 0.34), 0 0 18px rgba(232, 199, 122, 0.16) !important;
  color: #fff8e6 !important;
}
html:root body #callings #calling-panel button.cp-chip svg {
  color: #e0c68c !important;
  opacity: 0.95 !important;
}

/* ============================================================================
   2. DESKTOP POLISH — HERO SCRIM + SLICE 2 + SLICE 3 BALANCED REALM CARD + FOOTER
   ============================================================================ */
@media (min-width: 700px) {
  /* Soften lower-left radial crowd scrim to keep warm rim detail while preserving left text contrast */
  html:root body #hero .hero-shade {
    background:
      radial-gradient(ellipse 52% 48% at 18% 72%, rgba(8, 6, 4, 0.66) 0%, rgba(8, 6, 4, 0.34) 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.16) 84%, rgba(16, 12, 9, 0.72) 94%, #120e0a 100%) !important;
  }

  /* Graded gameplay screenshots need ZERO heavy CSS darken/contrast filter */
  html:root body #game-band figure.frame .clip img,
  html:root body #journey-grid figure.frame .clip img,
  html:root body #game-band figure.frame:nth-child(2) .clip img,
  html:root body #journey-grid figure.frame:first-child .clip img {
    filter: none !important;
  }
  html:root body #game-band figure.frame figcaption p,
  html:root body #journey-grid figure.frame figcaption p {
    max-width: 43ch !important;
    text-wrap: pretty !important;
  }

  /* Clean text-link Play in desktop footer so 3 boxed PLAY buttons do not compete on Slice 5 */
  html:root body footer#account.foot .foot-links a.foot-play-link {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 4px 2px !important;
    color: #f3d284 !important;
    font-weight: 700 !important;
  }
  html:root body #play .req {
    color: #e8dcc2 !important;
    font-size: 14.5px !important;
  }
}

@media (min-width: 1041px) {
  /* Match 382px stage height to distributed #realm-card -> ZERO 35% empty void at bottom of right panel! */
  html:root body section#realms.band {
    padding: 136px 0 98px !important;
  }
  html:root body #realms .realm-media,
  html:root body #realms .realm-pics {
    height: 382px !important;
    min-height: 382px !important;
    max-height: 382px !important;
  }
  html:root body #realms #realm-card {
    min-height: 382px !important;
    padding: 26px 30px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }
  html:root body #realms #realm-card h3 {
    font-size: 27px !important;
  }
  html:root body #realms #realm-card p.law {
    margin: 0 0 14px !important;
    padding: 12px 16px !important;
  }
  html:root body #realms #realm-card ul {
    gap: 12px !important;
    margin-top: auto !important;
  }
  html:root body #realms #realm-card ul li {
    font-size: 16px !important;
    line-height: 1.5 !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(218, 180, 108, 0.10) !important;
  }
  html:root body #realms #realm-card ul li:last-child {
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
  }
}

/* ============================================================================
   3. MOBILE SLICE 1 FULL-HEIGHT ART + HEADER/HERO/CALLINGS POLISH
   ============================================================================ */
@media (max-width: 699px) {
  /* Override bundle-r100.css:1715 hardcoded 480px cap so Sundering painting fills full 736px canvas cleanly! */
  html:root body section#world.band .sunder .s-track,
  html:root body section#world.band .sunder .s-slide,
  html:root body section#world.band .sunder .s-media,
  html:root body section#world.band .sunder .s-media img,
  html:root body section#world.band .sunder .s-media canvas {
    height: 100% !important;
    min-height: 736px !important;
    max-height: none !important;
  }
  html:root body section#world.band .sunder .s-copy {
    bottom: 48px !important;
    padding: 110px 18px 20px !important;
  }

  /* Header & Hero micro-polish */
  html:root body header#bar.bar .bar-end {
    gap: 12px !important;
  }
  html:root body #hero .hero-logo {
    margin: 10px auto 0 !important;
    gap: 2px !important;
  }
  html:root body #hero .hero-logo .emblem,
  html:root body #hero .hero-logo .emblem canvas {
    width: 148px !important;
    height: 148px !important;
    max-width: 148px !important;
    max-height: 148px !important;
    flex: 0 0 148px !important;
  }
  html:root body #hero .hero-logo .emblem canvas {
    left: 0 !important;
    top: 0 !important;
  }
  html:root body #hero .hero-logo .emblem img {
    width: 92px !important;
    height: 92px !important;
    max-width: 92px !important;
    max-height: 92px !important;
    inset: 28px !important;
  }
  html:root body #hero .hero-logo .emblem {
    margin: 0 auto 2px !important;
  }
  html:root body #hero .hero-logo .wordmark {
    margin: 0 auto 0 !important;
  }

  /* Keep exact 6-slice docH ~ 5049px while giving R31 Fighter portrait +10px height */
  html:root body section#journey.band {
    padding: 112px 0 132px !important;
  }

  /* Muted dark-fantasy emerald Playable badge & generous pill margin + 2+2 balanced paths */
  html:root body #callings #calling-row > button.calling {
    padding: 6px 10px 7px !important;
  }
  html:root body #callings #calling-row > button.calling small.medal-cap.open-cap {
    background: rgba(32, 58, 34, 0.76) !important;
    border: 1px solid rgba(154, 204, 138, 0.50) !important;
    color: #e4f4dc !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig {
    flex: 0 0 146px !important;
    height: 146px !important;
    min-height: 146px !important;
    max-height: 146px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-fig > img,
  html:root body #callings #calling-panel .cp97 .cp-dfig > img {
    height: 142px !important;
    max-height: 142px !important;
  }
  html:root body #callings #calling-panel .cp97 .v0 .cp-paths .cp-pn {
    max-width: 22ch !important;
  }
}
