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

body {
  background: #0f0f23;
  color: #eee;
  font-family: "Press Start 2P", monospace;
  min-height: 100vh;
}

.hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(10px, 2vh, 20px) 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: clamp(10px, 2vh, 18px);
}

header h1 {
  font-size: clamp(20px, 4vw, 32px);
  color: #e94560;
  line-height: 1.2;
  margin-bottom: 6px;
}

.tagline {
  font-size: clamp(8px, 1.1vw, 10px);
  color: #aaa;
  margin-bottom: 0;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
  margin-bottom: clamp(10px, 2vh, 18px);
}

.game-card {
  background: #1a1a2e;
  border: 2px solid #333;
  border-radius: 8px;
  padding: clamp(10px, 1.5vh, 16px) 10px;
  text-align: center;
  text-decoration: none;
  color: #eee;
  transition: border-color 0.2s, transform 0.2s;
  min-height: clamp(110px, 18vh, 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.game-card:hover {
  border-color: #e94560;
  transform: translateY(-2px);
}

/* On 3-col layout: keep 5 cards in 2 rows (3 + 2 centered).
   The 4th and 5th cards span 1 col each but offset so they center. */
.game-card:nth-child(4) {
  grid-column: 1 / span 1;
  grid-row: 2;
  margin-left: 50%;
}
.game-card:nth-child(5) {
  grid-column: 2 / span 1;
  grid-row: 2;
  margin-left: 50%;
}

.game-icon {
  font-size: 32px;
  margin-bottom: 6px;
  height: clamp(36px, 6vh, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-icon svg {
  width: clamp(36px, 6vh, 48px);
  height: clamp(36px, 6vh, 48px);
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform 0.2s;
}

.game-card:hover .game-icon svg {
  transform: translateY(-1px) scale(1.05);
}

.game-card h2 {
  font-size: clamp(8px, 1.1vw, 10px);
  color: #e94560;
  margin-bottom: 4px;
}

.game-card p {
  font-size: clamp(6px, 0.8vw, 8px);
  color: #888;
  line-height: 1.4;
}

.cta {
  text-align: center;
  background: #16213e;
  border: 1px solid #e94560;
  border-radius: 8px;
  padding: clamp(8px, 1.5vh, 14px) 16px;
  margin-bottom: clamp(8px, 1.5vh, 14px);
}

.cta p {
  font-size: clamp(7px, 0.9vw, 9px);
  line-height: 1.6;
}

.cta strong {
  color: #ffd700;
}

.ghost-warning {
  color: #888;
  font-size: clamp(6px, 0.7vw, 7px) !important;
  margin-top: 6px;
}

footer {
  text-align: center;
  font-size: clamp(6px, 0.7vw, 7px);
  color: #555;
  margin-top: auto;
}

footer .links {
  margin-top: 6px;
}

footer a {
  color: #e94560;
  text-decoration: none;
}

/* 2-column layout: ~1000px or below */
@media (max-width: 1000px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-card:nth-child(4) {
    grid-column: 1 / span 1;
    grid-row: auto;
    margin-left: 0;
  }
  .game-card:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: auto;
    max-width: 50%;
    margin: 0 auto;
    width: 100%;
  }
}

/* 1-column layout: under ~700px wide — mobile scrolling is fine */
@media (max-width: 700px) {
  .hub {
    min-height: auto;
    padding: 20px 16px;
  }
  .games-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }
  .game-card:nth-child(4),
  .game-card:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    max-width: 100%;
    width: auto;
  }
  .game-card {
    min-height: auto;
    padding: 18px 12px;
  }
  .game-icon,
  .game-icon svg {
    width: 56px;
    height: 56px;
  }
  header {
    margin-bottom: 24px;
  }
  .cta {
    margin-bottom: 24px;
    padding: 18px;
  }
}
