@font-face {
  font-family: "PressStart2P";
  src: url("/assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}

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

:root {
  --yellow: #ffcc00;
  --yellow-glow: rgba(255, 204, 0, 0.4);
  --blue: #aaaaff;
  --blue-dim: #8888cc;
  --blue-dark: #555588;
  --blue-glow: rgba(170, 170, 255, 0.3);
  --bg: #0a0a0a;
  --bg-panel: #0d0d1a;
  --text: #cccccc;
  --text-dim: #888888;
  --link: #aaaaff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PressStart2P", monospace;
  font-size: 14px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* Body text default is white/gray */

/* CRT scanline overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.10) 0px,
    rgba(0, 0, 0, 0.10) 2px,
    transparent 2px,
    transparent 4px
  );
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 9999;
}

/* CRT vignette */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 9998;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-shadow: 0 0 8px var(--blue-glow);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
}

.hero h1 {
  font-size: 36px;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow-glow), 0 0 40px rgba(255, 204, 0, 0.2);
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.hero .tagline {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.hero .tagline-sub {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 40px;
  letter-spacing: 3px;
}

.cursor-blink::after {
  content: "_";
  animation: blink 1s step-end infinite;
}

.block-cursor::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.play-btn {
  display: inline-block;
  padding: 16px 48px;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-family: "PressStart2P", monospace;
  font-size: 20px;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.2s;
  background: transparent;
  letter-spacing: 2px;
  cursor: pointer;
}

.play-btn:hover {
  background: var(--blue);
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 20px var(--blue-glow), 0 0 40px rgba(170, 170, 255, 0.2);
}

/* ---- GAME EMBED ---- */
.game-wrapper {
  display: none;
  justify-content: center;
  padding: 0 0 40px;
}

.game-wrapper--visible {
  display: flex;
  animation: containerGrow 0.6s ease-out forwards;
}

.game-container {
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--blue-dark);
  background: #000;
  position: relative;
  box-shadow: 0 0 30px var(--blue-glow), 0 0 60px rgba(170, 170, 255, 0.1);
  overflow: hidden;
}

.game-container--expanded {
  max-width: none;
  /* Fit to viewport: use height as constraint if wider than 16:9 viewport */
  max-height: 100vh;
  aspect-ratio: 16 / 9;
}

.game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.game-container iframe.game-iframe--loaded {
  opacity: 1;
}

.fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--blue-dark);
  color: var(--blue);
  font-family: "PressStart2P", monospace;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.game-container:hover .fullscreen-btn {
  opacity: 1;
}

.fullscreen-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 0 8px var(--blue-glow);
}

.game-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  color: var(--text-dim);
}

/* Button expand-out animation */
.play-btn--expanding {
  animation: btnExpand 0.4s ease-in forwards;
  pointer-events: none;
}

@keyframes btnExpand {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
    border-color: var(--blue);
    box-shadow: 0 0 30px var(--blue-glow);
  }
  100% {
    transform: scale(0.01);
    opacity: 0;
  }
}

@keyframes containerGrow {
  0% {
    transform: scale(0.02);
    opacity: 0;
  }
  60% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---- SECTION ---- */
section {
  padding: 60px 0;
}

section h2 {
  font-size: 20px;
  color: var(--blue);
  text-align: center;
  margin-bottom: 40px;
  text-shadow: 0 0 10px var(--blue-glow);
}

section h2::before {
  content: "> ";
  color: var(--blue-dark);
}

.features-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 32px;
  margin-top: -24px;
}

/* ---- FEATURES ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  border: 1px solid var(--blue-dark);
  padding: 24px;
  background: var(--bg-panel);
}

.feature-card h3 {
  font-size: 13px;
  color: var(--blue);
  margin-bottom: 12px;
}

.feature-card h3::before {
  content: "$ ";
  color: var(--blue-dark);
}

.feature-card p {
  font-size: 11px;
  color: var(--text);
  line-height: 2;
}

/* ---- SCREENSHOTS ---- */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.screenshot-slot {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--blue-dark);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screenshot-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}

.lightbox-card {
  background: var(--bg-panel);
  border: 2px solid var(--blue-dark);
  box-shadow: 0 0 40px var(--blue-glow), 0 0 80px rgba(0, 0, 0, 0.8);
  padding: 12px;
  max-width: 85%;
  max-height: 85vh;
  animation: cardPopIn 0.25s ease-out;
}

.lightbox-card img {
  display: block;
  max-width: 100%;
  max-height: calc(85vh - 24px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: "PressStart2P", monospace;
  font-size: 18px;
  cursor: pointer;
  z-index: 20001;
}

.lightbox-close:hover {
  color: #ffffff;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--blue-dark);
  color: var(--blue);
  font-family: "PressStart2P", monospace;
  font-size: 24px;
  padding: 16px 12px;
  cursor: pointer;
  z-index: 20001;
}

.lightbox-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--blue);
  box-shadow: 0 0 10px var(--blue-glow);
}

.lightbox-arrow--left {
  left: 16px;
}

.lightbox-arrow--right {
  right: 16px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-dim);
  font-family: "PressStart2P", monospace;
}

@keyframes cardPopIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.screenshot-slot .placeholder {
  font-size: 11px;
  color: var(--text-dim);
}

/* ---- STORES ---- */
.stores {
  text-align: center;
}

.store-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--blue-dark);
  color: var(--text-dim);
  font-size: 11px;
  font-family: "PressStart2P", monospace;
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--blue-dark);
  margin-top: 20px;
}

footer p {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.credits {
  margin: 16px 0;
}

.credits p {
  font-size: 9px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.credits .credit-label {
  color: var(--yellow);
  margin-top: 12px;
  margin-bottom: 2px;
}

footer a {
  font-size: 10px;
}

/* ---- PRIVACY PAGE ---- */
.privacy {
  padding: 60px 0;
}

.privacy h1 {
  font-size: 24px;
  color: var(--yellow);
  text-shadow: 0 0 10px var(--yellow-glow);
  margin-bottom: 8px;
}

.privacy .updated {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.privacy h2 {
  font-size: 14px;
  color: var(--blue);
  margin: 32px 0 16px;
  text-align: left;
}

.privacy h2::before {
  content: "> ";
  color: var(--blue-dark);
}

.privacy p,
.privacy li {
  font-size: 11px;
  color: var(--text);
  line-height: 2.2;
}

.privacy ul {
  list-style: none;
  padding-left: 20px;
}

.privacy ul li::before {
  content: "- ";
  color: var(--blue-dark);
}

.privacy a.back-link {
  display: inline-block;
  margin-bottom: 32px;
  font-size: 12px;
}

.privacy a.back-link::before {
  content: "< ";
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 22px;
  }

  .hero .tagline {
    font-size: 11px;
  }

  .play-btn {
    font-size: 16px;
    padding: 14px 32px;
  }

  section h2 {
    font-size: 16px;
  }

  body {
    font-size: 12px;
  }
}
