:root {
  --bg-top: #081225;
  --bg-bottom: #020617;
  --panel: #0f172a;
  --panel-edge: #1e293b;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --brand: #22d3ee;
  --brand-2: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, #11345d 0%, transparent 30%),
    radial-gradient(circle at 85% -10%, #4a2d15 0%, transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.3rem);
  letter-spacing: 0.02em;
}

.hero p {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.45;
}

.meta-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.meta {
  font-weight: 600;
  color: #cbd5e1;
}

.rules-button,
.rules-link {
  border: 1px solid #7dd3fc;
  color: #083344;
  background: linear-gradient(120deg, #7dd3fc, #22d3ee);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

#games-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.game-card {
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.35);
}

.pill-row {
  display: flex;
  gap: 8px;
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #082f49;
  background: linear-gradient(120deg, var(--brand), #67e8f9);
  border-radius: 999px;
  padding: 5px 9px;
}

.game-card h2 {
  margin: 12px 0 4px;
}

.tagline {
  margin: 0;
  color: #f8fafc;
}

.description {
  color: var(--muted);
  margin: 10px 0 14px;
  min-height: 64px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--panel-edge);
  padding-top: 10px;
  color: #cbd5e1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-link {
  color: #0f172a;
  background: linear-gradient(120deg, var(--brand-2), #fbbf24);
  text-decoration: none;
  font-weight: 800;
  border-radius: 10px;
  padding: 8px 12px;
}

.empty {
  color: #fecaca;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 20px;
  z-index: 100;
}

.modal.open {
  display: grid;
}

.modal-card {
  width: min(680px, 100%);
  background: linear-gradient(160deg, rgba(14, 24, 45, 0.98), rgba(17, 24, 39, 0.98));
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 20px 20px 18px;
  position: relative;
}

.modal-card h2 {
  margin: 0 32px 12px 0;
}

.modal-card p {
  color: #cbd5e1;
}

.rules-list {
  margin: 0;
  padding-left: 20px;
  color: #e2e8f0;
  line-height: 1.5;
}

.rules-note {
  margin-top: 12px;
  color: #fbbf24;
  font-weight: 700;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 700px) {
  .page {
    padding: 12px;
  }

  .hero {
    margin-top: 8px;
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
