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

:root {
  color-scheme: light;
  --ink: #2a3a63;
  --outline: #21305e;
  --muted: #5d6f8e;
  --sky: #dcf3ff;
  --sky-deep: #c2e8ff;
  --mint: #c2f0d6;
  --petal: #ffd9ec;
  --sun: #ffe27a;
  --peach: #ffcaa6;
  --lavender: #e0d9ff;
  --white: #fffdf8;
  --cream: #fffaf0;
  --blue: #4f82d8;
  --blue-dark: #28407e;
  --line: rgba(33, 48, 94, 0.16);
  --shadow: 0 16px 34px rgba(70, 94, 129, 0.20);
  --shadow-sm: 0 8px 18px rgba(70, 94, 129, 0.16);
  --pop: 0 6px 0 rgba(33, 48, 94, 0.16);
  --r-lg: 28px;
  --r-md: 22px;
  --r-sm: 16px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--sky);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 12% -8%, rgba(255, 226, 122, 0.30), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(255, 217, 236, 0.42), transparent 60%),
    linear-gradient(180deg, var(--sky) 0%, var(--cream) 44%, var(--mint) 100%);
  background-attachment: fixed;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3, .brand, .button, .nav-links a, .eyebrow, .game-status {
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
}

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

.sky-decor .deco {
  position: absolute;
  will-change: transform;
  animation: floaty 7s ease-in-out infinite;
}

.sky-decor .deco.twinkle { animation: twinkle 4.5s ease-in-out infinite; }

body > header,
body > main,
body > footer { position: relative; z-index: 1; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(3deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-9px) rotate(2deg); }
}
@keyframes pop-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 54px);
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue-dark);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 3px solid var(--outline);
  border-radius: 50%;
  padding: 2px;
  background: var(--white);
  object-fit: cover;
  box-shadow: var(--pop);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 2px solid transparent;
  color: var(--blue-dark);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--sun);
  border-color: var(--outline);
  transform: translateY(-2px);
  outline: none;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 3px solid var(--outline);
  color: var(--blue-dark);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--sun);
  box-shadow: var(--pop);
  font-family: "Fredoka", system-ui, sans-serif;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px);
  background: #ffec97;
  box-shadow: 0 10px 0 rgba(33, 48, 94, 0.16);
  outline: none;
}

.button:active { transform: translateY(1px); box-shadow: 0 3px 0 rgba(33, 48, 94, 0.16); }

.button.secondary {
  background: var(--white);
  color: var(--blue-dark);
}
.button.secondary:hover,
.button.secondary:focus-visible { background: #eaf7ff; }

.button.small {
  min-height: 42px;
  padding: 9px 16px;
  font-size: 0.96rem;
}

.hero {
  position: relative;
  min-height: min(82svh, 720px);
  display: grid;
  place-items: center;
  padding: clamp(36px, 7vw, 80px) clamp(18px, 5vw, 70px);
  overflow: hidden;
  border-bottom: 2px solid var(--line);
}

.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-scene svg { width: 100%; height: 100%; display: block; }

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  padding: clamp(26px, 4vw, 44px);
  text-align: center;
  background: rgba(255, 253, 248, 0.86);
  border: 3px solid var(--outline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
  animation: pop-in 600ms ease both;
}

.hero-mascot {
  width: clamp(96px, 16vw, 132px);
  height: clamp(96px, 16vw, 132px);
  margin: 0 auto 14px;
  border: 4px solid var(--outline);
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--pop);
  animation: bob 4s ease-in-out infinite;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 16px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--petal);
  color: var(--blue-dark);
  font-size: clamp(0.82rem, 2vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 14px;
  color: var(--blue-dark);
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.hero-copy {
  max-width: 48ch;
  margin: 0 auto 18px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  line-height: 1.5;
  font-weight: 600;
}

.play-note {
  max-width: 52ch;
  margin: 0 auto 22px;
  padding: 10px 16px;
  border: 2px dashed var(--blue);
  border-radius: var(--r-sm);
  background: rgba(220, 243, 255, 0.7);
  color: var(--blue-dark);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
}

.hero-actions,
.page-actions,
.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.section { padding: clamp(36px, 6vw, 74px) clamp(18px, 5vw, 70px); }

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.section-title h2,
.page-title h1 {
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
}

.section-title p,
.page-title p {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  font-weight: 600;
}

.soft-band {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 217, 236, 0.6), rgba(255, 226, 122, 0.42) 48%, rgba(194, 240, 214, 0.6));
  border-block: 2px solid var(--line);
}

.eyebrow.inline {
  background: var(--lavender);
}

.about-card {
  padding: clamp(26px, 5vw, 46px);
  border: 3px solid var(--outline);
  border-radius: var(--r-lg);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.about-card .eyebrow { background: var(--sun); }

.about-card h2 {
  margin-bottom: 14px;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.about-card p:not(.eyebrow) {
  max-width: 76ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.about-card .button { margin-top: 10px; }

.about-title h1 { max-width: 12ch; }
.about-title .page-actions { margin-top: 22px; justify-content: flex-start; }
.page-title .eyebrow { background: var(--mint); }

.about-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(22px, 5vw, 42px);
  align-items: start;
}

.about-story h2 {
  margin-bottom: 14px;
  color: var(--blue-dark);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.about-story p:not(.eyebrow) {
  max-width: 72ch;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.6;
}

.about-favorites,
.about-steps article {
  border: 3px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--cream);
  box-shadow: var(--shadow-sm);
}

.about-favorites { padding: 24px; }

.about-favorites h3,
.about-steps h3 {
  margin-bottom: 14px;
  color: var(--blue-dark);
  font-size: 1.4rem;
  line-height: 1.15;
}

.about-favorites ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
  list-style: none;
}

.about-favorites li {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: start;
}

.about-favorites span { font-size: 1.5rem; line-height: 1; }

.about-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.about-steps article { padding: 24px; }

.about-steps article:nth-child(1) { background: var(--petal); }
.about-steps article:nth-child(2) { background: var(--sky); }
.about-steps article:nth-child(3) { background: var(--mint); }

.about-steps p {
  margin-bottom: 0;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 600;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}

.game-card {
  overflow: hidden;
  border: 3px solid var(--outline);
  border-radius: var(--r-lg);
  background: var(--cream);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 22px 40px rgba(70, 94, 129, 0.26);
}

.game-card > a:first-child {
  display: block;
  border-bottom: 3px solid var(--outline);
}

.game-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--sky);
}

.game-card-body { padding: 20px; }

.game-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.game-emoji {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7bd, #ffd9ec 55%, #e0d9ff);
  font-size: 1.9rem;
  box-shadow: var(--pop);
}

.game-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--mint);
  color: #1d5b3e;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.game-kicker {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 700;
}

.game-card h3 {
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 1.45rem;
  line-height: 1.15;
}

.game-card p {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.tag-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--lavender);
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.tag-row span:nth-child(3n+1) { background: var(--petal); }
.tag-row span:nth-child(3n+2) { background: var(--sky); }

.page-title {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 66px) clamp(18px, 5vw, 70px) 24px;
}

.game-shell { padding: clamp(18px, 4vw, 42px); }

.game-topbar {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.game-title h1 {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1;
}

.game-title p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.game-frame-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid var(--outline);
  border-radius: var(--r-lg);
  background: #9ed7f4;
  box-shadow: var(--shadow);
}

.game-frame {
  display: block;
  width: 100%;
  height: min(76svh, 760px);
  min-height: 560px;
  border: 0;
  background: #bfe0f5;
}

.note {
  width: min(1180px, 100%);
  margin: 16px auto 0;
  padding: 12px 16px;
  border: 2px dashed var(--blue);
  border-radius: var(--r-sm);
  background: rgba(220, 243, 255, 0.6);
  color: var(--blue-dark);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.45;
}

.site-footer {
  padding: 28px clamp(18px, 5vw, 70px);
  color: var(--muted);
  background: rgba(255, 253, 248, 0.82);
  border-top: 2px solid var(--line);
  font-size: 0.96rem;
  font-weight: 700;
}

.site-footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 30px;
  border: 3px dashed var(--blue);
  border-radius: var(--r-md);
  background: rgba(255, 253, 248, 0.86);
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }
  .nav-links { justify-content: flex-start; }
  .hero { min-height: auto; }
  .section-title,
  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .about-story,
  .about-steps { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .hero-actions,
  .page-actions,
  .game-actions { width: 100%; }
  .about-title .page-actions { justify-content: stretch; }
  .game-frame { height: 72svh; min-height: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  .sky-decor .deco,
  .hero-mascot,
  .hero-inner { animation: none !important; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
