/* StickerVerse — public site. Dark-first, matching the app's palette.
   No external assets: system fonts, no CDN, no build step. */

:root {
  --bg: #0b0a12;
  --surface: #17151f;
  --surface-2: #221e2e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f4fa;
  --muted: #9aa0ae;
  --purple: #7c4dff;
  --purple-soft: #8b5cff;
  --grad: linear-gradient(135deg, #7c4dff 0%, #9a4dff 50%, #b24dff 100%);
  --verified: #4da6ff;
  --success: #2fd68a;
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 10, 18, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: 66px;
}
.logo { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; white-space: nowrap; }
.logo span { color: var(--purple-soft); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-size: 14.5px; font-weight: 600; transition: background .18s, color .18s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  padding: 74px 0 54px;
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: -60% 50% auto; transform: translateX(50%);
  width: 900px; height: 900px; pointer-events: none;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.28) 0%, rgba(124, 77, 255, 0) 62%);
}
.hero > * { position: relative; }
.hero h1 {
  margin: 0 0 14px; font-size: clamp(38px, 6.2vw, 64px);
  line-height: 1.05; letter-spacing: -1.6px; font-weight: 800;
}
.hero h1 .grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 auto 26px; max-width: 620px; color: var(--muted); font-size: 17.5px; }

.stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 34px; }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.6px; }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1.1px; }

/* ---------------------------------------------------------------- search + filters */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 4px 6px 4px 18px;
  transition: border-color .18s, box-shadow .18s;
}
.searchbar:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.16); }
.searchbar svg { flex: none; opacity: .6; }
.searchbar input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font-size: 16px; padding: 12px 0;
}
.searchbar input::placeholder { color: var(--muted); }
.search-clear {
  border: 0; background: var(--surface-2); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%; line-height: 1;
}
.search-clear:hover { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 26px 0 0; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--purple); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------------------------------------------------------------- sections */
.section { padding: 46px 0; }
.section-head {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 25px; letter-spacing: -0.5px; font-weight: 800; }
.section-head .count { color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------------------------- pack grid */
.pack-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}
.pack-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pack-card:hover {
  transform: translateY(-4px); border-color: var(--purple);
  box-shadow: var(--shadow);
}
.pack-preview {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px;
}
.pack-preview .cell {
  aspect-ratio: 1; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); border-radius: 10px; overflow: hidden;
}
.pack-preview img { width: 84%; height: 84%; object-fit: contain; }
.pack-card h3 {
  margin: 12px 4px 2px; font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pack-meta {
  margin: 0 4px 6px; color: var(--muted); font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}
.badge-verified { color: var(--verified); font-size: 12px; }

/* ---------------------------------------------------------------- sticker grid */
.sticker-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.sticker-tile {
  position: relative; aspect-ratio: 1; padding: 10px;
  background: rgba(255, 255, 255, 0.055); border: 1px solid var(--line);
  border-radius: var(--radius-sm); display: grid; place-items: center;
  transition: transform .16s, background .16s, border-color .16s;
}
.sticker-tile:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.1); border-color: var(--purple);
}
.sticker-tile img { width: 100%; height: 100%; object-fit: contain; }
.sticker-tile .name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11.5px; text-align: center; padding: 14px 6px 6px;
  background: linear-gradient(transparent, rgba(11, 10, 18, 0.92));
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--muted); opacity: 0; transition: opacity .16s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticker-tile:hover .name { opacity: 1; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 700; transition: .18s; white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(124, 77, 255, 0.32); }
.btn-primary:hover { filter: brightness(1.09); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--purple); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------- pack page header */
.pack-hero {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  padding: 40px 0 8px;
}
.pack-hero-art {
  width: 150px; height: 150px; flex: none; padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
.pack-hero-art .cell {
  background: rgba(255, 255, 255, 0.05); border-radius: 10px;
  display: grid; place-items: center; overflow: hidden;
}
.pack-hero-art img { width: 84%; height: 84%; object-fit: contain; }
.pack-hero-info { flex: 1; min-width: 260px; }
.pack-hero-info h1 { margin: 0 0 8px; font-size: clamp(28px, 4.6vw, 42px); letter-spacing: -1px; }
.pack-hero-info p { margin: 0 0 14px; color: var(--muted); max-width: 620px; }
.pack-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.tagrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; }
.tag {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
}

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(6, 5, 12, 0.86); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lb-card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 24px; padding: 24px; width: min(430px, 100%);
  text-align: center; box-shadow: var(--shadow); position: relative;
}
.lb-art {
  background: rgba(255, 255, 255, 0.06); border-radius: 18px;
  padding: 26px; margin-bottom: 18px;
}
.lb-art img { width: 100%; max-width: 260px; margin: 0 auto; aspect-ratio: 1; object-fit: contain; }
.lb-card h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.3px; }
.lb-card .lb-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.lb-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lb-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); font-size: 18px;
}
.lb-close:hover { color: var(--text); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(23, 21, 31, 0.9); color: var(--text); font-size: 20px; display: grid; place-items: center;
}
.lb-nav:hover { border-color: var(--purple); }
.lb-prev { left: -60px; }
.lb-next { right: -60px; }
@media (max-width: 620px) {
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); padding: 12px 22px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .24s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(47, 214, 138, .5); }

/* ---------------------------------------------------------------- tables / content pages */
.prose { max-width: 780px; }
.prose h1 { font-size: clamp(30px, 5vw, 42px); letter-spacing: -1px; margin: 0 0 12px; }
.prose h2 { font-size: 22px; margin: 34px 0 10px; letter-spacing: -0.3px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose a { color: var(--purple-soft); text-decoration: underline; text-underline-offset: 3px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin: 18px 0;
}
.credit-group { margin-bottom: 26px; }
.credit-group h3 { margin: 0 0 10px; font-size: 17px; }
.credit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.credit-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13.5px; color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
}
.credit-list b { color: var(--text); font-weight: 700; }
.credit-list .lic {
  background: var(--surface-2); border-radius: 999px; padding: 1px 10px;
  font-size: 12px; color: var(--purple-soft); white-space: nowrap;
}
.credit-list a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.credit-list a:hover { color: var(--text); }

/* ---------------------------------------------------------------- empty + footer */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 19px; margin-bottom: 6px; }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 46px;
  color: var(--muted); font-size: 14px;
}
.footer-inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-inner nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 640px) {
  .header-inner { height: 58px; gap: 10px; }
  .nav a { padding: 7px 10px; font-size: 13.5px; }
  .hero { padding: 46px 0 34px; }
  .stats { gap: 26px; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .pack-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
