/* LET Junior Kids — built on the LET Junior Design System tokens (hue-*, ink-*, surface-*,
   radius-*, shadow-pop, ease-bounce) and the letjunior.com scenery: sky, clouds, mountains, hills.
   Text on a coloured field uses the deep (--d) shade, never white-on-bright: the DS flags the
   bright hues as below 4.5:1 for white text, the deep shades all clear it. */

/* Subset of Twemoji Mozilla (CC-BY 4.0, github.com/mozilla/twemoji-colr) covering only the
   emoji this app actually uses, so 🔥 looks the same hand-drawn way on Windows, Android, iOS
   and macOS instead of falling back to whatever emoji font each OS ships. unicode-range keeps
   the browser from touching this font for ordinary text, and it falls through to system emoji
   for any glyph not in the subset. */
@font-face {
  font-family: "LET Emoji";
  src: url("../assets/fonts/twemoji-subset.woff2") format("woff2");
  unicode-range: U+203C, U+2049, U+2122, U+2139, U+2194-2199, U+21A9-21AA, U+231A-231B, U+2328,
    U+23CF, U+23E9-23FA, U+24C2, U+25AA-25FE, U+2600-27BF, U+2934-2935, U+2B05-2B07, U+2B1B-2B1C,
    U+2B50, U+2B55, U+3030, U+303D, U+3297, U+3299, U+FE0F, U+200D, U+1F000-1FFFF;
  font-display: swap;
}

/* Fluent Emoji (3D style, CC-BY 4.0, github.com/microsoft/fluentui-emoji), fetched by
   tools/build-emoji-3d.mjs. js/emoji3d.js auto-swaps every emoji text node in the app for one
   of these; sizing off font-size keeps each icon the size the text glyph would have been. */
.emoji-3d { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; object-fit: contain; }

:root {
  --hue-orange: #ff7a1a; --hue-gold: #ffc93c; --hue-mint: #2ec4b6; --hue-green: #3dbe64; --hue-sky: #4fa8ff;
  --hue-pink: #ff4fa0; --hue-purple: #8b5cf6; --hue-coral: #ff5c5c; --hue-teal: #00cec9;
  --brand-primary: #6c5ce7; --brand-accent: #ffa24c;
  --ink-900: #2b2140; --ink-700: #4a3f63; --ink-500: #6f6781; --ink-200: #e4dfee;
  --surface-bg: #fff8ee; --surface-card: #ffffff;
  --font-display: "LET Emoji", "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-body: "LET Emoji", "Nunito", "Quicksand", system-ui, sans-serif;
  --radius-sm: 10px; --radius-md: 18px; --radius-lg: 26px; --radius-pill: 999px;
  --shadow-card: 0 8px 20px rgba(43, 33, 64, .10);
  --shadow-pop: 0 4px 0 rgba(43, 33, 64, .18);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 120ms; --dur-med: 220ms;
  --sky-top: #6db8ff; --sky-mid: #a9d8ff; --sky-low: #dff1ff;
  --tabbar-h: 84px;
  color-scheme: light;
}

/* one class per hue: c = bright fill, d = deep fill that carries white text, t = tint */
.h-orange { --c: #ff7a1a; --d: #c2410c; --t: #ffe3c2; }
.h-gold   { --c: #ffc93c; --d: #9a6700; --t: #fff1c2; }
.h-mint   { --c: #2ec4b6; --d: #0f766e; --t: #cff5f0; }
.h-green  { --c: #3dbe64; --d: #1f7a3d; --t: #d8f5de; }
.h-sky    { --c: #4fa8ff; --d: #1d5fbf; --t: #dceeff; }
.h-pink   { --c: #ff4fa0; --d: #be185d; --t: #ffdcee; }
.h-purple { --c: #8b5cf6; --d: #5b3ee0; --t: #e9e1ff; }
.h-coral  { --c: #ff5c5c; --d: #c62828; --t: #ffe0de; }
.h-teal   { --c: #00cec9; --d: #0e7c79; --t: #cff7f4; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body); color: var(--ink-700); font-size: 16px; line-height: 1.5;
  background: var(--sky-mid); overflow-x: hidden; touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, option { font: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink-900); margin: 0; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 3px; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ================================ scenery ================================ */

.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-low) 100%); }
.cloud { position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 60px;
  box-shadow: inset 0 -10px 0 #e3f1ff; opacity: .95; animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 26px; top: -40px; }
.cloud::after { width: 100px; height: 100px; left: 70px; top: -56px; }
.cloud.c1 { top: 12%; left: -10%; transform: scale(.9); animation-duration: 95s; }
.cloud.c2 { top: 30%; left: 40%; transform: scale(.6); animation-duration: 140s; animation-delay: -60s; }
.cloud.c3 { top: 6%; left: 70%; transform: scale(1.1); animation-duration: 120s; animation-delay: -30s; }
.cloud.c4 { top: 48%; left: 10%; transform: scale(.5); animation-duration: 160s; animation-delay: -100s; opacity: .8; }
@keyframes drift { from { translate: -30vw 0; } to { translate: 130vw 0; } }

.sun { position: absolute; top: 90px; right: 4%; width: 120px; height: 120px; }
.sun .sun-rays { position: absolute; inset: 0; animation: spin 40s linear infinite; }
.sun .face { position: absolute; inset: 24px; border-radius: 50%; background: #ffc93c; box-shadow: inset -6px -8px 0 #f5a524; }
.sun .face::before, .sun .face::after { content: ""; position: absolute; top: 32%; width: 9px; height: 12px; border-radius: 50%; background: var(--ink-900); }
.sun .face::before { left: 30%; } .sun .face::after { right: 30%; }
.sun .smile { position: absolute; left: 50%; top: 56%; width: 26px; height: 13px; translate: -50% 0; border: 4px solid var(--ink-900); border-top: 0; border-radius: 0 0 26px 26px; }
.sun .cheek { position: absolute; top: 52%; width: 12px; height: 7px; border-radius: 50%; background: #ff8fb8; }
.sun .cheek.l { left: 16%; } .sun .cheek.r { right: 16%; }
@keyframes spin { to { rotate: 360deg; } }

.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 230px; }
@media (min-width: 960px) { .hills { height: 300px; } }

/* =============================== app shell =============================== */

#app { position: relative; z-index: 1; min-height: 100dvh; }
.shell { min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }

.topbar { position: sticky; top: 0; z-index: 20; padding: 10px 12px 0; }
.topbar-in { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 22px;
  padding: 8px 10px; box-shadow: 0 6px 0 rgba(43, 33, 64, .06), var(--shadow-card); }
.me-chip { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.me-chip .mini { width: 44px; height: 50px; flex: none; }
.me-chip .who { min-width: 0; display: grid; justify-items: start; gap: 3px; }
a.icon-btn { text-decoration: none; }
.me-chip .name { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); font-size: 17px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--d); background: var(--t); padding: 2px 8px; border-radius: 99px;
  white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stat { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 12px 0 8px; border-radius: 99px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink-900); background: var(--t); flex: none; }
.stat .ico { font-size: 20px; line-height: 1; }
.stat.bump { animation: bump .3s var(--ease-bounce); }
@keyframes bump { 50% { transform: scale(1.18); } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: #f4f0fb; flex: none; transition: transform var(--dur-fast) var(--ease-bounce); }
.icon-btn:active { transform: scale(.9); }
/* teacher: the language the whole class sees */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 3px; border-radius: 99px; background: #f4f0fb; flex: none; }
.lang-switch .ls-label { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-700, #5b5470); padding: 0 6px 0 8px; white-space: nowrap; }
.lang-switch button { height: 34px; padding: 0 12px; border-radius: 99px; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-700, #5b5470); transition: background .2s, color .2s, transform .2s var(--ease-bounce); }
.lang-switch button.on { background: #00a39f; color: #fff; box-shadow: 0 3px 0 #0e7c79; }
.lang-switch button:active { transform: scale(.94); }
.lang-switch .ls-short { display: none; }
@media (max-width: 700px) { .lang-switch .ls-label, .lang-switch .ls-long { display: none; } .lang-switch .ls-short { display: inline; } .lang-switch button { padding: 0 10px; } }
.hide-sm { display: none; }
@media (min-width: 560px) { .hide-sm { display: inline-flex; } }

.main { max-width: 1120px; margin: 0 auto; padding: 16px 16px 0; }

/* bottom tab bar (mobile) → side rail (desktop) */
.tabbar { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 7px 7px 11px;
  background: #fff; border-radius: 28px; box-shadow: 0 -2px 0 rgba(43,33,64,.04), 0 12px 30px rgba(43, 33, 64, .22); }
.tab .dot { position: absolute; top: 6px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--hue-coral); border: 2px solid #fff; animation: pulse 1.6s 3; }
@keyframes pulse { 50% { transform: scale(1.25); } }

.brand { display: none; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; padding-bottom: 60px; }
  .topbar { grid-column: 2; padding: 16px 24px 0; }
  .main { grid-column: 2; padding: 20px 24px 0; width: 100%; }
  .tabbar { position: fixed; left: 16px; top: 16px; bottom: 16px; right: auto; width: 234px; height: auto;
    grid-template-columns: 1fr; grid-auto-rows: 64px; align-content: start; padding: 16px 12px; border-radius: 30px; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 18px; }
  .tab .dot { top: 12px; right: 14px; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; margin-bottom: 4px; border-bottom: 2px dashed var(--ink-200); }
  .brand img { width: 46px; height: 46px; border-radius: 14px; }
  .brand b { font-family: var(--font-display); font-size: 21px; color: var(--ink-900); line-height: 1; }
  .brand small { display: block; font-size: 12px; color: var(--ink-500); font-weight: 700; }
}

/* ============================== typography =============================== */

.title-xl { font-size: clamp(34px, 7vw, 56px); font-weight: 700; paint-order: stroke fill; -webkit-text-stroke: 8px #fff; letter-spacing: -.5px; }
.title-lg { font-size: clamp(26px, 5vw, 38px); paint-order: stroke fill; -webkit-text-stroke: 6px #fff; }
.mark { background: linear-gradient(transparent 52%, var(--hue-gold) 52% 90%, transparent 90%); padding: 0 4px; -webkit-text-stroke: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--d, var(--brand-primary)); background: #fff; padding: 5px 14px; border-radius: 99px; box-shadow: 0 4px 0 var(--c, var(--hue-purple)); }
.lead { font-size: 17px; color: var(--ink-700); }
.muted { color: var(--ink-500); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 4px 12px; }
.section-head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.section-head h2 .sdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }

/* ================================ surfaces =============================== */

.card { background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 18px; position: relative; }
.chunky { position: relative; border-radius: var(--radius-lg); background: var(--d); color: #fff; padding: 20px; overflow: hidden;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--d) 70%, #000), 0 18px 30px rgba(43, 33, 64, .18); }
.chunky h2, .chunky h3 { color: #fff; }
.chunky::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none; }
.chunky .big-ico { position: absolute; right: 16px; top: 12px; font-size: 64px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.15)); animation: float 3.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-4deg); } }
.tap { transition: transform var(--dur-med) var(--ease-bounce), box-shadow var(--dur-fast); cursor: pointer; }
@media (hover: hover) { .tap:hover { transform: translateY(-4px); } }
.tap:active { transform: translateY(5px) !important; box-shadow: 0 2px 0 color-mix(in srgb, var(--d, #ccc) 70%, #000); }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .play-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }

/* ================================ controls =============================== */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px;
  border-radius: var(--radius-pill); background: var(--d, #5b3ee0); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 18px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--d, #5b3ee0) 65%, #000); transition: transform var(--dur-fast), box-shadow var(--dur-fast); white-space: nowrap; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--d, #5b3ee0) 65%, #000); }
@media (hover: hover) { .btn:hover { filter: brightness(1.07); } }
.btn.white { background: #fff; color: var(--d, #5b3ee0); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.btn.ghost { background: #f4f0fb; color: var(--ink-900); box-shadow: 0 4px 0 var(--ink-200); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { background: var(--ink-200); color: var(--ink-500); box-shadow: 0 4px 0 #cfc8de; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--t, #f4f0fb); color: var(--d, var(--ink-700)); font-weight: 800; font-size: 13px; }
.chip.on-dark { background: rgba(255,255,255,.2); color: #fff; }

.bar { height: 14px; border-radius: 99px; background: var(--ink-200); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--c, var(--hue-purple));
  transition: width 800ms var(--ease-bounce); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
.bar > i::after { content: ""; position: absolute; inset: 3px 8px auto 8px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.55); }
.bar.on-dark { background: rgba(255,255,255,.25); }
.bar.on-dark > i { background: #fff; }

/* ============================== motion helpers ============================= */

.fresh .rise > *, .fresh .rise-self { animation: rise .55s var(--ease-bounce) both; }
.fresh .rise > *:nth-child(2) { animation-delay: 60ms; } .fresh .rise > *:nth-child(3) { animation-delay: 120ms; }
.fresh .rise > *:nth-child(4) { animation-delay: 180ms; } .fresh .rise > *:nth-child(5) { animation-delay: 240ms; }
.fresh .rise > *:nth-child(6) { animation-delay: 300ms; } .fresh .rise > *:nth-child(n+7) { animation-delay: 360ms; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes popin { 0% { opacity: 0; transform: scale(.5); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes wobble { 20% { transform: translateX(-8px) rotate(-3deg); } 40% { transform: translateX(7px) rotate(3deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes rattle { 25% { rotate: -9deg; } 50% { rotate: 8deg; } 75% { rotate: -5deg; } }
.wobble { animation: wobble .45s ease; }
.rattle { animation: rattle .4s ease; }
.shimmer { position: relative; overflow: hidden; }
.shimmer::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%);
  transform: translateX(-100%); animation: shine 3.2s ease-in-out infinite; pointer-events: none; z-index: 1; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }

/* ================================ play tab ================================= */

.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; }
.hello h1 { font-size: clamp(30px, 6vw, 44px); paint-order: stroke fill; -webkit-text-stroke: 7px #fff; }
.hello p { font-weight: 700; color: var(--ink-900); margin-top: 6px; }

.quest-card { min-height: 190px; display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; }
.hello { flex-wrap: wrap; }
.hello .chip { white-space: nowrap; }
a.btn, a.chunky { text-decoration: none; }
@media (max-width: 700px) { .sun { top: 64px; right: -18px; transform: scale(.62); opacity: .9; } }
.quest-card .kicker { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; opacity: .92; }
.quest-card h3 { font-size: 30px; max-width: 70%; }
.quest-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; align-items: center; }
.quest-card .go { margin-left: auto; }
.quest-card.done { filter: saturate(.55); }
.stamp { position: absolute; right: 18px; bottom: 18px; z-index: 2; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--d);
  background: #fff; padding: 6px 16px; border-radius: 99px; rotate: -6deg; box-shadow: 0 4px 0 rgba(0,0,0,.2); animation: popin .5s var(--ease-bounce) both; }

.act-list { display: grid; gap: 12px; }
.act { text-align: left; width: 100%; display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 22px; padding: 12px 14px 12px 12px;
  box-shadow: 0 5px 0 var(--t), var(--shadow-card); }
.act .ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: var(--c); flex: none;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.14); }
.act .txt { flex: 1; min-width: 0; }
.act h4 { font-size: 18px; }
.act .sub { font-size: 14px; color: var(--ink-500); font-weight: 700; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.act .tick { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hue-green); color: #fff; font-weight: 900; flex: none; }
.act .coin { font-family: var(--font-display); font-weight: 700; color: #9a6700; background: #fff1c2; padding: 4px 10px; border-radius: 99px; flex: none; }

.goal { display: flex; gap: 16px; align-items: center; }
.tower { width: 92px; height: 130px; flex: none; }

/* drag and drop in the games (js/ui.js dragKit) */
.held { transform: translateY(-8px) scale(1.1) !important; box-shadow: 0 10px 0 var(--hue-gold), 0 16px 26px rgba(0,0,0,.2) !important; outline: 3px solid var(--hue-gold); z-index: 5; }
.drag-ghost { position: fixed; z-index: 999; pointer-events: none; translate: -50% -50%; font-size: 44px; filter: drop-shadow(0 10px 10px rgba(0,0,0,.25)); }
.drop-hot { outline: 4px dashed var(--hue-gold); outline-offset: 4px; }

/* =================================== map =================================== */

.node { --d: #8a8398; position: relative; width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 42px;
  background: var(--c); border: 6px solid #fff; box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 65%, #000), 0 14px 24px rgba(43,33,64,.2);
  transition: transform var(--dur-med) var(--ease-bounce); }
.node.locked { background: #cfc9dc; box-shadow: 0 8px 0 #a79fbb, 0 14px 24px rgba(43,33,64,.15); filter: grayscale(.2); }
.node.locked > span { opacity: .45; }
.node .lock { position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 17px; box-shadow: var(--shadow-pop); }
.node.open { animation: breathe 1.8s ease-in-out infinite; }
.node.open::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 4px dashed #fff; animation: spin 12s linear infinite; }
@keyframes breathe { 50% { transform: scale(1.07); } }
.node .star { position: absolute; top: -10px; right: -8px; font-size: 26px; animation: popin .5s var(--ease-bounce) both; }
.node-card { flex: 1; background: #fff; border-radius: 22px; padding: 12px 16px; box-shadow: var(--shadow-card); min-width: 0; }
.node-card small { font-family: var(--font-display); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--d); font-size: 12px; }
.node-card h3 { font-size: 20px; }
.node-card p { font-size: 14px; color: var(--ink-500); font-weight: 700; }
.play-bubble { position: absolute; top: -40px; left: 50%; translate: -50% 0; background: #fff; color: var(--d); font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 4px 14px; border-radius: 99px; box-shadow: 0 4px 0 var(--c); white-space: nowrap; animation: float 1.6s ease-in-out infinite; }
.world-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

/* ================================ group tab ================================ */

.lb { display: grid; gap: 10px; }
.lb-row { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow-card); }
.lb-row.me { outline: 4px solid var(--hue-gold); box-shadow: 0 6px 0 var(--hue-gold), var(--shadow-card); }
.lb-row .rank { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; background: #f4f0fb; color: var(--ink-900); flex: none; }
.lb-row .rank.m1 { background: var(--hue-gold); } .lb-row .rank.m2 { background: #dfe3ec; } .lb-row .rank.m3 { background: #f3c29b; }
.lb-row .av { width: 48px; height: 56px; flex: none; }
.lb-row .txt { flex: 1; min-width: 0; }
.lb-row b { font-family: var(--font-display); font-size: 18px; color: var(--ink-900); }
.lb-row .xp { font-family: var(--font-display); font-weight: 700; color: var(--brand-primary); white-space: nowrap; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 8px 0 18px; }
.podium .p { display: flex; flex-direction: column; align-items: center; width: 31%; max-width: 150px; }
.podium .p .av { width: 70px; height: 82px; }
.podium .p .blk { width: 100%; border-radius: 18px 18px 8px 8px; display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: #fff; background: var(--d);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--d) 65%, #000); animation: grow .7s var(--ease-bounce) both; transform-origin: bottom; }
.podium .p b { font-family: var(--font-display); color: var(--ink-900); margin: 4px 0; }
@keyframes grow { from { transform: scaleY(0); } }

.feed { display: grid; gap: 12px; }
.post { background: #fff; border-radius: 22px; padding: 14px; box-shadow: var(--shadow-card); display: grid; gap: 10px; }
.post .top { display: flex; gap: 12px; align-items: center; }
/* who wrote it: a teacher message or shout-out gets a coloured frame; app news stays plain */
.post.k-msg, .post.k-shout, .post.k-auto { position: relative; margin-top: 8px; }
.post.k-msg { box-shadow: inset 0 0 0 3px var(--hue-purple), var(--shadow-card); }
.post.k-shout { box-shadow: inset 0 0 0 3px var(--hue-pink), var(--shadow-card); }
.kind-pill { position: absolute; top: -11px; right: 14px; padding: 2px 10px; border-radius: 99px; font: 700 12px/18px var(--font-display); color: #fff; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.k-msg .kind-pill { background: var(--hue-purple); }
.k-shout .kind-pill { background: var(--hue-pink); }
.k-auto .kind-pill { background: #f4f0fb; color: var(--ink-500); box-shadow: none; }
.post .pic { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--t); flex: none; }
.post .what { font-weight: 700; color: var(--ink-900); }
.post .when { font-size: 12px; color: var(--ink-500); font-weight: 700; }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.react { height: 38px; min-width: 46px; padding: 0 10px; border-radius: 99px; background: #f4f0fb; font-size: 18px; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; transition: transform var(--dur-fast) var(--ease-bounce); }
.react span { font-size: 18px; }
.react.on { background: var(--hue-gold); box-shadow: 0 3px 0 #e0a100; }
.react:active { transform: scale(.85); }
.react { position: relative; }
.react.pop { animation: react-bump .45s var(--ease-bounce); }
.react.pop span { animation: react-spin .5s var(--ease-bounce); }
.react .fly { position: absolute; left: 50%; bottom: 60%; font-size: 26px; font-style: normal; pointer-events: none; animation: react-fly .8s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes react-bump { 40% { transform: scale(1.18); } 70% { transform: scale(.94); } }
@keyframes react-spin { 0% { transform: scale(.4) rotate(-25deg); } 60% { transform: scale(1.35) rotate(10deg); } 100% { transform: none; } }
@keyframes react-fly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .react.pop, .react.pop span { animation: none; } .react .fly { display: none; } }
.react-sum { font-size: 13px; font-weight: 700; color: var(--ink-500); }
.react-sum summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; max-width: 100%; }
.react-sum summary::-webkit-details-marker { display: none; }
.react-sum summary:hover { color: var(--ink-900); text-decoration: underline; }
.react-sum .rfaces { display: inline-flex; }
.react-sum .rfaces i { width: 24px; height: 24px; border-radius: 50%; background: #f4f0fb; display: grid; place-items: center; font-size: 15px; font-style: normal; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(43,33,64,.2); }
.react-sum .rfaces i + i { margin-left: -6px; }
.react-sum ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.react-sum li { display: flex; align-items: center; gap: 8px; color: var(--ink-900); }
.react-sum li span { font-size: 18px; }

/* ================================== me tab ================================= */

.hero-me { display: grid; gap: 16px; align-items: center; text-align: center; }
@media (min-width: 720px) { .hero-me { grid-template-columns: 260px 1fr; text-align: left; } }
.avatar-stage { position: relative; height: 270px; border-radius: 26px; background: radial-gradient(circle at 50% 110%, #9be07a 0 38%, transparent 38.5%), linear-gradient(#dff1ff, #bfe3ff); display: grid; place-items: end center; overflow: hidden; }
.avatar-stage .big { width: 190px; height: 220px; margin-bottom: 10px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15); position: relative; transition: transform var(--dur-fast) var(--ease-bounce); }
.sw.on { transform: scale(1.18); outline: 3px solid var(--ink-900); }
.sw .pr { position: absolute; bottom: -10px; left: 50%; translate: -50% 0; font-size: 10px; font-weight: 900; background: #fff1c2; color: #9a6700; padding: 0 5px; border-radius: 8px; white-space: nowrap; }
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 42px; padding: 0 16px; border-radius: 99px; background: #fff; font-family: var(--font-display); font-weight: 600; color: var(--ink-700); box-shadow: 0 3px 0 var(--ink-200); white-space: nowrap; flex: none; }
.seg button.on { background: var(--ink-900); color: #fff; box-shadow: 0 3px 0 #000; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.item { background: #fff; border-radius: 22px; padding: 12px; text-align: center; box-shadow: 0 5px 0 var(--ink-200), var(--shadow-card); display: grid; gap: 6px; justify-items: center; }
.item .prev { width: 90px; height: 90px; display: grid; place-items: center; font-size: 48px; background: #f7f3ff; border-radius: 20px; }
.item b { font-family: var(--font-display); color: var(--ink-900); }
.item.owned { box-shadow: 0 5px 0 var(--hue-green), var(--shadow-card); }
.price { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; color: #7a5200; background: #fff1c2; padding: 3px 12px; border-radius: 99px; }

/* ============================== sheets & overlays ============================ */

.veil { position: fixed; inset: 0; z-index: 60; background: rgba(43, 33, 64, .45); backdrop-filter: blur(3px); animation: fade .2s both; display: flex; align-items: flex-end; justify-content: center; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 720px; max-height: 92dvh; overflow-y: auto; background: var(--surface-bg); border-radius: 30px 30px 0 0; padding: 12px 18px calc(24px + env(safe-area-inset-bottom));
  animation: sheetUp .45s var(--ease-bounce) both; overscroll-behavior: contain; }
.sheet .grab { width: 54px; height: 6px; border-radius: 6px; background: var(--ink-200); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; position: sticky; top: -12px; background: var(--surface-bg); padding: 8px 0; z-index: 4; }
.sheet-head h2 { font-size: 26px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@media (min-width: 760px) { .veil { align-items: center; } .sheet { border-radius: 30px; animation-name: popin; } }

.full { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; text-align: center; padding: 24px; overflow: hidden; }
.full.purple { background: radial-gradient(circle at 50% 40%, #7247ef, #4527b8 70%); color: #fff; }
.full.orange { background: radial-gradient(circle at 50% 40%, #e2601c, #b23a0a 72%); color: #fff; }
.full.teal { background: radial-gradient(circle at 50% 40%, #11897f, #0b5f5b 72%); color: #fff; }
.full.sky { background: linear-gradient(var(--sky-top), var(--sky-low)); }
.full h1 { color: #fff; font-size: clamp(40px, 10vw, 76px); text-shadow: 0 5px 0 rgba(0,0,0,.18); }
.full.sky h1 { color: var(--ink-900); text-shadow: none; paint-order: stroke fill; -webkit-text-stroke: 8px #fff; }
.full .in { position: relative; z-index: 2; display: grid; gap: 16px; justify-items: center; max-width: 520px; animation: popin .6s var(--ease-bounce) both; }
.full .huge { font-size: 110px; line-height: 1; filter: drop-shadow(0 10px 0 rgba(0,0,0,.15)); animation: float 2.4s ease-in-out infinite; }
.full p { font-size: 19px; font-weight: 700; }
.rays { position: absolute; left: 50%; top: 42%; width: 200vmax; height: 200vmax; translate: -50% -50%; z-index: 1;
  background: repeating-conic-gradient(rgba(255,255,255,.1) 0 10deg, transparent 10deg 20deg); animation: spin 30s linear infinite; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

.toast { position: fixed; z-index: 130; left: 50%; top: 84px; translate: -50% 0; background: var(--ink-900); color: #fff; font-family: var(--font-display); font-weight: 600;
  padding: 10px 20px; border-radius: 99px; box-shadow: 0 6px 0 rgba(0,0,0,.25); animation: toast 2.2s var(--ease-bounce) both; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-20px) scale(.8); } 12%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* reward panel after a game */
.reward { display: grid; gap: 16px; justify-items: center; width: min(420px, 100%); }
.reward .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.reward .pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.18); padding: 10px 18px; border-radius: 20px; font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.reward .xpbox { width: 100%; background: rgba(255,255,255,.14); border-radius: 22px; padding: 14px 16px; text-align: left; }
.reward .xpbox b { font-family: var(--font-display); font-size: 17px; }
.chest-btn { font-size: 120px; line-height: 1; animation: shake 1.1s ease-in-out infinite; filter: drop-shadow(0 12px 0 rgba(0,0,0,.2)); }
@keyframes shake { 0%, 60%, 100% { transform: rotate(0); } 65% { transform: rotate(-10deg) scale(1.05); } 75% { transform: rotate(10deg) scale(1.08); } 85% { transform: rotate(-6deg); } }
.chest-btn.open { animation: burst .6s var(--ease-bounce) forwards; }
@keyframes burst { 40% { transform: scale(1.4); } 100% { transform: scale(0); opacity: 0; } }

/* =============================== game player ================================= */

.game { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; animation: fade .25s both;
  background: radial-gradient(70% 90px at 15% 100%, #a6e37f 97%, transparent 100%) bottom / 100% 110px no-repeat,
    radial-gradient(90% 70px at 80% 100%, #74cc55 97%, transparent 100%) bottom / 100% 80px no-repeat,
    linear-gradient(var(--sky-top), var(--sky-low)); }
.game-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 14px 10px; }
.game-top .x { width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 22px; font-weight: 900; color: var(--ink-700); box-shadow: 0 4px 0 rgba(0,0,0,.12); flex: none; }
.game-top .bar { flex: 1; height: 20px; background: rgba(255,255,255,.7); }
.game-top .bar > i { background: var(--hue-green); }
.game-top .t { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); background: #fff; padding: 6px 14px; border-radius: 99px; white-space: nowrap; font-size: 15px; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 12px 16px 28px; overflow-y: auto; }
.prompt { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink-900); background: #fff; padding: 8px 20px; border-radius: 99px; box-shadow: var(--shadow-pop); }
.picture { width: 170px; height: 170px; border-radius: 40px; background: #fff; display: grid; place-items: center; font-size: 104px; box-shadow: 0 8px 0 var(--ink-200), var(--shadow-card); animation: popin .5s var(--ease-bounce) both; }
/* placement test: the question, then three big answers. A pick is never marked right or wrong */
.pl-show { min-width: 170px; min-height: 150px; padding: 12px 24px; border-radius: 40px; background: #fff; display: grid; place-items: center; font-size: 96px; box-shadow: 0 8px 0 var(--ink-200), var(--shadow-card); animation: popin .5s var(--ease-bounce) both; }
.pl-show.text { font-family: var(--font-display); font-size: clamp(28px, 7vw, 44px); color: var(--ink-900); }
.pl-answers { width: min(520px, 100%); }
.pl-answers .btn.picked { transform: scale(.96); outline: 4px solid #fff; }
.picture.speak { font-size: 80px; background: var(--hue-purple); box-shadow: 0 8px 0 #5b3ee0; cursor: pointer; }
.picture.speak.talking { animation: bump .5s ease infinite; }
.slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 12px; border-radius: 26px; background: rgba(255,255,255,.55); min-height: 88px; min-width: 200px; border: 3px dashed rgba(255,255,255,.9); }
.slot { width: 58px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.7); border: 3px dashed var(--ink-200); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink-900); }
.slot.filled { background: var(--hue-green); color: #fff; border: 0; box-shadow: 0 5px 0 #2a9a4c; animation: popin .35s var(--ease-bounce) both; }
.tiles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 560px; }
.ltile { width: 62px; height: 66px; border-radius: 18px; background: #fff; font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink-900);
  box-shadow: 0 6px 0 var(--c, var(--hue-orange)); touch-action: none; user-select: none; transition: transform var(--dur-fast) var(--ease-bounce), opacity var(--dur-med); animation: popin .4s var(--ease-bounce) both; }
.ltile:active { transform: translateY(4px); }
.ltile.used { opacity: 0; pointer-events: none; transform: scale(.4); }
.wchip { padding: 12px 18px; border-radius: 18px; background: #fff; font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink-900); box-shadow: 0 6px 0 var(--c, var(--hue-purple));
  touch-action: none; user-select: none; transition: transform var(--dur-fast) var(--ease-bounce), opacity var(--dur-med); animation: popin .4s var(--ease-bounce) both; }
.wchip.used { opacity: 0; pointer-events: none; }
.slots .wchip.placed { background: var(--hue-green); color: #fff; box-shadow: 0 5px 0 #2a9a4c; animation-duration: .35s; }
.cards { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 10px; width: min(560px, 100%); }
.mcard { aspect-ratio: 3/4; perspective: 700px; }
.mcard .fl { position: relative; width: 100%; height: 100%; transition: transform .45s var(--ease-bounce); transform-style: preserve-3d; }
.mcard.up .fl, .mcard.got .fl { transform: rotateY(180deg); }
.mcard .fa, .mcard .ba { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; }
.mcard .fa { background: var(--hue-purple); box-shadow: 0 6px 0 #5b3ee0; font-size: 34px; color: #fff; background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,.25) 0 14%, transparent 15%), radial-gradient(circle at 70% 75%, rgba(255,255,255,.18) 0 10%, transparent 11%); }
.mcard .ba { background: #fff; box-shadow: 0 6px 0 var(--ink-200); transform: rotateY(180deg); font-size: clamp(30px, 9vw, 52px); font-family: var(--font-display); font-weight: 700; color: var(--ink-900); padding: 4px; }
.mcard .ba.word { font-size: clamp(13px, 3.6vw, 20px); word-break: break-word; }
.mcard.got .ba { background: var(--hue-green); color: #fff; box-shadow: 0 6px 0 #2a9a4c; }
.mcard.got { animation: bump .4s var(--ease-bounce); }
.buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(560px, 100%); }
.bucket { min-height: 150px; border-radius: 26px; background: var(--d); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 24px; box-shadow: 0 8px 0 color-mix(in srgb, var(--d) 65%, #000); transition: transform var(--dur-med) var(--ease-bounce); }
.bucket .cnt { font-size: 15px; background: rgba(255,255,255,.2); padding: 2px 10px; border-radius: 99px; }
.bucket.yum { transform: scale(1.06); }
.sort-card { padding: 20px 30px; border-radius: 24px; background: #fff; font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--ink-900); box-shadow: 0 8px 0 var(--ink-200), var(--shadow-card); touch-action: none; user-select: none; animation: popin .4s var(--ease-bounce) both; }
.timer { width: min(560px, 100%); height: 12px; }
.timer > i { transition: width linear; }
.pad { position: relative; width: min(320px, 78vw); aspect-ratio: 1; background: #fff; border-radius: 32px; box-shadow: 0 8px 0 var(--ink-200), var(--shadow-card); touch-action: none; }
.pad svg { width: 100%; height: 100%; }
.traced { display: flex; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 44px; color: var(--ink-900); min-height: 56px; }
.traced span { animation: popin .4s var(--ease-bounce) both; }
.traced span.todo { color: rgba(43,33,64,.2); }
.good { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--hue-green); animation: popin .4s var(--ease-bounce) both; paint-order: stroke fill; -webkit-text-stroke: 6px #fff; }

/* ================================ auth & doors =============================== */

.center-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 260px; gap: 24px; text-align: center; }
.logo-big { width: 104px; height: 104px; border-radius: 30px; box-shadow: 0 8px 0 rgba(0,0,0,.12); animation: popin .6s var(--ease-bounce) both; }
.doors { display: grid; gap: 18px; width: min(980px, 100%); }
@media (min-width: 760px) { .doors { grid-template-columns: repeat(3, 1fr); } }
.door { min-height: 210px; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.door h2 { font-size: 30px; }
.door p { font-weight: 700; opacity: .95; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; width: min(760px, 100%); }
.face { background: #fff; border-radius: 26px; padding: 12px 8px 14px; box-shadow: 0 6px 0 var(--t, var(--ink-200)), var(--shadow-card); display: grid; justify-items: center; gap: 4px; }
.face .av { width: 88px; height: 100px; }
.face b { font-family: var(--font-display); font-size: 20px; color: var(--ink-900); }
.pin-dots { display: flex; gap: 12px; justify-content: center; }
.pin-dots i { width: 54px; height: 54px; border-radius: 18px; background: rgba(255,255,255,.7); border: 3px dashed #fff; display: grid; place-items: center; font-size: 30px; font-style: normal; }
.pin-dots i.filled { background: #fff; border: 0; box-shadow: var(--shadow-pop); animation: popin .3s var(--ease-bounce) both; }
.pin-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(380px, 100%); }
.pin-pad button { aspect-ratio: 1; border-radius: 22px; background: #fff; font-size: 38px; box-shadow: 0 6px 0 var(--ink-200); transition: transform var(--dur-fast); }
.pin-pad button:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink-200); }
.code-in { width: min(300px, 100%); height: 70px; border-radius: 22px; border: 0; text-align: center; font-family: var(--font-display); font-size: 34px; letter-spacing: 6px; text-transform: uppercase; color: var(--ink-900); box-shadow: 0 6px 0 var(--ink-200), var(--shadow-card); }
.hint { font-size: 13px; font-weight: 700; color: var(--ink-700); background: rgba(255,255,255,.75); padding: 6px 14px; border-radius: 99px; }
.back-link { position: fixed; top: 14px; left: 14px; z-index: 5; }

/* ============================== parent & teacher ============================== */

.adult { max-width: 980px; margin: 0 auto; padding: 18px 16px 280px; }
.adult-top { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow-card); margin-bottom: 18px; }
.adult-top img { width: 42px; height: 42px; border-radius: 12px; }
.adult-top b { font-family: var(--font-display); font-size: 19px; color: var(--ink-900); flex: 1; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num { border-radius: 16px; padding: 10px 8px; background: var(--t); text-align: center; }
.num b { display: block; font-family: var(--font-display); font-size: 24px; color: var(--ink-900); line-height: 1.1; }
.num span { font-weight: 800; color: var(--ink-700); font-size: 12px; line-height: 1.2; display: block; margin-top: 2px; }
.p-hero { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; }
.p-hero .p-av { width: 56px; height: 66px; flex: none; }
.p-hero h1 { margin-bottom: 4px; }
.p-week, .p-prog { display: grid; gap: 10px; align-content: start; }
.p-week h3, .p-prog h3, .p-play h3 { font-size: 18px; }
.p-week-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-week-hd .chip { white-space: nowrap; }
.p-days { display: flex; align-items: center; gap: 10px; }
.p-days > span { font-weight: 800; font-size: 13px; color: var(--ink-700); flex: none; max-width: 76px; line-height: 1.2; }
.p-days .cal { flex: 1; gap: 4px; }
.p-days .cal i { max-width: 26px; margin-top: 2px; }
.p-days .cal i.future { border-width: 2px; }
.p-days .cal div { font-size: 11px; }
.p-prog p { margin: 0; font-size: 14px; }
.p-prog small { display: block; font-weight: 800; color: var(--ink-500); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.p-play { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.p-play > div { flex: 1; min-width: 0; }
.p-play p { margin: 0; font-weight: 700; font-size: 14px; opacity: .95; }
.cal { display: flex; gap: 8px; justify-content: space-between; }
.cal div { flex: 1; text-align: center; font-weight: 800; color: var(--ink-500); font-size: 13px; }
.cal i { display: block; aspect-ratio: 1; max-width: 46px; margin: 4px auto 0; border-radius: 50%; background: #f1edf7; }
.cal i.on { background: var(--hue-green); box-shadow: 0 4px 0 #2a9a4c; }
.cal i.future { background: transparent; border: 3px dashed var(--ink-200); }
details.card summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink-900); }
.roster { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kid { display: grid; gap: 8px; }
.kid .hd { display: flex; align-items: center; gap: 10px; }
.kid .hd .av { width: 48px; height: 56px; }
.kid .facts { display: flex; flex-wrap: wrap; gap: 6px; }
textarea.post-in { width: 100%; min-height: 90px; border-radius: 18px; border: 3px solid var(--ink-200); padding: 12px; font: inherit; resize: vertical; }

/* ============================ the character ============================ */
.av-up { transform-origin: 60px 124px; animation: breathe2 3.2s ease-in-out infinite; }
@keyframes breathe2 { 50% { transform: scale(1.015, 1.035); } }
.av-lid { transform-origin: 60px 68px; animation: blink2 5.4s infinite; }
@keyframes blink2 { 0%, 45%, 49%, 88%, 92%, 100% { transform: scaleY(1); } 47%, 90% { transform: scaleY(.08); } }
.av-look { animation: look 11s ease-in-out infinite; }
@keyframes look { 0%, 20%, 50%, 70%, 100% { transform: translate(0, 0); } 25%, 40% { transform: translate(-3px, 0); } 75%, 90% { transform: translate(3px, -1px); } }
svg.mini, svg.big { width: 100%; height: 100%; overflow: visible; }
.av svg, .avatar-stage svg, .face .av svg { width: 100%; height: 100%; overflow: visible; }


/* ============================= dev panel ============================= */
.dev-btn { position: fixed; right: 12px; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); z-index: 40; width: 44px; height: 44px; border-radius: 50%; background: var(--ink-900); color: #fff; font-size: 20px; box-shadow: 0 4px 0 #000; opacity: .8; }
@media (min-width: 960px) { .dev-btn { bottom: 18px; } }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

/* ========================= student: shortcuts, tiles, switch ========================= */

.coin-btn { cursor: pointer; transition: transform var(--dur-fast) var(--ease-bounce); }
.coin-btn:active { transform: scale(.92); }
.coin-btn .plus { width: 20px; height: 20px; border-radius: 50%; background: var(--hue-gold); color: var(--ink-900); display: grid; place-items: center; font-size: 15px; line-height: 1; margin-left: 2px; }

/* purchase confirmation: what it is, the price, what's left. Above sheets and games. */
.buy-veil { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(43, 33, 64, .55); backdrop-filter: blur(4px); animation: fade .2s both; }
.buy-card { width: min(400px, 100%); background: var(--surface-bg); border-radius: 30px; padding: 24px 20px 20px; text-align: center; display: grid; gap: 14px; justify-items: center;
  box-shadow: 0 10px 0 rgba(0,0,0,.15), 0 24px 50px rgba(43,33,64,.3); animation: popin .4s var(--ease-bounce) both; }
.buy-art { width: 110px; height: 110px; border-radius: 30px; background: #fff; display: grid; place-items: center; font-size: 64px; box-shadow: 0 6px 0 var(--ink-200); margin-top: -64px; }
.buy-art svg { width: 86px; height: 72px; }
.buy-card h2 { font-size: 28px; }
.buy-what { font-weight: 700; color: var(--ink-700); }
.buy-math { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.buy-math > span:not(.op) { flex: 1; display: grid; gap: 2px; background: #fff; border-radius: 16px; padding: 8px 4px; box-shadow: 0 3px 0 var(--ink-200); }
.buy-math small { font-size: 12px; font-weight: 800; color: var(--ink-500); }
.buy-math b { font-family: var(--font-display); font-size: 20px; color: var(--ink-900); white-space: nowrap; }
.buy-math > span.cost { background: #fff1c2; box-shadow: 0 3px 0 #e0a100; }
.buy-math > span.left { background: #d8f5de; box-shadow: 0 3px 0 #3dbe64; }
.buy-math .op { font-family: var(--font-display); font-size: 22px; color: var(--ink-500); }
.buy-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.buy-btns .btn { padding: 0 12px; font-size: 17px; }
.buy-btns .btn:only-child { grid-column: 1 / -1; }

/* ================================ teacher ================================ */

.t-ava { width: 46px; height: 46px; border-radius: 16px; background: #fff1c2; display: grid; place-items: center; font-size: 28px; flex: none; }
.fun-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 900px) { .fun-grid { grid-template-columns: repeat(4, 1fr); } }
.fun { text-align: left; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.fun h3 { font-size: 22px; }
.fun p { font-weight: 700; font-size: 14px; opacity: .95; }
.fun .big-ico { font-size: 48px; }

.group-sec { margin-top: 22px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; flex-wrap: wrap; }
.group-head h2 { font-size: 24px; }
.group-head .sdot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.spacer { flex: 1; }
.kid { text-align: left; width: 100%; }
.kid .kn { font-family: var(--font-display); font-size: 20px; color: var(--ink-900); }
.kid .where { font-size: 13px; font-weight: 700; color: var(--ink-500); }
.card.empty { color: var(--ink-500); font-weight: 700; border: 3px dashed var(--ink-200); box-shadow: none; background: rgba(255,255,255,.75); }
.kid-top { display: flex; gap: 14px; align-items: center; }
.kid-top .av { width: 90px; height: 104px; flex: none; }

.search { width: 100%; height: 54px; border-radius: 18px; border: 0; padding: 0 20px; font-weight: 700; color: var(--ink-900); box-shadow: 0 5px 0 var(--ink-200), var(--shadow-card); }
.acard-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.acard { display: grid; gap: 10px; box-shadow: 0 6px 0 var(--t), var(--shadow-card); }
.acard-main { display: flex; gap: 12px; align-items: center; text-align: left; }
.acard-main .ico { width: 54px; height: 54px; border-radius: 16px; background: var(--c); display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: inset 0 -5px 0 rgba(0,0,0,.14); }
.acard-main h4 { font-size: 19px; }
.acard-main .sub { font-size: 13px; font-weight: 700; color: var(--ink-500); }
.acard .facts, .kid .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-900); }
.prog .bar { flex: 1; }
.faces-row { display: flex; min-height: 8px; }
.faces-row .av { width: 34px; height: 40px; margin-right: -6px; }
.acts-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pick-list { display: grid; gap: 10px; }
.act.sel { outline: 4px solid var(--hue-gold); }

.form { display: grid; gap: 12px; }
.lbl { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); font-size: 16px; display: block; }
.lbl small { display: block; font-family: var(--font-body); font-weight: 700; color: var(--ink-500); font-size: 12px; }
.field { width: 100%; height: 48px; border-radius: 14px; border: 3px solid var(--ink-200); background: #fff; padding: 0 14px; font-weight: 700; color: var(--ink-900); }
.field:focus { border-color: var(--hue-purple); outline: none; }
.field.big { height: 60px; font-family: var(--font-display); font-size: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }   /* inputs line up even when one label has a hint */
.erows { display: grid; gap: 8px; }
.erow { display: flex; gap: 8px; align-items: center; }
.erow .field { flex: 1; min-width: 0; }
.erow .field.emo { flex: 0 0 64px; display: grid; place-items: center; font-size: 28px; padding: 0 4px; color: var(--ink-500); cursor: pointer; }
.erow .field.emo.on { border-color: var(--hue-purple); }
.emoji-pick { display: grid; gap: 8px; padding: 10px; border-radius: 18px; background: #fff; border: 3px solid var(--hue-purple); animation: popin .25s var(--ease-bounce) both; }
.emoji-tools { display: grid; gap: 8px; }
.emoji-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.emoji-chips button { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; background: #f4f0fb; font-weight: 800; font-size: 13px; color: var(--ink-700, var(--ink-900)); }
.emoji-chips button.on { background: var(--hue-purple); color: #fff; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; height: 264px; overflow-y: auto; align-content: start; }
.emoji-grid button[hidden] { display: none; }
.emoji-grid button { height: 44px; border-radius: 12px; font-size: 26px; display: grid; place-items: center; transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast); }
.emoji-grid button:hover { background: #f4f0fb; transform: scale(1.15); }
.erow .field.sel { flex: 0 0 38%; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-pick { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--ink-200); transition: transform var(--dur-fast); }
.type-pick span { font-size: 28px; }
.type-pick b { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-900); }
.type-pick.on { background: var(--t); box-shadow: 0 4px 0 var(--c); outline: 3px solid var(--c); transform: translateY(-2px); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink-900); cursor: pointer; flex-wrap: wrap; position: relative; }
.switch small { font-weight: 700; color: var(--ink-500); }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 52px; height: 30px; border-radius: 99px; background: var(--ink-200); position: relative; transition: background var(--dur-med); flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.15); transition: transform var(--dur-med) var(--ease-bounce); }
.switch input:checked + span { background: var(--hue-green); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.err { background: #ffe0de; color: #9f1f1f; font-weight: 800; padding: 10px 14px; border-radius: 14px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: -24px; background: var(--surface-bg); padding: 12px 0; }
.editor-actions .btn { flex: 1; }
.editor-actions .err { flex-basis: 100%; margin: 0; }   /* in the sticky bar, so a failed save is never out of sight */
.rec-on { background: #c62828 !important; animation: pulse 1s infinite; }
.player-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pp { background: #fff; border-radius: 18px; padding: 8px 4px; display: grid; justify-items: center; box-shadow: 0 4px 0 var(--ink-200); opacity: .6; transition: transform var(--dur-fast), opacity var(--dur-fast); }
.pp .av { width: 54px; height: 62px; }
.pp b { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-900); }
.pp.on { opacity: 1; outline: 3px solid var(--hue-gold); box-shadow: 0 4px 0 var(--hue-gold); transform: translateY(-2px); }
.shout-prev { display: flex; align-items: center; gap: 12px; background: var(--t); border-radius: 18px; padding: 12px 16px; }
.shout-prev span { font-size: 40px; }
.wheel-wrap { position: relative; width: min(340px, 82vw); aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; filter: drop-shadow(0 8px 0 rgba(0,0,0,.12)); }
.wheel-pin { position: absolute; top: -14px; left: 50%; translate: -50% 0; z-index: 2; font-size: 34px; color: var(--ink-900); text-shadow: 0 3px 0 #fff; }
.winner { font-family: var(--font-display); font-size: 26px; color: var(--ink-900); min-height: 34px; }

/* ============================== live duel board ============================== */

.duel { position: fixed; inset: 0; z-index: 90; overflow-y: auto; overflow-x: hidden; color: #fff; background: radial-gradient(circle at 50% 30%, #7247ef, #2e1a86 75%); }
.duel.over { background: radial-gradient(circle at 50% 35%, #e2601c, #9a2f06 75%); }
.duel-in { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; min-height: 100%; padding: calc(16px + env(safe-area-inset-top)) 16px 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.duel-top { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; align-items: center; }
.dq { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 8vw, 72px); line-height: 1.1; background: #fff; color: var(--ink-900); border-radius: 36px; padding: 24px 32px; min-width: min(420px, 90vw); box-shadow: 0 10px 0 rgba(0,0,0,.2); animation: popin .45s var(--ease-bounce) both; }
.dq.emo { font-size: clamp(90px, 22vw, 170px); padding: 10px 40px; }
.dq[data-say] { cursor: pointer; }
.duel .ask { font-family: var(--font-display); font-size: clamp(20px, 4vw, 30px); font-weight: 600; }
.dtimer { width: min(560px, 90vw); height: 18px; }
.dtimer > i { transition: none; }
.dtimer.late > i { background: var(--hue-gold); }
.answer { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 6vw, 48px); min-width: 200px; padding: 10px 28px; border-radius: 22px; border: 4px dashed rgba(255,255,255,.5); color: rgba(255,255,255,.7); }
.answer.on { border: 0; background: #1f7a3d; color: #fff; box-shadow: 0 6px 0 #145228; animation: popin .4s var(--ease-bounce) both; }
.duel-ctl { display: flex; gap: 12px; }
.dplayers { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; margin-top: auto; }
.dplayer { width: 130px; background: rgba(255,255,255,.14); border-radius: 24px; padding: 10px 8px 12px; display: grid; justify-items: center; gap: 2px; color: #fff; user-select: none; -webkit-touch-callout: none; transition: transform var(--dur-fast); }
button.dplayer { cursor: pointer; touch-action: manipulation; }
button.dplayer:active { transform: scale(.94); }
.dplayer .av { width: 64px; height: 74px; display: grid; place-items: center; }
.dplayer b { font-family: var(--font-display); font-size: 18px; }
.dplayer .pts { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; background: #fff; color: var(--ink-900); min-width: 56px; border-radius: 99px; padding: 2px 10px; }
.dplayer.me { outline: 4px solid var(--hue-gold); }
.dplayer.pop { animation: bump .5s var(--ease-bounce) 2; background: rgba(255,201,60,.35); }
.duel .kick { font-family: var(--font-display); letter-spacing: 2px; text-transform: uppercase; }
.duel h1 { color: #fff; font-size: clamp(36px, 8vw, 64px); text-shadow: 0 5px 0 rgba(0,0,0,.2); }
@media (max-width: 560px) { .dplayer { width: 96px; padding: 8px 4px; } .dplayer .av { width: 46px; height: 54px; } .dplayer b { font-size: 15px; } .dplayer .pts { font-size: 26px; } .dq { padding: 14px 20px; } }
.payout { font-family: var(--font-display); font-size: 24px; background: rgba(255,255,255,.18); padding: 8px 20px; border-radius: 99px; }

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

/* ============================== Flappy Flight ============================== */

.fly { position: fixed; inset: 0; z-index: 70; background: var(--sky-low); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; animation: fade .25s both; }
.fly canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fly-hud { position: absolute; inset: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 0; pointer-events: none; }
.fly-hud[hidden] { display: none; }
.fly-hud > * { pointer-events: auto; }
.fly-x { width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 22px; font-weight: 900; color: var(--ink-700); box-shadow: 0 4px 0 rgba(0,0,0,.12); flex: none; }
.fly-hud .bar { flex: 1; height: 18px; background: rgba(255,255,255,.7); }
.fly-hud .bar > i { background: var(--hue-green); transition: width .25s; }
.fly-coins { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink-900); background: #fff; padding: 7px 14px; border-radius: 99px; box-shadow: var(--shadow-pop); white-space: nowrap; }
.fly-coins.bump { animation: bump .3s var(--ease-bounce); }
.fly-layer { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(70px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); pointer-events: none; }
.fly-layer > * { pointer-events: auto; }
.fly-hint { pointer-events: none !important; align-self: end; margin-bottom: 18vh; display: grid; justify-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 6vw, 34px); color: var(--ink-900);
  paint-order: stroke fill; -webkit-text-stroke: 7px #fff; animation: popin .4s var(--ease-bounce) both; }
.fly-hint span { font-size: 44px; -webkit-text-stroke: 0; animation: float 1.2s ease-in-out infinite; }
.fly-card { position: relative; width: min(460px, 100%); max-height: 100%; overflow-y: auto; background: #fff; border-radius: var(--radius-lg); padding: 22px 18px; text-align: center;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; box-shadow: 0 8px 0 rgba(43,33,64,.18), var(--shadow-card); animation: popin .45s var(--ease-bounce) both; }
.fly-card h2 { font-size: clamp(24px, 6.5vw, 32px); color: var(--ink-900); line-height: 1.15; }
.fly-card p { font-weight: 700; color: var(--ink-700); }
.fly-card .q { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--hue-purple); color: #fff; }
.fly-card > .fly-x { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; font-size: 18px; background: #f4f0fb; }
.fly-kicker { font-family: var(--font-display); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; color: var(--hue-purple); }
.fly-replays { font-size: 14px; margin: -4px 0 8px; color: var(--ink-500, #8a8398) !important; }
.fly-big { font-size: 72px; line-height: 1; animation: float 2.4s ease-in-out infinite; }
.fly-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.fly-pill { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--ink-900); background: #fff4d6; padding: 8px 16px; border-radius: 18px; }
.fly-answers { display: grid; gap: 12px; }
.fly-answers .btn { font-size: 21px; min-height: 58px; white-space: normal; }
.fly-answers .btn.right { background: var(--hue-green); box-shadow: 0 5px 0 #1f7a3d; }
.fly-answers .btn.nope { opacity: .4; }
.fly-say { font-size: 18px; animation: popin .35s var(--ease-bounce) both; }
.fly-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fly-stage { position: relative; aspect-ratio: 1; border-radius: 20px; background: var(--c); box-shadow: 0 5px 0 var(--d); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 28px;
  display: grid; place-items: center; padding-bottom: 12px; text-shadow: 0 2px 0 var(--d); }
.fly-stage small { position: absolute; bottom: 6px; left: 0; right: 0; font-size: 12px; text-shadow: none; }
.fly-stage:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--d); }
.fly-stage.done { opacity: .8; }
.fly-stage.next { animation: bump 1.4s ease-in-out infinite; outline: 4px solid var(--hue-gold); outline-offset: 2px; }
.fly-stage.locked { background: var(--ink-200); box-shadow: 0 5px 0 #cfc8de; color: var(--ink-500); text-shadow: none; font-size: 22px; }
.fly-shield-on { font-weight: 800; color: var(--hue-sky); }
@media (max-width: 360px) { .fly-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .fly-stage.next, .fly-hint span, .fly-big { animation: none; } }

/* ------------------------------- Word Catcher ------------------------------- */

.fly-lives { display: flex; gap: 1px; font-size: 20px; background: #fff; padding: 5px 10px; border-radius: 99px; box-shadow: var(--shadow-pop); }
.fly-lives i { font-style: normal; }
.fly-lives i.pop { animation: burst .5s var(--ease-bounce) reverse; }
.fly-banner { position: absolute; inset: calc(66px + env(safe-area-inset-top)) 0 auto; width: max-content; max-width: calc(100% - 32px); margin: 0 auto; pointer-events: none; display: grid; justify-items: center;
  background: var(--d); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 5vw, 24px); padding: 8px 22px 10px; border-radius: 22px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--d) 65%, #000); white-space: nowrap; animation: popin .5s var(--ease-bounce) both; }
.fly-banner[hidden] { display: none; }
.fly-banner small { font-size: 13px; opacity: .85; font-weight: 600; }
.catch-cats { display: grid; gap: 8px; text-align: left; }
.catch-cat { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 18px; background: #f7f4fc; }
.catch-cat .ce { font-size: 26px; width: 34px; text-align: center; }
.catch-cat b { flex: 1; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink-900); }
.catch-lv { display: flex; gap: 8px; }
.catch-lv .fly-stage { width: 46px; font-size: 20px; border-radius: 14px; padding: 0; box-shadow: 0 4px 0 var(--d); }
.catch-lv .fly-stage.locked { font-size: 16px; box-shadow: 0 4px 0 #cfc8de; }
.catch-lv .fly-stage small { position: absolute; top: -8px; right: -6px; bottom: auto; left: auto; font-size: 14px; }
.catch-lv .fly-stage.next { outline-width: 3px; animation: none; }
.fly-banner.mini { padding: 5px 16px 7px; font-size: clamp(16px, 4.4vw, 20px); transition: padding .3s, font-size .3s; }
.fly-banner.mini small { display: none; }

.tile-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.atile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; min-height: 170px; padding: 14px; border-radius: 24px; background: #fff;
  box-shadow: 0 6px 0 var(--c), var(--shadow-card); }
.atile .ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0,0,0,.14); margin-bottom: 6px; }
.atile h4 { font-size: 18px; line-height: 1.15; }
.atile .sub { font-size: 13px; font-weight: 700; color: var(--ink-500); }
.atile .coin { margin-top: auto; font-family: var(--font-display); font-weight: 700; color: #7a5200; background: #fff1c2; padding: 3px 12px; border-radius: 99px; }
.atile .prize { position: absolute; top: 12px; right: 12px; font-size: 22px; animation: float 3s ease-in-out infinite; }
.atile .tick { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--hue-green); color: #fff; font-weight: 900; box-shadow: 0 3px 0 #2a9a4c; }
.atile.done { box-shadow: 0 6px 0 var(--ink-200), var(--shadow-card); }
.atile.done .ico { filter: saturate(.3); opacity: .7; }
.atile.done h4 { color: var(--ink-500); }
@media (max-width: 380px) { .tile-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .atile { min-height: 150px; padding: 12px; } }

/* the Group / Me switch: a sunken track with a raised key-style knob that slides between sides */
.toggle { --pad: 7px; --gap: 8px; position: sticky; top: 80px; z-index: 15; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: var(--pad); margin: 0 auto 18px; max-width: 460px;
  background: #fff; border-radius: 26px; box-shadow: var(--shadow-card); }
.toggle::before { content: ""; position: absolute; inset: var(--pad); border-radius: 18px; background: #efeaf8; box-shadow: inset 0 3px 0 rgba(43,33,64,.08); }
.knob { --edge: color-mix(in srgb, var(--d) 65%, #000); position: absolute; top: var(--pad); left: var(--pad); width: calc((100% - 2 * var(--pad) - var(--gap)) / 2); height: 56px; border-radius: 18px;
  background: var(--d); box-shadow: 0 4px 0 var(--edge); transition: top var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-med); }
.toggle[data-at="1"] .knob { transform: translateX(calc(100% + var(--gap))); }
.toggle:active .knob { top: calc(var(--pad) + 3px); box-shadow: 0 1px 0 var(--edge); }
.toggle.slide-r .knob { animation: knob-r .55s ease-out both; }
.toggle.slide-l .knob { animation: knob-l .55s ease-out both; }
@keyframes knob-r {
  0% { transform: translateX(0); }
  45% { transform: translateX(calc(100% + var(--gap) + 14px)) scale(1.08, .9); }
  70% { transform: translateX(calc(100% + var(--gap) - 5px)) scale(.97, 1.04); }
  100% { transform: translateX(calc(100% + var(--gap))); }
}
@keyframes knob-l {
  0% { transform: translateX(calc(100% + var(--gap))); }
  45% { transform: translateX(-14px) scale(1.08, .9); }
  70% { transform: translateX(5px) scale(.97, 1.04); }
  100% { transform: translateX(0); }
}
.opt { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; padding: 0 10px; min-width: 0; border-radius: 18px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--d); white-space: nowrap; transition: color var(--dur-med); }
.opt .ki { font-size: 30px; line-height: 1; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)) grayscale(.35); opacity: .75; transition: transform var(--dur-med) var(--ease-bounce), opacity var(--dur-med), filter var(--dur-med); }
.opt .kl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.opt.on { color: #fff; }
.opt.on .ki { opacity: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); transform: rotate(-8deg) scale(1.12); }
.toggle[class*="slide"] .opt.on .ki { animation: popin .5s .15s var(--ease-bounce) both; }
.toggle .dot { position: absolute; top: -4px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--hue-coral); border: 2px solid #fff; animation: pulse 1.6s 3; }
@media (min-width: 960px) { .toggle { top: 96px; } }


.btn[data-dim] { filter: saturate(.35) brightness(1.1); }

/* ======================= student: nav, home board, map, panels =======================
   One rule for the child's screens: things stay full size and the board is arranged to fit
   the screen, instead of everything shrinking to fit. Lists that grow scroll sideways. */

@media (min-width: 960px) {
  .shell { grid-template-columns: 124px 1fr; }
  .tabbar { width: 104px; grid-auto-rows: 92px; gap: 10px; padding: 14px 8px; }
  .tab .dot { top: 8px; right: 10px; }
  .brand { justify-content: center; padding: 2px 0 12px; }
  .brand div { display: none; }
  .brand img { width: 56px; height: 56px; }
}

/* sideways strips (teacher tiles, the map) and their arrow buttons */
.hs { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.hs-arrows { display: flex; gap: 6px; margin-left: auto; flex: none; }
.hs-btn { width: 40px; height: 40px; border-radius: 50%; background: #fff; font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--ink-900);
  box-shadow: 0 4px 0 var(--ink-200); transition: transform var(--dur-fast); }
.hs-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink-200); }

/* ---- Home: one screen, no page scroll ----
   Quest strip, minigames, then the teacher's row taking every pixel that's left. The height is
   the viewport minus the top bar and (on phones) the bottom tab bar. */
.bento { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "quest quest" "world world" "teach teach";
  height: calc(100dvh - 206px - env(safe-area-inset-bottom)); min-height: 380px; }
.shell:has(.bento) { padding-bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); }
.b-quest { grid-area: quest; position: relative; }
.b-world { grid-area: world; }
.b-teach { grid-area: teach; }

/* the quest as a compact strip, not a poster */
.b-quest > .quest-card { height: 100%; min-height: 0; padding: 12px 16px; gap: 4px; border-radius: 22px; }
.b-quest .quest-card .kicker { font-size: 11px; max-width: calc(100% - 130px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-quest .quest-card h3 { font-size: 22px; max-width: 72%; }
.b-quest .quest-card .big-ico { font-size: 40px; top: 18px; right: 14px; }
.b-quest .quest-card .meta { margin-top: 4px; gap: 6px; }
.b-quest .quest-card .chip { font-size: 12px; padding: 3px 10px; }
.b-quest .quest-card .btn { min-height: 36px; padding: 0 16px; font-size: 15px; }
.b-quest .quest-card .stamp { right: 14px; bottom: 12px; font-size: 15px; padding: 4px 12px; }
.b-quest .quest-card::after { width: 140px; height: 140px; right: -40px; top: -50px; }
.qs-more { position: absolute; z-index: 3; top: -10px; right: 18px; background: #fff; color: var(--ink-900); font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 4px 12px; border-radius: 99px; box-shadow: 0 4px 0 var(--ink-200), var(--shadow-card); rotate: 2deg; transition: transform var(--dur-fast) var(--ease-bounce); }
.qs-more:active { transform: translateY(3px); }

.b-game { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; min-width: 0; border-radius: 22px; }
.b-game .gi { font-size: 40px; line-height: 1; flex: none; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); animation: float 3.4s ease-in-out infinite; }
.b-game .gt { display: grid; justify-items: start; gap: 3px; min-width: 0; position: relative; z-index: 1; }
.b-game small { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; opacity: .92; }
.b-game b { font-family: var(--font-display); font-size: clamp(17px, 2vw, 22px); line-height: 1.1; }
.b-game .chip { font-size: 12px; padding: 2px 10px; }
/* Mundo LET: a window into the game. The world's own art (worldScene in js/art.js) in parallax
   layers scrolling by, the kids hopping along the ground, stars and a butterfly floating over them. */
.b-world { align-items: flex-start; padding: 16px 18px; min-height: 130px; isolation: isolate; }
.b-world::after { display: none; }
.b-game.b-world { justify-content: flex-start; padding: 14px; }
.b-world .gt { z-index: 2; padding: 8px 18px 10px; border-radius: 20px; background: rgba(14, 124, 121, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 4px 0 rgba(14, 90, 120, .25); }
.b-world small { text-shadow: 0 2px 0 rgba(14, 90, 120, .45); }
.b-world b { white-space: nowrap; font-size: clamp(24px, 3vw, 36px); text-shadow: 0 3px 0 #0e7c79, 0 6px 14px rgba(14, 60, 90, .35); }
.b-world .chip { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(14, 124, 121, .78); }
.gw-play { margin-top: 4px; background: #fff; color: #0e7c79; font-family: var(--font-display); font-weight: 700; font-size: 15px; padding: 5px 16px; border-radius: 99px;
  box-shadow: 0 4px 0 rgba(14, 90, 120, .35); animation: gwPulse 1.6s ease-in-out infinite; }
@keyframes gwPulse { 50% { transform: scale(1.07); } }
.gw-scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; background-size: 100% 100%; pointer-events: none; }
.gw-scene img { max-width: none; user-select: none; }
.gw-l { position: absolute; left: 0; right: 0; bottom: 0; }
.gw-strip { display: flex; height: 100%; width: max-content; animation: gwScroll var(--t, 40s) linear infinite; will-change: transform; }
.gw-strip img { height: 100%; width: auto; flex: none; }
@keyframes gwScroll { to { transform: translateX(-16.6667%); } }   /* six copies: one copy's width, then it loops */
.gw-clouds { top: 0; height: 30%; --t: 160s; }
.gw-mts { height: 74%; bottom: 10%; --t: 130s; }
.gw-hf { height: 56%; bottom: 7%; --t: 75s; }
.gw-hn { height: 46%; bottom: 4%; --t: 46s; }
.gw-ground { height: 36%; --t: 20s; }
.gw-sun, .gw-rays { position: absolute; right: 13%; top: 22%; translate: 50% -50%; }
.gw-sun { height: 34%; }
.gw-rays { height: 56%; animation: spin 40s linear infinite; }
.gw-star { position: absolute; height: 13%; filter: drop-shadow(0 0 8px rgba(255, 220, 90, .9)); animation: gwBob 2.8s ease-in-out infinite; }
.gw-star.s1 { left: 36%; bottom: 52%; }
.gw-star.s2 { left: 52%; bottom: 66%; height: 10%; animation-delay: -.7s; }
.gw-star.s3 { left: 66%; bottom: 46%; animation-delay: -1.4s; }
.gw-star.s4 { left: 82%; bottom: 60%; height: 9%; animation-delay: -2.1s; }
@keyframes gwBob { 50% { transform: translateY(-14%) rotate(14deg) scale(1.08); } }
.gw-bfly { position: absolute; height: 7%; left: 0; bottom: 30%; animation: gwFly 14s linear infinite; }
@keyframes gwFly { 0% { translate: -20px 0; } 25% { translate: 30cqw -40%; } 50% { translate: 55cqw 60%; } 75% { translate: 80cqw -30%; } 100% { translate: calc(100cqw + 20px) 0; } }
.gw-bird { position: absolute; height: 5%; top: 14%; right: 0; animation: gwBird 22s linear infinite; }
@keyframes gwBird { from { translate: 40px 0; } to { translate: calc(-100cqw - 40px) 30%; } }
.gw-scene { container-type: size; }
/* the kids run along the ground (it scrolls under them): hop, squash, land */
.gw-kids { position: absolute; left: 7%; bottom: 10%; height: 34%; display: flex; align-items: flex-end; gap: 2%; }
.gw-kids img { height: 82%; transform-origin: 50% 100%; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); animation: gwHop .62s ease-in-out infinite; }
.gw-kids img:nth-child(2) { height: 100%; animation-delay: -.2s; }
.gw-kids img:nth-child(3) { animation-delay: -.42s; }
@keyframes gwHop { 0%, 100% { transform: translateY(0) scale(1.08, .9); } 45% { transform: translateY(-22%) scale(.95, 1.06) rotate(4deg); } }
@media (max-width: 699px) { .gw-kids { left: auto; right: 4%; height: 46%; } .gw-star.s1 { left: 48%; } .gw-sun, .gw-rays { right: 40%; } }

/* the world runs in this frame over the whole app, and only while it's open */
.world-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 50; background: #a9ddff; }   /* over the app chrome (≤40), under every overlay (≥60): minigames, rewards and class calls show over the world */
html.in-world, html.in-world body { overflow: hidden; }

.b-teach { padding: 12px 12px 4px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex: none; }
.bt-head h2 { font-size: 20px; }
.tile-row { display: flex; gap: 12px; padding: 4px 2px 12px; flex: 1; min-height: 0; }
.tile-row .atile { flex: 0 0 164px; min-height: 0; scroll-snap-align: start; }
.empty-note { font-weight: 700; color: var(--ink-500); padding: 20px 8px; }

@media (max-width: 699px) {
  .b-game .gi { font-size: 34px; }
  .b-game .gt small { display: none; }
  .b-teach .hs-arrows { display: none; }
  .tile-row .atile { flex-basis: 140px; padding: 12px; }
  .b-quest .quest-card h3 { font-size: 20px; }
}
@media (min-width: 700px) {
  .bento { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "quest world world" "teach teach teach"; }
  .b-game { flex-direction: column; align-items: flex-start; justify-content: center; }
  .b-game .gi { font-size: 48px; }
  .b-quest .quest-card h3 { font-size: 28px; }
  .b-quest .quest-card .big-ico { font-size: 56px; }
}
@media (min-width: 960px) {
  /* two equal halves: quest + minigames on top, the teacher's row below */
  .bento { height: calc(100dvh - 142px); gap: 16px; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .b-quest .quest-card { justify-content: center; gap: 10px; }
  .b-quest .quest-card .kicker { font-size: 14px; }
  .b-quest .quest-card h3 { font-size: clamp(32px, 3.4vw, 46px); }
  .b-quest .quest-card .big-ico { font-size: 88px; top: 50%; right: 28px; translate: 0 -50%; }
  .b-quest .quest-card .chip { font-size: 14px; padding: 5px 14px; }
  .b-quest .quest-card .btn { min-height: 48px; padding: 0 26px; font-size: 18px; }
  .b-quest .quest-card .meta { margin-top: 6px; }
  .b-quest .quest-card::after { width: 260px; height: 260px; right: -70px; top: -80px; }
  .qs-more { font-size: 15px; padding: 6px 16px; }
  .b-game { align-items: center; text-align: center; gap: 10px; }
  .b-game .gt { justify-items: center; }
  .b-game .gi { font-size: 80px; }
  .b-game small { font-size: 13px; }
  .b-game b { font-size: clamp(22px, 2.2vw, 30px); }
  .b-game .chip { font-size: 14px; padding: 4px 12px; }
  .tile-row .atile { flex-basis: 180px; }
  .tile-row .atile .ico { width: 76px; height: 76px; font-size: 44px; border-radius: 24px; margin-bottom: 4px; }
  .shell:has(.bento) { padding-bottom: 0; }
  .b-quest > .quest-card { padding: 18px 20px; }
  .tile-row .atile { justify-content: center; align-items: center; text-align: center; gap: 6px; }
  .tile-row .atile h4 { font-size: 22px; }
  .tile-row .atile .sub { font-size: 14px; }
  .tile-row .atile .coin { margin-top: 8px; font-size: 17px; padding: 4px 14px; }
}

/* ---- Map: the winding path down the page (this tab scrolls) ---- */
.map-one { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.map-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-head .eyebrow { white-space: nowrap; }
.map-head b { font-family: var(--font-display); font-size: 17px; color: var(--ink-900); background: rgba(255,255,255,.85); padding: 3px 14px; border-radius: 99px; }
.trail { position: relative; width: 100%; max-width: 620px; margin: 0 auto; padding: 24px 14px 30px; }
.trail svg.path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.node-row { position: relative; display: flex; align-items: center; gap: 14px; height: 150px; }
.node-row.r { flex-direction: row-reverse; text-align: right; }
.world-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 24px; flex-wrap: wrap; }
.world-head::after { display: none; }
.wh-ico { font-size: 40px; line-height: 1; }
.wh-txt { flex: 1; min-width: 140px; }
.wh-txt small { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; }
.wh-txt h2 { font-size: 24px; line-height: 1.1; }
.wh-txt .bar { margin-top: 6px; height: 12px; }
@media (max-width: 699px) { .node-row { height: 132px; } .map-head b { font-size: 15px; } }

/* ---- Group: podium on top, the league underneath (this tab scrolls) ---- */
.group-one { max-width: 720px; margin: 0 auto; }
.group-one .map-head { margin-bottom: 12px; }
.league-one .podium { background: rgba(255,255,255,.55); border-radius: 30px; padding: 22px 10px 0; margin: 0 0 18px; overflow: hidden; }
@media (min-width: 960px) { .league-one .podium .p .av { width: 96px; height: 112px; } }
.feed.news { max-width: 720px; margin: 0 auto; }

/* ---- Me: one screen, no page scroll. Long lists scroll inside their own box. ---- */
.shell:has(.look-one, .shop-one) { padding-bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); }
.look-one, .shop-one { height: calc(100dvh - 290px - env(safe-area-inset-bottom)); min-height: 360px; }
.look-one { display: grid; gap: 12px; grid-template-rows: auto minmax(0, 1fr); }
.look-one .hero-me { background: #fff; border-radius: var(--radius-lg); padding: 10px; box-shadow: var(--shadow-card); grid-template-columns: 120px 1fr; gap: 14px; text-align: left; }
.look-one .avatar-stage { height: 118px; border-radius: 20px; }
.look-one .avatar-stage .big { width: 84px; height: 98px; margin-bottom: 4px; }
.hero-txt { display: grid; justify-items: start; gap: 6px; }
.hero-txt .plate { font-size: 14px; padding: 3px 10px; }
.look-one .title-lg { font-size: 28px; margin: 0; }
.look-one .hero-me .btn { padding: 0 16px; font-size: 16px; }
.shop-one { display: flex; flex-direction: column; }
.shop-one .seg { flex: none; }
.shop-one .shop { flex: 1; min-height: 0; overflow-y: auto; align-content: start; padding: 2px 2px 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.shop-one .item { min-width: 0; padding: 10px 8px; }
.shop-one .item .prev { width: 100%; max-width: 90px; height: auto; aspect-ratio: 1; }
.shop-one .item .prev svg { max-width: 100%; }
.shop-one .item .btn { padding: 0 12px; }
@media (min-width: 960px) {
  .shell:has(.look-one, .shop-one) { padding-bottom: 0; }
  .look-one, .shop-one { height: calc(100dvh - 222px); }
  .look-one { grid-template-columns: minmax(300px, .9fr) minmax(0, 1.3fr); grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .look-one .hero-me { grid-template-columns: 1fr; text-align: center; align-content: center; padding: 18px; }
  .hero-txt { justify-items: center; }
  .look-one .avatar-stage { height: auto; min-height: 200px; max-height: 300px; aspect-ratio: 1.1; }
  .look-one .avatar-stage .big { width: 170px; height: 196px; margin-bottom: 10px; }
  .look-one .title-lg { font-size: 36px; }
  .shop-one .shop { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---- Tab bar: a row of keyboard keys. Each tab is the key itself: tinted with a thick bottom
   edge when up, solid (deep shade, white label) when it is the current tab. Pressing sinks the key;
   the new tab springs back up with a bounce and the old one settles. ---- */
.tab { --edge: color-mix(in srgb, var(--c) 45%, var(--t)); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 18px; background: var(--t); color: var(--d); font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.1;
  box-shadow: 0 4px 0 var(--edge); transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast), background var(--dur-med), color var(--dur-med); }
.tab .ti { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.tab.on { --edge: color-mix(in srgb, var(--d) 65%, #000); background: var(--d); color: #fff; }
.tab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.tab.press { animation: key-press .5s ease-out both; }
.tab.release { animation: key-release .4s ease-out both; }
@keyframes key-press {
  0% { transform: none; }
  25% { transform: translateY(4px) scale(.96); box-shadow: 0 0 0 var(--edge); }
  55% { transform: translateY(-5px) scale(1.05); box-shadow: 0 8px 0 var(--edge); }
  78% { transform: translateY(1px); box-shadow: 0 3px 0 var(--edge); }
  100% { transform: none; box-shadow: 0 4px 0 var(--edge); }
}
@keyframes key-release {
  0% { transform: none; }
  40% { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
  75% { transform: translateY(-2px); box-shadow: 0 6px 0 var(--edge); }
  100% { transform: none; box-shadow: 0 4px 0 var(--edge); }
}
@media (min-width: 960px) { .tab { font-size: 15px; gap: 4px; padding: 0; border-radius: 22px; } .tab .ti { font-size: 36px; } }

/* ---- No scrollbars anywhere. Sideways strips and inner lists fade at the edge instead, so
   a child can see there is more to swipe to. ---- */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
.hs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.tile-row::after { content: ""; flex: 0 0 24px; }
.shop-one .shop { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); padding-bottom: 28px; }

/* ---- Group / Me halves: slide sideways between them (tap the switch or drag with a finger) ---- */
.pane-wrap { position: relative; touch-action: pan-y; }
/* while sliding: clip above and below the box, but let the halves run all the way to the screen
   edge; the main area clips sideways so a half passing the edge never widens the page */
.pane-wrap.sliding { clip-path: inset(-24px -100vw); }
.main { overflow-x: clip; }
.pane-old { position: absolute; left: 0; right: 0; pointer-events: none; }

/* ---- Me: tap the character and it reacts (wave, bounce, jump, spin, wiggle; cross if poked too fast) ---- */
.buddy { overflow: visible; cursor: pointer; width: 100%; -webkit-tap-highlight-color: transparent; }
.buddy svg { transform-origin: 50% 100%; }
.buddy:active svg { transform: scale(1.06, .9); transition: transform 80ms; }
.buddy.r-bounce svg { animation: av-bounce .9s ease-out; }
.buddy.r-jump svg { animation: av-jump .9s ease-out; }
.buddy.r-spin svg { animation: av-spin .9s ease-in-out; }
.buddy.r-wiggle svg { animation: av-wiggle .8s ease-in-out; }
.buddy.r-mad svg { animation: av-mad .6s ease-in-out; }
.buddy.r-wave .av-wave { transform-box: fill-box; transform-origin: 20% 90%; animation: av-wave .28s ease-in-out 4 alternate; }
@keyframes av-bounce { 0%, 40%, 80%, 100% { transform: none; } 10%, 50% { transform: scale(1.15, .82); } 25%, 65% { transform: translateY(-22%) scale(.92, 1.1); } }
@keyframes av-jump { 0%, 100% { transform: none; } 15% { transform: scale(1.18, .8); } 45% { transform: translateY(-45%) scale(.95, 1.08); } 80% { transform: scale(1.12, .88); } }
@keyframes av-spin { 0% { transform: none; } 20% { transform: scale(1.1, .88); } 60% { transform: translateY(-25%) rotate(360deg); } 100% { transform: rotate(360deg); } }
@keyframes av-wiggle { 0%, 100% { transform: none; } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
@keyframes av-mad { 0%, 100% { transform: none; } 15%, 45%, 75% { transform: translateX(-6%) scale(1.04); } 30%, 60%, 90% { transform: translateX(6%) scale(1.04); } }
@keyframes av-wave { from { transform: rotate(-14deg); } to { transform: rotate(18deg); } }
.poke-bubble { position: absolute; top: 6px; left: 50%; z-index: 2; translate: -50% 0; white-space: nowrap; background: #fff; color: var(--ink-900); font-family: var(--font-display); font-weight: 700; font-size: 16px;
  padding: 3px 12px; border-radius: 99px; box-shadow: 0 3px 0 rgba(43,33,64,.12); pointer-events: none; animation: bubble-pop 1.4s var(--ease-bounce) both; }
.poke-bubble.mad { background: var(--hue-coral); color: #fff; }
@keyframes bubble-pop { 0% { opacity: 0; transform: scale(.4) translateY(10px); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@media (min-width: 960px) { .poke-bubble { font-size: 20px; top: 12px; } }

/* ---- Me: the trophy shelf, a sideways row of tiles like "From your teacher" ---- */
.trophy-shelf { grid-area: auto; min-height: 0; }
.atile.locked { background: #f4f0fb; box-shadow: 0 6px 0 var(--ink-200); }
.atile.locked .ico { background: var(--ink-200); box-shadow: none; }
.atile.locked .ico { filter: grayscale(1); opacity: .75; }
.atile.locked h4 { color: var(--ink-500); }
.atile .lock { position: absolute; top: 10px; right: 10px; font-size: 18px; }
.trophy-shelf .atile { justify-content: center; align-items: center; text-align: center; gap: 4px; }
.trophy-shelf .atile .ico { width: 76px; height: 76px; font-size: 44px; border-radius: 24px; margin-bottom: 6px; }
.trophy-shelf .atile h4 { font-size: 19px; }
.trophy-shelf .atile .sub { font-size: 14px; }

/* ---- topbar buttons: tinted, full-strength icons (they used to look switched off) ---- */
.topbar .icon-btn { background: var(--t, #f4f0fb); box-shadow: 0 3px 0 color-mix(in srgb, var(--c, #8b5cf6) 55%, var(--t, #f4f0fb)); }
.topbar .icon-btn:active { transform: translateY(3px); box-shadow: none; }
.topbar .icon-btn .emoji-3d, .topbar .icon-btn { opacity: 1; filter: none; }
@media (hover: hover) { .topbar .icon-btn:hover { transform: translateY(-2px); } }
.bell { position: relative; }
.bell-n { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--hue-coral); color: #fff; border: 2px solid #fff;
  font: 700 12px/16px var(--font-display); font-style: normal; text-align: center; animation: popin .4s var(--ease-bounce) both; }
.notes { display: grid; gap: 8px; }
.note { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; background: #fff; border-radius: 20px; padding: 10px 14px 10px 10px; box-shadow: 0 4px 0 var(--ink-200); transition: transform var(--dur-fast) var(--ease-bounce); }
.note:active { transform: translateY(3px); box-shadow: none; }
@media (hover: hover) { .note:hover { transform: translateY(-2px); } }
.note .pic { width: 44px; height: 44px; border-radius: 14px; background: #f4f0fb; display: grid; place-items: center; font-size: 24px; flex: none; }
.note .txt { flex: 1; min-width: 0; display: grid; }
.note b { font-family: var(--font-display); color: var(--ink-900); font-size: 16px; line-height: 1.2; }
.note small { font-weight: 800; color: var(--ink-500); font-size: 12px; }
.note .chev { font-size: 24px; color: var(--ink-500); }
.notes-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 20px 8px; }
.notes-empty span { font-size: 56px; }
.notes-empty b { font-family: var(--font-display); font-size: 22px; color: var(--ink-900); }
.notes-empty small { font-weight: 700; color: var(--ink-500); }

.item.boost { grid-column: span 2; padding: 14px; }
.item.boost p { font-size: 13px; font-weight: 700; line-height: 1.3; }
.inv { display: flex; gap: 6px; }
.inv .chip { font-size: 14px; }
.fly-shields { font-size: 18px; color: var(--ink-900); }

/* teacher: a placement test's wrong answers, one per line */
.pl-wrong { list-style: none; display: grid; gap: 6px; margin: 0 0 10px; padding: 0; max-height: 220px; overflow-y: auto; }
.pl-wrong li { background: #fff4f2; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 14px; }
.pl-wrong s { color: var(--hue-coral, #ff5c5c); }

/* ================================ lessons ================================
   One card shape everywhere (teacher list, child's class sheet, family page): a calendar-page
   square on the left, topic and hours beside it. Cancelled goes quiet; live gets a pulsing edge. */
/* both apps have five tabs: on the bottom bar they share the width */
@media (max-width: 959px) { .tabbar { grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 7px 5px 11px; } .tab { font-size: 12px; } .tab .ti { font-size: 26px; } }

.lcard { display: grid; gap: 10px; box-shadow: 0 6px 0 var(--t), var(--shadow-card); }
.lcard-main { display: flex; gap: 12px; align-items: center; text-align: left; min-width: 0; }
.lcard-main .txt { display: grid; gap: 2px; min-width: 0; }
.lcard-main h4 { font-size: 19px; overflow-wrap: anywhere; }
.lcard-main .sub { font-size: 13px; font-weight: 700; color: var(--ink-500); }
.lcard-main .kick { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--d); }
.l-date { flex: none; width: 58px; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 var(--t), inset 0 0 0 2px var(--t); overflow: hidden;
  display: grid; justify-items: center; text-align: center; line-height: 1.05; padding-bottom: 5px; }
.l-date small:first-child { width: 100%; background: var(--c); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase; padding: 3px 0; }
.l-date b { font-family: var(--font-display); font-size: 26px; color: var(--ink-900); margin-top: 3px; }
.l-date small:last-child { font-size: 11px; font-weight: 800; color: var(--ink-500); text-transform: uppercase; }
.lcard.off { opacity: .62; }
.lcard.off h4 { text-decoration: line-through; text-decoration-thickness: 2px; }
.lcard.live, .p-class.live { box-shadow: 0 6px 0 var(--t), 0 0 0 3px var(--hue-coral), var(--shadow-card); animation: live-ring 1.8s ease-in-out infinite; }
@keyframes live-ring { 50% { box-shadow: 0 6px 0 var(--t), 0 0 0 7px rgba(255, 92, 92, .25), var(--shadow-card); } }
.live-dot { animation: pulse 1.4s infinite; }
.day-pick { cursor: pointer; }
.day-pick:has(input:checked) { background: var(--hue-mint); color: #fff; }
.day-pick input { accent-color: var(--hue-mint); }
.lesson-hero .kicker { text-transform: none; }
.lesson-hero.is-live { background: #c62828; }

/* the child's class sheet */
.kid-lesson .plan { font-weight: 700; color: var(--ink-700); }
.kid-lesson .words { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-lesson .word { min-height: 44px; padding: 0 14px; border-radius: 99px; background: var(--t); color: var(--d); font-family: var(--font-display); font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 45%, var(--t)); transition: transform var(--dur-fast) var(--ease-bounce); }
.kid-lesson .word:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--t); }
.kid-lesson .unlock { font-weight: 800; color: var(--ink-900); font-size: 14px; }
.up-next { font-size: 18px; margin: 6px 0 -2px; }
.class-chip { cursor: pointer; }
.class-chip.live { background: var(--hue-coral); color: #fff; animation: chip-glow 1.4s ease-in-out infinite; }
@keyframes chip-glow { 50% { box-shadow: 0 0 0 5px rgba(255, 92, 92, .3); } }
.class-chip .n small { font: inherit; }
/* phones: the chip stacks day over time and the coin's "+" goes, so the child's name keeps its room */
@media (max-width: 479px) {
  .class-chip .n { display: grid; line-height: 1; font-size: 15px; } .class-chip .n small { font-size: 11px; opacity: .8; }
  .coin-btn .plus { display: none; }
}
@media (max-width: 339px) { .class-chip .n { display: none; } .class-chip { padding: 0 8px; } }
.b-game.class-locked { filter: saturate(.4); }

/* the family page */
.p-class { display: grid; gap: 8px; --c: var(--hue-mint); --d: #0f766e; --t: #cff5f0; box-shadow: 0 6px 0 var(--t), var(--shadow-card); }
.p-class .lcard-main h4 { font-size: 20px; }
.p-class .plan { margin: 0; }
.p-class .plan .chip { margin: 2px 2px 0 0; }
.p-note { background: #fff1c2; border-radius: 14px; padding: 10px 14px; font-weight: 700; color: var(--ink-900); }
.p-class-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.p-next { border-top: 2px dashed var(--ink-200); padding-top: 8px; }
.p-next .p-row { margin-top: 6px; }
.p-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr); gap: 10px; font-size: 14px; font-weight: 700; align-items: baseline; }
.p-row b { color: var(--ink-900); }
.p-row.off { color: var(--hue-coral); }
.p-row.off span:nth-child(2) { text-decoration: line-through; }
.p-change { background: #ffe0de; box-shadow: 0 6px 0 #ffc2bd, var(--shadow-card); color: #8f1d1d; }
.p-change h3 { color: #8f1d1d; }
.p-change ul { margin: 6px 0 0; padding-left: 20px; font-weight: 700; }
@media (max-width: 479px) { .p-row { grid-template-columns: 1fr auto; } .p-row span:last-child { grid-column: 1 / -1; color: var(--ink-500); } }
@media (prefers-reduced-motion: reduce) { .lcard.live, .p-class.live, .class-chip.live, .live-dot { animation: none; } }
.kid-lesson .about { font-weight: 700; color: var(--ink-500); font-size: 15px; }
.cur-about { font-weight: 700; font-size: 14px; color: var(--ink-500); margin: -4px 0 4px; }
.cur-about:empty { display: none; }

/* Me: level, streak and the two settings that used to crowd the top bar */
.me-level { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: min(320px, 100%); font-weight: 800; }
.me-level b { font-family: var(--font-display); color: var(--ink-900); }
.me-level small { color: var(--ink-500); font-weight: 800; }
.me-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-me .inv .chip { white-space: nowrap; }

/* ---- top bar: essentials on phones and tablets, the full set once there's room ---- */
.lvl-ring { position: relative; width: 44px; height: 44px; flex: none; }
.lvl-ring svg { width: 100%; height: 100%; rotate: -90deg; }
.lvl-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; color: var(--ink-900); }
.top-wide { display: none !important; }
@media (min-width: 800px) {
  .top-wide { display: grid !important; }
  .stat.top-wide { display: inline-flex !important; }
  .me-tools { display: none; }   /* sound and switch player sit in the top bar instead */
}

/* ---- Me hero: a bigger character, then who you are beside your numbers ----
   The page may scroll when the screen is short, so the trophy tiles never get cut. */
.look-one { height: auto; min-height: calc(100dvh - 290px - env(safe-area-inset-bottom)); }
.look-one .hero-me { grid-template-columns: minmax(130px, 34%) 1fr; align-items: stretch; padding: 12px; }
.look-one .avatar-stage { height: auto; min-height: 170px; }
.look-one .avatar-stage .big { width: 128px; height: 148px; margin-bottom: 8px; }
.hero-txt { align-content: center; gap: 12px; }
.hero-id, .hero-stats { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.inv { flex-wrap: wrap; }
@media (min-width: 560px) and (max-width: 719px) {
  .hero-txt { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
  .look-one .avatar-stage { min-height: 200px; }
  .look-one .avatar-stage .big { width: 150px; height: 174px; }
}
.me-level { width: 100%; max-width: 320px; }
@media (max-width: 719px) { .trophy-shelf .tile-row { min-height: 190px; } .trophy-shelf .atile { min-height: 170px; } }
@media (max-width: 559px) {
  .look-one .hero-me { grid-template-columns: 118px 1fr; }
  .look-one .avatar-stage .big { width: 104px; height: 120px; }
  .look-one .title-lg { font-size: 26px; }
  .trophy-shelf .atile .ico { width: 60px; height: 60px; font-size: 34px; }
  .trophy-shelf .atile h4 { font-size: 17px; }
}
@media (min-width: 960px) {
  .look-one { min-height: calc(100dvh - 222px); }
  .look-one .avatar-stage { min-height: 200px; }
  .look-one .avatar-stage .big { width: 170px; height: 196px; }
  .hero-id, .hero-stats { justify-items: center; }
  .me-level { margin: 0 auto; }
}
/* "Level 3 ······ 40 / 150 XP" on top, the bar full width underneath */
.me-level { grid-template-columns: 1fr auto; grid-template-areas: "lv xp" "bar bar"; row-gap: 4px; }
.me-level b { grid-area: lv; } .me-level small { grid-area: xp; } .me-level .bar { grid-area: bar; }
/* phones: character beside the name, the numbers and settings as one full-width row below */
@media (max-width: 559px) {
  .look-one .hero-me { row-gap: 12px; }
  .look-one .hero-txt { display: contents; }
  .look-one .hero-id { align-content: center; }
  .look-one .hero-stats { grid-column: 1 / -1; grid-template-columns: 1fr; justify-items: stretch; }
  .look-one .avatar-stage { min-height: 140px; }
  .me-level { max-width: none; }
  .me-tools .btn { flex: 1; }
}
/* tablets (Me shows look + shop side by side): give the character half of its narrow column */
@media (min-width: 720px) and (max-width: 959px) {
  .me-duo .look-one .hero-me { grid-template-columns: 44% 1fr; }
  .me-duo .look-one .avatar-stage { min-height: 200px; }
  .me-duo .look-one .avatar-stage .big { width: min(140px, 90%); height: auto; aspect-ratio: 190 / 220; }
}
/* tablet/desktop shelf is a wrapping grid: a row is never shorter than its tiles (they overlapped
   when the box was short); the shelf scrolls inside instead */
@media (min-width: 720px) { .trophy-shelf .tile-row.hs { grid-auto-rows: minmax(auto, 1fr); } }

/* ---- child's Class tab: the lesson big on the left, the timetable and past classes beside it ---- */
.class-duo { display: grid; gap: 14px; align-items: start; }
.class-main, .class-side { display: grid; gap: 14px; min-width: 0; }
@media (min-width: 900px) { .class-duo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.class-duo .lesson-hero { min-height: 220px; justify-content: center; }
.class-duo .lesson-hero h3 { font-size: clamp(28px, 4vw, 44px); max-width: 80%; overflow-wrap: anywhere; }
.class-duo .lesson-hero .big-ico { font-size: 64px; top: 22px; right: 22px; }
.class-duo .lesson-hero .btn { min-height: 52px; font-size: 18px; padding: 0 26px; }
.class-plan { display: grid; gap: 10px; }
.class-plan h3 { font-size: 18px; }
.class-box { display: grid; gap: 8px; }
.class-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 2px dashed var(--ink-200); --c: var(--hue-mint); --t: #cff5f0; }
.class-row:nth-child(2) { border-top: 0; }
.class-row .txt { display: grid; gap: 2px; min-width: 0; }
.class-row b { font-family: var(--font-display); color: var(--ink-900); font-size: 17px; }
.class-row small { font-weight: 700; color: var(--ink-500); }
.class-row.off b { text-decoration: line-through; color: var(--ink-500); }
.fb-quote { display: block; margin-top: 4px; background: #fff1c2; border-radius: 12px; padding: 6px 10px; font-weight: 700; font-size: 14px; color: var(--ink-900); }

/* ---- teacher: past lessons with their feedback button ---- */
.past-h { font-size: 18px; margin: 18px 0 8px; }
.past-list { display: grid; gap: 0; padding: 6px 14px; --c: var(--hue-mint); --t: #cff5f0; }
.past-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 2px dashed var(--ink-200); }
.past-row:first-child { border-top: 0; }
.past-row .txt { flex: 1; display: grid; min-width: 0; }
.past-row b { font-family: var(--font-display); color: var(--ink-900); overflow-wrap: anywhere; }
.past-row small { font-weight: 700; color: var(--ink-500); }

/* ---- the full-screen feedback question ---- */
.fb-full { overflow-y: auto; place-items: start center; padding: 20px 16px; }
.fb-in { position: relative; z-index: 2; width: min(620px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; color: #fff; animation: popin .45s var(--ease-bounce) both; margin: auto 0; }
.fb-top { width: 100%; display: flex; align-items: center; gap: 10px; }
.fb-kick { flex: 1; text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .5px; opacity: .95; }
.fb-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fb-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.3); }
.fb-dot.done { background: #9ef0c2; }
.fb-dot.on { outline: 3px solid #fff; outline-offset: 2px; }
.fb-av { width: 120px; height: 140px; filter: drop-shadow(0 8px 0 rgba(0,0,0,.15)); }
.fb-count { font-weight: 800; opacity: .9; margin-bottom: -8px; }
.fb-in h1 { font-size: clamp(30px, 7vw, 48px); }
.fb-text { width: 100%; border: 0; border-radius: 20px; padding: 14px 16px; font: inherit; font-size: 19px; font-weight: 700; color: var(--ink-900); resize: none; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.fb-text:focus { outline: 4px solid #9ef0c2; }
.fb-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fb-preset { background: rgba(255,255,255,.18); color: #fff; font-weight: 800; font-size: 14px; padding: 8px 12px; border-radius: 99px; text-align: left; }
.fb-preset:hover { background: rgba(255,255,255,.3); }
.fb-btns { display: flex; gap: 10px; width: 100%; }
.fb-btns .btn { flex: 1; } .fb-btns [data-fb="back"] { flex: 0 0 56px; }
.fb-btns .btn[disabled] { opacity: .4; }
.fb-absent.on { background: #ffe0de; }
.fb-hint { font-weight: 700; font-size: 14px; opacity: .85; }

.p-fb { display: grid; gap: 10px; align-content: start; background: linear-gradient(160deg, #6d4ff0, #4b32c9); color: #fff; box-shadow: 0 6px 0 #3a25a8, var(--shadow-card); }
.p-fb h3 { font-size: 18px; color: #fff; }
.p-fb-hist { display: grid; gap: 12px; }
.p-fb-hist .p-fb-row { border-top: 2px dashed var(--ink-200); padding-top: 10px; }
.p-fb-hist .p-fb-row:first-child { border-top: 0; padding-top: 0; }
.p-fb-hist small { color: var(--ink-500); }
.p-fb-hist p { color: var(--ink-900); font-weight: 700; margin: 2px 0 0; }
.p-helptxt { margin: 0 0 10px; }
.p-help { text-align: center; }
.p-class > [data-modal] { justify-self: start; }
.p-fb > [data-modal] { justify-self: start; }
/* parent popups are always centred, phone included */
.veil.mid { align-items: center; padding: 16px; }
.veil.mid .sheet { border-radius: 26px; max-width: 520px; max-height: 80dvh; animation-name: popin; }
.veil.mid .grab { display: none; }
.p-fb > .p-fb-row { border-top: 2px dashed rgba(255,255,255,.3); padding-top: 8px; }
.p-fb > .p-fb-row:first-of-type { border-top: 0; padding-top: 0; }
.p-fb-row small { font-weight: 800; color: var(--ink-500); }
.p-fb > .p-fb-row small { color: #d6cbff; }
.p-fb-row p { font-weight: 700; color: var(--ink-900); margin: 2px 0 0; }
.p-fb > .p-fb-row p { color: #fff; }
.p-fb-row p.big { font-size: 19px; line-height: 1.4; }

/* ---- first-visit tour ---- */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-spot { position: fixed; border-radius: 18px; pointer-events: none; opacity: 0; box-shadow: 0 0 0 100vmax rgba(15, 10, 30, .72), inset 0 0 0 3px rgba(255,255,255,.9); transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 24px)); background: #fff; color: var(--ink-900); border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 6px 0 rgba(0,0,0,.18), 0 18px 40px rgba(0,0,0,.35); }
.tour-card.pop { animation: popin .35s var(--ease-bounce) both; }
.tour-card h3 { font-family: var(--font-display); font-size: 22px; margin: 6px 0 4px; }
.tour-card p { font-weight: 700; line-height: 1.4; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e4dfee; }
.tour-dots i.on { background: #8b5cf6; width: 22px; border-radius: 6px; }
.tour-btns { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-card p { white-space: pre-line; }
.tour.flat { background: rgba(15, 10, 30, .72); }
html.tour-lock, html.tour-lock body { overflow: hidden; overscroll-behavior: none; }

/* dress-up: the six Mundo LET characters */
.char-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.char-pick { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink-200); font-family: var(--font-display); font-size: 12px; color: var(--ink-900); }
.char-pick svg { width: 100%; max-width: 56px; height: auto; aspect-ratio: 120 / 170; }
.char-pick.on { outline: 3px solid var(--hue-purple); box-shadow: 0 3px 0 var(--hue-purple); }
@media (max-width: 420px) { .char-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
