:root {
  --bg: #efecf8;
  --bg-2: #e6e9f8;
  --surface: #ffffff;
  --text: #15172a;
  --muted: #6b6f86;
  --line: #e2e0ee;
  --card: #1f2433;
  --card-2: #2c3245;
  --card-text: #ffffff;
  --accent: #2f5fd0;
  --accent-ink: #ffffff;
  --red: #e8473b;
  --blue: #3b6fe0;
  --yellow: #f4b400;
  --green: #22b573;
  --shadow: 0 10px 30px rgba(31, 36, 51, .12);
  --radius: 22px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141d; --bg-2: #161a28; --surface: #1d2130; --text: #eef0f8; --muted: #9aa0b8;
    --line: #2b3042; --card: #262b3b; --card-2: #333a50; --accent: #ffcb05; --accent-ink: #15172a;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #12141d; --bg-2: #161a28; --surface: #1d2130; --text: #eef0f8; --muted: #9aa0b8;
  --line: #2b3042; --card: #262b3b; --card-2: #333a50; --accent: #ffcb05; --accent-ink: #15172a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-weight: 500; color: var(--text); line-height: 1.5;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-2), var(--bg)) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; flex: 1; }

/* ---------- Top bar ---------- */
.top {
  width: 100%; max-width: 1040px; margin: 0 auto; padding: 22px 20px 6px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.logo img { width: 120px; height: 120px; border-radius: 50%; transition: transform .3s ease; }
.logo:hover img { transform: rotate(-6deg) scale(1.04); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .15s;
}
.icon-btn:hover { transform: rotate(20deg); }
#themeBtn { justify-self: start; }
.cart-btn {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 12px 9px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); font-weight: 700; transition: transform .15s;
}
.cart-btn:hover { transform: translateY(-1px); }
.cart-count {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 800;
}
.cart-count.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.4); } }

/* ---------- Home ---------- */
.tagline { text-align: center; color: var(--muted); margin: 6px auto 0; font-size: 1.05rem; max-width: 34em; }
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin: 110px 0 0;
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  height: 270px; padding: 0 20px 24px; text-decoration: none; text-align: center;
  background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--card-text);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(31,36,51,.22); }
.tile .art {
  position: absolute; left: 50%; top: -84px; translate: -50% 0;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.3);
}
.tile:hover .art { transform: translateY(-8px) rotate(-3deg) scale(1.04); }
.tile .ghost { position: absolute; width: 120px; right: 10px; bottom: 10px; fill: rgba(255,255,255,.08); pointer-events: none; }
.tile-name { font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tile-name .arrow { opacity: 0; transform: translate(-4px, 4px); transition: .2s; }
.tile:hover .tile-name { text-decoration: underline; text-underline-offset: 4px; }
.tile:hover .tile-name .arrow { opacity: 1; transform: none; }
.tile-price { color: #aeb4c9; font-weight: 600; font-size: .95rem; margin-top: 2px; }

.perks { list-style: none; padding: 0; margin: 44px 0 0; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.perks li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--muted);
}

/* ---------- Illustrations ---------- */
.art { width: 200px; height: 200px; display: grid; place-items: center; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35)); }
.art img.photo { max-height: 200px; object-fit: contain; }

/* booster pack */
.pack { position: relative; width: 104px; height: 168px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(160deg, #3a63d8, #1b2f7a); display: grid; place-items: center; }
.pack::before, .pack::after { content: ""; position: absolute; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(90deg, #d7dbe6 0 5px, #a3aabb 5px 10px); }
.pack::before { top: 0; } .pack::after { bottom: 0; }
.pack svg { width: 70%; fill: #ffcb05; }
.pack .shine, .holo { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.4) 45%, transparent 60%); background-size: 260% 100%; animation: shine 3.8s linear infinite; }
.pack.b2 { position: absolute; transform: translate(-46px, 10px) rotate(-12deg); background: linear-gradient(160deg, #ef5a4c, #9b1f17); }
.pack.b2 svg { fill: #fff; }
.pack.b1 { transform: translate(36px, 4px) rotate(9deg); }
@keyframes shine { from { background-position: 130% 0; } to { background-position: -130% 0; } }

/* single in toploader */
.single { position: relative; width: 118px; aspect-ratio: 63 / 88; border-radius: 9px; padding: 6px; background: #ffcb05; transform: rotate(6deg); }
.single .in { position: relative; height: 100%; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #fff, #d6e1ff); }
.single .in svg { width: 82%; fill: #1c3f99; }
.single .in .holo { background: linear-gradient(115deg, transparent 20%, rgba(255,0,128,.3) 35%, rgba(0,220,255,.3) 45%, rgba(255,240,0,.3) 55%, transparent 70%); background-size: 260% 260%; mix-blend-mode: color-dodge; }
.single .loader { position: absolute; inset: -12px -10px -10px; border: 2px solid rgba(255,255,255,.75); border-radius: 8px; background: rgba(255,255,255,.1); }

/* guide book */
.book { position: relative; width: 132px; height: 172px; border-radius: 4px 12px 12px 4px; transform: rotate(-5deg);
  background: linear-gradient(160deg, #ef5a4c, #a8231a); box-shadow: inset 10px 0 0 rgba(0,0,0,.22);
  padding: 16px 14px 14px 22px; display: flex; flex-direction: column; gap: 8px; color: #fff; }
.book img { width: 54px; height: 54px; border-radius: 50%; }
.book b { font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.book svg { margin-top: auto; }
.book polyline { fill: none; stroke: #6ef0a8; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.book .coin { position: absolute; right: -18px; top: -16px; width: 46px; height: 46px; border-radius: 50%;
  background: #ffcb05; color: #15172a; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; transform: rotate(12deg); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-top: 30px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .92rem; text-decoration: none;
  margin-top: 20px; transition: transform .15s;
}
.back:hover { transform: translateX(-3px); }
.hero-card {
  position: relative; aspect-ratio: 1 / 1; border-radius: 26px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, var(--card-2), var(--card) 70%);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.hero-card .ghost { position: absolute; width: 46%; right: -6%; bottom: -6%; fill: rgba(255,255,255,.08); }
.hero-card .art { transform: scale(1.5); }
.info h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 800; }
.price-big { font-size: 1.5rem; font-weight: 800; margin: 4px 0 0; }
.info .desc { color: var(--muted); margin: 12px 0 0; }
.label { font-weight: 700; font-size: .85rem; color: var(--muted); margin: 22px 0 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px;
  font-weight: 700; font-size: .88rem; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue);
}
.pill .dot { width: 18px; height: 18px; border-radius: 50%; background: currentColor; display: grid; place-items: center; }
.pill .dot svg { width: 11px; height: 11px; fill: #fff; }
.pill.red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pill.yellow { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: #b07f00; }
:root[data-theme="dark"] .pill.yellow { color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.yellow { color: var(--yellow); } }
.pill.blue { color: var(--blue); }
:root[data-theme="dark"] .pill:not(.red):not(.yellow) { color: #8fb0ff; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; max-width: 360px;
}
.stat { text-align: center; }
.ring { position: relative; width: 58px; height: 58px; margin: 0 auto; }
.ring svg.r { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--line); }
.ring .val { stroke-linecap: round; transition: stroke-dashoffset 1s ease .2s; }
.ring .ico { position: absolute; inset: 0; display: grid; place-items: center; }
.ring .ico svg { width: 20px; height: 20px; }
.stat b { display: block; font-size: .9rem; margin-top: 6px; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 600; }

.buy { display: flex; gap: 10px; margin-top: 26px; max-width: 420px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; overflow: hidden; }
.qty button { border: 0; background: none; width: 40px; height: 48px; font-size: 1.15rem; font-weight: 700; }
.qty button:hover { background: var(--bg); }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border: 0; border-radius: 999px; font-weight: 800; font-size: 1rem;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.buy .btn { flex: 1; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.fine { color: var(--muted); font-size: .85rem; margin-top: 12px; }

.view { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 70px 20px 30px; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0; }
.foot a { color: inherit; text-decoration: none; font-weight: 700; }
.foot a:hover { color: var(--text); }
.heart { color: var(--red); }
.disclaimer { font-size: .75rem; margin-top: 8px !important; opacity: .8; max-width: 640px; margin-left: auto !important; margin-right: auto !important; }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 17, 30, .4); backdrop-filter: blur(3px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(400px, 100%);
  background: var(--surface); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15);
  transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.3rem; }
.ship-meter { padding: 14px 20px 0; font-size: .88rem; font-weight: 600; color: var(--muted); }
.ship-meter b { color: var(--text); }
.ship-meter .bar { margin-top: 8px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ship-meter .bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), var(--red)); transition: width .3s; }
.cart-items { list-style: none; margin: 0; padding: 6px 20px; overflow-y: auto; flex: 1; }
.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 60px; height: 60px; border-radius: 14px; background: linear-gradient(180deg, var(--card-2), var(--card)); display: grid; place-items: center; overflow: hidden; }
.thumb { position: relative; }
.thumb .art { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.3); filter: none; }
.ci-name { font-weight: 700; }
.ci-meta { color: var(--muted); font-size: .85rem; }
.cart-item .qty button { width: 30px; height: 32px; font-size: 1rem; }
.ci-right { display: grid; justify-items: end; gap: 6px; }
.ci-remove { border: 0; background: none; color: var(--muted); font-size: .8rem; padding: 0; text-decoration: underline; }
.cart-empty { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-weight: 600; }
.cart-empty svg { width: 90px; height: 90px; fill: var(--line); }
.cart-empty p { margin: 0; }
.drawer.is-empty .cart-empty { display: flex; }
.drawer.is-empty .cart-items, .drawer.is-empty .drawer-foot, .drawer.is-empty .ship-meter { display: none; }
.drawer-foot { padding: 18px 20px 22px; border-top: 1px solid var(--line); }
.drawer-foot .row { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; }
.muted { color: var(--muted); font-size: .85rem; margin: 4px 0 14px; }
.pay-note { text-align: center; font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.error { color: var(--red); font-weight: 700; font-size: .88rem; margin: 10px 0 0; text-align: center; }

.toast {
  position: fixed; left: 50%; top: 20px; z-index: 70; transform: translate(-50%, -160%);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.3), opacity .2s; opacity: 0; visibility: hidden; background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem; white-space: nowrap; box-shadow: var(--shadow);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; row-gap: 110px; }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .hero-card { max-width: 460px; width: 100%; margin: 0 auto; }
}
@media (max-width: 560px) {
  .top { padding-top: 14px; }
  .logo img { width: 92px; height: 92px; }
  .tagline { font-size: .98rem; }
  .grid { grid-template-columns: 1fr; margin-top: 100px; row-gap: 100px; }
  .tile { height: 220px; }
  .stats { max-width: none; }
  .buy { max-width: none; }
  .hero-card .art { transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill:not(.red):not(.yellow) { color: #8fb0ff; } }
.btn.in-cart { background: var(--green); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--green) 35%, transparent); }
