:root {
  --paper: #F2F5F8;
  --grid: #DCE3EB;
  --ink: #1B2340;
  --muted: #566080;

  --blue: #3B6BFF;
  --violet: #7B5CFF;
  --mint: #3DDC97;
  --sun: #FFC933;
  --pink: #FF6FA5;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  background-color: var(--paper);
  /* Клетчатое поле, как в агаре */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

h1 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 72px;
  max-width: 36rem;
  font-size: 1.25rem;
  color: var(--muted);
}

/* Список игр */
.games {
  display: flex;
  flex-wrap: wrap;
  gap: 56px 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game {
  width: min(240px, 100%);
}

/* Клетка игры */
.cell {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 32px;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
  /* Чуть неровный круг, чтобы клетка выглядела живой */
  border-radius: 52% 48% 50% 50% / 50% 52% 48% 50%;
  transition:
    transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1),
    border-radius 0.6s ease;
}

a.cell:hover {
  transform: scale(1.06);
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
}

a.cell:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 6px;
}

.cell--blue   { background: var(--blue);   color: #fff; }
.cell--violet { background: var(--violet); color: #fff; }
.cell--mint   { background: var(--mint);   color: var(--ink); }
.cell--sun    { background: var(--sun);    color: var(--ink); }
.cell--pink   { background: var(--pink);   color: var(--ink); }

/* Свободное место под следующую игру */
.cell--empty {
  background: transparent;
  border: 2px dashed var(--muted);
  color: var(--muted);
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
}

.game-desc {
  margin: 20px 0 6px;
  font-size: 1rem;
}

.game-tag {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .cell { transition: none; }
  a.cell:hover { transform: none; }
}
