:root {
  --bg: #0b0c16;
  --bg-2: #12142a;
  --card: #161935;
  --card-2: #1d2146;
  --line: rgba(255, 255, 255, .08);
  --text: #f3f4ff;
  --muted: #9aa0c7;
  --violet: #6366f1;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
  --gold: #ffcc33;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 13px; }

.bg-glow {
  position: fixed; inset: -20% -20% auto -20%; height: 520px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(34, 211, 238, .22), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(99, 102, 241, .3), transparent 70%);
  filter: blur(10px);
}

.topbar, main { position: relative; z-index: 1; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px calc(24px + var(--safe-b)); }

/* ---------- Top bar ---------- */
.topbar {
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { border-radius: 11px; box-shadow: 0 6px 20px rgba(139, 92, 255, .45); }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-tag { font-size: 12px; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; margin-top: 10px;
  padding: 22px 20px; border-radius: 24px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(34, 211, 238, .35), transparent 55%),
    linear-gradient(135deg, #0f2a4a 0%, #1e2a7a 50%, #111638 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 20px 50px rgba(30, 42, 122, .4);
}
.hero-text { position: relative; z-index: 1; max-width: 72%; }
.hero h1 { font-size: 22px; line-height: 1.2; margin: 10px 0 8px; font-weight: 800; }
.hero p { margin: 0; color: #cfd3ff; font-size: 13px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
}
.hero-key {
  position: absolute; right: -14px; bottom: -12px; width: 150px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px) rotate(3deg); } }

/* ---------- Perks ---------- */
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 22px; }
.perk {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 10px; text-align: center;
}
.perk b { display: block; font-size: 17px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.perk span { font-size: 12px; color: var(--muted); }

/* ---------- Catalog ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2, .how h2 { font-size: 20px; font-weight: 800; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  position: relative; text-align: left; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, box-shadow .2s ease;
  animation: rise .45s ease both;
}
.card:active { transform: scale(.97); }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.card-cover { position: relative; aspect-ratio: 400 / 260; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, var(--card), transparent);
}
.badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 8px;
  background: var(--accent); color: #0b0c16; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 60%, transparent);
}
.platform {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  font-size: 10px; font-weight: 700; padding: 4px 7px; border-radius: 8px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); color: #fff;
}
.card-body { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-title { font-weight: 800; font-size: 15px; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; font-size: 17px; white-space: nowrap; display: flex; flex-direction: column-reverse; line-height: 1.15; }
.old { font-size: 12px; color: var(--muted); text-decoration: line-through; font-weight: 500; }
.buy {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #0b0c16; font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* ---------- How ---------- */
.how { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; color: #d6d9f5; font-size: 14px; }
.how li span {
  flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad); font-weight: 800; color: #fff; font-size: 13px;
}
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }

/* ---------- Sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10; background: rgba(5, 6, 15, .65); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  max-width: 560px; margin: 0 auto; max-height: 92vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(18px + var(--safe-b)); }
.sheet.show { transform: translateY(0); }
.grabber { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .35); z-index: 2; }
.close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); font-size: 14px;
}
.sheet-cover { position: relative; aspect-ratio: 400 / 220; overflow: hidden; }
.sheet-cover img { width: 100%; height: 100%; object-fit: cover; }
.sheet-cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 50%; background: linear-gradient(to top, var(--bg-2), transparent); }
.sheet-body { padding: 0 18px; margin-top: -18px; position: relative; }
.s-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.s-meta span { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.s-meta span.accent { background: var(--accent); color: #0b0c16; border-color: transparent; }
.sheet h3 { font-size: 24px; font-weight: 800; margin: 10px 0 6px; }
.s-desc { margin: 0 0 12px; color: #c9cdee; font-size: 14px; }
.s-features { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.s-features li { font-size: 13px; color: #d6d9f5; display: flex; gap: 8px; align-items: center; }
.s-features li::before { content: "✓"; color: var(--accent); font-weight: 900; }

.label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.methods { display: grid; gap: 8px; margin-bottom: 16px; }
.method {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 12px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line);
  transition: border-color .15s ease, background .15s ease;
}
.method.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.method .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--card-2); color: var(--accent);
}
.method .m-name { font-weight: 700; font-size: 14px; }
.method .m-note { font-size: 12px; color: var(--muted); }
.method .radio {
  margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); flex: none;
  display: grid; place-items: center;
}
.method.active .radio { border-color: var(--accent); }
.method.active .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.method .soon { margin-left: auto; white-space: nowrap; flex: none; font-size: 10px; color: var(--muted); border: 1px dashed rgba(255,255,255,.2); border-radius: 6px; padding: 2px 6px; }

.btn {
  width: 100%; padding: 15px; border-radius: 16px; font-weight: 800; font-size: 16px;
  transition: transform .1s ease, opacity .2s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22d3ee));
  color: #0b0c16; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn.ghost { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 13px; padding: 12px; font-weight: 700; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; }
.order-card .row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; }
.order-card .row + .row { border-top: 1px solid var(--line); }
.order-card .row span { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 12px 2px 14px; }

.done { text-align: center; padding: 6px 0 18px; }
.done-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  font-size: 30px; font-weight: 900; color: #0b0c16; background: var(--accent);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: pop .4s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.done h4 { font-size: 20px; margin-bottom: 6px; }
.done p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 30;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #262a55; border: 1px solid rgba(255, 255, 255, .15); color: #fff;
  padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 600; max-width: 90vw; text-align: center;
  transition: all .25s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
  .hero-text { max-width: 100%; }
  .hero-key { opacity: .35; }
}
