:root {
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1rem;
  font-family: var(--font-sans, "Montserrat", sans-serif);
  color: #2b2b2b;
  background: linear-gradient(135deg, #d6d6d6 0%, #bfbfbf 50%, #a9a9a9 100%);
}

.games-page {
  width: 100%;
  max-width: 1024px;
}

.games-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5c5c5c;
}

h1 {
  margin: 0;
  font-family: var(--font-heading, "Montserrat", sans-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  color: #252525;
}

.subtitle {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: #4a4a4a;
}

.back-link {
  flex: 0 0 auto;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: #333;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.65);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
}

.game-card {
  --accent: #4a90e2;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  padding: 1.25rem;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #2f3238;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.12), 0 12px 24px rgba(0, 0, 0, 0.16);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 0%, var(--accent) 0%, transparent 55%);
  opacity: 0.85;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 65%);
}

.game-card > * {
  position: relative;
  z-index: 1;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.18), 0 20px 40px rgba(0, 0, 0, 0.22);
}

.game-card:hover::before,
.game-card:focus-visible::before {
  transform: scale(1.15);
  opacity: 1;
}

.game-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  opacity: 0.75;
}

.game-name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.game-play {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-play span {
  transition: transform 0.3s var(--ease);
}

.game-card:hover .game-play span,
.game-card:focus-visible .game-play span {
  transform: translateX(4px);
}

.game-card:nth-child(7n + 1) { --accent: #4a90e2; }
.game-card:nth-child(7n + 2) { --accent: #e67e22; }
.game-card:nth-child(7n + 3) { --accent: #27ae60; }
.game-card:nth-child(7n + 4) { --accent: #8e44ad; }
.game-card:nth-child(7n + 5) { --accent: #c0392b; }
.game-card:nth-child(7n + 6) { --accent: #16a085; }
.game-card:nth-child(7n + 7) { --accent: #d4a017; }

.empty {
  padding: 3rem 1rem;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.45);
  color: #444;
  text-align: center;
}

@media (max-width: 640px) {
  .games-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
