:root {
  --bg: #0c0c0e;
  --panel: #16161a;
  --border: #24242b;
  --border-lit: #34343d;
  --gold: #e0a83a;
  --gold-soft: #cf9c39;
  --text: #ececee;
  --muted: #8f8f99;
  --gem: #a879dc;
  --err: #e06767;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* tiled star field, small and spread, drifting one tile on a seamless diagonal loop */
.starfield {
  position: fixed;
  inset: -220px;
  z-index: 0;
  pointer-events: none;
  background-image: url("starfield.svg");
  background-repeat: repeat;
  background-size: 320px 320px;
  opacity: 0.055;
  animation: drift 48s linear infinite;
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 320px 320px; }
}
@media (prefers-reduced-motion: reduce) {
  .starfield { animation: none; }
}

/* drifting ATM stars floating across the background */
.bg-floaters {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.floater {
  position: absolute;
  left: 0;
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  opacity: 0.07;
  will-change: transform;
  animation-name: floatAcross;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
/* travels from off the left edge to off the right edge, bobbing + slowly spinning */
@keyframes floatAcross {
  from { transform: translate(-140px, 0) rotate(0deg); }
  to   { transform: translate(calc(100vw + 140px), -40px) rotate(360deg); }
}
/* each star gets its own lane, size, speed and start offset */
.floater.f1 { top: 8%;  width: 56px;  height: 56px;  opacity: 0.06; animation-duration: 42s; animation-delay: -4s; }
.floater.f2 { top: 24%; width: 96px;  height: 96px;  opacity: 0.05; animation-duration: 68s; animation-delay: -22s; }
.floater.f3 { top: 42%; width: 44px;  height: 44px;  opacity: 0.08; animation-duration: 34s; animation-delay: -12s; }
.floater.f4 { top: 58%; width: 120px; height: 120px; opacity: 0.04; animation-duration: 82s; animation-delay: -50s; }
.floater.f5 { top: 71%; width: 64px;  height: 64px;  opacity: 0.06; animation-duration: 48s; animation-delay: -30s; }
.floater.f6 { top: 84%; width: 80px;  height: 80px;  opacity: 0.05; animation-duration: 58s; animation-delay: -8s; }
.floater.f7 { top: 15%; width: 40px;  height: 40px;  opacity: 0.07; animation-duration: 30s; animation-delay: -18s; }
@media (prefers-reduced-motion: reduce) {
  .floater { animation: none; opacity: 0; }
}

.hero, main { position: relative; z-index: 1; }

/* hero */
.hero {
  text-align: center;
  padding: 64px 16px 8px;
}
.hero-star {
  image-rendering: pixelated;
  opacity: 0.95;
}
.hero-name {
  margin-top: 14px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hero-tag {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

/* layout */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}
.section { margin-top: 48px; }
.section-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.section-note {
  color: var(--muted);
  font-size: 13px;
  margin: -12px 0 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

/* cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 20px 20px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: var(--border-lit); }

.card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}
.card h3 .mark { color: var(--accent, var(--gold)); }

.perks { list-style: none; margin-bottom: 18px; flex: 1; }
.perks li {
  font-size: 14px;
  color: #cfcfd4;
  padding: 6px 0;
}
.perks li + li { border-top: 1px solid rgba(255, 255, 255, 0.04); }

/* gem cards */
.gem-glyph {
  font-size: 40px;
  line-height: 1;
  color: var(--gem);
  text-align: center;
  margin: 4px 0 8px;
}
.gem-amount {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  flex: 1;
}

/* buy button */
.buy-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: #1d1d22;
  border: 1px solid var(--gold-soft);
  border-radius: 6px;
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.buy-btn:hover { background: var(--gold); color: #14140f; }
.buy-btn:disabled {
  color: #56565e;
  border-color: #2a2a30;
  background: transparent;
  cursor: default;
}
.buy-per { opacity: 0.7; font-weight: 500; font-size: 12px; }

/* badge */
.badge {
  position: absolute;
  top: 14px; right: 14px;
  color: #4bbd7e;
  font-size: 12px;
  font-weight: 600;
}

footer {
  margin-top: 64px;
  text-align: center;
  color: #4f4f57;
  font-size: 12px;
  line-height: 1.7;
}

/* checkout modal */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
}
.overlay.open { display: flex; align-items: center; justify-content: center; }
.modal {
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 22px;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal input {
  width: 100%;
  padding: 10px 12px;
  background: #0d0d10;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}
.modal input:focus { outline: none; border-color: var(--gold-soft); }
.modal-error { color: var(--err); font-size: 13px; min-height: 17px; margin-bottom: 6px; }
.wide { margin-top: 4px; }
.modal-note { margin-top: 12px; color: #626269; font-size: 12px; }
