/* ============================================================
   MINI ARCADE — STYLES
   Palette reference (edit here to re-theme the whole site):
   ============================================================ */
:root {
  --navy: #2C3E6B;
  --navy-dark: #223257;
  --coral: #E8536A;
  --coral-dark: #d63d54;
  --teal: #1A8A86;
  --teal-dark: #146e6b;
  --sky: #EAF3FB;
  --cream: #FFF9F2;
  --white: #FFFFFF;
  --ink: #2A2A3B;
  --ink-soft: #5B6178;

  --font-display: 'Baloo 2', 'Fredoka', sans-serif;
  --font-body: 'Inter', 'Nunito Sans', sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;

  --shadow-soft: 0 10px 30px rgba(44, 62, 107, 0.12);
  --shadow-lift: 0 18px 40px rgba(44, 62, 107, 0.2);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--navy);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover, .btn:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-lift);
}

.btn-coral { background: var(--coral); color: var(--white); }
.btn-coral:hover { background: var(--coral-dark); }

.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-dark); }

.btn-sm { padding: 10px 22px; font-size: 0.9rem; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--white);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  height: 40px;
  width: auto;
  /* source logo is navy/teal on transparent — a light chip keeps it
     legible against the navy header */
  background: var(--white);
  border-radius: 10px;
  padding: 4px 6px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

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

.nav-links a {
  color: var(--white);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition: background 180ms ease, transform 180ms ease;
  font-size: 0.95rem;
  /* without this the two longest labels break across two lines once the
     nav gets tight, which reads as a broken second row rather than a nav */
  white-space: nowrap;
}

.nav-links a:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }

.nav-cta {
  background: var(--coral);
  color: var(--white) !important;
}
.nav-cta:hover { background: var(--coral-dark) !important; }

/* Leaves the hub for the parent KidSafeHQ site. Deliberately a plain text
   link, not a second coral pill — "Start Playing" is the primary action here
   and two filled buttons side by side would let the exit outweigh it. */
.nav-back {
  opacity: 0.82;
  margin-right: 4px;
}
.nav-back:hover, .nav-back:focus-visible { opacity: 1; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  overflow: hidden;
  padding: 100px 0 130px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
}

.hero-eyebrow {
  color: #ffd7de;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 20px;
}

.hero p {
  color: #cfd8ee;
  font-size: 1.05rem;
  max-width: 56ch;
  margin-bottom: 18px;
}

.hero p + a {
  margin-top: 14px;
}

.hero-graphic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}

.blob {
  position: absolute;
  border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
  filter: blur(0px);
  opacity: 0.9;
}

.blob-coral { background: var(--coral); width: 260px; height: 240px; top: -10px; right: 10px; opacity: 0.85; }
.blob-teal { background: var(--teal); width: 200px; height: 190px; bottom: -20px; left: -10px; opacity: 0.75; }

.hero-photo-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 6px solid var(--white);
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* decorative floating badges echoing the reference site's "24/7" chips */
.floating-chip {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  box-shadow: var(--shadow-soft);
  z-index: 3;
}
.chip-1 { top: -10px; left: 0; }
.chip-2 { bottom: 10px; right: -10px; }

/* ============================================================
   GAMES GRID
   ============================================================ */
.games-section {
  padding: 90px 0 100px;
  background: var(--white);
}

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 14px;
}

.section-heading p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Age-group filter ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.filter-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--sky);
  color: var(--navy);
  border: 2px solid transparent;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.filter-btn:hover, .filter-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--coral);
}

.filter-btn.is-active {
  background: var(--coral);
  color: var(--white);
}

.filter-empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
  padding: 28px 0 4px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.game-card[hidden] { display: none; }

.game-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 200ms ease, box-shadow 200ms ease;
  border: 1px solid rgba(44, 62, 107, 0.06);
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lift);
}

.thumb-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: var(--shadow-soft);
}

.thumb-ring.ring-coral { background: var(--coral); }
.thumb-ring.ring-teal { background: var(--teal); }
.thumb-ring.ring-navy { background: var(--navy); }

.thumb-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  overflow: hidden;
}

.thumb-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.game-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.game-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 22px;
  min-height: 44px;
}

.age-tag {
  font-size: 0.78rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal) !important;
  min-height: 0 !important;
  margin-bottom: 18px !important;
}

/* ---------- Activity blocks (Games / Scenarios) ---------- */
/* sticky header would otherwise cover the top of an anchored block */
#activities, .activity-block { scroll-margin-top: 90px; }

.activity-block + .activity-block {
  margin-top: 84px;
  padding-top: 72px;
  border-top: 2px dashed rgba(44, 62, 107, 0.15);
}

.activity-block-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 36px;
}

.activity-badge {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow-soft);
}

.activity-badge.badge-coral { background: var(--coral); }
.activity-badge.badge-teal { background: var(--teal); }
.activity-badge.badge-navy { background: var(--navy); }

/* A printable card carries two actions (open / save) rather than one
   button, so the row wraps instead of squeezing them on a narrow card. */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: #22305a; }

/* the secondary action: readable, but it should not compete with Open */
.btn-quiet {
  background: transparent;
  color: var(--navy);
  border: 2px solid rgba(44, 62, 107, 0.25);
}
.btn-quiet:hover {
  background: rgba(44, 62, 107, 0.08);
  border-color: rgba(44, 62, 107, 0.45);
}

.activity-block-copy { flex: 1 1 auto; }

.activity-block-copy h3 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-bottom: 4px;
}

.activity-block-copy p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0;
}

.activity-count {
  flex: 0 0 auto;
  align-self: flex-start;
  background: var(--sky);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ============================================================
   MODAL / LIGHTBOX
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 30, 51, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-window {
  background: var(--white);
  border-radius: var(--radius-md);
  width: min(960px, 100%);
  height: min(640px, 90vh);
  position: relative;
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--navy);
  color: var(--white);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.modal-icon-btn {
  color: var(--white);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.modal-icon-btn:hover, .modal-icon-btn:focus-visible {
  background: rgba(255,255,255,0.16);
}

.modal-body {
  flex: 1;
  background: var(--sky);
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy-dark);
  color: #cfd8ee;
  padding: 60px 0 28px;
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
}

.btn-lg {
  padding: 18px 44px;
  font-size: 1.1rem;
}

.social-row {
  display: flex;
  gap: 12px;
}

.social-row a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, transform 150ms ease;
}
.social-row a:hover { background: var(--coral); transform: translateY(-2px); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #9aa5c6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  /* five nav items plus the wordmark do not fit a tablet; the logo mark
     alone still identifies the site, so the words go first */
  .logo-text { display: none; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 10px 12px; font-size: 0.9rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-graphic { margin: 0 auto; }
}

@media (max-width: 640px) {
  .nav-back-full { display: none; }
  .header-inner { padding: 12px 16px; }
  .nav-links { gap: 4px; }
  .nav-links a { padding: 9px 13px; font-size: 0.88rem; white-space: nowrap; }
  .activity-block-head { flex-wrap: wrap; gap: 14px; }
  .activity-count { order: 3; }
  .games-grid { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 90px; }
}

/* The five-item nav measures 513px laid out, so it stops fitting at about
   533px of viewport. Below that there is no hamburger to fall back on, so
   the three in-page jumps give way and the nav keeps the way out
   (KidSafeHQ) and the way in (Start Playing). Re-measure before moving
   this: it was 470px when the nav had four items. */
@media (max-width: 600px) {
  .nav-section { display: none; }
}

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