@font-face { font-family: "Baloo 2"; font-weight: 500; font-display: swap; src: url(../fonts/baloo-2-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 500; font-display: swap; src: url(../fonts/baloo-2-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-weight: 700; font-display: swap; src: url(../fonts/baloo-2-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 700; font-display: swap; src: url(../fonts/baloo-2-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(../fonts/baloo-2-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(../fonts/baloo-2-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #1E2A4A;
  --ink-soft: #4E6A85;
  --sky: #BDE7FF;
  --sea: #8FD3FF;
  --cream: #FFF7E8;
  --cream-shadow: #E6D7BC;
  --white: #FFFFFF;
  --orange: #FF8A3D;
  --orange-dark: #C85A12;
  --green: #3BB273;
  --green-dark: #2A8A57;
  --purple: #7B5CF0;
  --purple-dark: #5A3FC0;
  --yellow: #FFC93C;
  --pink: #FF9EB5;
  --teal: #2EC4B6;
  --island: #7DD87D;
  --sand: #E9C98A;
  --warn: #FFB454;
  --radius: 28px;
  --unit: clamp(10px, 1.6vmin, 18px);
  --font: "Baloo 2", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--sky); color: var(--ink);
  font-family: var(--font); font-weight: 700;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
body { overflow: hidden; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
button { font-family: inherit; font-weight: 800; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
input, select, textarea { font-family: inherit; -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }
.emoji { font-family: var(--emoji); font-weight: 400; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; animation: screen-in .28s ease-out; }
.screen.cream { background: var(--cream); }
.screen.sky { background: var(--sky); }
.screen.lilac { background: #F3EEFF; }
.screen.ice { background: #EAF6FF; }
.screen.sun { background: #FFE9A8; }
@keyframes screen-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  min-height: 64px; padding: 0 28px; border-radius: 999px; background: var(--white);
  box-shadow: 0 6px 0 var(--cream-shadow); font-size: clamp(20px, 3vmin, 30px);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform .08s, box-shadow .08s;
}
.inline-star { width: 1em; height: 1em; vertical-align: -0.12em; }
.btn { white-space: nowrap; }
.btn svg { width: 1.3em; height: 1.3em; flex: none; }
.btn:active, .round:active, .card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cream-shadow); }
.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 6px 0 var(--orange-dark); }
.btn.go { background: var(--green); color: #fff; box-shadow: 0 6px 0 var(--green-dark); }
.btn.violet { background: var(--purple); color: #fff; box-shadow: 0 6px 0 var(--purple-dark); }
.round {
  width: var(--s, 72px); height: var(--s, 72px); border-radius: 50%; background: var(--white);
  box-shadow: 0 6px 0 var(--cream-shadow); display: inline-flex; align-items: center; justify-content: center;
  flex: none; transition: transform .08s, box-shadow .08s;
}
.round svg { width: 48%; height: 48%; }
.round.primary { background: var(--orange); box-shadow: 0 7px 0 var(--orange-dark); color: #fff; }
.round.go { background: var(--green); box-shadow: 0 7px 0 var(--green-dark); color: #fff; }
.round.violet { background: var(--purple); box-shadow: 0 7px 0 var(--purple-dark); color: #fff; }
.round.ghost { background: rgba(255,255,255,.6); box-shadow: none; }
.round.primary:active { box-shadow: 0 2px 0 var(--orange-dark); }
.round.go:active { box-shadow: 0 2px 0 var(--green-dark); }
.round.violet:active { box-shadow: 0 2px 0 var(--purple-dark); }
.round.big { --s: clamp(96px, 16vmin, 150px); }
.round.mid { --s: clamp(72px, 11vmin, 110px); }
.round.small { --s: 56px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.appear { animation: appear .35s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes appear { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 24px 8px; z-index: 5; }
.progress { flex: 1; height: 22px; border-radius: 11px; background: rgba(30,42,74,.1); overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 11px; background: var(--green); transition: width .5s ease; }
.chip { height: 56px; padding: 0 20px; border-radius: 28px; background: var(--white); display: inline-flex; align-items: center; gap: 10px; font-size: 26px; box-shadow: 0 4px 0 #8DB7D6; }
.chip svg { width: 30px; height: 30px; }

/* ---------- picture rendering ---------- */
.pic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: relative; }
.pic .emoji { font-size: calc(var(--ps, 120px) * .82); }
.pic img { width: 92%; height: 92%; object-fit: cover; border-radius: 18%; }
.pic .blob { width: 74%; height: 74%; border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; box-shadow: inset -10px -12px 0 rgba(0,0,0,.12); border: 4px solid rgba(30,42,74,.12); }
.pic .dots { display: grid; gap: 6%; width: 86%; height: 86%; place-items: center; }
.pic .dots span { font-size: calc(var(--ps, 120px) * .2); }
.pic .letter { display: flex; align-items: baseline; gap: 4%; }
.pic .letter b { font-size: calc(var(--ps, 120px) * .62); line-height: 1; color: var(--purple); }
.pic .letter i { font-style: normal; font-size: calc(var(--ps, 120px) * .45); color: var(--purple); opacity: .8; }
.pic .letter .emoji { font-size: calc(var(--ps, 120px) * .32); }
.pic svg.shape { width: 76%; height: 76%; }

/* ---------- cards ---------- */
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: 0 8px 0 var(--cream-shadow);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .1s, box-shadow .2s;
}
.card.correct { box-shadow: 0 0 0 10px var(--green), 0 8px 0 var(--cream-shadow); animation: hop .5s; }
.card.wrong { box-shadow: 0 0 0 10px var(--warn), 0 8px 0 var(--cream-shadow); animation: wiggle .45s; }
.card.hint { animation: hint 1s ease-in-out infinite; }
.card.dim { opacity: .35; }
@keyframes hop { 30% { transform: translateY(-14px) scale(1.04); } }
@keyframes wiggle { 20% { transform: rotate(-5deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes hint { 0%,100% { box-shadow: 0 0 0 0 rgba(59,178,115,.0), 0 8px 0 var(--cream-shadow); } 50% { box-shadow: 0 0 0 14px rgba(59,178,115,.55), 0 8px 0 var(--cream-shadow); } }

.options { flex: 1; display: flex; flex-wrap: wrap; gap: clamp(14px, 3vmin, 36px); align-items: center; justify-content: center; align-content: center; padding: 8px 24px 24px; }
.options .card { width: var(--cs); height: var(--cs); --ps: var(--cs); }

/* ---------- mascot ---------- */
.bobo { width: var(--bs, 110px); height: var(--bs, 110px); flex: none; }
.bobo .mouth-talk { display: none; }
.bobo.talking .mouth-idle { display: none; }
.bobo.talking .mouth-talk { display: inline; animation: talk .22s infinite alternate; transform-origin: 60px 88px; }
.bobo .eyes { animation: blink 4.5s infinite; transform-origin: 60px 64px; }
.bobo.happy { animation: bob-jump .6s; }
@keyframes talk { from { transform: scaleY(.5); } to { transform: scaleY(1.1); } }
@keyframes blink { 0%, 96%, 100% { transform: scaleY(1); } 98% { transform: scaleY(.1); } }
@keyframes bob-jump { 40% { transform: translateY(-22px) rotate(-6deg); } }
.float { animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.bubble-say { background: var(--white); border-radius: 26px; padding: 14px 24px; font-size: clamp(22px, 3.4vmin, 34px); box-shadow: 0 4px 0 #8DB7D6; display: inline-flex; align-items: center; gap: 12px; }
.prompt-row { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 4px 16px; }

/* ---------- profiles ---------- */
.profiles { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5vmin; padding: 24px; }
.profile-list { display: flex; flex-wrap: wrap; gap: 5vmin; justify-content: center; }
.profile { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: clamp(28px, 5vmin, 44px); }
.profile .face { width: clamp(140px, 24vmin, 220px); height: clamp(140px, 24vmin, 220px); border-radius: 50%; background: var(--white); box-shadow: 0 10px 0 #8DB7D6; display: flex; align-items: center; justify-content: center; font-size: clamp(90px, 15vmin, 140px); }
.corner { position: absolute; top: 16px; right: 16px; }

/* ---------- map ---------- */
.map-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-world { position: relative; height: 100%; }
.map-world svg.path { position: absolute; left: 0; top: 0; pointer-events: none; }
.island { position: absolute; width: 180px; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, -50%); }
.island .land { width: 160px; height: 118px; border-radius: 60px 70px 50px 60px; background: var(--island); box-shadow: 0 10px 0 var(--sand); display: flex; align-items: center; justify-content: center; font-size: 64px; }
.island:nth-child(odd) .land { border-radius: 70px 50px 60px 60px; }
.island.current .land { box-shadow: 0 10px 0 var(--sand), 0 0 0 8px var(--white); }
.island.locked .land { background: #B9D9C2; box-shadow: 0 8px 0 #D8C7A4; filter: saturate(.3); }
.island.locked .land .emoji { opacity: .35; }
.island.lesson .land { background: #FFB4D6; }
.island .name { font-size: 22px; text-shadow: 0 2px 0 rgba(255,255,255,.7); white-space: nowrap; }
.island .stars { font-size: 20px; letter-spacing: 2px; color: #fff; }
.island .stars .on { color: #FF7A1A; }
.island .bobo-here { position: absolute; top: -78px; --bs: 92px; }
.island .lock { position: absolute; top: 34px; width: 40px; height: 40px; }
.island .book { position: absolute; right: -6px; top: -6px; width: 48px; height: 48px; border-radius: 50%; background: var(--white); box-shadow: 0 4px 0 #8DB7D6; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.map-bottom { position: absolute; left: 24px; right: 24px; bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
.map-bottom > * { pointer-events: auto; }
.sunmeter { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 24px; background: var(--white); box-shadow: 0 4px 0 #8DB7D6; }
.sunmeter span { width: 22px; height: 22px; border-radius: 50%; background: #E3EEF6; }
.sunmeter span.on { background: var(--yellow); }
.waves { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: var(--sea); border-radius: 50% 50% 0 0 / 30px 30px 0 0; }

/* ---------- intro ---------- */
.intro { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5vmin; padding: 12px 24px; flex-wrap: wrap; }
.intro .card { width: clamp(220px, 44vmin, 400px); height: clamp(220px, 44vmin, 400px); --ps: clamp(220px, 44vmin, 400px); }
.intro .side { display: flex; flex-direction: column; gap: 2.4vmin; align-items: flex-start; }
.word-big { font-size: clamp(56px, 11vmin, 104px); line-height: 1; }
.word-cs { font-size: clamp(20px, 3vmin, 28px); color: #8A7A5C; }
.row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.footer { display: flex; justify-content: flex-end; align-items: center; padding: 0 24px 24px; min-height: 130px; gap: 16px; }
.footer .msg { flex: 1; font-size: clamp(22px, 3.6vmin, 34px); }

/* ---------- memory ---------- */
.memory { flex: 1; display: grid; gap: 2.4vmin; padding: 8px 4vw 24px; align-content: center; justify-content: center; }
.flip { perspective: 900px; width: var(--cs); height: var(--cs); }
.flip .inner { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.flip.open .inner { transform: rotateY(180deg); }
.flip .face, .flip .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.flip .back { background: var(--purple); box-shadow: 0 8px 0 var(--purple-dark); }
.flip .back svg { width: 40%; height: 40%; }
.flip .face { background: var(--white); box-shadow: 0 8px 0 #B9D3E6; transform: rotateY(180deg); --ps: var(--cs); flex-direction: column; }
.flip .face .txt { font-size: calc(var(--cs) * .24); }
.flip.done .face { background: #DDEFD9; box-shadow: none; }
.flip.done { animation: hop .5s; }

/* ---------- bubbles ---------- */
.bubbles { flex: 1; position: relative; overflow: hidden; }
.bubble { position: absolute; bottom: -200px; width: var(--bsz); height: var(--bsz); border-radius: 50%; --ps: var(--bsz);
  animation: rise var(--dur) linear forwards; }
.bubble .skin { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.95) 0 8%, rgba(255,255,255,.35) 9% 40%, rgba(160,220,255,.35) 41% 100%);
  border: 3px solid rgba(255,255,255,.9); box-shadow: inset 0 0 22px rgba(255,255,255,.6); }
.bubble .pic { width: 74%; height: 74%; }
.bubble.hint .skin { box-shadow: 0 0 0 10px rgba(59,178,115,.75), inset 0 0 22px rgba(255,255,255,.6); }
.bubble.popped, .bubble.nope { animation-play-state: paused; }
.bubble.popped .skin { animation: pop .3s ease-out forwards; }
.bubble.nope .pic { animation: wiggle .45s; }
@keyframes rise { from { transform: translateY(0) translateX(0); } 50% { transform: translateY(calc(-50vh - 100px)) translateX(20px); } to { transform: translateY(calc(-100vh - 260px)) translateX(-10px); } }
@keyframes pop { to { transform: scale(1.6); opacity: 0; } }

/* ---------- speak ---------- */
.speak { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6vmin; flex-wrap: wrap; padding: 12px 24px; }
.speak .card { width: clamp(200px, 38vmin, 320px); height: clamp(200px, 38vmin, 320px); --ps: clamp(200px, 38vmin, 320px); }
.mic-wrap { width: clamp(170px, 26vmin, 230px); height: clamp(170px, 26vmin, 230px); border-radius: 50%; background: rgba(123,92,240,.15); display: flex; align-items: center; justify-content: center; }
.mic-wrap.listening { animation: ring 1s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(123,92,240,.45); } 100% { box-shadow: 0 0 0 40px rgba(123,92,240,0); } }
.wave { display: flex; gap: 6px; align-items: center; height: 50px; }
.wave span { width: 10px; border-radius: 5px; background: var(--purple); height: 10px; transition: height .08s; }

/* ---------- trace ---------- */
.trace { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4vmin; padding: 12px; flex-wrap: wrap; }
.trace canvas { background: var(--white); border-radius: var(--radius); box-shadow: 0 8px 0 var(--cream-shadow); touch-action: none; }

/* ---------- story ---------- */
.story { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vmin; padding: 12px 24px; text-align: center; }
.story .scene { font-size: clamp(110px, 26vmin, 240px); }
.story .line { font-size: clamp(30px, 5.4vmin, 54px); max-width: 900px; }
.story .line-cs { font-size: clamp(18px, 2.6vmin, 24px); color: #8A7A5C; }

/* ---------- reward ---------- */
.reward { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6vmin; padding: 24px; position: relative; }
.reward h1 { margin: 0; font-size: clamp(44px, 8vmin, 72px); line-height: 1; }
.stars-row { display: flex; gap: 12px; align-items: flex-end; }
.stars-row svg { width: clamp(70px, 11vmin, 110px); height: auto; }
.stars-row svg:nth-child(2) { width: clamp(86px, 14vmin, 130px); }
.sticker-card { display: flex; align-items: center; gap: 28px; background: var(--white); border-radius: 36px; padding: 18px 36px; box-shadow: 0 10px 0 #E8C766; }
.sticker-slot { width: clamp(110px, 18vmin, 160px); height: clamp(110px, 18vmin, 160px); border-radius: 50%; background: #EAF6FF; border: 6px dashed #3D8BFF; display: flex; align-items: center; justify-content: center; font-size: clamp(70px, 11vmin, 100px); }
.sticker-slot .emoji { animation: sticker-in 1s cubic-bezier(.2,1.5,.4,1) both .4s; }
@keyframes sticker-in { from { transform: scale(0) rotate(-200deg); } to { transform: none; } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 14px; height: 8px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- album / shelf ---------- */
.grid-scroll { flex: 1; overflow-y: auto; padding: 12px 24px 32px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 18px; }
.album .slot { aspect-ratio: 1; border-radius: 50%; background: var(--white); box-shadow: 0 6px 0 #8DB7D6; display: flex; align-items: center; justify-content: center; font-size: 64px; }
.album .slot.missing .emoji { filter: grayscale(1) brightness(0); opacity: .12; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.book { border-radius: 24px; background: var(--white); box-shadow: 0 8px 0 var(--cream-shadow); padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 24px; text-align: center; }
.book .emoji { font-size: 90px; }
.book.locked { opacity: .45; }

/* ---------- sleepy / misc ---------- */
.center-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; padding: 24px; text-align: center; }
.title-xl { font-size: clamp(34px, 6vmin, 60px); margin: 0; line-height: 1.1; }

/* ---------- parent area (calmer, denser) ---------- */
.parent { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 400; background: #F4F6FA; color: var(--ink); -webkit-user-select: text; user-select: text; }
.parent .p-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: #F4F6FA; flex-wrap: wrap; }
.parent h1 { font-size: 24px; margin: 0; font-weight: 700; }
.parent h2 { font-size: 17px; margin: 0 0 10px; font-weight: 650; }
.parent .p-body { flex: 1; overflow-y: auto; padding: 4px 20px 40px; }
.parent .wrap { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.parent .tabs { display: flex; gap: 4px; background: #E7EBF3; border-radius: 12px; padding: 4px; flex-wrap: wrap; }
.parent .tabs button { height: 40px; padding: 0 16px; border-radius: 9px; font-weight: 600; font-size: 15px; color: #4A5872; }
.parent .tabs button[aria-selected="true"] { background: #fff; color: var(--ink); }
.parent .panel { background: #fff; border-radius: 16px; padding: 18px 20px; }
.parent .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.parent .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.parent .kpi { font-size: 30px; font-weight: 700; }
.parent .muted { color: #5B6B85; font-size: 14px; }
.parent .bars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 10px; }
.parent .bars div { flex: 1; background: #3D6BFF; border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.parent .bars div span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: #5B6B85; }
.parent .stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 12px; background: #E7EBF3; }
.parent .list > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EEF1F6; }
.parent .list > div:last-child { border-bottom: 0; }
.parent .pbtn { height: 44px; padding: 0 16px; border-radius: 10px; background: #3D6BFF; color: #fff; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.parent .pbtn.secondary { background: #E7EBF3; color: var(--ink); }
.parent .pbtn.danger { background: #FDECEC; color: #B42318; }
.parent .pbtn svg { width: 18px; height: 18px; }
.parent .icon-btn { width: 40px; height: 40px; border-radius: 10px; background: #F4F6FA; display: inline-flex; align-items: center; justify-content: center; }
.parent .icon-btn svg { width: 20px; height: 20px; }
.parent label { font-size: 14px; font-weight: 600; color: #4A5872; display: block; margin-bottom: 6px; }
.parent input[type=text], .parent input[type=number], .parent select { height: 44px; border-radius: 10px; border: 1px solid #D6DCE8; padding: 0 12px; font-size: 16px; width: 100%; background: #fff; color: var(--ink); }
.parent .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.parent .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.parent .switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid #EEF1F6; }
.parent .switch input { width: 48px; height: 28px; accent-color: #2E9E63; }
.parent .seg { display: inline-flex; background: #E7EBF3; border-radius: 10px; padding: 3px; }
.parent .seg button { height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: #4A5872; }
.parent .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.parent .avatars { display: flex; gap: 8px; flex-wrap: wrap; }
.parent .avatars button { width: 52px; height: 52px; border-radius: 50%; background: #F4F6FA; font-size: 30px; }
.parent .avatars button[aria-pressed="true"] { box-shadow: 0 0 0 3px #3D6BFF; background: #fff; }
.parent .wordpic { width: 44px; height: 44px; border-radius: 10px; background: #F4F6FA; flex: none; --ps: 44px; overflow: hidden; }
.parent .state-known { color: #2E9E63; font-weight: 600; font-size: 13px; }
.parent .state-learning { color: #B5600B; font-weight: 600; font-size: 13px; }
.parent .state-new { color: #5B6B85; font-weight: 600; font-size: 13px; }
.parent .notice { background: #FFF6E5; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #6B4A00; }

/* ---------- gate ---------- */
.gate { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6vmin; padding: 24px; flex-wrap: wrap; }
.gate .q { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.gate .q h1 { font-size: 40px; }
.gate .answer { height: 72px; border-radius: 16px; background: #fff; border: 2px solid #3D6BFF; display: flex; align-items: center; padding: 0 22px; font-size: 36px; font-weight: 700; letter-spacing: 6px; }
.gate .answer.bad { animation: wiggle .45s; border-color: #B42318; }
.keypad { display: grid; grid-template-columns: repeat(3, 82px); gap: 12px; }
.keypad button { height: 72px; border-radius: 18px; background: #fff; box-shadow: 0 2px 0 #D6DCE8; font-size: 28px; font-weight: 600; font-family: system-ui, sans-serif; }

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 12px 12px 6px; }
  .topbar > div[style*="font-size: 30px"] { display: none; }
  .chip { height: 48px; padding: 0 14px; font-size: 22px; }
  .round.small { --s: 48px; }
  .island { transform: translate(-50%, -50%) scale(.85); }
}
@media (max-height: 560px) {
  .topbar { padding-top: 8px; }
  .footer { min-height: 96px; padding-bottom: 12px; }
  .round.big { --s: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bubble { animation-duration: var(--dur) !important; }
}
