@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
  --neon-purple: #b44fff;
  --neon-cyan: #00f5ff;
  --neon-yellow: #ffe600;
  --neon-red: #ff3a3a;
  --neon-green: #39ff14;
  --bg-dark: #050510;
  --bg-card: #0d0d1f;
  --bg-card-hover: #141430;
  --border-glow: #5a3aee;
  --text-main: #e0e0ff;
  --text-dim: #444466;
}

html, body {
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  overflow-x: hidden;
}

/* Scanline overlay */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
}

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 48px 24px 32px;
  position: relative;
}

header::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-cyan), var(--neon-purple), transparent);
  margin-top: 32px;
  box-shadow: 0 0 12px var(--neon-purple);
}

.header-inner {
  display: inline-block;
}

.logo {
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-shadow:
    0 0 10px currentColor,
    0 0 30px currentColor,
    0 0 60px currentColor;
  animation: flicker 6s infinite;
}

.logo-c { color: #ff3a3a; }
.logo-a { color: #ff8c00; }
.logo-r { color: var(--neon-yellow); }
.logo-s { color: var(--neon-green); }
.logo-o { color: var(--neon-cyan); }
.logo-n { color: var(--neon-purple); }

.logo-arcade {
  font-size: clamp(14px, 3vw, 26px);
  color: var(--neon-cyan);
  letter-spacing: 0.5em;
  text-shadow: 0 0 16px var(--neon-cyan), 0 0 40px var(--neon-cyan);
}

.tagline {
  font-size: 10px;
  color: var(--neon-yellow);
  letter-spacing: 0.3em;
  margin-top: 16px;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.85; }
  97% { opacity: 1; }
  98% { opacity: 0.7; }
  99% { opacity: 1; }
}

/* ===== MAIN / GAME GRID ===== */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

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

/* ===== GAME CARD ===== */
.game-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--border-glow);
  border-radius: 4px;
  background: var(--bg-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.game-card:not(.coming-soon):hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--neon-cyan);
  box-shadow:
    0 0 16px var(--neon-cyan),
    0 0 40px rgba(0, 245, 255, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.6);
}

.game-card.coming-soon {
  border-color: #222244;
  cursor: default;
  opacity: 0.5;
}

.game-card-inner {
  display: flex;
  flex-direction: column;
}

/* ===== GAME PREVIEW ART ===== */
.game-preview {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.fight-masters-preview {
  background: #000;
  border-bottom: 2px solid var(--border-glow);
  padding: 0;
}

.preview-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  padding-bottom: 16px;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Pixel fighter silhouettes */
.fighter {
  width: 36px;
  height: 60px;
  position: relative;
  image-rendering: pixelated;
}

.fighter-left {
  background: var(--neon-purple);
  clip-path: polygon(
    30% 0%, 70% 0%,
    70% 20%, 90% 15%, 100% 30%, 80% 35%, 70% 25%,
    70% 55%, 90% 55%, 90% 100%, 55% 100%, 55% 65%,
    45% 65%, 45% 100%, 10% 100%, 10% 55%, 30% 55%,
    30% 25%, 20% 35%, 0% 30%, 10% 15%, 30% 20%
  );
  filter: drop-shadow(0 0 8px var(--neon-purple));
  animation: fighter-idle 1.2s ease-in-out infinite alternate;
}

.fighter-right.goblin {
  background: var(--neon-green);
  clip-path: polygon(
    20% 0%, 80% 0%,
    90% 10%, 85% 20%, 70% 18%, 70% 30%,
    100% 25%, 100% 50%, 80% 50%,
    80% 70%, 100% 70%, 100% 100%, 55% 100%, 55% 65%,
    45% 65%, 45% 100%, 0% 100%, 0% 70%, 20% 70%,
    20% 50%, 0% 50%, 0% 25%, 30% 30%, 30% 18%, 15% 20%, 10% 10%
  );
  filter: drop-shadow(0 0 8px var(--neon-green));
  animation: fighter-idle 1.4s ease-in-out infinite alternate-reverse;
}

@keyframes fighter-idle {
  from { transform: translateY(0px); }
  to   { transform: translateY(-4px); }
}

.versus {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--neon-yellow);
  text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
  align-self: center;
  animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Empty preview for coming soon */
.empty-preview {
  background: #080814;
  border-bottom: 2px solid #222244;
}

.question-mark {
  font-family: 'Press Start 2P', monospace;
  font-size: 48px;
  color: #333355;
}

/* ===== GAME INFO ===== */
.game-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-title {
  font-size: 14px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  letter-spacing: 0.05em;
}

.game-title.dim {
  color: #334;
  text-shadow: none;
}

.game-desc {
  font-size: 7px;
  line-height: 1.9;
  color: #8888bb;
  font-family: 'Courier New', monospace;
}

.game-desc.dim {
  color: #333344;
}

.game-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 6px;
  padding: 4px 8px;
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple);
  border-radius: 2px;
  letter-spacing: 0.1em;
}

.tag.dim {
  border-color: #222244;
  color: #333366;
}

/* ===== PLAY BUTTON ===== */
.play-btn {
  margin-top: 4px;
  font-size: 10px;
  padding: 10px 16px;
  background: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  text-align: center;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  text-shadow: 0 0 8px var(--neon-cyan);
}

.game-card:not(.coming-soon):hover .play-btn {
  background: rgba(0, 245, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.4);
}

.play-btn.disabled {
  border-color: #222244;
  color: #333366;
  text-shadow: none;
  cursor: default;
}

.play-icon {
  margin-right: 8px;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px 24px 40px;
  border-top: 1px solid #111133;
}

.footer-text {
  font-size: 7px;
  color: #334;
  letter-spacing: 0.2em;
}

.coin-row {
  margin-top: 16px;
  font-size: 14px;
  color: var(--neon-yellow);
  letter-spacing: 0.3em;
  opacity: 0.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  .logo {
    font-size: 22px;
  }
  .logo-arcade {
    font-size: 11px;
  }
}
