:root {
  --bg: #131512;
  --panel: #1a1d19;
  --panel-2: #21251f;
  --line: #2b312a;
  --text: #e7eae3;
  --muted: #98a294;
  --green: #6cc06c;
  --gold: #d3b05f;
  --red: #d97b6c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.mono { font-family: "IBM Plex Mono", monospace; }

.topbar { border-bottom: 1px solid var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -.2px;
}

.brand:hover { text-decoration: none; }

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--green);
}

.topbar-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--muted);
}

.topbar-count span { color: var(--green); }

.hero { padding: 52px 0 30px; border-bottom: 1px solid var(--line); }

.hero h1 {
  font-weight: 800;
  font-size: clamp(26px, 4.5vw, 40px);
  letter-spacing: -.8px;
  line-height: 1.15;
  max-width: 640px;
}

.hero-sub {
  color: var(--muted);
  margin: 8px 0 26px;
  max-width: 560px;
}

#search {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  padding: 15px 18px;
  outline: none;
}

#search:focus { border-color: var(--green); }
#search::placeholder { color: var(--muted); }

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.controls select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
}

.controls select:hover { border-color: #3a423a; }
.controls select:focus { border-color: var(--green); }

main { padding: 22px 0 10px; }

.showing {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.showing span { color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.card:hover { border-color: #3d463c; }

.thumb {
  aspect-ratio: 1;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(#242822 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: center;
}

.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.card-info { padding: 10px 12px 11px; }

.card-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price { color: var(--green); }
.price.offsale { color: var(--red); }
.price.free { color: var(--muted); }

.tag.limited, .tag.limitedu, .tag.collectible { color: var(--gold); }

.loader { display: flex; justify-content: center; padding: 36px 0; }

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

.endnote {
  text-align: center;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  padding: 36px 16px;
}

.hidden { display: none !important; }

footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 20px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }

.modal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 22px; display: flex; gap: 22px; }

.modal-thumb {
  width: 230px;
  height: 230px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-image: radial-gradient(#242822 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: center;
}

.modal-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.modal-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }

.modal-detail h2 {
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.3px;
}

.modal-type {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
}

.modal-type .tag { color: var(--gold); }

.statrow { display: flex; gap: 20px; flex-wrap: wrap; margin: 2px 0; }
.mstat { line-height: 1.3; }
.mstat .k { display: block; color: var(--muted); font-size: 11.5px; }
.mstat .v { font-family: "IBM Plex Mono", monospace; font-weight: 500; font-size: 15px; }
.mstat .v.green { color: var(--green); }
.mstat .v.red { color: var(--red); }

.desc {
  color: var(--muted);
  font-size: 13.5px;
  white-space: pre-wrap;
  max-height: 110px;
  overflow-y: auto;
}

.roblox-link { margin-top: auto; font-weight: 600; font-size: 14px; align-self: flex-start; }

@media (max-width: 720px) {
  .hero { padding: 36px 0 24px; }
  .modal-body { flex-direction: column; }
  .modal-thumb { width: 100%; height: auto; aspect-ratio: 1; }
}
