/* TRENCHES ITEM SHOP — page + shop overlay styles (ported look from TRENCH-REBIRTH). */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #0b0e10; overflow: hidden; }
body { font-family: "Chakra Petch", system-ui, sans-serif; color: #e8ecef; }

/* ── fullscreen canvas ── */
#game-root, #unity-canvas { position: fixed; inset: 0; width: 100%; height: 100%; }
#unity-canvas { display: block; background: #0b0e10; }

/* Boot overlay: the old #loading-* screen was replaced by the landing page —
   see TemplateData/landing.css / landing.js and #trenches-landing in index.html. */

/* ── shop overlay ── */
#trenches-shop {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(5, 7, 9, .82); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
#trenches-shop.open { display: flex; }
.ts-panel {
  width: min(1180px, 94vw); max-height: 92vh; display: flex; flex-direction: column;
  background: #111518; border: 1px solid #2a333a; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.ts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid #222a30;
}
.ts-head h1 { font-size: 22px; letter-spacing: .18em; display: flex; align-items: center; gap: 12px; }
.ts-bar { width: 6px; height: 22px; background: #f2c14e; display: inline-block; }
.ts-balance { font-size: 12px; color: #8a969e; letter-spacing: .1em; display: flex; gap: 18px; align-items: center; }
.ts-close { cursor: pointer; color: #b7c2c9; padding: 6px 10px; border: 1px solid #2a333a; }
.ts-close:hover { color: #fff; border-color: #f2c14e; }

/* grid + cards */
.ts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; padding: 18px 22px; overflow-y: auto;
}
.ts-card {
  position: relative; background: #161b1f; border: 1px solid #242d33; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.ts-card:hover { transform: translateY(-3px); border-color: #3a464e; }
.ts-card.godly     { border-color: #7a3b8f; }
.ts-card.legendary { border-color: #8f7a2b; }
.ts-rarity {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: .14em; padding: 3px 8px;
  background: #26526b; color: #bfe3ff;
}
.ts-rarity.epic      { background: #4b2b6e; color: #dcc2ff; }
.ts-rarity.legendary { background: #6e5a1c; color: #ffe9a6; }
.ts-rarity.godly     { background: linear-gradient(90deg, #7a2b8f, #b02f6b); color: #ffd7f4; }
.ts-own {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; color: #74e08c;
}
.ts-hero { position: relative; aspect-ratio: 16/10; background: #0d1114; }
.ts-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ts-zoom { opacity: 0; transition: opacity .2s; }
.ts-hero.has-zoom:hover .ts-zoom { opacity: 1; }
.ts-body { padding: 12px 14px 14px; }
.ts-name { font-size: 15px; letter-spacing: .06em; }
.ts-sub { font-size: 10px; color: #7d8990; letter-spacing: .12em; margin: 3px 0 8px; }
.ts-price { font-size: 12px; color: #f2c14e; margin-bottom: 10px; }
.ts-price small { color: #7d8990; }

/* action button */
.ts-btn {
  width: 100%; padding: 10px 8px; font-family: inherit; font-weight: 700; letter-spacing: .08em;
  font-size: 12px; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ts-btn.buy      { background: linear-gradient(180deg, #f2c14e, #dda52f); color: #0b0e10; }
.ts-btn.buy:hover { filter: brightness(1.1); }
.ts-btn.equip    { background: #1f6e3c; color: #d7ffe3; }
.ts-btn.equip:hover { background: #27874b; }
.ts-btn.equipped { background: #14361f; color: #74e08c; border: 1px solid #1f6e3c; }
.ts-btn.busy     { background: #2a333a; color: #b7c2c9; cursor: progress; }
.ts-big { font-size: 13px; }
.ts-cur { font-size: 10px; opacity: .8; }

/* footer */
.ts-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 22px 16px; border-top: 1px solid #222a30; }
.ts-pill { font-size: 10px; letter-spacing: .1em; color: #8a969e; padding: 4px 10px; border: 1px solid #2a333a; }

/* ── "VIEW IN 3D" button on cards with a GLB model (ported from TRENCH-REBIRTH,
      recolored to the TRENCHES gold/gunmetal palette) ── */
.ts-hero.has-3d { position: relative; }
.ts-view {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; color: #0b0e10; border: 0; white-space: nowrap;
  background: linear-gradient(180deg, #f2c14e, #dda52f);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .15s;
}
.ts-card:hover .ts-view { opacity: 1; }
@media (hover: none) { .ts-view { opacity: 1; } }

/* ── 3D viewer overlay (model-viewer, orbit + zoom) ── */
#ts-viewer {
  position: absolute; inset: 0; z-index: 30; display: none;
  background: radial-gradient(120% 90% at 50% 0%, #181d21 0%, #0b0e10 70%, #070809 100%);
}
#ts-viewer.open { display: flex; flex-direction: column; }
#ts-viewer #tsv-model { flex: 1; width: 100%; height: 100%; --poster-color: transparent; background: transparent; outline: none; }
#ts-viewer .tsv-close {
  position: absolute; top: 14px; right: 16px; z-index: 3; cursor: pointer;
  width: 38px; height: 38px; border: 1px solid #2a333a; background: #14181c;
  color: #b7c2c9; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
#ts-viewer .tsv-close:hover { color: #fff; border-color: #f2c14e; }
#ts-viewer .tsv-hint {
  position: absolute; top: 16px; left: 18px; z-index: 2;
  font-size: 11px; letter-spacing: .08em; color: #7d8990; pointer-events: none;
}
#ts-viewer .tsv-card {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 22px 24px;
  background: linear-gradient(180deg, rgba(11,14,16,0) 0%, rgba(11,14,16,.78) 38%, rgba(11,14,16,.96) 100%);
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
}
#ts-viewer .tsv-rarity {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  padding: 4px 10px; background: #26526b; color: #bfe3ff;
}
#ts-viewer .tsv-rarity.godly { background: linear-gradient(90deg, #7a2b8f, #b02f6b); color: #ffd7f4; }
#ts-viewer .tsv-rarity.legendary { background: #6e5a1c; color: #ffe9a6; }
#ts-viewer .tsv-rarity:empty { display: none; }
#ts-viewer .tsv-name { margin: 2px 0 0; font-size: 22px; font-weight: 700; letter-spacing: .08em; color: #fff; }
#ts-viewer .tsv-sub { font-size: 12px; letter-spacing: .12em; color: #8a969e; }
#ts-viewer .tsv-price { font-size: 13px; color: #f2c14e; letter-spacing: .04em; }
#ts-viewer #tsv-action { margin-top: 6px; min-width: 230px; width: auto; }

/* ── "coming soon" teaser cards ── */
.ts-card.soon { opacity: .92; }
.ts-hero-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: #0c0f12;
}
.ts-hero-soon svg { width: 26px; height: 26px; color: #f2c14e; }
.ts-hero-soon span { font-size: 10px; font-weight: 700; letter-spacing: .3em; color: #b7c2c9; }
.ts-btn.soon {
  background: #1b2126; color: #b7c2c9; cursor: not-allowed;
  font-weight: 700; letter-spacing: .16em;
}

/* Full-body character renders are square portraits — contain them, don't crop. */
.ts-card[data-skin="char_default"] .ts-hero { background: #1a1b1d; }
.ts-card[data-skin="char_default"] .ts-hero img,
.ts-card[data-skin="char_pills"] .ts-hero img { object-fit: contain; }
