:root {
  --bg: #0e0f11;
  --panel: #15161a;
  --card: #1a1b1f;
  --card-hi: #202126;
  --line: #26282e;
  --line-hi: #34363d;
  --text: #ececef;
  --muted: #9b9da6;
  --accent: #8b95ff;
  --good: #3ddc97;
  --avatar: #2b2d33;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; }
code, kbd, .m-sku code { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---------- top strip: support + reseller ---------- */
.promo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.promo-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
.promo-head { display: grid; gap: 2px; min-width: 0; }
.promo-head b { font-size: 15px; }
.promo-head span { font-size: 13px; color: var(--muted); }
.promo-resell { background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--panel) 70%);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transition: border-color .15s, transform .15s; }
.promo-resell:hover { border-color: var(--accent); transform: translateY(-1px); }
.promo-go { font-weight: 650; font-size: 14px; color: var(--accent); white-space: nowrap; }
.promo:has(.promo-support[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 860px) { .promo { grid-template-columns: 1fr; } }

/* ---------- contact cards (Support button -> dialog) ---------- */
dialog.reach-dlg { width: min(900px, calc(100vw - 32px)); padding: 26px 24px 24px; }
.reach-dlg .rc-title { padding-right: 40px; }
.acct svg { width: 18px; height: 18px; flex: none; }
.site-foot button.foot-support { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; }

/* ---------- footer ---------- */
.site-foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.site-foot .foot-brand { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.site-foot .foot-tag { flex: 1; min-width: 160px; }
.site-foot .foot-support {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.site-foot .foot-support:hover { text-decoration: underline; }
.site-foot .foot-link { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-foot .foot-link:hover { color: var(--text); }

/* account button in the header */
.acct {
  flex: none;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition: border-color .15s;
}
.acct:hover { border-color: var(--accent); }
.acct b { color: var(--good); font-weight: 650; font-variant-numeric: tabular-nums; }
svg { fill: currentColor; }

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
}
.search input::placeholder { color: var(--muted); }
.search kbd {
  font: 12px ui-monospace, monospace;
  color: var(--muted);
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  padding: 1px 6px;
}

.subbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.controls { display: flex; align-items: center; gap: 10px; flex: none; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.sort select {
  height: 34px;
  padding: 0 30px 0 11px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%239b9da6'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 9px center;
  appearance: none;
  border: 1px solid var(--line-hi);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  outline: none;
}
.sort select:focus-visible { border-color: var(--accent); }
.cur { display: inline-flex; background: var(--panel); border: 1px solid var(--line-hi); border-radius: 9px; padding: 2px; }
.cur button {
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.cur button[aria-pressed="true"] { background: var(--card-hi); color: var(--text); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 14px;
  transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] {
  color: var(--text);
  background: var(--card-hi);
  border-color: var(--line-hi);
}

/* ---------- grid ---------- */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

.status { color: var(--muted); font-size: 14px; margin: 0 0 14px; min-height: 20px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  outline: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-hi);
  background: var(--card-hi);
}
.card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.media {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #23252b, #17181c 70%);
}

.info { padding: 11px 13px 13px; }
.name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dots { display: flex; gap: 4px; margin-top: 7px; height: 10px; }
.dots i {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.price { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.price s { color: var(--muted); font-size: 13px; }
.price b { font-size: 16px; }
.off {
  font-size: 12px;
  font-weight: 600;
  color: var(--good);
  background: color-mix(in srgb, var(--good) 13%, transparent);
  border-radius: 6px;
  padding: 1px 6px;
}

.rtag { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: 6px; padding: 1px 6px; }

/* ---------- previews ---------- */
.deco { position: relative; width: 64%; aspect-ratio: 1; }
.deco .avatar {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  background: var(--avatar);
  display: grid;
  place-items: center;
}
.deco .avatar::after {
  content: "";
  width: 46%; height: 46%;
  border-radius: 50%;
  background: #3a3c44;
}
.deco img { position: absolute; inset: 0; width: 100%; height: 100%; }

.plate {
  position: relative;
  width: 90%;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: #202227 center / cover no-repeat;
}
.plate video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate .user {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.plate .user i { width: 28px; height: 28px; border-radius: 50%; background: var(--avatar); flex: none; }

.effect { width: 100%; height: 100%; object-fit: cover; }
.stage { position: relative; width: 100%; height: 100%; background: #111215; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* hover: the preview grows a little (effects a touch more) */
.media > .deco, .media > .plate, .media > .bundle, .media > .effect, .media > .stage {
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.card:hover .media > .deco, .card:hover .media > .plate, .card:hover .media > .bundle { transform: scale(1.06); }
.card:hover .media > .effect, .card:hover .media > .stage { transform: scale(1.12); }

.bundle { position: absolute; inset: 0; background: center / cover no-repeat; }
.bundle img, .bundle video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ---------- modal ---------- */
dialog {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-hi);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  overflow: auto;
}
dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
dialog:focus { outline: none; }
.close:focus { outline: none; }
.close:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

.close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.35);
}
.close svg { width: 18px; height: 18px; }
.close:hover { background: rgba(0,0,0,.55); }

.m-grid { display: grid; grid-template-columns: 1.05fr 1fr; }
.m-media {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #25272e, #141518 72%);
}
.m-media .deco { width: 58%; }
.m-media .plate { width: 86%; height: 72px; }
.m-media .plate .user { font-size: 17px; }
.m-media .plate .user i { width: 38px; height: 38px; }

.m-body { padding: 28px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.m-kind { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.m-body h2 { margin: -8px 0 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.015em; }
.m-summary { margin: 0; color: var(--muted); }
.label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.label span { color: var(--text); margin-left: 4px; }

.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatches button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line-hi);
  padding: 0;
}
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }

.contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.contents figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.contents .thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}
.contents .thumb .deco { width: 78%; }
.contents .thumb .plate { height: 22px; }
.contents .thumb .plate .user { display: none; }

.m-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.m-price .was { color: var(--muted); text-decoration: line-through; }
.m-price .now { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

.m-sku { display: flex; align-items: center; gap: 10px; }
.m-sku code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 13px ui-monospace, monospace;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.ghost {
  background: var(--card-hi);
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.ghost:hover { border-color: var(--accent); }

.buy {
  margin-top: auto;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #0e0f11;
  font-weight: 650;
}
.buy:disabled { opacity: .5; cursor: not-allowed; }

[hidden] { display: none !important; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .bar { padding: 12px 16px 8px; gap: 12px; }
  .brand { font-size: 17px; }
  .search kbd { display: none; }
  .acct { padding: 0 10px; }
  .acct .acct-name { display: none; }
  .subbar { padding: 0 16px 10px; flex-wrap: wrap; gap: 8px; }
  .tabs { flex-basis: 100%; }
  .controls { margin-left: auto; }
  .sort span { display: none; }
  main { padding: 14px 16px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .m-grid { grid-template-columns: 1fr; }
  .m-media { aspect-ratio: 4 / 3; }
  .m-body { padding: 20px 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
  .card:hover .media > * { transform: none !important; }
}

/* profile frame preview (Discord has no public frame image): a profile card in a glowing frame */
.frame-pv { position: relative; width: 62%; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.frame-pv .fcard { position: absolute; inset: 8%; border-radius: 14px; background: linear-gradient(180deg, #2b2d36, #1c1d22);
  border: 3px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent),
  0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); display: grid; align-content: start; justify-items: start; gap: 6px; padding: 18% 12% 0; }
.frame-pv .fav { width: 34%; aspect-ratio: 1; border-radius: 50%; background: #3a3c44; border: 3px solid #1c1d22; }
.frame-pv .fcard b { display: block; height: 7px; width: 80%; border-radius: 4px; background: #3a3c44; }
.frame-pv .fcard b.short { width: 55%; }
.frame-pv .ftag { position: absolute; bottom: 2%; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg, #0e0f11)); border-radius: 6px; padding: 2px 7px; }

/* ---------- cart ---------- */
.cart-btn { position: relative; }
.cart-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #0e0f11;
  font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.buy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.buy-row .buy { margin-top: 0; }
.ghost-buy { background: var(--card-hi); color: var(--text); border: 1px solid var(--line-hi); }
.ghost-buy:hover:not(:disabled) { border-color: var(--accent); }
dialog.cart-dlg { width: min(620px, calc(100vw - 32px)); padding: 22px 22px 18px; }
.cart-dlg h2 { margin: 0 0 14px; font-size: 20px; padding-right: 40px; }
.cart-list { display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.cart-row { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 12px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.cart-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #23252b, #17181c 70%); }
.cart-thumb .deco { width: 88%; }
.cart-thumb .plate { height: 18px; width: 92%; }
.cart-thumb .plate .user { display: none; }
.cart-text { display: grid; min-width: 0; }
.cart-text b, .cart-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-text span { font-size: 12.5px; }
.qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-hi); border-radius: 9px; padding: 2px; }
.qty button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; font-weight: 700; }
.qty button:hover { background: var(--card-hi); }
.qty span { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-price { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.cart-empty { margin: 8px 0; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.cart-foot b { font-size: 20px; }
.cart-actions { display: flex; gap: 8px; }
.cart-actions .buy { margin: 0; padding: 0 22px; }
@media (max-width: 560px) {
  .cart-row { grid-template-columns: 48px 1fr auto; }
  .cart-price { grid-column: 2 / -1; text-align: left; }
}

/* small screens: logo + icon buttons on one row, search on its own row below */
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 8px 6px; }
  .bar .brand { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .bar .search { order: 9; flex: 1 0 100%; max-width: none; margin-left: 0; }
  .acct { height: 38px; padding: 0 9px; gap: 6px; }
}
