/**
 * Live lobby frame: signed-off three-column base followed by the density,
 * stage, killstreak, and absorb overrides in their original cascade order.
 */

/* Lobby body: left retention rail | center stage | right rail */

.lobby-body {
  --panel: #0a1016;
  --panel-high: #0e151d;
  --panel-raised: #0f161e;
  --card: #101922;
  --blue: #16aefb;
  --blue-rgb: 22, 174, 251;
  --green: #12ed8c;
  --green-rgb: 18, 237, 140;
  --gold: #ffc238;
  --gold-rgb: 255, 194, 56;
  --amber: #ff9d0a;
  --amber-hot: #ffc14b;
  --amber-deep: #d87800;
  --amber-rgb: 255, 157, 10;
  --faint: #57616b;
  --danger: #ff6c60;
  --line: rgba(159, 181, 201, 0.14);
  --line-strong: rgba(159, 181, 201, 0.24);
  --ease-out: cubic-bezier(0.2, 0.75, 0.25, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) minmax(280px, 340px);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 24px;
  row-gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: 1680px;
  /* Topbar min-height + 1px bottom border */
  height: calc(100vh - var(--tb-h) - 1px);
  max-height: calc(100vh - var(--tb-h) - 1px);
  margin: 0 auto;
  padding: 16px 28px 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.lobby-body > .lobby-left,
.lobby-body > .lobby-center,
.lobby-body > .lobby-right {
  grid-row: 1;
  min-height: 0;
}

/* Thin legal rail — entry points only, not marketing footer. */
.legal-rail {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  min-height: 28px;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(159, 181, 201, 0.1);
  color: #5c6670;
  font-family: Rajdhani, "Arial Narrow", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.legal-rail__mark {
  color: #6d7883;
}

.legal-rail__links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.legal-rail__links a,
.legal-rail__placeholder {
  color: #7a8490;
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}

.legal-rail__links a:hover,
.legal-rail__links a:focus-visible {
  color: #c4ccd4;
}

.legal-rail__links a:focus-visible {
  outline: 1px solid rgba(255, 194, 82, 0.55);
  outline-offset: 2px;
}

.legal-rail__placeholder {
  cursor: default;
}

.legal-rail__sep {
  color: #454e57;
  user-select: none;
}

.lobby-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Duty + Objectives size to content; Quick Play absorbs leftover height. */
.lobby-left .duty-log,
.lobby-left .module--objectives {
  flex: 0 0 auto;
}

.lobby-left .module--objectives {
  padding: 10px;
}

.lobby-left .module--objectives .module__header {
  margin-bottom: 6px;
}

.lobby-left .play-cluster {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: 340px;
  min-height: 0;
  height: auto;
  margin-top: 4px;
}

.lobby-left .quick-play-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 86px;
  height: auto;
  container-type: size;
  container-name: quick-play;
}

.lobby-left .quick-play {
  width: 100%;
  height: 100%;
  min-height: 86px;
  gap: clamp(12px, 8cqh, 22px);
  padding:
    clamp(14px, 12cqh, 28px)
    clamp(18px, 5cqi, 28px)
    clamp(14px, 11cqh, 26px)
    clamp(18px, 5.5cqi, 28px);
}

.lobby-left .mode-select {
  flex: 0 0 auto;
  margin-top: 10px;
}

/* Type scales with the button itself, not the viewport. */
.lobby-left .quick-play__title {
  font-size: clamp(34px, 34cqh, 64px);
  letter-spacing: 0.06em;
  line-height: 0.88;
  text-shadow:
    0 1px 2px rgba(83, 34, 0, 0.35),
    0 2px 10px rgba(83, 34, 0, 0.18);
}

.lobby-left .quick-play.is-searching .quick-play__title,
.lobby-left .quick-play.is-found .quick-play__title,
.lobby-left .quick-play.is-joining .quick-play__title {
  font-size: clamp(30px, 30cqh, 54px);
  letter-spacing: 0.05em;
}

.lobby-left .quick-play__subtitle {
  margin-top: clamp(6px, 4cqh, 12px);
  font-size: clamp(12px, 9.5cqh, 18px);
  letter-spacing: 0.11em;
}

.lobby-left .quick-play__arrow {
  width: clamp(34px, 22cqh, 52px);
  height: clamp(26px, 16cqh, 40px);
}

.lobby-left .quick-play__arrow svg {
  width: 100%;
  height: 100%;
}

/* Center column: layered AAA hero stage + compact Combat Record (138px). */
.lobby-center {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* Fill leftover height under the combat strip — same role as Quick Play on the left. */
.lobby-center .hero-preview {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
}

.lobby-center .hero-shell {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  /*
    Steel chrome aperture — primary knob for “more Three.js vs more frame”.
    signed-off baseline is 30px. Lower = thinner border + larger L1 viewport.
    --rail / HUD dock / chamfer all derive from this, so keep it coherent.
    Sweet spot in the lobby column: ~20–24px.
  */
  --stage-frame: 22px;
  --panel-scale: 0.48;
  --dock-nudge: 1px;
}

/*
  Identity content density lives in hero-stage.css (signed-off baseline).
  Here: center-column fit only — slightly tighter width clamp so the
  denser card still clears the rail in the narrower lobby stage.
  Do not re-shrink badge / name / XP metrics (and never via --panel-scale).
*/
.lobby-center .panel--identity {
  width: min(340px, 78%);
}

.lobby-center .panel--squad {
  width: 150px;
  height: 42px;
  padding: 0 12px 0 11px;
}

.lobby-center .combat-record-shell {
  flex: 0 0 auto;
  width: 100%;
}

.lobby-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Exact stack from lobby.html right rail: claim → friends → loadout.
   Friends stays at the compact signed-off height (276px) — do not inflate it. */
.lobby-right .lr-card--featured {
  flex: 0 0 auto;
  width: 100%;
}

.lobby-right .squad-hub {
  display: flex;
  flex: 0 0 276px;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  height: 276px;
  max-height: 276px;
}

/* Loadout fills leftover height under Friends — same idea as Quick Play on the left.
   Keeps the 8px rail gap; CTA pins to the card floor so nothing clips. */
.lobby-right .loadout {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  --hex-w: 30px;
  --hex-line-alpha: 0.23;
  --hex-glow: 0.8;
  --scrim: 0.58;
}

/* Condensed chrome — header + CTA shrink so the Next-unlock strip and
   socket rail keep the leftover height. Measured reclaim ≈ 20px vs the
   prior 50/46 header/CTA wrap. */
.lobby-right .loadout__header {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 6px 12px 5px;
}

.lobby-right .loadout__header::before {
  background:
    radial-gradient(
      132px 40px at 54px 50%,
      rgba(5, 8, 12, calc(0.95 * var(--scrim))),
      rgba(5, 8, 12, calc(0.66 * var(--scrim))) 44%,
      rgba(5, 8, 12, 0) 76%
    ),
    linear-gradient(
      90deg,
      rgba(5, 8, 12, calc(0.68 * var(--scrim))) 0,
      rgba(5, 8, 12, calc(0.3 * var(--scrim))) 40%,
      rgba(5, 8, 12, 0) 68%
    );
}

.lobby-right .loadout__header .loadout__title {
  font-size: 18px;
  letter-spacing: 0.06em;
  line-height: 0.92;
}

.lobby-right .loadout__header .loadout__title::after {
  width: 26px;
  height: 2px;
  margin-top: 3px;
}

.lobby-right .next-unlock {
  flex: 0 0 auto;
  min-height: 30px;
}

.lobby-right .loadout__rail {
  flex: 1 1 auto;
  min-height: 0;
  align-content: center;
}

.lobby-right .loadout__action-wrap {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 0 8px 6px;
}

.lobby-right .loadout__action {
  min-height: 28px;
  gap: 8px;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.lobby-right .loadout__action i {
  font-size: 10px;
}

/* Bridge wallet bump animation onto player-rail resources */
.resource.is-bumped {
  animation: wallet-bump 460ms var(--ease-spring);
}

@media (max-width: 1280px) {
  .lobby-body {
    grid-template-columns: 340px minmax(0, 1fr);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .lobby-right {
    grid-column: 1 / -1;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .lobby-right .squad-hub {
    flex: 0 0 276px;
    height: 276px;
    max-height: 276px;
  }

  .lobby-right .loadout {
    flex: 0 0 auto;
  }
}

@media (max-width: 900px) {
  .lobby-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .lobby-left {
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .lobby-center {
    height: auto;
    min-height: 520px;
  }

  .lobby-center .hero-preview {
    min-height: 360px;
  }

  .lobby-right {
    max-width: none;
  }
}

/* Fill leftover viewport under whatever the (zoomed) topbar actually is.
   Avoids 100vh - --tb-h mismatch pushing .legal-rail off-screen. */
html,
html body {
  height: 100%;
  overflow: hidden;
}

html body {
  display: flex;
  flex-direction: column;
}

html .lobby-topbar {
  flex: 0 0 auto;
  min-height: var(--flex-tb-base, 76px);
}

html .lobby-body {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
}

/* ── 3-column contract — overrides the base ≤1280 stack ──────────────────
   The base frame collapses the shell at ≤1280: two tracks plus
   `.lobby-right { grid-column: 1 / -1 }`, and a single track at ≤900. The flex
   shell keeps three columns down to the hard floor — narrow viewports are
   handled by band tokens (§3.5+), not by dropping the layout.

   The runtime used to fight this with an inline grid-template-columns, which won
   the TRACKS but not the PLACEMENT: the right rail still spanned the whole
   row from column 1, so it painted where the left rail belongs, the left rail
   was auto-placed after it into an implicit track, and .lobby-center collapsed
   to 0px — the hero stage disappeared. Chrome zoom-out "fixed" it only because
   it lifted innerWidth back above 1280. Track widths now arrive as
   --flex-body-cols and placement is asserted here. */
html .lobby-body {
  grid-template-columns: var(
    --flex-body-cols,
    340px minmax(0, 1fr) minmax(280px, 340px)
  );
  column-gap: var(--flex-body-gap, 24px);
  /* Keep the base top/bottom padding (16 / 8); only the side edges dial. */
  padding-left: var(--flex-edge-left, 28px);
  padding-right: var(--flex-edge-right, 28px);
  overflow: hidden;
}

/* Hero HUD overlays — identity (top-left) + squad (bottom-right).
   Scale from the docked corner so shrink reclaim stays flush to the steel.
   --panel-scale stays frame-only; do not hijack it. */
html .lobby-center .panel--identity {
  transform: scale(var(--flex-hud-scale, 1));
  transform-origin: top left;
}

html .lobby-center .panel--squad {
  transform: scale(var(--flex-hud-scale, 1));
  transform-origin: bottom right;
}

html .lobby-body > .lobby-left,
html .lobby-body > .lobby-center,
html .lobby-body > .lobby-right {
  grid-column: auto;
  grid-row: 1;
}

/* Fork lets the rail go height:auto / overflow:visible at ≤1280; the flex rails
   are stretch-sized clipping columns in every band. Width caps stay off — the
   runtime dials rails past the 340 design base. */
html .lobby-left,
html .lobby-right {
  max-width: none;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

html .lobby-center {
  height: auto;
  min-height: 0;
}

/* Below the desktop matrix (hard floor is 1024) hand the single column back to
   the fork rather than forcing three tracks into a phone-width viewport. */
@media (max-width: 900px) {
  html .lobby-body {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  html .lobby-body > .lobby-left,
  html .lobby-body > .lobby-center,
  html .lobby-body > .lobby-right {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  html .lobby-left,
  html .lobby-right {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* Center stack: hero absorbs leftover height; CR lives in below-stage-slot.
   Kill hero-stage's 100vh lock so growing CR shrinks the stage upward. */
html .lobby-center {
  min-height: 0;
  overflow: hidden;
}

html .lobby-center .hero-preview {
  flex: 1 1 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none;
  margin: 0 !important;
}

html .lobby-center .hero-shell {
  flex: 1 1 0;
  min-height: 0;
}

html .below-stage-slot {
  flex: 0 0 auto;
  width: 100%;
  overflow: hidden;
}

/* Stick Coin packages share the CR below-stage footprint. Runtime zooms
   .coin-packages-shell from design 138 (see density-bake.js). Harden
   pack card centering so icon+amount aren't optically left-biased. */
html .coin-packages-shell {
  transform-origin: top left;
}

html .coin-packages .pack__face {
  justify-items: center;
  text-align: center;
}

html .coin-packages .pack__total {
  box-sizing: border-box;
  width: 100%;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-inline: 0;
  text-align: center;
}

html .coin-packages .pack__total i {
  flex: 0 0 auto;
  line-height: 1;
}

html .coin-packages .pack__bonus,
html .coin-packages .pack__rate {
  width: 100%;
  justify-self: stretch;
  text-align: center;
}

html .coin-packages .pack__buy {
  width: 100%;
  justify-self: stretch;
  text-align: center;
}

html .coin-packages .pack__badge {
  justify-self: center;
}

/* ── Killstreaks aperture density (runtime-driven tokens) ───────── */

html .killstreaks-aperture .ks-rail {
  --hexw: var(--ks-hex-w, 62px);
}

html .killstreaks-aperture .ks-arsenal__grid,
html .killstreaks-aperture .ks-arsenal__topline {
  grid-template-columns: minmax(0, 1fr) var(--ks-intel-w, 194px);
}

html .killstreaks-aperture .ks-label__count {
  font: 700 11px "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.14em;
}

/* Card height always follows the runtime token (loadout-mode uses fixed 96px).
   --ks-type-scale (runtime) shrinks card/intel copy only; 1 = prior band look. */
html .killstreaks-aperture .ks-card {
  --ks-card-body-h: calc(44px * var(--ks-type-scale, 1));
  height: var(--ks-card-h, 96px) !important;
  min-height: var(--ks-card-h, 96px) !important;
}

/* Glyph was hard-coded top:33px for 96px tiles — keep it in the art bed. */
html .killstreaks-aperture .ks-card__glyph {
  top: calc((100% - var(--ks-card-body-h, 44px)) / 2);
  font-size: clamp(15px, calc(var(--ks-card-h, 96px) * 0.27), 28px);
}

/* Density bump: name / cost / level / corner mark — readable at runtime card-h.
   Mark scales the slit plate (w/h/pad/font + same triangle clip), not icon-only.
   Equipped/locked mark opacity+color stay in loadout-mode.css. */
html .killstreaks-aperture .ks-card__mark {
  width: calc(29px * var(--ks-type-scale, 1));
  height: calc(29px * var(--ks-type-scale, 1));
  padding: calc(3px * var(--ks-type-scale, 1)) calc(4px * var(--ks-type-scale, 1)) 0 0;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  font-size: calc(10.5px * var(--ks-type-scale, 1));
}

html .killstreaks-aperture .ks-card__body {
  padding: 0 calc(9px * var(--ks-type-scale, 1)) calc(8px * var(--ks-type-scale, 1));
}

html .killstreaks-aperture .ks-card__name {
  font: 700 calc(14.5px * var(--ks-type-scale, 1)) / 1.05 "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.04em;
}

html .killstreaks-aperture .ks-card__meta {
  gap: calc(6px * var(--ks-type-scale, 1));
  margin-top: calc(5px * var(--ks-type-scale, 1));
  font: 700 calc(10.5px * var(--ks-type-scale, 1)) / 1 "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.1em;
}

html .killstreaks-aperture .ks-card__cost {
  gap: calc(4px * var(--ks-type-scale, 1));
}

html .killstreaks-aperture .ks-card__cost i {
  font-size: calc(9.5px * var(--ks-type-scale, 1));
}

/* ── Arsenal align contract (comfort lock) ───────────────────────────
   ALWAYS: Defensive card bottoms == intel panel bottom (no drift).
   ALWAYS: Offensive→Defensive gap is a fixed band gap — never leftover
           air (space-between / flex sponge between bands is forbidden).

   Fill OFF: stack packs from top; grid row = content; intel stretches
             to that same row → bottoms lock; slack sits under the row.
   Fill ON:  arsenal claims leftover; both bands share height 1fr|1fr
             with fixed --ks-band-gap; cards grow inside each band
             (min = --ks-card-h); intel stretches to the same grid cell
             → bottoms lock; leftover lives IN cards/intel art, not
             between Offensive and Defensive. */

html .killstreaks-aperture {
  --ks-band-gap: 18px;
}

/* Offensive / Defensive titles — bigger; gap owned by --ks-band-gap */
html .killstreaks-aperture .ks-group__label {
  gap: calc(7px * var(--ks-type-scale, 1));
  margin: 0 0 calc(8px * var(--ks-type-scale, 1));
  font: 700 calc(12px * var(--ks-type-scale, 1)) "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.18em;
}

html .killstreaks-aperture .ks-group__label i {
  font-size: calc(11px * var(--ks-type-scale, 1));
}

html .killstreaks-aperture .ks-groups {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-content: start;
  align-self: stretch;
  gap: var(--ks-band-gap, 18px);
  height: auto;
  min-height: 0;
}

html .killstreaks-aperture .ks-group {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

html .killstreaks-aperture .ks-arsenal__grid {
  align-items: stretch;
  align-content: start;
}

/* Fill ON — arsenal claims leftover; JS fits --ks-card-h so
   2×(label+card) + band-gap == grid height. Cards stay exact token
   height (no min-height overflow). Groups pack; intel stretches to
   the same content row → bottoms lock; band gap stays --ks-band-gap. */
html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-body > section:first-child {
  flex: 0 0 auto;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-arsenal {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  margin-top: 10px;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-arsenal__topline {
  flex: 0 0 auto;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-arsenal__grid {
  display: grid;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  align-content: start;
  grid-template-rows: auto;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-groups {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  gap: var(--ks-band-gap, 18px);
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-group {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  overflow: visible;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-group__label {
  flex: 0 0 auto;
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-cards {
  flex: 0 0 auto;
  align-content: start;
  grid-auto-rows: var(--ks-card-h, 96px);
}

html[data-killstreaks-fill="1"] .killstreaks-aperture .ks-card {
  height: var(--ks-card-h, 96px) !important;
  min-height: var(--ks-card-h, 96px) !important;
  max-height: var(--ks-card-h, 96px) !important;
}

/* Intel layout contract (fills arsenal grid row height):
   Row A — art stage absorbs leftover height after copy+facts measure
   Square — inscribed in Row A via min(stageW, stageH); never forces clip
   Row B — .ks-intel__copy natural height
   Row C — .ks-intel__facts natural height, always fully visible
   Leftover space lives in/around the square — not between brief and Cost. */
html .killstreaks-aperture .ks-intel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Stage: size container that yields leftover height; NOT a forced 1:1 box. */
html .killstreaks-aperture .ks-intel__well {
  container-type: size;
  position: relative;
  display: grid;
  place-items: center;
  grid-row: auto;
  flex: unset;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
}

/* Square image bed inscribed in the stage (override absolute inset:0). */
html .killstreaks-aperture .ks-intel__art {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
  place-self: center;
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
}

html .killstreaks-aperture .ks-intel__glyph {
  grid-area: 1 / 1;
  place-self: center;
  z-index: 1;
  font-size: clamp(
    calc(28px * var(--ks-type-scale, 1)),
    calc(var(--ks-intel-w, 194px) * 0.22 * var(--ks-type-scale, 1)),
    calc(44px * var(--ks-type-scale, 1))
  );
}

html .killstreaks-aperture .ks-intel__copy {
  min-height: 0;
  overflow: visible;
  padding: calc(12px * var(--ks-type-scale, 1)) calc(14px * var(--ks-type-scale, 1)) 0;
  grid-column: auto;
  grid-row: auto;
}

html .killstreaks-aperture .ks-intel__class {
  font: 700 calc(11px * var(--ks-type-scale, 1)) "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.2em;
}

html .killstreaks-aperture .ks-intel__name {
  margin: calc(5px * var(--ks-type-scale, 1)) 0 calc(8px * var(--ks-type-scale, 1));
  font: 700 calc(22px * var(--ks-type-scale, 1)) / 0.95 "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.03em;
}

html .killstreaks-aperture .ks-intel__brief {
  font-size: calc(12px * var(--ks-type-scale, 1));
  line-height: 1.45;
  color: #a7b0b9;
}

html .killstreaks-aperture .ks-intel__facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: calc(12px * var(--ks-type-scale, 1));
  padding: 0 calc(14px * var(--ks-type-scale, 1)) calc(14px * var(--ks-type-scale, 1));
  gap: calc(8px * var(--ks-type-scale, 1));
}

html .killstreaks-aperture .ks-intel__fact {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(8px * var(--ks-type-scale, 1));
  font: 700 calc(11px * var(--ks-type-scale, 1)) "Saira Condensed", Rajdhani, sans-serif;
  letter-spacing: 0.12em;
}

html .killstreaks-aperture .ks-intel__fact dd i {
  font-size: calc(10px * var(--ks-type-scale, 1));
}

/* ── Leftover-height absorb (density runtime toggle · data-lobby-absorb) ─────
   ON: Cap Quick Play + right-rail KS strip; Friends grows into slack.
   OFF: the base frame stretches Quick Play and loadout with flex: 1.
   Rails still zoom from 340 via runtime — caps are design-px, then zoom. */

html[data-lobby-absorb="1"] .lobby-left .duty-log {
  flex: 0 0 auto;
}

/* Objectives take left-rail leftover; QP stays capped at the floor. */
html[data-lobby-absorb="1"] .lobby-left .module--objectives {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Pin CTA cluster to rail floor without letting QP sponge leftover height. */
html[data-lobby-absorb="1"] .lobby-left .play-cluster {
  flex: 0 0 auto;
  margin-top: 0;
  min-height: 0;
  height: auto;
}

html[data-lobby-absorb="1"] .lobby-left .quick-play-frame {
  flex: 0 0 auto;
  min-height: 86px;
  max-height: 96px;
  height: auto;
}

html[data-lobby-absorb="1"] .lobby-left .quick-play {
  flex: 0 0 auto;
  min-height: 86px;
  max-height: 96px;
  height: auto;
}

/* Play mode only — Store/Inventory replace .play-right-stack. */
html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .squad-hub {
  flex: 1 1 auto;
  height: auto;
  min-height: 276px;
  max-height: none;
}

html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .squad-hub__body {
  flex: 1 1 auto;
  min-height: 0;
}

html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .loadout {
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
}

/*
  KS strip must NOT use the stretch-fit cqh sizing from loadout.css
  (container-type:size + --hexw from 100cqh). That cycle collapses when
  the rail is content-sized (flex:0) instead of flex:1 leftover. Pin the
  design socket column (~106px) and 52px hex; rail zoom still scales it.
*/
html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .loadout__rail {
  flex: 0 0 auto;
  container-type: normal;
  min-height: 96px;
  max-height: 128px;
  height: auto;
  padding: var(--pad-t, 10px) 8px 9px;
  align-content: center;
}

html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .loadout__rail > * {
  --ks-stack: 42px;
  --hexw: 52px;
  --hexh: calc(var(--hexw) * 0.866);
}

html[data-lobby-absorb="1"] body[data-lobby-panel="play"] .lobby-right .loadout__action-wrap {
  margin-top: 0;
}

