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

html,
body {
  height: 100%;
}

:root {
  color-scheme: dark;
  --bg: #0f172a;
  --text: #f8fafc;
  --muted: #cbd5f5;
  --card: rgba(15, 23, 42, 0.9);
  --accent: #f472b6;
  --accent-dark: #ec4899;
  --accent-2: #38bdf8;
  --accent-3: #22d3ee;
  --border: rgba(148, 163, 184, 0.25);
  --shadow: 0 22px 45px rgba(2, 6, 23, 0.55);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1e1b4b, #0f172a 55%, #111827);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.nav-cta {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

.hero-content {
  position: absolute;
  top: 2rem;
  left: 2rem;
  max-width: 360px;
  max-height: calc(100vh - 4rem);
  overflow: auto;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.hero-dismiss {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.6);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-content.hidden {
  display: none;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 2.8vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.stage-panel {
  margin: 1.5rem 0;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(248, 250, 252, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.stage-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent-2);
}

.stage-intro {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.stage-objectives {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.stage-objectives li::before {
  content: "•";
  color: var(--accent);
  margin-right: 0.5rem;
}

.stage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.hud {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 240px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  z-index: 12;
  backdrop-filter: blur(10px);
}

.hud-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hud-label {
  display: block;
}

.hud-objectives {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.hud-objectives li::before {
  content: "•";
  color: var(--accent-2);
  margin-right: 0.4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.subhead {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b1120;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

button.primary:hover {
  background: linear-gradient(120deg, var(--accent-dark), var(--accent-3));
}

button.ghost {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1.4rem;
  border-radius: 0.8rem;
  cursor: pointer;
}

.hero-metrics {
  display: flex;
  gap: 2rem;
  color: var(--muted);
}

.metric {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.metric-label {
  font-size: 0.85rem;
}

.hero-card {
  background: var(--card);
  border-radius: 0;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100vh;
}

.game-card {
  min-height: 100vh;
}

.card-header,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-card ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}

.hero-card li::before {
  content: "◆";
  color: var(--accent);
  margin-right: 0.5rem;
}

.hero-card .small {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.game-wrapper {
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), rgba(244, 114, 182, 0.15), rgba(2, 6, 23, 0.8));
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1rem;
  flex: 1;
  min-height: 60vh;
}

canvas {
  background: #0b1120;
  border-radius: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
  width: 100%;
  height: 100%;
}

#miniMap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(244, 114, 182, 0.4);
  box-shadow: 0 8px 25px rgba(2, 6, 23, 0.6);
  pointer-events: none;
  z-index: 12;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.section-alt {
  background: rgba(2, 6, 23, 0.55);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin-bottom: 2rem;
  max-width: 520px;
}

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

.feature-card {
  background: var(--card);
  border-radius: 1.1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.4);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.work-card {
  background: var(--card);
  border-radius: 1.1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.work-swatch {
  height: 140px;
  border-radius: 0.9rem;
  margin-bottom: 1rem;
}

.swatch-1 {
  background: linear-gradient(135deg, #0ea5e9, #1e293b);
}

.swatch-2 {
  background: linear-gradient(135deg, #22d3ee, #0f172a);
}

.swatch-3 {
  background: linear-gradient(135deg, #a78bfa, #1e1b4b);
}

.cta {
  background: var(--card);
  border-radius: 1.5rem;
  padding: 2.5rem;
  border: 1px solid var(--border);
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: center;
  box-shadow: var(--shadow);
}

.cta-form {
  display: grid;
  gap: 0.75rem;
}

.cta-form input {
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.75);
}

.modal.hidden {
  display: none;
}

.modal-card {
  max-width: 480px;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  position: relative;
}

.modal-result {
  margin-top: 1.5rem;
  color: var(--accent);
  font-weight: 600;
}

.runaway {
  position: relative;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall 1.8s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) rotate(540deg);
  }
}

.locked .content,
.locked .site-header,
.locked .site-footer {
  filter: blur(6px);
  pointer-events: none;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), #020617);
}

.gate-hidden {
  display: none;
}

.gate-panel {
  max-width: 460px;
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  text-align: left;
}

.gate-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.gate-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.gate-form input {
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
}

.gate-error {
  min-height: 1.2rem;
  color: #fca5a5;
  font-size: 0.85rem;
}

.gate-hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    padding: 1.5rem;
  }

  .hero-content {
    position: static;
    max-width: none;
    margin-bottom: 1.5rem;
  }

  .hero-card {
    min-height: auto;
  }
}
