/* ============================================================
   Online Brain Games — shared design tokens & site chrome
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@400;600;700;800&family=Press+Start+2P&display=swap');

:root {
  /* --- Palette: light, candy-arcade --- */
  --bg:        #EAF6FF;   /* pale sky blue page background */
  --bg-soft:   #F6FBFF;   /* slightly lighter panel background */
  --surface:   #FFFFFF;   /* card surfaces */
  --ink:       #22314A;   /* main text, dark slate blue */
  --ink-soft:  #5B6B85;   /* secondary text */

  --pink:      #FF6B9D;   /* bubblegum */
  --pink-deep: #E04C82;
  --teal:      #35C4B8;   /* mint arcade */
  --teal-deep: #1FA79C;
  --yellow:    #FFC93D;   /* lemon coin */
  --yellow-deep: #E6A800;
  --purple:    #9B7EDE;   /* grape */
  --purple-deep: #7E5FC4;
  --light-blue: #5FC1EE;  /* soft sky blue, used for the Simon Memory card CTA + blob */
  --light-blue-deep: #3AA8D8;

  /* Classic Simon colors, used only by the Simon Memory game/icon */
  --simon-green:  #2FBF5A;
  --simon-red:    #E6392C;
  --simon-yellow: #F6C51A;
  --simon-blue:   #2E6DF2;

  --line:      #D8E8F5;   /* hairline borders */
  --shadow:    0 8px 0 rgba(34, 49, 74, 0.10);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-score: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background blobs — quiet, decorative, behind everything */
.blob-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.blob-field span {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  filter: blur(2px);
}
.blob-field span:nth-child(1) { width: 220px; height: 220px; left: -60px; top: -40px; background: var(--pink); }
.blob-field span:nth-child(2) { width: 160px; height: 160px; right: -40px; top: 120px; background: var(--yellow); }
.blob-field span:nth-child(3) { width: 260px; height: 260px; right: 10%; bottom: -100px; background: var(--teal); }
.blob-field span:nth-child(4) { width: 140px; height: 140px; left: 8%; bottom: 6%; background: var(--light-blue); }

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  padding: 28px 0 8px;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--ink);
}
.brand .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 18px 0 0 var(--yellow), 36px 0 0 var(--teal);
  margin-right: 22px;
}
.back-link {
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--pink-deep); }

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 36px 0 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin: 0 0 10px;
  letter-spacing: 0.3px;
}
.hero h1 .flip {
  display: inline-block;
  color: var(--pink-deep);
  transform: rotate(-3deg);
}
.hero p {
  color: var(--ink-soft);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto;
  font-weight: 600;
}

/* --- Filters --- */
.filters {
  margin-top: 34px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.filter-row .filter-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.85rem;
  align-self: center;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.pill:hover { transform: translateY(-2px); border-color: var(--pink); color: var(--pink-deep); }
.pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  transform: translateY(-1px);
}
.filter-empty {
  display: none;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 40px 0;
}

/* --- Game grid & cards --- */
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px);
  justify-content: center;
  gap: 22px;
  margin-top: 34px;
  margin-bottom: 60px;
}
@media (min-width: 620px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 300px)); }
}
@media (min-width: 900px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 300px)); }
}

.game-card {
  --card-accent: var(--pink);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.game-card:not(.is-soon):hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 rgba(34, 49, 74, 0.12);
}
.game-card:not(.is-soon):active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(34, 49, 74, 0.12);
}
.game-card .icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--card-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 14px;
  transform: rotate(-4deg);
}
.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 6px;
}
.game-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 16px;
  flex-grow: 1;
}
.game-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.game-card .tags span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
}
.game-card:not(.is-soon):hover .cta {
  filter: brightness(1.15);
}
.game-card .cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--card-accent);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
}
.game-card.is-soon {
  cursor: default;
  opacity: 0.85;
}
.game-card.is-soon .cta {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-color: var(--line);
}
.game-card .ribbon {
  position: absolute;
  top: 16px;
  right: -8px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px 4px 14px;
  border-radius: 6px 0 0 6px;
  letter-spacing: 0.5px;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 30px 0 50px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- Focus visibility --- */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--purple-deep);
  outline-offset: 2px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 560px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .brand .dot { box-shadow: 14px 0 0 var(--yellow), 28px 0 0 var(--teal); margin-right: 18px; }
}
