/* ===== GAMES PAGE CSS ===== */
/* Shared colour, gradient and nav styles live in theme.css (loaded last on every page). */

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
html { scroll-behavior: smooth; }

body {
  background: var(--body-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
.container { max-width: 1400px; margin: 0 auto; padding: 2rem; padding-top: 100px; position: relative; z-index: 1; }

/* ===== HEADER ===== */
.header-text { text-align: center; margin-bottom: 3.5rem; position: relative; }
.header-text::after {
  content: ''; position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 3px; background: var(--gradient-1); border-radius: 2px;
}
.header-text h1 {
  font-size: 2.8rem; font-weight: 700; margin-bottom: .5rem;
  background: var(--gradient-1); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-text p { color: var(--text-color-second); font-size: 1.1rem; font-style: italic; }

/* ===== GAME CARDS ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

/* each game has its own accent colour */
.game-bug    { --accent: #a3e635; --accent-2: #15803d; }
.game-kandam { --accent: #2dd4bf; --accent-2: #1d4ed8; }
.game-tank   { --accent: #fb923c; --accent-2: #b91c1c; }

.game-card {
  display: flex; flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.game-card:hover, .game-card:focus-within {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 25px 70px rgba(0,0,0,.5), 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent);
}

.game-cover {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10;
  color: var(--accent);
  background:
    radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--accent-2) 70%, transparent), transparent 70%),
    linear-gradient(160deg, #141414, #0d0d0d);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}
.game-cover svg { width: 38%; max-width: 130px; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 55%, transparent)); }
.game-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
/* when a cover picture exists, keep it readable and hide the icon */
.game-cover img + svg { display: none; }
.game-cover::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(10,10,10,.65));
}

.game-body { display: flex; flex-direction: column; gap: 12px; padding: 24px; flex: 1; }
.game-body h2 { font-size: 1.5rem; font-weight: 700; color: var(--color-white); }
.game-body p { color: var(--text-color-second); font-size: .95rem; line-height: 1.65; flex: 1; }

.game-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.game-tags li {
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.game-play {
  display: flex; align-items: center; justify-content: center;
  margin-top: 6px; padding: 14px 24px;
  border-radius: 14px; text-decoration: none;
  font-size: 15px; font-weight: 600; color: #0a0a0a;
  background: var(--accent);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.game-play:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.game-play:active { transform: translateY(0); }

.games-note { text-align: center; color: var(--text-color-third); font-size: .9rem; margin-top: 2.5rem; }

/* ===== FOOTER ===== */
footer {
  background: var(--footer-bg-color); padding: 30px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  width: 100%; text-align: center; margin-top: 3rem; position: relative;
}
footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--first-color) 50%, transparent 100%);
}
.bottom-footer { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.bottom-footer p { color: var(--text-color-third); font-size: 14px; font-weight: 400; }
.bottom-footer a { color: var(--first-color); text-decoration: none; transition: all .3s ease; }
.bottom-footer a:hover { text-shadow: 0 0 10px var(--first-color); }

/* ===== RESPONSIVE ===== */
@media only screen and (max-width: 900px) {
  .container { padding: 1rem; padding-top: 100px; }
  .header-text h1 { font-size: 2rem; }
  .games-grid { gap: 1.5rem; }
}
@media only screen and (max-width: 600px) {
  .container { padding-top: 90px; }
  .header-text h1 { font-size: 1.8rem; }
  .header-text p { font-size: 1rem; }
  .game-body { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card, .game-play { transition: none; }
  .game-card:hover, .game-card:focus-within { transform: none; }
}
