/* ---------- AstroGate Base (reset + typography + helpers) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #fff;
  background: #000; /* fallback in case canvas fails */
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #d4af37;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
}

:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.9);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Headings ---------- */
h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
h1 {
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.2rem);
}
h2 {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem);
}
h3 {
  font-size: 1.05rem;
}

/* ---------- Background layers (FIX) ---------- */
/* Pin starfield & planets behind content so cards sit “on the stars” */
#starfield,
.planets {
  position: fixed; /* take out of normal flow */
  inset: 0; /* top/right/bottom/left: 0 */
  width: 100%;
  height: 100%;
  z-index: -1; /* behind page content */
  pointer-events: none;
  display: block;
}

/* ---------- Page layout ---------- */
.container {
  position: relative; /* sit above backgrounds */
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(8, 8, 12, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.08);
  backdrop-filter: blur(6px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #fff;
}
.logo img {
  width: 28px;
  height: 28px;
}

/* Top navigation */
.nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.nav a {
  color: #e9e1c2;
  opacity: 0.9;
}
.nav a:hover {
  opacity: 1;
  text-decoration: none;
}

/* ---------- Utilities ---------- */
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}
.center {
  text-align: center;
}
.m-0 {
  margin: 0;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.hide {
  display: none !important;
}

/* Accessible hide (screen-reader only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Cards & grid (baseline; theme.css can beautify) ---------- */
.card {
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 16px;
  padding: 16px;
  background: #0b0b0f;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.25);
  text-decoration: none;
}

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

/* ---------- Buttons ---------- */
.btn,
.unlock-btn {
  display: inline-block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #111;
  background: linear-gradient(90deg, #cfb053, #a67c00);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.btn:active,
.unlock-btn:active {
  transform: translateY(1px);
}
.unlock-btn:hover {
  text-decoration: none;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 32px;
  padding: 18px 0;
  color: #c9c0a0;
  opacity: 0.9;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}
