:root {
  --night: #07051a;
  --night-2: #0e0a2b;
  --panel: #120d35;
  --line: rgba(160, 120, 255, 0.18);
  --pink: #ff2bd6;
  --cyan: #22f4ff;
  --violet: #8b5cff;
  --orange: #ffb347;
  --lime: #b4ff39;
  --text: #ece8ff;
  --muted: #9c95c9;
  --radius: 14px;
  --display: "Monoton", "Orbitron", sans-serif;
  --head: "Orbitron", system-ui, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
  --mono: "VT323", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

/* CRT scanlines + vignette over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: multiply;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 14px; letter-spacing: 0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

.mono { font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0.04em; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(7, 5, 26, 0.85); backdrop-filter: blur(10px); border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-small {
  font-family: var(--display);
  font-size: 1.35rem;
  text-decoration: none;
  color: #fff;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink);
}
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.nav-links a:hover { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }

/* ---------- Hero ---------- */
.hero {
  --horizon: 58%;
  position: relative;
  height: min(100vh, 920px);
  min-height: 640px;
  overflow: hidden;
  background: var(--night);
}

.sky {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--horizon);
  overflow: hidden;
  background: linear-gradient(to bottom, #050316 0%, #1a0b3d 55%, #4a1063 100%);
  border-bottom: 1px solid rgba(255, 43, 214, 0.6);
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.5);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 15%, #ffd7fb 50%, transparent 51%),
    radial-gradient(1px 1px at 75% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 10%, #cff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 45%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 65% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 35%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 75%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 85%, #fff 50%, transparent 51%);
  background-size: 400px 300px;
  opacity: 0.8;
  animation: twinkle 4s ease-in-out infinite alternate;
}

.sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(360px, 58vw);
  aspect-ratio: 1;
  transform: translate(-50%, 42%);
  border-radius: 50%;
  background: linear-gradient(to bottom, #fff36b 0%, var(--orange) 25%, #ff3f8e 50%, #b81fff 70%);
  box-shadow: 0 0 80px rgba(255, 63, 142, 0.6), 0 0 200px rgba(184, 31, 255, 0.35);
  -webkit-mask: linear-gradient(to bottom,
      #000 0 30%, transparent 30% 32.5%, #000 32.5% 38%, transparent 38% 41.5%,
      #000 41.5% 46%, transparent 46% 50.5%, #000 50.5% 54%, transparent 54% 100%);
          mask: linear-gradient(to bottom,
      #000 0 30%, transparent 30% 32.5%, #000 32.5% 38%, transparent 38% 41.5%,
      #000 41.5% 46%, transparent 46% 50.5%, #000 50.5% 54%, transparent 54% 100%);
}

.mountains {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  width: 100%;
  height: 30%;
  max-height: 170px;
}
.mountains path { fill: #0b0626; stroke: var(--pink); stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px var(--pink)); }
.mountains .back { fill: #120838; stroke: var(--violet); }

.grid {
  position: absolute;
  left: -50%; right: -50%;
  top: var(--horizon);
  bottom: 0;
  perspective: 300px;
  overflow: hidden;
}
.grid::before {
  content: "";
  position: absolute;
  inset: -100% 0 0 0;
  transform: rotateX(62deg);
  transform-origin: 50% 100%;
  background-image:
    linear-gradient(to right, rgba(255, 43, 214, 0.75) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(34, 244, 255, 0.6) 2px, transparent 2px);
  background-size: 70px 70px;
  animation: grid-run 1.1s linear infinite;
}
.grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 60% at 50% 40%, rgba(7, 5, 26, 0.85), transparent 70%),
    linear-gradient(to bottom, rgba(7, 5, 26, 0.6) 0%, transparent 30%, transparent 70%, var(--night) 100%);
}

.hero-title {
  position: absolute;
  left: 0; right: 0;
  top: clamp(90px, 14vh, 150px);
  z-index: 2;
  text-align: center;
  padding: 0 16px;
}
.hero-lower {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--horizon) + 4%);
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  text-shadow: 0 2px 10px #000, 0 0 20px #000;
}
.logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 10vw, 7.5rem);
  line-height: 1;
  margin: 0;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--pink),
    0 0 30px var(--pink),
    0 0 60px var(--pink);
  animation: neon 6s infinite;
}
.logo-sub {
  margin: -0.15em 0 0;
  padding-left: 40%;
  font-family: "Mr Dafoe", cursive;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 1;
  color: var(--cyan);
  transform: rotate(-7deg);
  text-shadow: 0 0 8px var(--cyan), 0 0 24px rgba(34, 244, 255, 0.7), 0 0 2px #000;
}
.tagline {
  max-width: 560px;
  margin: 0 auto;
  color: #e6e0ff;
  font-size: 1.1rem;
}
.hero-stats {
  display: flex;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--muted);
}
.hero-stats b { color: var(--lime); font-weight: 400; text-shadow: 0 0 8px rgba(180, 255, 57, 0.6); }

.press-start {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  color: #fff;
  text-decoration: none;
  animation: blink 1.2s steps(2, start) infinite;
}
.press-start:hover { color: var(--lime); animation: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  font-family: var(--head);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--night);
  background: var(--cyan);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(34, 244, 255, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 28px rgba(34, 244, 255, 0.9); }
.btn-play { background: var(--lime); box-shadow: 0 0 16px rgba(180, 255, 57, 0.55); }
.btn-play:hover { box-shadow: 0 0 30px rgba(180, 255, 57, 0.95); }
.btn-ghost { background: transparent; color: var(--cyan); border: 1.5px solid var(--cyan); box-shadow: none; }
.btn-ghost:hover { box-shadow: 0 0 18px rgba(34, 244, 255, 0.5); }
.btn-small { padding: 7px 14px; font-size: 0.75rem; }

/* ---------- Library ---------- */
.library { position: relative; padding: 40px 0 100px; scroll-margin-top: 30px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 28px;
}
.section-head h2 span { color: var(--pink); text-shadow: 0 0 12px var(--pink); }
.section-head p { margin: 0; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--violet); }
.chip.on { color: var(--night); background: var(--pink); border-color: var(--pink); box-shadow: 0 0 14px rgba(255, 43, 214, 0.6); }
.chip .n { opacity: 0.6; margin-left: 4px; }

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}
.card:hover {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink), 0 0 28px rgba(255, 43, 214, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.card-art {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a0f5c, #0b0626);
  overflow: hidden;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, filter 0.3s ease; filter: saturate(1.1); }
.card:hover .card-art img { transform: scale(1.06); }
.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover .card-art::after { opacity: 1; }
.card-art .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 10px var(--cyan), 0 0 24px var(--cyan);
  background:
    linear-gradient(to bottom, transparent 55%, rgba(255, 43, 214, 0.15)),
    repeating-linear-gradient(90deg, rgba(34, 244, 255, 0.1) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(34, 244, 255, 0.1) 0 1px, transparent 1px 32px),
    linear-gradient(135deg, #24104f, #0a0624);
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  padding: 1px 9px;
  border-radius: 4px;
  color: var(--night);
  background: var(--lime);
  box-shadow: 0 0 12px rgba(180, 255, 57, 0.6);
}
.badge.vr { background: var(--cyan); box-shadow: 0 0 12px rgba(34, 244, 255, 0.6); }
.badge.wip { background: var(--orange); box-shadow: 0 0 12px rgba(255, 179, 71, 0.6); }
.badge.soon { background: var(--violet); color: #fff; box-shadow: 0 0 12px rgba(139, 92, 255, 0.6); }

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 6px; color: #fff; }
.card-body p { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tags .badge { position: static; }
.tag {
  font-family: var(--mono);
  font-size: 1.02rem;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(34, 244, 255, 0.08);
  border: 1px solid rgba(34, 244, 255, 0.22);
}

.empty { color: var(--muted); font-family: var(--mono); font-size: 1.4rem; }

/* ---------- About ---------- */
.about {
  padding: 90px 0;
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 255, 0.18), transparent 60%);
}
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about p { color: #d4cdf7; }
.terminal {
  font-family: var(--mono);
  font-size: 1.3rem;
  line-height: 1.35;
  background: #04030f;
  border: 1px solid rgba(180, 255, 57, 0.35);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--lime);
  text-shadow: 0 0 6px rgba(180, 255, 57, 0.5);
  box-shadow: inset 0 0 40px rgba(180, 255, 57, 0.06);
  overflow-x: auto;
}
.terminal .dim { color: #6f8f3a; text-shadow: none; }
.cursor { animation: blink 1s steps(2, start) infinite; }

.footer {
  padding: 32px 0 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--cyan); }
.footer .hint {
  margin-top: 4px;
  padding: 4px 8px;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background: none;
  border: 0;
  opacity: 0.5;
  cursor: pointer;
}
.footer .hint:hover { opacity: 1; color: var(--pink); text-shadow: 0 0 8px var(--pink); }

/* ---------- Light Rider (secret game in the hero) ---------- */
.rider {
  position: absolute;
  inset: 0;
  z-index: 5;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.rider-exit {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 6;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--muted);
  background: rgba(7, 5, 26, 0.6);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.rider-exit:hover { color: #fff; border-color: var(--pink); }
body.riding { overflow: hidden; }
body.riding .nav, body.riding .hero-lower, body.riding .grid { display: none; }
body.riding .hero-title { opacity: 0; transition: opacity 0.4s ease; }

/* ---------- Game detail page ---------- */
.detail-hero {
  position: relative;
  padding: 120px 0 50px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.detail-hero .bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.3) brightness(0.45);
  transform: scale(1.1);
}
.detail-hero .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(7, 5, 26, 0.3), var(--night));
}
.detail-top {
  position: relative;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
.back {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--cyan); }
.detail-top h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 43, 214, 0.65);
}
.pitch { font-size: 1.2rem; color: #ddd6ff; margin: 0 0 20px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.play-note { margin-top: 12px; color: var(--muted); font-size: 0.92rem; }
.hero-shot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 40px rgba(255, 43, 214, 0.25); aspect-ratio: 16/9; background: var(--panel); }
.hero-shot img { width: 100%; height: 100%; object-fit: cover; }
.hero-shot .placeholder { height: 100%; display: grid; place-items: center; font-family: var(--display); font-size: 2.2rem; color: #fff; text-shadow: 0 0 14px var(--cyan); text-align: center; padding: 20px; }

.detail-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding: 50px 0 90px; }
.detail-body h2 { font-size: 1.2rem; color: var(--cyan); text-shadow: 0 0 10px rgba(34, 244, 255, 0.5); margin-top: 34px; }
.detail-body h2:first-child { margin-top: 0; }
.description p { color: #d4cdf7; margin: 0 0 14px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.shots button { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--panel); aspect-ratio: 16/9; }
.shots button:hover { border-color: var(--cyan); }
.shots img { width: 100%; height: 100%; object-fit: cover; }
.side-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-self: start; position: sticky; top: 84px; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.facts dt { font-family: var(--mono); font-size: 1.15rem; color: var(--muted); }
.facts dd { margin: 0; }
.controls { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.controls td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls td:last-child { text-align: right; font-family: var(--mono); font-size: 1.15rem; color: var(--lime); padding-left: 12px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  background: rgba(4, 3, 15, 0.92);
  padding: 30px;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; border-radius: 10px; box-shadow: 0 0 60px rgba(255, 43, 214, 0.4); }

/* ---------- Player page ---------- */
.player-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.player-page::after { display: none; }
.player-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: #05040f;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.player-bar .title { font-family: var(--head); font-weight: 700; letter-spacing: 0.06em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar .back { margin: 0; }
.player-frame { flex: 1; width: 100%; border: 0; background: #000; }
.player-note { font-size: 0.85rem; color: var(--muted); }

/* ---------- Animations ---------- */
@keyframes grid-run { to { background-position: 0 70px; } }
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 0.95; } }
@keyframes blink { to { visibility: hidden; } }
@keyframes neon {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 0 0 4px #fff, 0 0 12px var(--pink), 0 0 30px var(--pink), 0 0 60px var(--pink);
    opacity: 1;
  }
  20%, 24%, 55% { text-shadow: none; opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .grid::before, .logo, .stars, .press-start, .cursor { animation: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .nav-links a:not(.primary) { display: none; }
  .hero { min-height: 640px; height: 100svh; --horizon: 52%; }
  .tagline { font-size: 1rem; }
  .about-inner, .detail-top, .detail-body { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .player-note { display: none; }
}
