/* NEONDYNE hub — synthwave brand language shared with the game client.
   Self-contained: fonts self-hosted, no third-party requests (GDPR posture). */

@font-face {
  font-family: 'Orbitron';
  src: url('/fonts/orbitron-var.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #0D0221;
  --bg2: #1A0533;
  --pink: #FF2975;
  --purple: #B026FF;
  --cyan: #2DE2E6;
  --yellow: #FFD319;
  --mint: #01F9C6;
  --text: #E8E3F5;
  --dim: rgba(232, 227, 245, 0.65);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ---- Background: horizon grid + glow + scanlines -------------------------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 40% at 50% 38%, rgba(255, 41, 117, 0.18), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 55%, #2B0A4E 100%);
}

.bg::after {
  content: '';
  position: absolute;
  left: -50%;
  right: -50%;
  top: 52%;
  bottom: -10%;
  background-image:
    linear-gradient(rgba(45, 226, 230, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 226, 230, 0.22) 1px, transparent 1px);
  background-size: 56px 44px;
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0px,
    rgba(0, 0, 0, 0.14) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* ---- Layout --------------------------------------------------------------- */

.container { width: min(920px, 92vw); margin: 0 auto; }

.site-header { padding: 22px 0; }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.wordmark {
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  background: linear-gradient(180deg, #fff 0%, var(--cyan) 35%, var(--purple) 65%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(176, 38, 255, 0.55));
}

.site-header .wordmark { font-size: 22px; }

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.nav-links a { color: var(--cyan); text-decoration: none; }
.nav-links a:hover { text-shadow: 0 0 10px rgba(45, 226, 230, 0.9); }

main { flex: 1; }

/* ---- Hero ----------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 9vh 0 7vh;
}

.hero .wordmark {
  display: block;
  font-size: clamp(44px, 9vw, 92px);
  line-height: 1.1;
}

.hero .tagline {
  margin-top: 14px;
  font-size: clamp(11px, 2vw, 14px);
  letter-spacing: 0.42em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(45, 226, 230, 0.8);
}

.hero .sub {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.9;
  color: var(--dim);
}

/* ---- Game cards ----------------------------------------------------------- */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding-bottom: 8vh;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(45, 226, 230, 0.35);
  border-radius: 10px;
  background: rgba(13, 2, 33, 0.82);
  padding: 26px 24px 24px;
  box-shadow: 0 0 24px rgba(45, 226, 230, 0.10), inset 0 0 30px rgba(176, 38, 255, 0.05);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.game-card:hover,
a.game-card:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 32px rgba(45, 226, 230, 0.28), inset 0 0 30px rgba(176, 38, 255, 0.08);
  transform: translateY(-2px);
  outline: none;
}

a.game-card.featured:hover,
a.game-card.featured:focus-visible {
  border-color: var(--pink);
  box-shadow: 0 0 36px rgba(255, 41, 117, 0.35), inset 0 0 30px rgba(176, 38, 255, 0.1);
}

.game-cover {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  height: auto;
  margin: -26px -24px 18px;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid rgba(45, 226, 230, 0.25);
  object-fit: cover;
  aspect-ratio: 1024 / 500;
}

/* Announced-but-unplayable game: a state modifier on the normal content
   card. Deliberately does not touch `display` — the card keeps its usual
   block/stacked layout (h2, tag, desc, pieces). Defined before `.featured`
   so a card that is somehow both (equal specificity) keeps the featured
   border/glow rather than looking unreleased. */
.game-card.unreleased {
  border-style: dashed;
  border-color: rgba(232, 227, 245, 0.2);
  box-shadow: none;
}

.game-card.unreleased h2 {
  opacity: 0.4;
}

.game-card.unreleased .card-tag,
.game-card.unreleased p.desc {
  color: rgba(232, 227, 245, 0.35);
}

.game-card.featured {
  border-color: var(--purple);
  box-shadow: 0 0 30px rgba(176, 38, 255, 0.35), inset 0 0 30px rgba(176, 38, 255, 0.08);
}

.game-card h2 {
  font-style: italic;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #fff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-card .card-tag {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 211, 25, 0.7);
}

.game-card p.desc {
  flex: 1 1 auto;
  margin: 16px 0 22px;
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.game-card .btn {
  align-self: flex-start;
}

.pieces {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

.pieces span {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 0 8px currentColor;
}

.game-card.soon {
  border-style: dashed;
  border-color: rgba(232, 227, 245, 0.2);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
}

.game-card.soon p {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: rgba(232, 227, 245, 0.35);
}

/* ---- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 12px 28px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 41, 117, 0.5);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn:hover { transform: scale(1.04); box-shadow: 0 0 26px rgba(255, 41, 117, 0.8); }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(45, 226, 230, 0.5);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(45, 226, 230, 0.15);
}

/* ---- Challenge page ------------------------------------------------------- */

.challenge {
  text-align: center;
  padding: 6vh 0 8vh;
}

.challenge .eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 41, 117, 0.8);
}

.challenge h1 {
  margin-top: 12px;
  font-size: clamp(26px, 5vw, 40px);
  font-style: italic;
  letter-spacing: 0.14em;
}

.challenge .code {
  color: var(--yellow);
  text-shadow: 0 0 14px rgba(255, 211, 25, 0.8);
}

.challenge .sub {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.standings {
  width: min(460px, 92vw);
  margin: 34px auto;
  border: 1px solid rgba(45, 226, 230, 0.35);
  border-radius: 10px;
  background: rgba(13, 2, 33, 0.85);
  padding: 18px 20px;
  box-shadow: 0 0 24px rgba(45, 226, 230, 0.12);
}

.standings h2 {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 14px;
}

.standings table { width: 100%; border-collapse: collapse; }

.standings td, .standings th {
  font-size: 12px;
  padding: 7px 4px;
  text-align: left;
  letter-spacing: 0.08em;
}

.standings th {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: rgba(232, 227, 245, 0.45);
  border-bottom: 1px solid rgba(45, 226, 230, 0.2);
}

.standings .rank { color: var(--purple); width: 2.2em; }
.standings .initials { color: var(--cyan); letter-spacing: 0.25em; }
.standings .score { text-align: right; color: var(--yellow); }
.standings .attempts { text-align: right; color: var(--dim); }

.standings .empty {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim);
  line-height: 1.8;
  padding: 8px 0;
}

.standings .sector {
  text-align: right;
  color: var(--cyan);
}

/* ---- Landing high scores -------------------------------------------------- */

.scores {
  padding-bottom: 12vh;
}

.scores-heading {
  font-style: italic;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-align: center;
  background: linear-gradient(180deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scores-sub {
  margin: 10px auto 28px;
  max-width: 36em;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  color: var(--dim);
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.scores-panel {
  width: auto;
  margin: 0;
  text-align: left;
}

.scores-panel h3 {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--pink);
  margin-bottom: 14px;
}

.scores-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-decoration: none;
}

.scores-more:hover {
  text-shadow: 0 0 10px rgba(45, 226, 230, 0.9);
}

/* ---- Game page ------------------------------------------------------------ */

.game-page {
  text-align: center;
  padding: 4vh 0 10vh;
  max-width: 720px;
}

.game-page-cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 28px;
  border-radius: 10px;
  border: 1px solid rgba(45, 226, 230, 0.25);
  object-fit: cover;
  aspect-ratio: 1024 / 500;
}

.game-page .eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 41, 117, 0.8);
}

.game-page h1 {
  margin-top: 12px;
  font-size: clamp(26px, 5vw, 40px);
  font-style: italic;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #fff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-page .card-tag {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 211, 25, 0.7);
}

.game-page .sub {
  margin: 16px auto 0;
  max-width: 38em;
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--dim);
}

.game-page-cta {
  margin-top: 28px;
}

.game-page .game-board {
  margin-top: 40px;
}

/* ---- Legal pages ---------------------------------------------------------- */

.legal {
  padding: 5vh 0 8vh;
  max-width: 700px;
}

.legal .eyebrow {
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--pink);
}

.legal h1 {
  margin: 10px 0 26px;
  font-size: clamp(24px, 4vw, 34px);
  font-style: italic;
  letter-spacing: 0.1em;
}

.legal h2 {
  margin: 30px 0 10px;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--cyan);
}

.legal p, .legal li {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--dim);
}

.legal ul { padding-left: 22px; margin: 8px 0; }

.legal a { color: var(--mint); }

.legal .legal-meta {
  margin-top: 34px;
  font-size: 12px;
  color: rgba(232, 227, 245, 0.4);
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid rgba(176, 38, 255, 0.25);
  padding: 22px 0 26px;
  background: rgba(13, 2, 33, 0.6);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.site-footer .wordmark { font-size: 14px; }

.footer-links {
  display: flex;
  gap: 18px;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.footer-links a { color: var(--dim); text-decoration: none; }
.footer-links a:hover { color: var(--cyan); }

.footer-copy { font-size: 10px; color: rgba(232, 227, 245, 0.35); letter-spacing: 0.1em; }

/* ---- Error page ----------------------------------------------------------- */

.errorpage {
  text-align: center;
  padding: 12vh 0;
}

.errorpage h1 {
  font-size: clamp(40px, 10vw, 90px);
  font-style: italic;
  color: var(--pink);
  text-shadow: 0 0 24px rgba(255, 41, 117, 0.7);
}

.errorpage p {
  margin: 16px 0 28px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

@media (max-width: 600px) {
  .nav-links { display: none; }
}
