:root {
  --bg: #fffaf0;
  --bg-dot: #f0e4cc;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #526071;
  --border: #e6dcc8;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
  --radius: 22px;
  --shadow: 0 6px 0 #e6dcc8, 0 14px 28px rgba(30, 41, 59, 0.08);
  --shadow-hover: 0 10px 0 #dfd2b8, 0 22px 36px rgba(30, 41, 59, 0.13);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  font-family: "Nunito", "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) 20px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 44px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid var(--border);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 14px;
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.25rem, 6vw, 3.4rem);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero p {
  margin: 0 auto;
  max-width: 460px;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--muted);
  font-weight: 600;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 26px;
  flex: 1;
  align-content: start;
}

.game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
  outline: none;
}

.game-card:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #e6dcc8, 0 8px 16px rgba(30, 41, 59, 0.08);
}

.game-card:focus-visible {
  outline: 4px solid rgba(14, 165, 233, 0.45);
  outline-offset: 3px;
}

.card-art {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2.5px solid var(--border);
}

.card-art--mastermind {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.card-art--trios {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
}

.card-art--default {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
}

.card-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
}

.pill--category {
  background: #e0f2fe;
  color: #0369a1;
}

.card-title {
  margin: 2px 0 0;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.card-tagline {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.48;
  color: var(--muted);
  font-weight: 600;
  flex: 1;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 0 var(--accent-dark);
  transition: background-color 0.14s ease;
}

.game-card:hover .play-btn,
.game-card:focus-visible .play-btn {
  background: #0284c7;
}

.game-card--trios .play-btn {
  background: #16a34a;
  box-shadow: 0 4px 0 #15803d;
}

.game-card--trios:hover .play-btn,
.game-card--trios:focus-visible .play-btn {
  background: #15803d;
}

.game-card--mastermind .play-btn {
  background: #f97316;
  box-shadow: 0 4px 0 #c2410c;
}

.game-card--mastermind:hover .play-btn,
.game-card--mastermind:focus-visible .play-btn {
  background: #ea580c;
}

.footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px dashed var(--border);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.footer a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .page {
    padding: 20px 16px 36px;
  }

  .card-art {
    height: 150px;
  }

  .card-body {
    padding: 18px;
  }
}
