/* ---------- Games Hub — theme ----------
   Bridges the two game palettes:
   warm cream + red/teal/yellow (tic-tac-toe) and sky blue (guess-the-number) */

:root {
  --bg: #fdf3e3;
  --ink: #2b2d42;
  --muted-ink: #5a5d73;
  --card: #ffffff;
  --blue: #4aa8ff;
  --yellow: #ffd93d;
  --amber: #f5a201;
  --red: #ff6b6b;
  --teal: #4ecdc4;
  --shadow: 0 12px 28px rgba(43, 45, 66, 0.14);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% 8%, rgba(74, 168, 255, 0.22), transparent 40%),
    radial-gradient(circle at 92% 12%, rgba(255, 217, 61, 0.30), transparent 38%),
    radial-gradient(circle at 88% 92%, rgba(78, 205, 196, 0.20), transparent 42%),
    radial-gradient(circle at 8% 90%, rgba(255, 107, 107, 0.14), transparent 38%),
    var(--bg);
  overflow-x: hidden;
}

/* ---------- Floating background scene ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  animation: float-drift 11s ease-in-out infinite;
}

.shape-1 {
  width: 110px;
  height: 110px;
  top: 16%;
  inset-inline-start: -35px;
  background: rgba(74, 168, 255, 0.25);
}

.shape-2 {
  width: 70px;
  height: 70px;
  bottom: 18%;
  inset-inline-end: 6%;
  background: rgba(255, 217, 61, 0.45);
  animation-delay: -4s;
}

.shape-3 {
  width: 46px;
  height: 46px;
  top: 34%;
  inset-inline-end: 14%;
  background: rgba(78, 205, 196, 0.35);
  animation-delay: -7s;
}

.shape-4 {
  width: 26px;
  height: 26px;
  bottom: 30%;
  inset-inline-start: 12%;
  background: rgba(255, 107, 107, 0.35);
  animation-delay: -2s;
}

.float-emoji {
  position: absolute;
  font-size: 1.6rem;
  opacity: 0.75;
  animation: float-drift 13s ease-in-out infinite;
}

.float-1 { top: 22%; inset-inline-start: 9%; }
.float-2 { top: 60%; inset-inline-end: 8%; animation-delay: -5s; }
.float-3 { bottom: 12%; inset-inline-start: 20%; animation-delay: -9s; }

@keyframes float-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(36px, 7vw, 72px) 20px 12px;
}

.logo {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -1px;
  user-select: none;
}

.logo-games { color: var(--blue); }
.logo-hub   { color: var(--amber); margin-inline-start: 0.15em; }

.tagline {
  margin-top: 6px;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  font-weight: 600;
  color: var(--muted-ink);
}

/* ---------- Games grid ---------- */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease;
}

.game-card:hover {
  transform: translateY(-7px) rotate(-0.6deg);
  box-shadow: 0 20px 38px rgba(43, 45, 66, 0.20);
}

.thumb {
  height: 150px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 16%, #ffffff), #ffffff);
  overflow: hidden;
}

.thumb img {
  max-width: 82%;
  max-height: 82%;
  object-fit: contain;
  transition: transform 0.35s var(--spring);
}

.game-card:hover .thumb img {
  transform: scale(1.08) rotate(2deg);
}

.card-title {
  font-size: 1.45rem;
  font-weight: 800;
}

.card-description {
  flex: 1;
  color: var(--muted-ink);
  font-weight: 600;
  line-height: 1.65;
}

.play-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 0.55em 1.2em;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform 0.25s var(--spring), filter 0.25s ease;
}

.play-btn:hover,
.play-btn:focus-visible {
  transform: scale(1.05);
  filter: brightness(0.94);
}

.play-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 20px 26px;
  font-weight: 600;
  color: var(--muted-ink);
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Small screens & motion preferences ---------- */

@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shape,
  .float-emoji {
    animation: none;
  }

  .game-card,
  .thumb img,
  .play-btn {
    transition: none;
  }
}
