/* Polka Dot Firehouse: shared world.
   White walls with black Dalmatian spots, engine red, helmet yellow, sky, concrete apron.
   Controls use the turnout-gear reflective trim: lime / silver / lime, either dark or lit, nothing in between. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --spot: #1e1c1c;
  --ink: #2a2321;
  --ink-soft: #4b3f3a;
  --wall: #fffdf8;
  --cream: #fcf5e3;
  --paper: #fffaf0;
  --red: #cc3329;
  --red-deep: #a8261e;
  --red-dark: #7d1a14;
  --yellow: #f2b82e;
  --yellow-deep: #d99a0b;
  --sky: #5c9ed1;
  --sky-deep: #2f6fa3;
  --green: #4f8f41;
  --green-deep: #2f6a27;
  --apron: #efe2c8;
  --apron-deep: #c9b28d;
  --trim-lime: #d6e04a;
  --trim-silver: #c6ccd2;
  --trim-lit: #ffffff;
  --brass: #c9962e;

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --shadow-1: 0 2px 4px rgb(60 30 20 / 0.12), 0 6px 14px rgb(60 30 20 / 0.10);
  --shadow-2: 0 4px 10px rgb(60 30 20 / 0.16), 0 14px 32px rgb(60 30 20 / 0.16);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--red) var(--cream);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(17px, 1.05vw + 12px, 20px);
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  caret-color: var(--red);
  text-rendering: optimizeLegibility;
}

::selection { background: var(--yellow); color: var(--spot); }

img { max-width: 100%; height: auto; display: block; }
img[draggable="false"] { -webkit-user-drag: none; user-select: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--spot);
  text-wrap: balance;
  margin: 0 0 0.45em;
}
h2 { font-size: clamp(2rem, 2.4vw + 1.2rem, 3.3rem); }
h3 { font-size: clamp(1.35rem, 0.8vw + 1rem, 1.75rem); }
p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--red-deep); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { color: var(--red); }

:focus-visible {
  outline: 4px solid var(--sky-deep);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--spot); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-weight: 800; text-decoration: none;
}
.skip:focus, .skip:hover { top: 12px; color: #fff; }
.foot a:hover, .foot a:focus-visible { color: var(--yellow); }

.icon { width: 1.1em; height: 1.1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; inset: 14px var(--gutter) auto; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  max-width: 1400px; margin: 0 auto;
  padding: 8px 10px 8px 22px;
  background: rgb(255 255 255 / 0.96);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}
.topbar--static { position: sticky; top: 12px; margin: 12px var(--gutter) 0; }
.topbar__brand { display: block; flex: none; line-height: 0; }
.topbar__brand img { height: 50px; width: auto; }
.topbar__nav { margin-left: auto; }
.topbar__nav ul { display: flex; gap: clamp(4px, 0.6vw, 12px); list-style: none; margin: 0; padding: 0; }
.topbar__nav a {
  display: block; padding: 8px clamp(8px, 0.8vw, 14px);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1rem, 0.35vw + 0.82rem, 1.18rem);
  color: var(--spot); text-decoration: none; border-radius: 999px;
}
.topbar__nav a:hover { background: var(--cream); color: var(--red-deep); }
.topbar__nav a[aria-current="page"] { background: var(--spot); color: #fff; }
.topbar__nav a.nav-grownups { color: var(--red-deep); box-shadow: inset 0 0 0 2px var(--red); }
.topbar__nav a.nav-grownups[aria-current="page"] { background: var(--red); color: #fff; }

.sound-toggle,
.menu-toggle {
  flex: none; display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: var(--cream); color: var(--spot); cursor: pointer;
}
.sound-toggle:hover, .menu-toggle:hover { background: var(--yellow); }
.sound-toggle .off { display: none; }
.sound-toggle[aria-pressed="false"] .on { display: none; }
.sound-toggle[aria-pressed="false"] .off { display: block; }
.menu-toggle { display: none; background: var(--red); color: #fff; }

@media (max-width: 1099px) {
  .topbar { padding: 6px 6px 6px 16px; }
  .topbar__brand img { height: 44px; }
  .topbar__nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .topbar .sound-toggle { margin-left: auto; }
}
/* narrow phones: let the logo shrink so both 48px buttons stay inside the pill */
@media (max-width: 380px) {
  .topbar { gap: 6px; padding-left: 12px; }
  .topbar--static { margin-inline: 10px; }
  .topbar__brand { min-width: 0; flex: 1 1 auto; }
  .topbar__brand img { width: 100%; height: auto; max-width: 130px; }
  .topbar .sound-toggle { margin-left: 0; }
}

/* phone menu: a sheet that slides down like a bay door */
.menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--red);
  color: #fff;
  padding: max(24px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transform: translateY(-102%);
  transition: transform 0.55s var(--ease-out);
  visibility: hidden;
}
.menu[data-open="true"] { transform: none; visibility: visible; }
.menu {
  /* door panel lines; scroll with the content when the menu scrolls */
  background-image: repeating-linear-gradient(to bottom, transparent 0 86px, rgb(0 0 0 / 0.14) 86px 89px, rgb(255 255 255 / 0.08) 89px 91px);
  background-attachment: local;
}
.menu__head { position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.menu__head img { height: 52px; width: auto; max-width: calc(100% - 68px); }
.menu__close { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; color: var(--red-deep); display: grid; place-items: center; cursor: pointer; }
.menu ul { position: relative; flex-shrink: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.menu a {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 18px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: #fff; text-decoration: none;
  border-radius: 18px;
}
.menu a:hover, .menu a:focus-visible { background: rgb(0 0 0 / 0.18); color: #fff; }
.menu a img { width: 46px; height: 46px; object-fit: contain; }
.menu .menu__grownups { margin-top: 18px; background: #fff; color: var(--red-deep); font-size: 1.35rem; }
.menu .menu__grownups:hover { background: var(--cream); color: var(--red-deep); }
/* the page you're on: a white outline and a yellow "You're here" tag sitting on it */
.menu a[aria-current="page"] { position: relative; margin-top: 12px; background: rgb(0 0 0 / 0.18); box-shadow: inset 0 0 0 3px #fff; }
.menu .menu__grownups[aria-current="page"] { margin-top: 18px; background: #fff; box-shadow: inset 0 0 0 3px var(--spot); }
.menu__here {
  position: absolute; top: -12px; right: 16px;
  padding: 2px 10px 3px; border-radius: 999px; border: 2px solid var(--spot);
  background: var(--yellow); color: var(--spot);
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; line-height: 1.1; white-space: nowrap;
}

/* ---------- Buttons: reflective-trim language ---------- */
.btn {
  --btn-bg: var(--yellow);
  --btn-fg: var(--spot);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 56px; padding: 0.55em 1.4em 0.8em;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15em; line-height: 1.1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 3px solid var(--spot); border-radius: 18px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.0), 0 5px 12px rgb(60 30 20 / 0.2);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  overflow: hidden;
}
.btn::after {
  /* the reflective strip along the bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: linear-gradient(to bottom, var(--trim-lime) 0 3px, var(--trim-silver) 3px 7px, var(--trim-lime) 7px 10px);
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); color: var(--btn-fg); box-shadow: 0 8px 18px rgb(60 30 20 / 0.24); }
.btn:hover::after, .btn:focus-visible::after {
  background: linear-gradient(to bottom, var(--trim-lime) 0 3px, var(--trim-lit) 3px 7px, var(--trim-lime) 7px 10px);
  box-shadow: 0 0 0 0 transparent;
}
.btn:active { transform: translateY(1px); }
.btn--red { --btn-bg: var(--red); --btn-fg: #fff; }
.btn--white { --btn-bg: #fff; --btn-fg: var(--spot); }
.btn--small { min-height: 46px; font-size: 1em; padding: 0.4em 1em 0.65em; border-radius: 14px; }
.btn .icon { width: 1em; height: 1em; }

/* ---------- Section grounds ---------- */
.wall {
  background-color: var(--wall);
  background-image: url("/assets/img/spot-wall.svg");
  background-size: 360px 360px;
}
.wall--soft { background-color: var(--wall); }
.wall--soft::before { content: none; }

.panel {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}

.trimband {
  height: 22px;
  background:
    linear-gradient(to bottom, var(--red-dark) 0 2px, var(--red) 2px 14px, var(--trim-lime) 14px 16px, var(--trim-silver) 16px 19px, var(--trim-lime) 19px 22px);
}

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }

.lede { font-size: 1.15em; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Footer ---------- */
.foot {
  background: var(--spot);
  color: #f3eee6;
  padding: 64px 0 40px;
  position: relative;
  overflow: hidden;
}
.foot::before {
  content: ""; position: absolute; inset: 0; opacity: 0.08;
  background-image: url("/assets/img/spot-wall.svg"); background-size: 300px 300px;
  filter: invert(1);
}
.foot .wrap { position: relative; display: grid; gap: 32px; grid-template-columns: 1.3fr 1fr 1fr; align-items: start; }
.foot__brand img { width: min(230px, 100%); height: auto; }
@media (max-width: 760px) { .foot__brand img { width: min(170px, 55%); } .foot { padding-top: 48px; } }
.foot__brand p { margin-top: 18px; color: #d9d1c6; max-width: 34ch; }
.foot h2 { font-size: 1.15rem; color: #fff; margin-bottom: 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0; }
.foot a:hover { color: var(--yellow); text-decoration: underline; }
.foot__small { grid-column: 1 / -1; border-top: 1px solid rgb(255 255 255 / 0.16); padding-top: 18px; font-size: 0.9rem; color: #c9c0b4; display: flex; align-items: center; gap: 14px; }
.foot__badge { width: 56px; height: 56px; flex: none; }
@media (max-width: 760px) { .foot__small { flex-direction: column; align-items: flex-start; gap: 12px; } }
@media (max-width: 760px) {
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}

/* ---------- Spot confetti (wins, the bell) ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i {
  position: absolute; display: block; width: var(--s); height: var(--s);
  background: url("/assets/img/spot-0.svg") center / contain no-repeat;
  animation: spot-fall var(--d) var(--ease-out) forwards;
}
.confetti i:nth-child(3n) { background-image: url("/assets/img/spot-2.svg"); }
.confetti i:nth-child(5n) { background-image: url("/assets/img/spot-4.svg"); }
@keyframes spot-fall {
  from { transform: translate(0, 0) scale(0.2) rotate(0deg); opacity: 1; }
  to { transform: translate(var(--x), var(--y)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Sub-page header (inside pages) ---------- */
.pagehead {
  position: relative; padding: 120px 0 48px; overflow: hidden;
}
.pagehead h1 { font-size: clamp(2.4rem, 4vw + 1rem, 4.6rem); margin-bottom: 0.25em; }
.pagehead .lede { margin-bottom: 0; }
.pagehead__art { position: absolute; right: max(var(--gutter), calc((100vw - var(--maxw)) / 2)); bottom: 0; width: clamp(140px, 18vw, 260px); }
@media (max-width: 760px) {
  .pagehead { padding-top: 100px; }
  .pagehead__art { position: static; width: 150px; margin-top: 16px; }
}

/* breadcrumbs for game pages */
.backlink { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; color: var(--spot); padding: 10px 0; }
.backlink:hover { color: var(--red-deep); }

/* ---------- Spotted walls without sliced spots ----------
   Sections marked data-spots get their spots placed by site.js, only in open wall space,
   so no spot is ever cut in half by a panel, a picture or the section edge. */
[data-spots] { position: relative; isolation: isolate; background-image: none !important; }
.spots { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.spots i { position: absolute; display: block; background: center / contain no-repeat; }

/* ---------- Floors: things stand on something ---------- */
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--floor-h, 40px); z-index: 0;
  /* poured concrete: a shaded edge where it meets the wall, saw-cut joints */
  background:
    repeating-linear-gradient(90deg, transparent 0 238px, rgb(60 30 20 / 0.09) 238px 240px),
    linear-gradient(to bottom, #d9c6a2 0, var(--apron) 9px, #f4ead7);
  box-shadow: inset 0 2px 0 rgb(60 30 20 / 0.16);
}
/* Pepper (or anything) standing on a surface: feet on the box's bottom edge, a soft contact shadow under them.
   --pad = transparent space under the feet in the art (as % of width), --sx/--sw = shadow centre and width. */
.pup { position: relative; display: block; isolation: isolate; line-height: 0; }
.pup img { position: relative; display: block; width: 100%; height: auto; margin-bottom: calc(-1 * var(--pad, 0%)); }
.pup::after {
  content: ""; position: absolute; z-index: -1; bottom: -7px; height: 15px;
  left: calc(var(--sx, 50%) - var(--sw, 50%) / 2); width: var(--sw, 50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgb(40 25 15 / 0.45), rgb(40 25 15 / 0.2) 60%, transparent);
}
.pup--br05 { --pad: 4%; --sx: 51%; --sw: 46%; }
.pup--br06 { --pad: 5.4%; --sx: 49%; --sw: 52%; }
.pup--br08 { --pad: 12.7%; --sx: 51%; --sw: 86%; }
.pup--sit { --pad: 0.2%; --sx: 47%; --sw: 78%; }

/* focus on the red menu: white ring (sky-blue on red is too faint) */
.menu :focus-visible { outline-color: #fff; }
.menu .menu__close:focus-visible, .menu .menu__grownups:focus-visible { outline-color: var(--spot); }
/* header symbols big enough to recognize */
.sound-toggle .icon, .menu-toggle .icon, .menu__close .icon { width: 24px; height: 24px; }

/* ---------- "Sound is off" note beside a Hear button (site.js) ---------- */
.sound-note {
  position: fixed; z-index: 85; left: 8px; top: 8px; --tip: 50%;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 16px);
  padding: 8px 8px 8px 16px;
  background: #fff; color: var(--spot); border: 3px solid var(--spot); border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.sound-note[hidden] { display: none; }
.sound-note::before {
  content: ""; position: absolute; left: var(--tip); top: -9px; width: 14px; height: 14px; translate: -50% 0; rotate: 45deg;
  background: #fff; border: 3px solid var(--spot); border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0;
}
.sound-note[data-side="above"]::before { top: auto; bottom: -9px; rotate: 225deg; }
.sound-note__text { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; white-space: nowrap; min-width: 6.4em; }
.sound-note__on { min-height: 48px; white-space: nowrap; }
.sound-note__x {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; padding: 0;
  background: none; border: 0; border-radius: 12px; color: var(--spot); cursor: pointer;
}
.sound-note__x .icon { width: 20px; height: 20px; }
.sound-note__x:hover { background: var(--cream); }
.sound-note.is-new { animation: sound-note-in 0.3s var(--ease-out); }
@keyframes sound-note-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
@media (max-width: 380px) {
  .sound-note { gap: 6px; padding-left: 12px; }
  .sound-note__text { font-size: 1rem; }
  .sound-note__on { padding-inline: 0.7em; }
}
@media (prefers-reduced-motion: reduce) { .sound-note.is-new { animation: none; } }
