:root {
  --bg: #0b0816;
  --card: #151027;
  --card2: #1d1636;
  --fg: #ece8ff;
  --muted: #9a92c0;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --gold: #fbbf24;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 5vw;
  background: rgba(11, 8, 22, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #2a2150;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); text-decoration: none; }
.brand-mark { color: var(--cyan); font-size: 1.6rem; text-shadow: 0 0 12px var(--cyan); }
.brand-text { font-family: "Cinzel", serif; font-weight: 800; letter-spacing: .12em; line-height: 1; }
.brand-text small { display: block; font-size: .65em; letter-spacing: .3em; color: var(--cyan); margin-top: 2px; }
.actions { display: flex; gap: .6rem; }
.btn {
  border: 0; cursor: pointer; border-radius: 8px;
  padding: .55rem 1rem; font: 600 .9rem "Inter", sans-serif;
  transition: transform .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-light { background: #fff; color: #111; }
.btn-primary { background: linear-gradient(90deg, var(--purple), #5b8cf6); color: #fff; }
.btn-primary span { background: rgba(0,0,0,.3); border-radius: 99px; padding: 0 .5rem; margin-left: .3rem; }
.wide { width: 100%; padding: .8rem; }

.hero { position: relative; height: clamp(160px, 28vw, 340px); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(11, 8, 22, .9)); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(11, 8, 22, .78), rgba(11, 8, 22, .9)),
    url("assets/Mystic_Horizon__Neon_Fantasy_Realm.png") center / cover no-repeat;
}

main { max-width: 1200px; margin: 0 auto; padding: 0 5vw 4rem; }
.category { margin-top: 2.5rem; }
.category h2 {
  text-align: center; font-family: "Cinzel", serif; font-size: 1.8rem; margin-bottom: 1.5rem;
}
.cmd { font: 600 .9rem "Inter", sans-serif; color: var(--cyan); margin-left: .4rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid #2a2150; border-radius: 14px; padding: 1.2rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--purple); box-shadow: 0 8px 30px rgba(139, 92, 246, .25); }
.art {
  height: 150px; border-radius: 10px; display: grid; place-items: center;
  font-size: 4rem; margin-bottom: .5rem;
  background: radial-gradient(circle at 50% 60%, var(--glow, #8b5cf6) -40%, #0e0a1d 70%);
  text-shadow: 0 0 25px var(--glow, #8b5cf6);
}
.card h3 { font-size: 1.05rem; }
.perks { list-style: none; color: var(--muted); font-size: .85rem; line-height: 1.5; flex: 1; }
.perks li::before { content: "\25C6 "; color: var(--cyan); font-size: .7em; }
.price { color: var(--cyan); font-weight: 700; font-size: 1.1rem; margin-top: .3rem; }
.card .btn { margin-top: .4rem; }

footer {
  border-top: 1px solid #2a2150; text-align: center;
  padding: 2rem 5vw; color: var(--muted); font-size: .85rem;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
footer .brand-text.small { font-size: 1rem; color: var(--fg); }
footer a { color: var(--muted); margin: 0 .6rem; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 30; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 100%);
  background: var(--card); border-left: 1px solid #2a2150; z-index: 40;
  transform: translateX(100%); transition: transform .3s;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid #2a2150; }
.close { background: none; border: 0; color: var(--fg); font-size: 1.8rem; cursor: pointer; }
#basketList { list-style: none; flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
#basketList li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid #241b45; }
#basketList .empty { color: var(--muted); justify-content: center; border: 0; }
#basketList button { background: none; border: 0; color: #f87171; cursor: pointer; }
.drawer-foot { padding: 1.2rem; border-top: 1px solid #2a2150; display: flex; flex-direction: column; gap: .8rem; }
.total { display: flex; justify-content: space-between; font-size: 1.1rem; }

/* Scope toggle, grids, bundles */
.scope { display: flex; justify-content: center; gap: .5rem; margin-top: 2rem; }
.scope-btn {
  background: var(--card); color: var(--muted); border: 1px solid #2a2150;
  padding: .6rem 1.6rem; border-radius: 99px; cursor: pointer; font: 600 .95rem "Inter", sans-serif;
}
.scope-btn.active { background: linear-gradient(90deg, var(--purple), var(--cyan)); color: #fff; border-color: transparent; }
.scope-note { text-align: center; color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 1.5rem; }
.bundle-group {
  font-family: "Cinzel", serif; margin: 1.5rem 0 .8rem; padding-left: .8rem;
  border-left: 3px solid var(--glow, var(--purple));
}
.bundle { text-align: center; }
.bundle-title { font-weight: 700; }
.price s { color: var(--muted); font-weight: 400; font-size: .85em; margin-right: .3rem; }
.save { color: var(--gold); font-size: .8rem; flex: 1; }

/* Clickable cards + detail page */
.card[data-href] { cursor: pointer; }
.more { color: var(--muted); font-size: .8rem; }
.card:hover .more { color: var(--cyan); }
.detail { max-width: 1000px; margin: 0 auto; padding: 1.5rem 5vw 4rem; }
.detail[hidden], main[hidden] { display: none; }
.back { color: var(--cyan); text-decoration: none; font-weight: 600; }
.back:hover { text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; margin-top: 2rem; align-items: start; }
.art.big { height: 320px; font-size: 7rem; gap: .5rem; grid-auto-flow: column; border: 1px solid #2a2150; }
.art.big .plus { font-size: 3rem; opacity: .6; }
.detail-info { display: flex; flex-direction: column; gap: .8rem; }
.detail-info h1 { font-family: "Cinzel", serif; font-size: 2rem; }
.detail-info h3 { margin-top: 1rem; font-family: "Cinzel", serif; }
.tag { align-self: flex-start; background: #241b45; color: var(--cyan); padding: .2rem .7rem; border-radius: 99px; font-size: .8rem; }
.big-price { font-size: 1.8rem; }
.big-price small { font-size: .5em; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.ptable { width: 100%; border-collapse: collapse; background: rgba(21, 16, 39, .8); border-radius: 10px; overflow: hidden; }
.ptable th, .ptable td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid #2a2150; }
.ptable th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.inc { display: flex; align-items: center; gap: .8rem; background: rgba(21, 16, 39, .8); border: 1px solid #2a2150; border-radius: 10px; padding: .7rem 1rem; }
.inc-icon { font-size: 1.8rem; text-shadow: 0 0 14px var(--glow, #8b5cf6); }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } .art.big { height: 220px; } }
