:root {
  --bg: #000000;
  --bg-alt: #0a0a0a;
  --panel: #161616;
  --accent: #ffd23f;
  --accent-2: #ff6b6b;
  --accent-3: #4ecdc4;
  --text: #f5f1ff;
  --text-dim: #c9beea;
  --radius: 14px;
  --font-display: 'Press Start 2P', monospace;
  --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

img.pixel {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.5; }

h2 {
  font-size: 1.4rem;
  color: var(--accent);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 0.9rem;
  color: var(--accent-3);
  margin: 0.6rem 0;
}

a { color: var(--accent-3); }

.section-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000;
  overflow: hidden;
  border-bottom: 2px solid rgba(190, 130, 255, 0.4);
}

/* Wrapper JS nudges via transform (mouse-reactive, "dye in water" drift).
   The inner .aurora-layer carries its own independent idle CSS animation
   so the two transforms compose instead of fighting for the same property. */
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.aurora-layer {
  position: absolute;
  inset: -120% -10%;
  /* Narrow, slanted vertical pillars with generous transparent gaps between
     them, more like real aurora curtains than soft blobs. */
  background:
    linear-gradient(101deg,
      transparent 0%, transparent 5%,
      rgba(168, 85, 247, 0.7) 9%, rgba(168, 85, 247, 0.55) 12%, transparent 18%,
      transparent 30%,
      rgba(76, 201, 196, 0.5) 35%, rgba(76, 201, 196, 0.35) 38%, transparent 44%,
      transparent 54%,
      rgba(139, 92, 246, 0.65) 59%, rgba(139, 92, 246, 0.45) 63%, transparent 70%,
      transparent 80%,
      rgba(217, 70, 239, 0.4) 86%, rgba(217, 70, 239, 0.25) 89%, transparent 95%
    );
  filter: blur(16px);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0%   { transform: translateY(-5%) rotate(-1.5deg) scaleY(1.05); }
  50%  { transform: translateY(4%) rotate(1.5deg) scaleY(1.18); }
  100% { transform: translateY(-3%) rotate(-1deg) scaleY(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-layer { animation: none; }
  .aurora { transition: none; }
}

.nav {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo { height: 40px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-weight: 700;
}

.nav-links a { text-decoration: none; color: var(--text); }
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  background: var(--accent);
  color: var(--bg) !important;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 900;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 3px solid transparent;
}
.btn:hover { transform: translateY(-3px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 6px 0 #c79b00;
}
.btn-primary:hover { box-shadow: 0 9px 0 #c79b00; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--text-dim);
}
.btn-secondary:hover { border-color: var(--accent-3); color: var(--accent-3); }

.btn-large { font-size: 1.1rem; padding: 1.1rem 2.4rem; }

/* Hero */
.hero {
  position: relative;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  background: var(--bg);
  overflow: hidden;
}

.hero-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 2; }

.hero-logo { display: block; width: min(90vw, 420px); height: auto; margin: 0 auto 1rem; }

.badge-hero {
  margin-bottom: 1.5rem;
  animation: pulse-badge 2.2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.hero-tagline {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.4rem;
}

.hero-subtagline {
  font-size: 1.05rem;
  color: var(--accent-3);
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.hero-craft-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  opacity: 0.8;
  margin: 0 0 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-critter {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 56px;
  cursor: grab;
  z-index: 3;
  user-select: none;
  touch-action: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4));
}

.hero-critter.dragging {
  cursor: grabbing;
  z-index: 10;
  filter: drop-shadow(0 12px 16px rgba(0,0,0,0.5));
}

/* About */
.about { background: var(--bg-alt); }

.about p { color: var(--text-dim); font-size: 1.05rem; max-width: 680px; }

.about-strip {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  align-items: flex-end;
}

.about-strip img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.about-strip-composite {
  position: relative;
  width: 72px;
  height: 72px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.about-strip-composite img.about-strip-base,
.about-strip-composite img.about-strip-overlay {
  position: absolute;
  inset: 10px;
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: none;
  padding: 0;
  box-shadow: none;
}

.about-strip-composite img.about-strip-overlay { z-index: 2; }

/* Multiplayer */
.multiplayer {
  background: var(--bg);
}

.badge {
  display: inline-block;
  background: var(--accent-2);
  color: white;
  font-family: var(--font-display);
  font-size: 0.65rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.multiplayer p { color: var(--text-dim); font-size: 1.05rem; max-width: 640px; }

.multiplayer-ctas { justify-content: flex-start; margin: 2rem 0 1rem; }

.beta-note { font-size: 0.9rem; color: var(--text-dim); opacity: 0.85; }

.server-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  flex-shrink: 0;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.feature-list li {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  border-left: 4px solid var(--accent-3);
  color: var(--text);
}

/* Hats */
.hats { background: var(--bg-alt); }

.hats p { color: var(--text-dim); margin-bottom: 2.5rem; }

.hat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.2rem;
}

.hat-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.4rem 0.8rem 1rem;
  text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
  cursor: pointer;
}

.hat-card:hover { transform: translateY(-4px) rotate(-2deg); }

.hat-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 0.8rem;
}

.hat-avatar-gundy {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hat-avatar-hat {
  /* Matches gundy.tscn: the Hat Sprite2D sits centered on the same origin
     as GundySprite (no meaningful offset) — the hat art's own transparent
     padding is what places it correctly on the head. Overlay identically,
     don't add an offset here. Explicit 100% width/height because `inset: 0`
     alone doesn't stretch a replaced element (<img>) — it keeps native size. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

.hat-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.hat-price {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  margin-top: 0.3rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.hat-card:hover .hat-price { opacity: 1; transform: translateY(0); }

/* Hat preview modal: click a hat card to see it bigger, centered */
.hat-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.hat-preview-overlay.is-open {
  background: rgba(0, 0, 0, 0.25);
  opacity: 1;
  pointer-events: auto;
}

.hat-preview-card {
  background: var(--panel);
  border-radius: calc(var(--radius) * 1.4);
  padding: 2.6rem 2rem 2rem;
  text-align: center;
  box-shadow: 0 16px 0 rgba(0, 0, 0, 0.35), 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s ease;
}

.hat-preview-overlay.is-open .hat-preview-card {
  transform: scale(1);
  opacity: 1;
}

.hat-preview-card .hat-avatar { width: 220px; height: 220px; margin-bottom: 1.2rem; }

.hat-preview-card #hat-preview-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.hat-preview-card .hat-price {
  opacity: 1 !important;
  transform: none !important;
  font-size: 1rem !important;
}

/* Cast */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.cast-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.cast-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.cast-duo {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem;
}

.cast-duo img { margin-bottom: 0.5rem; }

.cast-card p { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

/* CTA band */
.cta-band {
  text-align: center;
  background: var(--bg);
}

.cta-band p { color: var(--text-dim); margin-bottom: 2rem; }

/* Footer */
.site-footer {
  border-top: 3px solid var(--panel);
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  flex-wrap: wrap;
}

.footer-logo { height: 28px; opacity: 0.8; }
.footer-inner a { text-decoration: none; font-weight: 700; }
.footer-copy { margin-left: auto; color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 640px) {
  .nav-links { gap: 1rem; font-size: 0.85rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  h2 { font-size: 1.1rem; }
  .hero-tagline { font-size: 1.05rem; }
  .footer-copy { margin-left: 0; width: 100%; }
}
