/* ============================================================
   MoochO's Mighty Mind — warm, low-sensory, child-first UI
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --cream:      #FFF8EE;
  --cream-2:    #FDF1E1;
  --card:       #FFFFFF;
  --ink:        #2A2342;
  --ink-soft:   #5D5578;
  --line:       #EADFCB;
  --line-deep:  #DCCDB4;

  --coral:      #C1552C;
  --coral-tint: #FFE6DA;
  --teal:       #1E7A70;
  --teal-tint:  #D6F0EA;
  --sky:        #2F6FB5;
  --sky-tint:   #DCE9F8;
  --plum:       #5B3F8C;
  --plum-tint:  #E8E0F7;
  --sun:        #C98A16;
  --sun-tint:   #FFF0C7;
  --rose:       #A63C6B;

  --shadow:    0 10px 26px rgba(74, 53, 20, .09), 0 2px 6px rgba(74, 53, 20, .05);
  --shadow-sm: 0 6px 14px rgba(74, 53, 20, .07);
  --radius:    26px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Nunito', ui-rounded, 'Trebuchet MS', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -8%, #FFEFD9 0%, rgba(255, 239, 217, 0) 62%),
    radial-gradient(900px 520px at 102% -4%, #E4F5F0 0%, rgba(228, 245, 240, 0) 58%),
    var(--cream);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------- layout */
.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 28px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main#main { flex: 1 0 auto; outline: none; }
main#main:focus-visible { outline: none; }

.view { animation: rise .34s ease-out both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 12px;
  margin-bottom: 6px;
  background: linear-gradient(to bottom, var(--cream) 62%, rgba(255, 248, 238, 0));
}

.topbar-side { display: flex; gap: 8px; align-items: center; }
.topbar-right { margin-left: auto; }

.brand {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink-soft);
  letter-spacing: -.01em;
  white-space: nowrap;
}

@media (max-width: 719px) { .brand { display: none; } }

.navbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 15px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.navbtn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.navbtn:hover { background: #FFFDF8; border-color: var(--line-deep); }
.navbtn:active { transform: scale(.97); }
.navbtn.quiet { color: var(--ink-soft); }
.navbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (max-width: 420px) {
  .navbtn { padding: 0 12px; font-size: 14px; gap: 5px; }
  .navbtn svg { width: 18px; height: 18px; }
}

/* ---------------------------------------------------------- typography */
.h1 {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(27px, 5.6vw, 40px);
  line-height: 1.14;
  letter-spacing: -.015em;
  margin: 0 0 10px;
  color: var(--ink);
}
.h2 {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(19px, 3.6vw, 23px);
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--ink);
}
.lede {
  font-size: 17.5px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 58ch;
}
.muted { color: var(--ink-soft); }
.small { font-size: 14.5px; line-height: 1.55; }
.center-text { text-align: center; }

.view-head { padding: 4px 2px 0; }

/* ---------------------------------------------------------- home hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
  padding: 4px 0 26px;
}
@media (min-width: 760px) {
  .hero { grid-template-columns: 350px 1fr; gap: 30px; padding: 8px 0 34px; }
}

.hero-friends {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}
.friend {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.friend-moocho { flex: 1 1 0; max-width: 150px; }
.friend-ada { flex: 1 1 0; max-width: 196px; }

.mascot-wrap { text-align: center; }

.bubble {
  position: relative;
  display: inline-block;
  max-width: 260px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 16px;
  height: 16px;
  transform: translateX(-50%) rotate(45deg);
  background: #fff;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  border-bottom-right-radius: 4px;
}

.friend-btn {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 22px;
}
.friend-btn.friend-static { cursor: default; }
.friend-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(74, 53, 20, .14));
}
.art-fallback { display: block; width: 100%; height: auto; }
.friend-btn:active { transform: scale(.985); }
.friend-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }

.bob { display: block; animation: bob 5.5s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-text { text-align: center; }
@media (min-width: 760px) { .hero-text { text-align: left; } }
.hero-text .muted { margin: 10px 0 0; }

.bubble-ada {
  max-width: 190px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  background: #F4FBF8;
  border-color: #BFE0DA;
  color: var(--ink);
}
.bubble-ada::after {
  background: #F4FBF8;
  border-right-color: #BFE0DA;
  border-bottom-color: #BFE0DA;
}

.btn-big {
  width: 100%;
  max-width: 420px;
  min-height: 64px;
  margin-inline: auto;
  font-size: 19px;
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(30, 122, 112, .26);
}
@media (min-width: 760px) { .btn-big { margin-inline: 0; } }

/* ---------------------------------------------------------- choice cards */
.choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 620px) { .choices { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .choices { grid-template-columns: repeat(3, 1fr); } }

.choice {
  --tint: var(--coral-tint);
  --tone: var(--coral);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  min-height: 96px;
  padding: 16px 16px 16px 18px;
  border: 2px solid transparent;
  border-radius: 24px;
  background: var(--tint);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(74, 53, 20, .07);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.choice[data-tone="coral"] { --tint: var(--coral-tint); --tone: var(--coral); }
.choice[data-tone="teal"]  { --tint: var(--teal-tint);  --tone: var(--teal); }
.choice[data-tone="sky"]   { --tint: var(--sky-tint);   --tone: var(--sky); }
.choice[data-tone="sun"]   { --tint: var(--sun-tint);   --tone: var(--sun); }
.choice[data-tone="plum"]  { --tint: var(--plum-tint);  --tone: var(--plum); }

.choice-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--tone);
  box-shadow: 0 3px 8px rgba(74, 53, 20, .07);
}
.choice-icon svg { width: 27px; height: 27px; }

.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-title { font-weight: 800; font-size: 18px; line-height: 1.25; }
.choice-sub { font-size: 14.5px; color: var(--ink-soft); line-height: 1.4; }
.choice-chev { width: 20px; height: 20px; flex: 0 0 auto; color: var(--tone); opacity: .8; margin-left: auto; }

@media (hover: hover) {
  .choice:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(74, 53, 20, .11); border-color: rgba(42, 35, 66, .12); }
}
.choice:active { transform: scale(.985); }
.choice:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------------------------------------------------------- panels & buttons */
.panel {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
@media (min-width: 640px) { .panel { padding: 26px; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, filter .16s ease, background .16s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-deep);
}
.btn.secondary:hover { background: #FFFCF6; filter: none; }
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.row.center { justify-content: center; }

.stat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

.field-label {
  display: block;
  margin: 20px 0 8px;
  font-weight: 800;
  font-size: 15.5px;
  color: var(--ink);
}
.field-label .muted { font-weight: 600; }

textarea {
  width: 100%;
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #FFFCF6;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}
textarea::placeholder { color: #9C93AC; }
textarea:focus { outline: 3px solid var(--sky); outline-offset: 2px; border-color: var(--sky); }

/* ---------------------------------------------------------- feelings */
.feelings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.feelings .feeling { flex: 1 1 calc(33.333% - 10px); max-width: 150px; }
@media (min-width: 700px) {
  .feelings { gap: 12px; }
  .feelings .feeling { flex: 1 1 108px; max-width: 160px; }
}

.feeling {
  --ring: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px 10px;
  border-radius: 20px;
  border: 3px solid transparent;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.feeling svg { width: min(62px, 16vw); height: auto; display: block; }
.feeling[aria-pressed="true"] {
  border-color: var(--ring);
  background: #FFFCF4;
  transform: translateY(-3px);
}
.feeling:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.feeling:active { transform: scale(.97); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s ease, border-color .14s ease, transform .12s ease;
}
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] {
  background: var(--teal-tint);
  border-color: var(--teal);
  color: #12564F;
  box-shadow: inset 0 0 0 2px rgba(30, 122, 112, .18);
}
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.result { text-align: center; }
.result-face { display: flex; justify-content: center; margin-bottom: 14px; }
.result-face svg { width: 88px; height: auto; }
.result .row { justify-content: center; }
.result p { margin: 0 0 10px; font-size: 17px; }

/* ---------------------------------------------------------- calm corner */
.calm-panel { text-align: center; }

.breath-stage {
  position: relative;
  width: min(320px, 76vw);
  aspect-ratio: 1 / 1;
  margin: 6px auto 18px;
  display: grid;
  place-items: center;
}

.breath-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #F0FBF7 0%, #B4E3D8 46%, #6FC0AE 100%);
  box-shadow: 0 0 0 12px rgba(111, 192, 174, .13), 0 18px 40px rgba(30, 122, 112, .18);
  transform: scale(.66);
  will-change: transform;
}

.breath-label {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 74%;
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(18px, 5vw, 23px);
  line-height: 1.2;
  color: #0E4A43;
  text-align: center;
  pointer-events: none;
}
.breath-count {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #166059;
  opacity: .85;
  min-height: 20px;
}

.breath-hint { margin: 0 0 6px; font-size: 16px; color: var(--ink-soft); }

/* ---------------------------------------------------------- adventure flow */
.adv-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #FFFDF7;
  border: 2px dashed var(--line-deep);
}
.adv-label {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-soft);
}
.adv-dots { display: inline-flex; gap: 7px; margin-left: auto; }
.adv-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #E7DFD2;
  transition: background .2s ease;
}
.adv-dot.on { background: var(--teal); }
.adv-dot.now { box-shadow: 0 0 0 3px rgba(30, 122, 112, .18); }

.adv-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 14px 0 6px;
}
.adv-foot .btn { min-width: 132px; }
@media (max-width: 430px) { .adv-foot .btn { flex: 1 1 auto; } }

/* ---------------------------------------------------------- focus quest */
.pattern-panel { text-align: center; }
.pattern-hud { display: flex; justify-content: center; margin-bottom: 14px; }

.pattern-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 92px;
  padding: 14px 10px;
  border-radius: 22px;
  background: #FFFCF4;
  border: 2px dashed var(--line);
}
.pattern-tile {
  display: grid;
  place-items: center;
  width: clamp(40px, 12vw, 58px);
  height: clamp(40px, 12vw, 58px);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(74, 53, 20, .09);
}
.pattern-tile svg { width: 78%; height: 78%; }
.pattern-slot {
  background: #FFF3D6;
  border: 3px dashed var(--sun);
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 700;
  color: var(--sun);
  line-height: 1;
}
.pattern-win { animation: popWin .45s ease; }
@keyframes popWin {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

.pattern-q {
  margin: 18px 0 12px;
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
}
.pattern-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.shape-opt {
  display: grid;
  place-items: center;
  width: clamp(76px, 21vw, 96px);
  height: clamp(76px, 21vw, 96px);
  border-radius: 24px;
  border: 3px solid var(--line);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.shape-opt svg { width: 62%; height: 62%; }
@media (hover: hover) {
  .shape-opt:hover { border-color: var(--teal); transform: translateY(-2px); }
}
.shape-opt:active { transform: scale(.96); }
.shape-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.shape-opt.good { border-color: var(--teal); background: var(--teal-tint); }
.shape-opt.nope { animation: nope .32s ease; }
@keyframes nope {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}
.pattern-msg {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 800;
  font-size: 16px;
  color: var(--teal);
}
.pattern-done { text-align: center; }
.pattern-done p { margin: 0; color: var(--ink-soft); }

/* ---------------------------------------------------------- brave thoughts */
.thoughts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .thoughts { grid-template-columns: 1fr 1fr; } }

.thought-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 16.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.thought-btn .dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--plum-tint);
  border: 3px solid var(--plum);
}
@media (hover: hover) { .thought-btn:hover { border-color: var(--plum); background: #FCFAFF; } }
.thought-btn:active { transform: scale(.985); }
.thought-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.brave-detail { text-align: center; }
.thought-quote {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-size: clamp(20px, 4.4vw, 25px);
  line-height: 1.3;
  color: var(--ink);
  margin: 2px 0 14px;
}
.validation { color: var(--ink-soft); font-size: 17px; margin: 0 0 16px; }

.brave-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 20px;
  border-radius: 22px;
  background: linear-gradient(160deg, #FFF6DF 0%, #FFE9F1 100%);
  border: 2px solid #F3DCC4;
}
.brave-spark { width: 28px; height: 28px; color: var(--sun); }
.brave-text {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(19px, 4.2vw, 23px);
  line-height: 1.4;
  margin: 0;
  color: var(--ink);
}
.brave-detail .row { justify-content: center; }
.brave-detail #braveAction { margin: 14px 0 0; }

/* ---------------------------------------------------------- story */
.story-panel { text-align: center; }
.story-art { margin: 4px auto 16px; max-width: 340px; }
.story-art svg { width: 100%; height: auto; display: block; border-radius: 20px; }

.story-text {
  font-size: clamp(18px, 4.2vw, 21px);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 46ch;
  color: var(--ink);
  min-height: 5.2em;
}
.story-dots { margin: 14px 0 0; font-weight: 800; color: var(--ink-soft); font-size: 14.5px; letter-spacing: .04em; }

/* ---------------------------------------------------------- finish */
.finish-card { text-align: center; padding: 26px 20px 22px; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 0 0 10px; }
.star {
  width: clamp(46px, 13vw, 62px);
  height: auto;
  opacity: 0;
  transform: scale(.6);
  animation: starPop .55s cubic-bezier(.2, 1.25, .5, 1) forwards;
}
.star:nth-child(2) { animation-delay: .14s; }
.star:nth-child(3) { animation-delay: .28s; }
@keyframes starPop {
  to { opacity: 1; transform: scale(1); }
}
.finish-card .h1 { margin-top: 6px; }
.finish-friends {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  margin: 8px 0 16px;
}
.finish-friends img { height: clamp(96px, 26vw, 132px); width: auto; display: block; }
.finish-list {
  list-style: none;
  margin: 0 auto 12px;
  padding: 0;
  max-width: 42ch;
  text-align: left;
}
.finish-list li {
  position: relative;
  padding: 6px 0 6px 30px;
  font-size: 16.5px;
  color: var(--ink);
}
.finish-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  width: 12px;
  height: 7px;
  border-left: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
  transform: rotate(-45deg);
}

/* ---------------------------------------------------------- gate */
.gate { text-align: center; }
.gate-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.gate-options .btn { padding: 0 8px; font-size: clamp(17px, 4.6vw, 20px); }
#gateMsg { margin: 14px 0 0; min-height: 22px; }

/* ---------------------------------------------------------- parent corner */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.setting:first-of-type { padding-top: 4px; }
.setting:last-of-type { border-bottom: 0; padding-bottom: 0; }
.setting-stack { align-items: flex-start; }
.setting-text { flex: 1 1 220px; min-width: 0; }
.setting-title { margin: 0 0 2px; font-weight: 800; font-size: 16.5px; }
.setting-text .muted { margin: 0; }

.switch { position: relative; display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.switch input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.switch-track {
  display: block;
  position: relative;
  width: 62px;
  height: 36px;
  border-radius: 999px;
  background: #DCD3C2;
  transition: background .18s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--teal); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(26px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--ink); outline-offset: 3px; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #F3EADB;
}
.seg-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4A4062;
  font: inherit;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background .16s ease, color .16s ease;
}
.seg-btn[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(74, 53, 20, .14);
}
.seg-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.plain-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}
.plain-list li { margin-bottom: 8px; }
.plain-list li:last-child { margin-bottom: 0; }

#parentSaved { margin: 0; color: var(--ink); font-size: 16.5px; }

/* ---------------------------------------------------------- footer */
.footer {
  flex: 0 0 auto;
  margin-top: 34px;
  padding: 22px 4px 8px;
  border-top: 2px dashed var(--line);
  text-align: center;
  color: var(--ink-soft);
}
.footer p { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.footer .footer-small { font-size: 13.5px; font-weight: 600; opacity: .85; }

/* ---------------------------------------------------------- reduced motion */
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html.reduced-motion .bob { animation: none !important; }
html.reduced-motion .view { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bob { animation: none !important; }
  .view { animation: none !important; }
}

/* ============================================================
   LOST TEMPLE — playable platform game
   ============================================================ */

.choice[data-tone="jungle"] { --tint: #DDEEDC; --tone: #1E7A48; }

.choice-badge {
  flex: 0 0 auto;
  margin-inline-start: 2px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tone);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---- full-screen game shell ---- */

/* meeem-game-frame.css locks html/body to the viewport for a pure game page.
   This app is a scrolling multi-screen hub, so document scrolling has to stay
   available everywhere except while the game itself is open. */
html:has([data-meeem-game]),
body:has([data-meeem-game]) {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body.game-mode { overflow: hidden; }
body.game-mode .topbar,
body.game-mode .footer { display: none !important; }
body.game-mode .app { padding: 0; max-width: none; }
body.game-mode main#main { flex: 1 1 auto; min-height: 0; }

/* The game view pins itself to the whole viewport so the play stage can never
   collapse to zero height inside the scrolling document. */
#view-game {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  width: 100%;
  z-index: 40;
  display: block;
  animation: none;
  background: #0E2F2A;
}
#view-game[hidden] { display: none !important; }

/* Absolute fill + three explicit grid rows. The old flex column with
   percentage heights could resolve the play stage to zero on a phone, which
   left the canvas with no box at all — no canvas, no game. A grid row of
   minmax(80px, 1fr) always hands the stage real space between the HUD and
   the control dock. */
.game-root {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #0E2F2A;
  color: #EEF8EC;
}
.game-root > * { min-width: 0; min-height: 0; }

/* ---- HUD ---- */
.game-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  min-height: 52px;
  background: #113A33;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.hud-cluster { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-cluster-end { margin-inline-start: auto; }
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  color: #EAF7E6;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.hud-star { width: 14px; height: 14px; fill: #FFCE45; flex: 0 0 auto; }
.hud-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #EAF7E6;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .14s ease, transform .1s ease;
}
.hud-btn svg { width: 21px; height: 21px; }
.hud-btn:hover { background: rgba(255, 255, 255, .16); }
.hud-btn:active { transform: scale(.94); }
.hud-btn:focus-visible { outline: 3px solid #FFCE45; outline-offset: 2px; }
.hud-btn[aria-pressed="true"] { background: #FFCE45; color: #33260A; border-color: #FFCE45; }

/* ---- stage ---- */
.game-stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: block;
  overflow: hidden;
  background: #8FD3C8;
}
/* The canvas is pinned to the stage box itself, so it can never be pushed
   out of view (or squeezed to nothing) by flex sizing. */
#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  background: #7FC9BE;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- overlays ---- */
.game-menu {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
  background: rgba(8, 32, 28, .74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
[hidden].game-menu { display: none !important; }

.game-card {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 18px;
  border-radius: 22px;
  background: #FFF8EE;
  color: #2A2342;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.game-kicker {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #1E7A48;
}
.game-heading {
  margin: 0 0 8px;
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(21px, 5.4vw, 27px);
  line-height: 1.16;
  color: #2A2342;
}
.game-lead {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.5;
  color: #5D5578;
}
.game-tip {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: #6C6486;
}
.game-how {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}
.game-how li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #EFF7EE;
  border: 2px solid #D6E7D4;
  font-size: 13.5px;
  font-weight: 700;
  color: #2A2342;
}
.how-key {
  font-weight: 900;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: #1E7A48;
}
.game-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.btn-game {
  width: 100%;
  max-width: 320px;
  min-height: 56px;
  background: #1E7A48;
  font-size: 17px;
  border-radius: 16px;
}
.game-card .btn.secondary {
  min-height: 50px;
  font-size: 15.5px;
  padding: 0 18px;
  flex: 1 1 auto;
}

.done-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.done-star svg { width: clamp(34px, 10vw, 46px); height: auto; fill: #DFD6C6; transition: fill .2s ease; }
.done-star.lit svg { fill: #FFCE45; }

/* ---- touch controls ---- */
.game-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 12px;
  background: #113A33;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.pad-group { display: flex; gap: 10px; }

.pad-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 74px;
  height: 64px;
  padding: 0;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #2C7266 0%, #1B4F46 100%);
  color: #EAF7E6;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, filter .12s ease;
}
.pad-btn svg { width: 30px; height: 30px; }
.pad-btn.is-down { transform: translateY(2px) scale(.96); filter: brightness(1.35); }
.pad-btn:focus-visible { outline: 3px solid #FFCE45; outline-offset: 2px; }

.pad-jump {
  width: 104px;
  background: linear-gradient(180deg, #F0C25C 0%, #D2961E 100%);
  border-color: rgba(255, 255, 255, .45);
  color: #3A2606;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .07em;
}
.pad-jump svg { width: 26px; height: 26px; }

@media (max-width: 359px) {
  .pad-btn { width: 64px; height: 58px; }
  .pad-jump { width: 90px; }
  .hud-chip { font-size: 12px; padding: 5px 9px; }
}

@media (min-width: 900px) {
  .pad-btn { width: 86px; height: 68px; }
  .pad-jump { width: 120px; }
  .game-controls { padding: 12px 26px 14px; }
  .game-hud { padding: 10px 22px; }
}

/* ============================================================
   HUB ADDITIONS — books, friendship, faces, founders, shop
   ============================================================ */

.ic { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
.ic.big { width: 40px; height: 40px; }

.band { margin-top: 34px; }
.band-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.band-title {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 4vw, 26px);
  margin: 0;
  color: var(--ink);
}
.linkbtn {
  border: 0;
  background: none;
  color: var(--teal);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 4px;
}
.linkbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

.feature {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: 24px;
  border: 2px solid #D6E7D4;
  background: linear-gradient(160deg, #EAF7EE 0%, #F8FBEF 100%);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
.feature:active { transform: scale(.985); }
.feature:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) { .feature:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(74, 53, 20, .11); } }
.feature-art {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  color: #1E7A48;
}
.feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-title { font-weight: 800; font-size: 18px; }
.feature-sub { font-size: 14.5px; color: var(--ink-soft); }

/* ---- book cards ---- */
.book-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 12px; }
@media (min-width: 700px) { .book-grid { grid-template-columns: 1fr 1fr; } }

.book-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.book-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--sun-tint);
  color: #8A5B0B;
  display: grid;
  place-items: center;
}
.book-status {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.book-status.out { background: #E4F3E7; color: #1B6340; }
.book-status.soon { background: #F0ECFB; color: #4A3280; }
.book-status.interest { background: #FFF0C7; color: #7A5407; }
.book-title {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
  margin: 6px 0 0;
  color: var(--ink);
}
.book-ages { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--ink-soft); }
.book-blurb { margin: 6px 0 0; font-size: 15.5px; color: var(--ink-soft); }
.book-act { margin: 8px 0 0; font-size: 15px; color: var(--ink); }
.book-note { margin: 10px 0 0; font-size: 12.5px; color: #7A7290; }
.book-card .btn { margin-top: 10px; width: 100%; }
.book-head { padding: 2px 2px 14px; }
.book-head .h1 { margin-bottom: 8px; }

/* ---- activities ---- */
.act-q { font-weight: 800; font-size: 17px; margin: 0 0 10px; color: var(--ink); }
.act-lead { margin: 0 0 14px; font-size: 16.5px; color: var(--ink); line-height: 1.55; }
.act-count { font-weight: 800; color: var(--teal); margin: 12px 0 0; }
.act-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.act-icon { display: flex; justify-content: center; color: var(--teal); margin-bottom: 6px; }
.act-done p { margin: 0; color: var(--ink-soft); }

.breath-mini {
  width: min(120px, 34vw);
  aspect-ratio: 1 / 1;
  margin: 6px auto 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #F0FBF7 0%, #B4E3D8 48%, #6FC0AE 100%);
  box-shadow: 0 0 0 8px rgba(111, 192, 174, .14);
  animation: breathMini 6s ease-in-out infinite;
}
@keyframes breathMini {
  0%, 100% { transform: scale(.72); }
  50% { transform: scale(1); }
}

.wiggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 0 28px;
  border-radius: 22px;
  border: 3px solid #D99A2B;
  background: var(--sun-tint);
  color: #5A3D06;
  font: inherit;
  font-weight: 900;
  font-size: 19px;
  cursor: pointer;
  margin-top: 6px;
  -webkit-tap-highlight-color: transparent;
}
.wiggle-btn:active { transform: scale(.96); }
.wiggle-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #FFFDF8;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  cursor: pointer;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .14s ease, background .14s ease;
}
@media (hover: hover) { .quiz-opt:hover { border-color: var(--teal); background: #FFFCF4; } }
.quiz-opt:active { transform: scale(.99); }
.quiz-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.quiz-feedback {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #FFF1E6;
  border: 2px solid #F3D3BB;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
.quiz-feedback.good { background: #E7F5EA; border-color: #BFE3C8; }

/* ---- colouring ---- */
.color-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.swatch {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--line);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.swatch:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tool {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.tool.on { background: var(--teal-tint); border-color: var(--teal); }
.color-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 460;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #fff;
  touch-action: none;
}
.color-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#outlineCanvas { pointer-events: none; }

/* ---- funny faces ---- */
.face-panel { text-align: center; }
.face-prompt {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(18px, 4.4vw, 23px);
  line-height: 1.3;
  margin: 0 0 14px;
  color: var(--ink);
}
.face-stage { width: min(190px, 52vw); margin: 0 auto 14px; }
.face-stage svg { width: 100%; height: auto; display: block; }
.face-finish { display: flex; justify-content: center; color: var(--teal); }
.mirror-wrap {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: #000;
}
#mirrorVideo { display: block; width: 100%; height: auto; transform: scaleX(-1); }

/* ---- stickers & founders ---- */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}
.sticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 18px;
  border: 2px dashed var(--line);
  background: #FFFCF6;
  opacity: .55;
}
.sticker.on {
  opacity: 1;
  border-style: solid;
  border-color: var(--sc);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.sticker-ic {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #F1EDE3;
  color: #8A8298;
}
.sticker.on .sticker-ic { background: var(--sc); color: #fff; }
.sticker-label { font-size: 12.5px; font-weight: 800; text-align: center; color: var(--ink-soft); line-height: 1.25; }

.founder-card { text-align: center; }
.badge-medal {
  width: 78px; height: 78px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sun-tint);
  color: #8A5B0B;
  box-shadow: 0 0 0 6px rgba(245, 184, 51, .22);
}
.founder-card p { margin: 0 0 8px; color: var(--ink-soft); }

/* ---- friendship ---- */
.locked-card { text-align: center; }
.locked-card p { color: var(--ink-soft); }
.friend-list { display: flex; flex-direction: column; gap: 10px; }
.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 18px;
  background: #FFFCF6;
  border: 2px solid var(--line);
}
.friend-avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sky-tint);
  color: #1E4D80;
  font-weight: 900;
  font-size: 18px;
}
.friend-name { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.small-btn { min-height: 44px; padding: 0 14px; font-size: 14.5px; }
.msg-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.msg-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.msg-btn:active { transform: scale(.97); }
.msg-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sent-line {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--teal-tint);
  color: #12564F;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.invite-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.invite-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 2px dashed var(--line-deep);
  background: #FFFDF7;
}
.invite-code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--ink);
}
.invite-exp { font-size: 12.5px; color: var(--ink-soft); max-width: 90px; line-height: 1.3; }
.qr-slot {
  width: 52px; height: 52px;
  border-radius: 10px;
  border: 2px dashed var(--line-deep);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #8A8298;
  text-align: center;
  line-height: 1.15;
}
.log-list { font-size: 15px; }
.admin-h {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin: 20px 0 6px;
  color: var(--ink);
}

/* ---- parent nav & shop ---- */
.parent-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.pnav {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pnav[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.pnav:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.preview-tag {
  display: inline-block;
  vertical-align: middle;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #FFF0C7;
  color: #7A5407;
  padding: 5px 9px;
  border-radius: 999px;
  margin-inline-start: 8px;
}

.shop-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: #fff;
  margin-bottom: 10px;
}
.shop-main { flex: 1 1 220px; min-width: 0; }
.shop-name { margin: 0 0 2px; font-weight: 800; font-size: 16px; color: var(--ink); }
.shop-main .muted { margin: 0; }

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #FFFCF6;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder { color: #9C93AC; }
input[type="text"]:focus,
input[type="email"]:focus { outline: 3px solid var(--sky); outline-offset: 2px; border-color: var(--sky); }
input:disabled { opacity: .6; }