:root {
  color-scheme: dark;
  --bg-deep: #090b12;
  --bg-panel: #0e121e;
  --bg-card: rgba(16, 21, 34, 0.9);
  --bg-elevated: rgba(23, 29, 46, 0.94);
  --border: rgba(148, 168, 224, 0.2);
  --border-strong: rgba(226, 234, 255, 0.34);
  --text-main: #f3f6ff;
  --text-muted: #98a4c6;
  --pink: #ff4d6d;
  --cyan: #4ce8ff;
  --gold: #ffd166;
  --green: #3bf08c;
  --red: #ff4d5e;
  --purple: #b87dff;

  --hero-accent: #ff4d6d;
  --hero-accent-2: #ff7a59;
  --hero-soft: rgba(255, 77, 109, 0.16);
  --hero-glow: rgba(255, 77, 109, 0.34);
  --hero-text: #ff9eb0;

  --font-display: "Bahnschrift", "DIN Condensed", "Segoe UI", "PingFang SC", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --chamfer-xs: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  --chamfer-sm: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  --chamfer-md: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  --chamfer-tab: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

#app-shell[data-hero="akane"] {
  --hero-accent: #ff4d6d;
  --hero-accent-2: #ff7a59;
  --hero-soft: rgba(255, 77, 109, 0.16);
  --hero-glow: rgba(255, 77, 109, 0.36);
  --hero-text: #ff9cb0;
}

#app-shell[data-hero="luna"] {
  --hero-accent: #7f8eff;
  --hero-accent-2: #4ce8ff;
  --hero-soft: rgba(127, 142, 255, 0.18);
  --hero-glow: rgba(127, 142, 255, 0.34);
  --hero-text: #c2ccff;
}

#app-shell[data-hero="vivi"] {
  --hero-accent: #ff4fa3;
  --hero-accent-2: #3bf0c2;
  --hero-soft: rgba(255, 79, 163, 0.18);
  --hero-glow: rgba(59, 240, 194, 0.3);
  --hero-text: #9efce6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Slim Dark Tactical Scrollbar */
*::-webkit-scrollbar {
  width: 5px;
  height: 4px;
}
*::-webkit-scrollbar-track {
  background: rgba(9, 11, 18, 0.72);
  border-left: 1px solid rgba(148, 168, 224, 0.08);
}
*::-webkit-scrollbar-thumb {
  background: rgba(148, 168, 224, 0.3);
  border-radius: 1px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--hero-accent);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 168, 224, 0.34) rgba(9, 11, 18, 0.72);
  }
}

html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--app-h, 100dvh);
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

#app-shell {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: var(--bg-deep);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.screen.active {
  display: flex;
}

/* ================= TOP BAR & PROGRESS ================= */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: calc(7px + env(safe-area-inset-top, 0px)) 10px 7px;
  background: rgba(10, 12, 20, 0.94);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brand-star {
  width: 15px;
  height: 15px;
  color: var(--hero-accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--hero-glow));
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.8px;
  white-space: nowrap;
  color: var(--text-main);
}

.badge-t {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  clip-path: var(--chamfer-xs);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.currency-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.story-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-left: 2px solid var(--hero-accent);
  color: var(--text-main);
  padding: 5px 10px;
  clip-path: var(--chamfer-xs);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.story-btn:hover {
  background: var(--hero-soft);
}

.coin-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 209, 102, 0.1);
  border-bottom: 1px solid rgba(255, 209, 102, 0.45);
  padding: 3px 9px;
  clip-path: var(--chamfer-xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-size: 14px;
}

.coin-dot {
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.7);
}

.ui-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08em;
  height: 1.08em;
  vertical-align: -0.16em;
  flex-shrink: 0;
}
.ui-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ui-ico.tiny-ico {
  width: 9px;
  height: 9px;
  vertical-align: -0.05em;
}
.skill-node-svg {
  width: 19px;
  height: 19px;
  vertical-align: 0;
}
.skill-node.is-keystone .skill-node-svg {
  width: 22px;
  height: 22px;
}

.icon-btn,
.icon-btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
}
.icon-btn { width: 31px; height: 31px; font-size: 14px; }
.icon-btn-sm { width: 30px; height: 30px; font-size: 13.5px; }

/* Mainline Progress Strip */
.mainline-banner {
  background: rgba(12, 15, 25, 0.92);
  border-bottom: 1px solid var(--border);
  padding: 4px 10px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.mainline-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mainline-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rank-badge {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  padding: 1px 7px;
  clip-path: var(--chamfer-xs);
  background: var(--hero-soft);
  color: var(--hero-text);
  border-left: 2px solid var(--hero-accent);
  flex-shrink: 0;
}
.mainline-stage-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mainline-xp-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.mainline-xp-bg {
  width: 56px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.mainline-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hero-accent), var(--hero-accent-2));
  transition: width 0.25s ease;
}
.mainline-xp-text {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mainline-next-goal {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slanted Tactical Tab Strip */
.tab-bar {
  display: flex;
  align-items: stretch;
  background: rgba(11, 14, 24, 0.96);
  border-bottom: 1px solid var(--border);
  padding: 3px 3px;
  gap: 1px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 7px 3px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.tab-btn:not(:last-child)::after {
  content: "/";
  position: absolute;
  right: -1px;
  color: rgba(148, 168, 224, 0.22);
  font-size: 11px;
  pointer-events: none;
}
.tab-btn.active {
  color: #fff;
  background: linear-gradient(105deg, var(--hero-accent), var(--hero-accent-2));
  clip-path: var(--chamfer-tab);
  padding-inline: 5px;
}
.tab-btn.active::after {
  display: none;
}
.tab-btn.active::before {
  content: "»";
  font-size: 11px;
  opacity: 0.9;
}
.tab-btn.locked-tab {
  color: #5f6888;
}

.ready-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  pointer-events: none;
  animation: pulseReady 1.8s ease-in-out infinite;
}

.mini-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10.5px;
  padding: 1px 4px;
  border-radius: 2px;
}
.tab-btn.active .mini-pill {
  background: rgba(9, 11, 18, 0.55);
  color: #fff;
}
.mini-pill.gold-pill {
  background: rgba(255, 209, 102, 0.16);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.4);
}

/* Panels */
.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 10px 10px calc(54px + env(safe-area-inset-bottom, 0px));
  flex-direction: column;
  gap: 8px;
}
.tab-panel.active {
  display: flex;
}
#tab-deploy.tab-panel {
  padding-top: 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  gap: 6px;
  background: linear-gradient(180deg, rgba(9, 11, 18, 0) 0%, rgba(9, 11, 18, 0.94) 54%, #090b12 100%);
}
.tab-panel > *,
.market-unlocked-board > * {
  flex-shrink: 0;
}

.section-label {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--hero-text);
  letter-spacing: 0.6px;
}

.muted-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ================= DEPLOY HERO STAGE (PLAN A SHOWCASE) ================= */
.hero-stage-v2 {
  position: relative;
  margin: 0 -10px;
  height: clamp(188px, 27.5vh, 224px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #090b12;
  flex-shrink: 0;
}

.stage-bg-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 11, 18, 0.86) 0%, rgba(9, 11, 18, 0.25) 45%, rgba(9, 11, 18, 0.6) 100%),
    linear-gradient(180deg, rgba(9, 11, 18, 0.16) 0%, rgba(9, 11, 18, 0.34) 55%, rgba(9, 11, 18, 0.98) 100%),
    url("./assets/backgrounds/salvage-workshop.webp") center 16% / cover no-repeat;
  z-index: 0;
}

.stage-ambient-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, var(--hero-glow) 0%, transparent 62%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.015) 0 4px, transparent 4px 12px);
  pointer-events: none;
  z-index: 1;
}

.stage-watermark {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: 46%;
  font-family: var(--font-display);
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 900;
  font-style: italic;
  line-height: 1.08;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  white-space: pre-line;
  color: rgba(240, 245, 255, 0.36);
  border-left: 3px solid var(--hero-accent);
  padding-left: 7px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 4;
}

.portrait-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.portrait-img {
  height: 112%;
  width: auto;
  max-width: 78%;
  object-fit: contain;
  object-position: top center;
  transform: translateX(4%);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.72));
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.75) 14%, #000 24%, #000 76%, rgba(0, 0, 0, 0.75) 88%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 66%, transparent 98%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.75) 14%, #000 24%, #000 76%, rgba(0, 0, 0, 0.75) 88%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 66%, transparent 98%);
  mask-composite: intersect;
}

.portrait-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
}
.portrait-fallback canvas {
  width: 84px;
  height: 84px;
  image-rendering: pixelated;
}

.hero-stage-v2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54%;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 11, 18, 0.78) 60%, rgba(9, 11, 18, 0.98) 100%);
  pointer-events: none;
  z-index: 3;
}

.hero-info {
  position: absolute;
  left: 10px;
  right: 76px;
  bottom: 7px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hero-name-row h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skin-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  padding: 1px 6px;
  clip-path: var(--chamfer-xs);
  background: var(--hero-soft);
  color: var(--hero-text);
  border-left: 2px solid var(--hero-accent);
  flex-shrink: 0;
}

.stage-hero-desc {
  font-size: 12.5px;
  line-height: 1.38;
  color: rgba(235, 240, 255, 0.86);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-stats-mini {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.hero-stats-mini > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(9, 11, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 1px 5px;
  border-radius: 2px;
}

/* Right Floating Vertical Action Rail */
.stage-side-rail {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 66px;
}

.rail-btn {
  background: rgba(11, 14, 24, 0.82);
  backdrop-filter: blur(6px);
  border: none;
  border-right: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--text-main);
  clip-path: var(--chamfer-sm);
  padding: 5px 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rail-btn:hover,
.rail-btn.dossier-btn {
  border-right-color: var(--hero-accent);
}
.rail-btn:active {
  transform: scale(0.96);
}
.rail-btn.wardrobe-rail-btn {
  border-right-color: #ff6eb8;
  color: #ffe8f6;
}
.rail-btn.wardrobe-rail-btn .rail-ico {
  color: #ff85c0;
}
.rail-ico {
  font-size: 14px;
  line-height: 1;
}

.rail-pixel-widget {
  background: rgba(11, 14, 24, 0.84);
  backdrop-filter: blur(6px);
  border-right: 2px solid rgba(76, 232, 255, 0.55);
  clip-path: var(--chamfer-sm);
  padding: 4px 3px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rail-pixel-preview {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
  padding: 0;
}
#preview-canvas {
  width: 42px;
  height: 44px;
  image-rendering: pixelated;
}
.rail-sub {
  font-size: 11.5px;
  line-height: 1;
  color: var(--text-muted);
}

.demo-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
}
.anim-demo-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-muted);
  border-radius: 2px;
  padding: 3px 0;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.anim-demo-btn.active {
  background: var(--hero-accent);
  color: #fff;
}

/* ================= DEPLOY LOWER TACTICAL DOCK ================= */
.deploy-dock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.deploy-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}
.section-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Hero Selector: 3 Cropped Portrait Chips */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.select-card {
  position: relative;
  height: 68px;
  background: #101423;
  border: 1px solid rgba(148, 168, 224, 0.22);
  clip-path: var(--chamfer-sm);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, border-color 0.15s;
}
.select-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 11, 18, 0.08) 0%, rgba(9, 11, 18, 0.36) 44%, rgba(9, 11, 18, 0.96) 86%);
  pointer-events: none;
}
.select-card:hover {
  border-color: var(--border-strong);
}
.select-card.selected {
  border-color: var(--card-accent, var(--hero-accent));
  box-shadow: inset 0 0 0 1px var(--card-accent, var(--hero-accent)), 0 0 14px var(--hero-soft);
}
.select-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-accent, var(--hero-accent));
  z-index: 3;
}

.hero-chip-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  opacity: 0.72;
  transition: opacity 0.15s, transform 0.2s;
}
.select-card.selected .hero-chip-portrait {
  opacity: 0.96;
  transform: scale(1.03);
}
.hero-chip-fallback {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  display: block;
  margin: 2px auto 0;
}

.hero-chip-index {
  position: absolute;
  top: 3px;
  left: 5px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(9, 11, 18, 0.78);
  padding: 0 4px;
  border-left: 2px solid var(--card-accent, var(--hero-accent));
}

.hero-chip-footer {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  z-index: 2;
}
.select-card .card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-card .card-sub {
  font-size: 11.5px;
  color: rgba(212, 222, 248, 0.85);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared Secondary Tab Tactical Banner & Corner Accent Chrome */
.tab-hero-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 10px 100%);
  background: linear-gradient(95deg, rgba(76, 232, 255, 0.28) 0%, rgba(18, 26, 44, 0.94) 68%);
  border-left: 4px solid var(--cyan);
  overflow: hidden;
}
.tab-hero-strip::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 68px;
  background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0.09) 0 6px, transparent 6px 12px);
  pointer-events: none;
}
.tab-hero-strip.codex-strip {
  background: linear-gradient(95deg, rgba(255, 77, 109, 0.3) 0%, rgba(16, 20, 34, 0.95) 68%);
  border-left-color: var(--pink);
}
.tab-hero-strip.market-strip {
  background: linear-gradient(95deg, rgba(76, 232, 255, 0.28) 0%, rgba(14, 20, 32, 0.95) 68%);
  border-left-color: var(--cyan);
}
.tab-hero-strip.upgrades-strip {
  background: linear-gradient(95deg, rgba(127, 142, 255, 0.32) 0%, rgba(15, 19, 34, 0.95) 68%);
  border-left-color: #7f8eff;
}
.tab-hero-strip.shop-strip {
  background: linear-gradient(95deg, rgba(255, 79, 163, 0.3) 0%, rgba(255, 209, 102, 0.14) 52%, rgba(16, 18, 30, 0.96) 86%);
  border-left-color: #ff4fa3;
}
.tab-hero-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.8px;
  color: #e9f2ff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.tab-hero-title span {
  color: #fff;
  font-style: normal;
  margin-left: 2px;
}
.tab-hero-ticks {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.42);
  position: relative;
  z-index: 1;
}

/* Zone Selector: 2-Card Scrollable Viewport Without Visible Scrollbar */
.zone-scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--cyan);
  opacity: 0.86;
  letter-spacing: 0.3px;
}
.zone-scroll-hint .ui-ico {
  width: 13px;
  height: 13px;
  vertical-align: 0;
}
.zone-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  cursor: grab;
  scroll-snap-type: y proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.zone-list.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.zone-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.zone-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 6px 10px 6px 9px;
  background-color: #101422;
  background-position: right center;
  background-size: cover;
  border: 1px solid rgba(148, 168, 224, 0.24);
  border-left: 3px solid var(--zone-accent, rgba(148, 168, 224, 0.42));
  clip-path: var(--chamfer-sm);
  cursor: pointer;
  overflow: hidden;
}
.zone-card.selected {
  border-color: var(--zone-accent, rgba(255, 255, 255, 0.45));
  border-left-color: var(--zone-accent, var(--cyan));
  box-shadow: 0 0 14px rgba(76, 232, 255, 0.16);
}
.zone-card.zone-red.selected {
  box-shadow: 0 0 14px rgba(255, 77, 109, 0.25);
}

.zone-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.zone-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}
.zone-card.selected .zone-num {
  color: var(--zone-accent, var(--cyan));
}
.zone-text {
  min-width: 0;
}
.zone-head-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.zone-card h4 {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
.zone-favored-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--zone-accent, var(--gold));
  background: rgba(9, 11, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1px 6px;
  clip-path: var(--chamfer-xs);
  white-space: nowrap;
}
.zone-mode-pill {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  clip-path: var(--chamfer-xs);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.zone-mode-pill.is-extract {
  color: #9ae6b4;
  background: rgba(16, 48, 34, 0.86);
  border: 1px solid rgba(59, 240, 140, 0.4);
}
.zone-mode-pill.is-special {
  color: #fde68a;
  background: rgba(68, 34, 12, 0.9);
  border: 1px solid rgba(250, 204, 21, 0.56);
}
.zone-card .muted-text {
  font-size: 12px;
  color: rgba(212, 220, 244, 0.86);
  line-height: 1.28;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zone-card.locked .muted-text {
  -webkit-line-clamp: 2;
}

.zone-rate {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--zone-accent, var(--gold));
  background: rgba(9, 11, 18, 0.84);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 209, 102, 0.35);
  padding: 3px 8px;
  clip-path: var(--chamfer-xs);
  flex-shrink: 0;
}
.zone-card.zone-light {
  border-color: rgba(255, 255, 255, 0.24);
}
.zone-card.zone-light.selected {
  box-shadow: 0 0 16px rgba(255, 214, 153, 0.24);
}
.zone-card.locked {
  opacity: 0.72;
  border-left-color: rgba(148, 168, 224, 0.25);
  cursor: not-allowed;
}
.zone-card.locked .zone-rate {
  color: var(--text-muted);
  border-color: rgba(148, 168, 224, 0.28);
}

.deploy-consumables-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 20, 34, 0.92);
  border: 1px solid rgba(76, 232, 255, 0.28);
  border-left: 3px solid var(--gold);
  clip-path: var(--chamfer-xs);
  padding: 6px 9px;
  font-size: 12px;
}
.deploy-consumables-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.deploy-cons-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  clip-path: var(--chamfer-xs);
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.48);
  color: #ffe28a;
  font-size: 11.5px;
  font-weight: 800;
}

.tarkov-tip-box {
  background: rgba(16, 21, 34, 0.75);
  border-left: 2px solid var(--cyan);
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
}

/* ================= TACTICAL BUTTONS ================= */
.primary-cta {
  width: 100%;
  padding: 11px 14px;
  border: none;
  clip-path: var(--chamfer-md);
  background:
    repeating-linear-gradient(
      -55deg,
      rgba(255, 255, 255, 0.08) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(100deg, var(--hero-accent), var(--hero-accent-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--hero-glow);
  margin-top: auto;
  position: relative;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.primary-cta:active {
  transform: scale(0.985);
}

.accent-btn {
  background: linear-gradient(100deg, #3bf08c, #27c8c0);
  color: #071612;
  border: none;
  clip-path: var(--chamfer-xs);
  padding: 8px 11px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.accent-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.danger-btn {
  background: rgba(255, 77, 94, 0.14);
  color: #ff9ca6;
  border: 1px solid rgba(255, 77, 94, 0.48);
  clip-path: var(--chamfer-sm);
  padding: 11px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
}

/* ================= STASH & LOOT ================= */
.stash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.loot-grid-4 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 640px) {
  .loot-grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.loot-grid-4.compact {
  max-height: 165px;
  overflow-y: auto;
}

.loot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 6px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}
.loot-card canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.loot-card .loot-name {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.loot-card .loot-val {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.loot-rarity-pill {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 2px;
  line-height: 1.1;
  background: rgba(9, 11, 18, 0.92);
  border: 1px solid currentColor;
}

.rarity-common {
  border-color: #6b7699;
  background: rgba(124, 134, 168, 0.08);
}
.rarity-common .slot-val,
.rarity-common .loot-val { color: #cbd2ea; }

.rarity-uncommon {
  border-color: rgba(59, 240, 140, 0.65);
  background: rgba(59, 240, 140, 0.09);
}
.rarity-uncommon .slot-val,
.rarity-uncommon .loot-val { color: #5ef7a3; }

.rarity-rare {
  border-color: rgba(76, 232, 255, 0.7);
  background: rgba(76, 232, 255, 0.11);
}
.rarity-rare .slot-val,
.rarity-rare .loot-val { color: #74eeff; }

.rarity-epic {
  border-color: rgba(194, 126, 255, 0.8);
  background: rgba(184, 125, 255, 0.14);
}
.rarity-epic .slot-val,
.rarity-epic .loot-val { color: #dfb8ff; }

.rarity-legendary {
  border-color: #ffd166;
  background: linear-gradient(145deg, rgba(255, 65, 92, 0.24), rgba(255, 209, 102, 0.22));
  box-shadow: 0 0 10px rgba(255, 110, 96, 0.38);
  animation: pulseLegendary 1.6s infinite alternate;
}
.rarity-legendary .slot-val,
.rarity-legendary .loot-val { color: #ffe082; }

@keyframes pulseLegendary {
  from { box-shadow: 0 0 6px rgba(255, 92, 110, 0.3), inset 0 0 5px rgba(255, 209, 102, 0.16); }
  to { box-shadow: 0 0 14px rgba(255, 209, 102, 0.58), inset 0 0 10px rgba(255, 77, 94, 0.26); }
}

.empty-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 26px 12px;
  color: var(--text-muted);
  font-size: 13.5px;
  border: 1px dashed var(--border);
  border-radius: 3px;
}

/* ================= SUPPLY & OUTFIT SHOP + 20-NODE SKILL TREE ================= */
.shop-daily-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  background:
    linear-gradient(125deg, rgba(255, 79, 163, 0.22) 0%, rgba(255, 209, 102, 0.16) 52%, rgba(16, 20, 34, 0.96) 100%),
    #101424;
  border: 1px solid rgba(255, 209, 102, 0.52);
  clip-path: var(--chamfer-md);
  box-shadow: inset 0 0 22px rgba(255, 209, 102, 0.1);
}
.shop-daily-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: repeating-linear-gradient(180deg, #ffd166 0 6px, #ff4fa3 6px 12px);
}
.shop-daily-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  padding-left: 4px;
}
.shop-daily-crate-box {
  width: 52px;
  height: 52px;
  clip-path: var(--chamfer-sm);
  background: radial-gradient(circle at center, rgba(255, 209, 102, 0.34), rgba(18, 22, 38, 0.96));
  border: 1px solid rgba(255, 209, 102, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd166;
  flex-shrink: 0;
}
.shop-daily-crate-box .ui-ico {
  width: 28px;
  height: 28px;
}
.shop-daily-meta { min-width: 0; flex: 1; }
.shop-daily-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.4px;
}
.shop-daily-desc {
  font-size: 12px;
  color: #ffe3a8;
  margin-top: 2px;
  line-height: 1.35;
}
.shop-claim-btn {
  flex-shrink: 0;
  background: linear-gradient(105deg, #ffd166, #ffb03a);
  color: #1c1008;
  border: none;
  clip-path: var(--chamfer-sm);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 900;
  font-style: italic;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 209, 102, 0.34);
}
.shop-claim-btn.claimed {
  background: rgba(59, 240, 140, 0.14);
  border: 1px solid rgba(59, 240, 140, 0.42);
  color: #79f7b5;
  box-shadow: none;
  cursor: default;
  font-style: normal;
  font-size: 12px;
  padding: 8px 10px;
}

.shop-consumables-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.consumable-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 9px 6px 8px;
  background: linear-gradient(180deg, rgba(19, 24, 40, 0.96) 0%, rgba(11, 14, 24, 0.98) 100%);
  border: 1px solid var(--cons-accent, rgba(76, 232, 255, 0.42));
  clip-path: var(--chamfer-sm);
}
.consumable-card.armed {
  box-shadow: inset 0 0 18px rgba(59, 240, 140, 0.18), 0 0 12px rgba(59, 240, 140, 0.22);
  border-color: var(--green);
}
.consumable-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  min-height: 30px;
  display: flex;
  align-items: center;
}
.consumable-socket {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cons-accent, var(--cyan));
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 72%);
  border: 1px dashed rgba(255, 255, 255, 0.16);
}
.consumable-socket .ui-ico {
  width: 26px;
  height: 26px;
}
.consumable-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cons-accent, var(--cyan));
  white-space: nowrap;
}
.consumable-buy-btn {
  width: 100%;
  margin-top: auto;
  border: none;
  clip-path: var(--chamfer-xs);
  padding: 6px 4px;
  background: linear-gradient(100deg, var(--cons-accent, var(--cyan)), #2a6ef0);
  color: #090b12;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
}
.consumable-buy-btn.armed {
  background: rgba(59, 240, 140, 0.2);
  border: 1px solid var(--green);
  color: var(--green);
  cursor: default;
}
.consumable-buy-btn:disabled:not(.armed) {
  opacity: 0.45;
  cursor: not-allowed;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.skin-poster-card {
  position: relative;
  aspect-ratio: 3 / 4.25;
  background: #0c101d;
  border: 1.5px solid var(--skin-accent, rgba(148, 168, 224, 0.34));
  clip-path: var(--chamfer-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.skin-poster-card.equipped {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(59, 240, 140, 0.28);
}
.skin-poster-card.is-jump-target {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.5), 0 0 22px rgba(255, 79, 163, 0.55);
  animation: jumpTargetPulse 0.8s ease-in-out 3;
}
@keyframes jumpTargetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.wardrobe-shop-head .market-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 4px 8px;
}
.skin-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  display: block;
}
.skin-poster-px-pill {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 42px;
  height: 44px;
  padding: 2px;
  background: rgba(9, 11, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.24);
  clip-path: var(--chamfer-xs);
  z-index: 2;
}
.skin-poster-px-pill canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.skin-swatches {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.skin-swatch {
  width: 13px;
  height: 5px;
  clip-path: var(--chamfer-xs);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.skin-poster-footer {
  position: relative;
  z-index: 2;
  padding: 26px 8px 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 11, 18, 0.86) 38%, rgba(9, 11, 18, 0.98) 100%);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.skin-poster-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-poster-btn {
  width: 100%;
  border: none;
  clip-path: var(--chamfer-xs);
  padding: 7px 6px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
}
.skin-poster-btn.is-equipped {
  background: rgba(59, 240, 140, 0.18);
  border: 1px solid var(--green);
  color: var(--green);
}
.skin-poster-btn.is-owned {
  background: linear-gradient(100deg, var(--green), #17b890);
  color: #07140f;
}
.skin-poster-btn.is-buy {
  background: linear-gradient(100deg, #ffd166, #ff9947);
  color: #1d1007;
}
.skin-poster-btn:disabled:not(.is-equipped) {
  opacity: 0.45;
  cursor: not-allowed;
}

.tree-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background:
    linear-gradient(90deg, rgba(10, 14, 24, 0.94) 0%, rgba(12, 18, 32, 0.86) 100%),
    var(--bg-card);
  border: 1px solid rgba(76, 232, 255, 0.34);
  border-left: 3px solid var(--cyan);
  clip-path: var(--chamfer-sm);
  padding: 7px 10px;
}
.tree-respec-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.48);
  color: var(--gold);
  clip-path: var(--chamfer-xs);
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.tree-respec-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tree-branch-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.branch-stat-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(14, 18, 30, 0.94);
  border: 1px solid var(--border);
  clip-path: var(--chamfer-xs);
  padding: 5px 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.branch-stat-pill.combat { border-color: rgba(255, 77, 109, 0.55); color: #ff93a9; }
.branch-stat-pill.survival { border-color: rgba(59, 240, 140, 0.55); color: #6cf5ad; }
.branch-stat-pill.loot { border-color: rgba(255, 209, 102, 0.55); color: #ffe08a; }

.skill-tree-stage {
  position: relative;
  width: 100%;
  height: 368px;
  max-height: 46vh;
  background:
    radial-gradient(circle at 50% 10%, rgba(76, 232, 255, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(8, 11, 20, 0.3) 0%, rgba(8, 11, 20, 0.62) 100%),
    url("./assets/backgrounds/skill-tree-console.webp") center top / cover no-repeat,
    #080b14;
  border: 1px solid rgba(76, 232, 255, 0.34);
  clip-path: var(--chamfer-sm);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.skill-tree-inner {
  position: relative;
  width: 100%;
  height: 530px;
}
.skill-tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tree-edge {
  stroke: rgba(74, 92, 138, 0.55);
  stroke-width: 1.1;
  stroke-dasharray: 2.5 2;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.2s, opacity 0.2s;
}
.tree-edge.unlocked {
  stroke: rgba(124, 152, 218, 0.78);
  stroke-width: 1.7;
  stroke-dasharray: none;
}
.tree-edge.active.branch-combat { stroke: #ff4d6d; stroke-width: 2.5; stroke-dasharray: none; }
.tree-edge.active.branch-survival { stroke: #3bf08c; stroke-width: 2.5; stroke-dasharray: none; }
.tree-edge.active.branch-loot { stroke: #ffd166; stroke-width: 2.5; stroke-dasharray: none; }

.skill-tree-nodes {
  position: absolute;
  inset: 0;
}
.skill-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
  overflow: visible;
  cursor: pointer;
  filter: drop-shadow(0 0 1px rgba(108, 128, 184, 0.55));
  transition: transform 0.12s, filter 0.15s;
}
.skill-node:active { transform: translate(-50%, -50%) scale(0.94); }
.skill-node.is-keystone {
  width: 48px;
  height: 48px;
}
.skill-node-socket {
  width: 100%;
  height: 100%;
  clip-path: var(--chamfer-sm);
  background: rgba(12, 16, 28, 0.94);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.skill-node-lv {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #090b12;
  border: 1px solid #3c4775;
  border-radius: 2px;
  padding: 1px 5px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.skill-node-cost-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.skill-node.is-locked .skill-node-socket {
  opacity: 0.55;
  background: rgba(9, 12, 22, 0.88);
  color: #5e6888;
}
.skill-node.is-available {
  filter: drop-shadow(0 0 1.6px rgba(76, 232, 255, 0.72));
}
.skill-node.is-available .skill-node-socket {
  color: #b4e9ff;
}
.skill-node.is-affordable {
  filter: drop-shadow(0 0 4px rgba(76, 232, 255, 0.55));
}
.skill-node.is-active.branch-core {
  filter: drop-shadow(0 0 4px rgba(76, 232, 255, 0.65));
}
.skill-node.is-active.branch-core .skill-node-socket {
  background: linear-gradient(145deg, rgba(76, 232, 255, 0.25), rgba(12, 16, 28, 0.94));
  color: var(--cyan);
}
.skill-node.is-active.branch-combat {
  filter: drop-shadow(0 0 5px rgba(255, 77, 109, 0.72));
}
.skill-node.is-active.branch-combat .skill-node-socket {
  background: linear-gradient(145deg, rgba(255, 77, 109, 0.28), rgba(20, 12, 22, 0.94));
  color: #ff8ca2;
}
.skill-node.is-active.branch-combat .skill-node-lv { border-color: #ff4d6d; color: #ffb8c6; }
.skill-node.is-active.branch-survival {
  filter: drop-shadow(0 0 5px rgba(59, 240, 140, 0.68));
}
.skill-node.is-active.branch-survival .skill-node-socket {
  background: linear-gradient(145deg, rgba(59, 240, 140, 0.24), rgba(10, 22, 18, 0.94));
  color: #6cf5ad;
}
.skill-node.is-active.branch-survival .skill-node-lv { border-color: var(--green); color: #9cfbd0; }
.skill-node.is-active.branch-loot {
  filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.72));
}
.skill-node.is-active.branch-loot .skill-node-socket {
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.25), rgba(24, 18, 12, 0.94));
  color: #ffe08a;
}
.skill-node.is-active.branch-loot .skill-node-lv { border-color: var(--gold); color: #ffe6a3; }
.skill-node.is-maxed .skill-node-lv { background: #1c243f; font-weight: 900; }
.skill-node.is-selected {
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px rgba(255, 255, 255, 0.45));
  z-index: 3;
}
.skill-node.is-selected .skill-node-socket {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.skill-inspector {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--hero-accent);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.skill-inspector-info { min-width: 0; flex: 1; }
.skill-inspector-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 3px;
}
.skill-branch-chip {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 700;
}
.skill-inspector-cur { font-size: 13.5px; color: #dbe2ff; line-height: 1.45; }
.skill-inspector-next { font-size: 13px; color: var(--cyan); margin-top: 3px; line-height: 1.45; }
.skill-inspector-req { font-size: 12.5px; color: #ff9eb0; margin-top: 3px; }
.skill-upgrade-btn {
  min-width: 82px;
  padding: 8px 10px;
  flex-shrink: 0;
}

.pill-row { display: flex; gap: 5px; }
.pill-btn {
  flex: 1;
  padding: 6px 3px;
  clip-path: var(--chamfer-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pill-btn.active {
  border-color: var(--hero-accent);
  color: #fff;
  background: var(--hero-soft);
}

.skin-row-left { display: flex; align-items: center; gap: 10px; }
.skin-row-left canvas {
  width: 44px;
  height: 44px;
  background: #0c0f1b;
  border: 1px solid var(--border);
  border-radius: 2px;
  image-rendering: pixelated;
}
.danger-zone { margin-top: auto; padding-top: 8px; text-align: center; }

/* ================= RAID SCREEN (FULL-BLEED ARENA + TRANSLUCENT HUD) ================= */
#raid-screen.active {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0a0d16;
}

.raid-top-cluster {
  position: relative;
  z-index: 12;
  margin: calc(6px + env(safe-area-inset-top, 0px)) 8px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  flex-shrink: 0;
  pointer-events: none;
}

.raid-hud-top {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 5px 8px;
  background: rgba(10, 14, 24, 0.84);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(76, 232, 255, 0.34);
  border-top: 2px solid var(--hero-accent);
  clip-path: var(--chamfer-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.raid-hud-top .icon-btn-sm {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.raid-hud-top button,
.tarkov-dock button,
.modal-card button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.hp-xp-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hp-wrap { width: 100%; position: relative; height: 15px; }
.hp-bar-bg {
  width: 100%;
  height: 100%;
  background: #1d1019;
  border: 1px solid #63273d;
  border-radius: 2px;
  overflow: hidden;
}
.hp-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff3e55, #ff7494);
  transition: width 0.1s;
}
.hp-text {
  position: absolute;
  inset: 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 2px #000;
}

.raid-clock-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  clip-path: var(--chamfer-xs);
  border-left: 2px solid var(--hero-accent);
  flex-shrink: 0;
}
.zone-badge { font-size: 11px; color: var(--cyan); font-weight: 700; }
.clock-num { font-family: var(--font-display); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-actions { display: flex; gap: 4px; flex-shrink: 0; }

.xp-bar-bg {
  position: relative;
  height: 4px;
  background: #101628;
  border-radius: 1px;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ce8ff, var(--hero-accent));
}
.xp-lvl {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  color: var(--cyan);
  background: rgba(76, 232, 255, 0.12);
  border: 1px solid rgba(76, 232, 255, 0.35);
  padding: 2px 5px;
  clip-path: var(--chamfer-xs);
  line-height: 1;
  flex-shrink: 0;
  text-shadow: 0 1px 2px #000;
}

.hud-subrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px 6px;
  font-size: 11.5px;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.safe-txt { color: var(--green); }
.gold-txt { color: var(--gold); }

.extract-pill {
  padding: 1px 6px;
  clip-path: var(--chamfer-xs);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}
.extract-pill.idle { background: rgba(152, 162, 200, 0.14); color: var(--text-muted); }
.extract-pill.preview { background: rgba(59, 240, 140, 0.12); color: #a4d3b8; }
.extract-hint { color: var(--text-muted); font-size: 11px; line-height: 1.25; }
.extract-pill.active {
  background: rgba(59, 240, 140, 0.2);
  color: var(--green);
  border: 1px solid var(--green);
  animation: pulseGreen 1s infinite alternate;
}
.extract-pill.objective {
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.55);
}
.extract-pill.boss {
  background: rgba(255, 59, 92, 0.24);
  color: #ffe4e6;
  border: 1px solid #ff4d6d;
  animation: pulseBoss 0.9s infinite alternate;
}
.extract-pill.true-path {
  background: linear-gradient(90deg, rgba(59, 240, 140, 0.22), rgba(168, 85, 247, 0.26));
  color: #fef08a;
  border: 1px solid #3bf08c;
  animation: pulseGreen 1s infinite alternate;
}

@keyframes pulseGreen {
  from { box-shadow: 0 0 2px rgba(59, 240, 140, 0.2); }
  to { box-shadow: 0 0 10px rgba(59, 240, 140, 0.65); }
}

@keyframes pulseBoss {
  from { box-shadow: 0 0 2px rgba(255, 77, 109, 0.25); }
  to { box-shadow: 0 0 11px rgba(255, 77, 109, 0.78); }
}

.canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0a0d16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
}

/* In-raid Character Bark Dialogue Strip */
.dialogue-strip {
  position: relative;
  width: 100%;
  background: rgba(10, 12, 20, 0.92);
  border-left: 3px solid var(--hero-accent);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  clip-path: var(--chamfer-sm);
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}
.bark-avatar {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  object-fit: cover;
  object-position: center 18%;
  object-view-box: inset(1% 16% 36% 16%);
  border: 1px solid var(--hero-accent);
  flex-shrink: 0;
}
.bark-avatar-px {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  background: #14192b;
  border: 1px solid var(--cyan);
  image-rendering: pixelated;
  flex-shrink: 0;
}
.bark-body { min-width: 0; text-align: left; }
.bark-speaker { font-family: var(--font-display); font-size: 12.5px; font-weight: 800; color: var(--hero-text); }
.bark-text { font-size: 13.5px; color: #f7f8ff; line-height: 1.3; }

/* Extraction Banner (flows directly beneath .raid-hud-top inside .raid-top-cluster) */
.extract-banner {
  position: relative;
  align-self: center;
  width: min(94%, 346px);
  background: rgba(9, 22, 18, 0.94);
  border: 1px solid var(--green);
  clip-path: var(--chamfer-sm);
  padding: 6px 10px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
}
.extract-banner-title { font-size: 12.5px; font-weight: 800; color: var(--green); margin-bottom: 4px; }
.extract-bar-bg { height: 7px; background: #142f22; overflow: hidden; }
.extract-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3bf08c, #d4ff7a); }
.extract-banner.is-altar {
  background: rgba(28, 22, 9, 0.94);
  border-color: #facc15;
}
.extract-banner.is-altar .extract-banner-title { color: #fef08a; }
.extract-banner.is-altar .extract-bar-bg { background: #33270d; }
.extract-banner.is-altar .extract-bar-fill { background: linear-gradient(90deg, #f59e0b, #fef08a); }
.extract-banner.is-hell {
  background: rgba(34, 8, 14, 0.94);
  border-color: #ff4d6d;
}
.extract-banner.is-hell .extract-banner-title { color: #fda4af; }
.extract-banner.is-hell .extract-bar-bg { background: #3a0d16; }
.extract-banner.is-hell .extract-bar-fill { background: linear-gradient(90deg, #dc2626, #fb923c); }
.extract-sec-text { font-family: var(--font-display); font-size: 12.5px; font-weight: 800; margin-top: 2px; color: #fff; }

.raid-toast {
  position: relative;
  align-self: center;
  max-width: 96%;
  background: rgba(12, 15, 25, 0.92);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 4px 10px;
  clip-path: var(--chamfer-xs);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  white-space: normal;
}

.raid-bottom-cluster {
  position: relative;
  z-index: 12;
  margin: 0 8px calc(6px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Compact Side-by-Side Single-Row Tarkov Dock */
.tarkov-dock {
  position: relative;
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 39%) minmax(0, 1fr);
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.dock-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  background: rgba(10, 14, 24, 0.88);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  clip-path: var(--chamfer-sm);
  padding: 4px 6px 5px;
  border: 1px solid rgba(76, 232, 255, 0.34);
}
.safe-block {
  border-color: rgba(59, 240, 140, 0.54);
  border-left: 2px solid var(--green);
}
.bag-block {
  border-color: rgba(76, 232, 255, 0.42);
}
.dock-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  min-width: 0;
}
.dock-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.dock-label small {
  font-size: 10.5px;
  font-weight: 700;
  opacity: 0.85;
}
.safe-block .dock-title { color: var(--green); }
.bag-block .dock-title { color: var(--cyan); }
.dock-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); }

.mini-action-btn {
  background: rgba(59, 240, 140, 0.14);
  border: 1px solid rgba(59, 240, 140, 0.52);
  color: var(--green);
  clip-path: var(--chamfer-xs);
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bag-title-right {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mini-action-btn.bag-auto-btn {
  padding: 2px 6px;
  font-size: 10.5px;
  background: rgba(76, 232, 255, 0.15);
  border-color: rgba(76, 232, 255, 0.56);
  color: var(--cyan);
}
.mini-action-btn.bag-auto-btn.is-off {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
}

.slot-row { display: flex; gap: 4px; align-items: center; touch-action: manipulation; }
.safe-scroll,
.bag-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 1px 0;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
.safe-scroll::-webkit-scrollbar,
.bag-scroll::-webkit-scrollbar { display: none; }

.inv-slot {
  position: relative;
  width: 44px;
  height: 45px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(22, 29, 49, 0.96) 0%, rgba(11, 15, 27, 0.98) 100%);
  border: 1px solid #2b3557;
  border-left: 2.5px solid var(--rar-color, #475569);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 1px 1px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.inv-slot.safe-slot {
  border-color: rgba(59, 240, 140, 0.42);
  border-left: 2.5px solid var(--rar-color, #3bf08c);
}
.inv-slot.safe-slot.empty-safe {
  border-color: rgba(59, 240, 140, 0.36);
  border-left-color: rgba(59, 240, 140, 0.45);
  background: rgba(16, 36, 28, 0.56);
  justify-content: center;
  padding: 0;
}
.inv-slot.safe-slot:not(.empty-safe) {
  box-shadow: inset 0 0 8px rgba(59, 240, 140, 0.14);
}
.inv-slot canvas { width: 22px; height: 22px; image-rendering: pixelated; pointer-events: none; }
.inv-slot .slot-val {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  pointer-events: none;
}
.inv-slot .slot-val::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 3px rgba(255, 209, 102, 0.6);
  flex-shrink: 0;
}
.safe-lock-tag {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  color: rgba(128, 238, 178, 0.85);
  line-height: 1;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.safe-lock-tag .ui-ico { width: 9px; height: 9px; }
.inv-slot .drop-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: rgba(11, 15, 27, 0.84);
  color: #8494b8;
  border: 1px solid rgba(132, 148, 184, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  touch-action: manipulation;
}
.inv-slot .drop-x::after {
  content: '';
  position: absolute;
  inset: -5px -4px -7px -7px;
}
@media (hover: hover) {
  .inv-slot .drop-x:hover {
    color: #ff8fa3;
    border-color: rgba(255, 107, 138, 0.55);
    background: rgba(45, 16, 26, 0.92);
  }
}
.inv-slot .drop-x:active {
  color: #ff8fa3;
  border-color: rgba(255, 107, 138, 0.55);
  background: rgba(45, 16, 26, 0.92);
}
.inv-slot .drop-x .ui-ico { width: 9px; height: 9px; }

/* ================= MODALS ================= */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.86);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top, 0px)) 12px max(10px, env(safe-area-inset-bottom, 0px));
  z-index: 30;
}
.hidden { display: none !important; }

.modal-card {
  width: 100%;
  max-width: 394px;
  max-height: calc(100% - 14px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0b0f1b;
  border: 1.5px solid var(--border-strong);
  border-top: 3px solid var(--hero-accent);
  clip-path: var(--chamfer-md);
  padding: 14px;
  text-align: center;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.88);
}

/* Level-Up Overhang Emblem & Octagonal Tactical Cards */
.modal-card.modal-levelup {
  position: relative;
  overflow: visible;
  margin-top: 16px;
  padding: 20px 12px 10px;
  background: linear-gradient(180deg, rgba(16, 20, 34, 0.98), rgba(8, 11, 20, 0.99));
  border: 2px solid rgba(255, 209, 102, 0.65);
  box-shadow:
    0 0 28px rgba(255, 209, 102, 0.16),
    inset 0 0 24px rgba(10, 14, 28, 0.85);
  clip-path: none;
  border-radius: 3px;
}
.modal-card.modal-levelup.modal-chest {
  border-color: rgba(76, 232, 255, 0.72);
  box-shadow: 0 0 28px rgba(76, 232, 255, 0.18), inset 0 0 24px rgba(10, 14, 28, 0.85);
}
.levelup-overhang-badge {
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%) skewX(-10deg);
  padding: 5px 24px;
  background: linear-gradient(100deg, #e01a4f 0%, #ff5a36 52%, #ffd166 100%);
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.4px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 6px 20px rgba(255, 110, 72, 0.55);
  border: 1px solid rgba(255, 240, 180, 0.65);
  white-space: nowrap;
  z-index: 2;
}
.levelup-overhang-badge.chest-badge {
  background: linear-gradient(100deg, #1b6dff, #4ce8ff);
  color: #08101e;
  text-shadow: none;
  box-shadow: 0 6px 20px rgba(76, 232, 255, 0.48);
}
.levelup-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.lvl-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}
.modal-levelup h3 {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.9px;
  color: #f3f7ff;
  white-space: nowrap;
}
.modal-footer-ticks {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.9;
}

.modal-badge {
  display: inline-block;
  padding: 3px 11px;
  clip-path: var(--chamfer-xs);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  background: var(--hero-soft);
  color: var(--hero-text);
  border-left: 2px solid var(--hero-accent);
  margin-bottom: 6px;
}
.modal-badge.success { background: rgba(59, 240, 140, 0.22); color: var(--green); border-color: var(--green); }
.modal-badge.fail { background: rgba(255, 77, 94, 0.24); color: #ff8f9b; border-color: var(--red); }

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 56vh;
  overflow-y: auto;
}
.choice-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--choice-rim, #4ce8ff);
  border: none;
  clip-path: var(--chamfer-sm);
  padding: 11px 12px;
  cursor: pointer;
  color: var(--text-main);
  transition: transform 0.1s ease, filter 0.12s ease;
}
.choice-card::before {
  content: "";
  position: absolute;
  inset: 2px;
  clip-path: var(--chamfer-sm);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0%, transparent 45%),
    linear-gradient(135deg, var(--choice-tint, rgba(20, 30, 56, 0.96)), rgba(9, 12, 22, 0.98) 72%);
  z-index: -1;
}
.choice-card::after {
  content: "///";
  position: absolute;
  right: 11px;
  bottom: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: var(--choice-rim, #4ce8ff);
  opacity: 0.72;
  pointer-events: none;
  z-index: 1;
}
.choice-card.choice-weapon {
  --choice-rim: #ff3b7f;
  --choice-tint: rgba(66, 16, 39, 0.95);
}
.choice-card.choice-passive {
  --choice-rim: #3bf08c;
  --choice-tint: rgba(12, 46, 36, 0.95);
}
.choice-card.choice-utility {
  --choice-rim: #4ce8ff;
  --choice-tint: rgba(14, 34, 54, 0.95);
}
.choice-card.choice-evo {
  --choice-rim: #ffd166;
  --choice-tint: rgba(68, 42, 14, 0.96);
}
.choice-card.choice-union {
  --choice-rim: #4ce8ff;
  --choice-tint: rgba(18, 44, 62, 0.96);
}
.choice-card:hover { filter: brightness(1.12); transform: translateY(-1px); }
.choice-icon {
  width: 50px;
  height: 50px;
  clip-path: var(--chamfer-xs);
  background: radial-gradient(circle at 50% 45%, rgba(76, 232, 255, 0.2), #070a14 78%);
  border: 1.5px solid #4ce8ff;
  box-shadow: inset 0 0 10px rgba(76, 232, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.choice-card.choice-evo .choice-icon { border-color: #ffd166; }
.choice-card.choice-passive .choice-icon { border-color: #3bf08c; }
.choice-icon canvas { width: 34px; height: 34px; image-rendering: pixelated; }
.choice-meta { min-width: 0; flex: 1; padding-right: 16px; }
.choice-meta h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.choice-meta p { font-size: 12.5px; color: #dbe3ff; line-height: 1.38; }

/* Pause & Loadout High-Contrast Header + 3 Telemetry Columns + 6+6 Visual Matrix */
.modal-card.modal-pause {
  padding: 0 0 13px;
  border: 1.5px solid rgba(76, 232, 255, 0.52);
  background: linear-gradient(180deg, #0b101d 0%, #070a13 100%);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.92), 0 0 24px rgba(76, 232, 255, 0.14);
}
.modal-top-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 5px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.7px;
  color: #dce7ff;
  background: #070a12;
}
.modal-top-brand .ui-ico { width: 12px; height: 12px; color: var(--cyan); }
.modal-top-brand .brand-ticks { margin-left: auto; color: rgba(255, 255, 255, 0.32); letter-spacing: 1px; }
.pause-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background:
    repeating-linear-gradient(-55deg, rgba(11, 16, 28, 0.12) 0 7px, transparent 7px 14px),
    linear-gradient(92deg, #4ce8ff 0%, #7ef5ff 74%, #37c7eb 100%);
  border-top: 1px solid #b5faff;
  border-bottom: 2px solid #091220;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  color: #070c17;
  letter-spacing: 0.5px;
}
.pause-header-strip .tab-hero-ticks { color: #070c17; letter-spacing: 1px; }
.pause-arsenal-wrap {
  padding: 10px 12px 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pause-operator-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 7px 8px;
  background: rgba(13, 18, 32, 0.96);
  border: 1px solid rgba(76, 232, 255, 0.35);
  clip-path: var(--chamfer-sm);
  text-align: left;
}
.pause-op-portrait-col {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.pause-op-avatar {
  width: 58px;
  height: 50px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  object-fit: cover;
  object-position: center 14%;
  border: 1.5px solid #ff4d6d;
  flex-shrink: 0;
}
.pause-op-lv-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pause-op-lv {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  line-height: 1.05;
}
.pause-op-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
}
.pause-telemetry-cols {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-left: 1px solid rgba(76, 232, 255, 0.22);
  padding-left: 7px;
}
.pause-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pause-stat-col .ui-ico { width: 13px; height: 13px; color: var(--cyan); margin-bottom: 1px; }
.pause-stat-col.is-rev .ui-ico { color: #ff6eb4; }
.pause-stat-lbl { font-size: 10.5px; font-weight: 700; color: #9cb0db; line-height: 1.1; }
.pause-stat-val { font-family: var(--font-display); font-size: 14px; font-weight: 900; color: #ffffff; line-height: 1.15; }
.pause-arsenal-bay {
  background: rgba(11, 15, 27, 0.96);
  border: 1px solid rgba(76, 232, 255, 0.28);
  clip-path: var(--chamfer-sm);
  padding: 8px 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pause-bay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  border-bottom: 1px solid rgba(76, 232, 255, 0.18);
  padding-bottom: 5px;
}
.pause-bay-head .bay-l { display: flex; align-items: center; gap: 5px; }
.pause-bay-head .ui-ico { width: 14px; height: 14px; color: var(--cyan); }
.pause-bay-head .bay-ticks { font-size: 11px; color: rgba(255, 255, 255, 0.28); letter-spacing: 1px; }
.pause-grid-section { text-align: left; }
.pause-grid-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: #a9bce6;
  margin-bottom: 5px;
  letter-spacing: 0.4px;
}
.pause-grid-label .ui-ico { width: 12px; height: 12px; color: var(--cyan); }
.pause-grid-label.is-passive .ui-ico { color: #c27eff; }
.pause-slot-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.pause-slot-box {
  height: 46px;
  background: rgba(9, 13, 24, 0.98);
  border: 1.5px solid #2b3558;
  clip-path: var(--chamfer-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  position: relative;
}
.pause-slot-box.filled-weapon {
  border-color: rgba(76, 232, 255, 0.85);
  background: radial-gradient(circle at 50% 45%, rgba(76, 232, 255, 0.18), rgba(9, 13, 24, 0.98) 76%);
}
.pause-slot-box.filled-book {
  border-color: rgba(194, 126, 255, 0.85);
  background: radial-gradient(circle at 50% 45%, rgba(194, 126, 255, 0.2), rgba(9, 13, 24, 0.98) 76%);
}
.pause-slot-box.awakened {
  border-color: var(--gold);
  background: radial-gradient(circle at 50% 45%, rgba(255, 209, 102, 0.24), rgba(9, 13, 24, 0.98) 76%);
}
.pause-slot-box.union {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(76, 232, 255, 0.28), rgba(255, 209, 102, 0.22));
}
.pause-slot-box.empty {
  border-style: dashed;
  border-color: rgba(114, 132, 184, 0.42);
  background: rgba(9, 12, 22, 0.72);
  color: #6b7aa6;
}
.pause-slot-box.empty::after {
  content: "///";
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 8px;
  font-weight: 900;
  font-style: italic;
  color: rgba(114, 132, 184, 0.4);
}
.pause-slot-box canvas { width: 28px; height: 28px; image-rendering: pixelated; }
.pause-slot-lv {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 1px 4px;
  background: rgba(5, 8, 16, 0.94);
  border-top-left-radius: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  color: #ffffff;
}
.pause-warning-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 8px 12px 0;
  padding: 6px 10px;
  background: rgba(255, 209, 102, 0.11);
  border: 1px solid rgba(255, 209, 102, 0.55);
  clip-path: var(--chamfer-xs);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffd970;
}
.pause-warning-strip .warn-left { display: flex; align-items: center; gap: 5px; }
.pause-warning-strip .ui-ico { width: 13px; height: 13px; color: var(--gold); flex-shrink: 0; }
.pause-warning-strip .warn-ticks { font-family: var(--font-display); font-style: italic; color: rgba(255, 209, 102, 0.55); letter-spacing: 1px; }
.modal-pause .modal-btn-row { padding: 0 12px; margin-top: 10px; flex-direction: column; gap: 7px; }
.pause-resume-cta {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 !important;
  background:
    repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px),
    linear-gradient(95deg, #27e3ff 0%, #6cf7ff 100%) !important;
  color: #070b15 !important;
  border: none !important;
  overflow: hidden;
}
.pause-resume-cta .cta-main {
  flex: 1;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 900;
  font-style: italic;
  text-align: center;
}
.pause-resume-cta .cta-wing {
  align-self: stretch;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff3e7f, #ff6b94);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%);
  color: #070b15;
}
.pause-resume-cta .cta-wing .ui-ico { width: 14px; height: 14px; }
.pause-resume-cta .cta-wing-ticks { font-size: 9px; font-weight: 900; line-height: 1; margin-top: 2px; }
.pause-retreat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1.5px solid rgba(255, 77, 94, 0.72) !important;
  background: rgba(34, 10, 18, 0.9) !important;
  color: #ff8e9d !important;
  font-size: 12.5px;
  font-weight: 800;
}
.pause-retreat-btn .retreat-ticks { font-family: var(--font-display); font-style: italic; opacity: 0.7; }

/* Result / Victory (EXTRACTED) & Defeat (MIA) Dual-Theme Debrief Modal */
.modal-card.modal-result {
  padding: 0 0 13px;
  border-top: none;
  background: #080b13;
}
.modal-card.modal-result.is-mia {
  border: 1.5px solid rgba(255, 66, 92, 0.65);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.94), 0 0 26px rgba(255, 66, 92, 0.16);
}
.modal-card.modal-result.is-win {
  border: 1.5px solid rgba(59, 240, 140, 0.65);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.94), 0 0 26px rgba(59, 240, 140, 0.18);
}
.result-top-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 900;
  font-style: italic;
  background: #06080f;
  color: #e4ecff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.result-top-brand .brand-l { display: flex; align-items: center; gap: 5px; }
.result-top-brand .ui-ico { width: 12px; height: 12px; }
.is-mia .result-top-brand .ui-ico,
.is-mia .result-top-brand .brand-r { color: #ff5872; }
.is-win .result-top-brand .ui-ico,
.is-win .result-top-brand .brand-r { color: #3bf08c; }

.modal-result .result-debrief-head,
.modal-result .result-stats,
.modal-result .result-agent-xp-bar,
.modal-result .result-summary-line,
.modal-result .result-market-note,
.modal-result .result-loot-section,
.modal-result .result-return-cta {
  margin-left: 11px;
  margin-right: 11px;
}
.modal-result .result-return-cta {
  width: calc(100% - 22px);
  margin-top: 10px;
}
.result-hero-banner {
  position: relative;
  height: 196px;
  background: #090c14;
  overflow: hidden;
}
.result-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  display: block;
}
.result-portrait.is-wide-banner {
  object-position: 28% 12%;
}
.result-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 42%, rgba(7, 9, 16, 0.72) 100%),
    linear-gradient(180deg, rgba(6, 8, 14, 0.25) 0%, transparent 32%, rgba(6, 8, 14, 0.85) 100%);
  pointer-events: none;
}
.result-op-tag {
  position: absolute;
  top: 8px;
  left: 10px;
  padding: 2px 8px;
  background: rgba(8, 11, 18, 0.84);
  border-left: 3px solid #3bf08c;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  z-index: 2;
}
.is-mia .result-op-tag { border-left-color: #ff4d6d; }
.result-quote-float {
  position: absolute;
  top: 34px;
  right: 8px;
  max-width: 146px;
  padding: 7px 9px 6px;
  background: rgba(10, 14, 24, 0.88);
  border: 1px solid rgba(59, 240, 140, 0.65);
  clip-path: var(--chamfer-sm);
  text-align: left;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.72);
}
.is-mia .result-quote-float { border-color: rgba(255, 77, 94, 0.7); }
.result-quote-float p {
  font-size: 11.5px;
  font-weight: 700;
  color: #f3f7ff;
  line-height: 1.38;
  margin: 0;
}
.result-quote-float .quote-wave {
  display: block;
  text-align: right;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #4ce8ff;
  margin-top: 2px;
}
.is-mia .result-quote-float .quote-wave { color: #ff6e84; }

.result-tape-badge {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  margin: 0;
  padding: 6px 12px;
  transform: rotate(-1.2deg);
  clip-path: none;
  border: none;
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.9px;
  z-index: 3;
}
.result-tape-badge.fail {
  background:
    repeating-linear-gradient(-48deg, rgba(255, 42, 74, 0.95) 0 13px, rgba(20, 8, 12, 0.96) 13px 26px);
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}
.result-tape-badge.success {
  background:
    repeating-linear-gradient(-48deg, rgba(20, 178, 102, 0.95) 0 13px, rgba(6, 22, 16, 0.96) 13px 26px);
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.96), 0 0 8px rgba(0, 0, 0, 0.8);
}

.result-debrief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: #9bb0db;
}
.result-inline-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
}
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.stat-box {
  position: relative;
  background: rgba(14, 19, 32, 0.96);
  border: 1.5px solid rgba(59, 240, 140, 0.45);
  clip-path: var(--chamfer-xs);
  padding: 6px 5px;
}
.is-mia .stat-box {
  background: rgba(28, 11, 17, 0.94);
  border-color: rgba(255, 77, 94, 0.48);
}
.stat-box .stat-lbl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #b7c8eb;
}
.stat-box .stat-lbl-row .ui-ico { width: 12px; height: 12px; color: #3bf08c; }
.is-mia .stat-box .stat-lbl-row .ui-ico { color: #ff5872; }
.stat-box .val {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  font-style: italic;
  color: var(--gold);
  line-height: 1.15;
  margin-top: 2px;
}

.result-agent-xp-bar {
  margin-top: 7px;
  padding: 5px 9px;
  background: rgba(12, 17, 29, 0.96);
  border: 1px solid rgba(76, 232, 255, 0.35);
  clip-path: var(--chamfer-xs);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.result-xp-track {
  flex: 1;
  height: 7px;
  background: #070a12;
  border: 1px solid rgba(76, 232, 255, 0.38);
  overflow: hidden;
}
.result-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #3bf08c, #4ce8ff);
}
.result-summary-line {
  margin-top: 6px;
  font-size: 11.5px;
  color: #aebfe6;
  text-align: left;
  line-height: 1.38;
}
.result-loot-section {
  margin-top: 7px;
  padding: 7px 9px;
  clip-path: var(--chamfer-sm);
  text-align: left;
}
.result-loot-section.vault-section {
  background: linear-gradient(135deg, rgba(11, 34, 27, 0.92), rgba(7, 16, 18, 0.95));
  border: 1.5px solid rgba(59, 240, 140, 0.58);
}
.result-loot-section.lost-section {
  background: linear-gradient(135deg, rgba(38, 11, 18, 0.92), rgba(14, 8, 12, 0.96));
  border: 1.5px solid rgba(255, 77, 94, 0.58);
}
.result-sec-head {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 6px;
}
.vault-head { color: #5bf5a5; }
.lost-head { color: #ff7a8a; }
.vault-body-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.vault-emblem-box {
  width: 68px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: rgba(5, 16, 12, 0.85);
  border: 1px solid rgba(59, 240, 140, 0.35);
  clip-path: var(--chamfer-xs);
}
.vault-emblem-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  mix-blend-mode: screen;
}
.vault-emblem-lbl {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  color: #72f7b1;
  text-align: center;
  margin-top: 2px;
}
.vault-body-row .loot-grid-4,
.lost-body-row .loot-grid-4 {
  flex: 1;
  min-width: 0;
}
.modal-result .loot-grid-4.compact {
  max-height: 174px;
  gap: 5px;
}
.modal-result .loot-card {
  padding: 15px 4px 5px;
  gap: 1px;
}
.modal-result .loot-card canvas {
  width: 26px;
  height: 26px;
}
.lost-body-row {
  position: relative;
  min-height: 76px;
  padding: 2px 0;
}
.lost-wireframe-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.lost-wireframe-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: screen;
  opacity: 0.14;
  filter: saturate(0.8);
}
.lost-grid {
  position: relative;
  z-index: 1;
}
.lost-grid .loot-card {
  opacity: 0.78;
  filter: grayscale(0.35);
  border-color: rgba(255, 77, 94, 0.5);
}
.lost-grid .loot-card .loot-name,
.lost-grid .loot-card .loot-val {
  text-decoration: line-through;
  color: #ff99a6;
}
.result-return-cta {
  font-family: var(--font-display) !important;
  font-weight: 900 !important;
  font-style: italic !important;
  letter-spacing: 0.8px;
}
.is-win .result-return-cta {
  background: linear-gradient(95deg, #2de38b 0%, #4ce8ff 100%) !important;
  color: #07120e !important;
  box-shadow: 0 6px 20px rgba(59, 240, 140, 0.35);
}
.is-mia .result-return-cta {
  background: linear-gradient(95deg, #ff3258 0%, #ff6b6b 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(255, 50, 88, 0.35);
}

/* Rules Briefing Modal */
.rules-card { text-align: left; }
.rules-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rule-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(18, 23, 38, 0.88);
  border-left: 2px solid var(--hero-accent);
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.rule-row strong { color: var(--text-main); }
.rule-num {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  font-style: italic;
  color: var(--hero-accent);
  flex-shrink: 0;
}

/* Story Prologue Modal */
.story-card { text-align: left; }
.story-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.story-portrait-stage {
  height: clamp(118px, 23vh, 185px);
  background:
    radial-gradient(circle at center, var(--hero-soft) 0%, rgba(10, 12, 20, 0.94) 80%),
    url("./assets/backgrounds/salvage-workshop.webp") center 20% / cover no-repeat;
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.story-portrait {
  height: calc(100% - 14px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7));
}
.story-fallback canvas { width: 96px; height: 96px; image-rendering: pixelated; }

.story-dialog-box {
  background: rgba(16, 21, 34, 0.92);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hero-accent);
  padding: 10px 12px;
  min-height: 90px;
}
.story-speaker { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: var(--hero-text); margin-bottom: 4px; }
.story-text { font-size: 14px; line-height: 1.6; color: #eff2ff; }
.story-nav { display: flex; gap: 8px; margin-top: 10px; }

/* Character Dossier Modal */
.dossier-card { text-align: left; }
.dossier-header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.dossier-portrait-wrap {
  width: 96px;
  height: 128px;
  border-radius: 3px;
  border: 1px solid var(--hero-accent);
  background: var(--bg-deep);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dossier-portrait { width: 100%; height: 100%; object-fit: contain; }
.dossier-fallback { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dossier-fallback canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.dossier-title-col h3 { font-size: 16px; margin: 4px 0; }
.dossier-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.dossier-tag {
  font-size: 12px;
  padding: 2px 6px;
  clip-path: var(--chamfer-xs);
  background: var(--hero-soft);
  color: var(--hero-text);
}
.dossier-lore { font-size: 14px; line-height: 1.6; color: #e2e7ff; }
.dossier-quote {
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 3px solid var(--hero-accent);
  background: rgba(20, 26, 44, 0.85);
  font-size: 13.5px;
  color: var(--gold);
}

/* ================= CODEX ================= */
.codex-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.codex-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background:
    linear-gradient(90deg, rgba(9, 11, 18, 0.95) 0%, rgba(9, 11, 18, 0.85) 66%, rgba(9, 11, 18, 0.42) 100%),
    url("./assets/backgrounds/skill-tree-console.webp") center 10% / cover no-repeat,
    var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hero-accent);
  clip-path: var(--chamfer-sm);
  padding: 8px 10px;
}
.codex-progress-track {
  width: 96px;
  height: 6px;
  background: #0a0d17;
  overflow: hidden;
  border: 1px solid var(--border);
}
.codex-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hero-accent), var(--gold));
}
.codex-recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.codex-recipe-card.awakened {
  border-color: rgba(255, 209, 102, 0.65);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.08) 0%, rgba(255, 77, 109, 0.08) 100%);
}
.codex-chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.codex-node {
  flex: 1;
  min-width: 0;
  background: #0e1220;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
.codex-node.evo-node.awakened {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.16), rgba(255, 77, 109, 0.12));
}
.codex-node.evo-node.locked { border-style: dashed; opacity: 0.72; }
.codex-node.evo-node.locked canvas { filter: grayscale(0.85) brightness(0.6); }
.codex-node canvas { width: 26px; height: 26px; image-rendering: pixelated; }
.codex-node-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.codex-node-sub { font-size: 11.5px; color: var(--text-muted); }
.codex-node.evo-node.awakened .codex-node-name { color: var(--gold); }
.codex-link-op { font-size: 13.5px; font-weight: 800; color: var(--cyan); flex-shrink: 0; }
.codex-link-op.arrow { color: var(--gold); }
.codex-recipe-detail {
  font-size: 13px;
  line-height: 1.48;
  color: #cdd5f5;
  background: rgba(9, 11, 18, 0.72);
  border-radius: 2px;
  padding: 5px 7px;
}

/* ================= DYNAMIC TRADING POST ================= */
.market-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  background:
    linear-gradient(90deg, rgba(9, 11, 18, 0.96) 0%, rgba(9, 11, 18, 0.78) 54%, rgba(9, 11, 18, 0.24) 100%),
    url("./assets/backgrounds/black-market-terminal.webp") right center / cover no-repeat,
    var(--bg-card);
  border: 1px solid rgba(76, 232, 255, 0.35);
  border-left: 3px solid var(--cyan);
  clip-path: var(--chamfer-sm);
  padding: 8px 10px;
}
.market-cycle-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  color: var(--cyan);
}
.market-top-meta {
  min-width: 0;
  flex: 1;
}
.market-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(9, 11, 18, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 209, 102, 0.58);
  color: var(--gold);
  clip-path: var(--chamfer-xs);
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.market-refresh-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.market-subhead { display: flex; justify-content: space-between; align-items: center; }
.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  color: #ffb866;
}
.hot-market-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.hot-card {
  background: linear-gradient(145deg, rgba(255, 165, 68, 0.16), rgba(16, 20, 32, 0.96));
  border: 1.5px solid rgba(255, 185, 86, 0.62);
  border-top: 3px solid #ffd166;
  clip-path: var(--chamfer-sm);
  padding: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.hot-card canvas { width: 32px; height: 32px; image-rendering: pixelated; flex-shrink: 0; }
.hot-card-meta { flex: 1; min-width: 0; }
.hot-card-title { font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-card-price { font-family: var(--font-display); font-size: 13.5px; font-weight: 900; color: var(--gold); }
.hot-card-tag { font-size: 12px; color: #ffd6a5; white-space: nowrap; }
.hot-card .commission-accept {
  flex-basis: 100%;
  min-height: 32px;
  background: linear-gradient(95deg, #ffd166, #ff9f43);
  color: #1c1008;
  border: none;
  font-weight: 900;
}
.hot-card .commission-accept.accepted {
  background: rgba(76, 232, 255, 0.16);
  border: 1px solid var(--cyan);
  color: var(--cyan);
}

.commission-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-left: 2px solid var(--hero-accent);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
}
.commission-note button { min-height: 30px; }
.hud-commission { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.hud-commission.commission-ready { color: var(--gold); }

.market-grid-2 { display: flex; flex-direction: column; gap: 5px; }
.ticker-card {
  background: rgba(14, 18, 32, 0.94);
  border: 1px solid rgba(76, 232, 255, 0.25);
  clip-path: var(--chamfer-xs);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ticker-card.is-hot { border-color: rgba(255, 165, 92, 0.72); background: rgba(255, 107, 74, 0.1); }
.ticker-card.is-rising { border-color: rgba(59, 240, 140, 0.45); }
.ticker-card.is-falling { border-color: rgba(255, 77, 94, 0.42); }
.ticker-card canvas { width: 24px; height: 24px; image-rendering: pixelated; flex-shrink: 0; }
.ticker-mid { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.ticker-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-owned { font-size: 11.5px; color: var(--cyan); flex-shrink: 0; }
.ticker-spark { width: 52px; height: 18px; display: block; flex-shrink: 0; }
.ticker-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; text-align: right; }
.ticker-mult { font-family: var(--font-display); font-size: 13px; font-weight: 800; }
.ticker-pct { font-size: 12px; font-weight: 800; min-width: 48px; text-align: right; }
.txt-up { color: var(--green); }
.txt-down { color: #ff7585; }
.txt-hot { color: var(--gold); }
.txt-flat { color: var(--text-muted); }

.market-divider { border-top: 1px dashed var(--border); margin: 2px 0; }
.market-action-row { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 7px; }
.rising-btn {
  background: linear-gradient(90deg, #ffd166, #ff856d);
  color: #1b1016;
  border: none;
  clip-path: var(--chamfer-xs);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.rising-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rising-btn,
.market-action-row .accent-btn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loot-trend-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(9, 11, 18, 0.88);
}
.loot-base-val { font-size: 11.5px; color: var(--text-muted); text-decoration: line-through; }

/* ================= IN-RAID VS SINGLE-ROW 6+6 SLOTS & AWAKENING ================= */
.vs-slots-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.vs-slot-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}
.vs-slot-divider {
  width: 1px;
  height: 15px;
  background: rgba(148, 168, 224, 0.32);
}
.vs-slot {
  height: 21px;
  background: rgba(16, 22, 38, 0.9);
  border: 1px solid #2b3456;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.vs-slot.empty { border-style: dashed; opacity: 0.45; }
.vs-slot.filled-weapon { border-color: rgba(76, 232, 255, 0.55); background: rgba(76, 232, 255, 0.08); }
.vs-slot.filled-book { border-color: rgba(184, 125, 255, 0.55); background: rgba(184, 125, 255, 0.09); }
.vs-slot.ready-evo { border-color: var(--gold); box-shadow: 0 0 8px rgba(255, 209, 102, 0.45); }
.vs-slot.awakened {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.24), rgba(255, 77, 109, 0.2));
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.4);
}
.vs-slot.union {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(76, 232, 255, 0.24), rgba(255, 209, 102, 0.22));
  box-shadow: 0 0 8px rgba(76, 232, 255, 0.45);
}
.vs-slot canvas { width: 14px; height: 14px; image-rendering: pixelated; flex-shrink: 0; }
.vs-slot-lv {
  position: absolute;
  right: 1px;
  bottom: 0;
  padding: 0 2px;
  border-radius: 1px;
  background: rgba(8, 11, 20, 0.88);
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.05;
  white-space: nowrap;
  pointer-events: none;
}
.vs-slot.awakened .vs-slot-lv { color: var(--gold); }
.vs-slot.union .vs-slot-lv { color: var(--cyan); }
.vs-slot-empty-dot { font-size: 10px; color: #4b5680; display: inline-flex; }
.vs-slot-empty-dot .ui-ico { width: 10px; height: 10px; }

.awakening-banner {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, rgba(38, 22, 16, 0.96), rgba(45, 16, 36, 0.96));
  border: 2px solid var(--gold);
  clip-path: var(--chamfer-sm);
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  box-shadow: 0 8px 26px rgba(255, 209, 102, 0.45);
}
.awakening-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  border: 1px solid var(--gold);
  background: #141122;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.awakening-icon-box canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.awakening-body { min-width: 0; text-align: left; }
.awakening-source { font-size: 12px; font-weight: 800; color: var(--gold); }
.awakening-title { font-size: 15px; font-weight: 900; color: #fff; }
.awakening-desc { font-size: 12.5px; color: #ffd6e4; }
.bark-body { min-width: 0; }

.choice-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
  padding: 2px 7px;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  vertical-align: middle;
  background: #4ce8ff;
  color: #08101c;
}
.choice-tag.evo { background: #ffd166; color: #191003; }
.choice-tag.book { background: #3bf08c; color: #061810; }
.choice-synergy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 9px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: linear-gradient(95deg, #f3a81e, #ffd166);
  color: #150e02;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
}

.result-market-note {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 2px;
  background: rgba(76, 232, 255, 0.08);
  border-left: 2px solid var(--cyan);
  font-size: 13px;
  color: #d6f7ff;
  white-space: pre-line;
}

.locked-feature-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.market-locked-banner {
  background:
    linear-gradient(90deg, rgba(9, 11, 18, 0.96) 0%, rgba(9, 11, 18, 0.85) 54%, rgba(9, 11, 18, 0.28) 100%),
    url("./assets/backgrounds/black-market-terminal.webp") right center / cover no-repeat,
    var(--bg-card);
  border-style: solid;
  border-color: var(--border);
  border-left: 3px solid var(--gold);
  clip-path: var(--chamfer-md);
}
.lock-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.lock-icon .ui-ico {
  width: 24px;
  height: 24px;
}
.lock-title { font-size: 15px; font-weight: 800; color: var(--gold); }
.lock-progress-pill {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(76, 232, 255, 0.1);
  border: 1px solid rgba(76, 232, 255, 0.35);
  clip-path: var(--chamfer-xs);
  padding: 3px 10px;
  margin-top: 2px;
}
.market-unlocked-board { display: flex; flex-direction: column; gap: 8px; }
.market-action-row.single-action { grid-template-columns: 1fr; }

/* Codex Grid, 4-Pill Switcher, Spotlight Blueprint & Filter Bar */
#codex-hero-pills.pill-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.codex-cat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 3px;
  clip-path: var(--chamfer-xs);
  background: rgba(14, 18, 32, 0.94);
  border: 1px solid rgba(148, 168, 224, 0.28);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.codex-cat-pill strong { font-size: 12.5px; color: #fff; }
.codex-cat-pill.active[data-cat="weapons"] { border-color: var(--pink); background: rgba(255, 77, 109, 0.22); color: #ffb2c2; }
.codex-cat-pill.active[data-cat="passives"] { border-color: var(--purple); background: rgba(184, 125, 255, 0.22); color: #e2c5ff; }
.codex-cat-pill.active[data-cat="evos"] { border-color: var(--cyan); background: rgba(76, 232, 255, 0.22); color: #b5f5ff; }
.codex-cat-pill.active[data-cat="unions"] { border-color: var(--gold); background: rgba(255, 209, 102, 0.22); color: #ffe7a3; }

.codex-node.is-silhouette { border-style: dashed; border-color: #2f3856; background: #0a0d18; }
.codex-node.is-silhouette canvas { filter: drop-shadow(0 0 1px rgba(152, 162, 200, 0.48)); }
.codex-node.is-silhouette .codex-node-name { color: #7d86ab; letter-spacing: 1px; }
.codex-collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
@media (min-width: 640px) {
  .codex-collection-grid { grid-template-columns: repeat(4, 1fr); }
}
.codex-collection-grid .codex-node {
  clip-path: var(--chamfer-sm);
  padding: 9px 5px;
  cursor: pointer;
  border-top: 2px solid rgba(76, 232, 255, 0.35);
}
.codex-collection-grid .codex-node.is-selected {
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.3);
}
.codex-node.is-unlock-locked { border-style: dotted; border-color: rgba(255, 77, 109, 0.45); }
.codex-filter-bar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 2px; }
.codex-filter-row { display: flex; align-items: center; gap: 6px; }
.codex-status-pills { display: flex; gap: 4px; flex: 1; }
.codex-status-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  clip-path: var(--chamfer-xs);
  padding: 6px 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.codex-status-btn.active {
  border-color: var(--cyan);
  color: #090b12;
  background: var(--cyan);
}
.codex-arch-select {
  background: #101422;
  color: var(--text-main);
  border: 1px solid rgba(76, 232, 255, 0.4);
  clip-path: var(--chamfer-xs);
  padding: 6px 8px;
  font-size: 12px;
  max-width: 146px;
}
.codex-detail-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.14) 0%, rgba(13, 17, 30, 0.96) 65%);
  border: 1.5px solid rgba(255, 77, 109, 0.55);
  clip-path: var(--chamfer-md);
  padding: 10px 11px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.codex-detail-card canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.25), #090c16);
  clip-path: var(--chamfer-sm);
  padding: 5px;
  border: 1px solid rgba(255, 77, 109, 0.6);
  flex-shrink: 0;
}
.codex-detail-body { flex: 1; min-width: 0; font-size: 13px; }
.codex-detail-head { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; margin-bottom: 3px; color: #fff; }
.codex-detail-unlock {
  color: var(--gold);
  font-size: 12px;
  margin-top: 5px;
  padding: 3px 7px;
  background: rgba(255, 209, 102, 0.1);
  border-left: 2px solid var(--gold);
}
.codex-recipe-card.is-union {
  border-color: rgba(76, 232, 255, 0.55);
  background: linear-gradient(135deg, rgba(76, 232, 255, 0.08) 0%, rgba(255, 209, 102, 0.06) 100%);
}
.codex-node.union-node.awakened {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(76, 232, 255, 0.18), rgba(255, 209, 102, 0.14));
}

/* Curse Toggle Chips Inside Skill Tree Inspector */
.curse-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.curse-chip-btn {
  background: rgba(18, 22, 36, 0.96);
  border: 1px solid rgba(255, 209, 102, 0.36);
  color: #ffe28a;
  clip-path: var(--chamfer-xs);
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.curse-chip-btn.active {
  background: linear-gradient(95deg, #ff4d5e, #ff9947);
  color: #0b0d17;
  border-color: transparent;
}

/* Level-Up Actions */
.levelup-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.lvl-action-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--act-rim, rgba(132, 152, 208, 0.55));
  border: none;
  color: #ffffff;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  padding: 9px 7px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  cursor: pointer;
}
.lvl-action-btn::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  background: linear-gradient(180deg, rgba(20, 26, 44, 0.96), rgba(9, 12, 22, 0.98));
  z-index: -1;
}
.lvl-action-btn .ui-ico { width: 12px; height: 12px; }
.lvl-action-btn.reroll { --act-rim: #ffd166; }
.lvl-action-btn.banish { --act-rim: #ff3b7f; }
.lvl-action-btn.skip { --act-rim: #4ce8ff; }
.lvl-action-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.lvl-action-btn:hover:not(:disabled) { filter: brightness(1.16); }
.lvl-action-btn.banish.armed::before {
  background: rgba(110, 18, 42, 0.94);
}
.choice-card.banish-armed { --choice-rim: #ff4d5e; --choice-tint: rgba(74, 14, 28, 0.96); }
.lvl-banish-hint { margin-top: 6px; font-size: 12.5px; color: #ff99a8; font-weight: 700; }

/* Unlock Celebration Modal */
.unlock-card { text-align: left; }
.unlock-stage-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.unlock-portrait {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  object-fit: cover;
  object-position: center 25%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.unlock-fallback-px {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  background: #14192b;
  border: 2px solid var(--gold);
  image-rendering: pixelated;
  flex-shrink: 0;
}
.unlock-stage-tag { font-size: 13px; font-weight: 800; color: var(--cyan); margin-bottom: 3px; }
.unlock-text-col h3 { font-size: 16.5px; color: var(--gold); }
.unlock-modal-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #eff2ff;
  background: rgba(16, 21, 34, 0.9);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  padding: 8px 10px;
}
.unlock-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.unlock-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  clip-path: var(--chamfer-xs);
  background: rgba(59, 240, 140, 0.14);
  border: 1px solid rgba(59, 240, 140, 0.45);
  color: var(--green);
}

/* ================= RESPONSIVE COMPACT SCREENS (PHONES / NARROW SHORT WINDOWS) ================= */
@media (max-height: 700px) and (max-width: 959px) {
  .top-bar { padding: calc(5px + env(safe-area-inset-top, 0px)) 10px 5px; }
  .mainline-banner { padding: 4px 10px 4px; gap: 2px; }
  .tab-btn { padding: 6px 2px; }
  .tab-panel { padding: 8px 10px calc(50px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  #tab-deploy.tab-panel { gap: 4px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .deploy-dock { gap: 4px; }
  .hero-stage-v2 { height: clamp(178px, 26.5vh, 198px); }
  .hero-info { bottom: 6px; right: 72px; }
  .hero-name-row h2 { font-size: 16.5px; }
  .stage-side-rail { width: 62px; gap: 4px; }
  .select-card { height: 64px; }
  .zone-list { max-height: 106px; gap: 5px; }
  .zone-card { min-height: 50px; padding: 5px 8px; }
  .primary-cta { padding: 9px 12px; font-size: 15px; }
  .raid-hud-top { padding: 4px 7px; gap: 2px; }
  .vs-slot { height: 20px; }
  .vs-slot canvas { width: 13px; height: 13px; }
  .dock-block { padding: 3px 5px 4px; }
  .inv-slot { width: 42px; height: 42px; }
  .inv-slot canvas { width: 20px; height: 20px; }
  .skill-tree-stage { height: 320px; max-height: 44vh; }
  .skill-node { width: 38px; height: 38px; }
  .skill-node.is-keystone { width: 44px; height: 44px; }
  .skill-node-svg { width: 18px; height: 18px; }
  .skill-node.is-keystone .skill-node-svg { width: 21px; height: 21px; }
  .skill-inspector { padding: 8px 10px; }
}

@media (max-width: 460px) {
  .market-grid-2 { flex-direction: column; }
  .hot-market-grid { grid-template-columns: repeat(2, 1fr); }
  #stash-grid.loot-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 375px) {
  .brand h1 { font-size: 16px; }
  .badge-t { font-size: 11px; padding: 1px 5px; }
  .story-btn { padding: 4px 8px; font-size: 12px; }
  .coin-pill { padding: 4px 8px; font-size: 13px; }
  .icon-btn { width: 29px; height: 29px; font-size: 13.5px; }
  .tab-btn { font-size: 12.5px; gap: 2px; }
  .mini-pill { font-size: 11px; padding: 1px 4px; }
  .codex-collection-grid { gap: 5px; }
  .shop-consumables-grid { gap: 5px; }
  .market-action-row { grid-template-columns: 1fr 1fr; }
}

/* ================= ONBOARDING TUTORIAL OVERLAYS ================= */
.story-rule-strip {
  margin-top: 8px;
  padding: 6px 9px;
  background: rgba(76, 232, 255, 0.12);
  border: 1px solid rgba(76, 232, 255, 0.42);
  border-left: 3px solid var(--cyan);
  clip-path: var(--chamfer-xs);
  font-size: 12.5px;
  font-weight: 700;
  color: #b7f5ff;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.rules-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.rules-btn-row .accent-btn {
  padding: 10px 8px;
  font-size: 13px;
}

.hideout-tutorial-tip {
  position: absolute;
  top: 132px;
  left: 10px;
  right: 10px;
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(11, 16, 29, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(76, 232, 255, 0.56);
  border-left: 3px solid var(--gold);
  clip-path: var(--chamfer-sm);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
}
.hideout-tip-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #e6eeff;
  line-height: 1.35;
}
.hideout-tip-badge {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 5px;
  clip-path: var(--chamfer-xs);
  background: rgba(255, 209, 102, 0.18);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
}
.hideout-tip-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.hideout-tip-close {
  padding: 4px 8px !important;
  font-size: 14px !important;
  line-height: 1;
}

.raid-tutorial-bar {
  position: relative;
  width: 100%;
  padding: 5px 9px;
  background: rgba(10, 15, 28, 0.9);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(76, 232, 255, 0.55);
  border-left: 3px solid var(--gold);
  clip-path: var(--chamfer-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.58);
  pointer-events: none;
}
.raid-tutorial-bar.shift-down {
  margin-top: 0;
}
.tut-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.tut-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.4px;
}
.tut-skip-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 168, 224, 0.35);
  color: #cbd5f5;
  clip-path: var(--chamfer-xs);
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.tut-title {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  line-height: 1.28;
}
.tut-hint {
  font-size: 11px;
  color: var(--cyan);
  margin-top: 1px;
  line-height: 1.22;
}

.safe-block.tutorial-glow {
  border-color: var(--gold) !important;
  filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.72));
}

/* ============================================================================
   BASE BUNKER, COMPANION BOND STAGE & GIFTING STYLES (v32)
   ============================================================================ */

@keyframes pulseReady {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

@keyframes companionBreathe {
  0%, 100% { scale: 1; translate: 0 0; }
  50% { scale: 1.012; translate: 0 -2px; }
}

@keyframes companionBounce {
  0% { scale: 1 1; translate: 0 0; }
  30% { scale: 1.045 0.96; translate: 0 3px; }
  65% { scale: 0.985 1.03; translate: 0 -5px; }
  100% { scale: 1 1; translate: 0 0; }
}

@keyframes fxFloatUp {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -8px) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(0.85); }
}

.companion-breathe {
  animation: companionBreathe 4.2s ease-in-out infinite;
  transform-origin: center bottom;
}

.companion-bounce {
  animation: companionBounce 0.46s cubic-bezier(0.22, 1.4, 0.36, 1) forwards !important;
}

.portrait-box.is-interactive {
  pointer-events: auto;
  cursor: pointer;
}

.companion-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
}

.companion-fx-particle {
  position: absolute;
  font-size: 13px;
  font-weight: 900;
  color: #ff7ab8;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  animation: fxFloatUp 0.95s ease-out forwards;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.companion-fx-particle.is-gold {
  color: var(--gold);
}
.companion-fx-particle.is-pout {
  color: #fca5a5;
}

.deploy-quote-bubble {
  position: absolute;
  top: 52px;
  left: 10px;
  max-width: 152px;
  z-index: 6;
  background: rgba(12, 16, 29, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 168, 224, 0.32);
  border-left: 3px solid var(--hero-accent);
  clip-path: var(--chamfer-xs);
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.38;
  color: #f8fafc;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.bond-mini-pill {
  border-color: rgba(255, 122, 184, 0.48) !important;
  color: #ff9ec9 !important;
  cursor: pointer;
  pointer-events: auto;
}

/* Base Companion Interactive Card */
.base-companion-stage {
  position: relative;
  border: 1px solid rgba(148, 168, 224, 0.24);
  border-top: 2px solid var(--hero-accent);
  clip-path: var(--chamfer-card);
  padding: 6px 9px 8px;
  background: radial-gradient(circle at 22% 45%, var(--hero-soft), rgba(10, 13, 23, 0.96) 72%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.base-stage-topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.base-hero-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.base-hero-chip {
  background: rgba(11, 15, 28, 0.78);
  border: 1px solid rgba(148, 168, 224, 0.28);
  color: #cbd5f5;
  clip-path: var(--chamfer-xs);
  padding: 3px 8px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.base-hero-chip.active {
  background: linear-gradient(105deg, var(--hero-accent), var(--hero-accent-2));
  border-color: transparent;
  color: #fff;
}
.base-hero-chip.is-locked {
  opacity: 0.55;
  color: #8894b8;
}

.base-poke-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(11, 15, 28, 0.78);
  border: 1px solid rgba(76, 232, 255, 0.3);
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
}

#tab-base.tab-panel {
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
}

.base-stage-main {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(104px, 36%) 1fr;
  gap: 8px;
  align-items: stretch;
  min-height: 152px;
}

.base-portrait-slot {
  position: relative;
  height: auto;
  min-height: 152px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.base-portrait-img {
  height: 102%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: top center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.72));
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 80%, transparent 100%);
  mask-composite: intersect;
}

.base-portrait-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.base-portrait-fallback canvas {
  width: 84px;
  height: 84px;
  image-rendering: pixelated;
}

.base-expr-badge {
  position: absolute;
  left: 2px;
  bottom: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  background: rgba(9, 12, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
  border-radius: 2px;
  pointer-events: none;
}

.base-companion-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.base-hero-head {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 0;
}
.base-hero-head h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.base-hero-head .skin-tag {
  min-width: 0;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.base-quote-bubble {
  position: relative;
  background: rgba(12, 17, 31, 0.9);
  border: 1px solid rgba(148, 168, 224, 0.3);
  border-left: 3px solid var(--hero-accent);
  clip-path: var(--chamfer-sm);
  padding: 7px 9px;
  min-height: 54px;
  display: flex;
  align-items: center;
}
.base-quote-bubble p {
  margin: 0;
  font-size: 12px;
  line-height: 1.42;
  color: #f1f5ff;
}

.base-bond-block {
  background: rgba(9, 12, 22, 0.72);
  border: 1px solid rgba(148, 168, 224, 0.2);
  padding: 6px 8px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.base-bond-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.bond-lv-text {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.4px;
}

.bond-hearts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.2);
}
.bond-heart {
  display: inline-flex;
  width: 12px;
  height: 12px;
}
.bond-heart svg {
  width: 100%;
  height: 100%;
}
.bond-heart.is-filled {
  color: #ff6b9d;
  filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.65));
}

.bond-xp-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.base-bond-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.base-bond-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hero-accent), #ff7ab8, var(--cyan));
  transition: width 0.25s ease-out;
}

.base-bond-perk {
  font-size: 11px;
  color: var(--cyan);
  line-height: 1.3;
}

.base-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.base-talk-btn,
.base-gift-btn {
  border: none;
  clip-path: var(--chamfer-xs);
  padding: 8px 6px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.base-talk-btn {
  background: linear-gradient(105deg, rgba(76, 232, 255, 0.2), rgba(56, 189, 248, 0.32));
  border: 1px solid rgba(76, 232, 255, 0.5);
  color: #e0f7ff;
}
.base-gift-btn {
  background: linear-gradient(105deg, var(--hero-accent), var(--hero-accent-2));
  color: #fff;
}
.base-talk-btn:active,
.base-gift-btn:active {
  transform: scale(0.97);
}

/* Starlight Bunker 3-Layer Cutaway Stack */
.bunker-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 0 auto;
  min-height: 0;
}

.bunker-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.bunker-header-row .section-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bunker-bonus-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.34);
  padding: 2px 7px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.bunker-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 0 auto;
  min-height: 0;
}

.bunker-room {
  position: relative;
  flex: 1 0 78px;
  min-height: 78px;
  max-height: 170px;
  border: 1px solid rgba(148, 168, 224, 0.25);
  border-left: 3px solid var(--cyan);
  clip-path: var(--chamfer-sm);
  overflow: hidden;
  background: #0a0e19;
}
.bunker-room.is-ready {
  border-color: rgba(52, 211, 153, 0.72);
  border-left-color: #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.18);
}

.bunker-room-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
  filter: brightness(0.92) contrast(1.04);
  pointer-events: none;
}

.bunker-room-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 20, 0.05) 0%, rgba(8, 11, 20, 0.18) 52%, rgba(8, 11, 20, 0.88) 100%);
  pointer-events: none;
  z-index: 1;
}

.bunker-room-canvas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  width: 100%;
  height: 56px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 2;
}

.bunker-room-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 3;
}
.bunker-room-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #34d399);
  transition: width 0.3s linear;
}

.bunker-room-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(8, 11, 20, 0.86);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bunker-room-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.bunker-room-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  color: var(--cyan);
  white-space: nowrap;
  flex-shrink: 0;
}

.bunker-room-status {
  font-size: 11.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bunker-room-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.bunker-mini-btn {
  background: rgba(148, 168, 224, 0.18);
  border: 1px solid rgba(148, 168, 224, 0.38);
  color: #f8fafc;
  clip-path: var(--chamfer-xs);
  padding: 3px 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.bunker-mini-btn.accent {
  background: rgba(76, 232, 255, 0.22);
  border-color: rgba(76, 232, 255, 0.56);
  color: #d8f8ff;
}
.bunker-mini-btn.gold-btn {
  background: rgba(255, 209, 102, 0.22);
  border-color: rgba(255, 209, 102, 0.62);
  color: var(--gold);
}
.bunker-mini-btn.is-ready {
  background: linear-gradient(105deg, #10b981, #06b6d4);
  border-color: transparent;
  color: #031518;
}
.bunker-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bunker-collect-btn {
  width: 100%;
  border: none;
  clip-path: var(--chamfer-sm);
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  background: linear-gradient(105deg, #22d3ee, #10b981);
  color: #04151b;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.26);
}
.bunker-collect-btn.is-idle {
  background: rgba(25, 33, 56, 0.9);
  color: #94a3b8;
  border: 1px solid rgba(148, 168, 224, 0.22);
  box-shadow: none;
}

.bunker-toast {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.48);
  color: #a7f3d0;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 3px;
}

/* Gift Visual Blend Fix & Gifting / Bunker Modals */
.gift-art-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 56%, transparent 88%);
  mask-image: radial-gradient(circle, #000 56%, transparent 88%);
}

.gift-card,
.bunker-modal-card {
  max-height: 86vh;
  overflow-y: auto;
  padding: 14px;
}

.modal-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.gift-bond-summary {
  background: rgba(11, 15, 27, 0.85);
  border: 1px solid rgba(148, 168, 224, 0.22);
  padding: 7px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gift-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.gift-crafted-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.gift-item-card {
  background: rgba(13, 18, 32, 0.9);
  border: 1px solid rgba(148, 168, 224, 0.24);
  clip-path: var(--chamfer-xs);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gift-item-card.is-fav {
  border-color: rgba(255, 107, 157, 0.65);
  background: linear-gradient(160deg, rgba(255, 107, 157, 0.14), rgba(13, 18, 32, 0.94));
}

.gift-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gift-item-meta {
  min-width: 0;
  flex: 1;
  text-align: left;
}
.gift-item-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
}
.gift-item-xp {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
}
.gift-item-card.is-fav .gift-item-xp {
  color: #ff8fc0;
}
.gift-item-qty {
  font-size: 11px;
  color: var(--text-muted);
}

.gift-item-actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
}
.gift-item-actions button {
  flex: 1;
  padding: 5px 6px;
  font-size: 11.5px;
}
.gift-item-actions .accent-btn,
.bunker-option-btns .accent-btn {
  color: #031518;
  font-weight: 900;
}

.gift-stash-list,
.bunker-modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.gift-stash-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 18, 32, 0.88);
  border: 1px solid rgba(148, 168, 224, 0.2);
  padding: 6px 8px;
  border-radius: 3px;
}

.gift-stash-canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.gift-stash-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.gift-stash-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}
.gift-stash-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.gift-pref-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
}
.gift-pref-tag.fav {
  background: rgba(255, 107, 157, 0.22);
  color: #ff8fc0;
}
.gift-pref-tag.like {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}
.gift-pref-tag.dislike {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.bunker-option-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(12, 17, 31, 0.92);
  border: 1px solid rgba(148, 168, 224, 0.25);
  clip-path: var(--chamfer-xs);
  padding: 9px 10px;
}
.bunker-option-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bunker-option-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.bunker-option-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.bunker-option-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.38;
}
.bunker-option-btns {
  display: flex;
  gap: 6px;
}
.bunker-option-btns button {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
}

.dossier-secret-box {
  background: rgba(15, 20, 36, 0.9);
  border: 1px solid rgba(255, 122, 184, 0.35);
  border-left: 3px solid var(--hero-accent);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.48;
  color: #e2e8f0;
  border-radius: 3px;
}
.dossier-secret-box.is-locked {
  border-color: rgba(148, 168, 224, 0.24);
  border-left-color: #64748b;
  color: var(--text-muted);
}

/* ============================================================================
   REUSABLE ANIME EMOTION COMPONENT & STARLIGHT WARDROBE ATELIER (v36)
   ============================================================================ */

@keyframes heroShyTilt {
  0%, 100% { rotate: -1.4deg; scale: 1.018; translate: 0 -2px; }
  50% { rotate: -2.2deg; scale: 1.028; translate: 0 -4px; }
}

@keyframes heroPoutShake {
  0% { rotate: 0deg; translate: 0 0; }
  20% { rotate: 1.8deg; translate: -2px -1px; }
  40% { rotate: -1.6deg; translate: 2px 0; }
  60% { rotate: 1.2deg; translate: -1px -1px; }
  80% { rotate: -0.9deg; translate: 1px 0; }
  100% { rotate: 0.5deg; translate: 0 0; }
}

@keyframes emotionPopIn {
  0% { opacity: 0; transform: scale(0.55) translateY(6px); }
  65% { opacity: 1; transform: scale(1.1) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes emotionFloatBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

@keyframes blushGlowBreath {
  0%, 100% { opacity: 0.42; transform: translateX(-50%) scale(0.95); }
  50% { opacity: 0.68; transform: translateX(-50%) scale(1.06); }
}

.is-expr-shy .portrait-img,
.is-expr-shy .base-portrait-img,
.is-expr-shy .wardrobe-portrait-img {
  animation: heroShyTilt 2.8s ease-in-out infinite !important;
  filter: drop-shadow(0 10px 22px rgba(255, 107, 157, 0.36)) saturate(1.06) brightness(1.03);
}

.is-expr-pout .portrait-img,
.is-expr-pout .base-portrait-img,
.is-expr-pout .wardrobe-portrait-img {
  animation: heroPoutShake 0.48s ease-out 1 forwards !important;
  filter: drop-shadow(0 10px 20px rgba(76, 232, 255, 0.25)) contrast(1.04);
}

.result-hero-banner.is-skin-mood.is-expr-win .result-portrait {
  filter: brightness(1.06) saturate(1.08) drop-shadow(0 0 18px rgba(255, 209, 102, 0.32));
}

.result-hero-banner.is-skin-mood.is-expr-mia .result-portrait {
  filter: grayscale(0.32) contrast(1.08) brightness(0.84);
}

.companion-emotion-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}

.emotion-aura {
  position: absolute;
  top: 15%;
  left: 50%;
  width: 118px;
  height: 82px;
  border-radius: 999px;
  pointer-events: none;
  animation: blushGlowBreath 2.2s ease-in-out infinite;
}
.emotion-aura.is-shy {
  background: radial-gradient(circle, rgba(255, 114, 178, 0.36) 0%, rgba(255, 77, 141, 0.14) 55%, transparent 78%);
}
.emotion-aura.is-pout {
  background: radial-gradient(circle, rgba(255, 92, 118, 0.22) 0%, rgba(76, 232, 255, 0.12) 55%, transparent 78%);
}
.emotion-aura.is-win {
  top: 10%;
  width: 170px;
  height: 110px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.26) 0%, transparent 72%);
}
.emotion-aura.is-mia {
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  transform: none;
  animation: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 77, 109, 0.06) 0 2px, transparent 2px 6px),
    radial-gradient(circle at 50% 40%, transparent 45%, rgba(255, 59, 92, 0.28) 100%);
}

.emotion-sticker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  animation: emotionPopIn 0.34s cubic-bezier(0.22, 1.4, 0.36, 1) forwards, emotionFloatBob 2.4s ease-in-out 0.35s infinite;
}
.emotion-sticker.is-shy {
  top: 16%;
  left: 56%;
  background: rgba(28, 12, 24, 0.88);
  border: 1px solid rgba(255, 130, 186, 0.72);
  color: #ff94c8;
}
.emotion-sticker.is-pout {
  top: 11%;
  left: 57%;
  background: rgba(24, 12, 18, 0.92);
  border: 1px solid rgba(255, 107, 107, 0.78);
  color: #ff7b8a;
}
.emotion-sticker.is-win {
  top: 12%;
  right: 12%;
  background: rgba(24, 20, 10, 0.86);
  border: 1px solid rgba(255, 209, 102, 0.72);
  color: #ffd166;
}
.emotion-sticker.is-mia {
  top: 12%;
  right: 12%;
  background: rgba(28, 8, 14, 0.9);
  border: 1px solid rgba(255, 77, 109, 0.76);
  color: #ff6b81;
}

.emotion-sub-chip {
  position: absolute;
  top: 28%;
  left: 22%;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #ff85c0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  animation: emotionPopIn 0.4s ease-out forwards;
}

.base-wardrobe-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 79, 163, 0.16);
  border: 1px solid rgba(255, 133, 192, 0.56);
  color: #ffd8ec;
  clip-path: var(--chamfer-xs);
  padding: 2px 7px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.base-wardrobe-btn .ui-ico {
  width: 12px;
  height: 12px;
  color: #ff85c0;
}

/* Starlight Wardrobe Atelier Modal */
.wardrobe-card {
  width: min(100%, 420px);
  max-height: 94vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #090c15;
  border: 1px solid rgba(255, 133, 192, 0.36);
  border-top: 2px solid #ff6eb8;
  overflow-y: auto;
}

.wardrobe-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wardrobe-back-btn {
  background: rgba(15, 20, 36, 0.88);
  border: 1px solid rgba(148, 168, 224, 0.34);
  color: #e2e8f0;
  clip-path: var(--chamfer-xs);
  padding: 5px 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.wardrobe-title-wrap {
  text-align: center;
  min-width: 0;
}
.wardrobe-sub-tag {
  display: block;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #ff85c0;
}
.wardrobe-title-wrap h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}
.wardrobe-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.42);
  clip-path: var(--chamfer-xs);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.wardrobe-stage {
  position: relative;
  height: 292px;
  border: 1px solid rgba(148, 168, 224, 0.24);
  clip-path: var(--chamfer-md);
  background: #080b14;
  overflow: hidden;
}

/* Built-in holographic vanity atelier lighting; optional wardrobe-dressing-room.webp can layer here later */
.wardrobe-stage-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 34%, rgba(255, 209, 102, 0.12) 0%, rgba(255, 79, 163, 0.08) 42%, transparent 74%),
    radial-gradient(circle at 14% 28%, rgba(76, 232, 255, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 86% 28%, rgba(255, 79, 163, 0.14) 0%, transparent 42%),
    linear-gradient(180deg, #0b1020 0%, #090c15 58%, #06080f 100%);
  pointer-events: none;
  z-index: 0;
}

.wardrobe-mirror-arch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 64%;
  height: 78%;
  border: 1px solid rgba(255, 209, 102, 0.24);
  box-shadow:
    inset 0 0 28px rgba(76, 232, 255, 0.08),
    0 0 24px rgba(255, 79, 163, 0.1);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 100%, 0 100%, 0 10%);
  pointer-events: none;
  z-index: 1;
}

.wardrobe-portrait-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
}
.wardrobe-portrait-img {
  height: 112%;
  width: auto;
  max-width: 80%;
  object-fit: contain;
  object-position: top center;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.8));
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 10%, #000 20%, #000 80%, rgba(0, 0, 0, 0.85) 90%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 72%, transparent 98%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.85) 10%, #000 20%, #000 80%, rgba(0, 0, 0, 0.85) 90%, transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 72%, transparent 98%);
  mask-composite: intersect;
}
.wardrobe-portrait-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wardrobe-portrait-fallback canvas {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}

.wardrobe-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 11, 20, 0.78) 65%, rgba(8, 11, 20, 0.98) 100%);
  pointer-events: none;
  z-index: 3;
}

.wardrobe-stage-hud-left {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 78px;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wardrobe-status-pill {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  clip-path: var(--chamfer-xs);
  background: rgba(15, 22, 38, 0.9);
  border: 1px solid rgba(148, 168, 224, 0.4);
  color: #cbd5f5;
}
.wardrobe-status-pill.is-equipped {
  border-color: var(--green);
  color: var(--green);
  background: rgba(10, 28, 20, 0.9);
}
.wardrobe-status-pill.is-owned {
  border-color: var(--cyan);
  color: var(--cyan);
}
.wardrobe-status-pill.is-preview {
  border-color: var(--gold);
  color: var(--gold);
}
.wardrobe-skin-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}
.wardrobe-skin-hint {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.wardrobe-stage-rail {
  position: absolute;
  right: 8px;
  top: 10px;
  bottom: 10px;
  z-index: 5;
  width: 62px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 6px;
}

.wardrobe-pixel-box {
  background: rgba(10, 14, 26, 0.88);
  border: 1px solid rgba(148, 168, 224, 0.34);
  clip-path: var(--chamfer-sm);
  padding: 5px 3px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #cbd5f5;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.wardrobe-pixel-box canvas {
  width: 48px;
  height: 50px;
  image-rendering: pixelated;
}

.wardrobe-expr-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(10, 14, 26, 0.86);
  border: 1px solid rgba(255, 133, 192, 0.28);
  clip-path: var(--chamfer-sm);
  padding: 4px;
}
.wardrobe-expr-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: #cbd5f5;
  padding: 4px 2px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  clip-path: var(--chamfer-xs);
}
.wardrobe-expr-btn.active {
  background: linear-gradient(105deg, rgba(255, 79, 163, 0.34), rgba(76, 232, 255, 0.24));
  border-color: #ff85c0;
  color: #fff;
}

.wardrobe-dock {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.wardrobe-hero-pills {
  display: flex;
  gap: 6px;
}
.wardrobe-hero-pills .pill-btn {
  flex: 1;
  text-align: center;
}

.wardrobe-skin-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.wardrobe-strip-card {
  position: relative;
  aspect-ratio: 3 / 3.7;
  background: #0d1221;
  border: 1.5px solid rgba(148, 168, 224, 0.28);
  clip-path: var(--chamfer-sm);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}
.wardrobe-strip-card.is-previewing {
  border-color: #ff6eb8;
  box-shadow: 0 0 14px rgba(255, 79, 163, 0.38);
}
.wardrobe-strip-card.is-equipped {
  border-color: var(--green);
}
.wardrobe-strip-card.is-previewing.is-equipped {
  box-shadow: 0 0 14px rgba(59, 240, 140, 0.42);
}
.wardrobe-strip-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
}
.wardrobe-strip-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(8, 11, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #e2e8f0;
}
.wardrobe-strip-badge.is-equipped {
  border-color: var(--green);
  color: var(--green);
}
.wardrobe-strip-badge.is-owned {
  border-color: var(--cyan);
  color: var(--cyan);
}
.wardrobe-strip-badge.is-locked {
  border-color: rgba(255, 209, 102, 0.55);
  color: var(--gold);
}
.wardrobe-strip-footer {
  position: relative;
  z-index: 2;
  padding: 18px 5px 5px;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 10, 18, 0.92) 55%, rgba(7, 10, 18, 0.98) 100%);
}
.wardrobe-strip-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wardrobe-action-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wardrobe-discount-note {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}
.wardrobe-primary-cta.is-shop-jump {
  background: linear-gradient(100deg, #ffd166, #ff8f3f);
  color: #1c1005;
}
.wardrobe-primary-cta.is-equipped {
  background: rgba(59, 240, 140, 0.16);
  border: 1px solid var(--green);
  color: var(--green);
}

.market-stash-col,
.upgrades-left-col,
.upgrades-right-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================================
   TABLET & DESKTOP FULL-SCREEN RESPONSIVE ADAPTATION (v39 HYBRID FULLSCREEN)
   ============================================================================ */

@media (min-width: 640px) {
  .top-bar,
  .mainline-banner,
  .tab-bar {
    padding-inline: 16px;
  }
  .tab-panel {
    padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .skin-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  }
  .loot-grid-4.compact {
    max-height: 210px;
  }
}

/* Tall / Square Desktop Splits & Portrait Tablets: keep centered single-column flow without crushing columns */
@media (min-width: 640px) and (max-width: 959px),
       (min-width: 640px) and (max-aspect-ratio: 119/100),
       (min-width: 640px) and (max-height: 619px) {
  .tab-panel {
    width: 100%;
    max-width: 820px;
    margin-inline: auto;
  }
  #tab-deploy .hero-stage-v2 {
    margin: 0;
    height: clamp(220px, 30vh, 330px);
    clip-path: var(--chamfer-md);
    border: 1px solid rgba(148, 168, 224, 0.24);
  }
  #tab-deploy .zone-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    gap: 8px;
  }
  #tab-deploy #zone-scroll-hint {
    display: none;
  }
  #tab-base.tab-panel {
    gap: 10px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .base-companion-stage {
    padding: 10px 12px;
    gap: 8px;
  }
  .base-stage-main {
    grid-template-columns: minmax(168px, 35%) 1fr;
    gap: 12px;
    min-height: 196px;
    align-items: center;
  }
  .base-portrait-slot {
    height: clamp(196px, 24vh, 250px);
    min-height: 196px;
  }
  .base-companion-panel {
    gap: 7px;
  }
  .bunker-section {
    gap: 8px;
    flex: 1 0 auto;
  }
  .bunker-room {
    flex: 1 0 92px;
    min-height: 92px;
    max-height: 205px;
  }
  .bunker-room-canvas {
    height: 68px;
    bottom: 26px;
  }
}

@media (min-width: 780px) {
  .modal-card {
    max-width: 500px;
  }
  .modal-card.modal-levelup {
    max-width: 560px;
  }
  .raid-top-cluster,
  .raid-bottom-cluster {
    width: min(calc(100% - 28px), 800px);
    margin-left: auto;
    margin-right: auto;
  }
  .raid-top-cluster {
    margin-top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .raid-bottom-cluster {
    margin-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .inv-slot {
    width: 48px;
    height: 48px;
  }

  #wardrobe-modal .wardrobe-card {
    width: min(94vw, 820px);
    max-width: none;
    max-height: 92vh;
    display: grid;
    grid-template-columns: minmax(320px, 48%) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 12px 14px;
    padding: 14px;
  }
  .wardrobe-topbar {
    grid-column: 1 / -1;
  }
  .wardrobe-stage {
    height: 100%;
    min-height: min(410px, 52vh);
  }
  .wardrobe-dock {
    min-height: 0;
    justify-content: space-between;
  }
  .wardrobe-skin-strip {
    flex: 1;
    align-content: start;
    gap: 8px;
  }
}

/* True Landscape Desktop: aspect >= 6:5 and height >= 620px */
@media (min-width: 960px) and (min-aspect-ratio: 6/5) and (min-height: 620px) {
  .top-bar,
  .mainline-banner,
  .tab-bar {
    padding-inline: 24px;
  }
  .tab-btn {
    font-size: 13.5px;
    padding: 9px 10px;
  }
  .tab-panel {
    width: 100%;
    max-width: 1520px;
    margin-inline: auto;
    padding: 14px 24px 20px;
    gap: 12px;
  }

  /* Deploy Tab: Full-Height Dual-Column Command Deck */
  #tab-deploy.tab-panel.active {
    display: grid;
    grid-template-columns: minmax(360px, 43%) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 24px 18px;
    overflow: hidden;
    align-items: stretch;
  }
  #tab-deploy .hero-stage-v2 {
    margin: 0;
    height: 100%;
    max-height: none;
    clip-path: var(--chamfer-md);
    border: 1px solid rgba(148, 168, 224, 0.24);
  }
  #tab-deploy .portrait-img {
    height: 106%;
    max-width: 88%;
  }
  #tab-deploy .stage-watermark {
    font-size: 24px;
    max-width: 60%;
  }
  #tab-deploy .deploy-quote-bubble {
    max-width: 230px;
    font-size: 12.5px;
  }
  #tab-deploy .deploy-dock {
    height: 100%;
    overflow-y: auto;
    gap: 10px;
    padding-right: 2px;
  }
  #tab-deploy .select-card {
    height: 86px;
  }
  #tab-deploy .zone-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 186px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    gap: 7px;
  }
  #tab-deploy #zone-scroll-hint {
    display: inline-flex;
  }
  #tab-deploy .zone-card {
    min-height: 60px;
  }

  /* Base & Bunker Tab: Full-Height Portrait Showcase + Frosted Bottom Companion HUD */
  #tab-base.tab-panel.active {
    display: grid;
    grid-template-columns: minmax(360px, 42%) minmax(0, 1fr);
    gap: 16px;
    padding: 14px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    align-items: stretch;
  }
  .base-companion-stage {
    height: 100%;
    min-height: 0;
    padding: 12px 14px;
    gap: 8px;
  }
  .base-stage-topbar {
    z-index: 6;
  }
  .base-stage-main {
    position: relative;
    display: block;
    flex: 1;
    min-height: 0;
  }
  .base-stage-main::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52%;
    background: linear-gradient(180deg, transparent 0%, rgba(9, 11, 18, 0.72) 55%, rgba(9, 11, 18, 0.96) 100%);
    pointer-events: none;
    z-index: 3;
  }
  .base-portrait-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
  }
  .base-portrait-img {
    height: 106%;
    width: auto;
    max-width: 94%;
    object-fit: contain;
    object-position: top center;
  }
  .base-expr-badge {
    top: 6px;
    right: 6px;
    bottom: auto;
    left: auto;
    z-index: 5;
    padding: 2px 8px;
  }
  .base-companion-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    background: rgba(9, 12, 22, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 168, 224, 0.28);
    border-top: 2px solid var(--hero-accent);
    clip-path: var(--chamfer-sm);
    padding: 10px 12px;
    gap: 7px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  }
  .base-hero-head .skin-tag {
    max-width: 150px;
  }
  .bunker-section {
    height: 100%;
    min-height: 0;
    gap: 10px;
    overflow-y: auto;
    padding-right: 2px;
    padding-bottom: 4px;
  }
  .bunker-stack {
    flex: 1 0 auto;
    min-height: 0;
    gap: 10px;
  }
  .bunker-room {
    flex: 1 1 0;
    min-height: 92px;
    max-height: none;
  }
  .bunker-room-canvas {
    height: 76px;
    bottom: 28px;
  }
  .bunker-room-hud {
    padding: 6px 12px;
  }
  .bunker-collect-btn {
    flex-shrink: 0;
  }

  /* Codex Tab: Responsive Multi-Column Archive */
  #tab-codex #codex-hero-pills.pill-row {
    max-width: 620px;
  }
  .codex-collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 10px;
  }

  /* Market & Stash Tab: Side-by-Side Live Ticker and Locker */
  #tab-market.tab-panel.active {
    display: grid;
    grid-template-columns: minmax(360px, 46%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px 16px;
    overflow: hidden;
    align-items: stretch;
  }
  #tab-market .tab-hero-strip {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  #tab-market #market-locked-card {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }
  #tab-market #market-unlocked-board {
    grid-column: 1;
    grid-row: 2;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
  }
  #tab-market .market-divider {
    display: none;
  }
  .market-stash-col {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
  }
  #stash-grid.loot-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  /* Upgrades Tab: Proportion-Safe 4:3 Astrolabe Console + Right Inspector */
  #tab-upgrades.tab-panel.active {
    display: grid;
    grid-template-columns: minmax(420px, 58%) minmax(320px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px 16px;
    overflow: hidden;
    align-items: stretch;
  }
  #tab-upgrades .tab-hero-strip {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .upgrades-left-col {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
  }
  .skill-tree-stage {
    flex: 1;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
  }
  .skill-tree-inner {
    width: min(100%, 660px);
    height: max(430px, 100%);
    min-height: 430px;
    margin: 0 auto;
  }
  .upgrades-right-col {
    grid-column: 2;
    grid-row: 2;
    justify-content: space-between;
    overflow-y: auto;
    min-height: 0;
  }

  /* Shop Tab: Prevent Giant Cards on Ultrawide */
  .shop-consumables-grid {
    gap: 12px;
  }
  .skin-grid {
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 12px;
  }
}

/* Shorter Landscape Laptops (e.g. 1280x640, 1366x768): keep portrait faces clear & CTA reachable */
@media (min-width: 960px) and (min-aspect-ratio: 6/5) and (min-height: 620px) and (max-height: 760px) {
  .tab-panel {
    padding-top: 10px;
    padding-bottom: 14px;
  }
  #tab-deploy .select-card {
    height: 70px;
  }
  #tab-deploy .zone-list {
    max-height: 140px;
  }
  #tab-deploy .zone-card {
    min-height: 56px;
  }
  .base-companion-panel {
    padding: 7px 9px;
    gap: 4px;
  }
  .base-quote-bubble {
    min-height: 36px;
    padding: 5px 8px;
  }
  .base-bond-block {
    padding: 4px 7px;
  }
  .base-action-row button {
    padding: 6px 8px;
  }
  .bunker-room {
    min-height: 82px;
  }
  .bunker-room-canvas {
    height: 60px;
    bottom: 23px;
  }
}


