/*
 * Maths HQ: ten visible maths missions on one desktop screen.
 * Keeps all ten original illustrations, level badges, and the armory preview.
 * Written after maths-hq-cockpit.css so the actual 3-column breakpoint
 * (1321px) activates the side-by-side promotions at normal Windows scaling.
 */

@media (min-width: 1321px) and (min-height: 600px) {
  body.mission-mode #screen-home .mission-home {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    grid-template-areas:
      "intro intro"
      "mixed armory"
      "topics topics"
      "map map";
    align-items: stretch;
    column-gap: 9px;
    row-gap: 9px;
    min-width: 0;
  }

  /* Maths HQ fills the workspace, and the topic gallery takes whatever height is left, so both
     rows of topics fit without scrolling. Opening the map lets the page grow and scroll again. */
  body.mission-mode #screen-home.active,
  body.mission-mode #home-host {
    height: 100%;
  }

  body.mission-mode #screen-home .mission-home:not(:has(.mission-map-details[open])) {
    height: 100%;
    grid-template-rows: auto auto minmax(auto, 1fr) auto;
  }

  body.mission-mode #screen-home .mission-workspace-heading {
    grid-area: intro;
    margin: 0;
  }

  body.mission-mode #screen-home .mission-workspace-heading h1 {
    font-size: clamp(1.5rem, 1.65vw, 1.85rem);
    margin: 1px 0 3px;
  }

  body.mission-mode #screen-home .mission-workspace-heading p {
    font-size: .73rem;
    line-height: 1.25;
  }

  body.mission-mode #screen-home .mission-mixed-card {
    grid-area: mixed;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: 149px;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    gap: 4px;
  }

  body.mission-mode #screen-home .mission-mixed-symbol {
    display: none;
  }

  body.mission-mode #screen-home .mission-mixed-copy {
    flex: 0 0 auto;
    min-width: 0;
  }

  body.mission-mode #screen-home .mission-mixed-copy h2 {
    margin: 3px 0;
    font-size: clamp(1.23rem, 1.45vw, 1.55rem);
  }

  body.mission-mode #screen-home .mission-mixed-copy p {
    font-size: .73rem;
    line-height: 1.24;
  }

  body.mission-mode #screen-home .mission-mixed-card .gb-forge-btn {
    width: 100%;
    min-height: 36px;
    padding: 6px 9px;
    flex: 0 0 auto;
    font-size: .91rem;
  }

  body.mission-mode #screen-home .armory-promo {
    grid-area: armory;
    display: grid;
    grid-template-columns: minmax(80px, 30%) minmax(0, 1fr);
    min-height: 149px;
    min-width: 0;
    margin: 0;
    padding: 10px;
    gap: 8px;
  }

  body.mission-mode #screen-home .armory-promo-art {
    min-height: 125px;
  }

  body.mission-mode #screen-home .armory-promo-art img {
    width: min(100%, 148px);
    max-height: 112px;
  }

  body.mission-mode #screen-home .armory-promo-art-badge {
    font-size: .55rem;
    padding: 3px 5px;
  }

  body.mission-mode #screen-home .armory-promo-copy h2 {
    font-size: clamp(1.14rem, 1.25vw, 1.45rem);
    line-height: .98;
    margin: 3px 0;
  }

  body.mission-mode #screen-home .armory-promo-eyebrow {
    font-size: .6rem;
    letter-spacing: .05em;
  }

  body.mission-mode #screen-home .armory-promo-featured {
    font-size: .86rem;
    margin: 3px 0 5px;
  }

  body.mission-mode #screen-home .armory-promo-progress {
    margin-bottom: 7px;
  }

  body.mission-mode #screen-home .armory-promo-progress-label {
    font-size: .64rem;
  }

  body.mission-mode #screen-home .armory-promo-cta {
    min-height: 35px;
    font-size: .93rem;
  }

  body.mission-mode #screen-home .armory-promo-footnote {
    font-size: .59rem;
    margin-top: 4px;
  }

  body.mission-mode #screen-home .armory-promo-complete {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  body.mission-mode #screen-home .armory-promo-complete-art {
    font-size: 2.8rem;
  }

  body.mission-mode #screen-home .armory-promo-complete .armory-promo-cta {
    grid-column: 1 / -1;
  }

  body.mission-mode #screen-home .mission-topic-section {
    grid-area: topics;
    min-width: 0;
  }

  body.mission-mode #screen-home .mission-topic-heading {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    gap: 8px;
  }

  body.mission-mode #screen-home .mission-topic-heading h2 {
    font-size: 1.35rem;
    margin: 0 0 2px;
  }

  body.mission-mode #screen-home .mission-topic-heading p {
    font-size: .7rem;
    line-height: 1.18;
  }

  body.mission-mode #screen-home .mission-level-control {
    flex-wrap: nowrap;
    gap: 7px;
    flex-shrink: 0;
  }

  body.mission-mode #screen-home .mission-level-hint {
    font-size: .61rem;
    max-width: 105px;
  }

  body.mission-mode #screen-home .mission-level-buttons {
    padding: 3px;
    gap: 3px;
  }

  body.mission-mode #screen-home .mission-level-option {
    width: clamp(37px, 2.7vw, 49px);
    min-height: 41px;
    padding: 3px 2px 2px;
    gap: 1px;
  }

  body.mission-mode #screen-home .mission-level-number {
    font-size: 1.06rem;
  }

  body.mission-mode #screen-home .mission-level-reward {
    font-size: .56rem;
  }

  body.mission-mode #screen-home .mission-map-details {
    grid-area: map;
    margin: 1px 0 0;
    padding: 6px 10px;
  }

  body.mission-mode #screen-home .mission-map-details summary {
    font-size: .72rem;
  }

  /* Everything needed for a normal launch fits without wheel scrolling.
     Expanding the map or opening a maths lesson can still scroll the centre. */
  body.mission-mode .mission-power {
    overflow: hidden;
    scrollbar-width: none;
  }

  body.mission-mode .mission-power .power-rig {
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
    padding: 13px 12px 11px;
    justify-content: space-between;
    gap: 3px;
  }

  body.mission-mode .mission-power .power-heading h2 {
    font-size: clamp(1.42rem, 1.55vw, 1.75rem);
    margin: 4px 0;
  }

  body.mission-mode .mission-power .power-heading p {
    font-size: .74rem;
  }

  body.mission-mode .mission-power .power-scene {
    height: clamp(150px, 25dvh, 230px);
    width: min(100%, 280px);
    margin: 4px auto 0;
    flex: 0 0 auto;
  }

  body.mission-mode .mission-power .power-halo-outer {
    width: 218px;
    height: 218px;
  }

  body.mission-mode .mission-power .power-halo-inner {
    width: 170px;
    height: 170px;
  }

  body.mission-mode .mission-power .power-rank {
    min-height: 78px;
  }

  body.mission-mode .mission-power .power-rank-name {
    font-size: clamp(1.3rem, 1.45vw, 1.58rem);
  }

  body.mission-mode .mission-power .power-charge-number {
    font-size: 1.75rem;
    margin-top: 4px;
  }

  body.mission-mode .mission-power .power-rank-detail {
    margin-top: 4px;
    font-size: .74rem;
  }

  body.mission-mode .mission-power .power-charge-track {
    margin-top: 5px;
    height: 9px;
  }

  body.mission-mode .mission-power .power-charge-cells {
    margin: 6px 0;
  }

  body.mission-mode .mission-power .power-charge-cell {
    height: 11px;
  }

  body.mission-mode .mission-power .power-message {
    min-height: 37px;
    padding: 8px;
    font-size: .87rem;
  }
}

@media (min-width: 1321px) and (min-height: 600px) and (max-height: 740px) {
  body.mission-mode #screen-home .mission-home {
    row-gap: 6px;
  }

  body.mission-mode #screen-home .mission-workspace-heading p {
    font-size: .69rem;
  }

  body.mission-mode #screen-home .mission-mixed-card,
  body.mission-mode #screen-home .armory-promo {
    min-height: 131px;
  }

  body.mission-mode #screen-home .armory-promo-art {
    min-height: 108px;
  }

  body.mission-mode #screen-home .armory-promo-art img {
    max-height: 98px;
  }

  body.mission-mode .mission-power .power-scene {
    height: clamp(135px, 23dvh, 178px);
  }
}

/* Garden goes behind the branding, not behind the radar text.
   Keep it dark enough that the logo and achievements remain legible. */
body.mission-mode .topbar.gb-topbar {
  background:
    linear-gradient(180deg, transparent 60%, rgba(9, 8, 18, .4) 100%),
    linear-gradient(90deg, #0b0814 0%, #0b0814 20%, rgba(11, 8, 20, 0) 32%, rgba(11, 8, 20, 0) 68%, #0b0814 80%, #0b0814 100%),
    /* Shown near its real size (never stretched), so the scene stays crisp; the fades hide its edges. */
    url('../assets/home/header-backyard.jpg?v=2') center 52% / auto 310% no-repeat,
    #0b0814;
  padding-top: 6px;
  padding-bottom: 7px;
}

body.mission-mode .topbar.gb-topbar .brand-logo {
  height: clamp(105px, 26vw, 143px);
}

body.mission-mode .mission-control {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(20, 67, 44, .29), transparent 62%),
    linear-gradient(180deg, #101623 0%, #090f16 54%, #0b0d17 100%);
}

