/* Madboys Version 16 — Content Safe Area discipline and compact-desktop polish. */

/* Agreement and Character Builder are ordinary menu destinations. They keep
   the same two-column rhythm, surface and hover response as every sibling. */
body.madboys-site.site-final.site-production .menu-panel nav > a.privacy,
body.madboys-site.site-final.site-production .menu-panel nav > a.builder-menu-link {
  grid-column: auto !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  color: #dce5f2 !important;
  border-color: var(--dd-border) !important;
  background: linear-gradient(180deg, #1a2538, #0c131f) !important;
  box-shadow: none !important;
  transition: color .2s ease, border-color .2s ease, background .2s ease,
    box-shadow .2s ease, transform .2s ease !important;
}

body.madboys-site.site-final.site-production .menu-panel nav > a.privacy:hover,
body.madboys-site.site-final.site-production .menu-panel nav > a.privacy:focus-visible,
body.madboys-site.site-final.site-production .menu-panel nav > a.builder-menu-link:hover,
body.madboys-site.site-final.site-production .menu-panel nav > a.builder-menu-link:focus-visible {
  color: #fff7df !important;
  border-color: rgba(223, 183, 94, .58) !important;
  background: linear-gradient(180deg, #22324a, #111a29) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 7px 16px rgba(0,0,0,.2) !important;
  transform: translateY(-1px) !important;
}

@media (min-width: 900px) and (min-aspect-ratio: 1.001/1) {
  body.madboys-site.site-final.site-production {
    --v16-safe-gap: clamp(24px, 4dvh, 42px);
    --v16-safe-bottom: calc(100dvh - var(--v16-safe-gap));
  }

  /* Home feature art uses the full inner height of each card. */
  body.madboys-site.site-final.site-production section.home .home-cards .feature-card {
    grid-template-columns: clamp(104px, 8.4vw, 138px) minmax(0, 1fr) 38px !important;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas: "icon title arrow" "icon text arrow" !important;
    align-items: stretch !important;
    overflow: hidden !important;
  }

  body.madboys-site.site-final.site-production section.home .home-cards .feature-card img {
    grid-area: icon !important;
    align-self: stretch !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
  }

  /* Stories: the four future-fate panels grow upward and finish exactly above
     the bottom safe gap. The hero is deliberately allowed to sit behind them. */
  body.madboys-site.site-final.site-production section.stories .fate-cards {
    top: auto !important;
    bottom: calc(var(--v16-safe-gap) + 2px) !important;
    height: clamp(140px, 19dvh, 190px) !important;
    overflow: visible !important;
  }

  body.madboys-site.site-final.site-production section.stories .fate-cards article,
  body.madboys-site.site-final.site-production section.stories .fate-cards img {
    height: 100% !important;
  }

  /* Expansion: the redundant statistics strip is removed on every horizontal
     desktop tier. The map rises into the space and the three region feature
     images become full-height crops inside their cards. */
  body.madboys-site.site-final.site-production section.expansion .map-pills {
    display: none !important;
  }

  body.madboys-site.site-final.site-production section.expansion .map-zone {
    top: clamp(218px, 25dvh, 270px) !important;
    bottom: calc(var(--v16-safe-gap) + clamp(126px, 16dvh, 166px)) !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body.madboys-site.site-final.site-production section.expansion .expansion-cards {
    top: auto !important;
    bottom: calc(var(--v16-safe-gap) + 2px) !important;
    height: clamp(116px, 14dvh, 150px) !important;
  }

  body.madboys-site.site-final.site-production section.expansion .expansion-cards .feature-card {
    height: 100% !important;
    grid-template-columns: clamp(112px, 9vw, 150px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
    padding: 0 14px 0 0 !important;
    column-gap: 14px !important;
    overflow: hidden !important;
  }

  body.madboys-site.site-final.site-production section.expansion .expansion-cards .feature-card img {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    object-fit: cover !important;
  }

  /* Blood: retain the thin slogan ribbon and meter artwork, but remove the
     large blue glass slab behind the whole Monster Blood / Gold module. */
  body.madboys-site.site-final.site-production section.blood .blood-power,
  body.madboys-site.site-final.site-production section.blood .blood-power.glass {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.madboys-site.site-final.site-production section.blood .blood-power h4 {
    min-height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 0 4px !important;
    padding: 5px 18px !important;
    border: 1px solid rgba(100,137,181,.52) !important;
    border-radius: 999px !important;
    background: rgba(6,11,20,.82) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.28) !important;
  }

  /* Rewards: use the available vertical space instead of leaving a dead band.
     Both columns finish above the same bottom-safe boundary. */
  body.madboys-site.site-final.site-production section.rewards .faq-list {
    bottom: var(--v16-safe-gap) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  body.madboys-site.site-final.site-production section.rewards .reward-grid {
    height: clamp(146px, 17dvh, 188px) !important;
    min-height: clamp(146px, 17dvh, 188px) !important;
  }

  body.madboys-site.site-final.site-production section.rewards .reward-grid article {
    height: 100% !important;
    min-height: 0 !important;
  }

  body.madboys-site.site-final.site-production section.rewards .benefits-row {
    top: auto !important;
    bottom: var(--v16-safe-gap) !important;
    height: clamp(108px, 13dvh, 142px) !important;
    min-height: 0 !important;
  }
}

/* Compact desktop follows the real viewport, not the legacy 850/960px
   artificial chapter heights. Optional modules lose to fit. */
@media (min-width: 1180px) and (min-aspect-ratio: 6/5) and (max-width: 1499px),
       (min-width: 1180px) and (min-aspect-ratio: 6/5) and (max-height: 849px) {
  body.madboys-site.site-final.site-production .screen,
  body.madboys-site.site-final.site-production section.stories,
  body.madboys-site.site-final.site-production .canvas {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.madboys-site.site-final.site-production section.builds .artifact-row,
  body.madboys-site.site-final.site-production section.council .flow-row,
  body.madboys-site.site-final.site-production section.stories .shift,
  body.madboys-site.site-final.site-production section.stories .section-kicker,
  body.madboys-site.site-final.site-production section.stories .journey-row,
  body.madboys-site.site-final.site-production section.blood .blood-cards {
    display: none !important;
  }

  /* Builds hero art is explicitly capped so its feet cannot cross the safe
     bottom line, while equipment and ability cards keep their full size. */
  body.madboys-site.site-final.site-production section.builds .build-hero {
    height: clamp(280px, 45dvh, 370px) !important;
    max-height: calc(100dvh - 310px - var(--v16-safe-gap)) !important;
    object-position: center top !important;
  }

  body.madboys-site.site-final.site-production section.builds .ability-row {
    bottom: calc(var(--v16-safe-gap) + 2px) !important;
  }

  /* Council art and consequences move as one group. The local badge replaces
     the detached header badge and sits beside the title area. */
  body.madboys-site.site-final.site-production .header-context-pill {
    display: none !important;
  }

  body.madboys-site.site-final.site-production section.council .small-pill {
    display: flex !important;
    position: absolute !important;
    left: max(64px, calc(50% - 590px)) !important;
    right: auto !important;
    top: 92px !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 46 !important;
  }

  body.madboys-site.site-final.site-production section.council .council-table {
    top: 312px !important;
  }

  body.madboys-site.site-final.site-production section.council .bonus-cards {
    top: min(548px, calc(var(--v16-safe-bottom) - 132px)) !important;
    height: 104px !important;
  }

  body.madboys-site.site-final.site-production section.council .bonus-cards .feature-card {
    grid-template-columns: 78px minmax(0, 1fr) !important;
    padding: 12px 16px 12px 8px !important;
  }

  body.madboys-site.site-final.site-production section.council .bonus-cards .feature-card img {
    width: 70px !important;
    height: 100% !important;
    min-height: 76px !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  /* Compact Rewards gets taller cards, then lets the benefit strip occupy the
     remaining space down to the safe boundary. */
  body.madboys-site.site-final.site-production section.rewards .reward-grid {
    top: calc(var(--v75-rewards-top, 176px) + 168px) !important;
    height: clamp(132px, 19dvh, 154px) !important;
    min-height: clamp(132px, 19dvh, 154px) !important;
  }

  body.madboys-site.site-final.site-production section.rewards .benefits-row {
    height: clamp(96px, 14dvh, 116px) !important;
  }
}

/* On the genuinely short compact tier, Founder Rewards cannot coexist with
   the enlarged feature cards inside Content Safe Area, so it is removed as an
   entire module rather than clipped or overlapped. */
@media (min-width: 900px) and (min-aspect-ratio: 1.001/1) and (max-height: 790px) {
  body.madboys-site.site-final.site-production section.home .founder-strip,
  body.madboys-site.site-final.site-production section.home .founder-slogan {
    display: none !important;
  }

  body.madboys-site.site-final.site-production section.home .home-cards {
    top: auto !important;
    bottom: calc(var(--v16-safe-gap) + 2px) !important;
    height: clamp(124px, 18dvh, 142px) !important;
    min-height: clamp(124px, 18dvh, 142px) !important;
  }
}
