:root {
  --bg: #0d0a24;
  --surface: #171236;
  --surface-2: #221b4d;
  --text: #ece8ff;
  --muted: #a59fd0;
  --accent: #a99bff;
  --accent-hover: #c0b6ff;
  --on-accent: #0d0a24;
  --error: #ffb4c8;
  font-family: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

/* Fondo en <html> para que las estrellas (body::before) queden por encima */
html {
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 32rem at 12% -8%, rgba(124, 92, 255, 0.28), transparent 65%),
    radial-gradient(42rem 26rem at 100% 8%, rgba(244, 114, 182, 0.12), transparent 65%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
}

/* Estrellas estáticas: dos capas de puntos con tamaños de tile distintos */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 150px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 190px 70px, #fff, transparent),
    radial-gradient(1px 1px at 60px 210px, #fff, transparent),
    radial-gradient(1px 1px at 170px 20px, #cfc6ff, transparent),
    radial-gradient(1.5px 1.5px at 40px 120px, #cfc6ff, transparent),
    radial-gradient(1px 1px at 230px 180px, #fff, transparent);
  background-size: 260px 240px, 260px 240px, 260px 240px, 260px 240px, 340px 300px, 340px 300px, 340px 300px;
}

.wrap { width: min(64rem, 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* Botones */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-text { background: none; color: var(--muted); }
.btn-text:hover { background: none; color: var(--text); }

/* Encabezado */
.top { padding-block: 1.5rem; font-weight: 600; }
.top a { text-decoration: none; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: 4.5rem 5rem; }
.hero > *:not(.planet) { position: relative; }
.hero h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); max-width: 12em; margin-bottom: 1rem; }
.hero p { max-width: 34rem; color: var(--muted); font-size: 1.125rem; margin-bottom: 2rem; }

.planet {
  position: absolute;
  top: -5rem;
  right: -9rem;
  width: 26rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #cdc3ff 0%, #6f58ee 42%, #2b1f7c 72%, #150f40 100%);
  opacity: 0.9;
}

/* Packs */
.packs { padding-block: 1rem 4.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
}
.card h3 { font-size: 1.125rem; }
.card p { font-size: 0.95rem; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.25rem;
}
.price { font-size: 1.5rem; font-weight: 700; }

/* Cómo funciona */
.steps { padding-block: 0 4.5rem; }
.steps ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; counter-reset: paso; }
.steps li { counter-increment: paso; }
.steps li::before { content: counter(paso); display: block; font-size: 2rem; font-weight: 700; color: var(--accent); margin-bottom: 0.25rem; }
.steps strong { display: block; margin-bottom: 0.25rem; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* Pie */
.foot { padding-block: 2rem 3rem; color: var(--muted); font-size: 0.9rem; }

/* Checkout */
dialog {
  background: var(--surface);
  color: var(--text);
  border: 0;
  border-radius: 1.25rem;
  padding: 1.75rem;
  width: min(26rem, 100% - 2rem);
  margin: auto;
}
dialog::backdrop { background: rgba(8, 6, 24, 0.78); }
dialog h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
dialog label { display: block; font-weight: 600; margin: 1.25rem 0 0.5rem; }
dialog input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
}
dialog input::placeholder { color: var(--muted); }
.small { font-size: 0.875rem; margin-top: 0.5rem; }
.error { color: var(--error); font-size: 0.9rem; margin-top: 0.75rem; }
.actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

/* Páginas de resultado */
.result { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1rem; padding-block: 3rem; }
.result h1 { font-size: clamp(2rem, 5vw, 3rem); }
.result p { max-width: 32rem; color: var(--muted); font-size: 1.125rem; }
.result .btn { margin-top: 0.5rem; }

@media (max-width: 40rem) {
  .hero { padding-block: 3rem 3.5rem; }
  .planet { width: 16rem; top: -3rem; right: -6rem; opacity: 0.6; }
}
