/*
Theme Name: Napzoo
Theme URI: https://napzoo.com
Author: Napzoo
Description: A calm night-sky theme for Napzoo, the bedtime playground parents share with their children. The homepage shows a tucked-in moon, age filters and a grid of game tiles. Each game is its own plugin (Napzoo – Bedtime Quest, Story Spinner and so on) that adds a tile here automatically.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: napzoo
Tags: one-column, custom-menu, dark, kids, entertainment
*/

:root {
  /* One night-sky world. Moonlight cream is the single bold accent. */
  --sky: #13143a;
  --sky-2: #1d1f52;
  --sky-3: #2a2d6b;
  --moon: #f7e6ad;
  --ink: #eeedff;
  --muted: #aeacdc;
  --peach: #ffb894;
  --mint: #93e2cf;
  --lilac: #bba9ff;
  --rose: #ff9fb8;
  --display: "Gluten", "Comic Sans MS", "Chalkboard SE", cursive;
  --body: "Atkinson Hyperlegible", "Verdana", system-ui, sans-serif;
  --radius: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
#nz-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nz-wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; }
a { color: var(--moon); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--moon); outline-offset: 3px; border-radius: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* Header */
.nz-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 12px; flex-wrap: wrap; }
.nz-brand { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--moon); text-decoration: none; }
.nz-top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nz-menu { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nz-menu a { color: var(--ink); text-decoration: none; font-size: 15px; }
.nz-menu a:hover { color: var(--moon); }
.nz-pill {
  background: rgba(255,255,255,.07); color: var(--ink); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 8px 16px; font-size: 15px; cursor: pointer; text-decoration: none;
}
.nz-pill:hover { background: rgba(255,255,255,.14); }
.nz-tuck { color: var(--muted); font-size: 15px; }
.nz-tuck b { color: var(--moon); font-variant-numeric: tabular-nums; }

/* Hero */
.nz-hero { display: grid; justify-items: center; text-align: center; padding: 10px 0 26px; gap: 6px; }
.nz-moon-wrap { position: relative; }
.nz-moon { background: none; border: 0; padding: 0; cursor: pointer; width: 150px; height: 150px; }
.nz-moon svg { width: 100%; height: 100%; overflow: visible; transition: transform .5s ease; }
.nz-moon:hover svg { transform: rotate(-6deg) scale(1.04); }
.nz-moon .lid { transition: transform .35s ease; transform-origin: center; transform-box: fill-box; transform: scaleY(0); }
.nz-moon.sleepy .lid { transform: scaleY(1); }
.nz-moon .blanket { transition: transform .6s cubic-bezier(.3,1.4,.6,1); transform: translateY(70px); }
.nz-moon.sleepy .blanket { transform: translateY(0); }
.nz-zzz { position: absolute; font-family: var(--display); color: var(--moon); pointer-events: none; animation: nzfloat 2.2s ease-out forwards; font-size: 26px; }
@keyframes nzfloat { from { opacity: 1; transform: translate(0,0) scale(.8); } to { opacity: 0; transform: translate(40px,-80px) scale(1.4); } }
.nz-title {
  font-family: var(--display); font-weight: 800; font-size: clamp(54px, 10vw, 92px);
  line-height: .95; margin: 4px 0 0; letter-spacing: -1px; color: var(--moon);
  text-shadow: 0 0 40px rgba(247,230,173,.35);
}
.nz-tag { font-size: clamp(18px, 2.6vw, 22px); margin: 6px 0 0; max-width: 34ch; text-wrap: balance; }
.nz-hint { color: var(--muted); font-size: 14px; margin: 0; }

/* Filters */
.nz-filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 26px; }
.nz-chip {
  border: 1.5px solid rgba(255,255,255,.2); background: transparent; color: var(--ink);
  padding: 7px 15px; border-radius: 999px; cursor: pointer; font-size: 15px;
}
.nz-chip[aria-pressed="true"] { background: var(--moon); color: var(--sky); border-color: var(--moon); font-weight: 700; }

/* Grid */
.nz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.nz-tile {
  display: grid; grid-template-rows: auto 1fr; text-decoration: none;
  background: var(--sky-2); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); transition: transform .25s ease, box-shadow .25s ease;
}
a.nz-tile:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 14px 40px rgba(0,0,0,.35), 0 0 0 2px var(--tc); }
.nz-tile.is-off { opacity: .55; }
.nz-tile .art { background: var(--tc); aspect-ratio: 16 / 10; display: grid; place-items: center; }
.nz-tile .art svg { width: 78%; height: 78%; }
.nz-tile .meta { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.nz-tile h2 { font-family: var(--display); font-weight: 700; font-size: 23px; line-height: 1.1; margin: 0; }
.nz-tile p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.nz-ages { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.nz-age { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); }
.nz-age.together { background: rgba(255,184,148,.18); color: var(--peach); }
.nz-tile[hidden] { display: none; }
.nz-empty { text-align: center; color: var(--muted); border: 2px dashed rgba(255,255,255,.18); border-radius: var(--radius); padding: 40px 20px; }

/* Footer */
.nz-foot { margin-top: 56px; display: grid; gap: 10px; justify-items: center; text-align: center; color: var(--muted); font-size: 15px; }
.nz-foot p { margin: 0; max-width: 60ch; }
.nz-foot .sig { font-family: var(--display); color: var(--moon); font-size: 22px; }

/* Game and normal pages */
.nz-page { max-width: 820px; margin: 0 auto; }
.nz-back { display: inline-block; background: rgba(255,255,255,.08); color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 15px; text-decoration: none; }
.nz-back:hover { background: rgba(255,255,255,.16); }
.nz-page-title { font-family: var(--display); font-weight: 800; color: var(--moon); font-size: clamp(34px, 6vw, 50px); line-height: 1; margin: 18px 0 8px; text-wrap: balance; }
.nz-content { font-size: 18px; }
.nz-content h2, .nz-content h3 { font-family: var(--display); color: var(--moon); line-height: 1.15; }
.nz-content p, .nz-content li { max-width: 65ch; }
.nz-post-list { display: grid; gap: 18px; }
.nz-post-list article { background: var(--sky-2); border-radius: var(--radius); padding: 20px 22px; }

/* Dim overlay */
#nz-dimmer { position: fixed; inset: 0; background: rgba(5,5,20,.45); pointer-events: none; z-index: 9999; opacity: 0; transition: opacity .8s; }
body.nz-dim #nz-dimmer { opacity: 1; }

@media (max-width: 480px) {
  .nz-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .nz-tile h2 { font-size: 18px; }
  .nz-tile p { display: none; }
  .nz-tile .meta { padding: 10px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
