:root {
  --page-bg: #0b0e1f;
  --page-bg-soft: #141a33;
  --panel: rgba(20, 24, 34, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.68);
  --brand: #7bffb2;
  --accent: #ff59d6;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --shell: min(2400px, calc(100% - 24px));
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 89, 214, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(123, 255, 178, 0.16), transparent 24%),
    linear-gradient(180deg, var(--page-bg-soft), var(--page-bg));
  overflow-x: hidden;
}

a {
  color: inherit;
}

.page-shell {
  width: var(--shell);
  margin: 0 auto;
  padding: 14px 0 26px;
}

.site-nav,
.hero-card,
.mode-card,
.site-footer {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 22px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6aa6ff);
  position: relative;
}

.site-brand-mark::before,
.site-brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 6px;
}

.site-brand-mark::before {
  inset: 7px 15px 15px 7px;
  background: rgba(255, 255, 255, 0.92);
}

.site-brand-mark::after {
  inset: 15px 7px 7px 15px;
  background: rgba(123, 255, 178, 0.96);
}

.site-brand-label {
  display: block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-brand-name {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.site-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.site-links a,
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.site-links a:hover,
.footer-links a:hover,
.site-links a:focus-visible,
.footer-links a:focus-visible {
  color: var(--text);
  outline: none;
}

.hero-card {
  margin-top: 18px;
  border-radius: 28px;
  padding: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 16px;
  align-items: start;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero-copy {
  margin: 12px 0 0;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.6;
}

.mode-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mode-row label {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
}

.mode-row select {
  flex: 1 1 220px;
  max-width: 360px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 14px;
  font: inherit;
}

.mode-row select:focus-visible {
  outline: none;
  border-color: rgba(123, 255, 178, 0.5);
  box-shadow: 0 0 0 3px rgba(123, 255, 178, 0.12);
}

.pill-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-list li {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
}

.hero-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.hero-actions-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.hero-actions-row .mode-row {
  margin-top: 0;
}

.hero-actions-row .mode-row select {
  max-width: 320px;
}

.ghost-link,
.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  text-decoration: none;
}

.ghost-link {
  background: var(--panel-soft);
  color: var(--muted);
  border: 0;
}

.cta-link {
  background: var(--brand);
  color: #1a1d24;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(123, 255, 178, 0.2);
}

.mode-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mode-card {
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.mode-card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.mode-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.mode-card .mode-card-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mode-card .mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(123, 255, 178, 0.14);
  color: var(--brand);
  text-decoration: none;
  font-weight: 800;
}

.mode-card .mode-link:hover,
.cta-link:hover {
  transform: translateY(-1px);
}

.stage-shell {
  margin-top: 18px;
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.stage-hint {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #1f2330;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stage-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 12px;
  align-content: center;
  justify-items: center;
  background: #0b0f17;
}

.stage-shell:fullscreen .stage-hint {
  width: 100%;
}

.stage-shell:fullscreen canvas {
  width: auto;
  max-width: 100%;
  height: calc(100vh - 88px);
  max-height: calc(100vh - 88px);
  border-radius: 18px;
}

.site-footer {
  margin-top: 18px;
  border-radius: 22px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-copy {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    justify-items: start;
  }
  .hero-actions-row {
    justify-content: flex-start;
  }
  .mode-row select {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    padding: 10px 0 18px;
  }

  .site-nav,
  .site-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .site-links,
  .footer-links {
    justify-content: center;
    gap: 10px;
  }

  .hero-card {
    padding: 16px;
    border-radius: 22px;
  }

  .hero-actions {
    width: 100%;
    justify-items: stretch;
  }

  .ghost-link,
  .cta-link {
    width: 100%;
  }
}
