/* Shared styles for the homepage, the games hub and each game page. */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0b1120;
  color: #edf3ff;
  font: 17px/1.7 system-ui, sans-serif;
}

header, main, footer {
  width: min(100% - 36px, 960px);
  margin: auto;
}

header {
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

a { color: #80f0d7; }

a:focus-visible, button:focus-visible {
  outline: 3px solid #80f0d7;
  outline-offset: 5px;
}

h1, h2 { line-height: 1.2; }

h1 {
  font-size: clamp(36px, 7vw, 62px);
  max-width: 720px;
}

main { padding: 24px 0 56px; }

section { margin: 38px 0; }

.lead { color: #c8d5ea; max-width: 680px; }

.button {
  display: inline-block;
  background: #80f0d7;
  color: #0b1120;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

footer {
  border-top: 1px solid #344155;
  padding: 24px 0;
}

footer a { margin-right: 18px; }

/* Game cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #172238;
  border: 1px solid #22314d;
  border-radius: 18px;
  overflow: hidden;
}

.game-card:hover { border-color: #3c716f; }

.game-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 340;
  background: #0b1222;
}

.game-card .body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  flex: 1;
}

.game-card h3 { margin: 0; font-size: 21px; line-height: 1.25; }

.game-card h3 a { color: #edf3ff; text-decoration: none; }

/* The whole card is clickable; the title link stretches over it. */
.game-card h3 a::after { content: ""; position: absolute; inset: 0; }

.game-card h3 a:focus-visible { outline: none; }

.game-card:focus-within { outline: 3px solid #80f0d7; outline-offset: 4px; }

.game-card p { margin: 0; color: #c8d5ea; font-size: 15.5px; line-height: 1.6; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #a9bbd4;
  background: #0f182b;
  border: 1px solid #2a3a57;
  border-radius: 999px;
  padding: 2px 10px;
}

/* Game page */
#game-frame {
  display: block;
  width: 100%;
  height: 720px; /* fallback; game-frame.js sizes the frame to the game */
  border: 0;
  border-radius: 18px;
  background: #080d19;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

/* Keep the title area compact so the game's Start button is on screen. */
.game-page main { padding-top: 0; }
.game-page h1 { margin: 4px 0 6px; font-size: clamp(34px, 5vw, 48px); }
.game-page .intro { margin: 0 0 10px; }

@media (max-width: 600px) {
  main { padding-top: 0; }
  .game-page h1 { margin: 8px 0 4px; font-size: 34px; }
  .game-page .intro { margin: 0 0 10px; font-size: 16px; }
  .game-page .game-meta { margin-bottom: 10px; }
}

/* Games hub comparison table */
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

.compare th, .compare td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #22314d;
}

.compare thead th {
  color: #a9bbd4;
  font-size: 13px;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .compare th, .compare td { padding: 8px 6px; font-size: 14px; }
}
