:root {
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --line: rgba(0, 0, 0, .10);
  --line-soft: rgba(0, 0, 0, .06);
  --blue: #0071e3;
  --blue-dark: #005bbf;
  --green: #248a3d;
  --amber: #b66a00;
  --radius: 28px;
  --radius-sm: 18px;
  --max: 1120px;
  --shadow: 0 22px 70px rgba(0, 0, 0, .08);
  --font: ui-sans-serif, system-ui, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(22px, calc((100vw - var(--max)) / 2));
  background: rgba(245, 245, 247, .82);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #1d1d1f;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: wrap;
}
.nav a {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 999px;
  font-size: .86rem;
  transition: color .18s ease, background .18s ease;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  background: rgba(0, 0, 0, .05);
}
.mobile-nav-button { display: none; }

main {
  width: min(var(--max), calc(100% - 34px));
  margin: 0 auto;
  padding: 54px 0 42px;
}
.view { display: none; animation: fadeIn .24s ease both; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 18px 50px;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 940px;
  margin-bottom: 18px;
  font-size: clamp(3.7rem, 9vw, 7.5rem);
  line-height: .93;
  letter-spacing: -.075em;
  font-weight: 760;
}
h2 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 4.8vw, 4.7rem);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 740;
}
h3 {
  margin-bottom: 9px;
  font-size: 1.22rem;
  line-height: 1.2;
  letter-spacing: -.025em;
}
p { color: var(--muted); line-height: 1.58; }
.hero-subtitle {
  max-width: 670px;
  margin: 0 auto 4px;
  color: #424245;
  font-size: clamp(1.28rem, 2.25vw, 2rem);
  line-height: 1.22;
  letter-spacing: -.02em;
}
.hero-note {
  margin: 10px 0 34px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
}

.search-card {
  width: min(760px, 100%);
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  text-align: left;
}
label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
}
.search-row, .inline-form, .inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 15px 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus {
  border-color: rgba(0, 113, 227, .55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}
.primary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 19px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
}
.primary-button {
  color: #fff;
  background: var(--blue);
}
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.ghost-button {
  color: var(--blue);
  background: rgba(0, 113, 227, .08);
  border: 1px solid rgba(0, 113, 227, .14);
}
.ghost-button:hover { background: rgba(0, 113, 227, .13); transform: translateY(-1px); }
.primary-button:disabled, .ghost-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.fine-print {
  margin: 13px 0 0;
  color: var(--muted-2);
  font-size: .88rem;
}
.two-line {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
}

.quiet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 40px 0 24px;
}
.quiet-grid article, .panel, .result-card, .stat-card, .item-card, .leaderboard-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.025);
}
.quiet-grid article {
  padding: 34px;
  min-height: 225px;
}
.quiet-grid span {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted-2);
  font-size: .88rem;
  font-weight: 650;
}
.quiet-grid p { margin-bottom: 0; }

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 20px;
}
.status-strip div {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.status-strip span {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  margin-bottom: 5px;
}
.status-strip strong { font-size: 1.08rem; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 20px 0 26px;
}
.section-heading p {
  max-width: 700px;
  margin-bottom: 0;
  font-size: 1.04rem;
}
.section-heading.compact {
  align-items: center;
  margin-top: 0;
}
.result-section { margin: 14px 0 44px; }
.result-card { padding: 32px; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.kv {
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.kv span {
  display: block;
  color: var(--muted-2);
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
}
.kv strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.pill, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  color: #424245;
  background: #f1f1f3;
  border: 1px solid var(--line-soft);
  font-size: .82rem;
  font-weight: 650;
}

.two-column {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 22px;
  margin-bottom: 22px;
}
.panel { padding: 32px; }
.panel.roomy { margin-top: 22px; }
.muted { color: var(--muted-2); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stat-card { padding: 30px; }
.stat-card span {
  color: var(--muted);
  font-size: .95rem;
}
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  letter-spacing: -.065em;
  line-height: .95;
}
.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.rules-grid div {
  padding: 20px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.rules-grid strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.3rem;
  letter-spacing: -.02em;
}
.rules-grid span { color: var(--muted); line-height: 1.5; }

.tabs, .shop-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tab, .filter-button {
  border: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 650;
}
.tab.active, .filter-button.active {
  color: #fff;
  background: #1d1d1f;
  border-color: #1d1d1f;
}
.list-panel { display: grid; gap: 12px; }
.empty-state {
  padding: 34px;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
}
.row-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.row-card p { margin: 4px 0 0; }

.split-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
}
.watchlist-link {
  width: 100%;
  display: block;
  text-align: left;
  margin-top: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}
.watchlist-link.active {
  border-color: rgba(0, 113, 227, .38);
  background: rgba(0, 113, 227, .07);
}
.watch-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
}
.drag-handle { color: var(--muted-2); font-weight: 700; }

.shop-grid, .inventory-grid, .leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.item-card, .leaderboard-card { padding: 26px; }
.item-art {
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f8f8fa, #ececf1);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.item-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}
.price { color: var(--green); font-weight: 760; }
.rarity-common { color: #6e6e73; }
.rarity-uncommon { color: var(--blue); }
.rarity-rare { color: var(--green); }
.rarity-epic { color: #7e3ff2; }
.rarity-legendary, .rarity-exclusive { color: var(--amber); }

.leader-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}
.leader-row:last-child { border-bottom: 0; }
.rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f1f1f3;
  color: var(--muted);
  font-weight: 700;
}

.footer {
  width: min(var(--max), calc(100% - 34px));
  margin: 30px auto 0;
  padding: 28px 0 38px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: .92rem;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 420px;
  padding: 15px 17px;
  border-radius: 18px;
  color: #fff;
  background: rgba(29, 29, 31, .94);
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
}
.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
  padding: 28px;
}
.not-found .brand-mark { margin: 0 auto; }

@media (max-width: 980px) {
  .site-header { padding-inline: 18px; }
  .nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    padding: 10px;
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .mobile-nav-button { display: inline-flex; }
  .quiet-grid, .status-strip, .two-column, .split-layout { grid-template-columns: 1fr; }
  .shop-grid, .inventory-grid, .leaderboard-grid { grid-template-columns: repeat(2, 1fr); }
  .rules-grid, .result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  main, .footer { width: min(100% - 22px, var(--max)); }
  main { padding-top: 30px; }
  .hero { min-height: auto; padding: 52px 0 32px; }
  h1 { font-size: clamp(3.1rem, 17vw, 4.6rem); }
  .search-row, .inline-form, .inline-actions { flex-direction: column; align-items: stretch; }
  .section-heading { flex-direction: column; align-items: flex-start; }
  .shop-grid, .inventory-grid, .leaderboard-grid, .stat-grid, .rules-grid, .result-grid { grid-template-columns: 1fr; }
  .row-card { flex-direction: column; align-items: flex-start; }
}
.privacy-line { margin: 12px 0 0; color: var(--muted-2); font-size: .88rem; }

.loading-line {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .06);
  margin-bottom: 18px;
  position: relative;
}
.loading-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--blue);
  animation: loadingSlide 1.1s ease-in-out infinite;
}
@keyframes loadingSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}
.item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.price {
  color: var(--text);
  font-weight: 750;
  letter-spacing: -.02em;
}
.watchlist-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 15px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 10px;
}
.watchlist-pill.active {
  background: #fff;
  border-color: rgba(0, 113, 227, .24);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .08);
}
.watchlist-pill span {
  color: var(--muted);
  font-size: .86rem;
}
.boost-banner {
  grid-column: 1 / -1;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fff, #f5f9ff);
  border-color: rgba(0, 113, 227, .16);
}
.boost-banner p {
  margin: 0;
  color: var(--text);
  font-weight: 650;
}
.mini {
  grid-template-columns: repeat(2, 1fr);
}
.muted { color: var(--muted); }
