/* The Locker — R15 Avatar Bay */

@font-face {
  font-family: "Cinzel";
  src: url("./assets/fonts/cinzel-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("./assets/fonts/cinzel-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080a0c;
  --ink: #e9e9de;
  --ink-dim: #bcc0b5;
  --muted: #8a918a;
  --faint: #626a64;
  --line: rgba(231, 232, 219, 0.12);
  --line-strong: rgba(231, 232, 219, 0.21);
  --panel: rgba(13, 16, 18, 0.9);
  --accent: #d8c89a;
  --accent-bright: #eee2c4;
  --accent-soft: rgba(216, 200, 154, 0.14);
  --amber: #c9a06a;
  --rust: #c46a45;
  --blue: #8fa9c0;
  --steel: #94a4aa;
  --wine: #7e3f4a;
  --display: "Cinzel", "Times New Roman", serif;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 760px at 58% 34%, #1b2226 0%, #10151a 44%, #090c0f 74%, #060708 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 34% at 36% 70%, rgba(190, 202, 210, 0.06), transparent 68%),
    radial-gradient(ellipse 28% 24% at 74% 24%, rgba(196, 106, 68, 0.055), transparent 70%);
  z-index: 1;
}

button {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: #0a0c08;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 14px;
  color: #0a0c08;
  background: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 3D stage ---------- */

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  outline: none;
}

#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#stage canvas:active {
  cursor: grabbing;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 7, 8, 0.36), transparent 18%, transparent 76%, rgba(5, 7, 8, 0.5)),
    radial-gradient(ellipse 78% 72% at 50% 46%, transparent 38%, rgba(4, 6, 8, 0.6) 100%);
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 78px;
  padding: 0 clamp(18px, 3.2vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(to bottom, rgba(7, 9, 11, 0.78), rgba(7, 9, 11, 0.12) 72%, transparent);
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.topbar::after {
  content: "";
  position: absolute;
  left: clamp(18px, 3.2vw, 44px);
  right: clamp(18px, 3.2vw, 44px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, var(--line-strong), var(--line) 20%, transparent 74%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  color: #0a0c08;
  background: var(--accent);
  font-family: var(--display);
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0.01em;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  box-shadow: 0 0 42px rgba(216, 200, 154, 0.14);
}
.brand-mark span {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  vertical-align: 10px;
  margin-left: -1px;
  letter-spacing: -0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-text b {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.075em;
}
.brand-text small {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}

.build {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
  white-space: nowrap;
}
.build b {
  color: var(--ink-dim);
  font-weight: 500;
}
.build .sep {
  opacity: 0.5;
}
.build .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(216, 200, 154, 0.8);
}

.ghost-btn,
.pill-btn,
.square-btn,
.action {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(10, 12, 8, 0.34);
  color: var(--ink-dim);
  border-radius: 6px;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
  backdrop-filter: blur(8px);
}
.ghost-btn:hover,
.pill-btn:hover,
.square-btn:hover,
.action:hover {
  color: var(--ink);
  border-color: rgba(216, 200, 154, 0.42);
  background: rgba(216, 200, 154, 0.06);
}
.ghost-btn:active,
.pill-btn:active,
.square-btn:active,
.action:active {
  transform: translateY(1px);
}

.snap-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
}
.snap-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

/* ---------- hero ---------- */

.hero {
  position: fixed;
  left: clamp(20px, 4.2vw, 68px);
  top: clamp(102px, 15.5vh, 164px);
  width: min(392px, 31vw);
  z-index: 12;
  pointer-events: none;
  animation: heroIn 0.9s var(--ease) both 0.15s;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: #aeb3a7;
  white-space: nowrap;
}
.eyebrow .tick {
  width: 22px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(216, 200, 154, 0.6);
}
.eyebrow em {
  color: var(--faint);
  font-style: normal;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(52px, 5.5vw, 78px);
  line-height: 0.94;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 12px 50px rgba(0, 0, 0, 0.45);
}
.hero h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(216, 200, 154, 0.24);
}
.hero h1 em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1px rgba(216, 200, 154, 0.7);
  text-shadow: none;
}

.hero-copy {
  max-width: 288px;
  margin: 22px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  color: var(--muted);
}

.loadout-card {
  width: 306px;
  margin-top: 30px;
  padding-top: 13px;
  border-top: 1px solid var(--line-strong);
  pointer-events: auto;
}
.lc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.lc-head b {
  color: var(--ink);
  font-weight: 500;
}
.stat {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 19px;
}
.stat-label {
  width: 72px;
  flex: none;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.track {
  position: relative;
  flex: 1;
  height: 3px;
  overflow: hidden;
  background: rgba(236, 241, 224, 0.09);
}
.track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(to right, rgba(216, 200, 154, 0.55), var(--accent));
  box-shadow: 0 0 10px rgba(216, 200, 154, 0.3);
  transition: width 0.5s var(--ease);
}
.stat b {
  width: 22px;
  flex: none;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  text-align: right;
  color: var(--ink-dim);
}
.lc-note {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.lc-note.is-ready {
  color: var(--accent);
}

/* ---------- locker panel ---------- */

.locker {
  position: fixed;
  top: 92px;
  right: clamp(16px, 2.4vw, 36px);
  bottom: 24px;
  z-index: 18;
  width: clamp(360px, 29vw, 418px);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(17, 21, 24, 0.94), rgba(9, 11, 13, 0.97)),
    radial-gradient(circle at 100% 0, rgba(216, 200, 154, 0.055), transparent 40%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow:
    0 36px 100px rgba(0, 0, 0, 0.58),
    0 2px 0 rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
  overflow: hidden;
  animation: panelIn 0.8s var(--ease) both 0.25s;
}
.locker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 66px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(216, 200, 154, 0.5);
  z-index: 2;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-head {
  padding: 16px 16px 0;
  flex: none;
}
.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-right: 2px;
}
.mono {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}
.panel-count {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-top: 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 4px 9px;
  border: 0;
  background: none;
  color: #858d7f;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.tab:hover {
  color: var(--ink);
}
.tab::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.tab[aria-selected="true"] {
  color: var(--accent);
}
.tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
.tab .tab-n {
  display: inline-block;
  margin-left: 3px;
  font-size: 6.5px;
  color: var(--faint);
  transform: translateY(-1px);
}
.tab[aria-selected="true"] .tab-n {
  color: rgba(216, 200, 154, 0.55);
}

.mobile-controls {
  display: none;
}

.item-detail {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 16px 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  min-height: 22px;
}
.detail-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--faint);
  white-space: nowrap;
}
.detail-stats {
  color: #6f7769;
  letter-spacing: 0.04em;
}
.detail-stats b {
  color: #aeb5a5;
  font-weight: 400;
}
.rarity-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
  display: inline-block;
  flex: none;
}
.rarity-dot.common {
  background: #9aa396;
}
.rarity-dot.rare {
  background: var(--blue);
  box-shadow: 0 0 5px rgba(126, 168, 255, 0.5);
}
.rarity-dot.epic {
  background: #c58cff;
  box-shadow: 0 0 5px rgba(197, 140, 255, 0.5);
}
.rarity-dot.legendary {
  background: var(--amber);
  box-shadow: 0 0 5px rgba(255, 180, 94, 0.55);
}

.item-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 241, 224, 0.18) transparent;
}
.item-grid::-webkit-scrollbar {
  width: 6px;
}
.item-grid::-webkit-scrollbar-thumb {
  background: rgba(236, 241, 224, 0.16);
  border-radius: 10px;
}

.item {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  border: 1px solid rgba(236, 241, 224, 0.1);
  border-radius: 9px;
  background: #111416;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}
.item:hover {
  border-color: rgba(236, 241, 224, 0.28);
  transform: translateY(-1px);
}
.item.is-on {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 26px rgba(216, 200, 154, 0.1);
}
.item .swatch {
  position: relative;
  height: 60px;
  overflow: hidden;
  background: linear-gradient(132deg, var(--c1, #4c5244) 0%, var(--c2, #22261d) 100%);
}
.item .swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.22), transparent 42%),
    repeating-linear-gradient(112deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 9px);
  mix-blend-mode: overlay;
  opacity: 0.75;
}
.item .cat-icon {
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 23px;
  height: 23px;
  color: rgba(8, 10, 12, 0.6);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.12));
}
.item .rarity {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.item .rarity.common { background: #cbd1c4; }
.item .rarity.rare { background: var(--blue); box-shadow: 0 0 7px rgba(126, 168, 255, 0.7); }
.item .rarity.epic { background: #c58cff; box-shadow: 0 0 7px rgba(197, 140, 255, 0.7); }
.item .rarity.legendary { background: var(--amber); box-shadow: 0 0 8px rgba(255, 180, 94, 0.8); }

.item .check {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  color: #0a0c08;
  background: var(--accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 0.18s var(--ease),
    transform 0.18s var(--ease);
}
.item.is-on .check {
  opacity: 1;
  transform: none;
}

.item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px 8px;
  border-top: 1px solid rgba(236, 241, 224, 0.075);
  background: rgba(6, 8, 9, 0.5);
}
.item .name {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.25;
  color: #e3e2d7;
  letter-spacing: 0.005em;
}
.item .sub {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.09em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.is-on .name {
  color: #fff;
}
.item.is-on .sub {
  color: rgba(216, 200, 154, 0.65);
}

.item.none .swatch {
  background:
    repeating-linear-gradient(45deg, #141719 0 7px, #0e1113 7px 14px);
}
.item.none .swatch::before {
  display: none;
}
.item.none .none-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #737b6d;
}
.item.none .none-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}
.item.none.is-on .none-mark {
  color: var(--accent);
}

.panel-foot {
  flex: none;
  padding: 11px 12px 12px;
  border-top: 1px solid var(--line);
  background: rgba(7, 9, 11, 0.55);
}
.foot-actions {
  display: flex;
  gap: 6px;
}
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  height: 34px;
  padding: 0 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  border-radius: 7px;
}
.action svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.action.primary {
  color: #0a0c08;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}
.action.primary:hover {
  color: #0a0c08;
  background: #e9ddc2;
  border-color: #e9ddc2;
}
.autosave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 2px 0;
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.1em;
  color: #5c6457;
}
.autosave b {
  font-weight: 400;
  color: #6e7667;
}
.live-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(216, 200, 154, 0.8);
  animation: livePulse 3s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- left controls ---------- */

.controls {
  position: fixed;
  left: clamp(20px, 4.2vw, 68px);
  bottom: 24px;
  z-index: 14;
  width: 342px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: heroIn 0.9s var(--ease) both 0.45s;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.control-label {
  width: 56px;
  flex: none;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  color: var(--faint);
}
.skin-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.skin-swatch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--skin);
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(236, 241, 224, 0.18);
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}
.skin-swatch:hover {
  transform: scale(1.12);
}
.skin-swatch[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 0 2px #0b0d0f,
    0 0 0 3.5px var(--accent);
}

.pose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pose-chip {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(236, 241, 224, 0.14);
  border-radius: 4px;
  background: rgba(12, 15, 10, 0.35);
  color: #909888;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}
.pose-chip:hover {
  color: var(--ink);
  border-color: rgba(236, 241, 224, 0.32);
}
.pose-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(216, 200, 154, 0.55);
  background: rgba(216, 200, 154, 0.08);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  border-radius: 4px;
}
.pill-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pill-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(216, 200, 154, 0.32);
}
.pill-btn[aria-pressed="true"] svg {
  animation: spin 6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.square-btn {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 4px;
}
.square-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 11;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: #5b6356;
  white-space: nowrap;
  pointer-events: none;
}
.hint span {
  margin: 0 7px;
  color: #3e453b;
}
.hint kbd {
  font-family: var(--mono);
  font-size: 7px;
  color: #868e7f;
  border: 1px solid rgba(236, 241, 224, 0.16);
  border-radius: 3px;
  padding: 1px 4px;
}

/* ---------- loader + toast ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 500px at 50% 45%, #151a10, #090b08 70%);
  transition:
    opacity 0.65s var(--ease),
    visibility 0.65s var(--ease);
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  animation: loaderIn 0.5s var(--ease) both;
}
@keyframes loaderIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.loader-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #0a0c08;
  background: var(--accent);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.loader-mark span {
  font-family: var(--mono);
  font-size: 12px;
  vertical-align: 15px;
  letter-spacing: -0.06em;
}
.loader-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 190px;
}
.loader-copy > span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}
.loader-track {
  height: 2px;
  background: rgba(236, 241, 224, 0.12);
  overflow: hidden;
}
.loader-track i {
  display: block;
  height: 100%;
  width: 38%;
  background: var(--accent);
  animation: loadScan 1.2s var(--ease) infinite;
}
@keyframes loadScan {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}
.loader-copy small {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.17em;
  color: var(--faint);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  transform: translate(-50%, 14px);
  padding: 10px 16px;
  border-radius: 5px;
  background: var(--accent);
  color: #0a0c08;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}


/* ---------- material language ---------- */

.material-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding: 0 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.material-filters::-webkit-scrollbar {
  display: none;
}
.mat-chip {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(231, 232, 219, 0.13);
  border-radius: 3px;
  background: rgba(12, 14, 16, 0.56);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}
.mat-chip i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--mat, #8a8f84);
  box-shadow: 0 0 5px var(--mat, #8a8f84);
}
.mat-chip span {
  margin-left: 1px;
  color: var(--faint);
  font-size: 6px;
  letter-spacing: 0;
}
.mat-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.mat-chip.is-on {
  color: var(--accent);
  border-color: rgba(216, 200, 154, 0.42);
  background: rgba(216, 200, 154, 0.075);
}
.mat-chip.is-on span {
  color: rgba(216, 200, 154, 0.58);
}

.material-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
}
.material-dot.cloth {
  background: #8d947f;
  box-shadow: 0 0 5px rgba(141, 148, 127, 0.55);
}
.material-dot.leather {
  background: #a97b58;
  box-shadow: 0 0 5px rgba(169, 123, 88, 0.55);
}
.material-dot.chainmail {
  background: #99a6ad;
  box-shadow: 0 0 5px rgba(153, 166, 173, 0.55);
}
.item .material-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  z-index: 2;
}
.item .swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: overlay;
}
.item .swatch.mat-cloth::after {
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.15) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 5px);
}
.item .swatch.mat-leather::after {
  background-image: radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.32) 0 1px, transparent 1.7px);
  background-size: 7px 7px;
}
.item .swatch.mat-chainmail::after {
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 1.8px, rgba(0, 0, 0, 0.28) 2px 2.9px, transparent 3.1px),
    radial-gradient(circle at 0 0, transparent 0 1.8px, rgba(255, 255, 255, 0.12) 2px 2.7px, transparent 2.9px);
  background-size: 8px 8px;
}
.item.mat-cloth .sub {
  color: #8d947f;
}
.item.mat-leather .sub {
  color: #a97b58;
}
.item.mat-chainmail .sub {
  color: #99a6ad;
}
.item.is-on .sub {
  color: rgba(216, 200, 154, 0.72);
}

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .hero {
    width: 330px;
  }
  .hero h1 {
    font-size: clamp(52px, 5.7vw, 70px);
  }
  .loadout-card {
    width: 288px;
  }
  .controls {
    width: 316px;
  }
  .hint {
    display: none;
  }
}

@media (max-width: 1080px) and (min-width: 901px) {
  .locker {
    width: 348px;
  }
  .hero {
    width: 290px;
  }
  .hero h1 {
    font-size: 58px;
  }
  .hero-copy {
    display: none;
  }
  .loadout-card {
    width: 258px;
    margin-top: 22px;
  }
  .controls {
    width: 100%;
    max-width: 316px;
  }
  .control-label {
    width: 48px;
  }
}

@media (max-height: 800px) and (min-width: 901px) {
  .hero {
    top: 96px;
  }
  .hero-copy {
    display: none;
  }
  .loadout-card {
    margin-top: 20px;
  }
  .controls {
    bottom: 18px;
  }
  .lc-note {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(760px 540px at 52% 30%, #1d2428 0%, #0f1316 52%, #07090a 100%);
  }
  body::before {
    background:
      radial-gradient(ellipse 70% 30% at 50% 48%, rgba(190, 202, 210, 0.065), transparent 70%);
  }
  #stage {
    inset: 0 0 auto 0;
    height: 50vh;
  }
  #stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(8, 10, 12, 0.85));
  }
  .vignette {
    background:
      linear-gradient(to bottom, rgba(5, 7, 8, 0.4), transparent 22%, transparent 60%, rgba(5, 7, 8, 0.2)),
      radial-gradient(ellipse 92% 50% at 50% 34%, transparent 44%, rgba(4, 6, 8, 0.42) 100%);
  }

  .topbar {
    height: 62px;
    padding: 0 14px;
  }
  .topbar::after {
    left: 14px;
    right: 14px;
    background: linear-gradient(to right, var(--line-strong), transparent 80%);
  }
  .brand {
    gap: 10px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 23px;
  }
  .brand-mark span {
    font-size: 7px;
    vertical-align: 8px;
  }
  .brand-text b {
    font-size: 18px;
  }
  .brand-text small {
    font-size: 6px;
  }
  .build {
    display: none;
  }
  .snap-btn {
    width: 34px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .snap-btn span {
    display: none;
  }

  .hero {
    display: none;
  }
  .controls {
    display: none;
  }
  .hint {
    display: none;
  }

  .locker {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: 50vh;
    min-height: 322px;
    max-height: 500px;
    border-radius: 14px;
    animation-duration: 0.65s;
  }
  .locker::before {
    left: 16px;
    width: 48px;
  }
  .panel-head {
    padding: 11px 12px 0;
  }
  .mono {
    font-size: 8.5px;
  }
  .panel-count {
    font-size: 6.5px;
  }
  .tabs {
    margin-top: 8px;
  }
  .tab {
    padding: 8px 3px;
    font-size: 7px;
  }
  .tab .tab-n {
    display: none;
  }

  .mobile-controls {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid var(--line);
  }
  .m-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .m-label {
    width: 32px;
    flex: none;
    font-family: var(--mono);
    font-size: 6.5px;
    letter-spacing: 0.1em;
    color: var(--faint);
  }
  .mobile-controls .skin-row {
    gap: 8px;
  }
  .mobile-controls .skin-swatch {
    width: 21px;
    height: 21px;
  }
  .mobile-controls .pose-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }
  .mobile-controls .pose-row::-webkit-scrollbar {
    display: none;
  }
  .mobile-controls .pose-chip {
    height: 24px;
    padding: 0 9px;
    font-size: 6.5px;
  }

  .item-detail {
    margin: 6px 12px 0;
    padding-bottom: 6px;
    min-height: 19px;
  }
  .detail-name {
    font-size: 10px;
  }
  .detail-meta {
    font-size: 6px;
  }
  .detail-stats {
    display: none;
  }
  .item-grid {
    padding: 8px 10px 12px;
    gap: 6px;
  }
  .item .swatch {
    height: 43px;
  }
  .item .cat-icon {
    width: 19px;
    height: 19px;
    left: 6px;
    bottom: 5px;
  }
  .item .meta {
    padding: 6px 7px 7px;
  }
  .item .name {
    font-size: 9.5px;
  }
  .item .sub {
    font-size: 6px;
  }
  .panel-foot {
    padding: 8px 10px 9px;
  }
  .action {
    height: 31px;
    font-size: 7px;
  }
  .action svg {
    width: 10px;
    height: 10px;
  }
  .autosave {
    margin-top: 7px;
    font-size: 6px;
  }
  .toast {
    bottom: calc(50vh + 18px);
    font-size: 7.5px;
  }
}

@media (max-width: 380px) {
  .locker {
    left: 6px;
    right: 6px;
    bottom: 6px;
    height: 51vh;
  }
  .brand-text small {
    display: none;
  }
  .item .swatch {
    height: 42px;
  }
  .item .name {
    font-size: 9px;
  }
  .panel-count {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .material-filters {
    margin-top: 6px;
    padding-bottom: 1px;
    gap: 3px;
  }
  .mat-chip {
    height: 21px;
    padding: 0 6px;
    font-size: 6.5px;
  }
  .mat-chip span {
    display: none;
  }
  .item .material-dot {
    top: 7px;
    right: 7px;
  }
  .item-detail {
    margin-top: 7px;
  }
}
