/* styles.css */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

header {
  background-color: #333;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
}

nav a:hover,
nav a:focus {
  background-color: #555;
}

main {
  padding: 1.25rem;
}

section {
  display: none;
}

section.active {
  display: block;
}

iframe {
  width: 100%;
  height: 600px;
  border: none;
}

.game-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.game-card {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 200px;
  min-height: 300px;
}

.game-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.download-button,
.back-button {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #0078D4;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
}

.download-button:hover,
.back-button:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .game-card {
    width: 150px;
  }
  iframe {
    height: 400px;
  }
}


/* Category widget wrapper */
.category-widget {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Widget header styling */
.category-widget h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #0078D4;
  padding-bottom: 0.25rem;
}

/* Turn the game-list into a responsive grid */
.category-widget .game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Make cards padded, consistent height, and flex‑spaced */
.game-card {
  padding: 1rem;                   /* add inner spacing */
  box-sizing: border-box;          /* include padding in width/height */
  display: flex;
  flex-direction: column;
  justify-content: space-between;  /* push buttons to bottom */
  min-height: 350px;               /* enforce consistent height */
  background-color: #fafafa;       /* subtle bg to separate from white page */
  border-radius: 0.5rem;           /* soften corners */
}

/* Ensure the description fills the gap if no buttons */
.game-card p {
  flex-grow: 1;
  margin: 0.5rem 0 1rem;
  line-height: 1.4;
}

/* Space out titles */
.game-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

/* Uniform button/link spacing */
.game-card .download-button,
.game-card .learn-more {
  margin-top: 0.5rem;
  width: 100%;                     /* full‑width buttons/links */
  text-align: center;
}

/* Stretch cards to equal height in the grid */
.category-widget .game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
