/* Self-hosted fonts (SIL Open Font License, see fonts/LICENSE.txt) */
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("../fonts/quicksand.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }

/* Home page styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif;
  background: #ffffff; color: #1d2a3d; line-height: 1.6;
}
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

header { padding: 20px 0; }
header .wrap { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 26px; font-weight: 900; text-decoration: none; display: inline-flex; align-items: center; }
.logo img { height: 42px; width: auto; display: block; }
.hero-wrap .logo img { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 4px 10px rgba(20,10,60,.35)); }
.logo span { color: #ff5d73; }
nav a { margin-left: 20px; text-decoration: none; font-weight: 700; opacity: .75; }
nav a:hover { opacity: 1; }

.hero { text-align: center; padding: 60px 0 40px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; font-weight: 900; }
.hero h1 em { font-style: normal; color: #ff8c42; }
.hero p { font-size: 20px; max-width: 620px; margin: 18px auto 30px; opacity: .8; }
.btn {
  display: inline-block; font-size: 22px; font-weight: 800; text-decoration: none;
  padding: 16px 40px; border-radius: 999px; background: #ffb43b; color: #0b1d33;
  box-shadow: 0 6px 0 #c97f0b; transition: transform .1s;
}
.btn:hover { transform: translateY(-2px); }
.note { margin-top: 14px; font-size: 15px; opacity: .6; }

.parents { background: #0b1d33; color: #fff; padding: 60px 0; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tip { background: rgba(255,255,255,.07); border-radius: 20px; padding: 22px; }
.tip b { display: block; font-size: 19px; margin-bottom: 6px; color: #ffe066; }

footer { text-align: center; padding: 30px 0; font-size: 14px; opacity: .6; }

/* ---------- Sunset meadow hero ---------- */
.hero-wrap {
  position: relative; overflow: hidden; min-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(#2d3a8c 0%, #c86fa3 52%, #ffb27a 66%, #3f8f3a 66.2%, #2f6a30 100%);
  color: #fff;
}
#meadow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(20,24,70,.35), rgba(20,24,70,0) 45%),
    radial-gradient(ellipse 70% 45% at 50% 38%, rgba(20,16,60,.28), rgba(20,16,60,0) 70%); }
.hero-wrap header, .hero-wrap .hero { position: relative; z-index: 2; }
.hero-wrap header { pointer-events: none; } .hero-wrap header a { pointer-events: auto; }
.hero-wrap .logo span { color: #ffd23f; }
.hero-wrap nav a { opacity: .9; color: #fff; }
.hero-wrap .hero { padding: 7vh 0 0; pointer-events: none; }
.hero-wrap .hero .btn { pointer-events: auto; }
.hero-wrap .hero h1 { text-shadow: 0 3px 18px rgba(30,20,80,.45); }
.hero-wrap .hero h1 em { color: #ffd23f; }
.hero-wrap .hero p { opacity: 1; font-weight: 500; text-shadow: 0 1px 2px rgba(20,12,60,.7), 0 2px 14px rgba(20,12,60,.65); }
.hero-wrap .note { opacity: 1; margin-top: 16px; }
.hero-wrap .note span { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 15px; font-weight: 600;
  color: #fff; background: rgba(28,20,64,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(20,10,50,.25); letter-spacing: .01em; }
nav { white-space: nowrap; }
@media (max-width: 520px) {
  header .wrap { gap: 10px; }
  .logo { font-size: 22px; }
  .logo img { height: 28px; }
  nav a { margin-left: 12px; font-size: 14px; }
  .hero-wrap .hero { padding-top: 4vh; }
}
@media (max-width: 360px) { nav a { margin-left: 9px; font-size: 13px; } .logo img { height: 24px; } }
/* Phones held sideways: short screen, so tighten the hero */
@media (orientation: landscape) and (max-height: 500px) {
  header { padding: 10px 0; }
  .logo img { height: 30px; }
  .hero-wrap { min-height: 100vh; }
  .hero-wrap .hero { padding-top: 1vh; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15px; margin: 8px auto 14px; max-width: 560px; }
  .hero-wrap .note { margin-top: 10px; }
  .hero-wrap .note span { font-size: 13px; padding: 4px 12px; }
  .btn { padding: 12px 26px; font-size: 17px; }
}

/* ---------- Pick a game ---------- */
.pg {
  position: relative; overflow: hidden; padding: 56px 0 72px;
  font-family: "Quicksand", "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #1e293b;
  background-color: #f7f9fd;
  background-image: radial-gradient(#e0e7ff 1.2px, transparent 1.2px), radial-gradient(#fed7aa 1.2px, transparent 1.2px);
  background-size: 48px 48px; background-position: 0 0, 24px 24px;
}
.pg-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; position: relative; }
@media (min-width: 640px) { .pg-inner { padding: 0 24px; } }
@media (min-width: 1024px) { .pg-inner { padding: 0 32px; } }
.pg h2, .pg h3 { font-family: "Fredoka", "Nunito", "Trebuchet MS", system-ui, sans-serif; }
.pg-head { text-align: center; max-width: 820px; margin: 0 auto 40px; }
.pg-head h2 { font-size: clamp(36px, 5vw, 48px); font-weight: 700; letter-spacing: -0.02em; color: #1e293b; margin-bottom: 8px;
  text-shadow: 0 1px 1px rgba(0,0,0,.05); }
.pg-head p { color: #475569; font-weight: 500; font-size: clamp(16px, 1.6vw, 18px); }
.pg-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.pg-chip {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 16px; border-radius: 999px;
  background: #fff; color: #475569; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: border-color .15s, color .15s, background .15s;
}
.pg-chip:hover { border-color: #cbd5e1; color: #0f172a; }
.pg-chip.on { background: #0f172a; color: #fff; border-color: #0f172a; font-weight: 700; }

.pg-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: stretch; }
@media (min-width: 640px) { .pg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pg-grid { grid-template-columns: repeat(4, 1fr); gap: 28px; } }

.pg-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  border-radius: 28px; padding: 28px; color: #fff; text-decoration: none;
  background: linear-gradient(to bottom, var(--from), var(--to));
  box-shadow: 0 12px 30px -4px rgba(0,0,0,.08), 0 4px 12px -2px rgba(0,0,0,.05);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease;
}
.pg-card[hidden] { display: none; }
@media (hover: hover) { .pg-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 22px 38px -6px rgba(0,0,0,.16), 0 10px 20px -3px rgba(0,0,0,.08); } }
.pg-card:active { transform: translateY(-2px) scale(.99); }
.pg-card:focus-visible { outline: 4px solid #fbbf24; outline-offset: 4px; }
.pg-glow { position: absolute; right: -32px; top: -32px; width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255,255,255,.15); filter: blur(24px); pointer-events: none; transition: transform .5s; }
@media (hover: hover) { .pg-card:hover .pg-glow { transform: scale(1.25); } }

.pg-icon { width: 64px; height: 64px; margin: 8px 0 24px; border-radius: 16px; background: rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: center; transition: transform .2s; }
@media (hover: hover) { .pg-card:hover .pg-icon { transform: scale(1.1); } }
.pg-emoji { font-size: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.pg-piano { position: relative; display: flex; width: 48px; height: 40px; background: #fff; border-radius: 6px; overflow: hidden;
  border: 1px solid #cbd5e1; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pg-piano i { flex: 1; border-right: 1px solid #e2e8f0; } .pg-piano i:last-of-type { border-right: 0; }
.pg-piano b { position: absolute; top: 0; width: 8px; height: 20px; background: #0f172a; border-radius: 0 0 2px 2px; }

.pg-card h3 { font-size: 24px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; transition: transform .2s; }
@media (hover: hover) { .pg-card:hover h3 { transform: translateX(4px); } }
.pg-card p { color: rgba(255,255,255,.9); font-size: 14px; font-weight: 500; line-height: 1.65; }

.pg-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: space-between; }
.pg-age { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; background: rgba(255,255,255,.2); }
.pg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.pg-dot.pulse { animation: pgPulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pgPulse { 50% { opacity: .5; } }
.pg-play { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.pg-play svg { width: 12px; height: 12px; margin-left: 2px; fill: currentColor; }
@media (hover: hover) { .pg-card:hover .pg-play { background: #fff; color: var(--play); } }

.pg-doodle { position: absolute; pointer-events: none; animation: pgFloat 6s ease-in-out infinite; }
.pg-doodle.d1 { top: 18px; left: 24px; width: 64px; fill: #bae6fd; opacity: .7; }
.pg-doodle.d2 { top: 60px; right: 48px; width: 40px; fill: #fde68a; opacity: .75; animation-duration: 7s; animation-delay: 1.5s; }
.pg-doodle.d3 { bottom: 28px; left: 64px; width: 30px; fill: #fbcfe8; opacity: .6; }
@keyframes pgFloat { 50% { transform: translateY(-8px) rotate(4deg); } }
/* Phones: compact cards (two per row upright, three when sideways) */
@media (max-width: 639px), (orientation: landscape) and (max-height: 500px) {
  .pg { padding: 40px 0 56px; }
  .pg-head { margin-bottom: 24px; }
  .pg-filters { gap: 6px; }
  .pg-chip { font-size: 13px; padding: 6px 12px; }
  .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pg-card { border-radius: 20px; padding: 14px; }
  .pg-card:hover { transform: none; }
  .pg-card:active { transform: scale(.97); }
  .pg-icon { width: 46px; height: 46px; margin: 0 0 10px; border-radius: 13px; }
  .pg-emoji { font-size: 24px; }
  .pg-piano { width: 34px; height: 28px; border-radius: 4px; }
  .pg-piano b { width: 6px; height: 14px; }
  .pg-card h3 { font-size: 17px; line-height: 1.2; margin-bottom: 0; }
  .pg-card:hover h3 { transform: none; }
  .pg-card p { display: none; }
  .pg-foot { margin-top: 12px; padding-top: 10px; }
  .pg-age { font-size: 11px; padding: 3px 9px; gap: 5px; }
  .pg-play { width: 26px; height: 26px; }
  .pg-play svg { width: 10px; height: 10px; }
  .pg-glow { width: 90px; height: 90px; }
  .pg-doodle { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pg-doodle, .pg-dot.pulse { animation: none; } .pg-card, .pg-card * { transition: none !important; } }

/* Smooth jump to "Pick a game" */
html { scroll-behavior: smooth; }
#games { scroll-margin-top: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- About / Privacy pages ---------- */
.page { background: #f7f9fd; font-family: "Quicksand", "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #1e293b; }
.page header { background: #fff; border-bottom: 1px solid #e2e8f0; }
.page nav a[aria-current="page"] { opacity: 1; color: #7064f8; }
.doc { max-width: 760px; margin: 0 auto; padding: 44px 24px 72px; }
.doc h1, .doc h2 { font-family: "Fredoka", "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #1e293b; }
.doc h1 { font-size: clamp(36px, 6vw, 48px); line-height: 1.1; margin-bottom: 14px; }
.doc h2 { font-size: 24px; margin: 36px 0 10px; }
.doc p, .doc li { font-size: 17px; line-height: 1.7; color: #334155; font-weight: 500; }
.doc .lead { font-size: 20px; }
.doc .small { font-size: 14px; color: #64748b; }
.doc ul { padding-left: 22px; margin: 8px 0; }
.doc li { margin-bottom: 8px; }
.doc b { color: #1e293b; }
.doc a, footer a, .tip a { color: #5c4ee5; font-weight: 700; }
.tip a { color: #ffe066; }
.callout { background: #eef2ff; border: 2px solid #c7d2fe; border-radius: 20px; padding: 18px 22px; margin: 22px 0 6px;
  font-size: 17px; line-height: 1.7; color: #334155; font-weight: 500; }
.callout b { display: block; font-family: "Fredoka", "Nunito", sans-serif; font-size: 19px; margin-bottom: 4px; color: #3730a3; }
.age-table { display: grid; gap: 10px; margin: 12px 0; }
.age-table div { background: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: grid; grid-template-columns: 150px 1fr; gap: 12px; font-size: 16px; }
.age-table b { color: #5c4ee5; }
@media (max-width: 520px) { .age-table div { grid-template-columns: 1fr; gap: 2px; } }
footer { line-height: 1.9; }

/* Illustrated game icons */
.pg-icon.pg-art { width: 80px; height: 80px; margin: 0 0 16px; background: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.pg-art img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.22)); }
@media (max-width: 639px), (orientation: landscape) and (max-height: 500px) { .pg-icon.pg-art { width: 54px; height: 54px; margin: -4px 0 6px -4px; } }
@media (orientation: landscape) and (max-height: 500px) { .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* About page logo */
.about-logo { display: block; box-sizing: border-box; width: min(320px, 72%); height: auto; padding: 16px; margin: 0 auto 8px; border-radius: 28px;
  background: #fff; box-shadow: 0 10px 30px -8px rgba(30,41,59,.18); }
