/* The Armory: the VIGIL and its weapons big and lit, each system a thing you handle. On a wide screen the controls sit over the
   picture; on a phone they sit under it, so a thumb never covers the mech. The words are a line or two under each picture, and
   everything longer is behind a fold. */

.armo { --glass: rgba(9, 12, 17, 0.74); --glass-line: rgba(255, 236, 214, 0.2); --warm: #ffc98f; --teal: #78efe4; --bad: #ff7a5c; overflow-x: clip; background: #3a281b; padding-top: var(--top-height); }
.armo .nw { white-space: nowrap; }

/* ---------- the fitting bay ---------- */
.kit { position: relative; background: #2e2118; }
.kit__view { position: relative; height: clamp(560px, calc(100svh - var(--top-height) - 158px), 900px); }
.kit__scene { position: absolute; inset: 0; overflow: hidden; container-type: size; background: #2c2018; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.kit__scene.is-held { cursor: grabbing; }
/* The hub's bay is one portrait picture: scale it to cover the box and hold its platform (73.4% down it) 11% above the bottom. */
.kit__bay { --pw: max(100cqw, 112cqh); position: absolute; left: 50%; width: var(--pw); height: calc(var(--pw) * 1.125); bottom: calc(11cqh - var(--pw) * 1.125 * 0.266); transform: translateX(-50%); pointer-events: none; }
.kit__plate { position: absolute; inset: 0; width: 100%; height: 100%; filter: brightness(1.42) saturate(1.12); }
.kit__l { position: absolute; background: no-repeat 0 0 / 100% 100%; animation: kit-breathe var(--period) ease-in-out infinite alternate; opacity: 1; }
@keyframes kit-breathe { from { opacity: var(--low); } to { opacity: 1; } }
.kit__shadow { position: absolute; left: 50%; top: 73.4%; width: 30%; height: 4.5%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.25) 55%, transparent); }
.kit__scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(20, 10, 4, 0.5) 0, rgba(20, 10, 4, 0) 34%, rgba(20, 10, 4, 0) 72%, rgba(20, 10, 4, 0.34) 100%), linear-gradient(0deg, rgba(20, 10, 4, 0.4) 0, rgba(20, 10, 4, 0) 22%); }
.kit__mech { --size: min(88cqh, 100cqw); position: absolute; z-index: 2; left: 50%; bottom: calc(11cqh - var(--size) * 0.03); width: var(--size); height: var(--size); transform: translateX(-50%); }
.kit__mech > img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mark { position: absolute; z-index: 3; left: var(--x); top: var(--y); width: 32px; height: 32px; margin: -16px 0 0 -16px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28), 0 3px 12px rgba(0, 0, 0, 0.55); transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease; touch-action: manipulation; }
.mark::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; }   /* a 50 px target */
.mark.is-far { opacity: 0.42; transform: scale(0.82); }
.mark.is-on { background: #fff; transform: scale(1.22); box-shadow: 0 0 0 4px var(--accent), 0 0 22px rgba(255, 190, 120, 0.9); }
.kit__words { position: absolute; z-index: 3; left: var(--gutter); top: clamp(16px, 4vh, 44px); max-width: min(31vw, 520px); pointer-events: none; }
.kit__words .eyebrow { color: #fff; margin: 0; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 1px 10px rgba(0, 0, 0, 0.9); }
.kit h1 { font-family: var(--font-display); font-size: clamp(3.8rem, 7.2vw, 7.6rem); line-height: 0.88; letter-spacing: 0; text-transform: uppercase; color: #fff; margin: 8px 0 10px; text-shadow: 0 4px 40px rgba(20, 8, 0, 0.7); }
.kit__lead { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.42rem); line-height: 1.28; font-weight: 600; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85); }
.kit__scene > .prealpha { top: auto; bottom: 14px; right: var(--gutter); }
.stage__view--climb > .prealpha { top: auto; bottom: 12px; right: auto; left: var(--gutter); }
.kit__hint { position: absolute; z-index: 3; left: 50%; bottom: 8px; margin: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em; color: #fff; text-shadow: 0 1px 8px #000; pointer-events: none; white-space: nowrap; }

.slots { position: absolute; z-index: 4; right: var(--gutter); top: clamp(14px, 3vh, 30px); width: clamp(230px, 22vw, 320px); margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.slot { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; width: 100%; min-height: 72px; padding: 5px 12px 5px 6px; border: 1px solid var(--glass-line); background: var(--glass); color: #fff; font-family: var(--font); text-align: left; cursor: pointer; touch-action: manipulation; }
.slot img { grid-row: 1 / 3; width: 76px; height: 57px; object-fit: contain; }
.slot__num { position: absolute; z-index: 1; left: -9px; top: -7px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.slot__where { align-self: end; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255, 244, 232, 0.84); }
.slot__name { align-self: start; font-family: var(--font-display); font-size: 1.32rem; line-height: 1.05; font-weight: 600; letter-spacing: 0.01em; }
.slot:hover { background: rgba(60, 40, 24, 0.84); }
.slot[aria-pressed="true"] { background: rgba(224, 137, 62, 0.92); border-color: #ffc98f; color: #1a0c02; }
.slot[aria-pressed="true"] .slot__where { color: #2a1404; }
.slot[aria-pressed="true"] .slot__num { background: #fff; }
.slot--empty img { opacity: 0.32; filter: grayscale(0.7); }

.kit__read { position: absolute; z-index: 4; left: var(--gutter); bottom: clamp(14px, 3vh, 28px); width: min(34vw, 460px); display: grid; gap: 6px; }
.load { display: block; height: 6px; background: rgba(255, 255, 255, 0.2); position: relative; }
.load::before { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--v, 0)); background: var(--warm); transition: transform 0.25s ease; }
.load::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: 71.43%; width: 2px; background: #fff; }   /* the maximum: 100% of carrying capacity on a scale that runs to 140% */
.is-over .load::before { background: var(--bad); }
.kit__go { justify-self: start; color: var(--warm); font-weight: 600; font-size: 0.98rem; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }

/* ---------- a tray of pieces ---------- */
.tray { padding: 10px var(--gutter) 12px; background: linear-gradient(180deg, rgba(20, 10, 4, 0.5), rgba(20, 10, 4, 0.16)); }
.tray--kit { background: #3a281b; min-height: 158px; }
.stage--tray { --tray: 134px; }
.tray--guns .part img { max-width: 92px; }
.tray__parts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.tray__parts--eight { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.part { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 4px 3px 6px; border: 1px solid rgba(255, 236, 214, 0.28); background: rgba(250, 240, 228, 0.14); color: #fff; cursor: pointer; font-family: var(--font); touch-action: manipulation; }
.part[hidden] { display: none; }
.part img { width: 100%; max-width: 110px; aspect-ratio: 4 / 3; object-fit: contain; }
.part--mod img { border-radius: 2px; }
.part b { font-family: var(--font-mono); font-weight: 400; font-size: 0.66rem; letter-spacing: 0; line-height: 1.1; text-align: center; }   /* may wrap: "Reactor cooling" is wider than its tile at several widths */
.part span { font-family: var(--font-mono); font-size: 0.6rem; line-height: 1.25; color: rgba(255, 244, 232, 0.84); white-space: nowrap; }
.part small { font-size: 0.66rem; line-height: 1.2; color: rgba(255, 244, 232, 0.8); white-space: nowrap; }
.part small.is-earned { color: var(--warm); }
.part:hover { background: rgba(250, 240, 228, 0.24); }
.part[aria-pressed="true"] { background: rgba(224, 137, 62, 0.88); border-color: #ffc98f; color: #1a0c02; }
.part[aria-pressed="true"] span, .part[aria-pressed="true"] small { color: #2a1404; }
@media (max-width: 1240px) { .tray__parts { grid-template-columns: repeat(6, minmax(0, 1fr)); } .tray__parts--eight { grid-template-columns: repeat(8, minmax(0, 1fr)); } .tray--kit { min-height: 0; } }
@media (max-width: 760px) { .tray__parts, .tray__parts--eight { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- the chapter tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; background: #2c2118; }
.tiles a { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: clamp(96px, 12vw, 160px); padding: 10px 14px; overflow: hidden; text-decoration: none; color: #fff; isolation: isolate; }
.tiles img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.5s ease; }
.tiles a::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 6, 2, 0) 30%, rgba(10, 6, 2, 0.74)); }
.tiles a:hover img, .tiles a:focus-visible img { transform: scale(1.06); }
.tiles b { font-family: var(--font-display); font-size: clamp(1.2rem, 1.9vw, 1.65rem); line-height: 1.05; font-weight: 600; text-transform: uppercase; letter-spacing: 0.01em; }
.tiles span { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 244, 232, 0.88); }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* ---------- a stage ---------- */
.bay { background: rgb(var(--tone)); }
.stage { position: relative; isolation: isolate; }
.stage__view { position: relative; height: clamp(600px, 88svh, 920px); overflow: hidden; background: rgb(var(--tone)); }
.stage__bg, .stage__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage__view::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(8, 6, 4, 0.44) 0, rgba(8, 6, 4, 0) 34%); }
.stage canvas[data-main] { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.stage__head { position: absolute; z-index: 4; left: var(--gutter); top: clamp(16px, 3.4vh, 38px); right: var(--gutter); pointer-events: none; }
.kicker { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75); }
.kicker b { color: var(--warm); font-weight: 400; margin-right: 6px; }
.stage__head h2, .crate h2 { font-family: var(--font-display); font-size: clamp(3rem, 8.4vw, 7.4rem); line-height: 0.94; text-transform: uppercase; color: #fff; margin: 2px 0 4px; letter-spacing: 0; text-shadow: 0 3px 34px rgba(0, 0, 0, 0.5); }
.stage__do { margin: 0; max-width: 34em; font-size: clamp(1.02rem, 1.5vw, 1.3rem); line-height: 1.3; color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 1px 14px rgba(0, 0, 0, 0.85); }

.dock { position: absolute; z-index: 5; right: var(--gutter); bottom: clamp(16px, 3vh, 30px); width: min(420px, 32vw); display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { .stage--tray > .stage__view { height: clamp(520px, calc(100svh - var(--top-height) - var(--tray)), 880px); } }   /* the picture, its picker and its trigger on one screen */
.stage--tray > .tray { height: var(--tray); overflow: hidden; }
.stage--tray > .dock { bottom: calc(var(--tray) + 12px); }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.hud { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; background: var(--glass-line); border: 1px solid var(--glass-line); }
.hud--three { grid-template-columns: repeat(3, 1fr); }
.hud--four { grid-template-columns: repeat(4, 1fr); }
.hud > div { background: var(--glass); padding: 8px 10px; min-width: 0; }
.hud dt { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255, 244, 232, 0.84); line-height: 1.25; }
.hud dd { margin: 2px 0 0; font-family: var(--font-display); font-size: clamp(1.14rem, 1.5vw, 1.4rem); font-weight: 600; line-height: 1.08; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud--four dd { font-size: clamp(1rem, 1.25vw, 1.18rem); }
.verdict { margin: 0; padding: 9px 12px; background: var(--glass); border-left: 3px solid var(--warm); color: #fff; font-size: 1rem; line-height: 1.32; min-height: 3.2em; }
.is-over .verdict, [data-state="locked"] .verdict, [data-state="dry"] .verdict { border-left-color: var(--bad); }

.chip { min-height: 40px; padding: 0 12px; border: 1px solid rgba(255, 236, 214, 0.55); background: var(--glass); color: #fff; font-family: var(--font); font-weight: 600; font-size: 0.92rem; cursor: pointer; touch-action: manipulation; }
.chip:hover { background: rgba(60, 40, 24, 0.86); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip--quiet { border-style: dashed; margin-left: auto; }
.act { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; width: 100%; padding: 0 22px; border: 0; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 8px 26px rgba(224, 137, 62, 0.42); }
[data-trigger] { touch-action: none; }   /* a hold, never a scroll */
.act:hover { background: #f0a25c; }
.act.is-held { background: #ffd9a8; transform: translateY(1px); box-shadow: 0 0 40px rgba(255, 180, 100, 0.85); }
.act:disabled { background: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.7); box-shadow: none; cursor: default; }
.no-js .act, .no-js .chip, .no-js .mark, .no-js .tray--guns, .no-js .rung, .no-js [data-bank], .no-js .hill input { display: none; }
.no-js .part, .no-js .slot { pointer-events: none; }

.gauge { position: relative; display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: baseline; padding: 7px 12px 12px; background: var(--glass); color: #fff; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.gauge small { font-size: 0.66rem; text-transform: none; letter-spacing: 0; color: rgba(255, 244, 232, 0.84); }
.gauge b { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge i { grid-column: 1 / -1; display: block; height: 11px; margin-top: 5px; background: linear-gradient(90deg, #78efe4 0, #ffd17a 55%, #ff7a5c 90%); clip-path: inset(0 calc((1 - var(--v, 0)) * 100%) 0 0); }
.gauge::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 12px; height: 11px; background: rgba(255, 255, 255, 0.16); }
.is-hot .gauge b { color: var(--bad); }

/* ---------- fire it ---------- */
.fire__target { position: absolute; z-index: 2; left: 6%; bottom: 36%; height: 24%; aspect-ratio: 1; pointer-events: none; }
.fire__target img, .reach__target img { position: relative; display: block; width: 100%; height: 100%; }
.fire__target img { filter: url(#land-desert); }
.reach__target img { filter: url(#land-snow); }
.fire__target::before, .reach__target::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: -3%; height: 10%; background: radial-gradient(closest-side, rgba(6, 4, 2, 0.62), rgba(6, 4, 2, 0.24) 60%, rgba(6, 4, 2, 0)); }
.fire__gun { position: absolute; z-index: 2; left: 25%; top: 25%; width: 42%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; pointer-events: none; filter: drop-shadow(0 26px 34px rgba(20, 8, 0, 0.55)); transform: translate(var(--kick, 0), calc(var(--kick, 0) * 0.3)); transition: opacity 0.2s; }
.fire__hot { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(255, 70, 20, 0) 45%, rgba(255, 70, 20, 0.55) 100%); opacity: var(--hot, 0); }
[data-state="locked"] .fire__gun { filter: drop-shadow(0 26px 34px rgba(20, 8, 0, 0.55)) saturate(0.45) brightness(0.8); }

/* ---------- reach it ---------- */
.stage__view--reach { height: clamp(600px, calc(100svh - var(--top-height)), 880px); touch-action: pan-y; cursor: ew-resize; }
.reach__target { position: absolute; z-index: 2; left: 29%; top: var(--feet); height: var(--tall); aspect-ratio: 1; transform: translate(-50%, -99%); pointer-events: none; }
.reach__tag { position: absolute; z-index: 3; left: 29%; top: calc(var(--feet) - var(--tall) * 0.96); transform: translate(-50%, -100%); padding: 1px 8px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 0.72rem; white-space: nowrap; pointer-events: none; }
.hill { display: block; padding: 9px 13px 8px; background: var(--glass); color: #fff; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
.hill span { display: flex; justify-content: space-between; align-items: baseline; }
.hill output { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; }
.hill input { width: 100%; height: 42px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: grab; touch-action: pan-y; }
.hill input::-webkit-slider-runnable-track { height: 8px; background: linear-gradient(90deg, #78efe4, #ffd17a 60%, #ff7a5c); }
.hill input::-moz-range-track { height: 8px; background: linear-gradient(90deg, #78efe4, #ffd17a 60%, #ff7a5c); }
.hill input::-webkit-slider-thumb { -webkit-appearance: none; width: 36px; height: 36px; margin-top: -14px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 3px 14px rgba(0, 0, 0, 0.5); }
.hill input::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); }
.hill--reach { position: absolute; z-index: 4; left: var(--gutter); width: min(44vw, 620px); bottom: clamp(12px, 2.4vh, 24px); }
.lineup { position: absolute; z-index: 5; right: var(--gutter); bottom: clamp(12px, 2.4vh, 24px); width: min(41vw, 590px); color: #fff; }
.lineup__head { display: grid; gap: 6px; margin-bottom: 6px; }
.lineup__head .verdict { min-height: 0; }
.ladder { position: relative; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.gun { display: grid; grid-template-columns: 54px 6.2em minmax(0, 1fr) 5.4em; gap: 0 10px; align-items: center; padding: 1px 10px 1px 4px; background: rgba(9, 12, 17, 0.74); transition: opacity 0.2s, background 0.2s; }
.gun img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.gun__name { font-family: var(--font-display); font-size: clamp(1.12rem, 1.5vw, 1.36rem); line-height: 1.1; font-weight: 600; white-space: nowrap; }
.gun__run { position: relative; height: 18px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 2px, rgba(255, 255, 255, 0.08) 2px); }
.gun__run i { position: absolute; left: 0; top: 3px; bottom: 3px; width: calc(var(--at, 0) * 100%); background: var(--teal); transition: width 0.25s ease, background 0.2s; }
.gun__off { text-align: right; font-family: var(--font-display); font-size: clamp(1.05rem, 1.5vw, 1.32rem); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gun.is-out { background: rgba(9, 12, 17, 0.42); }
.gun.is-out .gun__name, .gun.is-out .gun__off { opacity: 0.56; }
.gun.is-out img { opacity: 0.45; filter: grayscale(0.8); }
.gun.is-out .gun__run i { background: var(--bad); }
.ladder[data-rank]:not([data-rank="reach"]) .gun__run i { background: var(--warm); }

/* ---------- break it ---------- */
.stage[data-biome="desert"] .salv > img { filter: url(#land-desert); }
.stage[data-biome="snow"] .salv > img { filter: url(#land-snow); }
.stage[data-biome="jungle"] .salv > img { filter: url(#land-jungle); }
.stage[data-biome="volcanic"] .salv > img { filter: url(#land-volcanic); }
.stage[data-biome="volcanic"] .stage__bg img { filter: brightness(1.6) saturate(1.08); }   /* the badlands' storm is too dark for a page that should feel lit */
.stage[data-biome="jungle"] .stage__bg img { filter: brightness(1.4) saturate(1.1); }
.salv { position: absolute; z-index: 2; left: 50%; bottom: 1%; height: 90%; aspect-ratio: 1; transform: translateX(-50%); }
.salv > img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.zone { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); padding: 0; border: 0; background: transparent; cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.zone:hover, .zone:focus-visible, .zone.is-hit { background: rgba(255, 200, 140, 0.2); outline: 1px solid rgba(255, 220, 180, 0.72); outline-offset: -1px; }
.zone__chip { position: absolute; left: 50%; top: var(--cy, 50%); transform: translate(-50%, -50%); display: flex; gap: 0; pointer-events: none; }
.zone__chip img { width: clamp(30px, 5.6cqh, 46px); height: clamp(30px, 5.6cqh, 46px); object-fit: cover; border-radius: 50%; border: 2px solid #fff; background: #1a120c; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.zone__chip img + img { margin-left: -9px; }
.zone__chip i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.86); background: rgba(40, 20, 12, 0.72); color: #fff; font-style: normal; font-weight: 600; }
.stage__view--salvage { container-type: size; }
.stage__view--salvage .stage__head { right: auto; }
@media (min-width: 900px) { .stage__view--salvage .stage__do { max-width: 23vw; } }
/* A squarer window: a smaller VIGIL, a little left, or the title meets its pod and the dock covers its arm. */
@media (min-width: 900px) and (max-width: 1199px) {
  .salv { left: 47%; height: 82%; }
}
.salv::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: -1%; height: 13%; background: radial-gradient(closest-side, rgba(6, 4, 2, 0.72), rgba(6, 4, 2, 0.3) 62%, rgba(6, 4, 2, 0)); pointer-events: none; }
.bank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin: 0; padding: 0; list-style: none; background: var(--glass-line); border: 1px solid var(--glass-line); }
.bank li { position: relative; display: grid; grid-template-columns: 34px 1fr; column-gap: 4px; align-items: center; padding: 5px 6px 8px; background: var(--glass); color: #fff; min-width: 0; }
.bank img { width: 34px; height: 34px; object-fit: cover; border-radius: 3px; }
.bank b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bank span { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0; line-height: 1.2; margin-top: 3px; color: rgba(255, 244, 232, 0.86); overflow-wrap: anywhere; }
.bank i { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.14); }
.bank i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--f, 0)); background: var(--warm); }
.bank .is-wild i::after { background: var(--teal); }
.bank li.is-new { background: rgba(224, 137, 62, 0.72); }

/* ---------- open it ---------- */
.crate { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.8fr); gap: clamp(16px, 3vw, 44px); align-items: center; padding: clamp(24px, 5vh, 56px) var(--gutter); background: linear-gradient(180deg, #7d4c28, #5a3a1c); color: #fff; }
.crate__art { margin: 0; position: relative; }
.crate__art img { display: block; width: 100%; max-width: 520px; margin: auto; filter: drop-shadow(0 22px 30px rgba(20, 8, 0, 0.55)); }
.crate__art.is-open img { animation: crate-pop 0.5s ease; }
@keyframes crate-pop { 0% { transform: scale(1) rotate(0); } 30% { transform: scale(1.07) rotate(-1.6deg); } 60% { transform: scale(1.03) rotate(1.2deg); } 100% { transform: scale(1) rotate(0); } }
.crate h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
.grades { display: grid; gap: 3px; margin: 8px 0 0; padding: 0; list-style: none; }
.grades li { display: grid; grid-template-columns: 74px minmax(0, 1fr) 3.2em 4.4em; gap: 8px; align-items: center; padding: 4px 8px; background: rgba(20, 10, 4, 0.34); }
.grades li.is-rolled { background: var(--accent); color: var(--accent-ink); }
.grades b { font-family: var(--font-display); font-size: 1.26rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.grades small { font-size: 0.86rem; white-space: nowrap; }
.grades__bar { position: relative; height: 10px; background: rgba(255, 255, 255, 0.12); }
.grades__bar i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); background: var(--warm); transition: width 0.3s ease; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.pips i.on { background: var(--warm); }
.is-rolled .pips i.on { background: var(--accent-ink); }
.crate__do { display: grid; gap: 10px; }

/* ---------- climb it ---------- */
.stage__view--climb { height: clamp(560px, 80svh, 860px); background: #2c2018; }
.climb__bay { position: absolute; inset: 0; overflow: hidden; }
.climb__bay img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; filter: brightness(1.5) saturate(1.1); }
.climb__bay::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 62% at 34% 58%, rgba(255, 176, 96, calc(0.1 + var(--mk, 0) * 0.14)), rgba(255, 176, 96, 0) 70%); transition: background 0.3s; }
.climb__gun { position: absolute; z-index: 2; left: 8%; top: 27%; width: 46%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; pointer-events: none; filter: drop-shadow(0 30px 40px rgba(14, 6, 0, 0.7)); }
.climb__mk { position: absolute; z-index: 2; right: var(--gutter); top: clamp(16px, 3.4vh, 38px); margin: 0; font-family: var(--font-display); font-size: clamp(3.2rem, 9vw, 7.6rem); line-height: 0.9; font-weight: 600; text-transform: uppercase; color: var(--warm); text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); pointer-events: none; }
.rungs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rung { min-height: 56px; border: 1px solid rgba(255, 236, 214, 0.5); background: var(--glass); color: #fff; font-family: var(--font-display); font-size: 1.32rem; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.rung:hover { background: rgba(60, 40, 24, 0.86); }
.rung[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gain { position: relative; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; padding: 9px 13px 14px; background: var(--glass); color: #fff; }
.gain span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; }
.gain b { font-family: var(--font-display); font-size: clamp(2.4rem, 3.6vw, 3.2rem); line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.gain small { grid-column: 1 / -1; font-size: 0.92rem; color: var(--warm); }
.gain i { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, 0.16); }
.gain i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--v, 0)); background: var(--warm); transition: transform 0.25s ease; }
.bill { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; padding: 0; list-style: none; background: var(--glass-line); border: 1px solid var(--glass-line); }
.bill li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 6px 10px; background: var(--glass); color: #fff; min-height: 56px; }
.bill img { grid-row: 1 / 3; width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.bill b { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.05; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill span { grid-column: 2; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.02em; color: rgba(255, 244, 232, 0.86); }
.bill li:nth-child(n + 3) b, .bill li:nth-child(n + 3) span { grid-column: 1 / -1; }

/* ---------- the words under a stage ---------- */
.note { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px clamp(20px, 4vw, 60px); align-items: start; padding: clamp(18px, 3.2vh, 34px) var(--gutter); background: linear-gradient(180deg, rgba(8, 6, 4, 0.1), rgba(8, 6, 4, 0.34)); color: #fff; }
.note__say { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.36rem); line-height: 1.34; text-wrap: pretty; max-width: 40em; }
.sums { background: rgba(8, 6, 4, 0.3); border: 1px solid rgba(255, 236, 214, 0.28); padding: 0 14px; }
.sums summary { min-height: 46px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.sums summary::-webkit-details-marker { display: none; }
.sums summary::after { content: "+"; font-size: 1.4rem; color: var(--warm); }
.sums[open] summary::after { content: "−"; }
.sums[open] { padding-bottom: 14px; }
.sums p { font-size: 1rem; line-height: 1.45; margin: 0 0 0.8em; }
.sums a { color: var(--warm); }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 1rem; line-height: 1.36; }
.points b { color: var(--warm); font-weight: 600; }

/* ---------- the end, and every piece in full ---------- */
.end { padding: clamp(40px, 8vh, 88px) var(--gutter); text-align: center; background: linear-gradient(180deg, rgb(120, 84, 44), #5a3a1c 60%, #3a2412); color: #fff; }
.end__line { margin: 0 auto 22px; max-width: 18em; font-family: var(--font-display); font-size: clamp(2.2rem, 5.6vw, 4.6rem); line-height: 1; text-transform: uppercase; font-weight: 600; }
.end__buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 20px; }
.end__source { margin: 0 auto; max-width: 44em; font-size: 0.92rem; line-height: 1.4; color: rgba(255, 244, 232, 0.86); }

.sheet { background: #3a2412; color: #fff; }
.sheet > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-height: 64px; padding: 14px var(--gutter); cursor: pointer; list-style: none; border-top: 1px solid rgba(255, 236, 214, 0.2); font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; text-transform: uppercase; }
.sheet > summary::-webkit-details-marker { display: none; }
.sheet > summary::after { content: "+"; margin-left: auto; color: var(--warm); }
.sheet[open] > summary::after { content: "−"; }
.sheet > summary small { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: rgba(255, 244, 232, 0.84); }
.sheet__body { padding: 0 var(--gutter) clamp(30px, 6vh, 60px); display: grid; gap: 14px; }
.piece { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(12px, 3vw, 36px); align-items: center; padding: 14px; background: rgba(250, 240, 228, 0.08); scroll-margin-top: calc(var(--top-height) + 8px); }
.piece__stage img { display: block; width: 100%; height: auto; }
.piece__kicker { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warm); }
.piece__name { margin: 2px 0; font-family: var(--font-display); font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1; font-weight: 600; }
.piece__own { margin: 0 0 6px; font-size: 0.92rem; color: rgba(255, 244, 232, 0.84); }
.piece__own.is-earned { color: var(--warm); }
.piece__text { margin: 0 0 10px; font-size: 1rem; line-height: 1.42; max-width: 44em; }
.piece__stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin: 0 0 8px; }
.piece__stats > div { padding: 6px 8px; background: rgba(8, 6, 4, 0.3); min-width: 0; }
.piece__stats dt { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 244, 232, 0.84); }
.piece__stats dd { margin: 0; font-size: 0.82rem; line-height: 1.2; }
.piece__stats dd b { display: inline; font-family: var(--font-display); font-size: 1.26rem; font-weight: 600; }
.piece__stats dd small { display: block; font-size: 0.72rem; color: rgba(255, 244, 232, 0.8); }
.piece__foot { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 0.9rem; }
.piece__fit { color: var(--warm); font-weight: 600; }
.modules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.module { padding: 10px; background: rgba(250, 240, 228, 0.08); scroll-margin-top: calc(var(--top-height) + 8px); }
.module p { margin: 0 0 8px; font-size: 0.96rem; line-height: 1.4; }
.module__art { display: block; position: relative; }
.module__art img { display: block; width: 100%; height: auto; }
.module__weight { margin: 8px 0 0; font-size: 0.86rem; }
.module__weight b { font-family: var(--font-display); font-size: 1.2rem; }
.module__name { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.upg__table { display: grid; gap: 2px; }
.upg__row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2px; }
.upg__row > div { padding: 8px 10px; background: rgba(250, 240, 228, 0.08); min-width: 0; }
.upg__lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.upg__coin, .upg__part-art { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.upg__lead-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.upg__guns { display: inline-flex; flex-wrap: wrap; }
.upg__guns img { width: 46px; height: 35px; object-fit: contain; }
.upg__who { flex-basis: 100%; font-size: 0.9rem; color: rgba(255, 244, 232, 0.86); }
.upg__step { display: flex; flex-direction: column; gap: 1px; font-size: 0.92rem; }
.upg__step b { font-family: var(--font-display); font-size: 1.34rem; font-weight: 600; }
.upg__step small { font-size: 0.8rem; color: rgba(255, 244, 232, 0.84); }
.upg__mk { font-family: var(--font-mono); font-size: 0.68rem; color: var(--warm); }
.upg__note { margin: 4px 0 0; font-size: 0.96rem; line-height: 1.4; }

/* ---------- a phone: the picture, then the controls under it ---------- */
@media (max-width: 899px) {
  .kit__view { height: auto; }
  .kit__scene { position: relative; inset: auto; height: clamp(480px, 62svh, 640px); }
  .kit__bay { bottom: calc(8cqh - var(--pw) * 1.125 * 0.266); }
  .kit__mech { --size: min(70cqh, 104cqw); bottom: calc(8cqh - var(--size) * 0.03); }
  .kit__words { right: var(--gutter); max-width: none; top: 12px; }
  .kit h1 { font-size: clamp(3.2rem, 15vw, 5rem); margin: 4px 0 4px; }
  .kit__lead { font-size: 1rem; }
  .slots { position: static; width: auto; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 10px 12px 8px; background: #3a281b; }
  .slot { display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 3px 2px 5px; text-align: center; }
  .slot img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .slot__num { left: 2px; top: 2px; width: 20px; height: 20px; font-size: 0.82rem; }
  .slot__where { display: none; }
  .slot__name { font-size: 0.82rem; line-height: 1.05; white-space: normal; overflow-wrap: anywhere; }
  .kit__read { position: static; width: auto; padding: 0 16px 10px; background: #3a281b; }
  .tray { padding: 10px 12px 12px; }
  .tray--kit { padding-top: 2px; }
  .tray--guns { background: rgba(20, 10, 4, 0.36); }
  .part b { font-size: 0.62rem; }
  .part span { font-size: 0.52rem; }
  .stage__view { height: clamp(380px, 58svh, 620px); }
  .stage__view--fire { height: clamp(330px, 44svh, 520px); }
  .stage__view--reach { height: clamp(400px, 52svh, 560px); }
  .reach__target, .reach__tag { left: 50%; }
  .stage__view--salvage { height: clamp(470px, 60svh, 640px); }
  .stage__view--climb { height: clamp(340px, 46svh, 520px); }
  .dock { position: static; width: auto; padding: 12px 16px 14px; background: linear-gradient(180deg, rgba(8, 6, 4, 0.42), rgba(8, 6, 4, 0.14)); }
  .stage__head h2 { font-size: clamp(2.8rem, 13vw, 4.4rem); }
  .stage__do { font-size: 1rem; max-width: none; }
  .stage--tray > .tray { height: auto; overflow: visible; }
  .fire__target { left: 0; top: 40%; bottom: auto; height: 28%; }
  .kit__scene > .prealpha { top: 8px; bottom: auto; right: 10px; }
  .kit__hint { left: 0; right: 0; bottom: 5px; padding: 0 var(--gutter); transform: none; text-align: center; line-height: 1.25; white-space: normal; }
  .sheet > summary { position: relative; padding-right: calc(var(--gutter) + 26px); }
  .sheet > summary::after { position: absolute; right: var(--gutter); top: 14px; margin: 0; }
  .fire__gun { left: auto; right: -2%; top: auto; bottom: 2%; width: 78%; }
  .stage__view--salvage .stage__head { right: var(--gutter); max-width: none; }
  .salv { left: 50%; top: auto; bottom: 0; height: 72%; }
  .climb__gun { left: auto; right: 2%; top: auto; bottom: 0; width: min(76%, 430px); }
  .climb__mk { font-size: clamp(2.6rem, 12vw, 3.6rem); top: 34px; right: 16px; }
  .lineup .chip { padding: 0 8px; font-size: 0.86rem; }
  .note { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .lineup { position: static; width: auto; padding: 10px 12px 18px; background: linear-gradient(180deg, rgb(62, 90, 124), rgb(42, 56, 78)); }
  .hill--reach { left: 12px; right: 12px; width: auto; bottom: 10px; }
  .gun { grid-template-columns: 44px 5.4em minmax(0, 1fr) 5em; gap: 0 6px; padding: 0 8px 0 2px; }
  .gun__name { font-size: 1.04rem; }
  .gun__off { font-size: 1rem; }
  .gun__run { height: 12px; }
  .gun__run i { top: 2px; bottom: 2px; }
  .crate { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 24px; }
  .crate__art img { max-width: 300px; }
  .grades li { grid-template-columns: 70px minmax(0, 1fr) 3em 4.2em; gap: 6px; padding: 4px 6px; }
  .piece { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .piece__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modules { grid-template-columns: 1fr 1fr; }
  .upg__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upg__lead { grid-column: 1 / -1; }
}

.stage:has(input:focus-visible) .hill input::-webkit-slider-thumb { outline: 3px solid #fff; }
.kit__scene:has(input:focus-visible) { outline: 3px solid #fff; outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  .kit__l { animation: none; }
  .mark, .tiles img, .load::before, .gun, .gun__run i, .grades__bar i, .gain i::after, .fire__gun { transition: none; }
  .crate__art.is-open img { animation: none; }
}
