:root {
  --bg: #15121d;
  --bg2: #1d1928;
  --panel: #252032;
  --panel2: #2e2840;
  --line: #3b3450;
  --text: #f1ecff;
  --muted: #a79fc2;
  --gold: #ffd23f;
  --amethyst: #a259ff;
  --green: #6bc74a;
  --blue: #3aa0ff;
  --red: #f25a5a;
  --radius: 16px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(162, 89, 255, 0.22), transparent 60%),
    radial-gradient(700px 360px at 90% 0%, rgba(255, 210, 63, 0.10), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: Cinzel, serif; letter-spacing: 0.02em; margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px 28px; background: rgba(21, 18, 29, 0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; }
/* The logo is rendered on black; screen-blending drops the black onto our dark header. */
.brand img { height: 40px; width: auto; mix-blend-mode: screen; }
.tabs { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 600; color: var(--muted); transition: color 0.15s, background 0.15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--amethyst); color: #fff; box-shadow: 0 6px 18px -8px var(--amethyst); }

main { max-width: 1280px; margin: 0 auto; padding: 28px 28px 80px; }
.tab { display: none; }
.tab.active { display: block; animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero (full-bleed key art) ---------- */
.hero {
  position: relative; min-height: clamp(460px, 62vh, 680px); display: none; align-items: flex-end;
  margin-bottom: 8px; overflow: hidden; isolation: isolate;
}
body[data-tab='wearables'] .hero { display: flex; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; z-index: -1; transform: scale(1.02); }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(21, 18, 29, 0.55) 0%, rgba(21, 18, 29, 0) 30%, rgba(21, 18, 29, 0.35) 70%, var(--bg) 100%),
    linear-gradient(90deg, rgba(21, 18, 29, 0.75) 0%, rgba(21, 18, 29, 0.25) 50%, rgba(21, 18, 29, 0) 100%);
}
.hero-inner { width: 100%; max-width: 1280px; margin: 0 auto; padding: 40px 28px 56px; display: flex; flex-direction: column; align-items: flex-start; }
.hero-logo { width: min(560px, 90%); height: auto; mix-blend-mode: screen; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); margin-left: -4%; }
.tagline { margin: 6px 0 22px; font-family: Cinzel, serif; font-weight: 600; font-size: clamp(16px, 2vw, 22px); letter-spacing: 0.06em; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent; transition: transform 0.12s, filter 0.12s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn.primary { background: var(--amethyst); color: #fff; box-shadow: 0 10px 24px -12px var(--amethyst); }
.btn.ghost { border-color: rgba(255, 255, 255, 0.35); color: #fff; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); }

/* ---------- Zones ---------- */
.zones { margin-bottom: 44px; }
.zone-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.zone {
  position: relative; display: block; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); aspect-ratio: 3 / 4; transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.zone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.zone::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(12, 10, 18, 0.92) 100%); }
.zone:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 30px 50px -30px var(--accent); }
.zone:hover img { transform: scale(1.05); }
.zone-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; z-index: 1; }
.zone-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.zone-kicker img { position: static; width: 16px; height: 16px; }
.zone h3 { font-size: 20px; color: #fff; margin-bottom: 4px; }
.zone p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.catalogue-head { padding-top: 8px; scroll-margin-top: 90px; }

.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 28px; color: var(--gold); margin-bottom: 6px; }
.section-head h3 { font-size: 20px; color: var(--gold); margin-bottom: 6px; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 72ch; }
.section-head.small { margin-top: 36px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--chip, var(--amethyst)) 60%, var(--line)); }
.chip img { width: 18px; height: 18px; }
.chip.active { color: #fff; border-color: var(--chip, var(--amethyst)); background: color-mix(in srgb, var(--chip, var(--amethyst)) 28%, var(--panel)); }

/* ---------- Groups ---------- */
.group { margin-bottom: 40px; }
.group-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-left: 14px; border-left: 3px solid var(--accent, var(--gold)); }
.group-head h2 { font-size: 20px; color: var(--accent, var(--gold)); }
.group-head p { margin: 0; font-size: 14px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.grid.compact { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }

/* ---------- Wearable cards ---------- */
.card {
  position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel) 40%); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent, var(--amethyst)); opacity: 0.9; }
.card:hover { transform: translateY(-3px); border-color: var(--accent, var(--amethyst)); box-shadow: 0 24px 40px -28px var(--accent, var(--amethyst)); }
.card .art { position: relative; background: radial-gradient(circle at 50% 40%, #241e33, #171322 70%); aspect-ratio: 1; display: grid; place-items: center; }
.card .art img { width: 100%; height: 100%; object-fit: contain; }
.card .art .lvl {
  position: absolute; top: 12px; left: 12px; font-family: Cinzel, serif; font-weight: 800; font-size: 14px;
  background: var(--accent, var(--amethyst)); color: #fff; padding: 4px 10px; border-radius: 8px; box-shadow: 0 6px 16px -8px var(--accent, var(--amethyst));
}
.card .art .rarity {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.6); color: var(--r, var(--gold)); border: 1px solid color-mix(in srgb, var(--r, var(--gold)) 50%, transparent); padding: 4px 8px; border-radius: 6px;
}
/* Decentraland rarity palette */
.r-common { --r: #abb1c7; } .r-uncommon { --r: #ed6d4f; } .r-rare { --r: #36cf75; } .r-epic { --r: #3d85e6; }
.r-legendary { --r: #a855f7; } .r-exotic { --r: #c48bff; } .r-mythic { --r: #ff63e1; } .r-unique { --r: #ffb626; }
.card .art .planned {
  position: absolute; bottom: 12px; left: 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.65); color: var(--muted); border: 1px dashed var(--line); padding: 4px 8px; border-radius: 6px;
}
.card.is-planned .art img { filter: saturate(0.7); opacity: 0.85; }
.card .body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 17px; }
.card .effect { font-size: 13px; color: var(--muted); line-height: 1.45; }
.card .label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.cost { display: flex; flex-wrap: wrap; gap: 6px; }
.mat {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 8px 4px 4px; font-size: 13px; font-weight: 600; transition: border-color 0.15s, background 0.15s;
}
.mat:hover { border-color: var(--amethyst); background: color-mix(in srgb, var(--amethyst) 14%, var(--panel2)); }
.mat img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.mat .n { color: var(--gold); }
.mat.combo { border-color: color-mix(in srgb, var(--amethyst) 60%, var(--line)); }
.mat.relic { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.req { margin: 0; padding-left: 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.buy { display: inline-block; margin-top: 4px; padding: 9px 16px; border-radius: 999px; background: var(--amethyst); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none; align-self: flex-start; }
.buy:hover { filter: brightness(1.1); }

/* Single-item groups (the Ring) stretch into a feature row */
.grid.feature { grid-template-columns: 1fr; }
.grid.feature .card { flex-direction: row; }
.grid.feature .card .art { width: 300px; flex: 0 0 300px; aspect-ratio: 1; }
.grid.feature .card .body { padding: 24px 28px; justify-content: center; }
.grid.feature .card h3 { font-size: 22px; }
.grid.feature .card .effect { font-size: 14.5px; max-width: 64ch; }

/* ---------- Material cards ---------- */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px 22px; }
.pair { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: stretch; gap: 6px; }
.pair .mcard { display: flex; flex-direction: column; }
.pair .arrow { align-self: center; }
.pair .arrow { color: var(--muted); font-size: 18px; text-align: center; }
.mcard { position: relative; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; padding: 0; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.mcard:hover { transform: translateY(-2px); border-color: var(--accent, var(--amethyst)); box-shadow: 0 18px 30px -24px var(--accent, var(--amethyst)); }
.mcard img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #1a1724; }
.mcard .body { padding: 10px 12px 12px; }
.mcard h4 { margin: 0 0 4px; font-size: 14px; }
.mcard .meta { font-size: 12px; color: var(--muted); line-height: 1.45; }
.mcard .meta .needs { color: var(--gold); font-weight: 600; }
.mcard .tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--panel2); color: var(--muted); margin-bottom: 6px; }
.mcard.locked .tag { color: var(--amethyst); }

/* ---------- How it works ---------- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.rule { position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel) 50%); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 22px 72px; }
.rule .step {
  position: absolute; top: 20px; left: 20px; width: 36px; height: 36px; display: grid; place-items: center;
  font-family: Cinzel, serif; font-weight: 800; font-size: 16px; color: #fff; background: var(--amethyst); border-radius: 10px; box-shadow: 0 8px 18px -8px var(--amethyst);
}
.rule h3 { font-size: 17px; color: var(--gold); margin-bottom: 8px; }
.rule p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.rule strong { color: var(--text); }

/* ---------- Footer ---------- */
.foot {
  max-width: 1280px; margin: 0 auto; padding: 22px 28px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.foot strong { color: var(--gold); font-family: Cinzel, serif; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); }

/* ---------- Detail drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); z-index: 8; }
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 9; overflow-y: auto;
  background: var(--bg2); border-left: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: -30px 0 60px -40px #000; animation: slide 0.22s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail .close { position: absolute; top: 14px; right: 14px; border: 0; background: var(--panel); border-radius: 999px; width: 36px; height: 36px; font-size: 18px; }
.detail .close:hover { background: var(--panel2); }
.detail img.hero { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 14px; background: #1a1724; }
.detail h2 { font-size: 22px; color: var(--gold); margin-bottom: -10px; }
.detail .tier-line { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.detail .kv { display: grid; grid-template-columns: 1fr; gap: 12px; font-size: 15px; line-height: 1.45; margin: 0; }
.detail .kv dt { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.detail .kv dd { margin: 0 0 4px; }
.detail .label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.detail .list { display: flex; flex-direction: column; gap: 6px; }
.detail .list button { text-align: left; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.detail .list button:hover { border-color: var(--amethyst); }
.detail .list img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.detail .list small { display: block; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .zone-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 420px; }
}
@media (max-width: 720px) {
  .grid.feature .card { flex-direction: column; }
  .grid.feature .card .art { width: 100%; flex: none; }
  .pairs { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: center; padding: 10px 16px; gap: 10px; }
  .brand img { height: 32px; }
  .hero-inner { padding: 32px 16px 40px; }
  .hero-logo { width: 100%; margin-left: 0; }
  .tagline { font-size: 15px; }
  .zone { aspect-ratio: 4 / 5; }
  .tabs { justify-content: center; }
  main { padding: 20px 16px 60px; }
  .group-head { flex-direction: column; gap: 4px; }
  .rule { padding-left: 22px; padding-top: 68px; }
  .how-grid { grid-template-columns: 1fr; }
}
