:root {
  --bg: #0c0e0a;
  --bg-2: #161a12;
  --panel: rgba(28, 34, 22, 0.88);
  --panel-solid: #22281c;
  --line: #3a4530;
  --text: #e8ecd9;
  --muted: #9aa68a;
  --buy: #c4a35a;
  --buy-dim: rgba(196, 163, 90, 0.15);
  --sell: #6f9e7a;
  --sell-dim: rgba(111, 158, 122, 0.15);
  --danger: #c4725a;
  --focus: #d9c27a;
  --radius: 4px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --poster: url("/assets/alberta-badlands-cherno.jpg");
  --map-tint: rgba(18, 28, 16, 0.55);
}

body[data-map="chernarus"] {
  --map-tint: rgba(12, 28, 18, 0.58);
  --buy: #c9b06a;
}

body[data-map="nasdara"] {
  --map-tint: rgba(48, 28, 12, 0.52);
  --buy: #d4a45a;
  --line: #4a3a28;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  /* Transparent so fixed poster shows on lobby + shop */
  background: transparent;
  color: var(--text);
  font-family: var(--font);
}

/* Cinematic poster world — fixed under all screens */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0a0c08;
}

.world-poster {
  position: absolute;
  inset: 0;
  /* Fixed static poster — covers the whole viewport, does not scroll */
  background: var(--poster) center top / cover no-repeat;
  filter: saturate(1.08) contrast(1.04);
  animation: none;
  transform: none;
}

.world-scrim {
  position: absolute;
  inset: 0;
  /* Lobby: light veil so ALBERTA + scene stay visible */
  background:
    linear-gradient(180deg, rgba(6, 8, 6, 0.18) 0%, rgba(6, 8, 6, 0.32) 55%, rgba(6, 8, 6, 0.55) 100%),
    linear-gradient(105deg, rgba(8, 14, 10, 0.25) 0%, transparent 48%, rgba(40, 22, 10, 0.28) 100%);
  transition: background 0.6s ease;
}

/* Shop: slightly stronger so text stays readable over listings */
body.shop-open .world-scrim {
  background:
    linear-gradient(180deg, rgba(6, 8, 6, 0.28) 0%, rgba(6, 8, 6, 0.38) 40%, rgba(6, 8, 6, 0.5) 100%),
    linear-gradient(105deg, rgba(8, 14, 10, 0.22) 0%, transparent 50%, rgba(40, 22, 10, 0.22) 100%);
}

.world-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.45);
}

body.shop-open .world-vignette {
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.4);
}

body.shop-open .world-particles {
  display: none;
}

.gate,
#gate,
#shop {
  position: relative;
  z-index: 1;
}

.world-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(232, 236, 217, 0.45);
  box-shadow: 0 0 8px rgba(196, 163, 90, 0.4);
  animation: drift-up linear infinite;
  opacity: 0;
}

.world-particles span:nth-child(1) { left: 12%; bottom: -5%; animation-duration: 14s; animation-delay: 0s; }
.world-particles span:nth-child(2) { left: 28%; bottom: -8%; width: 2px; height: 2px; animation-duration: 18s; animation-delay: 2s; }
.world-particles span:nth-child(3) { left: 45%; bottom: -4%; animation-duration: 12s; animation-delay: 4s; }
.world-particles span:nth-child(4) { left: 58%; bottom: -10%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: 1s; }
.world-particles span:nth-child(5) { left: 72%; bottom: -6%; animation-duration: 16s; animation-delay: 3.5s; }
.world-particles span:nth-child(6) { left: 84%; bottom: -3%; width: 2px; height: 2px; animation-duration: 13s; animation-delay: 5s; }
.world-particles span:nth-child(7) { left: 35%; bottom: -12%; animation-duration: 22s; animation-delay: 6s; }
.world-particles span:nth-child(8) { left: 66%; bottom: -7%; animation-duration: 15s; animation-delay: 7s; }

@keyframes ken-burns {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.14) translate(-1.5%, 1%); }
}

@keyframes drift-up {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: 0.7; }
  80% { opacity: 0.35; }
  100% { transform: translateY(-110vh) translateX(18px); opacity: 0; }
}

@keyframes gate-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.7); opacity: 0.55; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .world-poster,
  .world-particles span,
  .gate-enter,
  .item,
  .pulse-ring {
    animation: none !important;
  }
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.eyebrow {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--buy);
}

h1 {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.lede {
  color: var(--muted);
  line-height: 1.45;
  max-width: 28rem;
}

/* Gate */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
}

.gate-hero-mark {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 140px;
  height: 140px;
  margin-left: -70px;
  pointer-events: none;
  opacity: 0.35;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(196, 163, 90, 0.55);
  border-radius: 50%;
  animation: pulse-ring 2.8s ease-out infinite;
}

.pulse-ring.delay {
  animation-delay: 1.2s;
}

.gate-card {
  width: min(640px, 100%);
  background: linear-gradient(160deg, rgba(18, 22, 14, 0.32), rgba(10, 12, 9, 0.26));
  border: 1px solid rgba(196, 163, 90, 0.4);
  padding: 2rem 1.75rem 1.5rem;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(1.05);
  position: relative;
  z-index: 1;
}

.gate-enter {
  animation: gate-rise 0.55s ease-out both;
}

.gate-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.gate-btn {
  appearance: none;
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(12, 14, 10, 0.32);
  color: var(--text);
  text-align: left;
  padding: 1rem 1.1rem;
  cursor: pointer;
  font: inherit;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  transition: border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.gate-btn:not(.map) {
  grid-template-columns: auto 1fr;
}

.gate-emoji {
  font-size: 1.55rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.gate-copy {
  min-width: 0;
}

.gate-arrow {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--buy);
  opacity: 0.55;
  transition: transform 0.2s, opacity 0.2s;
}

.gate-btn:hover,
.gate-btn:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--focus);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.gate-btn:hover .gate-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.gate-btn.cherno:hover {
  background: linear-gradient(110deg, rgba(40, 70, 45, 0.35), rgba(12, 14, 10, 0.55));
  border-color: #7a9a6a;
}

.gate-btn.nasdara:hover {
  background: linear-gradient(110deg, rgba(120, 70, 30, 0.35), rgba(12, 14, 10, 0.55));
  border-color: #d4782a;
}

.gate-btn.buy:hover {
  background: var(--buy-dim);
  border-color: var(--buy);
}

.gate-btn.sell:hover {
  background: var(--sell-dim);
  border-color: var(--sell);
}

.gate-btn.both:hover {
  border-color: var(--focus);
}

.gate-label {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gate-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.gate-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Shop shell — scrolls over fixed poster */
.shop {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Hero strip removed — poster is the page background */
.shop-banner {
  display: none;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(10, 12, 9, 0.45);
  backdrop-filter: blur(14px) saturate(1.05);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.top-tools {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.mode-badge {
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: rgba(18, 22, 14, 0.45);
  backdrop-filter: blur(8px);
}

.mode-badge.buy {
  color: var(--buy);
  border-color: var(--buy);
}
.mode-badge.sell {
  color: var(--sell);
  border-color: var(--sell);
}
.mode-badge.both {
  color: var(--focus);
}

.search-wrap input {
  width: min(280px, 70vw);
  background: rgba(12, 14, 10, 0.45);
  border: 1px solid rgba(196, 163, 90, 0.3);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

.search-wrap input:focus {
  outline: 1px solid var(--focus);
  border-color: var(--focus);
}

.linkish {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.25rem 0;
}

.linkish:hover {
  color: var(--text);
}

.linkish.danger:hover {
  color: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 300px;
  gap: 0;
  flex: 1;
  min-height: 0;
  background: transparent;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cats.cats-split {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  .cats.cats-split .cat-block {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .cats.cats-split .cat-btn {
    width: auto;
  }
  .cart {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.cats {
  padding: 1rem 0.75rem;
  border-right: 1px solid rgba(196, 163, 90, 0.22);
  background: rgba(12, 14, 10, 0.38);
  backdrop-filter: blur(12px) saturate(1.05);
  overflow: auto;
}

.cats.cats-split {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cat-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cat-block-sell {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(111, 158, 122, 0.35);
}

.cat-block-title {
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.15rem 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--buy);
  text-shadow: 0 1px 10px rgba(196, 163, 90, 0.25);
}

.cat-block-sell .cat-block-title {
  color: var(--sell);
  text-shadow: 0 1px 10px rgba(111, 158, 122, 0.28);
}

.catalog-block.dimmed {
  opacity: 0.55;
}

.catalog-block.focus-side {
  opacity: 1;
}

.catalog-block.focus-side .section-title {
  text-shadow: 0 0 18px rgba(196, 163, 90, 0.25);
}

.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

.cat-btn.active {
  color: var(--text);
  border-color: rgba(196, 163, 90, 0.35);
  background: rgba(34, 40, 28, 0.55);
  box-shadow: inset 3px 0 0 var(--buy);
}

.cat-btn.open {
  color: var(--text);
}

.cat-btn.deals {
  color: #1a1408;
  background: linear-gradient(135deg, #e0b84a 0%, #c4922a 50%, #e0b84a 100%);
  background-size: 200% auto;
  border-color: #f0d078;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
  box-shadow: 0 0 0 1px rgba(240, 208, 120, 0.35);
  animation: shimmer 4s linear infinite;
}

.cat-btn.deals:hover {
  color: #120e06;
  background: linear-gradient(135deg, #f0c85a 0%, #d4a238 100%);
  transform: translateX(3px) scale(1.02);
}

.cat-btn.deals.active {
  color: #120e06;
  border-color: #ffe6a0;
  background: linear-gradient(135deg, #f5d06a 0%, #e0b84a 100%);
  box-shadow: 0 0 16px rgba(224, 184, 74, 0.5);
}

.trader-rules {
  margin: 0;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(196, 163, 90, 0.12);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.35;
}

.trader-rules strong {
  color: var(--buy);
}

.cart-limit-hint {
  margin: 0 0 0.75rem;
  padding: 0 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.cart-limit-hint.warn {
  color: var(--danger);
  font-weight: 600;
}

.locker-delivery {
  margin: 0.15rem 0 0.35rem;
  padding: 0.7rem 0.7rem 0.8rem;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: rgba(196, 163, 90, 0.08);
  border-radius: var(--radius);
}

.locker-delivery h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--buy);
}

.locker-help {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.locker-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.locker-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.locker-field input {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(12, 14, 10, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius);
}

.locker-field input:focus {
  outline: 1px solid var(--focus);
  border-color: var(--focus);
}

.gate-btn.map.locked,
.gate-btn.map:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.gate-btn.map.locked .gate-hint,
.gate-btn.map:disabled .gate-hint {
  color: var(--muted);
}

.gate-back {
  margin-top: 1.25rem;
  display: inline-block;
}

.item.deals-item {
  border-color: rgba(224, 184, 74, 0.45);
  background: linear-gradient(
    160deg,
    rgba(224, 184, 74, 0.2),
    rgba(34, 40, 28, 0.4)
  );
}

.item.deals-item .item-name {
  color: var(--buy);
}

.cat-subwrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.35rem 0.55rem;
  padding: 0.15rem 0 0.25rem 0.55rem;
  border-left: 1px solid var(--line);
}

.cat-btn.sub {
  font-size: 0.92em;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0;
  color: var(--muted);
}

.cat-btn.sub.active {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}

.catalog {
  padding: 1rem 1.1rem 3rem;
  overflow: auto;
  background: rgba(8, 10, 8, 0.22);
  backdrop-filter: blur(6px);
}

.section-title {
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.35rem;
  margin: 0.5rem 0 0.75rem;
}

.section-title span {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.buy-tone {
  color: var(--buy);
}
.sell-tone {
  color: var(--sell);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.item {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.8rem;
  background: rgba(16, 18, 12, 0.42);
  border: 1px solid rgba(196, 163, 90, 0.22);
  border-radius: var(--radius);
  backdrop-filter: blur(10px) saturate(1.05);
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s, background 0.18s;
  animation: item-in 0.35s ease both;
}

.item:nth-child(1) { animation-delay: 0.02s; }
.item:nth-child(2) { animation-delay: 0.05s; }
.item:nth-child(3) { animation-delay: 0.08s; }
.item:nth-child(4) { animation-delay: 0.11s; }
.item:nth-child(5) { animation-delay: 0.14s; }
.item:nth-child(6) { animation-delay: 0.17s; }
.item:nth-child(7) { animation-delay: 0.2s; }
.item:nth-child(8) { animation-delay: 0.23s; }

.item:hover {
  transform: translateY(-3px);
  background: rgba(18, 22, 14, 0.58);
  border-color: rgba(196, 163, 90, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.item-name {
  font-weight: 600;
  line-height: 1.25;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.price {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

.item.buy .price {
  color: var(--buy);
}
.item.sell .price {
  color: var(--sell);
}

.add-btn {
  appearance: none;
  border: 1px solid rgba(196, 163, 90, 0.35);
  background: rgba(12, 14, 10, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.add-btn:hover {
  border-color: var(--focus);
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
}

/* Cart — height grows with lines; foot stays under items (no empty stretch) */
.cart {
  padding: 1rem;
  border-left: 1px solid rgba(196, 163, 90, 0.22);
  background: rgba(12, 14, 10, 0.4);
  backdrop-filter: blur(14px) saturate(1.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-self: start;
  position: sticky;
  top: 0;
  width: 100%;
  max-height: calc(100vh - 1rem);
  overflow: auto;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-head h2,
.cart-section h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-section h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  padding: 0.5rem;
  background: rgba(12, 14, 10, 0.4);
  border: 1px solid rgba(196, 163, 90, 0.22);
  border-radius: var(--radius);
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
}

.cart-line .name {
  grid-column: 1 / -1;
  font-weight: 500;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-row button {
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
}

.line-total {
  font-family: var(--display);
  font-size: 1.1rem;
}

.subtotal {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.subtotal strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.2rem;
}

.cart-foot {
  margin-top: 0.5rem;
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.net-label {
  margin: 0;
  color: var(--buy);
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.15;
}

.net-total {
  margin: 0.2rem 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(2.75rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.95;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.net-total.due-trader {
  color: #f0d078;
}

.net-total.due-player {
  color: #8fd4a0;
}

.net-total.even {
  color: var(--muted);
}

.net-hint {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.sell-hint {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed rgba(111, 158, 122, 0.45);
  background: rgba(111, 158, 122, 0.1);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.sell-jump {
  appearance: none;
  border: 1px solid rgba(111, 158, 122, 0.55);
  background: rgba(12, 14, 10, 0.55);
  color: var(--sell);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.sell-jump:hover {
  border-color: var(--sell);
  background: var(--sell-dim);
  color: var(--text);
}


.primary {
  width: 100%;
  appearance: none;
  border: 1px solid var(--buy);
  background: linear-gradient(135deg, #e0b84a, #c4a35a 45%, #a8863a);
  color: #1a160c;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}

.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(196, 163, 90, 0.35);
}

.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.ticket-card {
  margin: 0;
  padding: 1.25rem 1.2rem 1rem;
  width: min(520px, 94vw);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.ticket-card h2 {
  margin: 0.15rem 0 0.75rem;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.55rem;
}

.ticket-body {
  margin: 0;
  padding: 0.85rem 0.9rem;
  max-height: min(50vh, 420px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: var(--radius);
}

.ticket-meta {
  margin: 0.55rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.qty-row button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.copy-status {
  margin: 0.5rem 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--sell);
}

.variant-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: -0.25rem;
}

/* Variant overlay */
.variant-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 1rem;
}
.variant-card {
  margin: 0;
  padding: 1.25rem 1.2rem 1rem;
  width: min(420px, 92vw);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.variant-card h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.5rem;
}
.variant-price {
  margin: 0.25rem 0 1rem;
  color: var(--buy);
  font-family: var(--display);
  font-size: 1.25rem;
}
.variant-label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.variant-block {
  margin-bottom: 1rem;
}
.variant-custom-input {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
}
.variant-custom-input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.variant-custom-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 12rem;
  overflow-y: auto;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.chip:hover {
  border-color: var(--focus);
}
.chip.active {
  border-color: var(--buy);
  background: var(--buy-dim);
}
.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  background: var(--swatch, #888);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.variant-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}
.variant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}
.ghost:hover {
  color: var(--text);
}
.variant-actions .primary {
  width: auto;
  padding: 0.55rem 1rem;
  font-size: 1rem;
}

/* ——— Mobile / phone ———
   Landscape poster + cover crops the art hard on tall phones.
   Fit the full banner width, letterbox with the dark world bg. */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  html,
  body {
    min-height: 100dvh;
  }

  .world-poster {
    background-size: 220% auto;
    background-position: center center;
    background-repeat: no-repeat;
  }

  body.shop-open .world-poster {
    background-size: 220% auto;
    background-position: center 30%;
  }

  .world-vignette {
    box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.5);
  }

  .world-particles {
    display: none;
  }

  .gate {
    min-height: 100dvh;
    min-height: 100svh;
    padding: max(0.75rem, env(safe-area-inset-top))
      max(0.75rem, env(safe-area-inset-right))
      max(0.75rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
    align-content: center;
  }

  .gate-hero-mark {
    display: none;
  }

  .gate-card {
    width: 100%;
    max-width: 100%;
    padding: 1.25rem 1rem 1rem;
    background: linear-gradient(
      160deg,
      rgba(18, 22, 14, 0.1),
      rgba(10, 12, 9, 0.07)
    );
    backdrop-filter: blur(5px) saturate(1.05);
  }

  .gate-card h1 {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
  }

  .gate-btn {
    min-height: 3.25rem;
    padding: 0.85rem 0.9rem;
    touch-action: manipulation;
  }

  .gate-emoji {
    font-size: 1.35rem;
  }

  .gate-note {
    font-size: 0.8rem;
  }

  #shop {
    min-height: 100dvh;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .catalog {
    padding: 0.75rem;
  }

  .item {
    padding: 0.75rem;
  }

  .cart {
    padding: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .variant-overlay {
    align-items: end;
    padding: 0;
  }

  .variant-card {
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: min(92dvh, 920px);
    overflow: auto;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .chip {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    touch-action: manipulation;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .gate-btn {
    grid-template-columns: auto 1fr;
  }

  .gate-arrow {
    display: none;
  }

  .gate-label {
    font-size: 1.05rem;
  }
}

