/* Inventory, shop, workshop, trades, case roulette */

.inv-page { max-width: var(--wide); }
.inv-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px 40px;
  margin-bottom: 36px;
}
.inv-hero h1 { margin-top: 10px; }
.inv-hero .lede { margin-top: 14px; }
.inv-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.inv-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.inv-stat {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--grad-surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-decoration: none;
  text-align: center;
}
a.inv-stat { display: block; transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
a.inv-stat:hover { border-color: var(--gold); transform: translateY(-1px); }
.inv-stat > span:first-child { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.inv-stat .num { display: block; margin-top: 6px; font-family: var(--display); font-size: 32px; line-height: 1; }
.inv-stat .num > span { display: inline; }
.inv-stat i { font-style: normal; color: var(--muted); font-size: 0.62em; }
.inv-stat small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.inv-stat.is-sparks { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(217, 183, 122, 0.16), var(--surface-solid)); border-color: var(--line-2); }
.inv-stat.is-sparks .num { color: var(--gold-2); }
.inv-stat.is-wide { grid-column: 1 / -1; }
.rar-bars { display: flex; gap: 4px; margin-top: 12px; height: 6px; }
.rar-bar { flex: 1; border-radius: 99px; background: color-mix(in srgb, var(--rar) 18%, var(--surface-2)); overflow: hidden; }
.rar-bar i { display: block; height: 100%; background: var(--rar); border-radius: inherit; }

.inv-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px 28px;
  align-items: start;
}
.loadout { position: sticky; top: calc(var(--nav-h) + 16px); padding: 22px; }
.loadout-head { margin-bottom: 18px; }
.loadout-head h2 { font-size: 26px; }
.loadout-id { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lo-portrait { border: 0; background: none; padding: 0; cursor: pointer; }
.lo-name { min-width: 0; }
.lo-name b { display: block; font-size: 18px; }
.lo-title {
  margin-top: 4px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.lo-title.is-empty { color: var(--muted); font-weight: 600; }
.lo-plaque-row {
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.lo-plaque-row small { display: block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.lo-plaque-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 3;
  min-height: 64px;
  padding: 0 14%;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: transparent center / contain no-repeat;
}
.lo-plaque-box.is-empty {
  box-shadow: 0 0 0 1px var(--line) inset;
}
.lo-plaque-box.is-on { box-shadow: none; }
.lo-plaque-sample {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--gold-2);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.lo-bubble-row { width: 100%; border: 0; background: none; padding: 0; margin: 0 0 16px; cursor: pointer; text-align: left; }
.lo-bubble-plain { opacity: 0.7; }
.lo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lo-slot {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 6px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--field);
  box-shadow: 0 0 0 1px var(--line) inset;
  cursor: pointer;
  color: inherit;
}
.lo-slot small { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.lo-card { width: 54px; height: 72px; perspective: 400px; }
.lo-card-in {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(160deg, #3a1a24, #12080c);
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 8px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 160ms var(--ease);
}
.lo-card-in img { width: 100%; height: 100%; object-fit: cover; }
.lo-card-in.is-default { background: repeating-linear-gradient(135deg, #2a1620, #2a1620 6px, #1a0d12 6px, #1a0d12 12px); }
.lo-swatch {
  width: 54px;
  height: 36px;
  border-radius: 8px;
  background: #1a3a28 center/cover;
  box-shadow: 0 0 0 1px var(--line-2) inset;
}
.lo-swatch.is-default { background-image: none; }
.lo-effect-box { width: 44px; height: 44px; display: grid; place-items: center; color: var(--gold); }
.lo-effect-box .thumb { width: 44px; height: 44px; }
.lo-emotes { margin-top: 16px; }
.lo-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.lo-emote-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lo-emote {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--field);
  box-shadow: 0 0 0 1px var(--line) inset;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--faint);
}
.lo-emote img, .lo-emote .thumb { width: 100%; height: 100%; object-fit: cover; }
.lo-emote.is-empty { border: 1px dashed var(--line-2); background: transparent; box-shadow: none; }

.inv-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; width: max-content; max-width: 100%; flex-wrap: wrap; }
.inv-tab {
  border: 0;
  background: none;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}
.inv-tab .num { margin-left: 6px; color: var(--muted); font-size: 12px; }
.inv-tab.is-on { background: var(--surface-hi); color: var(--ink); box-shadow: var(--shadow-1); }
.inv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 16px; }
.inv-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-select select { min-height: 36px; width: auto; padding: 6px 36px 6px 12px; font-size: 13px; }
.mini-select .pretty-wrap { width: auto; min-width: 168px; }
.mini-select .pretty-btn { min-height: 36px; padding: 6px 36px 6px 12px; font-size: 13px; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.inv-grid-sm { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.icard {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px 10px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  box-shadow: 0 0 0 1px var(--line) inset, 0 8px 20px rgba(0, 0, 0, 0.18);
  color: inherit;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.icard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar, var(--line-2)) 55%, transparent) inset;
  pointer-events: none;
}
.icard:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar) 70%, transparent) inset, 0 16px 32px rgba(0, 0, 0, 0.28); }
.icard[data-rarity="epic"]::after, .icard[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--rar) 35%, transparent) 50%, transparent 65%);
  animation: sheen 3.6s linear infinite;
  pointer-events: none;
}
@keyframes sheen { to { transform: translateX(40%); } }
.icard-art { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--r-sm); background: #0c0a10; overflow: hidden; }
.icard--plaque .icard-art,
.icard:has(.thumb--plaque) .icard-art {
  aspect-ratio: 1;
  background: transparent;
}
.icard-art img, .icard-art .thumb { width: 100%; height: 100%; object-fit: cover; }
.icard-art .thumb--plaque,
.icard--plaque .thumb {
  min-height: 0;
  background: transparent;
}
.icard-art .thumb--plaque img,
.icard--plaque .icard-art img {
  object-fit: contain;
  object-position: center;
  padding: 18% 6%;
}
.icard-art .thumb-title {
  width: 100%;
  height: 100%;
  min-height: 100%;
  font-size: clamp(16px, 2.2vw, 22px);
  display: grid;
  place-items: center;
  text-align: center;
}
.icard-body { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.icard-name { font-size: 14px; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.icard-rar { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rar); }
.icard-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: rgba(7, 6, 10, 0.78);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
}
.icard-dup {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--surface-hi);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.icard-flag { font-size: 11px; color: var(--muted); }
.icard.is-ghost { opacity: 0.48; cursor: default; filter: grayscale(0.4); }
.icard.is-ghost .ghost-q {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 42px;
  color: #fff;
  text-shadow: 0 4px 16px #000;
}
.inv-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; }
.inv-empty h3 { margin-bottom: 8px; }
.inv-empty p { max-width: 46ch; margin: 0 auto 16px; color: var(--muted); }
.inv-empty-art {
  width: 120px;
  height: 90px;
  margin: 0 auto 16px;
  border-radius: var(--r-md);
  background: url("/art/scenes/vault-sm.webp") center/cover;
  box-shadow: var(--shadow-1);
}

.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.case-card {
  display: grid;
  grid-template-rows: 180px auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-solid);
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow-2);
}
.case-art { position: relative; background: #0a080d; }
.case-art img { width: 100%; height: 100%; object-fit: cover; }
.case-glow { position: absolute; inset: auto 20% -20px; height: 50px; background: radial-gradient(closest-side, color-mix(in srgb, var(--rar) 55%, transparent), transparent); pointer-events: none; }
.case-body { padding: 16px 18px 18px; display: grid; gap: 8px; }
.case-name { font-size: 24px; }
.case-desc, .case-src { color: var(--muted); font-size: 13px; }
.case-more { display: grid; place-items: center; text-align: center; min-height: 260px; border: 1px dashed var(--line-2); background: transparent; box-shadow: none; }
.case-more-in { display: grid; justify-items: center; gap: 8px; padding: 24px; color: var(--ink-2); }
.case-more-in b { font-size: 18px; color: var(--ink); }

.coll-group { margin-bottom: 28px; }
.coll-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin-bottom: 12px; }
.coll-head .meter { flex: 1; min-width: 120px; margin-top: 0; position: static; width: auto; left: auto; right: auto; bottom: auto; }

.inv-drops { margin-top: 40px; }
.drops-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.drop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.drop-row .thumb, .drop-row img { width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 8px; object-fit: cover; }
.drop-row .thumb--plaque, .drop-row .thumb--plaque img { width: 88px; height: 28px; min-width: 88px; min-height: 28px; object-fit: contain; }
.drop-row .thumb-title { min-height: 40px; font-size: 11px; padding: 4px; }
.drop-text { display: grid; min-width: 0; }
.drop-who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-item { color: var(--rar); }

/* item detail */
dialog.item-dialog { width: min(720px, calc(100vw - 24px)); }
.item-dialog-box {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 8px 0;
  border-radius: var(--r-xl);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.item-dialog-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.item-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rar) 28%, transparent), #09070c 70%);
  padding: 32px;
}
.item-rays {
  position: absolute;
  inset: 8%;
  background: conic-gradient(from 20deg, transparent, color-mix(in srgb, var(--rar) 22%, transparent), transparent 30%);
  animation: spin-slow 14s linear infinite;
  pointer-events: none;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.item-info { padding: 28px 28px 24px; display: grid; align-content: start; gap: 10px; }
.item-name { font-size: 34px; }
.item-desc { color: var(--ink-2); }
.item-meta { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 8px 0; font-size: 14px; }
.item-meta dt { color: var(--muted); }
.item-hint, .item-note { color: var(--muted); font-size: 13px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.item-dust { color: var(--muted); }
.co-card { width: clamp(200px, 22vw, 260px); pointer-events: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar, #d9b77a) 55%, transparent), 0 24px 70px color-mix(in srgb, var(--rar, #d9b77a) 35%, transparent); animation: co-pop 520ms var(--ease) both; }
@keyframes co-pop { from { opacity: 0; transform: scale(0.82) translateY(14px); } }

/* gift */
dialog.gift-dialog { width: min(560px, calc(100vw - 24px)); }
.gift-box {
  position: relative;
  padding: 36px 32px 28px;
  border-radius: var(--r-xl);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  text-align: center;
  overflow: hidden;
}
.gift-rays { position: absolute; inset: -20%; background: radial-gradient(circle at 50% 20%, rgba(217, 183, 122, 0.22), transparent 55%); pointer-events: none; }
.gift-lede { color: var(--ink-2); margin: 10px auto 20px; max-width: 42ch; }
.gift-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 22px; }
.gift-item { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: var(--r-md); background: var(--field); box-shadow: 0 0 0 1px var(--line) inset; }
.gift-item .thumb, .gift-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.gift-item small { color: var(--muted); font-size: 11px; }
.gift-sparks .num { font-family: var(--display); font-size: 36px; color: var(--gold-2); }
.gift-actions { display: grid; gap: 8px; justify-items: center; }

/* case opener */
html.co-lock, html.co-lock body { overflow: hidden; }
.co-stage {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #f5ede1;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}
.co-stage.is-in { opacity: 1; transform: none; }
.co-stage.is-out { opacity: 0; }
.co-bg { position: absolute; inset: 0; background: radial-gradient(900px 500px at 50% 20%, color-mix(in srgb, var(--rar, #d9b77a) 22%, transparent), transparent 60%), #07060a; }
.co-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; }
.co-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.co-skip { border: 0; background: none; color: #cdbfae; font-weight: 700; cursor: pointer; padding: 8px 14px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.25) inset; }
.co-skip:hover { color: #fff; box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.55) inset; }
.co-skip[hidden] { display: none; }
.co-intro, .co-reel, .co-reveal, .co-error { position: relative; z-index: 1; grid-row: 2; min-height: 0; }
.co-error[hidden] { display: none; }
.co-stage[data-phase="intro"] .co-reel,
.co-stage[data-phase="intro"] .co-reveal,
.co-stage[data-phase="spin"] .co-intro,
.co-stage[data-phase="spin"] .co-reveal,
.co-stage[data-phase="reveal"] .co-intro,
.co-stage[data-phase="reveal"] .co-reel { display: none; }
.co-intro { display: grid; place-items: center; gap: 16px; }
.co-box { position: relative; width: min(320px, 70vw); }
.co-box img { width: 100%; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)); }
.co-box-glow { position: absolute; inset: 40% 10% -10%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rar) 50%, transparent), transparent); }
.co-intro-text { font-family: var(--display); font-size: 28px; }
.co-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.co-video.is-out { opacity: 0; transition: opacity 400ms ease; }
.co-reel { display: grid; align-content: center; justify-items: center; gap: 22px; padding: 0 0 8vh; }
.co-reel::before {
  content: "Что же внутри…";
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 34px);
  color: #f1e6d4;
}
.co-window {
  --tile: clamp(116px, 12vw, 168px);
  position: relative;
  width: 100vw;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.02));
  border-block: 1px solid rgba(217, 183, 122, 0.18);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.co-window::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--gold) 18%, #fff4d6 50%, var(--gold) 82%, transparent);
  box-shadow: 0 0 14px var(--gold), 0 0 32px rgba(217, 183, 122, 0.45);
  pointer-events: none;
}
.co-window:has(.is-win)::before { opacity: 0; transition: opacity 300ms ease; }
.co-track { display: flex; gap: 14px; will-change: transform; padding: 30px 0; }
.co-tile {
  --rar: #a7adb8;
  flex: none;
  width: var(--tile);
  padding: 10px 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 14%, #16121a), #110e15 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar) 45%, transparent) inset, 0 -3px 0 0 var(--rar) inset, 0 10px 24px rgba(0, 0, 0, 0.45);
  text-align: center;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.co-tile[data-rarity="uncommon"] { --rar: #5fcf98; }
.co-tile[data-rarity="rare"] { --rar: #5b9dff; }
.co-tile[data-rarity="epic"] { --rar: #b26bff; }
.co-tile[data-rarity="legendary"] { --rar: #f3b857; }
.co-tile > .thumb, .co-tile > .cos-thumb, .co-tile > span:first-child { display: block; width: 100%; min-height: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #0c0a10; }
.co-tile:has(.thumb--plaque) > .thumb,
.co-tile--plaque > .thumb { aspect-ratio: 16 / 3; }
.co-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.co-tile:has(.thumb--plaque) img,
.co-tile--plaque img { object-fit: contain; }
.co-tile-name { display: block; margin-top: 9px; font-size: 12px; font-weight: 700; color: #e9dfcf; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-tile.is-win { transform: scale(1.1); box-shadow: 0 0 0 2px var(--rar), 0 0 0 1px var(--rar) inset, 0 14px 50px color-mix(in srgb, var(--rar) 55%, transparent); }
.co-pointer {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  margin-left: -11px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 16px solid var(--gold);
  filter: drop-shadow(0 0 8px var(--gold));
  pointer-events: none;
}
.co-pointer.is-bottom { top: auto; bottom: 0; border-top: 0; border-bottom: 16px solid var(--gold); }
.co-pointer.is-tick { animation: tick-nudge 80ms ease; }
@keyframes tick-nudge { 50% { transform: translateY(3px); } }
.co-reveal { display: grid; align-content: center; justify-items: center; text-align: center; padding: 0 20px 6vh; }
.co-sparks, .co-rays { position: absolute; inset: 0; pointer-events: none; }
.co-sparks { width: 100%; height: 100%; }
.co-rays {
  inset: 50% auto auto 50%;
  width: 140vmax;
  height: 140vmax;
  margin: -70vmax 0 0 -70vmax;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rar) 16%, transparent) 0deg 5deg, transparent 5deg 18deg);
  mask-image: radial-gradient(closest-side, #000 8%, rgba(0, 0, 0, 0.5) 30%, transparent 62%);
  -webkit-mask-image: radial-gradient(closest-side, #000 8%, rgba(0, 0, 0, 0.5) 30%, transparent 62%);
  animation: spin-slow 40s linear infinite;
}
.co-result { position: relative; display: grid; justify-items: center; gap: 12px; }
.co-rar {
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--rar);
  background: color-mix(in srgb, var(--rar) 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar) 45%, transparent) inset;
}
.co-name { margin: 6px 0 0; font-size: clamp(34px, 5vw, 60px); line-height: 1.05; }
.co-desc { max-width: 42ch; margin: 0; color: #cdbfae; }
.co-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.co-error { display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; }

/* shop / workshop / trades */
.shop, .workshop, .trades, .market { width: 100%; max-width: var(--wide, 1680px); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--page-x, 24px) 80px; }
.shop .section-head, .workshop .section-head, .trades .section-head { margin-bottom: 18px; }
.shop-grid, .workshop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.shop-card, .ws-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--grad-surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.shop-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); background: #0c0a10; }
.shop-odds { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.shop-odds b { color: var(--rar); }
.ws-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ws-list li { display: flex; }
.ws-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
}
.ws-list label:has(input:checked) { border-color: var(--gold); box-shadow: var(--glow-gold); }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-cols ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.trade-cols li label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--field); }
.trade-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.trade-line span { flex: 1; min-width: 180px; }

@media (max-width: 1000px) {
  .inv-hero, .inv-layout, .item-dialog-box, .trade-cols { grid-template-columns: 1fr; }
  .loadout { position: static; }
}
@media (max-width: 560px) {
  .inv-stats { grid-template-columns: 1fr 1fr; }
  .lo-grid { grid-template-columns: 1fr 1fr 1fr; }
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-dialog-box { grid-template-columns: 1fr; }
  .item-stage { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .icard[data-rarity="epic"]::after, .icard[data-rarity="legendary"]::after, .item-rays, .co-rays { animation: none; }
}

.market-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.market-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.market-search { min-width: min(240px, 100%); }
.market-search input { width: 100%; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.market-card {
  display: grid; gap: 10px; padding: 14px;
  border-radius: var(--r-lg); background: var(--grad-surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.market-art { display: grid; place-items: center; min-height: 88px; }
.market-body { display: grid; gap: 6px; }
.market-name { margin: 0; font-size: 18px; line-height: 1.2; }
.market-seller { color: var(--muted); font-size: 13px; text-decoration: none; }
.market-seller:hover { color: var(--gold-2); }
.market-price { margin: 4px 0 8px; color: var(--gold-2); font-weight: 800; }
