@font-face {
  font-family: "Chakra Petch";
  src: url("../assets/fonts/ChakraPetch-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../assets/fonts/ChakraPetch-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/Silkscreen-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #070a09;
  --bg-deep: #040706;
  --panel: rgba(12, 19, 17, 0.88);
  --panel-strong: rgba(15, 23, 20, 0.96);
  --paper: #ede6d3;
  --paper-dim: #cbbfa7;
  --muted: #97a399;
  --muted-2: #78877b;
  --line: rgba(226, 223, 201, 0.13);
  --line-strong: rgba(226, 223, 201, 0.25);
  --amber: #ffb52d;
  --amber-hot: #ff6f1d;
  --cyan: #5ff0ce;
  --cyan-dim: #2c9f8b;
  --red: #ff4f58;
  --green: #a9e56e;
  --blue: #75b9ff;
  --violet: #b896ff;
  --font-ui: "Chakra Petch", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Silkscreen", "Chakra Petch", monospace;
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --cut: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  --cut-lg: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg-deep); color: var(--paper); }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
::selection { background: var(--amber); color: #0a0b08; }

.hidden { display: none !important; }
.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.app {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  background:
    radial-gradient(circle at 76% 38%, rgba(32, 86, 70, 0.2), transparent 42%),
    radial-gradient(circle at 10% 85%, rgba(255, 111, 29, 0.09), transparent 35%),
    linear-gradient(135deg, #080c0b 0%, #050807 50%, #0a0f0d 100%);
}

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient__glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.ambient__glow--one { width: 48vw; height: 48vw; right: -15vw; top: -18vw; background: rgba(47, 128, 105, 0.18); }
.ambient__glow--two { width: 36vw; height: 36vw; left: -18vw; bottom: -15vw; background: rgba(255, 111, 29, 0.12); }
.ambient__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(213, 236, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213, 236, 220, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 78%);
  opacity: 0.7;
}
.ambient__noise {
  position: absolute; inset: -20%;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.7s steps(2) infinite;
}
.ambient__vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.62) 100%); }
@keyframes grain {
  0% { transform: translate(0,0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -2%); }
  100% { transform: translate(3%, 1%); }
}

/* ---------- shared bits ---------- */
.kbd, kbd {
  font-family: var(--font-ui);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 23px; height: 21px; padding: 0 5px;
  border: 1px solid var(--line-strong);
  background: rgba(237, 230, 211, 0.05);
  color: var(--paper);
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.35);
}
.pad-state { font-family: var(--font-display); font-size: 9px; letter-spacing: .12em; color: var(--muted-2); border-left: 1px solid var(--line); padding-left: 12px; }
.pad-state.is-on { color: var(--cyan); text-shadow: 0 0 10px rgba(95,240,206,.35); }
.status-led {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 9px; letter-spacing: .12em; color: var(--muted);
}
.status-led i, .live-dot i, .blink-dot {
  width: 6px; height: 6px; background: var(--cyan); display: inline-block;
  box-shadow: 0 0 10px var(--cyan); animation: ledPulse 2s infinite;
}
@keyframes ledPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- hangar top ---------- */
.menu-screen {
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 22px clamp(24px, 3.2vw, 56px) 0;
  position: relative;
}
.hangar-top {
  display: flex; justify-content: space-between; align-items: center;
  height: 50px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.brand-lockup { display: flex; gap: 13px; align-items: center; }
.brand-mark {
  width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  padding: 4px; border: 1px solid rgba(255,181,45,.55); transform: rotate(45deg);
  background: rgba(255,181,45,.06); box-shadow: 0 0 22px rgba(255,181,45,.12);
}
.brand-mark span { background: var(--amber); display: block; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { background: rgba(255,181,45,.24); }
.brand-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: .11em; line-height: 1; }
.brand-name span { color: var(--amber); margin-left: 3px; }
.brand-sub { font-size: 9px; letter-spacing: .24em; color: var(--muted); margin-top: 6px; }
.hangar-top__right { display: flex; align-items: center; gap: 18px; }
.icon-btn {
  width: 38px; height: 34px; border: 1px solid var(--line);
  background: rgba(237,230,211,.025); display: inline-grid; place-items: center;
  padding: 0; transition: border-color .2s, background .2s, color .2s;
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.icon-btn:hover { border-color: var(--amber); color: var(--amber); background: rgba(255,181,45,.08); }
.icon-btn--ghost { border-color: transparent; }
.icon-btn.is-muted { color: var(--muted-2); }

/* ---------- hero layout ---------- */
.hangar-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, .84fr);
  gap: clamp(28px, 4.5vw, 80px);
  align-items: center;
  padding: clamp(18px, 3.2vh, 44px) 0 clamp(18px, 2.6vh, 36px);
  max-width: 1540px; width: 100%; margin: 0 auto;
  min-height: 0;
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 9px; letter-spacing: .2em; color: var(--amber);
  margin-bottom: clamp(12px, 2vh, 22px);
}
.eyebrow__line { width: 34px; height: 1px; background: var(--amber); box-shadow: 0 0 12px rgba(255,181,45,.5); }
.game-title {
  position: relative;
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(64px, 8.5vw, 138px);
  line-height: .76; letter-spacing: -.09em;
  width: max-content; max-width: 100%;
  text-transform: uppercase;
}
.game-title__brick, .game-title__fire { display: block; position: relative; }
.game-title__brick {
  color: transparent;
  -webkit-text-stroke: clamp(1px, .16vw, 3px) var(--paper);
  text-shadow: 0 0 30px rgba(237,230,211,.07);
}
.game-title__brick::before, .game-title__brick::after {
  content: attr(data-glitch);
}
.game-title__fire {
  color: var(--amber);
  text-shadow: 5px 5px 0 rgba(255,111,29,.12), 0 0 40px rgba(255,111,29,.22);
  margin-left: clamp(24px, 4vw, 72px);
}
.game-title__fire::after {
  content: ""; position: absolute; left: 2%; right: -1%; bottom: 2%; height: 3px;
  background: repeating-linear-gradient(90deg, var(--amber-hot) 0 18px, transparent 18px 26px);
  opacity: .5;
}
.game-title__tag {
  position: absolute; right: -6px; bottom: -32px;
  font-size: clamp(11px, 1.1vw, 17px); letter-spacing: .17em;
  color: #0b0e0b; background: var(--paper);
  padding: .45em .8em .35em; line-height: 1;
  transform: skewX(-8deg);
  box-shadow: 5px 5px 0 rgba(255,181,45,.68);
}
.cn-title {
  display: flex; gap: .28em; margin-top: clamp(34px, 4.4vh, 50px);
  font-family: var(--font-cn); font-weight: 900; font-size: clamp(16px, 1.55vw, 23px);
  letter-spacing: .5em; color: var(--paper-dim);
}
.cn-title span { border-bottom: 1px solid rgba(255,181,45,.45); padding-bottom: 7px; }
.hero-pitch {
  color: var(--muted); font-family: var(--font-cn); font-size: clamp(12px, .98vw, 15px);
  line-height: 1.9; max-width: 570px; margin: clamp(15px, 2.2vh, 25px) 0 clamp(18px, 2.8vh, 32px);
}
.hero-pitch strong { color: var(--cyan); font-weight: 600; }
.section-label {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  font-family: var(--font-display); font-size: 8px; letter-spacing: .14em; color: var(--muted);
}
.section-label span { color: var(--amber); }
.arena-options { display: flex; gap: 7px; }
.arena-card {
  flex: 1; min-width: 0; text-align: left; position: relative;
  border: 1px solid var(--line); background: rgba(8, 13, 11, .58);
  padding: 12px 12px 11px; min-height: 83px;
  clip-path: var(--cut);
  transition: border-color .22s, background .22s, transform .22s;
}
.arena-card:hover { border-color: rgba(255,181,45,.45); transform: translateY(-2px); background: rgba(255,181,45,.035); }
.arena-card.is-active {
  border-color: var(--amber); background: linear-gradient(145deg, rgba(255,181,45,.15), rgba(255,181,45,.025) 58%);
  box-shadow: inset 0 0 0 1px rgba(255,181,45,.13);
}
.arena-card.is-active::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent);
}
.arena-card__index { display: block; font-family: var(--font-display); font-size: 8px; color: var(--amber); margin-bottom: 9px; }
.arena-card__name { display: block; font-family: var(--font-cn); font-weight: 700; font-size: 13px; letter-spacing: .08em; white-space: nowrap; }
.arena-card__en { display: block; font-family: var(--font-display); font-size: 7px; letter-spacing: .08em; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.arena-card__trait { display: block; font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arena-card__diff { display: block; margin-top: 5px; font-family: var(--font-display); font-size: 6px; letter-spacing: .06em; color: var(--cyan); white-space: nowrap; }
.arena-card__diff--hard { color: var(--amber); }
.arena-card__diff--nightmare { color: #ff8a8d; }
.arena-card.is-active .arena-card__trait { color: var(--paper-dim); }
.mode-picker { margin-top: 17px; }
.mode-options { display: flex; gap: 6px; }
.mode-card { display: flex; flex-direction: column; gap: 2px; min-width: 132px; padding: 9px 13px; border: 1px solid var(--line); background: rgba(8,13,11,.58); clip-path: var(--cut); text-align: left; transition: border-color .2s, background .2s; }
.mode-card strong { font-family: var(--font-cn); font-size: 12px; letter-spacing: .08em; font-weight: 700; }
.mode-card small { font-family: var(--font-display); font-size: 6px; letter-spacing: .12em; color: var(--muted-2); }
.mode-card:hover { border-color: rgba(95,240,206,.45); }
.mode-card.is-active { border-color: var(--cyan); background: rgba(95,240,206,.09); box-shadow: inset 0 0 0 1px rgba(95,240,206,.1); }
.mode-card.is-active small { color: var(--cyan); }
.mode-hint { display: block; margin-top: 7px; font-family: var(--font-cn); font-size: 8px; letter-spacing: .05em; color: var(--muted-2); }
.touch-hint { display: none; margin-top: 5px; font-family: var(--font-cn); font-size: 8px; line-height: 1.55; letter-spacing: .03em; color: var(--cyan); }
.menu-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: clamp(20px, 3vh, 32px); }
.menu-actions .text-btn { padding: 12px 16px; border: 1px solid var(--line-strong); background: rgba(10, 16, 13, .45); clip-path: var(--cut); }
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 15px;
  min-width: 252px; border: 1px solid var(--amber); background: var(--amber); color: #0b0b07;
  padding: 13px 18px; text-align: left; clip-path: var(--cut);
  transition: background .18s, color .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 0 0 rgba(255,181,45,0);
}
.cta:hover { background: var(--paper); border-color: var(--paper); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,181,45,.16); }
.cta:active { transform: translateY(0); }
.cta__corners { position: absolute; inset: 4px; border: 1px solid rgba(10,10,6,.18); pointer-events: none; clip-path: var(--cut); }
.cta__icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(0,0,0,.25); }
.cta__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cta__copy { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.cta__copy strong { font-family: var(--font-cn); font-size: 15px; letter-spacing: .12em; }
.cta__copy small { font-family: var(--font-display); font-size: 7px; letter-spacing: .14em; opacity: .62; }
.cta__arrow { font-size: 23px; font-weight: 300; line-height: 1; }
.cta--small { min-width: 218px; padding: 10px 16px; }
.text-btn {
  border: 0; background: none; color: var(--paper-dim);
  font-family: var(--font-cn); font-size: 12px; letter-spacing: .09em;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 0;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.text-btn span {
  width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 8px;
}
.text-btn:hover { color: var(--amber); border-color: var(--amber); }
.text-btn--muted { color: #96a599; }
.record-strip {
  display: flex; gap: clamp(22px, 3vw, 48px); margin-top: clamp(21px, 3.4vh, 38px);
  border-top: 1px solid var(--line); padding-top: 13px; width: min(100%, 470px);
}
.record-strip div { display: flex; flex-direction: column; gap: 3px; }
.record-strip span { font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); letter-spacing: .08em; }
.record-strip strong { font-family: var(--font-display); font-size: 12px; color: var(--paper-dim); letter-spacing: .05em; }

/* ---------- hero visual ---------- */
.hero-visual { position: relative; max-width: 590px; justify-self: end; width: 100%; }
.visual-frame {
  position: relative; aspect-ratio: 720 / 760; max-height: min(67vh, 700px);
  width: 100%; margin-left: auto;
  border: 1px solid rgba(95, 240, 206, .21);
  background: #06100d;
  clip-path: var(--cut-lg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 70px rgba(20, 100, 80, .12);
  overflow: hidden;
}
.visual-frame::before {
  content: ""; position: absolute; inset: 9px; z-index: 3; pointer-events: none;
  border: 1px solid rgba(95,240,206,.1); clip-path: var(--cut-lg);
}
.visual-frame::after {
  content: ""; position: absolute; left: 0; top: 0; width: 34%; height: 1px; z-index: 4;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 10px var(--cyan);
}
.visual-frame__top {
  position: absolute; z-index: 4; top: 20px; left: 23px; right: 23px;
  display: flex; justify-content: space-between;
  font-family: var(--font-display); font-size: 8px; letter-spacing: .13em; color: rgba(215,242,230,.62);
}
.live-dot { display: flex; align-items: center; gap: 6px; color: var(--cyan); }
.live-dot i { width: 5px; height: 5px; }
#menuCanvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.visual-frame__scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(106,255,221,.018) 3px 4px);
  mix-blend-mode: screen;
}
.visual-frame__scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 16%;
  background: linear-gradient(180deg, transparent, rgba(95,240,206,.04), transparent);
  animation: scanSweep 6s linear infinite;
}
@keyframes scanSweep { 0% { top: -20%; } 100% { top: 110%; } }
.visual-frame__hud {
  position: absolute; z-index: 4; display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-display); font-size: 7px; letter-spacing: .1em;
  border-left: 1px solid var(--cyan); padding-left: 8px;
}
.visual-frame__hud span { color: var(--muted-2); }
.visual-frame__hud b { color: var(--cyan); font-weight: 400; }
.visual-frame__hud--tl { top: 62px; left: 23px; }
.visual-frame__hud--br { bottom: 106px; right: 23px; border-left-color: var(--amber); text-align: right; }
.visual-frame__hud--br b { color: var(--amber); }
.visual-frame__coords {
  position: absolute; z-index: 4; top: 67px; right: 24px; text-align: right;
  font-family: var(--font-display); font-size: 6px; line-height: 1.9; letter-spacing: .1em; color: rgba(205,230,216,.32);
}
.visual-frame__cross { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.visual-frame__cross i { position: absolute; background: rgba(95,240,206,.18); }
.visual-frame__cross i:first-child { width: 1px; height: 14px; left: 8%; top: 46%; }
.visual-frame__cross i:last-child { height: 1px; width: 14px; left: calc(8% - 6px); top: calc(46% + 6px); }
.visual-frame__caption {
  position: absolute; z-index: 4; left: 23px; right: 23px; bottom: 21px;
  padding-top: 13px; border-top: 1px solid rgba(95,240,206,.18);
  display: flex; flex-direction: column;
}
.visual-frame__caption .caption-index { font-family: var(--font-display); font-size: 8px; color: var(--amber); letter-spacing: .15em; margin-bottom: 3px; }
.visual-frame__caption strong { font-family: var(--font-cn); font-weight: 700; font-size: 13px; letter-spacing: .12em; }
.visual-frame__caption small { font-family: var(--font-display); font-size: 7px; letter-spacing: .11em; color: var(--muted-2); margin-top: 5px; }
.visual-note {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  font-family: var(--font-display); font-size: 7px; letter-spacing: .09em; color: var(--muted-2); margin-top: 11px;
}
.visual-note span { width: 24px; height: 1px; background: var(--cyan-dim); }

/* ---------- footer / ticker ---------- */
.hangar-footer { flex: 0 0 auto; border-top: 1px solid var(--line); }
.ticker { -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); overflow: hidden; border-bottom: 1px solid var(--line); }
.ticker__track {
  display: flex; align-items: center; gap: 28px; width: max-content;
  padding: 10px 0; animation: ticker 34s linear infinite;
  font-family: var(--font-display); font-size: 8px; letter-spacing: .12em; color: var(--muted-2);
}
.ticker__track i { width: 4px; height: 4px; background: var(--amber); transform: rotate(45deg); }
.ticker__track span:nth-child(3n+1) { color: var(--paper-dim); }
@keyframes ticker { to { transform: translateX(-50%); } }
.footer-meta {
  display: flex; justify-content: space-between; gap: 18px; padding: 10px 0 14px;
  font-family: var(--font-display); font-size: 7px; letter-spacing: .12em; color: var(--muted-2);
}
.footer-meta span:nth-child(2) { color: rgba(137,149,139,.55); }

/* reveal animation */
.reveal { opacity: 0; animation: revealUp .7s cubic-bezier(.2,.8,.2,1) forwards; }
.reveal-1 { animation-delay: .08s; } .reveal-2 { animation-delay: .16s; } .reveal-3 { animation-delay: .28s; }
.reveal-4 { animation-delay: .38s; } .reveal-5 { animation-delay: .48s; } .reveal-6 { animation-delay: .58s; }
@keyframes revealUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ================= GAME ================= */
.game-layout.is-hidden { display: none; }
.game-layout {
  height: 100svh; min-height: 620px;
  display: flex; flex-direction: column;
  padding: 14px clamp(16px, 2vw, 30px) 12px;
  opacity: 1; transition: opacity .35s ease;
}
.topbar {
  height: 57px; flex: 0 0 auto; display: grid;
  grid-template-columns: 1fr minmax(320px, 440px) 1fr;
  align-items: center; gap: 20px;
  border-bottom: 1px solid var(--line); padding-bottom: 11px;
}
.topbar__brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mini-mark { width: 25px; height: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border: 1px solid rgba(255,181,45,.45); transform: rotate(45deg); }
.mini-mark i { background: var(--amber); }
.mini-mark i:nth-child(2), .mini-mark i:nth-child(3) { background: rgba(255,181,45,.22); }
.topbar__brand strong { font-family: var(--font-display); font-size: 12px; letter-spacing: .1em; display: block; line-height: 1; }
.topbar__brand span { display: block; font-family: var(--font-display); font-size: 7px; letter-spacing: .1em; color: var(--muted-2); margin-top: 5px; white-space: nowrap; }
.run-clock { min-width: 0; }
.run-clock__meta { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.run-clock__meta span:first-child { font-family: var(--font-cn); font-size: 11px; letter-spacing: .1em; color: var(--amber); }
.run-clock__meta span:last-child { font-family: var(--font-display); font-size: 13px; letter-spacing: .08em; color: var(--paper); }
.run-clock__bar { height: 3px; background: rgba(237,230,211,.1); position: relative; }
.run-clock__bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 12px rgba(95,240,206,.35); transition: width .2s linear; }
.run-clock__bar em { position: absolute; top: -2px; width: 1px; height: 7px; background: var(--red); left: 75%; box-shadow: 0 0 6px var(--red); }
.topbar__controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tiny-stat { display: flex; align-items: baseline; gap: 7px; margin-right: 10px; }
.tiny-stat span { font-family: var(--font-display); font-size: 8px; color: var(--muted-2); letter-spacing: .1em; }
.tiny-stat b { font-family: var(--font-display); font-size: 12px; color: var(--paper-dim); font-weight: 400; }
.topbar .icon-btn { width: 31px; height: 29px; border-color: transparent; }
.topbar .icon-btn:hover { border-color: var(--line-strong); }

.battle-layout {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 15px; padding-top: 13px;
}
.battle-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.battle-statusbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 8px 3px;
}
.battle-frame {
  position: relative; width: 100%; aspect-ratio: 5 / 3;
  max-height: calc(100svh - 226px);
  margin: 0 auto;
  border: 1px solid rgba(95,240,206,.24);
  background: #07100d;
  box-shadow: 0 16px 50px rgba(0,0,0,.42), 0 0 50px rgba(30,110,90,.07);
  overflow: hidden;
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.battle-frame canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#gameCanvas { touch-action: none; }
.frame-corner { position: absolute; z-index: 10; width: 18px; height: 18px; pointer-events: none; }
.frame-corner--tl { left: 4px; top: 4px; border-left: 1px solid var(--cyan); border-top: 1px solid var(--cyan); }
.frame-corner--tr { right: 4px; top: 4px; border-right: 1px solid var(--cyan); border-top: 1px solid var(--cyan); }
.frame-corner--bl { left: 4px; bottom: 4px; border-left: 1px solid var(--cyan); border-bottom: 1px solid var(--cyan); }
.frame-corner--br { right: 4px; bottom: 4px; border-right: 1px solid var(--cyan); border-bottom: 1px solid var(--cyan); }
.screen-vignette, .screen-scanlines, .danger-tint { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.screen-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.23) 100%); }
.screen-scanlines { z-index: 4; opacity: .1; background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.2) 2px 3px); mix-blend-mode: multiply; }
.danger-tint {
  background: radial-gradient(ellipse at center, transparent 36%, rgba(255,50,62,.32) 100%);
  opacity: 0; transition: opacity .16s;
}
.danger-tint.is-active { opacity: 1; animation: dangerPulse .9s infinite; }
@keyframes dangerPulse { 50% { opacity: .55; } }
.canvas-id { position: absolute; z-index: 5; right: 12px; bottom: 9px; font-family: var(--font-display); font-size: 7px; color: rgba(203,230,214,.35); letter-spacing: .12em; }

/* combat deck */
.combat-deck {
  flex: 0 0 auto; min-height: 62px; display: grid;
  grid-template-columns: 1.05fr .8fr 1.1fr 1.9fr;
  align-items: center; gap: 0; margin-top: 9px;
  border: 1px solid var(--line); background: rgba(8,13,11,.6);
  clip-path: var(--cut);
}
.deck-slot { height: 100%; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-right: 1px solid var(--line); position: relative; }
.deck-slot__key { position: absolute; top: 4px; left: 6px; font-family: var(--font-display); font-size: 6px; color: var(--muted-2); letter-spacing: .1em; }
.deck-slot__icon { width: 32px; height: 32px; margin-top: 4px; flex: 0 0 32px; }
.deck-slot__icon canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.deck-slot__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deck-slot__copy small { font-family: var(--font-cn); font-size: 10px; color: var(--muted-2); letter-spacing: .1em; }
.deck-slot__copy strong { font-family: var(--font-cn); font-weight: 600; font-size: 13px; color: var(--paper-dim); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(95,240,206,.25); margin-top: 4px; color: var(--cyan); flex: 0 0 30px; }
.dash-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dash-meter { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: rgba(237,230,211,.1); }
.dash-meter i { display: block; height: 100%; width: 100%; background: var(--cyan); }
.deck-slot--objective { border-right: 0; }
.objective-glyph { width: 30px; height: 30px; border: 1px solid rgba(255,181,45,.35); transform: rotate(45deg) scale(.7); margin: 4px 0 0 2px; flex: 0 0 30px; position: relative; }
.objective-glyph::before, .objective-glyph::after { content: ""; position: absolute; background: var(--amber); }
.objective-glyph::before { width: 10px; height: 1px; top: 14px; left: 9px; }
.objective-glyph::after { width: 1px; height: 10px; top: 9px; left: 14px; }
.deck-hint { align-self: stretch; display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; padding: 8px 12px; font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); border-left: 1px solid var(--line); }
.deck-hint span { font-family: var(--font-display); color: var(--paper-dim); font-size: 7px; border: 1px solid var(--line); padding: 3px 5px; }
.deck-hint b { color: var(--muted-2); font-weight: 400; }

/* sidebar */
.sidebar { min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; padding-right: 1px; }
.sidebar::-webkit-scrollbar { display: none; }
.side-panel { border: 1px solid var(--line); background: var(--panel); padding: 11px 13px 12px; flex: 0 0 auto; position: relative; }
.side-panel::before { content: ""; position: absolute; left: -1px; top: 10px; width: 2px; height: 14px; background: var(--amber); opacity: .8; }
.panel-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.panel-head span { font-family: var(--font-display); font-size: 9px; letter-spacing: .13em; color: var(--muted); }
.panel-head b { font-family: var(--font-display); font-weight: 400; font-size: 9px; letter-spacing: .08em; color: var(--cyan); }
.panel-head b.is-danger { color: var(--red); }
.panel-head b.is-passive-count { color: var(--green); }
.panel-head__line { flex: 1; height: 1px; background: var(--line); }
.level-row { display: flex; gap: 11px; align-items: center; }
.level-badge { width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid rgba(255,181,45,.45); display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,181,45,.07); clip-path: var(--cut); }
.level-badge small { font-family: var(--font-display); font-size: 7px; color: var(--amber); letter-spacing: .1em; }
.level-badge strong { font-family: var(--font-display); font-size: 18px; line-height: 1; margin-top: 2px; color: var(--paper); }
.level-info { flex: 1; min-width: 0; }
.level-info__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.level-info__row span { font-family: var(--font-cn); font-size: 10px; color: var(--muted-2); }
.level-info__row b { font-family: var(--font-display); font-size: 10px; font-weight: 400; color: var(--paper-dim); }
.level-info__row + .meter { margin-bottom: 6px; }
.meter { height: 3px; background: rgba(237,230,211,.1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; transition: width .18s ease; }
.meter--hp i { background: linear-gradient(90deg, var(--green), #d3f08e); }
.meter--xp i { background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 8px rgba(95,240,206,.35); }
.pilot-tags { display: flex; gap: 13px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.pilot-tags span { font-family: var(--font-display); font-size: 7px; color: var(--muted-2); letter-spacing: .08em; }
.pilot-tags b { color: var(--paper-dim); font-weight: 400; margin-left: 3px; }
.coop-panel.is-hidden { display: none; }
.coop-list { display: flex; flex-direction: column; gap: 7px; }
.coop-unit__row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.coop-unit__row b { margin-left: auto; font-family: var(--font-display); font-size: 9px; font-weight: 400; color: var(--paper-dim); }
.coop-unit__row em { font-family: var(--font-display); font-style: normal; font-size: 7px; letter-spacing: .06em; color: var(--cyan); min-width: 36px; text-align: right; }
.coop-unit__row em.is-down { color: var(--red); }
.coop-tag { display: inline-grid; place-items: center; width: 20px; height: 15px; font-family: var(--font-display); font-size: 7px; color: #0b0b07; background: var(--amber); }
.coop-tag--p2 { background: var(--cyan); }
.meter--p2 i { background: linear-gradient(90deg, #3d8f9d, var(--cyan)); }
.coop-unit__row em.is-alive { color: var(--green); }
.core-gauge { display: flex; gap: 13px; align-items: center; }
.core-gauge__ring {
  width: 60px; height: 60px; flex: 0 0 60px; position: relative; display: grid; place-items: center;
  background: conic-gradient(var(--cyan) calc(var(--p) * 1%), rgba(95,240,206,.1) 0);
  border-radius: 50%;
}
.core-gauge__ring::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(95,240,206,.35); border-radius: 50%; background: var(--panel-strong); z-index: 0; }
.core-gauge__ring span { position: relative; z-index: 2; font-family: var(--font-display); font-size: 15px; color: var(--cyan); }
.core-gauge__ring i { position: absolute; width: 4px; height: 4px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 8px var(--cyan); }
.core-gauge__copy { display: flex; flex-direction: column; gap: 3px; }
.core-gauge__copy strong { font-family: var(--font-display); font-size: 11px; font-weight: 400; color: var(--paper-dim); }
.core-gauge__copy small { font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.core-pips { display: flex; gap: 3px; margin-top: 5px; }
.core-pips i { width: 15px; height: 3px; background: var(--cyan); box-shadow: 0 0 5px rgba(95,240,206,.25); }
.core-pips i.is-off { background: rgba(95,240,206,.12); box-shadow: none; }
.how__pad { margin-top: 10px; font-family: var(--font-display); font-size: 8px; letter-spacing: .08em; color: var(--cyan); opacity: .72; }
.base-meter { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.base-meter__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.base-meter__row b { font-family: var(--font-display); font-size: 8px; font-weight: 400; color: var(--cyan); }
.meter--base i { background: linear-gradient(90deg, #317e73, var(--cyan)); }
.base-meter.is-low .base-meter__row b { color: var(--red); }
.base-meter.is-low .meter--base i { background: linear-gradient(90deg, #7a2424, var(--red)); }
.core-note { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); margin-top: 9px; padding-top: 8px; font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.core-note .blink-dot { width: 4px; height: 4px; background: var(--red); box-shadow: 0 0 7px var(--red); }
.loadout-list { display: flex; flex-direction: column; gap: 4px; min-height: 38px; max-height: 168px; overflow-y: auto; scrollbar-width: none; }
.loadout-list::-webkit-scrollbar { display: none; }
.loadout-item { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 3px 5px; margin: 0 -5px; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.loadout-item:hover { background: rgba(237,230,211,.025); border-color: var(--line); }
.loadout-item canvas { width: 22px; height: 22px; flex: 0 0 22px; image-rendering: pixelated; }
.loadout-item__copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.loadout-item__copy strong { font-family: var(--font-cn); font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loadout-item__copy small { font-family: var(--font-display); font-size: 8px; letter-spacing: .08em; color: var(--muted-2); }
.loadout-pips { display: flex; gap: 2px; flex: 0 0 auto; }
.loadout-pips i { width: 3px; height: 9px; background: rgba(237,230,211,.14); }
.loadout-pips i.is-on { background: var(--amber); box-shadow: 0 0 4px rgba(255,181,45,.5); }
.loadout-item.is-passive .loadout-pips i.is-on { background: var(--cyan); box-shadow: 0 0 4px rgba(95,240,206,.45); }
.loadout-item.is-passive .loadout-item__copy small { color: var(--cyan-dim); }
.loadout-item.is-fused { border-color: rgba(255,181,45,.32); background: rgba(255,181,45,.045); }
.loadout-item.is-fused .loadout-item__copy strong { color: var(--amber); }
.loadout-item.is-fused .loadout-item__copy small { color: var(--amber); opacity: .7; }
.empty-slot { font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); padding: 10px 0; text-align: center; border: 1px dashed var(--line); }
.intel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.intel-grid div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(237,230,211,.05); padding-bottom: 3px; }
.intel-grid span { font-family: var(--font-cn); font-size: 10px; color: var(--muted-2); }
.intel-grid strong { font-family: var(--font-display); font-size: 10px; font-weight: 400; color: var(--paper-dim); }
.intel-grid strong.is-hot { color: var(--amber); }
.threat-bars { display: flex; gap: 3px; margin-top: 9px; }
.threat-bars i { height: 3px; flex: 1; background: rgba(237,230,211,.09); }
.threat-bars i.is-on { background: var(--amber); box-shadow: 0 0 6px rgba(255,181,45,.25); }
.threat-bars.is-critical i.is-on { background: var(--red); box-shadow: 0 0 8px rgba(255,79,88,.4); }
.side-tip { border-left: 1px solid rgba(255,181,45,.4); padding: 2px 0 2px 9px; font-family: var(--font-cn); font-size: 10px; color: var(--muted-2); line-height: 1.7; margin-top: auto; }

/* toasts */
.toast-stack { position: absolute; z-index: 8; left: 18px; top: 14px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.toast { font-family: var(--font-cn); font-size: 11px; color: var(--paper); background: rgba(5,10,8,.84); border-left: 2px solid var(--amber); padding: 7px 11px; letter-spacing: .06em; animation: toastIn .25s ease both, toastOut .3s ease 2.6s forwards; box-shadow: 0 4px 20px rgba(0,0,0,.35); }
.toast.is-cyan { border-left-color: var(--cyan); }
.toast.is-red { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-5px); } }

/* boss hud */
.boss-hud { position: absolute; z-index: 7; left: 50%; bottom: 15px; transform: translateX(-50%); width: min(66%, 620px); padding: 8px 12px; background: rgba(5,9,8,.78); border: 1px solid rgba(255,79,88,.35); }
.boss-hud__meta { display: flex; justify-content: space-between; margin-bottom: 5px; font-family: var(--font-display); font-size: 9px; letter-spacing: .1em; color: var(--red); }
.boss-hud__meta span { color: var(--paper-dim); }
.boss-hud__bar { height: 6px; background: rgba(255,79,88,.13); }
.boss-hud__bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--red), var(--amber-hot)); box-shadow: 0 0 10px rgba(255,79,88,.5); transition: width .15s; }

/* mobile */
.mobile-stick, .mobile-dash { display: none; z-index: 9; }
.mobile-stick { position: absolute; width: 76px; height: 76px; border: 1px solid rgba(95,240,206,.35); border-radius: 50%; left: 22px; bottom: 22px; touch-action: none; }
.mobile-stick::before, .mobile-stick::after { content: ""; position: absolute; background: rgba(95,240,206,.16); }
.mobile-stick::before { width: 1px; height: 100%; left: 50%; top: 0; }
.mobile-stick::after { width: 100%; height: 1px; left: 0; top: 50%; }
.mobile-stick i { position: absolute; width: 28px; height: 28px; left: 24px; top: 24px; background: rgba(95,240,206,.2); border: 1px solid var(--cyan); border-radius: 50%; transform: translate(0,0); }
.mobile-dash { position: absolute; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,181,45,.12); border: 1px solid var(--amber); font-family: var(--font-display); font-size: 8px; color: var(--amber); letter-spacing: .08em; }

/* ================= OVERLAYS ================= */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.overlay__backdrop { position: absolute; inset: 0; background: rgba(3,6,5,.76); backdrop-filter: blur(9px); }
.levelup__content { position: relative; width: min(1480px, 94vw); }
.levelup__head { text-align: center; margin-bottom: clamp(22px, 2.4vw, 38px); animation: revealUp .5s ease both; }
.levelup__head h2 { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: clamp(10px, 1vw, 18px); font-family: var(--font-cn); font-size: clamp(42px, 4.2vw, 76px); font-weight: 800; letter-spacing: .06em; line-height: 1; }
.levelup__head h2 span { color: var(--amber); font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.levelup__head h2 em { font-style: normal; color: var(--paper); font-size: .72em; letter-spacing: .08em; }
.levelup__head h2 strong { color: var(--amber); font-family: var(--font-display); font-size: .82em; font-weight: 700; letter-spacing: .01em; }
.levelup__head p { font-family: var(--font-cn); color: var(--paper-dim); font-size: clamp(15px, 1vw, 20px); letter-spacing: .08em; margin: 12px 0 0; }
.upgrade-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 1.4vw, 24px); }
.upgrade-card {
  position: relative; min-height: clamp(400px, 38vh, 500px); text-align: left;
  border: 1px solid var(--line); background: linear-gradient(158deg, rgba(22,31,27,.95), rgba(8,13,11,.97));
  padding: 0; clip-path: var(--cut-lg); overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .2s;
  animation: cardIn .45s cubic-bezier(.2,.8,.2,1) both;
}
.upgrade-card:nth-child(2) { animation-delay: .08s; }
.upgrade-card:nth-child(3) { animation-delay: .16s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.upgrade-card:hover, .upgrade-card:focus-visible { transform: translateY(-7px); border-color: var(--accent); box-shadow: 0 18px 40px rgba(0,0,0,.36), 0 0 34px color-mix(in srgb, var(--accent) 14%, transparent); }
.upgrade-card::before { content: ""; position: absolute; left: 0; top: 0; width: 5px; height: 100%; background: var(--accent); }
.upgrade-card::after { content: ""; position: absolute; right: -30%; top: -25%; width: 240px; height: 240px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 17%, transparent), transparent 68%); pointer-events: none; }
.upgrade-card__top { display: flex; justify-content: space-between; align-items: center; padding: clamp(18px, 1.4vw, 26px) clamp(22px, 1.8vw, 32px) 0 clamp(26px, 2.1vw, 38px); position: relative; z-index: 1; font-family: var(--font-cn); font-size: clamp(12px, .82vw, 16px); letter-spacing: .1em; color: var(--muted); }
.upgrade-card__type { color: var(--accent); font-weight: 700; }
.upgrade-card__level { color: var(--paper-dim); }
.upgrade-card__icon { position: relative; z-index: 1; width: clamp(118px, 8vw, 150px); height: clamp(118px, 8vw, 150px); margin: clamp(16px, 1.5vw, 26px) clamp(26px, 2.1vw, 38px) clamp(16px, 1.4vw, 24px); display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); clip-path: var(--cut); }
.upgrade-card__icon canvas { width: 74%; height: 74%; image-rendering: pixelated; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 40%, transparent)); }
.upgrade-card__body { position: relative; z-index: 1; padding: 0 clamp(26px, 2.1vw, 38px); }
.upgrade-card__name { font-family: var(--font-cn); font-size: clamp(28px, 1.8vw, 38px); font-weight: 800; letter-spacing: .05em; margin: 0 0 8px; color: var(--paper); line-height: 1.2; }
.upgrade-card__role { margin-top: 6px; font-family: var(--font-cn); font-size: clamp(13px, .85vw, 17px); letter-spacing: .05em; color: var(--accent); border-left: 2px solid var(--accent); padding-left: 9px; opacity: .95; }
.upgrade-card__desc { margin: clamp(16px, 1.4vw, 24px) 0 18px; min-height: 60px; font-family: var(--font-cn); color: #c0ccc3; font-size: clamp(15px, .95vw, 19px); line-height: 1.75; }
.upgrade-card__desc b { color: var(--accent); font-weight: 700; }
.upgrade-card__fusion { position: relative; z-index: 1; margin: 0 clamp(26px, 2.1vw, 38px) 12px; padding: 7px 9px; border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 6%, rgba(3,8,6,.5)); color: #b7c5bb; font-family: var(--font-cn); font-size: clamp(12px, .82vw, 14px); line-height: 1.5; letter-spacing: .02em; }
.upgrade-card__fusion b { color: var(--accent); font-weight: 700; }
.upgrade-card__fusion em { font-style: normal; color: var(--cyan); margin-left: 4px; }
.upgrade-card__fusion .fusion-label { display: inline-block; margin-right: 6px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.upgrade-card__pips { display: flex; gap: 5px; padding: 0 clamp(26px, 2.1vw, 38px) 26px; position: relative; z-index: 1; }
.upgrade-card__pips i { width: 24px; height: 4px; background: rgba(237,230,211,.12); }
.upgrade-card__pips i.is-on { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent); }
.upgrade-card__key { position: absolute; bottom: 18px; right: 22px; z-index: 2; font-family: var(--font-display); font-size: 14px; color: var(--muted-2); border: 1px solid var(--line); width: 30px; height: 30px; display: grid; place-items: center; }
.upgrade-card__pad { position: absolute; right: 60px; bottom: 18px; z-index: 3; font-family: var(--font-display); font-size: 9px; letter-spacing: .08em; color: var(--amber); border: 1px solid rgba(255,181,45,.6); background: rgba(8,13,11,.86); padding: 3px 5px; opacity: 0; transform: translateY(3px); transition: opacity .18s, transform .18s; }
.upgrade-card.is-pad .upgrade-card__pad { opacity: 1; transform: none; }
.levelup__foot { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: clamp(20px, 2vw, 32px); font-family: var(--font-cn); font-size: clamp(12px, .8vw, 15px); color: #a7b5aa; }
.levelup__foot > span:first-child { display: flex; align-items: center; gap: 5px; min-height: 20px; }
.reroll-btn { border: 1px solid var(--line-strong); background: rgba(237,230,211,.025); padding: 10px 16px; color: var(--paper-dim); font-family: var(--font-cn); font-size: clamp(12px, .8vw, 15px); letter-spacing: .05em; transition: border-color .2s, color .2s; }
.reroll-btn span { color: var(--cyan); margin-right: 5px; }
.reroll-btn b { color: var(--cyan); font-family: var(--font-display); font-size: 11px; margin-left: 3px; }
.reroll-btn:hover { border-color: var(--cyan); color: var(--paper); }
.reroll-btn:disabled { opacity: .3; cursor: not-allowed; }
.levelup__players { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.levelup__player { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border: 1px solid var(--line); background: rgba(8,13,11,.5); font-family: var(--font-cn); font-size: clamp(15px, 1vw, 19px); color: var(--paper-dim); }
.levelup__player b { font-family: var(--font-display); font-size: .95em; letter-spacing: .05em; }
.levelup__player em { font-style: normal; color: var(--muted); }
.levelup__player--p1 { border-color: rgba(255,181,45,.42); color: var(--amber); }
.levelup__player--p2 { border-color: rgba(95,240,206,.42); color: var(--cyan); }
.levelup__player.is-active { background: rgba(95,240,206,.06); }
.levelup__player--p1.is-active { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(255,181,45,.18); }
.levelup__player--p2.is-active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(95,240,206,.22); }
.levelup__player.is-active em { color: var(--paper); }
.upgrade-card.is-pad .upgrade-card__pad { opacity: 1; transform: none; }

/* pause */
.pause__card { position: relative; width: min(500px, 100%); text-align: center; background: var(--panel-strong); border: 1px solid var(--line-strong); padding: 42px 42px 27px; clip-path: var(--cut-lg); animation: pauseIn .3s ease both; }
@keyframes pauseIn { from { opacity: 0; transform: scale(.97); } }
.pause__stripe { position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: repeating-linear-gradient(90deg, var(--amber) 0 24px, transparent 24px 31px); opacity: .8; }
.pause__eyebrow { font-family: var(--font-display); font-size: 8px; letter-spacing: .15em; color: var(--amber); }
.pause__card h2 { font-family: var(--font-cn); font-size: 31px; letter-spacing: .12em; margin: 12px 0 7px; }
.pause__card > p { font-family: var(--font-cn); font-size: 11px; color: var(--muted); margin: 0 0 28px; }
.pause__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pause__actions .cta { min-width: 260px; }
.pause__controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 27px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.pause__controls span { display: flex; align-items: center; gap: 5px; }

/* result */
.result__content { position: relative; width: min(800px, 100%); text-align: center; background: linear-gradient(160deg, rgba(19,25,21,.98), rgba(6,10,8,.99)); border: 1px solid var(--line-strong); padding: 36px 52px 36px; clip-path: var(--cut-lg); animation: pauseIn .4s ease both; }
.result__tag { font-family: var(--font-display); font-size: 9px; letter-spacing: .18em; color: var(--red); }
.result__tag.is-win { color: var(--cyan); }
.result__content h2 { font-family: var(--font-cn); font-size: 38px; letter-spacing: .15em; margin: 13px 0 8px; }
.result__seal { width: 76px; height: 76px; margin: 7px auto 16px; border: 1px solid rgba(255,79,88,.5); border-radius: 50%; position: relative; display: grid; place-items: center; color: var(--red); font-family: var(--font-display); font-size: 18px; }
.result__seal span, .result__seal i { content: ""; position: absolute; border: 1px solid rgba(255,79,88,.19); border-radius: 50%; }
.result__seal span { inset: 7px; } .result__seal i { inset: 16px; }
.result__seal b { font-weight: 400; }
.result__seal.is-win { color: var(--cyan); border-color: rgba(95,240,206,.55); }
.result__seal.is-win span, .result__seal.is-win i { border-color: rgba(95,240,206,.2); }
.result__content > p { font-family: var(--font-cn); font-size: 12px; color: var(--paper-dim); margin: 0 auto 22px; max-width: 370px; line-height: 1.9; }
.result__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result__stats div { padding: 15px 6px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.result__stats div:last-child { border-right: 0; }
.result__stats span { font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.result__stats strong { font-family: var(--font-display); font-size: 16px; font-weight: 400; color: var(--paper-dim); }
.result__build { display: flex; justify-content: center; gap: 7px; margin: 19px 0 22px; flex-wrap: wrap; }
.result__build span { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-cn); font-size: 10px; color: var(--paper-dim); border: 1px solid var(--line); padding: 4px 8px; }
.result__build i { width: 4px; height: 4px; background: var(--amber); }
.result__actions { display: flex; justify-content: center; align-items: center; gap: 20px; }

/* how to */
.how__panel { position: relative; width: min(900px, 100%); background: var(--panel-strong); border: 1px solid var(--line-strong); padding: 38px 42px 32px; clip-path: var(--cut-lg); animation: pauseIn .35s ease both; }
.close-btn { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 1px solid var(--line-strong); background: rgba(237,230,211,.025); color: var(--paper-dim); font-size: 22px; line-height: 1; }
.close-btn:hover { border-color: var(--red); color: var(--red); }
.how__eyebrow { font-family: var(--font-cn); font-size: clamp(13px, .9vw, 16px); letter-spacing: .1em; color: var(--amber); }
.how__panel h2 { font-family: var(--font-cn); font-size: clamp(24px, 3vw, 36px); letter-spacing: .11em; margin: 10px 0 22px; }
.how__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px; }
.how__grid article { position: relative; padding: 0 0 22px 35px; border-top: 1px solid var(--line); padding-top: 17px; }
.how__num { position: absolute; left: 0; top: 17px; font-family: var(--font-display); font-size: 8px; color: var(--amber); }
.how__grid h3 { font-family: var(--font-cn); font-size: 15px; margin: 0 0 7px; letter-spacing: .1em; }
.how__grid p { font-family: var(--font-cn); font-size: 11px; line-height: 1.85; color: #a8b6ab; margin: 0; }
.how__grid kbd { margin: 0 2px; }
.how__legend { display: flex; flex-wrap: wrap; gap: 10px 18px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; font-family: var(--font-cn); font-size: 10px; color: var(--paper-dim); }
.how__legend span { display: inline-flex; align-items: center; gap: 6px; }
.chip { width: 11px; height: 11px; display: inline-block; }
.chip--star { background: var(--amber); clip-path: polygon(50% 0, 62% 34%, 100% 38%, 70% 62%, 80% 100%, 50% 76%, 20% 100%, 30% 62%, 0 38%, 38% 34%); }
.chip--bomb { background: var(--red); border-radius: 50%; }
.chip--shield { background: var(--cyan); clip-path: polygon(50% 0, 95% 20%, 86% 70%, 50% 100%, 14% 70%, 5% 20%); }
.chip--time { background: var(--blue); border-radius: 50%; }
.chip--shovel { background: var(--paper-dim); clip-path: polygon(35% 0, 65% 0, 65% 58%, 100% 58%, 50% 100%, 0 58%, 35% 58%); }
.how__panel > .cta { margin-top: 23px; }
.rotate-hint { display: none; }


/* ---------- campaign, chassis archive, fusion codex ---------- */
.arena-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.arena-card { min-height: 64px; padding: 8px 9px 7px; }
.arena-card__index { margin-bottom: 4px; }
.arena-card__name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.arena-card__en { font-size: 6px; overflow: hidden; text-overflow: ellipsis; }
.arena-card__trait { margin-top: 4px; font-size: 8px; }
.arena-card.is-locked { opacity: .42; cursor: not-allowed; border-style: dashed; }
.arena-card.is-locked:hover { transform: none; border-color: var(--line); background: rgba(8,13,11,.58); }
.arena-card.is-cleared .arena-card__index { color: var(--cyan); }
.arena-card__lock { position: absolute; right: 8px; top: 7px; font-size: 10px; color: var(--muted-2); }
.section-label b#stageProgress { float: right; font-family: var(--font-display); font-size: 9px; color: var(--cyan); letter-spacing: .1em; }
.stage-hint { margin-top: 6px; font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); letter-spacing: .04em; }
.pilot-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pilot-pair:has(#tankPickerBtn2.is-hidden) { grid-template-columns: 1fr; }
#tankPickerBtn2.is-hidden { display: none; }

.pilot-pair .pilot-card { min-width: 0; }
.pilot-pair .pilot-card__preview { flex-basis: 62px; width: 62px; height: 43px; }
.pilot-pair .pilot-card__preview canvas { width: 62px; height: 43px; }
.pilot-pair .pilot-card__copy strong { font-size: 11px; }
.pilot-pair .pilot-card__copy em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pilot-card__slot { flex: 0 0 auto; font-family: var(--font-display); font-size: 8px; color: var(--amber); border: 1px solid rgba(255,181,45,.45); padding: 2px 4px; }
.pilot-card--p2 { border-color: rgba(95,240,206,.32); background: linear-gradient(100deg, rgba(95,240,206,.07), rgba(8,13,11,.5)); }
.pilot-card--p2 .pilot-card__slot { color: var(--cyan); border-color: rgba(95,240,206,.45); }
.pilot-card--p2 .pilot-card__cta { color: var(--cyan); }
.pilot-picker { margin-top: 14px; }
.pilot-card { width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; padding: 7px 10px; border: 1px solid rgba(255,181,45,.32); background: linear-gradient(100deg, rgba(255,181,45,.08), rgba(8,13,11,.5)); clip-path: var(--cut); transition: border-color .2s, background .2s; }
.pilot-card:hover { border-color: var(--amber); background: rgba(255,181,45,.1); }
.pilot-card__preview { flex: 0 0 74px; width: 74px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(2,7,5,.7); }
.pilot-card__preview canvas { width: 74px; height: 54px; image-rendering: pixelated; }
.pilot-card__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pilot-card__copy strong { font-family: var(--font-cn); font-size: 13px; color: var(--paper); letter-spacing: .07em; }
.pilot-card__copy small { font-family: var(--font-display); font-size: 6px; letter-spacing: .11em; color: var(--amber); }
.pilot-card__copy em { font-family: var(--font-cn); font-style: normal; font-size: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pilot-card__cta { flex: 0 0 auto; font-family: var(--font-cn); font-size: 9px; color: var(--amber); letter-spacing: .06em; }
.pilot-card__cta b { font-family: var(--font-display); font-weight: 400; margin-left: 4px; }

.tank-select .overlay__backdrop { background: rgba(2,5,4,.88); }
.tank-select__panel { position: relative; width: min(1180px, 100%); max-height: 92svh; overflow: hidden; display: flex; flex-direction: column; background: var(--panel-strong); border: 1px solid var(--line-strong); padding: 30px 32px 22px; clip-path: var(--cut-lg); animation: pauseIn .35s ease both; }
.tank-select__head h2, .fusion-panel h2 { font-family: var(--font-cn); font-size: clamp(24px, 3vw, 38px); letter-spacing: .1em; margin: 8px 0 8px; }
.tank-select__head p, .fusion-lead { font-family: var(--font-cn); color: var(--muted); font-size: 11px; line-height: 1.8; margin: 0 0 16px; }
.tank-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; overflow-y: auto; padding: 2px 3px 8px; min-height: 0; }
.tank-card { position: relative; text-align: left; padding: 8px 9px 9px; border: 1px solid var(--line); background: rgba(7,12,10,.7); clip-path: var(--cut); transition: border-color .18s, background .18s, transform .18s; }
.tank-card:hover { border-color: rgba(255,181,45,.5); transform: translateY(-2px); }
.tank-card.is-active { border-color: var(--amber); background: linear-gradient(145deg, rgba(255,181,45,.14), rgba(7,12,10,.72)); box-shadow: inset 0 0 0 1px rgba(255,181,45,.12); }
.tank-card__top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tank-card__id { font-family: var(--font-display); font-size: 6px; color: var(--muted-2); letter-spacing: .08em; }
.tank-card__role { font-family: var(--font-cn); font-size: 7px; color: var(--amber); border: 1px solid rgba(255,181,45,.3); padding: 1px 4px; }
.tank-card canvas { display: block; width: 72px; height: 48px; margin: 3px auto 4px; image-rendering: pixelated; }
.tank-card__name { display: block; font-family: var(--font-cn); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tank-card__en { display: block; font-family: var(--font-display); font-size: 6px; color: var(--muted-2); letter-spacing: .07em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tank-card__trait { display: block; font-family: var(--font-cn); font-size: 8px; line-height: 1.5; color: var(--muted); margin-top: 5px; min-height: 24px; }
.tank-card.is-locked .tank-card__trait { padding-bottom: 14px; }
.tank-card.is-locked { opacity: .52; border-style: dashed; }
.tank-card.is-locked:hover { border-color: var(--line-strong); }
.tank-card.is-locked .tank-card__role { color: var(--muted-2); border-color: var(--line); }
.tank-card__lock { position: absolute; right: 10px; bottom: 9px; font-family: var(--font-cn); font-size: clamp(10px, .7vw, 13px); color: var(--muted-2); letter-spacing: .04em; }
.tank-card.is-owned .tank-card__id { color: var(--cyan); }
.tank-select__actions { display: flex; flex-direction: column; align-items: stretch; gap: 7px; flex: 0 0 auto; min-width: 190px; }
.tank-cores { font-family: var(--font-cn); font-size: clamp(11px, .75vw, 14px); color: var(--amber); letter-spacing: .05em; text-align: right; }
.tank-select__actions .cta { min-width: 190px; }
.tank-select__actions .is-hidden { display: none; }


.tank-detail__affinity { color: var(--cyan); font-family: var(--font-cn); font-size: 9px; letter-spacing: .04em; }
.tank-select__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
.tank-detail { flex: 1; min-width: 0; font-family: var(--font-cn); color: var(--muted); font-size: 10px; line-height: 1.7; max-width: 760px; }
.tank-detail strong { color: var(--paper); font-size: 12px; }
.tank-detail b { color: var(--amber); font-weight: 600; }
.tank-detail__ok { color: var(--cyan); font-family: var(--font-display); font-size: 8px; letter-spacing: .06em; }
.tank-detail__lock { color: var(--muted-2); font-family: var(--font-display); font-size: 8px; letter-spacing: .06em; }

.fusion-screen .how__panel { width: min(1000px, 100%); max-height: 92svh; overflow-y: auto; }
.fusion-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.fusion-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(7,12,10,.62); padding: 10px 12px; clip-path: var(--cut); }
.fusion-card__part { min-width: 0; }
.fusion-card__part small { display: block; font-family: var(--font-display); font-size: 6px; letter-spacing: .08em; color: var(--muted-2); }
.fusion-card__part strong { display: block; font-family: var(--font-cn); font-size: 10px; color: var(--paper); margin-top: 2px; }
.fusion-card__plus { font-family: var(--font-display); font-size: 11px; color: var(--amber); }
.fusion-card__result { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 7px; display: flex; align-items: baseline; gap: 8px; }
.fusion-card__result strong { font-family: var(--font-cn); color: var(--amber); font-size: 11px; }
.fusion-card__result span { font-family: var(--font-cn); color: var(--muted); font-size: 8px; line-height: 1.6; }
.result__actions .is-hidden { display: none; }


.stage-picker-card { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 10px; border: 1px solid rgba(95,240,206,.3); background: linear-gradient(100deg, rgba(95,240,206,.07), rgba(8,13,11,.5)); clip-path: var(--cut); transition: border-color .2s, background .2s; }
.stage-picker-card:hover { border-color: var(--cyan); background: rgba(95,240,206,.09); }
.stage-picker-card__index { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 11px; color: var(--cyan); }
.stage-picker-card__copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.stage-picker-card__copy strong { font-family: var(--font-cn); font-size: 13px; color: var(--paper); letter-spacing: .06em; }
.stage-picker-card__copy small { font-family: var(--font-display); font-size: 6px; color: var(--cyan); letter-spacing: .1em; }
.stage-picker-card__copy em { font-family: var(--font-cn); font-style: normal; font-size: 8px; color: var(--muted); }
.stage-picker-card__cta { flex: 0 0 auto; font-family: var(--font-cn); font-size: 9px; color: var(--cyan); }
.stage-picker-card__cta b { font-family: var(--font-display); font-weight: 400; margin-left: 3px; }
.stage-picker-card__difficulty { align-self: flex-start; margin-top: 4px; padding: 2px 6px; border: 1px solid rgba(95,240,206,.32); font-family: var(--font-display); font-size: 6px; line-height: 1.2; letter-spacing: .08em; color: var(--cyan); }
.difficulty-picker { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(6,12,9,.48); }
.difficulty-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.difficulty-card { min-width: 0; padding: 8px 9px; border: 1px solid var(--line-strong); background: rgba(8,14,11,.58); color: var(--paper-dim); text-align: left; clip-path: var(--cut); transition: border-color .2s, background .2s, transform .2s; }
.difficulty-card:hover { border-color: rgba(255,181,45,.5); transform: translateY(-1px); }
.difficulty-card strong { display: block; font-family: var(--font-cn); font-size: 12px; letter-spacing: .08em; color: var(--paper); }
.difficulty-card small { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 6px; letter-spacing: .08em; color: var(--muted); }
.difficulty-card em { display: block; margin-top: 5px; font-family: var(--font-cn); font-style: normal; font-size: 8px; line-height: 1.35; color: var(--muted-2); }
.difficulty-card[data-difficulty="hard"] { border-color: rgba(255,181,45,.24); }
.difficulty-card[data-difficulty="hard"].is-active { border-color: var(--amber); background: rgba(255,181,45,.1); }
.difficulty-card[data-difficulty="nightmare"] { border-color: rgba(255,79,88,.25); }
.difficulty-card[data-difficulty="nightmare"].is-active { border-color: var(--red); background: rgba(255,79,88,.1); }
.difficulty-card.is-active strong { color: var(--cyan); }
.difficulty-card[data-difficulty="hard"].is-active strong { color: var(--amber); }
.difficulty-card[data-difficulty="nightmare"].is-active strong { color: #ff8a8d; }
.difficulty-hint { display: block; margin-top: 7px; font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); }

.stage-select__panel { width: min(1320px, 96vw); max-width: min(1320px, 96vw); }
.codex-panel { max-width: 1120px; }
.codex-grid { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; padding: 2px 4px 10px; min-height: 0; }
.codex-section__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 8px; letter-spacing: .12em; color: var(--cyan); }
.codex-section__head b { font-family: var(--font-cn); font-size: 8px; font-weight: 400; color: var(--muted-2); letter-spacing: .04em; }
.codex-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.codex-card { min-width: 0; display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--line); background: rgba(7,13,10,.62); clip-path: var(--cut); }
.codex-card.is-locked { opacity: .42; filter: saturate(.25); }
.codex-card.is-elite { border-color: rgba(255,181,45,.3); }
.codex-card.is-boss { border-color: rgba(255,79,88,.42); background: rgba(255,79,88,.045); }
.codex-card canvas { width: 100%; height: auto; aspect-ratio: 200 / 116; image-rendering: pixelated; background: radial-gradient(ellipse at center, rgba(95,240,206,.045), transparent 65%); }
.codex-card__name { margin-top: 4px; font-family: var(--font-cn); font-size: 10px; color: var(--paper); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codex-card__en { margin-top: 1px; font-family: var(--font-display); font-size: 6px; color: var(--cyan); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codex-card__desc { margin-top: 5px; font-family: var(--font-cn); font-size: 8px; line-height: 1.45; color: var(--muted-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.codex-legend { display: flex; gap: 12px; font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); }
.codex-legend span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 4px; background: var(--cyan); }
.codex-legend .is-elite::before { background: var(--amber); }
.codex-legend .is-boss::before { background: var(--red); }
.save-panel { max-width: 820px; }
.save-text { width: 100%; min-height: 220px; resize: vertical; padding: 12px; border: 1px solid var(--line-strong); background: rgba(3,8,6,.8); color: var(--paper-dim); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; line-height: 1.55; outline: none; }
.save-text:focus { border-color: var(--cyan); }
.save-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.save-status { font-family: var(--font-cn); font-size: 9px; color: var(--muted-2); }
.save-status.is-ok { color: var(--cyan); }
.save-status.is-bad { color: var(--red); }
.save-foot-note { font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); }
.text-btn--danger { color: #ff8a8d; border-color: rgba(255,79,88,.35); }
.text-btn--danger:hover { color: #fff; border-color: var(--red); background: rgba(255,79,88,.1); }

.stage-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stage-grid .arena-card { min-height: 86px; }
.stage-grid .arena-card__name { font-size: 12px; }
.stage-grid .arena-card__trait { display: block; }
.stage-select__foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

@media (max-width: 1180px) {
  .hangar-main { grid-template-columns: minmax(0, 1.08fr) minmax(320px, .78fr); gap: 28px; }
  .game-title { font-size: clamp(57px, 8.5vw, 98px); }
  .arena-card__trait { display: none; }
  .arena-card { min-height: 69px; }
  .battle-layout { grid-template-columns: minmax(0, 1fr) 268px; }
  .deck-hint { display: none; }
  .combat-deck { grid-template-columns: 1.05fr .8fr 1.1fr; }
  .deck-slot--objective { border-right: 0; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .menu-screen { min-height: 100svh; padding: 16px 20px 0; }
  .hangar-main { grid-template-columns: 1fr; align-items: start; gap: 30px; padding-top: 32px; }
  .hero-visual { justify-self: stretch; max-width: none; }
  .visual-frame { max-height: 480px; aspect-ratio: 1.25; }
  .hero-copy { max-width: none; }
  .game-title { font-size: clamp(66px, 15vw, 121px); }
  .footer-meta { display: none; }
  .game-layout { min-height: 100svh; height: auto; padding: 10px 12px 14px; }
  .topbar { grid-template-columns: 1fr auto; gap: 10px; height: auto; padding: 5px 0 10px; }
  .run-clock { grid-column: 1 / -1; grid-row: 2; }
  .topbar__brand span { display: none; }
  .tiny-stat { display: none; }
  .battle-layout { grid-template-columns: 1fr; }
  .battle-frame { max-height: none; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .side-tip { display: none; }
  .loadout-panel, .intel-panel { grid-column: auto; }
  .combat-deck { grid-template-columns: 1fr 1fr; }
  .deck-slot--objective { border-top: 1px solid var(--line); }
  .deck-slot:nth-child(2) { border-right: 0; }
  .deck-hint { display: none; }
  .upgrade-cards { grid-template-columns: 1fr; gap: 10px; max-height: 65vh; overflow-y: auto; padding: 2px 5px 8px; }
  .upgrade-card { min-height: 0; display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto 1fr auto; padding: 10px; }
  .upgrade-card__top { grid-column: 1 / -1; padding: 0 0 5px; }
  .upgrade-card__icon { grid-column: 1; grid-row: 2; width: 76px; height: 76px; margin: 0; }
  .upgrade-card__icon canvas { width: 56px; height: 56px; }
  .upgrade-card__body { grid-column: 2; grid-row: 2; padding: 0 0 0 16px; }
  .upgrade-card__name { font-size: 17px; }
  .upgrade-card__desc { margin: 5px 0; min-height: 0; font-size: 11px; line-height: 1.65; }
  .upgrade-card__fusion { margin: 4px 0; padding: 4px 6px; font-size: 10px; line-height: 1.4; }
  .upgrade-card__pips { grid-column: 1 / -1; padding: 5px 0 0; }
  .upgrade-card__key { display: none; }
  .levelup__content { max-height: 92svh; }
  .levelup__head { margin-bottom: 15px; }
  .levelup__head p { display: none; }
  .levelup__foot { margin-top: 15px; }
  .result__content { padding: 25px 22px 24px; }
  .how__panel { padding: 28px 22px 24px; max-height: 92svh; overflow-y: auto; }
}
@media (max-width: 620px) {
  .hangar-top { align-items: flex-start; }
  .hangar-top__right .status-led, .hangar-top__right .pad-state { display: none; }
  .game-title { font-size: clamp(56px, 16.5vw, 95px); }
  .game-title__tag { right: 0; bottom: -14px; }
  .cn-title { margin-top: 23px; }
  .arena-options { flex-direction: column; }
  .arena-card { min-height: 61px; padding: 9px 11px; }
  .arena-card__index { position: absolute; right: 11px; top: 10px; margin: 0; }
  .arena-card__name { font-size: 12px; }
  .mode-options { flex-direction: column; }
  .mode-card { min-width: 0; width: 100%; flex-direction: row; align-items: baseline; gap: 8px; }
  .menu-actions { gap: 16px; }
  .cta { min-width: 0; flex: 1; }
  .record-strip { gap: 18px; }
  .sidebar { grid-template-columns: 1fr; }
  .combat-deck { grid-template-columns: 1fr; }
  .deck-slot { border-right: 0; border-bottom: 1px solid var(--line); }
  .deck-slot--objective { border-bottom: 0; }
  .levelup__head h2 em { display: block; margin: 8px 0 0; }
  .levelup__foot { gap: 12px; flex-wrap: wrap; }
  .levelup__hint { display: none; }
  .result__stats { grid-template-columns: 1fr 1fr; }
  .result__stats div:nth-child(2) { border-right: 0; }
  .result__stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result__actions { flex-direction: column; gap: 8px; }
  .result__actions .cta { width: 100%; }
  .how__grid { grid-template-columns: 1fr; }
  .how__legend { gap: 8px 12px; }
  .overlay { padding: 12px; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 900px) {
  .mobile-stick, .mobile-dash { display: block; }
  .touch-hint { display: block; }
  .deck-hint { display: none; }
  .canvas-id { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.loadout-hint { padding: 6px 5px 2px; font-family: var(--font-cn); font-size: 8px; color: rgba(139,155,142,.55); letter-spacing: .04em; }
/* compact in-frame vitals for touch layouts */
.mobile-hud { display: none; position: absolute; z-index: 8; top: 7px; left: 7px; right: 7px; gap: 5px; pointer-events: none; }
.mobile-hud__cell { flex: 1; display: flex; align-items: center; gap: 6px; height: 19px; padding: 0 6px; border: 1px solid rgba(95,240,206,.22); background: rgba(4,10,8,.68); font-family: var(--font-display); font-size: 7px; color: var(--muted); letter-spacing: .06em; }
.mobile-hud__cell i { flex: 1; height: 3px; background: rgba(95,240,206,.13); overflow: hidden; }
.mobile-hud__cell i b { display: block; height: 100%; width: 100%; background: var(--cyan); box-shadow: 0 0 6px rgba(95,240,206,.4); transition: width .15s; }
.mobile-hud__cell.is-low { border-color: rgba(255,79,88,.45); }
.mobile-hud__cell.is-low i b { background: var(--red); box-shadow: 0 0 6px rgba(255,79,88,.5); }
.mobile-hud__level { display: flex; align-items: center; gap: 4px; height: 19px; padding: 0 6px; border: 1px solid var(--line-strong); background: rgba(4,10,8,.68); font-family: var(--font-display); font-size: 7px; color: var(--muted); }
.mobile-hud__level strong { font-size: 9px; font-weight: 400; color: var(--amber); }
@media (max-width: 900px) and (orientation: portrait) {
  .game-layout { height: 100svh; min-height: 0; overflow: hidden; }
  .battle-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .battle-column { flex: 0 0 auto; min-height: 0; justify-content: flex-start; }
  .battle-frame { width: 100%; height: auto; max-height: calc(100svh - 170px); margin: 0 auto; }
  .sidebar { display: none; }
  .combat-deck { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; flex: 0 0 auto; }
  .combat-deck .deck-slot { height: 43px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .combat-deck .deck-slot:nth-child(2) { border-right: 0; }
  .combat-deck .deck-slot--objective { border-bottom: 0; }
  .combat-deck .deck-slot__icon { width: 24px; height: 24px; flex: 0 0 24px; margin-top: 2px; }
  .combat-deck .deck-slot__copy small { font-size: 7px; }
  .combat-deck .deck-slot__copy strong { font-size: 9px; }
  .combat-deck .deck-hint { display: none; }
  .mobile-hud { display: flex; }
  .mobile-stick, .mobile-dash { position: fixed; }
  .mobile-stick { left: 28px; bottom: 37px; width: 86px; height: 86px; }
  .mobile-stick i { left: 28px; top: 28px; width: 28px; height: 28px; }
  .mobile-dash { right: 30px; bottom: 50px; width: 62px; height: 62px; font-size: 8px; }
}
@media (max-width: 900px) and (max-height: 500px) {
  body { overflow: hidden; }
  .game-layout { height: 100svh; min-height: 0; display: flex; flex-direction: column; padding: 4px 8px 6px; }
  .topbar { flex: 0 0 auto; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 1px 0 3px; align-items: center; }
  .topbar__brand span, .topbar__brand .brand-sub { display: none; }
  .topbar__brand strong { font-size: 10px; letter-spacing: .06em; }
  .topbar .mini-mark { width: 20px; height: 20px; }
  .topbar .icon-btn { width: 26px; height: 24px; }
  .topbar .icon-btn svg { width: 13px; height: 13px; }
  .run-clock { grid-column: 2; grid-row: 1; }
  .run-clock__meta { margin-bottom: 3px; }
  .topbar__controls { gap: 4px; }
  .run-clock__meta span:first-child { font-size: 8px; }
  .run-clock__bar { height: 2px; }
  .battle-layout { flex: 1; min-height: 0; display: flex; padding-top: 5px; }
  .battle-column { flex: 1; min-height: 0; justify-content: center; }
  .battle-frame { width: auto; height: 100%; max-height: 100%; aspect-ratio: 5 / 3; margin: 0 auto; }
  .sidebar, .combat-deck { display: none; }
  .mobile-hud { display: flex; }
  .touch-hint { display: block; }
  .mobile-stick, .mobile-dash { display: block; position: fixed; }
  .mobile-stick { left: 28px; bottom: 33px; width: 72px; height: 72px; }
  .mobile-stick i { left: 22px; top: 22px; width: 26px; height: 26px; }
  .mobile-dash { right: 28px; bottom: 44px; width: 52px; height: 52px; font-size: 7px; }
  .boss-hud { bottom: 6px; width: min(58%, 430px); padding: 5px 8px; }
  .boss-hud__meta { font-size: 6px; margin-bottom: 3px; }
  .boss-hud__bar { height: 4px; }
  .toast-stack { top: 6px; right: 6px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .rotate-hint { display: flex; position: fixed; z-index: 30; left: 50%; bottom: 12px; transform: translateX(-50%); align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(255,181,45,.35); background: rgba(7,12,10,.86); color: var(--paper-dim); font-family: var(--font-cn); font-size: 10px; letter-spacing: .06em; pointer-events: none; }
  #gameLayout:not(.is-hidden) ~ .rotate-hint { display: flex; bottom: 164px; top: auto; }
}
@media (max-height: 500px) {
  .menu-screen { height: 100svh; min-height: 0; overflow: hidden; padding: 8px 16px 6px; }
  .hangar-top { height: 34px; padding-bottom: 5px; }
  .brand-mark { width: 25px; height: 25px; padding: 3px; gap: 2px; }
  .brand-name { font-size: 11px; }
  .brand-sub { display: none; }
  .hangar-top__right { gap: 8px; }
  .icon-btn { width: 30px; height: 27px; }
  .icon-btn svg { width: 14px; height: 14px; }
  .hangar-main { display: block; max-width: none; padding: 7px 0 0; min-height: 0; }
  .hero-copy { max-width: none; }
  .eyebrow { margin-bottom: 7px; font-size: 7px; }
  .game-title { display: flex; align-items: baseline; gap: .06em; width: max-content; max-width: 100%; font-size: clamp(52px, 8.2vh, 72px); line-height: .82; letter-spacing: -.08em; }
  .game-title__fire { margin-left: 0; }
  .game-title__tag { right: -8px; bottom: -21px; font-size: 9px; padding: .35em .6em .3em; box-shadow: 4px 4px 0 rgba(255,181,45,.58); }
  .cn-title { margin-top: 28px; font-size: 13px; gap: .22em; }
  .cn-title span { padding-bottom: 4px; }
  .hero-pitch, .record-strip, .hero-visual, .hangar-footer { display: none; }
  .section-label { margin-bottom: 5px; font-size: 7px; }
  .arena-options { gap: 6px; }
  .arena-card { min-height: 52px; padding: 6px 9px; }
  .arena-card__index { margin-bottom: 4px; font-size: 7px; }
  .arena-card__name { font-size: 11px; }
  .arena-card__en { font-size: 6px; margin-top: 1px; }
  .arena-card__trait { display: none; }
  .menu-actions { margin-top: 8px; gap: 16px; }
  .cta { min-height: 48px; padding: 8px 13px; }
  .cta__copy strong { font-size: 14px; }
  .cta__copy small { font-size: 7px; }
  .text-btn { padding: 7px 9px; font-size: 7px; }
  .reveal { animation: none; opacity: 1; }
}

.upgrade-card.is-pad {
  border-color: rgba(255,181,45,.72);
  background: linear-gradient(158deg, rgba(37,34,24,.98), rgba(8,13,11,.98));
  box-shadow: inset 0 0 0 1px rgba(255,181,45,.18), 0 12px 30px rgba(0,0,0,.3);
  transform: translateY(-3px);
}

/* co-op deployment accent */
.mode-card[data-coop="1"].is-active {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(95,240,206,.12), rgba(95,240,206,.02) 60%);
  box-shadow: inset 0 0 0 1px rgba(95,240,206,.10);
}
.coop-panel .panel-head b { color: var(--cyan); }

@media (max-width: 900px) {
  .arena-options { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .tank-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .tank-select__panel { padding: 24px 18px 16px; max-height: 94svh; }
  .tank-select__foot { align-items: flex-start; flex-direction: column; gap: 10px; }
  .tank-select__foot .cta { width: 100%; }
  .fusion-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .arena-options { grid-template-columns: 1fr 1fr; }
  .arena-card { min-height: 57px; padding: 7px 8px 6px; }
  .arena-card__name { font-size: 10px; }
  .arena-card__en, .arena-card__trait { display: none; }
  .pilot-card__preview { flex-basis: 58px; width: 58px; height: 46px; }
  .pilot-card__preview canvas { width: 58px; height: 46px; }
  .pilot-card__cta { font-size: 8px; }
  .tank-grid { grid-template-columns: 1fr 1fr; }
  .tank-card canvas { width: 64px; height: 44px; }
  .tank-select__head h2 { font-size: 24px; }
  .fusion-card { grid-template-columns: 1fr auto 1fr; padding: 8px; }
  .fusion-card__result { display: block; }
}

@media (max-width: 900px) {
  .stage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stage-select__panel { max-height: 94svh; }
  .stage-select__foot { align-items: flex-start; flex-direction: column; }
  .stage-select__foot .cta { width: 100%; }
}
@media (max-width: 620px) {
  .stage-picker-card__copy em, .stage-picker-card__cta { display: none; }
  .stage-grid { grid-template-columns: 1fr 1fr; }
  .stage-grid .arena-card { min-height: 68px; }
  .stage-grid .arena-card__trait { display: none; }
}
@media (max-height: 780px) and (min-width: 901px) {
  .hangar-main { padding-top: 10px; padding-bottom: 10px; gap: 28px; }
  .game-title { font-size: clamp(54px, 7vw, 104px); }
  .cn-title { margin-top: 22px; }
  .hero-pitch { margin-top: 10px; margin-bottom: 13px; line-height: 1.65; }
  .arena-picker { margin-top: 8px; }
  .pilot-picker, .mode-picker { margin-top: 9px; }
  .menu-actions { margin-top: 14px; }
  .record-strip { margin-top: 14px; padding-top: 9px; }
  .pilot-card { padding: 4px 8px; }
  .pilot-card__preview { height: 43px; flex-basis: 62px; width: 62px; }
  .pilot-card__preview canvas { width: 62px; height: 43px; }
  .mode-card { padding: 7px 11px; }
}

@media (max-width: 620px) {
  .pilot-pair { grid-template-columns: 1fr; }
  .tank-select__actions { min-width: 100%; width: 100%; }
  .tank-select__actions .cta { min-width: 100%; }
  .tank-cores { text-align: left; }
}

@media (max-width: 620px) {
  .mobile-stick, .mobile-dash { display: block; }
  .touch-hint { display: block; }
  .difficulty-picker { padding: 8px; }
  .difficulty-options { gap: 5px; }
  .difficulty-card { padding: 7px 6px; }
  .difficulty-card em { display: none; }
  .difficulty-card strong { font-size: 11px; }
  .codex-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .codex-card canvas { height: auto; }
  .codex-card__desc { display: none; }
  .save-text { min-height: 160px; font-size: 9px; }
}
@media (max-width: 900px) {
  .stage-picker-card__difficulty { font-size: 5px; }
  .difficulty-card em { font-size: 7px; }
}

/* ================= FIXED VIEWPORT / NO PAGE SCROLL ================= */
html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body { position: fixed; inset: 0; }
#app, .app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.menu-screen {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.hangar-main { min-height: 0; overflow: hidden; }
.game-layout {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

@media (max-height: 1200px) {
  .hero-pitch, .record-strip { display: none; }
}
@media (max-height: 820px) {
  .game-title { font-size: clamp(52px, min(8.5vw, 9vh), 100px); }
  .cn-title { margin-top: 18px; }
  .hangar-main { padding: 8px 0; }
}
@media (max-height: 760px) {
  .cn-title { display: none; }
  .eyebrow { margin-bottom: 6px; }
}
@media (max-width: 900px) {
  .hero-visual { display: none; }
  .hangar-main { display: block; max-width: none; }
  .menu-screen { padding: 10px 20px 0; }
  .game-layout { height: 100dvh; min-height: 0; overflow: hidden; }
}
@media (max-height: 500px) {
  .menu-screen { padding: 4px 14px 4px; }
  .hangar-top { height: 30px; padding-bottom: 4px; }
  .hangar-main { display: block; padding: 4px 0 0; }
  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    row-gap: 5px;
    max-width: none;
    align-content: start;
  }
  .eyebrow, .cn-title, .hero-pitch, .record-strip, .hero-visual, .hangar-footer { display: none; }
  .game-title { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(42px, 11vh, 62px); line-height: .8; }
  .arena-picker { grid-column: 1; grid-row: 2; align-self: start; }
  .pilot-picker { grid-column: 2; grid-row: 1; margin-top: 0; align-self: start; }
  .mode-picker { grid-column: 2; grid-row: 2; margin-top: 0; align-self: start; }
  .menu-actions { grid-column: 1 / -1; grid-row: 3; margin-top: 2px; gap: 8px 12px; }
  .section-label { margin-bottom: 4px; font-size: 7px; }
  .stage-hint { display: none; }
  .arena-card { min-height: 48px; padding: 5px 7px; }
  .stage-picker-card { min-height: 48px; padding: 5px 8px; }
  .pilot-pair { gap: 5px; }
  .pilot-card { padding: 5px 7px; }
  .pilot-card__preview { flex-basis: 48px; width: 48px; height: 34px; }
  .pilot-card__preview canvas { width: 48px; height: 34px; }
  .pilot-card__copy strong { font-size: 10px; }
  .pilot-card__copy small, .pilot-card__copy em { font-size: 6px; }
  .mode-options { gap: 4px; }
  .mode-card { min-width: 0; padding: 5px 8px; }
  .mode-card strong { font-size: 10px; }
  .mode-card small { font-size: 5px; }
  .menu-actions .text-btn { padding: 5px 7px; font-size: 8px; }
  .menu-actions .cta { min-height: 40px; padding: 6px 10px; }
  .cta__copy strong { font-size: 12px; }
  .cta__copy small { font-size: 6px; }
  .icon-btn { width: 28px; height: 25px; }
  .icon-btn svg { width: 13px; height: 13px; }
  .brand-name { font-size: 11px; }
  .brand-sub { display: none; }
}

/* Gamepad / keyboard focus ring for the whole UI */
button.is-pad-focus, [tabindex].is-pad-focus, .upgrade-card.is-pad-focus {
  outline: 2px solid var(--cyan) !important;
  outline-offset: 3px !important;
  border-color: var(--cyan) !important;
  box-shadow: inset 0 0 0 2px rgba(95,240,206,.62), 0 0 0 4px rgba(95,240,206,.12), 0 0 24px rgba(95,240,206,.2) !important;
}

.upgrade-card.is-pad-focus {
  outline: 1px solid rgba(255,181,45,.88) !important;
  outline-offset: 2px !important;
  border-color: var(--amber) !important;
  box-shadow: inset 0 0 0 2px rgba(255,181,45,.55), 0 0 26px rgba(255,181,45,.13) !important;
}

/* topbar objective + single thruster deck */
.run-clock__meta { gap: 10px; }
.run-clock__meta #objectiveLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-cn);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--paper-dim);
}
.combat-deck--thruster {
  display: flex;
  grid-template-columns: none;
  min-height: 64px;
}
.combat-deck--thruster .deck-slot--thruster {
  flex: 1;
  gap: 13px;
  padding: 10px 16px;
  border-right: 0;
}
.combat-deck--thruster .dash-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  margin-top: 3px;
}
.combat-deck--thruster .dash-icon svg { width: 22px; height: 22px; }
.combat-deck--thruster .deck-slot__copy { flex: 1; }
.combat-deck--thruster .deck-slot__copy small { font-size: 11px; color: var(--cyan); }
.combat-deck--thruster .deck-slot__copy strong { font-size: 15px; }
.combat-deck--thruster .dash-meter { left: 16px; right: 16px; bottom: 7px; height: 3px; }
@media (max-width: 900px) and (orientation: portrait) {
  .combat-deck--thruster { display: flex; grid-template-columns: none; min-height: 0; }
  .combat-deck--thruster .deck-slot--thruster { height: 43px; padding: 6px 10px; border-right: 0; border-bottom: 0; }
  .combat-deck--thruster .dash-icon { width: 26px; height: 26px; flex-basis: 26px; margin-top: 1px; }
  .combat-deck--thruster .dash-icon svg { width: 17px; height: 17px; }
  .combat-deck--thruster .deck-slot__copy small { font-size: 8px; }
  .combat-deck--thruster .deck-slot__copy strong { font-size: 10px; }
  .combat-deck--thruster .dash-meter { left: 10px; right: 10px; bottom: 5px; height: 2px; }
  .run-clock__meta #objectiveLabel { font-size: 8px; }
}
@media (max-width: 620px) {
  .run-clock__meta { gap: 5px; }
  .run-clock__meta #objectiveLabel { font-size: 8px; }
}

/* base turret status */
.base-turret-note {
  margin-top: 5px;
  font-family: var(--font-cn);
  font-size: 8px;
  letter-spacing: .06em;
  color: var(--muted-2);
}
.base-turret-note.is-active { color: var(--cyan); }

/* two-action combat deck: thruster + team recall */
.combat-deck--actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 64px;
}
.combat-deck--actions .deck-slot {
  height: 100%;
  padding: 10px 14px;
}
.combat-deck--actions .deck-slot--thruster { border-right: 1px solid var(--line); }
.combat-deck--actions .dash-icon,
.combat-deck--actions .recall-icon { width: 34px; height: 34px; flex-basis: 34px; margin-top: 2px; }
.combat-deck--actions .dash-icon svg,
.combat-deck--actions .recall-icon svg { width: 20px; height: 20px; }
.combat-deck--actions .deck-slot__copy small { font-size: 10px; }
.combat-deck--actions .deck-slot__copy strong { font-size: 14px; }
.combat-deck--actions .dash-meter { left: 14px; right: 14px; bottom: 6px; }
.deck-slot--recall {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s, color .18s, opacity .18s;
}
.deck-slot--recall:hover:not(:disabled) { background: rgba(95,240,206,.06); }
.deck-slot--recall:disabled { cursor: default; opacity: .66; }
.recall-icon { display: grid; place-items: center; border: 1px solid rgba(95,240,206,.25); color: var(--cyan); }
.recall-icon svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.recall-meter { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; background: rgba(237,230,211,.1); }
.recall-meter i { display: block; height: 100%; width: 100%; background: var(--cyan); transition: width .12s linear; }
.deck-slot--recall.is-cooling .recall-icon { color: var(--muted-2); border-color: var(--line-strong); }
.deck-slot--recall.is-cooling .recall-meter i { background: var(--amber); }

/* item field manual */
.item-guide-panel { max-width: 980px; }
.item-guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; overflow-y: auto; padding: 2px 4px 10px; min-height: 0; }
.item-guide-card {
  position: relative; min-width: 0; min-height: 138px; padding: 11px 11px 10px;
  border: 1px solid var(--line); background: linear-gradient(155deg, rgba(15,23,18,.92), rgba(5,10,8,.88));
  clip-path: var(--cut);
}
.item-guide-card__head { display: flex; align-items: center; gap: 9px; }
.item-guide-card__glyph {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
  border: 1px solid currentColor; color: var(--item-color); background: rgba(255,255,255,.025);
  font-family: var(--font-display); font-size: 19px; line-height: 1; box-shadow: inset 0 0 18px rgba(255,255,255,.035);
}
.item-guide-card__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-guide-card__title strong { font-family: var(--font-cn); font-size: 12px; font-weight: 600; color: var(--paper); letter-spacing: .05em; }
.item-guide-card__title small { font-family: var(--font-display); font-size: 6px; letter-spacing: .1em; color: var(--item-color); }
.item-guide-card__desc { margin-top: 9px; font-family: var(--font-cn); font-size: 10px; line-height: 1.5; color: var(--paper-dim); }
.item-guide-card__detail { margin-top: 5px; font-family: var(--font-cn); font-size: 8px; line-height: 1.55; color: var(--muted-2); }
.item-guide-card__tag { position: absolute; right: 9px; top: 9px; font-family: var(--font-display); font-size: 6px; color: var(--muted-2); letter-spacing: .08em; }

/* mobile recall */
.mobile-recall { display: none; z-index: 9; position: absolute; right: 88px; bottom: 25px; width: 46px; height: 46px; border-radius: 50%; background: rgba(95,240,206,.1); border: 1px solid rgba(95,240,206,.6); font-family: var(--font-display); font-size: 6px; color: var(--cyan); letter-spacing: .06em; }
.mobile-recall:disabled { opacity: .45; }
.mobile-recall.is-cooling { color: var(--amber); border-color: rgba(255,181,45,.5); }
@media (hover: none) and (pointer: coarse) and (max-width: 900px) {
  .mobile-recall { display: block; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .combat-deck--actions { display: flex; min-height: 0; }
  .combat-deck--actions .deck-slot { height: 43px; padding: 6px 10px; }
  .combat-deck--actions .dash-icon, .combat-deck--actions .recall-icon { width: 26px; height: 26px; flex-basis: 26px; margin-top: 1px; }
  .combat-deck--actions .dash-icon svg, .combat-deck--actions .recall-icon svg { width: 17px; height: 17px; }
  .combat-deck--actions .deck-slot__copy small { font-size: 8px; }
  .combat-deck--actions .deck-slot__copy strong { font-size: 10px; }
  .combat-deck--actions .dash-meter, .combat-deck--actions .recall-meter { left: 10px; right: 10px; bottom: 5px; height: 2px; }
  .mobile-recall { position: fixed; right: 102px; bottom: 58px; width: 44px; height: 44px; }
  .item-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) and (max-height: 500px) {
  .combat-deck--actions { display: none; }
  .mobile-recall { display: block; position: fixed; right: 88px; bottom: 47px; width: 40px; height: 40px; }
  .item-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .item-guide-grid { grid-template-columns: 1fr; }
  .item-guide-card { min-height: 0; }
}

/* Keep the hangar fully usable on shorter desktop viewports: no clipped start row. */
@media (max-height: 1000px) and (min-width: 901px) {
  .hangar-main { padding-top: 12px; padding-bottom: 12px; }
  .game-title { font-size: clamp(55px, 7.4vw, 106px); }
  .cn-title { margin-top: 18px; font-size: clamp(15px, 1.3vw, 19px); }
  .eyebrow { margin-bottom: 10px; }
  .stage-hint { display: none; }
  .stage-picker-card { padding: 6px 9px; }
  .pilot-picker { margin-top: 9px; }
  .pilot-card { padding: 6px 9px; }
  .mode-picker { margin-top: 7px; }
  .menu-actions { flex-wrap: nowrap; gap: 7px; margin-top: 10px; }
  .menu-actions .cta { min-width: 210px; padding: 9px 12px; gap: 10px; }
  .menu-actions .text-btn { padding: 8px 8px; font-size: 9px; gap: 5px; white-space: nowrap; }
  .menu-actions .text-btn span { width: 15px; height: 15px; font-size: 7px; }
}

@media (max-width: 620px) {
  .hangar-main { padding-bottom: 4px; }
  .stage-hint { display: none; }
  .pilot-picker { margin-top: 6px; }
  .mode-picker { margin-top: 5px; }
  .mode-card { padding: 6px 9px; }
  .menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
  .menu-actions .cta { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 50px; padding: 8px 12px; }
  .menu-actions .text-btn { width: 100%; min-height: 32px; padding: 6px 7px; font-size: 8px; justify-content: center; }
  .menu-actions .text-btn span { width: 14px; height: 14px; font-size: 7px; }
}

/* ---------- AI visual lab / pilot ---------- */
.art-test-btn { border-color: rgba(95,240,206,.26); color: var(--cyan); }
.art-test-btn:hover { border-color: var(--cyan); background: rgba(95,240,206,.06); }
.art-test-btn.is-hidden { display: none; }

body.ai-art #menuScreen::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4,8,6,.98) 0%, rgba(4,8,6,.9) 30%, rgba(4,8,6,.46) 64%, rgba(4,8,6,.76) 100%),
    linear-gradient(180deg, rgba(4,8,6,.44) 0%, rgba(4,8,6,.08) 42%, rgba(4,8,6,.82) 100%),
    url("../assets/ai/menu-hangar-wide.webp") center / cover no-repeat;
  filter: saturate(.84) contrast(1.06);
}
body.ai-art #menuScreen > * { position: relative; z-index: 1; }

.art-screen .art-panel {
  position: relative; width: min(1180px, 94vw); max-height: 92svh; overflow-y: auto;
  padding: 30px 34px 22px; border: 1px solid rgba(95,240,206,.25);
  background: linear-gradient(145deg, rgba(8,17,13,.98), rgba(4,9,7,.98));
  clip-path: var(--cut-lg); box-shadow: 0 0 80px rgba(0,0,0,.55), inset 0 0 70px rgba(95,240,206,.025);
}
.art-head { padding-right: 36px; }
.art-head h2 {
  margin: 8px 0 7px; font-family: var(--font-cn); font-size: clamp(22px, 3vw, 34px);
  font-weight: 900; letter-spacing: .06em; color: var(--paper);
}
.art-head p { max-width: 760px; margin: 0; font-family: var(--font-cn); color: var(--muted); font-size: 10px; line-height: 1.7; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 12px; margin-top: 18px; }
.art-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; min-width: 0; }
.art-card {
  min-width: 0; margin: 0; border: 1px solid var(--line); background: rgba(7,12,10,.8);
  clip-path: var(--cut); overflow: hidden;
}
.art-card__frame { position: relative; overflow: hidden; background: #07100d; }
.art-card__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(3,7,5,.5));
}
.art-card--hero .art-card__frame { aspect-ratio: 16 / 9; }
.art-card--wide .art-card__frame { aspect-ratio: 16 / 7; }
.art-card--portrait .art-card__frame { aspect-ratio: 1 / 1; background: radial-gradient(circle at 50% 45%, rgba(48,88,68,.34), #07100d 72%); }
.art-card__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-card--portrait .art-card__frame img { object-fit: contain; padding: 6%; }
.art-card__tag {
  position: absolute; z-index: 2; top: 10px; left: 10px; padding: 3px 5px;
  border: 1px solid rgba(95,240,206,.35); background: rgba(3,8,6,.72);
  font-family: var(--font-display); font-size: 6px; letter-spacing: .1em; color: var(--cyan);
}
.art-card figcaption { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 10px; }
.art-card figcaption strong { font-family: var(--font-cn); font-size: 12px; color: var(--paper); letter-spacing: .04em; }
.art-card figcaption span { font-family: var(--font-display); font-size: 6px; letter-spacing: .1em; color: var(--amber); }
.art-card figcaption small { margin-top: 4px; font-family: var(--font-cn); font-size: 9px; line-height: 1.5; color: var(--muted-2); }
.art-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.art-foot > span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 7px; letter-spacing: .08em; color: var(--muted-2); }
.art-foot > span i { width: 5px; height: 5px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
@media (max-width: 900px) {
  .art-screen .art-panel { width: 94vw; padding: 23px 18px 16px; max-height: 94svh; }
  .art-grid { grid-template-columns: 1fr; }
  .art-stack { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .art-card--portrait .art-card__frame { aspect-ratio: 1 / 1; }
  .art-card--wide .art-card__frame { aspect-ratio: 1 / 1; }
  .art-foot { align-items: flex-start; flex-direction: column; }
  body.ai-art #menuScreen::before {
    background:
      linear-gradient(180deg, rgba(4,8,6,.58), rgba(4,8,6,.74) 60%, rgba(4,8,6,.96)),
      url("../assets/ai/menu-hangar-wide.webp") 62% center / cover no-repeat;
  }
}
@media (max-width: 620px) {
  .art-stack { grid-template-columns: 1fr; }
  .art-card--wide .art-card__frame { aspect-ratio: 16 / 9; }
  .art-card figcaption small { font-size: 8px; }
}


/* Co-op independent XP + build readout */
.coop-unit__xp { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 3px; font-family: var(--font-display); font-size: 7px; letter-spacing: .06em; color: var(--muted-2); }
.coop-unit__xp b { color: var(--cyan); font-weight: 400; }
.coop-unit__xp .meter { flex: 1; }
.coop-build { margin-top: 4px; font-family: var(--font-cn); font-size: 8px; line-height: 1.45; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coop-build b { color: var(--paper-dim); font-weight: 500; }
.levelup__player.is-active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(95,240,206,.25); }
.levelup__player.is-active em { color: var(--cyan); }

/* Endless protocol card: cyan, distinct from campaign sectors. */
.arena-card--endless {
  border-color: rgba(95, 240, 206, .32);
  background: linear-gradient(145deg, rgba(95, 240, 206, .09), rgba(8, 13, 11, .58) 62%);
}
.arena-card--endless:hover {
  border-color: rgba(95, 240, 206, .7);
  background: linear-gradient(145deg, rgba(95, 240, 206, .15), rgba(8, 13, 11, .62) 62%);
}
.arena-card--endless .arena-card__index,
.arena-card--endless .arena-card__diff { color: var(--cyan); }
.arena-card--endless.is-active {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(95, 240, 206, .18), rgba(95, 240, 206, .025) 58%);
  box-shadow: inset 0 0 0 1px rgba(95, 240, 206, .15);
}
.arena-card--endless.is-active::after {
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.arena-card--endless.is-locked { border-style: dashed; }
.arena-card__diff--endless { color: var(--cyan); }
.stage-grid .arena-card--endless { grid-column: span 2; }


/* Controller-native UI: visible focus is a first-class state, not hover. */
.pad-hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 120;
  transform: translateX(-50%);
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 24px);
  padding: 8px 14px;
  border: 1px solid rgba(95, 240, 206, .34);
  background: rgba(4, 10, 9, .92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(95, 240, 206, .06);
  color: var(--paper-dim);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}
body.pad-connected .pad-hint.is-visible { display: flex; }
.pad-hint span { display: inline-flex; align-items: center; gap: 5px; }
.pad-hint span + span { padding-left: 12px; border-left: 1px solid var(--line); }
.pad-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(95, 240, 206, .38);
  background: rgba(95, 240, 206, .08);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1;
}
@media (max-width: 620px) {
  .pad-hint { gap: 8px; padding: 7px 10px; font-size: 7px; }
  .pad-hint span + span { padding-left: 8px; }
  .pad-hint kbd { min-width: 17px; height: 16px; padding: 0 4px; font-size: 7px; }
}

/* =====================================================================
   2026 command-deck menu pass
   One visual idea: a hangar launch bay, not a control panel.
   The menu is a left/right rail; the machine is the hero.
   ===================================================================== */
.sf-menu {
  height: 100svh;
  min-height: 0;
  padding: 18px clamp(20px, 3.4vw, 56px) 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}
.sf-menu .hangar-top {
  height: 42px;
  padding-bottom: 8px;
}
.sf-top .brand-name { font-size: 14px; letter-spacing: .13em; }
.sf-top .brand-mark { width: 28px; height: 28px; padding: 3px; }
.sf-top .pad-state { display: none; }
.sf-top .hangar-top__right { gap: 6px; }
.sf-main {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(360px, .78fr);
  align-items: center;
  gap: clamp(18px, 4vw, 76px);
  padding: clamp(10px, 2vh, 28px) 0;
}
.sf-heading {
  position: relative;
  z-index: 3;
  align-self: end;
  padding-bottom: clamp(12px, 4vh, 54px);
}
.sf-kicker {
  margin-bottom: 16px;
  color: var(--amber);
  font-family: var(--font-display);
  font-size: clamp(8px, .7vw, 11px);
  letter-spacing: .32em;
}
.sf-wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(64px, 9.2vw, 148px);
  font-weight: 700;
  line-height: .74;
  letter-spacing: -.1em;
  text-transform: uppercase;
  width: max-content;
  max-width: 100%;
}
.sf-wordmark span {
  display: block;
  color: transparent;
  -webkit-text-stroke: clamp(1px, .15vw, 3px) var(--paper);
  text-shadow: 0 0 36px rgba(237,230,211,.06);
}
.sf-wordmark em {
  display: block;
  margin-left: .14em;
  color: var(--amber);
  font-style: normal;
  text-shadow: 5px 5px 0 rgba(255,111,29,.12), 0 0 44px rgba(255,111,29,.22);
}
.sf-cn-title {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(64px, 8vw, 150px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .18em;
  white-space: nowrap;
  text-shadow: 6px 6px 0 rgba(255,111,29,.1), 0 0 48px rgba(255,181,45,.12);
}
.sf-cn-title::first-letter { color: var(--amber); }
.sf-mission {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 13px;
  margin-top: clamp(20px, 4vh, 40px);
  color: var(--paper);
  font-family: var(--font-cn);
}
.sf-mission span {
  color: var(--amber);
  font-family: var(--font-cn);
  font-size: clamp(13px, .95vw, 17px);
  letter-spacing: .1em;
}
.sf-mission strong { font-size: clamp(20px, 1.9vw, 30px); letter-spacing: .04em; }
.sf-mission i { width: 28px; height: 1px; background: var(--line-strong); align-self: center; }
.sf-showcase {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.sf-showcase::before {
  content: "";
  position: absolute;
  inset: 7% 1% 2%;
  background:
    radial-gradient(ellipse at 50% 64%, rgba(95,240,206,.11), transparent 45%),
    linear-gradient(180deg, transparent 55%, rgba(255,181,45,.04));
  filter: blur(4px);
  z-index: -1;
}
.sf-showcase canvas {
  position: relative;
  z-index: 2;
  display: block;
  height: min(60vh, 590px);
  width: auto;
  max-width: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 26px 28px rgba(0,0,0,.45));
  animation: sfHover 6s ease-in-out infinite;
}
@keyframes sfHover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.sf-showcase__orbit {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 53%;
  width: min(44vw, 480px);
  aspect-ratio: 1;
  border: 1px solid rgba(95,240,206,.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.sf-showcase__orbit::after {
  content: "";
  position: absolute;
  left: 12%; top: 1%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}
.sf-showcase__orbit--one { animation: sfOrbit 18s linear infinite; }
.sf-showcase__orbit--two { width: min(36vw, 390px); border-style: dashed; border-color: rgba(255,181,45,.15); animation: sfOrbit 13s linear infinite reverse; }
@keyframes sfOrbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
.sf-unit-tag {
  position: absolute;
  z-index: 4;
  right: 1%;
  bottom: 1%;
  display: grid;
  gap: 3px;
  text-align: right;
}
.sf-unit-tag span {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .14em;
}
.sf-unit-tag strong {
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(20px, 1.8vw, 28px);
  letter-spacing: .06em;
}
.sf-unit-tag em {
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .12em;
}
.sf-nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 70px;
  padding: 8px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,18,15,.72), rgba(4,8,6,.34));
}
.sf-nav__item {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-cn);
  font-size: clamp(15px, 1.45vw, 23px);
  font-weight: 700;
  letter-spacing: .12em;
  transition: color .16s, background .16s, border-color .16s, transform .16s;
}
.sf-nav__item::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: 3px;
  height: 1px;
  background: transparent;
  transition: background .16s;
}
.sf-nav__item:hover {
  color: var(--paper);
  background: rgba(237,230,211,.05);
}
.sf-nav__item b {
  margin-left: 5px;
  color: var(--amber);
  font-family: var(--font-ui);
  font-size: .52em;
  font-weight: 500;
  letter-spacing: .06em;
}
.sf-nav__item--start {
  flex: 1.25 1 0;
  margin: 0 8px;
  padding: 0 16px;
  border-color: var(--paper);
  background: var(--paper);
  color: #090b08;
  font-size: clamp(18px, 1.8vw, 29px);
  clip-path: var(--cut);
  box-shadow: 0 0 30px rgba(237,230,211,.11);
}
.sf-nav__item--start:hover { background: var(--amber); border-color: var(--amber); color: #090b08; transform: translateY(-1px); }
.sf-nav__item.is-pad-focus {
  color: var(--cyan) !important;
  background: rgba(95,240,206,.08) !important;
  border-color: rgba(95,240,206,.6) !important;
  box-shadow: inset 0 0 0 1px rgba(95,240,206,.2) !important;
  outline: none !important;
}
.sf-nav__item.is-pad-focus::after { background: var(--cyan); }
.sf-nav__item--start.is-pad-focus {
  color: #050706 !important;
  background: var(--amber) !important;
  border-color: var(--amber) !important;
  box-shadow: 0 0 34px rgba(255,181,45,.32) !important;
}
.sf-hint {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 9px 0 1px;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .1em;
}
.sf-hint span + span { padding-left: 20px; border-left: 1px solid var(--line); }
.menu-legacy { display: none !important; }

/* Horizontal archive rails: hangar, campaign and field manual now read
   like a console carousel instead of a wall of cards. */
.stage-grid,
.tank-grid,
.item-guide-grid {
  display: flex !important;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,181,45,.35) transparent;
  padding: 4px 3px 12px;
  min-height: 0;
}
.stage-grid::-webkit-scrollbar,
.tank-grid::-webkit-scrollbar,
.item-guide-grid::-webkit-scrollbar { height: 4px; }
.stage-grid::-webkit-scrollbar-thumb,
.tank-grid::-webkit-scrollbar-thumb,
.item-guide-grid::-webkit-scrollbar-thumb { background: rgba(255,181,45,.35); }
.stage-grid .arena-card {
  flex: 0 0 clamp(190px, 20vw, 260px);
  min-height: 132px;
  padding: 16px 16px 14px;
  scroll-snap-align: center;
}
.stage-grid .arena-card__index { font-size: clamp(11px, .72vw, 13px); margin-bottom: 12px; }
.stage-grid .arena-card__name { font-size: clamp(18px, 1.5vw, 24px); }
.stage-grid .arena-card__en,
.stage-grid .arena-card__trait,
.stage-grid .arena-card__diff { display: none; }
.stage-grid .arena-card--endless { grid-column: auto; }
.tank-grid { align-items: stretch; }
.tank-card {
  flex: 0 0 clamp(190px, 21vw, 270px);
  min-height: 230px;
  padding: 14px 14px 12px;
  scroll-snap-align: center;
}
.tank-card canvas { width: 128px; height: 86px; margin: 18px auto 12px; }
.tank-card__id,
.tank-card__role,
.tank-card__en { display: none; }
.tank-card__name { font-size: clamp(17px, 1.5vw, 22px); text-align: center; }
.tank-card__trait { display: none; }
.tank-card.is-locked .tank-card__trait { display: block; font-size: clamp(10px, .7vw, 13px); min-height: 0; text-align: center; }
.tank-card__lock { right: 12px; bottom: 10px; }
#tankScreenHint { display: none; }
#tankDetail {
  flex: 1;
  min-width: 0;
  color: var(--paper-dim);
  font-family: var(--font-cn);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#tankDetail strong { color: var(--paper); font-size: 16px; margin-right: 10px; }
#tankDetail b { color: var(--amber); font-weight: 500; }
#tankDetail em { color: var(--muted-2); font-style: normal; }
.tank-select__head p { display: none; }
.item-guide-card {
  flex: 0 0 clamp(230px, 25vw, 320px);
  min-height: 190px;
  scroll-snap-align: center;
}
.item-guide-card__tag,
.item-guide-card__title small { display: none; }
.item-guide-card__desc { font-size: 14px; }
.item-guide-card__detail { font-size: 12px; }
.manual-brief {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 12px;
}
.manual-brief article {
  padding: 12px 13px;
  border: 1px solid var(--line);
  background: rgba(7,12,10,.65);
  clip-path: var(--cut);
}
.manual-brief strong {
  display: block;
  margin-bottom: 5px;
  color: var(--amber);
  font-family: var(--font-cn);
  font-size: 12px;
  letter-spacing: .08em;
}
.manual-brief span {
  display: block;
  color: var(--paper-dim);
  font-family: var(--font-cn);
  font-size: 11px;
  line-height: 1.65;
}
.fusion-lead { display: none; }

@media (max-width: 1100px) {
  .sf-main { grid-template-columns: minmax(0, .82fr) minmax(300px, .9fr); gap: 24px; }
  .sf-wordmark { font-size: clamp(58px, 9.6vw, 110px); }
  .sf-showcase canvas { height: min(54vh, 520px); }
  .sf-nav__item { letter-spacing: .05em; }
}
@media (max-width: 820px) {
  .sf-menu { padding: 12px 16px 10px; }
  .sf-main { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 8px; }
  .sf-heading { padding-bottom: 12px; }
  .sf-kicker { margin-bottom: 8px; font-size: 7px; }
  .sf-wordmark { font-size: clamp(46px, 10vw, 82px); }
  .sf-cn-title { margin-top: 12px; font-size: 11px; }
  .sf-mission { margin-top: 14px; gap: 7px; }
  .sf-mission strong { font-size: 15px; }
  .sf-showcase canvas { height: min(46vh, 430px); }
  .sf-showcase__orbit { width: min(52vw, 360px); }
  .sf-showcase__orbit--two { width: min(42vw, 280px); }
  .sf-unit-tag { right: 0; bottom: 0; }
  .sf-unit-tag strong { font-size: 16px; }
  .sf-nav { min-height: 58px; padding: 6px 0; }
  .sf-nav__item { font-size: 13px; letter-spacing: .02em; }
  .sf-nav__item--start { font-size: 16px; margin: 0 3px; padding: 0 8px; }
  .sf-nav__item b { display: none; }
  .sf-hint { font-size: 7px; gap: 9px; padding-top: 6px; }
  .sf-hint span + span { padding-left: 9px; }
  .manual-brief { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .sf-menu { padding: 8px 10px 7px; }
  .sf-top { height: 32px; }
  .sf-top .brand-name { font-size: 11px; }
  .sf-main { grid-template-columns: minmax(0, 1fr) minmax(0, .88fr); }
  .sf-wordmark { font-size: clamp(40px, 12vw, 64px); }
  .sf-cn-title { letter-spacing: .35em; }
  .sf-mission span { font-size: 7px; }
  .sf-mission strong { font-size: 12px; }
  .sf-mission i { display: none; }
  .sf-showcase canvas { height: min(40vh, 330px); }
  .sf-showcase__orbit { width: 70vw; }
  .sf-showcase__orbit--two { width: 58vw; }
  .sf-unit-tag { display: none; }
  .sf-nav { overflow-x: auto; min-height: 50px; }
  .sf-nav__item { flex: 0 0 64px; font-size: 12px; }
  .sf-nav__item--start { flex-basis: 84px; font-size: 14px; }
  .manual-brief { grid-template-columns: 1fr; max-height: 20vh; overflow-y: auto; }
  .tank-card { flex-basis: 72vw; }
  .stage-grid .arena-card { flex-basis: 72vw; }
  .item-guide-card { flex-basis: 78vw; }
}
.sf-showcase canvas {
  -webkit-mask-image: radial-gradient(ellipse at 50% 56%, #000 48%, rgba(0,0,0,.92) 62%, transparent 82%);
  mask-image: radial-gradient(ellipse at 50% 56%, #000 48%, rgba(0,0,0,.92) 62%, transparent 82%);
}
.sf-hint { display: none; }
body.pad-connected .sf-hint { display: flex; }
/* Keep the archive rails airy: only the choice itself carries weight. */
.difficulty-card { min-height: 64px; display: flex; align-items: center; justify-content: center; padding: 12px 16px; }
.difficulty-card small,
.difficulty-card em,
.difficulty-hint { display: none; }
.difficulty-card strong { font-size: clamp(16px, 1.1vw, 20px); letter-spacing: .08em; }
.tank-card canvas { width: 170px; height: 115px; margin: 10px auto 8px; }
.item-guide-panel .codex-legend { display: none; }
.manual-brief strong { font-size: 13px; }
.manual-brief span { font-size: 12px; }
@media (max-width: 820px) {
  .tank-card canvas { width: 140px; height: 95px; }
}
@media (max-width: 620px) {
  .tank-card canvas { width: 120px; height: 82px; }
}
/* The canvas has an ID rule from the old hangar; keep it aspect-correct
   instead of stretching it to the showcase column. */
.sf-showcase #menuCanvas {
  width: auto;
  height: min(60vh, 590px);
  max-width: 100%;
}
@media (max-width: 1100px) {
  .sf-showcase #menuCanvas { height: min(54vh, 520px); }
}
@media (max-width: 820px) {
  .sf-showcase #menuCanvas { height: min(46vh, 430px); }
}
@media (max-width: 620px) {
  .sf-showcase #menuCanvas { height: min(40vh, 330px); }
}
@media (max-height: 620px) {
  .sf-menu { padding: 8px 14px 6px; }
  .sf-top { height: 30px; padding-bottom: 4px; }
  .sf-kicker { display: none; }
  .sf-heading { align-self: center; padding-bottom: 0; }
  .sf-wordmark { font-size: clamp(48px, 7.2vw, 82px); }
  .sf-cn-title { display: none; }
  .sf-mission { margin-top: 10px; }
  .sf-mission strong { font-size: clamp(14px, 1.6vw, 18px); }
  .sf-showcase #menuCanvas { height: min(50vh, 270px); }
  .sf-nav { min-height: 48px; padding: 4px 0; }
  .sf-nav__item { font-size: 12px; }
  .sf-nav__item--start { font-size: 15px; }
  .sf-unit-tag strong { font-size: 16px; }
}
/* Touch controls belong to the run, never to the hangar. */
.state-menu .mobile-stick,
.state-menu .mobile-dash,
.state-menu .mobile-recall { display: none !important; }
@media (max-height: 620px) {
  .sf-menu .sf-top { height: 30px; }
  .sf-unit-tag { display: none; }
}
@media (max-width: 520px) and (orientation: portrait) {
  .sf-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
  }
  .sf-heading {
    align-self: start;
    padding: 4vh 0 0;
  }
  .sf-showcase {
    min-height: 0;
    align-self: stretch;
  }
  .sf-showcase #menuCanvas { height: min(44vh, 360px); }
  .sf-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    min-height: 0;
    padding: 4px 0;
  }
  .sf-nav__item,
  .sf-nav__item--start {
    flex: none;
    min-height: 42px;
    margin: 0;
    padding: 0 4px;
    font-size: 12px;
  }
  .sf-nav__item--start { font-size: 13px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .state-menu .rotate-hint { display: none; }
}
.sf-heading {
  align-self: center;
  padding-bottom: 0;
}
/* App-level state hooks (the state class lives on #app, not <body>). */
.app.state-menu .mobile-stick,
.app.state-menu .mobile-dash,
.app.state-menu .mobile-recall,
.app.state-menu .pad-hint { display: none !important; }
@media (max-width: 620px) and (orientation: portrait) {
  .app.state-menu .rotate-hint { display: none; }
}
.item-guide-panel .tank-select__foot { justify-content: flex-end; }

/* ================= 2026 COMMAND DECK / COMBAT HUD ================= */
/* Lift the command rail off the bottom edge so it reads as a control deck,
   not a footer. */
.sf-menu {
  padding-bottom: clamp(88px, 26vh, 270px);
}
.sf-showcase #menuCanvas { height: min(55vh, 500px); }
@media (max-width: 620px) and (orientation: portrait) {
  .sf-menu { padding-bottom: 0; }
}

/* Pause: one clear primary action, two legible secondary actions. */
.pause__card { width: min(640px, 100%); padding: 48px 48px 32px; }
.pause__card h2 { font-size: clamp(36px, 3.2vw, 46px); margin: 15px 0 10px; }
.pause__card > p { font-size: 14px; line-height: 1.8; margin-bottom: 30px; }
.pause__actions { gap: 12px; }
.pause__actions .cta { min-width: min(390px, 100%); min-height: 72px; }
.pause__actions .text-btn {
  min-width: min(390px, 100%);
  min-height: 50px;
  padding: 12px 22px;
  border: 1px solid var(--line-strong);
  background: rgba(237,230,211,.025);
  font-family: var(--font-cn);
  font-size: 15px;
  letter-spacing: .12em;
}
.pause__actions .text-btn:hover { background: rgba(255,181,45,.07); }
.pause__controls { gap: 12px 18px; margin-top: 30px; padding-top: 18px; font-size: 11px; }
.pause__controls kbd { font-size: 10px; padding: 4px 6px; }

/* Stage map: endless protocol gets its own full-width row. */
.endless-row { display: block; margin-top: 9px; }
.endless-row .arena-card--endless {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 22px;
  row-gap: 2px;
  padding: 14px 22px;
  text-align: left;
}
.endless-row .arena-card--endless .arena-card__index { position: static; right: auto; top: auto; grid-column: 1; grid-row: 1 / 3; margin: 0; font-size: 10px; writing-mode: horizontal-tb; }
.endless-row .arena-card--endless .arena-card__name { grid-column: 2; grid-row: 1; font-size: 25px; }
.endless-row .arena-card--endless .arena-card__trait { grid-column: 2; grid-row: 2; margin: 0; font-size: 10px; }
.endless-row .arena-card--endless .arena-card__en { display: none; }
.endless-row .arena-card--endless .arena-card__diff { grid-column: 3; grid-row: 1 / 3; margin: 0; font-size: 8px; }
.endless-row .arena-card--endless .arena-card__lock { position: static; grid-column: 3; grid-row: 1 / 3; }

/* Full-width battle field; the old right sidebar is gone. */
.battle-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 12px;
}
.battle-column {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  min-height: 0;
}
.battle-frame {
  width: min(100%, calc((100svh - 250px) * 1.6667));
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  flex: 0 0 auto;
}
.sidebar, .side-tip { display: none !important; }
.tiny-stat { display: none; }
#mobileHud { display: none !important; }
.hud-legacy { display: none !important; }

/* Corner vitals: P1 left, P2 right, base bar centered. */
.hud-pilot {
  position: absolute;
  z-index: 9;
  top: 10px;
  width: min(280px, 31%);
  padding: 9px 11px 10px;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, rgba(5,10,8,.58), rgba(5,10,8,.12));
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  pointer-events: none;
}
.hud-pilot--p1 { left: 10px; }
.hud-pilot--p2 {
  right: 10px;
  left: auto;
  border-left: 0;
  border-right: 2px solid var(--cyan);
  background: linear-gradient(270deg, rgba(5,10,8,.58), rgba(5,10,8,.12));
}
.hud-pilot.is-hidden { display: none; }
.hud-pilot__top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hud-pilot__tag {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 16px;
  background: var(--amber);
  color: #090b08;
  font-family: var(--font-display);
  font-size: 8px;
}
.hud-pilot__tag--p2 { background: var(--cyan); }
.hud-pilot__top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-cn);
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--paper);
}
.hud-pilot__top em {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .08em;
  color: var(--muted-2);
}
.hud-pilot__top em b { color: var(--paper-dim); font-weight: 400; }
#coopState2 { color: var(--cyan); }
#coopState2.is-down { color: var(--red); }
.hud-pilot__line {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}
.hud-pilot__line span { font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); letter-spacing: .08em; }
.hud-pilot__line em { font-family: var(--font-display); font-size: 8px; font-style: normal; color: var(--paper-dim); white-space: nowrap; }
.hud-meter { display: block; height: 4px; background: rgba(237,230,211,.12); overflow: hidden; }
.hud-meter b { display: block; height: 100%; width: 100%; transition: width .18s ease; }
.hud-meter--hp b { background: linear-gradient(90deg, var(--green), #d3f08e); }
.hud-meter--xp b { background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 8px rgba(95,240,206,.35); }
.hud-meter--base b { background: linear-gradient(90deg, #317e73, var(--cyan)); }
.hud-meter--base.is-low b { background: linear-gradient(90deg, #7a2424, var(--red)); }
.hud-pilot__build {
  margin-top: 5px;
  font-family: var(--font-cn);
  font-size: 8px;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-pilot__build b { color: var(--paper-dim); font-weight: 400; }
.hud-base {
  position: static;
  z-index: 9;
  width: 206px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: rgba(5,10,8,.78);
  pointer-events: none;
}
.hud-base__label { font-family: var(--font-cn); font-size: 8px; color: var(--muted-2); letter-spacing: .1em; }
.hud-base .hud-meter { flex: 1; min-width: 60px; }
.hud-base > em { font-family: var(--font-display); font-size: 8px; font-style: normal; color: var(--paper-dim); white-space: nowrap; }
.hud-base__hidden { display: none !important; }

/* Loadout lives in a quiet rail under the battlefield. */
.hud-loadout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: rgba(8,13,11,.62);
}
.hud-loadout__head { flex: 0 0 auto; display: flex; align-items: baseline; gap: 8px; }
.hud-loadout__head span { font-family: var(--font-display); font-size: 8px; letter-spacing: .12em; color: var(--muted); }
.hud-loadout__head b { font-family: var(--font-cn); font-size: 9px; font-weight: 400; color: var(--amber); }
.hud-loadout__head b.is-passive-count { color: var(--green); }
.hud-loadout .loadout-list {
  flex: 1;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.hud-loadout .loadout-item {
  flex: 0 0 auto;
  min-height: 27px;
  gap: 4px;
  padding: 2px 6px;
  border-color: rgba(237,230,211,.07);
}
.hud-loadout .loadout-item canvas { width: 18px; height: 18px; flex-basis: 18px; }
.hud-loadout .loadout-item__copy { flex-direction: row; align-items: baseline; gap: 4px; }
.hud-loadout .loadout-item__copy strong { font-size: 10px; max-width: 78px; }
.hud-loadout .loadout-item__copy small { font-size: 7px; color: var(--muted-2); }
.hud-loadout .loadout-pips { display: none; }
.hud-loadout .loadout-hint { display: none; }
.hud-loadout .empty-slot { padding: 5px 10px; border: 0; font-size: 9px; }
.combat-deck { margin-top: 0; min-height: 55px; }
.toast-stack { top: 62px; left: 50%; transform: translateX(-50%); align-items: center; }
.toast { border-left: 0; border-bottom: 2px solid var(--amber); }

@media (max-width: 1100px) {
  .battle-frame { width: min(100%, calc((100svh - 270px) * 1.6667)); }
  .hud-pilot { width: min(250px, 32%); }
  .hud-base { width: 180px; }
}
@media (max-width: 820px) {
  .battle-frame { width: 100%; }
  .hud-pilot { width: 220px; top: 7px; padding: 7px 8px 8px; }
  .hud-pilot--p1 { left: 7px; }
  .hud-pilot--p2 { right: 7px; }
  .hud-base { top: 7px; width: 150px; }
  .hud-pilot__top strong { font-size: 11px; }
  .hud-pilot__line span { display: none; }
  .hud-pilot__line { grid-template-columns: minmax(0,1fr) auto; gap: 5px; }
  .hud-loadout__head span { display: none; }
  .combat-deck { min-height: 50px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .battle-frame { width: 100%; height: auto; max-height: none; }
  .hud-pilot { width: 166px; top: 5px; padding: 5px 6px 6px; }
  .hud-pilot--p1 { left: 5px; }
  .hud-pilot--p2 { right: 5px; }
  .hud-base { display: none; }
  .hud-pilot__tag { width: 20px; height: 14px; font-size: 7px; }
  .hud-pilot__top strong { font-size: 10px; }
  .hud-pilot__top em { font-size: 7px; }
  .hud-pilot__line em { font-size: 7px; }
  .hud-pilot__build { display: none; }
  .hud-loadout { min-height: 38px; padding: 3px 6px; }
  .hud-loadout__head b { font-size: 8px; }
  .hud-loadout .loadout-item { min-height: 25px; padding: 2px 4px; }
  .hud-loadout .loadout-item__copy strong { font-size: 9px; max-width: 62px; }
  .toast-stack { top: 48px; }
}
.pause__actions .text-btn { font-size: 16px; min-height: 54px; }
.pause__controls { font-size: 12px; }
.pause__controls kbd { font-size: 11px; }
.hud-pilot__top strong { font-size: 14px; }
.hud-pilot__line em { font-size: 9px; }
.hud-pilot__line span { font-size: 9px; }
.hud-meter { height: 5px; }
.toast { max-width: min(460px, 72vw); font-size: 10px; padding: 6px 10px; }
@media (max-width: 700px) {
  .battle-statusbar { display: none; }
  .hud-base { display: none; }
}
.pause__actions .text-btn { font-size: 17px; min-height: 56px; }
.toast-stack { top: auto; bottom: 14px; left: 14px; transform: none; align-items: flex-start; }
@media (max-width: 620px) and (orientation: portrait) {
  .toast-stack { bottom: 8px; left: 6px; }
}
.hud-pilot--p2 .hud-meter--hp b { background: linear-gradient(90deg, #2d8b83, var(--cyan)); }

/* Main menu: the white selection block follows the current focus, instead of
   staying pinned to the primary action. */
.sf-nav__item--start {
  border-color: transparent;
  background: transparent;
  color: var(--paper);
  box-shadow: none;
}
.sf-nav:not(:has(.sf-nav__item.is-pad-focus)) .sf-nav__item--start {
  border-color: var(--paper);
  background: var(--paper);
  color: #090b08;
  box-shadow: 0 0 30px rgba(237,230,211,.11);
}
.sf-nav__item.is-pad-focus,
.sf-nav__item--start.is-pad-focus {
  color: #090b08 !important;
  background: var(--paper) !important;
  border-color: var(--paper) !important;
  clip-path: var(--cut);
  box-shadow: 0 0 32px rgba(237,230,211,.18) !important;
}
.sf-nav__item.is-pad-focus::after { background: #090b08; }
.sf-nav__item.is-pad-focus b { color: #6b4a00; }

/* Pickup messages hang directly under the owning pilot's corner. */
.hud-pilot__feed {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
.hud-pilot__feed--p2 { left: auto; right: 0; align-items: flex-end; }
.pickup-toast {
  max-width: 100%;
  padding: 8px 12px;
  border-left: 3px solid var(--cyan);
  background: rgba(5,10,8,.94);
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(16px, 1vw, 19px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .025em;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
  box-shadow: 0 7px 22px rgba(0,0,0,.32);
  animation: pickupFeedIn .18s ease-out both;
}
.hud-pilot__feed--p2 .pickup-toast { border-left: 0; border-right: 2px solid var(--cyan); text-align: right; }
@keyframes pickupFeedIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 620px) and (orientation: portrait) {
  .hud-pilot__feed { width: min(280px, calc(100vw - 24px)); }
  .pickup-toast { font-size: 14px; padding: 7px 10px; }
}

/* The command rail sits at the lower quarter, not the lower third. */
.sf-menu { padding-bottom: clamp(72px, 25vh, 250px); }
.sf-showcase #menuCanvas { height: min(54vh, 500px); }
@media (max-width: 620px) and (orientation: portrait) {
  .sf-menu { padding-bottom: 0; }
}

/* With the side column gone, let the battlefield take the available width. */
.battle-frame { width: min(100%, calc((100svh - 252px) * 1.6667)); }
@media (max-width: 1100px) {
  .battle-frame { width: min(100%, calc((100svh - 228px) * 1.6667)); }
}

/* Large displays: remove the old 1500px desktop cap and let the battlefield
   consume the full usable height. The column also absorbs leftover space so
   the frame stays centred vertically instead of hugging the top. */
.battle-column { max-width: none; }
@media (min-width: 901px) {
  .battle-column { flex: 1 1 auto; }
}

/* 2K / 4K typography: keep the HUD legible without taking space away from
   the battlefield. Minimum values match the 1080p layout exactly. */
.topbar { grid-template-columns: 1fr minmax(320px, clamp(440px, 28vw, 720px)) 1fr; }
.topbar__brand strong { font-size: clamp(12px, .7vw, 17px); }
.topbar__brand span { font-size: clamp(7px, .4vw, 10px); }
.run-clock__meta span:first-child { font-size: clamp(11px, .7vw, 15px); }
.run-clock__meta span:last-child { font-size: clamp(13px, .8vw, 18px); }
.run-clock__bar { height: clamp(3px, .2vw, 5px); }
.topbar .icon-btn { width: clamp(31px, 1.6vw, 40px); height: clamp(29px, 1.5vw, 38px); }
.topbar .icon-btn svg { width: clamp(14px, .8vw, 18px); height: clamp(14px, .8vw, 18px); }

.hud-pilot {
  width: clamp(280px, 18vw, 420px);
  padding: clamp(9px, .45vw, 13px) clamp(11px, .55vw, 16px) clamp(10px, .48vw, 14px);
}
.hud-pilot__top { gap: clamp(7px, .35vw, 10px); }
.hud-pilot__tag {
  width: clamp(24px, 1.4vw, 32px);
  height: clamp(16px, .95vw, 22px);
  font-size: clamp(8px, .5vw, 10px);
}
.hud-pilot__top strong { font-size: clamp(13px, .78vw, 18px); }
.hud-pilot__top em { font-size: clamp(8px, .48vw, 11px); }
.hud-pilot__line { grid-template-columns: clamp(30px, 1.8vw, 40px) minmax(0,1fr) auto; gap: clamp(7px, .35vw, 10px); margin-top: clamp(5px, .3vw, 7px); }
.hud-pilot__line span, .hud-pilot__line em { font-size: clamp(8px, .48vw, 11px); }
.hud-meter { height: clamp(4px, .28vw, 6px); }
.hud-pilot__build { font-size: clamp(8px, .48vw, 11px); margin-top: clamp(5px, .3vw, 7px); }
.hud-base {
  width: clamp(206px, 12vw, 300px);
  gap: clamp(7px, .4vw, 10px);
  padding: clamp(6px, .35vw, 9px) clamp(9px, .55vw, 13px);
}
.hud-base__label, .hud-base > em { font-size: clamp(8px, .48vw, 11px); }
.hud-pilot__feed { width: min(clamp(420px, 25vw, 600px), 100%); }
.pickup-toast { font-size: clamp(16px, 1vw, 19px); }
.hud-loadout__head span { font-size: clamp(8px, .45vw, 11px); }
.hud-loadout__head b { font-size: clamp(9px, .5vw, 12px); }
.hud-loadout .loadout-item canvas { width: clamp(18px, 1vw, 24px); height: clamp(18px, 1vw, 24px); flex-basis: clamp(18px, 1vw, 24px); }
.hud-loadout .loadout-item__copy strong { font-size: clamp(10px, .55vw, 13px); }
.hud-loadout .loadout-item__copy small { font-size: clamp(7px, .4vw, 10px); }
.combat-deck--actions .deck-slot__copy small { font-size: clamp(10px, .55vw, 13px); }
.combat-deck--actions .deck-slot__copy strong { font-size: clamp(14px, .75vw, 18px); }
.combat-deck--actions .dash-icon,
.combat-deck--actions .recall-icon { width: clamp(34px, 1.8vw, 42px); height: clamp(34px, 1.8vw, 42px); flex-basis: clamp(34px, 1.8vw, 42px); }

/* Keep the slightly roomier 4K reserve from shrinking ordinary desktop play. */
@media (min-width: 1101px) and (max-width: 1899px) {
  .battle-frame { width: min(100%, calc((100svh - 240px) * 1.6667)); }
}

/* Main menu: eight command-rail entries and a slightly lower rail. */
@media (min-width: 621px) {
  .sf-menu { padding-bottom: clamp(54px, 18vh, 190px); }
}
@media (min-width: 901px) {
  .sf-nav__item { font-size: clamp(13px, 1.25vw, 28px); letter-spacing: .06em; }
  .sf-nav__item--start { font-size: clamp(16px, 1.55vw, 34px); }
}
#sfModeName { display: inline; color: inherit; font: inherit; letter-spacing: inherit; }

/* Stage deployment: each pilot confirms their own chassis after choosing a sector. */
.stage-roster { margin-top: 12px; }
.stage-roster .section-label { margin-bottom: 6px; }
.stage-roster__grid { display: flex; gap: 8px; }
.stage-pilot {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid rgba(255,181,45,.28);
  background: linear-gradient(100deg, rgba(255,181,45,.07), rgba(8,13,11,.55));
  color: var(--paper); text-align: left; clip-path: var(--cut);
  transition: border-color .18s, background .18s;
}
.stage-pilot:hover { border-color: var(--amber); background: rgba(255,181,45,.1); }
.stage-pilot.is-hidden { display: none; }
.stage-pilot__slot {
  flex: 0 0 auto; padding: 2px 5px; border: 1px solid rgba(255,181,45,.45);
  color: var(--amber); font-family: var(--font-display); font-size: 8px;
}
.stage-pilot__copy { min-width: 0; display: grid; gap: 2px; }
.stage-pilot__copy strong { font-family: var(--font-cn); font-size: clamp(15px, 1vw, 19px); letter-spacing: .04em; }
.stage-pilot__copy small { color: var(--muted); font-family: var(--font-cn); font-size: clamp(10px, .7vw, 13px); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-pilot__cta { margin-left: auto; flex: 0 0 auto; color: var(--amber); font-family: var(--font-cn); font-size: clamp(11px, .75vw, 14px); }
#stageTankP2 { border-color: rgba(95,240,206,.3); background: linear-gradient(100deg, rgba(95,240,206,.07), rgba(8,13,11,.55)); }
#stageTankP2 .stage-pilot__slot { color: var(--cyan); border-color: rgba(95,240,206,.45); }
#stageTankP2 .stage-pilot__cta { color: var(--cyan); }

/* Settings overlay: shared by the menu and the pause stack. */
.settings__panel {
  position: relative; width: min(660px, 100%); max-height: 92svh; overflow-y: auto;
  padding: 34px 36px 24px; border: 1px solid var(--line-strong);
  background: var(--panel-strong); clip-path: var(--cut-lg); animation: pauseIn .3s ease both;
}
.settings__panel h2 { margin: 10px 0 7px; font-family: var(--font-cn); font-size: clamp(27px, 3vw, 38px); letter-spacing: .12em; }
.settings__lead { margin: 0 0 22px; color: var(--muted); font-family: var(--font-cn); font-size: 11px; line-height: 1.7; }
.settings__rows { display: grid; gap: 8px; }
.settings-row {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(170px,1.25fr) 58px;
  align-items: center; gap: 14px; min-height: 58px; padding: 11px 13px;
  border: 1px solid var(--line); background: rgba(7,13,10,.64);
}
.settings-row__copy { min-width: 0; display: grid; gap: 3px; }
.settings-row__copy strong { color: var(--paper); font-family: var(--font-cn); font-size: 13px; letter-spacing: .07em; }
.settings-row__copy small { color: var(--muted-2); font-family: var(--font-display); font-size: 7px; letter-spacing: .08em; }
.settings-range { width: 100%; accent-color: var(--amber); cursor: pointer; }
.settings-value { color: var(--amber); font-family: var(--font-display); font-size: 12px; text-align: right; }
.settings-toggle {
  grid-column: 2 / 4; justify-self: end; display: inline-flex; align-items: center; gap: 12px;
  min-width: 132px; padding: 8px 12px; border: 1px solid var(--line-strong);
  background: rgba(237,230,211,.035); color: var(--paper-dim); font-family: var(--font-cn); font-size: 11px;
}
.settings-toggle b { color: var(--muted-2); font-family: var(--font-display); font-size: 8px; font-weight: 400; }
.settings-toggle.is-on { border-color: var(--cyan); color: var(--cyan); background: rgba(95,240,206,.08); }
.settings-toggle.is-on b { color: var(--cyan); }
.settings__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings__note { color: var(--muted-2); font-family: var(--font-cn); font-size: 9px; }
@media (max-width: 620px) {
  .settings__panel { padding: 24px 17px 18px; max-height: 94svh; }
  .settings-row { grid-template-columns: 1fr 58px; gap: 8px; }
  .settings-row__copy { grid-column: 1 / -1; }
  .settings-range { grid-column: 1; }
  .settings-toggle { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .settings__foot { align-items: stretch; flex-direction: column; }
  .settings__foot .cta { width: 100%; }
}
.pause__card { max-height: calc(100svh - 24px); overflow-y: auto; }
.fusion-panel { max-height: 92svh; overflow-y: auto; }
@media (min-width: 1900px) {
  .settings__panel { width: min(1000px, 80vw); padding: 46px 50px 32px; }
  .settings__panel h2 { font-size: 48px; }
  .settings__lead { font-size: 15px; }
  .settings__rows { gap: 12px; }
  .settings-row { min-height: 78px; padding: 16px 18px; gap: 20px; grid-template-columns: minmax(0,1fr) minmax(240px,1.3fr) 74px; }
  .settings-row__copy strong { font-size: 18px; }
  .settings-row__copy small { font-size: 9px; }
  .settings-value { font-size: 16px; }
  .settings-toggle { min-width: 178px; padding: 12px 16px; font-size: 15px; }
  .settings__foot .cta { min-width: 250px; }
  .settings__note { font-size: 12px; }
}
.settings-toggle:disabled { opacity: .38; cursor: not-allowed; }

/* ---------- readability pass: Chinese-first UI ---------- */
.cta__copy small { display: none; }
.cta__copy strong { font-size: clamp(15px, 1vw, 18px); }
.levelup__foot { font-size: clamp(14px, 1vw, 19px); }
.levelup__foot #levelupKeyHint { display: none; }
.reroll-btn { font-size: clamp(16px, 1.1vw, 20px); padding: 10px 18px; }
.upgrade-card__top { font-size: clamp(14px, 1vw, 18px); }
.tank-select__head h2, .fusion-panel h2 { font-size: clamp(30px, 3.2vw, 52px); }
.tank-select__head p, .fusion-lead { font-size: clamp(12px, .85vw, 16px); line-height: 1.7; }
.codex-panel { width: min(1500px, 96vw); max-width: min(1500px, 96vw); }
.codex-grid { gap: 24px; }
.codex-section__head { font-size: clamp(12px, .85vw, 16px); padding-bottom: 9px; }
.codex-section__head b { font-size: clamp(11px, .75vw, 14px); }
.codex-cards { gap: 10px; }
.codex-card { padding: 10px; }
.codex-card__name { font-size: clamp(13px, .95vw, 17px); margin-top: 6px; }
.codex-card__desc { font-size: clamp(10px, .75vw, 14px); line-height: 1.55; margin-top: 7px; }
.codex-card__en { display: none; }
.codex-legend { font-size: clamp(11px, .75vw, 14px); }
.difficulty-card { padding: 11px 13px; }
.difficulty-card strong { font-size: clamp(15px, 1vw, 19px); }
.difficulty-card em { font-size: clamp(10px, .7vw, 13px); margin-top: 6px; }
.difficulty-hint { font-size: clamp(11px, .75vw, 14px); }
.difficulty-picker .section-label { font-size: clamp(11px, .75vw, 14px); }
.item-guide-card__title strong { font-size: clamp(15px, 1vw, 19px); }
.item-guide-card__desc { font-size: clamp(13px, .9vw, 17px); line-height: 1.6; }
.item-guide-card__detail { font-size: clamp(11px, .75vw, 14px); }
.manual-brief article strong { font-size: clamp(14px, .9vw, 18px); }
.manual-brief article span { font-size: clamp(11px, .75vw, 14px); }
.settings-row__copy strong { font-size: clamp(16px, 1.1vw, 21px); }
.settings-row__copy small { font-size: clamp(10px, .72vw, 14px); line-height: 1.5; }
.settings__lead { font-size: clamp(12px, .85vw, 16px); }
.pause__card h2, .result__content h2 { font-size: clamp(36px, 4vw, 62px); }
.pause__card > p, .result__content > p { font-size: clamp(13px, .9vw, 17px); }
.result__stats span { font-size: clamp(11px, .75vw, 14px); }
.result__stats strong { font-size: clamp(20px, 1.5vw, 28px); }
.save-foot-note, .settings__note { font-size: clamp(10px, .72vw, 13px); }
@media (max-width: 900px) {
  .levelup__content { width: min(100%, 94vw); }
  .levelup__head h2 { font-size: clamp(34px, 9vw, 48px); }
  .upgrade-card__name { font-size: 20px; }
  .upgrade-card__desc { font-size: 14px; }
  .codex-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.toast-stack { z-index: 300; }
.settings-toggle.is-unavailable { opacity: .55; }
.stage-select__foot .tank-detail, .stage-roster .section-label, .difficulty-picker .section-label { font-size: clamp(12px, .85vw, 15px); }
@media (max-height: 620px) {
  .sf-cn-title { display: block; font-size: clamp(36px, 6vw, 54px); letter-spacing: .12em; }
}
.result__tag { display: none; }
.result__build span { font-size: clamp(11px, .75vw, 14px); }
.result__actions .text-btn { font-size: clamp(12px, .8vw, 15px); }
.fusion-panel { width: min(1320px, 96vw); }
.fusion-card { padding: 13px 16px; gap: 12px; }
.fusion-card__part small { font-family: var(--font-cn); font-size: clamp(10px, .72vw, 13px); letter-spacing: .06em; }
.fusion-card__part strong { font-size: clamp(13px, .95vw, 17px); margin-top: 3px; }
.fusion-card__plus { font-size: clamp(14px, .9vw, 17px); }
.fusion-card__result { padding-top: 9px; gap: 10px; }
.fusion-card__result strong { font-size: clamp(15px, 1.1vw, 20px); }
.fusion-card__result span { font-size: clamp(11px, .78vw, 14px); line-height: 1.55; }
@media (min-width: 901px) {
  .item-guide-card { flex: 0 0 calc((100% - 40px) / 5); }
}
.fusion-screen .how__panel { width: min(1320px, 96vw); }
.stage-select__foot .tank-detail { display: none; }
.stage-select__foot { justify-content: flex-end; }
.sf-kicker { display: none; }

/* 基地血条：单人与双人共用的核心信息，放大到可一眼读数。 */
.hud-base {
  width: clamp(360px, 26vw, 560px);
  gap: clamp(9px, .55vw, 14px);
  padding: clamp(8px, .5vw, 12px) clamp(12px, .7vw, 17px);
  border-color: rgba(95,240,206,.22);
  background: rgba(5,10,8,.86);
  box-shadow: 0 8px 26px rgba(0,0,0,.32);
}
.hud-base__label,
.hud-base > em { font-size: clamp(13px, .9vw, 18px); }
.hud-base .hud-meter { height: clamp(11px, .8vw, 16px); min-width: 0; background: rgba(237,230,211,.16); }
.hud-base .hud-meter b { box-shadow: 0 0 12px rgba(95,240,206,.24); }
@media (max-width: 1100px) {
  .hud-base { width: min(360px, 32vw); }
}
@media (max-width: 700px) {
  .hud-base { display: none; }
}

/* ================= FIRST DEPLOY TUTORIAL ================= */
.tutorial { z-index: 135; }
.tutorial__panel {
  position: relative;
  width: min(1180px, 94vw);
  max-height: 92svh;
  overflow: auto;
  padding: clamp(24px, 2.6vw, 44px);
  background:
    linear-gradient(155deg, rgba(19,31,25,.99), rgba(5,9,7,.99) 62%),
    radial-gradient(circle at 82% 8%, rgba(255,181,45,.11), transparent 34%);
  border: 1px solid rgba(226,223,201,.22);
  box-shadow: 0 28px 90px rgba(0,0,0,.58), 0 0 0 1px rgba(0,0,0,.45) inset;
  clip-path: var(--cut-lg);
  animation: tutorialIn .34s ease both;
}
.tutorial__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), rgba(255,181,45,.12) 54%, transparent);
}
.tutorial__close { top: 15px; right: 18px; z-index: 2; }
.tutorial__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: clamp(16px, 1.6vw, 24px);
  color: var(--amber);
  font-family: var(--font-display);
  font-size: clamp(8px, .62vw, 10px);
  letter-spacing: .12em;
}
.tutorial__eyebrow i {
  width: 7px; height: 7px;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255,181,45,.75);
  transform: rotate(45deg);
}
.tutorial__head { max-width: 850px; }
.tutorial__kicker {
  display: block;
  color: var(--cyan);
  font-family: var(--font-cn);
  font-size: clamp(11px, .82vw, 14px);
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: 7px;
}
.tutorial__head h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(36px, 4.1vw, 64px);
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.04;
}
.tutorial__head h2 em { color: var(--amber); font-style: normal; }
.tutorial__lead {
  margin: clamp(10px, 1vw, 16px) 0 0;
  color: var(--paper-dim);
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.05vw, 18px);
  line-height: 1.75;
}
.tutorial__lead b { color: var(--cyan); font-weight: 800; }
.tutorial__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 16px);
  margin-top: clamp(20px, 2vw, 30px);
}
.tutorial-step {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(8,15,12,.86);
  border: 1px solid rgba(226,223,201,.16);
  clip-path: var(--cut);
}
.tutorial-step:nth-child(1) { border-color: rgba(255,181,45,.32); }
.tutorial-step:nth-child(2) { border-color: rgba(95,240,206,.28); }
.tutorial-step:nth-child(3) { border-color: rgba(184,150,255,.25); }
.tutorial-step__index {
  position: absolute;
  top: 10px; left: 13px;
  z-index: 1;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .08em;
}
.tutorial-step__art {
  position: relative;
  display: grid;
  place-items: center;
  height: 168px;
  overflow: hidden;
  border-bottom: 1px solid rgba(226,223,201,.1);
  background:
    linear-gradient(rgba(95,240,206,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95,240,206,.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 54%, rgba(95,240,206,.1), transparent 58%),
    #06100c;
  background-size: 22px 22px, 22px 22px, auto, auto;
}
.tutorial-step__art--combat { background-color: #120d08; }
.tutorial-step__art--xp { background-color: #07110e; }
.tutorial-step__art--skills { padding: 12px 10px 8px; }
.tutorial-svg { display: block; width: 100%; height: 100%; }
.tutorial-step__body { padding: 14px 16px 18px; }
.tutorial-step__body > span {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: .1em;
}
.tutorial-step__body h3 {
  margin: 4px 0 5px;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(20px, 1.55vw, 27px);
  font-weight: 800;
  letter-spacing: .04em;
}
.tutorial-step__body p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-cn);
  font-size: clamp(12px, .9vw, 15px);
  line-height: 1.65;
}
.tutorial-step__body p b { color: var(--cyan); font-weight: 700; }
.tutorial-skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.tutorial-skill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 112px;
  padding: 15px 4px 8px;
  background: rgba(7,16,12,.9);
  border: 1px solid rgba(226,223,201,.18);
  clip-path: var(--cut);
}
.tutorial-skill canvas { width: 44px; height: 44px; image-rendering: pixelated; }
.tutorial-skill b {
  margin-top: 3px;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.tutorial-skill small {
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--font-cn);
  font-size: 9px;
}
.tutorial-skill__key {
  position: absolute;
  top: 5px; left: 7px;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 8px;
}
.tutorial-skill--amber { border-color: rgba(255,181,45,.35); }
.tutorial-skill--cyan { border-color: rgba(95,240,206,.3); }
.tutorial-skill--violet { border-color: rgba(184,150,255,.3); }
.tutorial-skill.is-focus {
  background: linear-gradient(180deg, rgba(255,181,45,.14), rgba(7,16,12,.96));
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255,181,45,.18), 0 0 24px rgba(255,181,45,.14);
}
.tutorial-skill-prompt {
  position: absolute;
  left: 50%; bottom: 4px;
  transform: translateX(-50%);
  padding: 2px 8px;
  color: var(--amber);
  background: rgba(5,10,8,.92);
  border: 1px solid rgba(255,181,45,.32);
  font-family: var(--font-cn);
  font-size: 9px;
  white-space: nowrap;
}
.tutorial__goal {
  display: flex;
  align-items: center;
  gap: clamp(7px, .8vw, 13px);
  margin-top: clamp(18px, 1.8vw, 25px);
  padding: 11px 15px;
  color: var(--paper-dim);
  border-top: 1px solid rgba(226,223,201,.12);
  border-bottom: 1px solid rgba(226,223,201,.12);
  background: rgba(255,181,45,.035);
  font-family: var(--font-cn);
  font-size: clamp(11px, .82vw, 14px);
}
.tutorial__goal > span {
  margin-right: auto;
  color: var(--muted-2);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .1em;
}
.tutorial__goal strong { color: var(--paper); font-weight: 700; white-space: nowrap; }
.tutorial__goal i { color: var(--amber); font-style: normal; }
.tutorial__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(16px, 1.6vw, 22px);
}
.tutorial__foot > div { display: flex; flex-direction: column; gap: 2px; }
.tutorial__foot b {
  color: var(--cyan);
  font-family: var(--font-cn);
  font-size: clamp(12px, .9vw, 15px);
  letter-spacing: .05em;
}
.tutorial__foot small { color: var(--muted-2); font-family: var(--font-cn); font-size: 11px; }
@keyframes tutorialIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 900px) {
  .tutorial__panel { padding: 21px 18px 19px; max-height: 94svh; }
  .tutorial__close { top: 10px; right: 11px; }
  .tutorial__head { padding-right: 30px; }
  .tutorial__head h2 { font-size: clamp(31px, 6.2vw, 46px); }
  .tutorial__steps { grid-template-columns: 1fr; gap: 8px; margin-top: 15px; }
  .tutorial-step { display: grid; grid-template-columns: 126px minmax(0, 1fr); }
  .tutorial-step__art { height: 100%; min-height: 128px; border-bottom: 0; border-right: 1px solid rgba(226,223,201,.1); }
  .tutorial-step__body { padding: 11px 13px 13px; }
  .tutorial-step__body h3 { font-size: 20px; }
  .tutorial-step__body p { font-size: 12px; line-height: 1.55; }
  .tutorial-step__art--skills { padding: 7px 5px; }
  .tutorial-skill { min-height: 88px; padding-top: 12px; }
  .tutorial-skill canvas { width: 34px; height: 34px; }
  .tutorial-skill b { font-size: 10px; }
  .tutorial-skill small { display: none; }
  .tutorial-skill-prompt { bottom: 2px; font-size: 8px; }
  .tutorial__goal { flex-wrap: wrap; gap: 7px; margin-top: 13px; padding: 9px 11px; }
  .tutorial__goal > span { flex: 0 0 100%; margin: 0 0 2px; }
}
@media (max-width: 600px) {
  .tutorial__panel { padding: 18px 13px 14px; }
  .tutorial__eyebrow { font-size: 8px; margin-bottom: 12px; }
  .tutorial__head h2 { font-size: clamp(29px, 8vw, 39px); }
  .tutorial__lead { font-size: 12px; line-height: 1.65; }
  .tutorial-step { grid-template-columns: 98px minmax(0, 1fr); }
  .tutorial-step__art { min-height: 112px; }
  .tutorial-step__body { padding: 9px 10px 11px; }
  .tutorial-step__body > span { font-size: 7px; }
  .tutorial-step__body h3 { font-size: 17px; margin: 3px 0 3px; }
  .tutorial-step__body p { font-size: 11px; line-height: 1.45; }
  .tutorial-skill { min-height: 78px; padding: 10px 1px 5px; }
  .tutorial-skill canvas { width: 28px; height: 28px; }
  .tutorial-skill b { font-size: 9px; }
  .tutorial-skill__key { top: 2px; left: 4px; font-size: 7px; }
  .tutorial-skill-prompt { display: none; }
  .tutorial__goal { font-size: 10px; }
  .tutorial__foot { flex-direction: column; align-items: stretch; }
  .tutorial__foot .cta { width: 100%; }
}
/* 局内设置：整行高亮，明确当前正在调整哪一项。 */
.settings-row { transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.settings-row.is-selected,
.settings-row:focus-within {
  border-color: rgba(255,181,45,.78);
  background: rgba(255,181,45,.075);
  box-shadow: inset 3px 0 0 var(--amber), 0 0 0 1px rgba(255,181,45,.12);
}
.settings-row.is-selected .settings-row__copy strong,
.settings-row:focus-within .settings-row__copy strong { color: var(--amber); }
.settings-row.is-selected .settings-toggle,
.settings-row:focus-within .settings-toggle { border-color: rgba(255,181,45,.58); }
.settings-row.is-selected .settings-range,
.settings-row:focus-within .settings-range { filter: drop-shadow(0 0 5px rgba(255,181,45,.25)); }

/* ================= FIRST ITEM TUTORIAL ================= */
.item-tutorial { z-index: 136; }
.item-tutorial__panel { width: min(1240px, 94vw); }
.item-tutorial__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(15px, 1.5vw, 21px);
}
.item-tutorial__card {
  position: relative;
  min-width: 0;
  padding: 12px 12px 11px;
  background: rgba(8,15,12,.88);
  border: 1px solid rgba(226,223,201,.15);
  clip-path: var(--cut);
}
.item-tutorial__card.is-base {
  background: linear-gradient(160deg, rgba(95,240,206,.07), rgba(8,15,12,.94));
  border-color: rgba(95,240,206,.34);
}
.item-tutorial__card header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.item-tutorial__glyph {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--item-color);
  border: 1px solid color-mix(in srgb, var(--item-color) 55%, transparent);
  background: color-mix(in srgb, var(--item-color) 9%, transparent);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
}
.item-tutorial__title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.item-tutorial__title strong {
  overflow: hidden;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(12px, .92vw, 15px);
  font-weight: 700;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-tutorial__title small {
  overflow: hidden;
  color: var(--item-color);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-tutorial__tag {
  margin-left: auto;
  align-self: flex-start;
  color: var(--muted-2);
  font-family: var(--font-cn);
  font-size: 9px;
  white-space: nowrap;
}
.item-tutorial__card.is-base .item-tutorial__tag { color: var(--cyan); }
.item-tutorial__desc {
  margin: 9px 0 0;
  color: var(--paper-dim);
  font-family: var(--font-cn);
  font-size: clamp(11px, .78vw, 13px);
  line-height: 1.55;
}
.item-tutorial__detail {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--font-cn);
  font-size: clamp(9px, .68vw, 11px);
  line-height: 1.5;
}
.item-tutorial__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-top: clamp(14px, 1.4vw, 19px);
  padding: 9px 13px;
  color: var(--muted);
  border-top: 1px solid rgba(95,240,206,.16);
  border-bottom: 1px solid rgba(95,240,206,.16);
  background: rgba(95,240,206,.035);
  font-family: var(--font-cn);
  font-size: clamp(10px, .75vw, 13px);
}
.item-tutorial__note b { color: var(--cyan); font-weight: 700; }
.item-tutorial__note span { color: var(--paper-dim); }
.item-tutorial__note i { color: var(--amber); font-style: normal; font-size: .86em; }
.item-tutorial__note em { margin-left: auto; color: var(--muted-2); font-style: normal; }
@media (max-width: 1100px) {
  .item-tutorial__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .item-tutorial__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-tutorial__title strong { font-size: 13px; }
  .item-tutorial__note em { flex: 0 0 100%; margin-left: 0; }
}
@media (max-width: 600px) {
  .item-tutorial__panel { padding-bottom: 14px; }
  .item-tutorial__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .item-tutorial__card { padding: 9px 9px 8px; }
  .item-tutorial__glyph { flex-basis: 28px; width: 28px; height: 28px; font-size: 17px; }
  .item-tutorial__title strong { font-size: 12px; }
  .item-tutorial__desc { margin-top: 7px; font-size: 10px; line-height: 1.45; }
  .item-tutorial__detail { font-size: 9px; line-height: 1.4; }
  .item-tutorial__tag { font-size: 8px; }
  .item-tutorial__note { gap: 5px 7px; padding: 7px 8px; font-size: 9px; }
}
@media (max-width: 600px) {
  /* Keep the primary action visible while the item cards scroll inside the panel. */
  .item-tutorial__panel { display: flex; flex-direction: column; overflow: hidden; }
  .item-tutorial__panel > .tutorial__eyebrow,
  .item-tutorial__panel > .tutorial__head,
  .item-tutorial__panel > .item-tutorial__note,
  .item-tutorial__panel > .tutorial__foot { flex: 0 0 auto; }
  .item-tutorial__grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,181,45,.35) transparent;
  }
  .item-tutorial__grid::-webkit-scrollbar { width: 4px; }
  .item-tutorial__grid::-webkit-scrollbar-thumb { background: rgba(255,181,45,.35); }
}

/* ================= HOMEPAGE HERO PASS ================= */
.sf-heading {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.sf-brief {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, .8vw, 12px);
  width: 100%;
  margin-top: clamp(18px, 3.5vh, 34px);
}
.sf-brief__item {
  position: relative;
  min-width: 0;
  min-height: 74px;
  padding: 10px 12px 11px;
  border: 1px solid rgba(237,230,211,.14);
  background: linear-gradient(145deg, rgba(12,20,16,.86), rgba(5,9,7,.58));
  clip-path: var(--cut);
}
.sf-brief__item::before {
  content: "";
  position: absolute;
  left: 0; top: 11px; bottom: 11px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber), rgba(255,111,29,.12));
}
.sf-brief__item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--font-cn);
  font-size: clamp(10px, .72vw, 13px);
  letter-spacing: .1em;
}
.sf-brief__item strong {
  display: block;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--font-cn);
  font-size: clamp(18px, 1.45vw, 25px);
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-brief__item em {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--amber);
  font-family: var(--font-cn);
  font-size: clamp(10px, .7vw, 12px);
  font-style: normal;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-showcase::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: clamp(16px, 3vh, 34px);
  width: min(36vw, 510px);
  height: clamp(38px, 6vh, 72px);
  transform: translateX(-50%);
  border: 1px solid rgba(255,181,45,.22);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,181,45,.16), rgba(255,111,29,.05) 48%, transparent 72%);
  box-shadow: 0 0 44px rgba(255,111,29,.10), inset 0 0 24px rgba(255,181,45,.06);
  pointer-events: none;
}
.sf-unit-tag {
  right: 2.5%;
  bottom: 1%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 9px 5px 12px;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, rgba(4,8,6,0), rgba(4,8,6,.72));
  text-align: left;
}
.sf-unit-tag span { font-size: clamp(9px, .62vw, 11px); }
.sf-unit-tag strong { font-size: clamp(18px, 1.3vw, 23px); }
.sf-unit-tag em { font-size: clamp(9px, .62vw, 11px); }
@media (min-width: 821px) {
  .sf-main {
    grid-template-columns: minmax(0, .94fr) minmax(340px, .86fr);
    gap: clamp(28px, 4.6vw, 82px);
    align-items: stretch;
  }
  .sf-heading {
    align-self: stretch;
    padding: clamp(18px, 4.5vh, 54px) 0 clamp(8px, 2.4vh, 26px);
  }
  .sf-cn-title {
    position: relative;
    z-index: 2;
    font-size: clamp(72px, 8.4vw, 150px);
    line-height: .9;
    letter-spacing: .1em;
  }
  .sf-showcase #menuCanvas { height: min(62vh, 620px); }
}
@media (max-width: 820px) {
  .sf-heading { padding: 10px 0 4px; justify-content: center; }
  .sf-cn-title { margin-top: 0; font-size: clamp(52px, 9vw, 78px); line-height: .92; letter-spacing: .06em; }
  .sf-brief { gap: 7px; margin-top: 14px; }
  .sf-brief__item { min-height: 62px; padding: 8px 9px 9px; }
  .sf-brief__item::before { top: 8px; bottom: 8px; }
  .sf-brief__item span { margin-bottom: 3px; font-size: 9px; }
  .sf-brief__item strong { font-size: 16px; }
  .sf-brief__item em { margin-top: 2px; font-size: 9px; }
  .sf-showcase::after { width: min(62vw, 360px); bottom: 4%; }
  .sf-unit-tag { right: 0; bottom: 2%; }
}
@media (max-width: 620px) {
  .sf-unit-tag { display: none; }
  .sf-cn-title { font-size: clamp(44px, 10.2vw, 62px); letter-spacing: .04em; }
  .sf-brief { gap: 5px; margin-top: 10px; }
  .sf-brief__item { min-height: 54px; padding: 6px 7px 7px; }
  .sf-brief__item span { font-size: 8px; letter-spacing: .04em; }
  .sf-brief__item strong { font-size: 12px; }
  .sf-brief__item em { font-size: 8px; }
  .sf-showcase::after { width: 72vw; height: 34px; bottom: 2%; }
}
@media (max-height: 620px) {
  .sf-brief { display: none; }
}
.sf-showcase #menuCanvas {
  -webkit-mask-image: radial-gradient(ellipse 62% 66% at 50% 56%, #000 45%, rgba(0,0,0,.88) 65%, transparent 94%);
  mask-image: radial-gradient(ellipse 62% 66% at 50% 56%, #000 45%, rgba(0,0,0,.88) 65%, transparent 94%);
}

/* Quick actions live directly under each pilot's corner HUD. */
.hud-pilot__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(237,230,211,.12);
  pointer-events: none;
}
.hud-quick {
  position: relative;
  min-width: 0;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 7px;
  border: 1px solid rgba(237,230,211,.13);
  background: linear-gradient(145deg, rgba(10,19,15,.82), rgba(4,9,7,.66));
  overflow: hidden;
}
.hud-quick--recall {
  pointer-events: auto;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.hud-quick--recall:hover:not(:disabled) {
  border-color: rgba(95,240,206,.55);
  background: rgba(95,240,206,.07);
}
.hud-quick--recall:disabled { cursor: default; opacity: .62; }
.hud-quick--recall.is-cooling .hud-quick__icon { color: var(--muted-2); border-color: var(--line-strong); }
.hud-quick--recall.is-cooling .hud-quick__meter b { background: var(--amber); }
.hud-quick__icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(95,240,206,.3);
  color: var(--cyan);
}
.hud-quick__icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.hud-quick__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hud-quick__copy small {
  font-family: var(--font-cn);
  font-size: 9px;
  line-height: 1;
  color: var(--muted-2);
  letter-spacing: .06em;
}
.hud-quick__copy strong {
  overflow: hidden;
  font-family: var(--font-cn);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--paper-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hud-quick__meter {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 3px;
  height: 2px;
  background: rgba(237,230,211,.1);
}
.hud-quick__meter b {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  transition: width .12s linear;
}
.hud-pilot__actions--p2 { border-top-color: rgba(95,240,206,.18); }
@media (max-width: 820px) {
  .hud-pilot__actions { gap: 4px; margin-top: 5px; padding-top: 5px; }
  .hud-quick { height: 34px; gap: 4px; padding: 3px 4px 5px; }
  .hud-quick__icon { width: 21px; height: 21px; flex-basis: 21px; }
  .hud-quick__icon svg { width: 13px; height: 13px; }
  .hud-quick__copy small { font-size: 8px; }
  .hud-quick__copy strong { font-size: 10px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .hud-pilot__actions { gap: 3px; margin-top: 4px; padding-top: 4px; }
  .hud-quick { height: 30px; gap: 3px; padding: 2px 3px 4px; }
  .hud-quick__icon { width: 18px; height: 18px; flex-basis: 18px; }
  .hud-quick__icon svg { width: 12px; height: 12px; }
  .hud-quick__copy small { display: block; font-size: 7px; }
  .hud-quick__copy strong { font-size: 8px; }
  .hud-quick__meter { left: 3px; right: 3px; bottom: 2px; }
}
/* Keep the corner HUDs inside the battlefield on narrow screens after the
   large-display clamp above; the quick actions must not collide. */
@media (max-width: 820px) {
  .hud-pilot { width: 220px; }
}
@media (max-width: 620px) and (orientation: portrait) {
  .hud-pilot { width: 166px; }
}

/* Tutorial confirmation gate: never start with the confirm action selected. */
.confirm-gate {
  transition: opacity .16s ease, filter .16s ease, box-shadow .16s ease;
}
.confirm-gate:not(.is-armed) {
  opacity: .58;
  filter: saturate(.5);
}
.confirm-gate.is-armed {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16), 0 0 18px rgba(95, 240, 206, .22);
}
.confirm-gate__hint {
  margin: 8px 0 0;
  color: rgba(200, 226, 214, .72);
  font-family: var(--font-cn);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .05em;
  text-align: center;
}
.confirm-gate__hint.is-armed {
  color: var(--cyan);
}
