/* DSP Space Arcade — synthwave landing page */

body {
  overflow-y: auto;
  background: #0b0220;
}

/* Synthwave background canvas */
#synthwave {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Marquee ticker */
.ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #05010f;
  border-bottom: 2px solid #ff2d95;
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
  box-shadow: 0 0 18px rgba(255, 45, 149, 0.4);
}
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
}
.ticker-track span {
  font-size: 11px;
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.7);
  padding-right: 40px;
  letter-spacing: 1px;
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Landing layout */
.landing {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 90px 32px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 48px;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 4px;
  margin-bottom: 18px;
  animation: flicker 4s infinite;
}
.hero-title {
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1.25;
  letter-spacing: 4px;
  margin-bottom: 20px;
  /* Dark translucent backdrop so the neon text stays readable over the sun */
  background: rgba(5, 1, 15, 0.55);
  padding: 14px 34px;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(5, 1, 15, 0.8);
  display: inline-block;
}
.hero-title .line1,
.hero-title .line2,
.hero-title .line3 {
  display: block;
}
.hero-title .line1 { animation: flicker 5s infinite; }
.hero-title .line2 { animation: flicker 7s infinite 0.5s; }
.hero-title .line3 { animation: flicker 6s infinite 1s; }
.hero-sub {
  font-size: 13px;
  letter-spacing: 3px;
  margin-bottom: 24px;
}
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.divider-line {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  box-shadow: 0 0 8px #00e5ff;
}
.divider-star {
  color: #ffd700;
  font-size: 16px;
  text-shadow: 0 0 8px #ffd700;
  animation: spin 6s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* Game cards */
.games {
  display: grid;
  /* minmax(0, 1fr) forces truly equal columns — plain 1fr lets longer
     titles stretch their column, making thumbnails uneven. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Equal-height rows so a wrapping title (e.g. "SPACE INVADERS") doesn't
     make one row of cards taller than the other. */
  grid-auto-rows: 1fr;
  gap: 32px;
  width: 100%;
  margin-bottom: 56px;
}
@media (max-width: 1200px) {
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .games { grid-template-columns: 1fr; }
}

.game-card {
  background: rgba(13, 2, 33, 0.85);
  border: 3px solid #2a1a5e;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  min-width: 0;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: #00e5ff;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.35), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.game-card[data-game="invaders"]:hover { border-color: #39ff14; box-shadow: 0 0 24px rgba(57, 255, 20, 0.35), 0 12px 40px rgba(0,0,0,0.6); }
.game-card[data-game="asteroids"]:hover { border-color: #00e5ff; box-shadow: 0 0 24px rgba(0, 229, 255, 0.35), 0 12px 40px rgba(0,0,0,0.6); }
.game-card[data-game="breakout"]:hover { border-color: #ffd700; box-shadow: 0 0 24px rgba(255, 215, 0, 0.35), 0 12px 40px rgba(0,0,0,0.6); }

.thumb-frame {
  position: relative;
  width: 100%;
  /* Fallback for browsers without aspect-ratio (older Safari): padding hack */
  height: 0;
  padding-top: 112.5%; /* 9/8 */
  overflow: hidden;
  border: 2px solid #3a2a6e;
  background: #05010f;
}
@supports (aspect-ratio: 1) {
  .thumb-frame {
    height: auto;
    padding-top: 0;
    aspect-ratio: 8 / 9;
  }
}
.thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  display: block;
}
.thumb-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}
.game-card:hover .thumb {
  animation: thumb-bob 1.2s ease-in-out infinite;
}
@keyframes thumb-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.game-title {
  font-size: 20px;
  letter-spacing: 2px;
  /* Reserve 2 lines so a wrapping title (e.g. "SPACE INVADERS") doesn't push
     its INSERT COIN button lower than the other cards — all buttons align. */
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-tagline {
  font-size: 10px;
  color: #888;
  letter-spacing: 2px;
}
.game-hi {
  font-size: 11px;
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}
.hi-value {
  color: #fff;
}
.play-btn {
  width: 100%;
  font-size: 13px;
  padding: 16px 22px;
  text-decoration: none;
  text-align: center;
}

/* Footer */
.landing-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.music-btn {
  font-size: 11px;
  padding: 12px 20px;
  cursor: pointer;
}
.footer-line {
  font-size: 11px;
  letter-spacing: 2px;
}
.footer-sign {
  font-size: 14px;
  letter-spacing: 2px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.footer-copy {
  font-size: 8px;
  color: #555;
  letter-spacing: 1px;
}

/* Flicker animation */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.6; }
  94% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
}
