/* rockokids — shared stylesheet: design tokens, site chrome (top bar, footer,
   parent gate) and the kids' hub. Same Rocko look as wheresrocko (warm paper,
   Fredoka, Rocko orange-red, the daylight backdrop), tuned for little hands:
   bigger targets, fewer words, pictures first.
   Fredoka is SELF-HOSTED (/fonts/) — this site loads nothing from a third party. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.ttf?v=14326b0") format("truetype");
  font-weight: 300 700;   /* variable font: one file covers every weight */
  font-display: swap;
}

:root {
  --paper:     #FBFAF7;
  --surface:   #FFFFFF;
  --surface-2: #F2EFE9;
  --ink:       #211E1A;
  --ink-soft:  #6C665E;
  --line:      #E8E3DA;
  --brand:     #F04E37;   /* Rocko orange-red */
  --brand-ink: #B8351F;
  --sky:       #afd4f0;

  /* bright section hues (kept from wheresrocko's launcher) */
  --c-make:   #FF5FA8;
  --c-find:   #3AA0FF;
  --c-learn:  #FFB020;
  --c-play:   #35D07A;

  --radius: 22px;
  --shadow:      0 1px 2px rgba(30,22,14,.05), 0 8px 24px rgba(30,22,14,.08);
  --shadow-lift: 0 2px 6px rgba(30,22,14,.10), 0 16px 36px rgba(30,22,14,.16);
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    linear-gradient(rgba(20,30,50,.02), rgba(20,30,50,.10)),
    url("/img/bg-home.webp?v=14326b0");
  background-size: cover, cover;
  background-position: center bottom, center bottom;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat;
  background-color: var(--sky);
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 18px 16px 40px; }
h1, h2, h3 { font-weight: 700; line-height: 1.05; margin: 0; }
a { color: var(--brand-ink); }
img { max-width: 100%; }
:focus-visible { outline: 4px solid #3AA0FF; outline-offset: 3px; border-radius: 12px; }

/* ---------------- the hub card ---------------- */
.hub {
  border-radius: 32px;
  padding: 18px 22px 28px;
  border: 1px solid #d4e3f0;
  box-shadow: 0 18px 44px rgba(20,60,90,.20), inset 0 1px 0 rgba(255,255,255,.6);
  background:
    radial-gradient(120% 120% at 50% 4%, rgba(255,255,255,.92), transparent 52%),
    linear-gradient(180deg, #F4F9FD 0%, #DCEAF6 100%);
}

/* topper: Rocko waving + the wordmark */
.hub-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.hub-rocko {
  width: 104px; height: 104px; object-fit: contain; flex: 0 0 auto;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.24));
  cursor: pointer;
}
.wordmark { font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: -.01em; color: #1c2434; }
.wordmark .rk { color: var(--brand); }
.wordmark .kids span { display: inline-block; }
.wordmark .kids span:nth-child(1) { color: #3AA0FF; transform: rotate(-6deg); }
.wordmark .kids span:nth-child(2) { color: #FFB020; transform: translateY(-3px); }
.wordmark .kids span:nth-child(3) { color: #35D07A; transform: rotate(5deg); }
.wordmark .kids span:nth-child(4) { color: #FF5FA8; transform: translateY(2px) rotate(-4deg); }
.hub-sub { margin: 4px 0 0; font-size: 1rem; color: var(--ink-soft); font-weight: 500; }

/* sections: a big picture-word header, then a grid of big tiles */
.shelf { margin-top: 22px; }
.shelf-h {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.5rem; color: #1c2434;
  padding: 6px 18px 6px 8px; border-radius: 999px;
  background: #fff; border: 3px solid var(--c, var(--brand));
  box-shadow: 0 4px 0 var(--c, var(--brand));
  margin-bottom: 14px;
}
.shelf-h .ic {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c, var(--brand)); font-size: 1.4rem;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }

.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 3px solid var(--c, var(--brand));
  box-shadow: 0 6px 0 var(--c, var(--brand)), var(--shadow);
  text-decoration: none; color: var(--ink);
  font: inherit; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 9px 0 var(--c, var(--brand)), var(--shadow-lift); }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c, var(--brand)), var(--shadow); }
.tile-art {
  width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--brand)) 14%, #fff);
}
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-art .emoji { font-size: 4.2rem; line-height: 1; }
.tile-name { font-size: 1.15rem; font-weight: 600; text-align: center; line-height: 1.1; }

/* a game that hasn't moved over yet: sleepy, not a link */
.tile.soon { cursor: default; }
.tile.soon .tile-art img, .tile.soon .tile-art .emoji { filter: saturate(.35) brightness(1.05); opacity: .75; }
.tile.soon .zzz {
  position: absolute; top: 6px; right: 8px;
  font-size: .95rem; font-weight: 700; color: #fff;
  background: #7a86a8; padding: 2px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.tile.soon:hover { transform: none; box-shadow: 0 6px 0 var(--c, var(--brand)), var(--shadow); }
.tile.wiggle { animation: wiggle .5s ease; }
@keyframes wiggle {
  0%,100% { transform: rotate(0); } 20% { transform: rotate(-4deg); }
  40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); }
}
/* a tile that leaves this site (goes through the parent gate) */
.tile .out {
  position: absolute; top: 6px; left: 8px; font-size: .85rem; font-weight: 700;
  background: #1c2434; color: #fff; padding: 2px 9px; border-radius: 999px;
}

/* grown-ups button, small and quiet at the bottom */
.grownups {
  display: flex; justify-content: center; margin-top: 30px;
}
.grownups-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 1rem; font-weight: 600;
  color: #1c2434; background: rgba(255,255,255,.85);
  border: 2px solid #c9d6e4; border-radius: 999px;
  padding: 8px 18px; cursor: pointer; text-decoration: none;
}
.grownups-btn:hover { background: #fff; }

/* ---------------- footer ---------------- */
.site-foot {
  text-align: center; padding: 16px 16px 22px;
  font-size: .85rem; color: #1c2434;
}
.site-foot .foot-pill {
  display: inline-block; background: rgba(255,255,255,.8); border-radius: 999px; padding: 6px 16px;
}
.site-foot .ver { opacity: .5; margin-left: .35em; }

/* ---------------- parent gate ---------------- */
.pg-back {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(20,28,44,.55);
}
.pg-card {
  width: min(420px, 100%);
  background: var(--paper); color: var(--ink);
  border-radius: 26px; padding: 22px 22px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center; position: relative;
}
.pg-card img { width: 96px; height: 96px; object-fit: contain; margin: -6px auto 4px; display: block; }
.pg-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.pg-card p { margin: 6px 0; color: var(--ink-soft); }
.pg-q { font-size: 1.15rem; color: var(--ink) !important; font-weight: 600; }
.pg-form { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.pg-form input {
  width: 110px; font: inherit; font-size: 1.4rem; text-align: center;
  padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.pg-btn {
  font: inherit; font-size: 1.1rem; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--brand); border: 0; border-radius: 14px; padding: 10px 18px;
  box-shadow: 0 4px 0 var(--brand-ink);
}
.pg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-ink); }
.pg-msg { min-height: 1.4em; font-weight: 600; color: var(--brand-ink) !important; }
.pg-x {
  position: absolute; top: 10px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  font: inherit; font-size: 1.6rem; line-height: 1; background: var(--surface-2); color: var(--ink);
}
.pg-dest { font-size: .85rem; word-break: break-all; }

/* ---------------- plain content pages (grown-ups, 404) ---------------- */
.page {
  max-width: 720px; margin: 0 auto;
  background: var(--paper); border-radius: 28px; padding: 26px 26px 30px;
  box-shadow: var(--shadow-lift);
}
.page h1 { font-size: 2rem; margin-bottom: 10px; }
.page h2 { font-size: 1.3rem; margin: 22px 0 8px; }
.page p, .page li { font-size: 1.05rem; font-weight: 400; }
.page ul { padding-left: 1.2em; }
.back-home {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-weight: 600; text-decoration: none; color: #1c2434;
  background: rgba(255,255,255,.88); padding: 8px 16px 8px 8px; border-radius: 999px;
}
.back-home img { width: 40px; height: 40px; object-fit: contain; }

@media (max-width: 520px) {
  .hub { padding: 14px 14px 22px; border-radius: 26px; }
  .hub-rocko { width: 80px; height: 80px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile-name { font-size: 1.05rem; }
  .shelf-h { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile.wiggle { transition: none; animation: none; }
}
