:root {
  --bg-void: #12192b;
  --bg-panel: rgba(16, 24, 42, 0.94);
  --bg-elev: #101b30;
  --bg-slot: rgba(11, 19, 35, 0.92);
  --line-subtle: rgba(56, 189, 248, 0.28);
  --line-bright: #22d3ee;
  --line-gold: #fbbf24;
  --text-main: #f2f7ff;
  --text-sec: #b6cbe6;
  --text-dim: #8ca6c8;
  --cyan: #22d3ee;
  --emerald: #34d399;
  --gold: #fbbf24;
  --crimson: #fb7185;
  --violet: #c084fc;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bevel-panel: inset 0 2px 0 rgba(186, 230, 253, 0.14), inset 0 -2px 0 rgba(2, 5, 12, 0.88), 0 20px 48px rgba(0, 0, 0, 0.74);
  --bevel-card: inset 0 2px 0 rgba(186, 230, 253, 0.12), inset 0 -2px 0 rgba(2, 5, 12, 0.82), 0 10px 24px rgba(0, 0, 0, 0.52);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

.hidden {
  display: none !important;
}

.app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-void);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.pixel-icon,
.hero-bot-preview {
  display: block;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* ==================== TOP 16-BIT ARCADE CONTROL BAR ==================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 52px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.94) 0%, rgba(6, 10, 20, 0.62) 80%, transparent 100%);
  pointer-events: none;
}

.top-left,
.top-center,
.top-right {
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 11px;
  border-radius: 2px;
  border: 2px solid var(--line-subtle);
  background: #0b1426;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.7);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.nav-pill:hover {
  color: var(--cyan);
  border-color: var(--line-bright);
}

.nav-pill:active {
  transform: translateY(2px);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: 2px;
  background: rgba(11, 20, 38, 0.86);
  border: 2px solid rgba(56, 189, 248, 0.18);
}

.core-dot {
  width: 7px;
  height: 7px;
  background: var(--cyan);
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text-main);
}

.ver-tag {
  padding: 1px 5px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.top-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  gap: 8px;
}

.wave-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 2px;
  background: #0a1324;
  border: 2px solid var(--line-bright);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.75);
  font-size: 13px;
}

.wave-label {
  color: var(--text-sec);
  font-weight: 700;
}

.wave-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.endless-badge {
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid var(--line-gold);
  color: #fef08a;
  font-size: 11px;
  font-weight: 800;
}

.timer-readout {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 2px;
  background: #0a1324;
  border: 2px solid var(--line-subtle);
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 2px;
  border: 2px solid var(--line-subtle);
  background: #0b1426;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.75);
  color: var(--text-main);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.08s ease;
}

.ctrl-btn:hover {
  border-color: var(--line-bright);
  background: #12203a;
}

.ctrl-btn:active {
  transform: translateY(2px);
}

.ctrl-btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.icon-btn {
  width: 34px;
  padding: 0;
}

.lang-btn {
  font-family: var(--mono);
  font-weight: 800;
  min-width: 44px;
}

.auto-btn .status-led {
  width: 7px;
  height: 7px;
  background: var(--text-dim);
}

.auto-btn.is-active {
  border-color: var(--emerald);
  background: #0c2e28;
  color: #d1fae5;
}

.auto-btn.is-active .status-led {
  background: var(--emerald);
}

/* ==================== IN-RUN COMBAT HUD ==================== */
.hud-layer {
  position: fixed;
  inset: 52px 0 0 0;
  z-index: 20;
  pointer-events: none;
}

.hud-status-panel {
  position: absolute;
  top: 6px;
  left: max(12px, env(safe-area-inset-left));
  width: min(276px, 58vw);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-track {
  position: relative;
  flex: 1;
  height: 19px;
  border-radius: 2px;
  background: #070d19;
  border: 2px solid rgba(56, 189, 248, 0.36);
  overflow: hidden;
}

.xp-track {
  height: 16px;
}

.bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  transition: width 0.12s ease-out;
}

.hp-fill {
  background: #10b981;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28);
}

.hp-fill.is-low {
  background: #f43f5e;
}

.shield-fill {
  background: rgba(56, 189, 248, 0.56);
  border-right: 2px solid #e0f2fe;
}

.xp-fill {
  background: #0ea5e9;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.bar-label {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  line-height: 15px;
  padding: 0 7px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1px 1px 0 #04070e;
  font-variant-numeric: tabular-nums;
}

.xp-track .bar-label {
  line-height: 12px;
  font-size: 10.5px;
}

.revive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: rgba(251, 191, 36, 0.2);
  border: 2px solid var(--line-gold);
  color: var(--gold);
}

.slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.module-slots {
  display: flex;
  gap: 4px;
}

.slot-cell {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: var(--bg-slot);
  border: 2px solid rgba(56, 189, 248, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-cell .pixel-icon {
  width: 22px;
  height: 22px;
}

.passive-row .slot-cell {
  width: 29px;
  height: 29px;
}

.passive-row .slot-cell .pixel-icon {
  width: 18px;
  height: 18px;
}

.slot-cell.is-filled {
  border-color: rgba(56, 189, 248, 0.62);
}

.slot-cell.is-evolved {
  border-color: var(--gold);
  background: #2b1d06;
}

.slot-lv {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000;
}

.slot-cell.is-evolved .slot-lv {
  color: #fef08a;
}

.hud-metrics {
  position: absolute;
  top: 6px;
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 9px;
  border-radius: 2px;
  background: rgba(9, 15, 28, 0.9);
  border: 2px solid var(--line-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}

.metric-chip strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.metric-chip.gold-chip strong {
  color: var(--gold);
}

/* Boss HUD */
.boss-hud {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 86vw);
  padding: 7px 11px;
  border-radius: 2px;
  background: rgba(22, 9, 18, 0.94);
  border: 2px solid #fb7185;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.68);
}

.boss-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 13px;
}

.boss-code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgba(244, 63, 94, 0.28);
  border: 1px solid #fda4af;
  color: #ffe4e6;
}

.boss-hp-nums {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-sec);
  font-variant-numeric: tabular-nums;
}

.boss-bar-track {
  height: 10px;
  border-radius: 2px;
  background: #07060a;
  overflow: hidden;
  border: 1px solid rgba(251, 113, 133, 0.5);
}

.boss-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e11d48, #fb7185, #fbbf24);
  transition: width 0.1s linear;
}

/* Toast Alert */
.toast-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 2px;
  background: rgba(10, 17, 32, 0.96);
  border: 2px solid var(--line-bright);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
  animation: toastEnter 0.24s var(--ease-expo);
}

.toast-banner.is-warn {
  border-color: var(--crimson);
  color: #ffe4e6;
}

.toast-banner.is-gold {
  border-color: var(--gold);
  color: #fef08a;
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Bottom-Right Side-by-Side Arcade Buttons: Jump + Dash */
.action-cluster {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.arcade-action-btn {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 3px;
  border: 2px solid var(--line-bright);
  background: rgba(10, 20, 36, 0.9);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), inset 0 -4px 0 rgba(0, 0, 0, 0.72), 0 12px 26px rgba(0, 0, 0, 0.6);
  color: var(--cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  transition: transform 0.07s ease, border-color 0.14s ease;
}

.jump-btn {
  border-color: var(--emerald);
  color: var(--emerald);
}

.jump-btn:hover {
  border-color: #6ee7b7;
}

.dash-btn:hover {
  border-color: #67e8f9;
}

.arcade-action-btn:active {
  transform: translateY(3px);
}

.dash-btn.on-cd {
  border-color: rgba(140, 166, 200, 0.34);
  color: var(--text-dim);
}

.dash-cd-fill {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.78);
  transform-origin: bottom center;
  pointer-events: none;
}

.arcade-action-btn svg,
.action-key {
  position: relative;
  z-index: 2;
}

.action-key {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main);
}

.is-touch .arcade-action-btn {
  width: 82px;
  height: 82px;
}

/* ==================== OVERLAY SCREENS & 16-BIT MODALS ==================== */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 64px 16px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop {
  background: rgba(4, 8, 15, 0.82);
}

.menu-shell {
  width: min(1060px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: stretch;
  animation: panelReveal 0.28s var(--ease-expo);
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-hero-pane,
.menu-talent-pane {
  background: var(--bg-panel);
  border: 2px solid var(--line-subtle);
  border-radius: 3px;
  padding: 24px;
  box-shadow: var(--bevel-panel);
}

.menu-hero-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.hero-bot-preview {
  box-sizing: content-box;
  width: 60px;
  height: 66px;
  flex-shrink: 0;
  background: #070d1a;
  border: 2px solid rgba(34, 211, 238, 0.45);
  border-radius: 2px;
}

.display-title {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text-main);
}

.subtitle-code {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--cyan);
}

.hero-copy {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--text-sec);
  max-width: 64ch;
}

.career-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.career-stat {
  padding: 10px 12px;
  border-radius: 2px;
  background: #0d172a;
  border: 2px solid rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.career-stat span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
}

.career-stat strong {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.start-cta-row {
  margin-bottom: 4px;
}

.primary-launch-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 3px;
  border: 2px solid #a5f3fc;
  background: #22d3ee;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 #0e7490, 0 10px 26px rgba(34, 211, 238, 0.28);
  color: #041019;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.08s ease;
}

.primary-launch-btn:hover {
  background: #38bdf8;
}

.primary-launch-btn:active {
  transform: translateY(2px);
}

.gold-launch-btn {
  border-color: #fef08a;
  background: #fbbf24;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 0 #b45309, 0 10px 26px rgba(251, 191, 36, 0.3);
}

.gold-launch-btn:hover {
  background: #fcd34d;
}

.evo-formula-box {
  padding: 12px 14px;
  border-radius: 2px;
  background: #0c1526;
  border: 2px solid rgba(251, 191, 36, 0.34);
  margin-bottom: 12px;
}

.section-mini-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fde047;
}

.evo-formula-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.evo-pair-item {
  font-size: 12.5px;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.evo-pair-item strong {
  color: #fef08a;
  font-weight: 800;
}

.controls-footnote {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* Permanent Talent Hangar */
.talent-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pane-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 900;
}

.pane-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-sec);
}

.wallet-box {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 2px;
  background: #271b05;
  border: 2px solid var(--line-gold);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wallet-label {
  font-size: 11px;
  font-weight: 700;
  color: #fde68a;
}

.wallet-amount {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.talent-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.talent-row {
  padding: 10px 12px;
  border-radius: 2px;
  background: #0d172a;
  border: 2px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.14s ease;
}

.talent-row:hover {
  border-color: rgba(56, 189, 248, 0.48);
}

.talent-info {
  min-width: 0;
  flex: 1;
}

.talent-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.talent-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.talent-bonus-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cyan);
}

.talent-desc {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-sec);
}

.talent-pips {
  display: flex;
  gap: 4px;
}

.talent-pip {
  width: 18px;
  height: 6px;
  background: rgba(140, 166, 200, 0.22);
}

.talent-pip.is-on {
  background: var(--cyan);
}

.talent-buy-btn {
  flex-shrink: 0;
  min-width: 86px;
  height: 36px;
  padding: 0 12px;
  border-radius: 2px;
  border: 2px solid var(--line-gold);
  background: #2b1e07;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.7);
  color: #fef08a;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.08s ease;
}

.talent-buy-btn:hover:not(:disabled) {
  background: #3f2c0a;
}

.talent-buy-btn:active:not(:disabled) {
  transform: translateY(2px);
}

.talent-buy-btn:disabled {
  border-color: rgba(140, 166, 200, 0.22);
  background: #0a1220;
  color: var(--text-dim);
  cursor: not-allowed;
}

.talent-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ghost-sm-btn {
  padding: 6px 12px;
  border-radius: 2px;
  border: 2px solid var(--line-subtle);
  background: #0b1426;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-sm-btn:hover {
  color: var(--text-main);
  border-color: var(--line-bright);
}

.ghost-sm-btn:active {
  transform: translateY(2px);
}

.talent-feedback {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}

/* ==================== UPGRADE 3-CHOICE MODAL ==================== */
.upgrade-dialog {
  width: min(880px, 100%);
  margin: auto;
  padding: 24px;
  border-radius: 3px;
  background: var(--bg-panel);
  border: 2px solid var(--line-bright);
  box-shadow: var(--bevel-panel);
  animation: panelReveal 0.22s var(--ease-expo);
}

.upgrade-head {
  text-align: center;
  margin-bottom: 18px;
}

.upgrade-head h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 900;
  color: var(--text-main);
}

.upgrade-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sec);
}

.auto-pick-bar {
  margin: 10px auto 0;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}

.auto-pick-track {
  height: 6px;
  background: rgba(52, 211, 153, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.auto-pick-fill {
  height: 100%;
  width: 0%;
  background: var(--emerald);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.up-card {
  position: relative;
  text-align: left;
  padding: 16px;
  border-radius: 3px;
  background: #0e192d;
  border: 2px solid rgba(56, 189, 248, 0.36);
  box-shadow: var(--bevel-card);
  color: var(--text-main);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.08s ease;
}

.up-card:hover {
  border-color: var(--cyan);
  background: #13223d;
}

.up-card:active {
  transform: translateY(2px);
}

.up-card.is-evo {
  background: #271b06;
  border-color: var(--gold);
}

.up-card.is-evo:hover {
  border-color: #fef08a;
  background: #332308;
}

.up-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.up-type-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.42);
  color: var(--cyan);
}

.up-card.is-passive .up-type-tag {
  background: rgba(192, 132, 252, 0.18);
  border-color: rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
}

.up-card.is-evo .up-type-tag {
  background: rgba(251, 191, 36, 0.25);
  border-color: var(--gold);
  color: #fef08a;
}

.up-hotkey {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-sec);
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid rgba(182, 203, 230, 0.3);
}

.up-icon-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.up-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 2px;
  background: #070d19;
  border: 2px solid rgba(56, 189, 248, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.up-icon-box .pixel-icon {
  width: 32px;
  height: 32px;
}

.up-name {
  margin: 0;
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.25;
}

.up-lv-step {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--emerald);
}

.up-card.is-evo .up-lv-step {
  color: var(--gold);
}

.up-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.54;
  color: var(--text-sec);
  flex: 1;
}

.up-synergy {
  padding-top: 8px;
  border-top: 1px solid rgba(182, 203, 230, 0.16);
  font-size: 11.5px;
  color: var(--text-dim);
}

.up-synergy.is-ready {
  color: #fde047;
  font-weight: 700;
}

/* ==================== COMPACT & SUMMARY DIALOGS ==================== */
.compact-dialog,
.summary-dialog {
  width: min(530px, 100%);
  margin: auto;
  padding: 24px;
  border-radius: 3px;
  background: var(--bg-panel);
  border: 2px solid var(--line-bright);
  box-shadow: var(--bevel-panel);
  animation: panelReveal 0.24s var(--ease-expo);
}

.victory-dialog {
  border-color: var(--gold);
}

.compact-dialog h2,
.summary-title {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
}

.gold-heading {
  color: var(--gold);
}

.dialog-desc,
.summary-reason {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-sec);
}

.dialog-actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-action-btn {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 3px;
  border: 2px solid var(--line-bright);
  background: #101d34;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.7);
  color: var(--text-main);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action-btn:hover {
  background: #162847;
}

.secondary-action-btn:active {
  transform: translateY(2px);
}

.danger-ghost-btn {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 3px;
  border: 2px solid rgba(251, 113, 133, 0.55);
  background: rgba(68, 16, 28, 0.45);
  color: #fecdd3;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.danger-ghost-btn:active {
  transform: translateY(2px);
}

.pause-arsenal-wrap,
.sum-build-section {
  margin-bottom: 16px;
}

.mini-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sec);
}

.pause-arsenal-list,
.sum-weapon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.build-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 2px;
  background: #0e182b;
  border: 1px solid var(--line-subtle);
  font-size: 12.5px;
  font-weight: 700;
}

.build-pill .pixel-icon {
  width: 16px;
  height: 16px;
}

.build-pill.is-gold {
  border-color: var(--gold);
  background: #2b1d06;
  color: #fef08a;
}

.summary-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.sum-stat-item {
  padding: 10px 13px;
  border-radius: 2px;
  background: #0d172a;
  border: 2px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sum-stat-item span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sec);
}

.sum-stat-item strong {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.earned-banner {
  padding: 11px 15px;
  border-radius: 2px;
  background: #281b06;
  border: 2px solid var(--line-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.earned-banner span {
  font-size: 13.5px;
  font-weight: 800;
  color: #fde68a;
}

.earned-banner strong {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-card-btn {
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 3px;
  border: 2px solid var(--line-gold);
  background: #332308;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.75);
  color: #fef08a;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.08s ease;
}

.share-card-btn:hover {
  background: #45300b;
}

.share-card-btn:active {
  transform: translateY(2px);
}

.summary-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.summary-sub-actions .primary-launch-btn {
  min-height: 46px;
  font-size: 15px;
}

/* ==================== RESPONSIVE ADAPTATION ==================== */
@media (max-width: 900px) {
  .menu-shell {
    grid-template-columns: 1fr;
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .up-card {
    padding: 14px;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .brand-badge {
    display: none;
  }

  .top-center {
    position: static;
    transform: none;
    gap: 5px;
  }

  .wave-label {
    display: none;
  }

  .menu-hero-pane,
  .menu-talent-pane,
  .upgrade-dialog,
  .summary-dialog,
  .compact-dialog {
    padding: 16px;
  }

  .boss-hud {
    top: 112px;
    width: min(360px, 92vw);
  }

  .toast-banner {
    top: 168px;
    font-size: 12px;
    max-width: 92vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .arcade-action-btn {
    width: 72px;
    height: 72px;
  }

  .is-touch .arcade-action-btn {
    width: 76px;
    height: 76px;
  }

  .summary-stats-row,
  .summary-sub-actions {
    grid-template-columns: 1fr;
  }
}
