/* ---------- Buttons: chunky, pressable, like a toy ---------- */
.btn {
  white-space: nowrap;
  --btn-bg: var(--snow);
  --btn-fg: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 52px;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: var(--ink);
  border-radius: var(--r-btn);
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--navy); }
.btn:active { transform: translateY(4px); box-shadow: var(--lift-press); }
.btn--big { min-height: 60px; font-size: 1.4rem; padding-inline: 1.8rem; }
.btn--small { min-height: 44px; font-size: 1.05rem; padding: 0.5rem 1rem; box-shadow: 0 4px 0 var(--navy); }
.btn--small:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.btn--sun { --btn-bg: var(--sun); }
.btn--white { --btn-bg: var(--snow); }
.btn--tie { --btn-bg: var(--tie); --btn-fg: var(--snow); }
.btn--meadow { --btn-bg: var(--meadow); }
.btn--navy { --btn-bg: var(--navy); --btn-fg: var(--snow); box-shadow: 0 6px 0 var(--sun-dark); }
.btn--ghost { --btn-bg: transparent; box-shadow: none; }

.textlink {
  font-weight: 700; text-decoration-thickness: 3px; text-underline-offset: 5px;
  text-decoration-color: var(--sun);
}
.textlink:hover { text-decoration-color: var(--tie); }

.pill {
  display: inline-block; margin: 0; padding: 0.35rem 0.9rem;
  border: var(--ink); border-radius: var(--r-pill);
  font-family: var(--font-display); font-size: 1rem; line-height: 1;
}
.pill--soon { background: var(--fox); }

/* ---------- CaseCoin ---------- */
.coin {
  display: inline-block; width: 1.4em; height: 1.4em; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--sun) 0 52%, var(--sun-dark) 53% 60%, var(--sun) 61%);
  border: 2px solid var(--navy);
  flex: none;
}

/* ---------- Staging bar ---------- */
.staging-bar { display: none;
  background: var(--navy); color: var(--sun);
  text-align: center; font-weight: 700; font-size: var(--text-sm);
  padding: var(--s1) var(--s4);
}

/* ---------- Header: a thin floating pill ---------- */
:root { --pill-h: 58px; --pill-top: 10px; --header-space: calc(var(--pill-h) + var(--pill-top) * 2); }
.site-header { position: fixed; z-index: 50; top: var(--pill-top); left: 0; right: 0; pointer-events: none; }
.pillbar {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s3);
  width: min(1400px, 100% - 2 * clamp(0.5rem, 2vw, 1.5rem)); margin-inline: auto;
  height: var(--pill-h); padding: 0 var(--s2) 0 6px;
  background: rgba(255, 252, 244, .9);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  border: 2px solid var(--navy); border-radius: var(--r-pill);
  box-shadow: 0 4px 0 var(--navy), 0 10px 24px rgba(24, 33, 88, .18);
}
main { padding-top: var(--header-space); }
.page-home main { padding-top: 0; }

.brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; flex: none; }
.brand__badge {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--snow); border: 2px solid var(--navy); overflow: hidden;
}
.brand__badge img { width: 40px; height: 40px; }
.brand__sign { height: 48px; width: auto; margin-top: 2px; }
.test-chip {
  flex: none; padding: 0.2rem 0.55rem; border-radius: var(--r-pill);
  background: var(--navy); color: var(--sun); font-weight: 700; font-size: 0.75rem; line-height: 1.2;
}

.mainnav { margin-left: auto; display: none; }
.mainnav > ul { display: flex; align-items: center; gap: 2px; list-style: none; }
.mainnav > ul > li > a, .mainnav > ul > li > button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 60px; padding: 2px 4px;
  font-weight: 700; font-size: 0.72rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  background: none; border: 0; border-radius: 14px; cursor: pointer; color: var(--navy);
}
.mainnav .ico {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--snow); border: 2px solid #d6deef;
  transition: transform var(--t-med) var(--ease-pop), border-color var(--t-fast);
}
.mainnav .ico svg { width: 20px; height: 20px; }
.mainnav a:hover .ico, .mainnav button:hover .ico, .mainnav button[aria-expanded="true"] .ico { transform: translateY(-2px) scale(1.08); border-color: var(--navy); }
.mainnav a[aria-current="page"] .ico { background: var(--sun); border-color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.mainnav a[aria-current="page"] .lbl { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--sun); text-underline-offset: 2px; }
.mainnav__more { position: relative; }
.mainnav__more ul {
  position: absolute; right: 0; top: calc(100% + 14px); min-width: 240px;
  list-style: none; padding: var(--s2);
  background: var(--snow); border: var(--ink); border-radius: 18px; box-shadow: var(--lift);
}
.mainnav__more ul a { display: block; padding: 0.6rem 0.8rem; border-radius: 10px; font-weight: 700; text-decoration: none; }
.mainnav__more ul a:hover { background: var(--lake-pale); }

.header-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.mainnav + .header-actions { margin-left: var(--s2); }
.header-actions .btn--small { min-height: 40px; font-size: 1rem; padding: 0.4rem 0.9rem; box-shadow: 0 3px 0 var(--navy); }

.coin-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0.3rem 0.8rem 0.3rem 0.4rem;
  border: 2px solid var(--navy); border-radius: var(--r-pill); background: var(--snow);
  text-decoration: none; font-weight: 700;
}
.coin-chip__count { font-family: var(--font-display); font-size: 1.1rem; }
.coin-chip__name { display: none; }

.menu-btn {
  width: 44px; height: 44px; border: 2px solid var(--navy); border-radius: 50%; background: var(--snow);
  box-shadow: 0 3px 0 var(--navy); cursor: pointer; display: grid; place-items: center;
}
.menu-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }
.menu-btn__bars, .menu-btn__bars::before, .menu-btn__bars::after {
  display: block; width: 20px; height: 3px; border-radius: 3px; background: var(--navy); position: relative;
}
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; left: 0; }
.menu-btn__bars::before { top: -6px; }
.menu-btn__bars::after { top: 6px; }

.drawer {
  pointer-events: auto;
  position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  background: var(--lake); color: var(--snow);
  padding: var(--s6) var(--gutter) var(--s9);
}
.drawer ul { list-style: none; }
.drawer__main a {
  display: flex; align-items: center; gap: var(--s3);
  font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1;
  padding: var(--s2) 0; text-decoration: none; color: var(--snow);
  text-shadow: 0 3px 0 var(--navy);
}
.drawer__main .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--snow); border: 2px solid var(--navy); flex: none; }
.drawer__main .ico svg { width: 28px; height: 28px; }
.drawer__label { margin: var(--s6) 0 var(--s2); font-weight: 700; color: var(--sun); }
.drawer__sub a { display: block; padding: var(--s2) 0; font-weight: 700; font-size: 1.2rem; color: var(--snow); }
.drawer__close { margin-top: var(--s6); }

@media (max-width: 520px) {
  .brand__sign { height: 40px; }
  .test-chip { display: none; }
}
@media (max-width: 380px) { .brand__sign { display: none; } }
@media (min-width: 560px) { .coin-chip__name { display: inline; } }
@media (min-width: 1060px) {
  .mainnav { display: block; }
  .menu-btn { display: none; }
}
@media (min-width: 1060px) and (max-width: 1240px) {
  .brand__sign { height: 40px; }
  .mainnav > ul > li > a, .mainnav > ul > li > button { min-width: 54px; }
}

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--snow); border-top: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0.5rem 0 0.55rem; font-size: 0.85rem; font-weight: 700; text-decoration: none;
}
.tabbar svg { width: 28px; height: 28px; fill: var(--navy); }
.tabbar a[aria-current="page"] svg { fill: var(--tie); }
.tabbar a[aria-current="page"] { color: var(--tie); }
body { padding-bottom: 78px; }
@media (min-width: 760px) {
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--snow); padding: var(--s8) 0 var(--s5); }
.site-footer__inner {
  width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; gap: var(--s6);
}
.site-footer__brand { display: flex; gap: var(--s4); align-items: flex-start; }
.site-footer__brand img { width: 72px; flex: none; }
.site-footer__brand strong { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.site-footer__creator { display: inline-block; margin-top: 6px; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s5); }
.site-footer h2 { font-size: 1.3rem; color: var(--sun); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; }
.site-footer li a { display: inline-block; padding: 0.3rem 0; text-decoration: none; }
.site-footer li a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; }
.site-footer__legal {
  width: min(var(--max), 100% - 2 * var(--gutter)); margin: var(--s7) auto 0;
  padding-top: var(--s4); border-top: 2px solid var(--navy-2);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  font-size: var(--text-sm);
}
.site-footer__legal p { margin: 0; }
@media (min-width: 900px) { .site-footer__inner { grid-template-columns: 1fr 2fr; } }

/* ---------- Notice pages (404, error, rebuilding) ---------- */
.notice-page {
  display: grid; gap: var(--s6); align-items: center;
  padding: var(--s8) 0; min-height: 60vh;
}
.notice-page__art { width: min(220px, 50vw); justify-self: center; }
.notice-page h1 { font-size: var(--text-2xl); }
.notice-page__actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s5); }
@media (min-width: 760px) { .notice-page { grid-template-columns: 260px 1fr; } }

/* ---------- Floating ghosts (Halloween) ---------- */
.ghosts { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.ghosts[hidden] { display: none; }
.ghost { position: absolute; left: 0; top: 0; will-change: transform, opacity; transition: opacity 1.2s ease; filter: drop-shadow(0 0 8px rgba(190, 160, 255, 0.55)); }
.ghost svg { display: block; width: 100%; height: auto; }
.snow-toggle.snow-toggle--ghosts svg { fill: #8a5cf6; }
.snow-toggle.snow-toggle--ghosts[aria-pressed="false"] svg { fill: #9aa6c4; }
.snow-toggle.snow-toggle--stack { bottom: calc(144px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) { .snow-toggle.snow-toggle--stack { bottom: calc(var(--s4) + 60px); } }

/* ---------- Snow ---------- */
.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.snow-toggle {
  position: fixed; z-index: 45; left: var(--s4); bottom: calc(86px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  font-family: var(--font-display); font-size: 1rem; line-height: 1;
  color: var(--navy); background: var(--snow);
  border: var(--ink); border-radius: var(--r-pill); box-shadow: 0 4px 0 var(--navy);
  cursor: pointer;
}
.snow-toggle svg { width: 22px; height: 22px; fill: var(--lake); }
.snow-toggle[aria-pressed="false"] svg { fill: #9aa6c4; }
.snow-toggle:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
@media (min-width: 760px) { .snow-toggle { bottom: var(--s4); } }
.snow-toggle[hidden] { display: none; }
@media (max-width: 759px) {
  .snow-toggle { left: auto; right: var(--s4); width: 48px; height: 48px; padding: 0; justify-content: center; }
  .snow-toggle [data-snow-label], .snow-toggle [data-ghost-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Party pieces shared by every room ---------- */
/* inner pages sit on a light sky with soft confetti dots */
/* Site background: soft paw prints that stay put while the page scrolls over them.
   A fixed layer (not background-attachment: fixed) so it also works on iPhones. */
body { background-color: #d6ecfd; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: #d6ecfd url("../img/bg/paws-1672.webp") center / cover no-repeat;
}
@media (max-width: 900px) { body::before { background-image: url("../img/bg/paws-900.webp"); } }
body.page-reader::before { display: none; }

/* bunting: a row of coloured pennants */
.bunting {
  display: block; height: 32px; width: 100%;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='264' height='32'><path d='M2 2h40L22 30z' fill='%23e22b2e' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/><path d='M46 2h40L66 30z' fill='%23ffc928' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/><path d='M90 2h40L110 30z' fill='%232dbe6c' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/><path d='M134 2h40L154 30z' fill='%23ffffff' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/><path d='M178 2h40L198 30z' fill='%231585ee' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/><path d='M222 2h40L242 30z' fill='%23ff7a1a' stroke='%23182158' stroke-width='2' stroke-linejoin='round'/></svg>") repeat-x 0 0 / 264px 32px;
}
.bunting-wrap { position: relative; padding-top: 4px; }
.bunting-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 3px; background: var(--navy); border-radius: 3px; }

/* room hero: the coloured band at the top of each room */
.room-hero {
  --room: var(--lake); --room-ink: var(--snow);
  position: relative; overflow: hidden;
  background: var(--room); color: var(--room-ink);
  border-bottom: var(--ink);
  padding-top: var(--header-space);
}
.page-home .room-hero { padding-top: 0; }
.room-hero__inner {
  position: relative; display: grid; gap: var(--s5); align-items: end;
  padding: var(--s6) 0 0; min-height: 240px;
}
.room-hero__copy { padding-bottom: var(--s7); position: relative; z-index: 2; }
.room-hero h1 {
  font-size: clamp(2.4rem, 1.5rem + 4vw, 4.4rem); line-height: .95; margin-bottom: var(--s3);
  color: var(--snow); text-shadow: 0 5px 0 var(--navy); -webkit-text-stroke: 2px var(--navy); paint-order: stroke fill;
}
.room-hero p { font-size: var(--text-lg); font-weight: 700; max-width: 40ch; margin: 0; }
.room-hero__art { display: flex; justify-content: center; align-items: flex-end; gap: 0; position: relative; z-index: 1; }
.room-hero__art img { height: 210px; width: auto; margin-inline: -18px; filter: drop-shadow(0 5px 0 rgba(24,33,88,.3)); }
.room-hero__art img:nth-child(2) { height: 240px; z-index: 1; }
.room-hero::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -1px; height: 54px; z-index: 0;
  background: var(--hill, var(--meadow)); border-top: var(--ink);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.room-hero--sun { --room: var(--sun); }
.room-hero--sun h1 { color: var(--snow); }
.room-hero--sun p { color: var(--navy); }
.room-hero--fox { --room: var(--fox); }
.room-hero--tie { --room: var(--tie); }
.room-hero--meadow { --room: var(--meadow); --hill: #24a85d; }
.room-hero--navy { --room: var(--navy); }
.main-room { padding-top: 0; }
@media (min-width: 860px) {
  .room-hero__inner { grid-template-columns: 1.2fr 1fr; min-height: 300px; }
  .room-hero__art img { height: 270px; }
  .room-hero__art img:nth-child(2) { height: 310px; }
}
body:has(.room-hero) main, body:has(.friend-hero) main { padding-top: 0; }
@media (max-width: 859px) {
  .room-hero__inner { min-height: 0; padding-top: var(--s5); }
  .room-hero__copy { padding-bottom: 0; }
  .room-hero__art img { height: 140px; margin-inline: -12px; }
  .room-hero__art img:nth-child(2) { height: 160px; }
  .room-hero__art { margin-bottom: 18px; }
}
.room-hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* cart chip in the pill bar */
.cart-chip {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 2px solid var(--navy); border-radius: 50%; background: var(--sun); color: var(--navy);
}
.cart-chip svg { width: 20px; height: 20px; }
.cart-chip span {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--tie); color: var(--snow); border: 2px solid var(--navy);
  font: 400 .75rem/16px var(--font-display); text-align: center;
}
@media (max-width: 440px) {
  .pillbar:has(.cart-chip) .brand__sign { display: none; }
}

/* Small screens: grid and flex children may shrink below their content (fixes 320px sideways scroll) */
.auth, .library, .contact, .thanks, .plus, .store, .cart, .newsitem { grid-template-columns: minmax(0, 1fr); }
.empty { grid-template-columns: minmax(0, 1fr); }
.empty > *, .auth > *, .contact > *, .library > * { min-width: 0; }
h1, h2, h3 { overflow-wrap: break-word; }
.btn { max-width: 100%; }
@media (max-width: 420px) { .btn { white-space: normal; text-align: center; line-height: 1.15; } }
