/* Scoped styles shared by the public playground and its Admin preview. */
/* Mystery gifts are CSS illustrations, so every color remains sharp on phones/tablets. */
.math-gift-purple { --gift: #a786e8; --gift-dark: #7652b8; --gift-light: #eee4ff; --ribbon: #ffe294; }
.math-gift-pink { --gift: #f49cbe; --gift-dark: #c45987; --gift-light: #fff0f6; --ribbon: #fff0b4; }
.math-gift-blue { --gift: #81c8f1; --gift-dark: #337fae; --gift-light: #e8f6ff; --ribbon: #fff0ab; }
.math-gift-orange { --gift: #f7ba72; --gift-dark: #bc773b; --gift-light: #fff0de; --ribbon: #fff5bb; }
.math-gift-green { --gift: #89d5b0; --gift-dark: #398969; --gift-light: #e8faf0; --ribbon: #ffe6a0; }
.math-gift-yellow { --gift: #ffdc76; --gift-dark: #ad7e26; --gift-light: #fff7d9; --ribbon: #b9a1f3; }
.math-blind-gifts > p { margin: 10px auto 20px; max-width: 600px; color: #66748b; font-size: 15px; }
.math-blind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.math-player .math-blind-box { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 22px 12px 16px; border: 2px solid var(--gift); border-radius: 26px; background: var(--gift-light); box-shadow: 0 5px 0 color-mix(in srgb, var(--gift) 50%, white); color: #243c59; }
.math-player .math-blind-box:hover:not(:disabled) { background: var(--gift-light); border-color: var(--gift-dark); transform: translateY(-3px); }
.math-blind-box strong { font-size: 18px; }
.math-blind-box .math-gift-collection-name { font-size: 13px; font-weight: 800; }
.math-blind-box small { font-size: 11px; font-weight: 700; color: #6e738a; }
.math-gift-art { display: block; width: 128px; height: 130px; position: relative; margin-bottom: 10px; }
.math-gift-body { position: absolute; bottom: 4px; left: 16px; width: 96px; height: 78px; border-radius: 4px 4px 16px 16px; background: linear-gradient(110deg, #ffffff2b, transparent), var(--gift); box-shadow: inset -9px -6px 0 #0000000e, 0 8px 0 #0000000b; }
.math-gift-body::before, .math-gift-lid::before { content: ''; position: absolute; top: 0; bottom: 0; left: 38px; width: 20px; background: var(--ribbon); }
.math-gift-body > span { display: grid; place-items: center; position: absolute; left: 33px; top: 20px; width: 30px; height: 32px; background: #fff; border-radius: 9px; font-size: 24px; font-weight: 900; color: var(--gift-dark); box-shadow: 0 2px 0 #0000000b; }
.math-gift-lid { position: absolute; left: 10px; bottom: 76px; width: 108px; height: 24px; border-radius: 7px; background: var(--gift); box-shadow: inset 0 -5px 0 #00000013, 0 -2px 0 #ffffff80; z-index: 2; }
.math-gift-lid::before { left: 44px; }
.math-gift-bow { position: absolute; left: 60px; top: 12px; width: 12px; height: 27px; border-radius: 6px; background: var(--ribbon); z-index: 3; }
.math-gift-bow::before, .math-gift-bow::after { content: ''; position: absolute; bottom: 0; width: 29px; height: 23px; border: 8px solid var(--ribbon); border-radius: 70% 80% 10% 80%; transform: rotate(20deg); right: 5px; }
.math-gift-bow::after { right: auto; left: 5px; transform: scaleX(-1) rotate(20deg); }
.math-gift-spark { position: absolute; right: -2px; top: 22px; color: var(--gift-dark); font-size: 25px; }
.math-gift-rule { display: block; color: #728196; font-size: 12px; }
.math-gift-reveal { padding: 28px; margin: 20px auto; max-width: 650px; border: 2px solid var(--gift); border-radius: 30px; background: radial-gradient(circle at 50% 10%, #fff, transparent 65%), var(--gift-light); }
.math-reveal-art { position: relative; display: grid; place-items: center; width: 170px; height: 170px; margin: 18px auto; border-radius: 50%; background: #ffffffd9; box-shadow: 0 5px 0 var(--gift); }
.math-reveal-art img { width: 150px; height: 150px; object-fit: contain; }
.math-reveal-art > span { font-size: 100px; line-height: 1; }
.math-reveal-art i { position: absolute; top: 0; right: -10px; color: var(--gift-dark); font-size: 35px; font-style: normal; }
.math-reveal-art i:last-child { top: auto; right: auto; left: -12px; bottom: 0; font-size: 26px; }
.math-gift-reveal h3 { font-size: 28px; margin: 12px 0 4px; }
.math-reveal-collection { font-size: 14px; font-weight: 900; color: var(--gift-dark); margin: 0 0 18px; }
.math-gift-reveal > p { font-size: 15px; }
.math-player .math-reward-listen { font-size: 14px; min-height: 44px; padding: 8px 14px; background: #fff; border-color: var(--gift); }
.math-collection-meter { padding: 14px; margin-top: 20px; border-radius: 18px; background: #ffffffb3; text-align: left; font-size: 13px; font-weight: 800; }
.math-collection-meter strong { float: right; color: var(--gift-dark); }
.math-collection-meter progress { display: block; width: 100%; height: 12px; accent-color: var(--gift-dark); margin-top: 8px; }
.math-gift-reveal .math-gift-storage { font-size: 12px; color: #61748c; margin: 12px 0 0; }
.math-album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.math-world .math-album { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 8px; min-width: 0; padding: 16px 12px; border: 2px solid var(--gift); border-radius: 20px; background: var(--gift-light); }
.math-album > span { font-size: 30px; }.math-album strong { font-size: 14px; }.math-album small { font-size: 11px; color: #65758c; }
.math-album progress { display: block; width: 100%; height: 8px; accent-color: var(--gift-dark); }
.math-world .math-album[aria-pressed=true] { outline: 3px solid var(--gift-dark); outline-offset: 2px; }
.math-album-detail { margin-top: 24px; }.math-album-detail h3 { font-size: 22px; }
.math-album-stickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.math-album-stickers article { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; padding: 16px 8px; border: 1px solid #dccced; border-radius: 20px; background: #f8f0ff; }
.math-album-stickers img { width: 80px; height: 80px; object-fit: contain; }.math-album-stickers article > span { font-size: 50px; height: 80px; display: grid; place-items: center; }.math-album-stickers strong { font-size: 12px; }.math-album-stickers small { font-size: 12px; color: #7650b8; }
.math-album-stickers .is-missing { background: #f6f7fb; border-style: dashed; color: #8e97a7; }.math-album-stickers .is-missing > span { font-weight: 900; color: #c3b6d4; }
@media (max-width: 599px) {
    .math-blind-grid, .math-album-grid, .math-album-stickers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .math-player .math-blind-box { padding: 14px 6px; border-radius: 22px; }
    .math-gift-art { transform: scale(.8); transform-origin: center; margin: -10px -15px -4px; }
    .math-blind-box strong { font-size: 15px; }.math-blind-box .math-gift-collection-name { font-size: 11px; }.math-blind-box small { font-size: 10px; }
    .math-gift-reveal { padding: 20px 14px; }.math-gift-reveal h3 { font-size: 24px; }.math-gift-reveal > p { font-size: 14px; }
    .math-album-grid .math-album { padding: 12px 10px; }.math-album strong { font-size: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .math-reveal-art { animation: math-sticker-reveal .45s ease-out; } @keyframes math-sticker-reveal { from { opacity: 0; transform: scale(.65) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } } }
.math-player .math-timer-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; padding: 10px 14px; border: 1px solid #d9c7f1; border-radius: 18px; background: #f3ecff; box-shadow: 0 3px 0 #e8def7; }
.math-timer-bar [role=timer] { display: flex; align-items: center; gap: 8px; color: #6741a8; }
.math-timer-bar strong { font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.math-timer-bar small { font-size: 11px; }
.math-player .math-pause-button { min-height: 44px; padding: 7px 12px; font-size: 13px; background: #fff; border-color: #cfb9eb; border-radius: 12px; }
.math-player .math-timer-bar.is-low { background: #fff1d6; border-color: #edbd60; box-shadow: 0 3px 0 #f6dfad; }
.math-timer-bar.is-low [role=timer] { color: #875011; }
.math-pause-screen { box-sizing: border-box; width: min(390px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 2px solid #dac8f2; border-radius: 30px; padding: 24px; text-align: center; color: #243c59; background: #fffaf0; font: 15px/1.6 'Nunito', system-ui, sans-serif; box-shadow: 0 16px 80px #172d5540; }
.math-pause-screen::backdrop { background: #1e305bb3; backdrop-filter: blur(7px); }
.math-pause-screen .hvo-mascot { display: block; width: 130px; height: 130px; object-fit: contain; margin: 0 auto 12px; }
.math-pause-screen h2 { font-size: 28px; margin: 8px 0; }
.math-pause-screen p { font-size: 14px; color: #66748c; margin: 0 0 16px; }
.math-paused-time { display: block; font-variant-numeric: tabular-nums; color: #7650b8; font-size: 28px; margin: 10px 0 20px; }
.math-pause-screen button { display: block; width: 100%; margin-top: 10px; }
@media (max-width: 575px) { .math-player .math-timer-bar { padding: 8px 10px; gap: 8px; }.math-timer-bar strong { font-size: 23px; }.math-timer-bar small { display: none; } }
.math-world, .math-player, .math-admin { color: #243c59; font-family: 'Nunito', system-ui, sans-serif; line-height: 1.6; }
:is(.math-world, .math-player, .math-admin) *, :is(.math-world, .math-player, .math-admin) *::before, :is(.math-world, .math-player, .math-admin) *::after { box-sizing: border-box; }
:is(.math-world, .math-player) button, :is(.math-world, .math-player) select, .math-primary { font: inherit; font-weight: 800; color: #243c59; }
:is(.math-world, .math-player) button, .math-primary { border: 2px solid #cedfdf; border-radius: 16px; background: #fff; padding: 10px 18px; min-height: 48px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(.math-world, .math-player, .math-admin) button:disabled { cursor: default; opacity: .65; }
:is(.math-world, .math-player) button:hover:not(:disabled) { background: #fff5cd; border-color: #d5af4a; }
:is(.math-world, .math-player, .math-admin) :is(button, a, input, select):focus-visible { outline: 3px solid #285fb8; outline-offset: 3px; }
:is(.math-world, .math-player) h1, :is(.math-world, .math-player) h2, :is(.math-world, .math-player) h3 { font-family: inherit; font-weight: 900; color: #243c59; line-height: 1.25; }
.math-world { background: #fffcf3; }
.math-game-overlay { box-sizing: border-box; position: fixed; inset: 0; z-index: 1000000; height: 100vh; height: 100dvh; overflow: auto; overscroll-behavior: contain; background: radial-gradient(ellipse at top left, #e8f8ef, transparent 55%), #fffcf3; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.math-game-overlay > .math-player { box-sizing: border-box; width: 100%; max-width: 1100px; margin: 0 auto; }
@media (max-width: 575px) { .math-game-overlay { padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right)); } }
.math-world section { padding-block: 0; }
.math-world .math-world-hero { display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; gap: 32px; padding: 48px max(24px, calc((100% - 1200px) / 2)); background: radial-gradient(ellipse at 94% 10%, #ead8ff 0 20%, transparent 20.1%), linear-gradient(110deg, #fff2c4, #e0f4eb); border-bottom: 2px dashed #c4d8c8; }
.math-eyebrow { display: block; font-size: 12px; font-weight: 900; letter-spacing: .06em; color: #5f528d; }
.math-world-hero h1 { font-size: clamp(36px, 4vw, 58px); margin: 14px 0 20px; }
.math-world-hero h1 span { color: #7960a2; }
.math-world-hero p { max-width: 600px; font-size: 18px; }
.math-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
:is(.math-world, .math-player) .math-primary { display: inline-flex; align-items: center; justify-content: center; background: #ffce66; border-color: #e7b44d; box-shadow: 0 4px 0 #d5a543; color: #3a382f; text-decoration: none; }
.math-world-art { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px; }
.math-world-art > span { position: absolute; left: 8%; top: 10%; transform: rotate(-10deg); color: #7453a3; font-size: 30px; font-weight: 900; }
.math-world-art > .hvo-mascot { display: block; width: 260px; height: 260px; max-width: 100%; object-fit: contain; }
.math-world-art small { font-size: 13px; font-weight: 800; padding: 8px 16px; border-radius: 99px; background: #fff9; }
.math-world .math-catalog, .math-world .math-gift-shelf { max-width: 1248px; padding: 40px 24px; margin: 0 auto; }
.math-catalog-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.math-catalog-heading h2 { font-size: clamp(25px, 3vw, 36px); margin: 10px 0 0; }
.math-catalog label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; }
.math-catalog select { max-width: 100%; border: 2px solid #cadbd2; border-radius: 14px; padding: 10px 36px 10px 12px; min-height: 48px; background: #fff; }
.math-type-filter { max-width: 420px; margin: 20px 0 28px; }
.math-shelf-heading { font-size: 23px; margin: 32px 0 18px; }
.math-shelf-heading > span { display: inline-block; font-size: 12px; font-weight: 700; padding: 6px 10px; background: #dff1e7; border-radius: 99px; margin-left: 8px; }
.math-lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.math-lesson-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 2px solid #d7e6db; border-radius: 28px; background: #eaf6ec; box-shadow: 0 5px 0 #d6e6d5; }
.math-card-1 { background: #fff0d1; border-color: #eddbb5; box-shadow: 0 5px 0 #e9d7b2; }
.math-card-2 { background: #f0e8ff; border-color: #ddcfee; box-shadow: 0 5px 0 #ddcfee; }
.math-card-3 { background: #e5f1ff; border-color: #cddff0; box-shadow: 0 5px 0 #cddff0; }
.math-card-icon { display: grid; place-items: center; width: 64px; height: 64px; background: #fffc; border-radius: 22px; font-size: 36px; }
.math-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; margin: 18px 0 10px; }
.math-lesson-card h3 { font-size: 23px; margin: 0 0 10px; overflow-wrap: anywhere; }
.math-lesson-card p { font-size: 15px; margin: 0 0 18px; overflow-wrap: anywhere; }
.math-lesson-card button { margin-top: auto; width: 100%; }
.math-completed-label { margin: 0 0 12px; font-size: 12px; font-weight: 800; color: #286344; }
.math-player { max-width: 1040px; margin: 0 auto; padding: 24px 32px 36px; background: #fffcf3; min-width: 0; }
.math-player-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.math-player-top > span { background: #e8dafa; padding: 6px 12px; border-radius: 99px; font-weight: 900; }
.math-progress { display: flex; align-items: center; gap: 16px; margin: 24px 0; font-weight: 900; font-size: 14px; }
.math-progress > span { flex: 0 0 auto; }
.math-progress progress { flex: 1; height: 14px; border: 0; border-radius: 999px; overflow: hidden; appearance: none; background: #e5eee7; }
.math-progress progress::-webkit-progress-bar { background: #e5eee7; }
.math-progress progress::-webkit-progress-value { background: #62ba99; border-radius: 999px; }
.math-progress progress::-moz-progress-bar { background: #62ba99; }
.math-question-heading { display: flex; gap: 20px; align-items: center; margin: 0 0 20px; }
.math-question-heading > .hvo-mascot { flex: 0 0 110px; width: 110px; height: 110px; object-fit: contain; }
.math-question-heading h2 { font-size: clamp(23px, 3vw, 32px); margin: 8px 0 12px; overflow-wrap: anywhere; }
.math-question-heading > div { min-width: 0; }
.math-player .math-listen { font-size: 14px; background: #e5f0fe; border-color: #c9ddf4; }
.math-question-content { padding: 24px; border: 2px solid #e6e4d1; border-radius: 28px; background: #fff; text-align: center; }
.math-question-content > p { font-size: 14px; margin: 12px 0; }
.math-objects, .math-options, .math-sequence, .math-drop-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.math-objects { margin: 0 auto 22px; max-width: 680px; }
.math-options { margin-top: 20px; }
.math-object, .math-zero { display: grid; place-items: center; position: relative; width: 74px; min-height: 74px; border: 2px solid #e2eadf; border-radius: 20px; font-size: 40px; background: #f4f9f1; }
:is(.math-object, .math-option, .math-match-item, .math-gap, .math-drop, .math-sample, .math-drag-ghost) img { display: block; width: 100%; height: 100%; max-height: 100px; object-fit: contain; }
.math-player .math-object { padding: 8px; }
.math-player .math-option { position: relative; font-size: 32px; min-width: 92px; min-height: 84px; padding: 14px; border-radius: 20px; background: #eef5ff; border-color: #d6e3f4; max-width: 100%; overflow-wrap: anywhere; }
.math-option small { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; height: 25px; font-size: 14px; background: #fff; border-radius: 50%; margin-right: 12px; vertical-align: middle; }
.math-player .is-selected { border-color: #8756b0; background: #f1e5ff; box-shadow: 0 0 0 2px #8756b025; }
.math-player .math-color-number { font-size: 58px; color: #fff; -webkit-text-stroke: 2px #8756b0; }
.math-player .math-color-number.is-selected { color: #8756b0; }
.math-interactive-objects .math-object small { position: absolute; right: 2px; top: -8px; color: #4c356c; font-size: 24px; }
.math-player .is-crossed::after { content: ''; position: absolute; left: 6px; right: 6px; top: 48%; height: 5px; transform: rotate(-36deg); background: #bd5268; border-radius: 3px; }
.math-counter { font-weight: 900; color: #755191; }
.math-number-entry, .math-equation-entry { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; }
.math-player :is(.math-number-entry, .math-equation-entry) input { width: 120px; height: 65px; text-align: center; font: 900 30px 'Nunito', sans-serif; border: 2px solid #bca4d7; border-radius: 16px; background: #fffaf1; color: #243c59; }
.math-player .math-equation-entry input { width: min(100%, 320px); }
.math-keypad { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 430px; gap: 8px; margin: 20px auto 0; }
.math-keypad button { padding: 8px; font-size: 24px; }
.math-drawing svg { display: block; width: 100%; height: auto; min-height: 140px; background: #fffaf0; border: 2px dashed #c6a7d8; border-radius: 20px; touch-action: none; }
.math-small-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 12px 0 0; }
.math-small-actions button { font-size: 14px; padding-inline: 12px; }
.math-matching { display: grid; grid-template-columns: minmax(0, 1fr) 16% minmax(0, 1fr); max-width: 650px; margin: 20px auto; position: relative; }
.math-matching > div { display: grid; gap: 12px; }
.math-matching > div:last-child { grid-column: 3; }
.math-player .math-match-item { height: 76px; min-width: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; font-size: clamp(20px, 3vw, 32px); background: #f6f0fd; overflow: hidden; }
.math-match-item img { height: 55px; max-width: 80%; }
.math-match-item > span { overflow-wrap: anywhere; }
.math-match-item small { align-self: flex-start; font-size: 11px; }
.math-match-lines { position: absolute; top: 0; left: 42%; width: 16%; height: 100%; overflow: visible; pointer-events: none; }
.math-gap, .math-player .math-drop { display: grid; place-items: center; width: 80px; min-height: 80px; border: 3px dashed #af8ecf; border-radius: 20px; font-size: 34px; background: #faf5ff; }
.math-player .math-drop { width: 88px; }
.math-draggable { touch-action: none; user-select: none; }
.math-drag-ghost { position: fixed; transform: translate(-50%, -50%); z-index: 2000; pointer-events: none; width: 72px; height: 72px; font-size: 40px; background: #fff9; border-radius: 18px; }
.math-maze { display: grid; max-width: 400px; margin: 16px auto; gap: 5px; padding: 8px; background: #e1f0e1; border-radius: 20px; touch-action: none; }
.math-maze button { aspect-ratio: 1; min-height: 0; padding: 3px; font-size: clamp(22px, 3vw, 32px); border: 1px solid #c6dbc5; border-radius: 10px; background: #fff; }
.math-maze button.is-wall { background: #b8dba8; opacity: 1; }
.math-maze button.is-path { background: #ffe49b; }
.math-sample { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 65px; max-width: 140px; min-height: 130px; margin: 0 auto 24px; border: 3px solid #ffce66; border-radius: 24px; }
.math-sample small { font-size: 13px; font-weight: 900; }
.math-equation-pictures { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-bottom: 20px; }
.math-equation-pictures .math-objects { max-width: 240px; margin: 0; gap: 6px; }
.math-equation-pictures .math-object { width: 54px; min-height: 54px; font-size: 30px; }
.math-equation-pictures > b { font-size: 32px; }
.math-feedback { min-height: 50px; padding: 14px; margin: 20px 0; border-radius: 16px; text-align: center; font-weight: 800; background: #edf3fa; }
.math-feedback.correct { color: #245c42; background: #dcf3df; }
.math-feedback.wrong { color: #7d4e25; background: #fff0d0; }
.math-player-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.math-parent-note { font-size: 12px; text-align: center; margin: 24px 0 0; color: #576d7c; }
.math-notice { padding: 14px; border: 1px solid #e8c980; background: #fff5d8; border-radius: 16px; margin-top: 18px; font-size: 14px; }
.math-notice button { display: block; margin-top: 8px; }
.math-completion { text-align: center; padding: 24px 0; }
.math-completion > .hvo-mascot { display: block; width: 180px; height: 180px; object-fit: contain; margin: 0 auto 18px; }
.math-completion h2 { font-size: clamp(28px, 4vw, 40px); margin: 12px 0; }
.math-score { font-size: 70px; font-weight: 900; color: #8151ae; line-height: 1.2; margin: 20px 0; }
.math-score small { font-size: 26px; }
.math-rewards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.math-reward-groups { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.math-world .math-reward-groups button { min-height: 44px; padding: 8px 12px; font-size: 13px; border-radius: 16px; }
.math-reward-groups button[aria-pressed=true] { background: #7856b5; border-color: #7856b5; color: #fff; }
.math-rewards > :is(button, article) { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 24px; border: 2px solid #e0d6ed; background: #faf2ff; min-width: 0; }
.math-rewards img { width: 85px; height: 85px; object-fit: contain; }
.math-rewards > :is(button, article) > span { font-size: 48px; }
.math-rewards strong { font-size: 14px; }
.math-rewards small { font-size: 12px; overflow-wrap: anywhere; }
.math-rewards > article > .math-gift-count { font-size: 16px; font-weight: 900; color: #7856b5; padding: 4px 14px; border-radius: 999px; background: #e9dcff; }
/* Authoring UI follows the existing Admin theme and keeps the child preview isolated. */
.math-admin h1 { font-size: 28px; margin: 0 0 8px; }
.math-admin-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.math-admin .is-current { background: #eef4ff; border-color: #1677ff; }
.math-admin-editor { display: grid; gap: 16px; }
.math-admin fieldset { display: grid; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
.math-admin label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; min-width: 0; }
.math-admin label small { font-weight: 400; font-size: 12px; color: #65758a; }
.math-admin .ant-select { width: 100%; min-width: 0; }
.math-admin-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.math-admin-row > label { flex: 1; min-width: 120px; }
.math-admin-row > .ant-select { flex: 1; min-width: 200px; }
.math-admin-save { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; background: #fff; box-shadow: 0 4px 18px #243c5920; border-radius: 12px; z-index: 5; }
.math-admin-preview { padding: 16px; background: #fffcf3; border-radius: 24px; }
.math-admin-pairs { display: grid; gap: 12px; }
@media (max-width: 1023px) {
    .math-lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .math-world .math-world-hero { padding: 32px 24px; grid-template-columns: 1.3fr 1fr; }
}
@media (max-width: 767px) {
    .math-world .math-world-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 20px; }
    .math-world-hero h1 { font-size: 37px; }
    .math-world-hero p { font-size: 16px; }
    .math-world-art > .hvo-mascot { width: 180px; height: 180px; }
    .math-world-art > span { left: 16%; }
    .math-world .math-catalog, .math-world .math-gift-shelf { padding: 28px 16px; }
    .math-player { padding: 16px 12px 28px; }
    .math-player-top { font-size: 12px; }
    .math-player-top button { padding: 8px 10px; font-size: 12px; }
    .math-question-heading { gap: 10px; align-items: flex-start; }
    .math-question-heading > .hvo-mascot { flex-basis: 70px; width: 70px; height: 70px; }
    .math-question-heading h2 { font-size: 23px; }
    .math-question-heading .math-eyebrow { font-size: 10px; }
    .math-question-content { padding: 16px 12px; border-radius: 20px; }
    .math-objects, .math-options, .math-sequence, .math-drop-row { gap: 8px; }
    .math-object { width: 60px; min-height: 60px; font-size: 34px; border-radius: 16px; }
    .math-player .math-option { min-width: 72px; min-height: 72px; font-size: 28px; padding: 10px; }
    .math-option small { margin-right: 6px; }
    .math-player .math-color-number { font-size: 48px; }
    .math-player .math-drop, .math-gap { width: 64px; min-height: 64px; }
    .math-keypad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .math-keypad button { font-size: 22px; min-height: 50px; }
    .math-player .math-match-item { font-size: 21px; border-radius: 12px; }
    .math-equation-pictures { gap: 10px; }
    .math-equation-pictures .math-objects { max-width: 110px; }
    .math-equation-pictures .math-object { width: 45px; min-height: 45px; font-size: 27px; padding: 3px; }
    .math-equation-pictures > b { font-size: 24px; }
    .math-rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .math-completion > .hvo-mascot { width: 140px; height: 140px; }
    .math-admin-preview { padding: 0; }
}
@media (max-width: 479px) {
    .math-lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .math-lesson-card { padding: 20px; }
    .math-world-hero h1 { font-size: 34px; }
    .math-catalog-heading { align-items: stretch; }
    .math-catalog-heading label, .math-type-filter { width: 100%; }
    .math-rewards > :is(button, article) { padding: 12px 8px; }
}
@media (max-height: 600px) and (min-width: 600px) {
    .math-player { padding-top: 12px; }
    .math-question-heading > .hvo-mascot { width: 65px; height: 65px; flex-basis: 65px; }
    .math-question-heading h2 { font-size: 24px; }
    .math-progress { margin: 12px 0; }
}
@media (prefers-reduced-motion: reduce) { .math-world *, .math-player * { scroll-behavior: auto; } }

/* Learning hub: age, topic, published lessons, and a separate personal journey. */
.math-learning-hub { background: #f4f7fb; }
.math-hub-container { max-width: 1328px; margin: 0 auto; padding: 24px; }
.math-learning-hub .math-hub-welcome { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 24px; padding: 24px 32px; border: 1px solid #d3e7db; border-radius: 24px; background: radial-gradient(ellipse at 100% 0%, #e9dcfa, transparent 45%), linear-gradient(110deg, #f8f5df, #def1e6); }
.math-hub-welcome h1 { font-size: clamp(28px, 3vw, 38px); margin: 8px 0; }
.math-hub-welcome p { margin: 0; color: #536779; font-size: 15px; }
.math-hub-welcome > .hvo-mascot { width: 150px; height: 150px; object-fit: contain; }
.math-hub-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.math-hub-nav button { padding: 8px 16px; font-size: 14px; border-color: #d0ded5; }
.math-hub-nav button[aria-pressed="true"] { background: #243c59; border-color: #243c59; color: #fff; }
.math-hub-nav button > span { display: inline-block; padding: 0 6px; margin-left: 5px; background: #e9ddfa; color: #644590; border-radius: 8px; font-size: 12px; }
.math-hub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; align-items: start; margin-top: 24px; }
.math-hub-main { display: grid; gap: 20px; min-width: 0; }
.math-learning-hub :is(.math-age-panel, .math-topic-panel, .math-catalog, .math-hub-collection) { padding: 22px; border: 1px solid #e0e7ef; border-radius: 22px; background: #fff; margin: 0; max-width: none; }
.math-panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.math-panel-heading h2 { font-size: 21px; margin: 0; }
.math-panel-heading h2 > span { margin-right: 6px; }
.math-panel-heading p { margin: 6px 0 0; font-size: 13px; color: #63768a; }
.math-learning-hub .math-show-all { padding: 5px 12px; min-height: 40px; border-color: #e0e7ef; font-size: 12px; }
.math-show-all[aria-pressed="true"] { background: #eef4ff; color: #37679d; }
.math-age-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.math-learning-hub .math-age-choices button { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 16px; border-color: #e3daf2; background: #f5f0fc; text-align: left; min-width: 0; }
.math-age-choices strong { font-size: 19px; }
.math-age-choices small { font-size: 11px; color: #685b7c; }
.math-age-choices button > span { position: absolute; right: 12px; top: 14px; font-size: 20px; }
.math-learning-hub .math-age-choices button[aria-pressed="true"] { background: #7856b5; border-color: #7856b5; color: #fff; }
.math-age-choices button[aria-pressed="true"] small { color: #f0e7ff; }
.math-topic-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.math-learning-hub .math-topic-choices button { display: flex; gap: 12px; align-items: center; padding: 14px; background: #fff4dc; border-color: #f1dfb6; text-align: left; min-width: 0; }
.math-topic-choices button > span { display: grid; place-items: center; flex: 0 0 44px; height: 44px; background: #fffc; border-radius: 14px; font-size: 28px; }
.math-topic-choices strong { display: block; font-size: 15px; }
.math-topic-choices small { font-size: 12px; color: #667587; }
.math-learning-hub .math-topic-choices .math-topic-patterns { background: #f1eafa; border-color: #e1d4f0; }
.math-learning-hub .math-topic-choices .math-topic-observe { background: #e9f4ec; border-color: #d0e5d5; }
.math-learning-hub .math-topic-choices .math-topic-connect { background: #eaf3fd; border-color: #d2e3f6; }
.math-learning-hub .math-topic-choices button[aria-pressed="true"] { border-color: #7856b5; box-shadow: inset 0 0 0 1px #7856b5; }
.math-status-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.math-learning-hub .math-status-filters button { min-height: 42px; padding: 6px 12px; border-color: #e1e7ef; border-radius: 12px; font-size: 12px; }
.math-status-filters button[aria-pressed="true"] { background: #e9f0fa; color: #2b578c; border-color: #b8cee7; }
.math-more-filters { min-width: 160px; max-width: 100%; font-size: 13px; }
.math-more-filters summary { cursor: pointer; padding: 10px 12px; border: 1px solid #d9e2ec; border-radius: 12px; font-weight: 800; }
.math-more-filters label { margin-top: 10px; }
.math-learning-hub .math-lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.math-learning-hub .math-lesson-card { padding: 18px; border-width: 1px; border-radius: 18px; box-shadow: 0 3px 0 #243c590b; }
.math-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.math-learning-hub .math-card-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 27px; flex: 0 0 46px; }
.math-card-state { font-size: 11px; font-weight: 800; color: #576c7c; }
.math-learning-hub .math-lesson-card h3 { font-size: 19px; margin: 0 0 8px; }
.math-learning-hub .math-lesson-card > p { font-size: 13px; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.math-learning-hub .math-card-meta { margin: auto 0 12px; font-size: 11px; padding-top: 6px; }
.math-learning-hub .math-lesson-card > button { min-height: 44px; font-size: 13px; padding: 8px 12px; border-radius: 12px; margin: 0; }
.math-age-group + .math-age-group { margin-top: 24px; padding-top: 20px; border-top: 1px solid #e7edf2; }
.math-age-group > h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 14px; }
.math-age-group > h3 > span { font-size: 11px; color: #607387; border-radius: 99px; padding: 4px 10px; background: #eef3f9; }
.math-progress-sidebar { position: sticky; top: 100px; background: #fff; border: 1px solid #dce4ee; border-radius: 22px; overflow: hidden; padding: 22px; }
.math-journey-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; }
.math-journey-heading > span { display: grid; place-items: center; flex: 0 0 44px; height: 44px; font-size: 27px; background: #fff2c6; border-radius: 15px; }
.math-journey-heading .math-eyebrow { font-size: 9px; }
.math-journey-heading h2 { font-size: 19px; margin: 4px 0 0; }
.math-journey-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.math-journey-stats strong { display: block; font-size: 28px; font-weight: 900; color: #7856b5; }
.math-journey-stats span { display: block; font-size: 10px; font-weight: 800; color: #61758a; }
.math-journey-progress { margin: 18px 0; }
.math-journey-progress p { font-size: 12px; margin: 0 0 8px; color: #607387; }
.math-journey-progress progress { display: block; width: 100%; height: 9px; accent-color: #7856b5; }
.math-progress-sidebar > button { width: 100%; font-size: 13px; padding: 10px 8px; }
.math-progress-sidebar .math-sidebar-gifts { margin-top: 12px; border-color: #e2d5f1; background: #f5effc; }
.math-parent-tips { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #dce4ee; }
.math-parent-tips h3 { margin: 0 0 8px; font-size: 15px; }
.math-parent-tips p { font-size: 13px; color: #607387; margin: 0 0 12px; }
.math-parent-tips small { font-size: 10px; color: #758697; }
.math-hub-empty { text-align: center; padding: 24px 16px; background: #f8fafc; border: 1px dashed #d9e3ec; border-radius: 18px; }
.math-hub-empty > .hvo-mascot { width: 100px; height: 100px; margin: 0 auto 14px; }
.math-hub-empty > span { display: block; font-size: 60px; }
.math-hub-empty h3 { font-size: 20px; margin: 0 0 10px; }
.math-hub-empty p { font-size: 14px; color: #607387; max-width: 400px; margin: 0 auto 16px; }
.math-hub-loading { padding: 32px 16px; text-align: center; font-size: 14px; color: #607387; }
.math-hub-collection .math-rewards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1600px) { .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
    .math-hub-container { padding: 20px; }
    .math-hub-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .math-progress-sidebar { position: static; }
    .math-journey-stats { max-width: 380px; }
    .math-journey-progress { max-width: 380px; }
    .math-progress-sidebar > button { width: auto; margin-right: 10px; }
}
@media (max-width: 575px) {
    .math-hub-container { padding: 12px; }
    .math-learning-hub .math-hub-welcome { grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; padding: 20px 16px; border-radius: 20px; }
    .math-hub-welcome > .hvo-mascot { width: 80px; height: 80px; align-self: start; }
    .math-hub-welcome h1 { font-size: 28px; }
    .math-hub-welcome .math-eyebrow { font-size: 9px; letter-spacing: 0; }
    .math-hub-welcome p { font-size: 13px; }
    .math-hub-nav { gap: 6px; }
    .math-hub-nav button { font-size: 12px; padding: 8px 10px; }
    .math-hub-layout { margin-top: 16px; }
    .math-hub-main { gap: 14px; }
    .math-learning-hub :is(.math-age-panel, .math-topic-panel, .math-catalog, .math-hub-collection) { padding: 16px 12px; border-radius: 18px; }
    .math-panel-heading h2 { font-size: 18px; }
    .math-panel-heading { gap: 8px; }
    .math-age-choices { gap: 6px; }
    .math-learning-hub .math-age-choices button { padding: 12px 8px; align-items: center; text-align: center; }
    .math-age-choices strong { font-size: 16px; }
    .math-age-choices small { font-size: 9px; }
    .math-age-choices button > span { display: none; }
    .math-learning-hub .math-topic-choices button { flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px; }
    .math-topic-choices strong { font-size: 13px; }
    .math-topic-choices small { font-size: 11px; }
    .math-learning-hub .math-lesson-grid { grid-template-columns: minmax(0, 1fr); }
    .math-learning-hub .math-lesson-card { padding: 16px; }
    .math-more-filters { width: 100%; }
    .math-status-filters { gap: 6px; }
    .math-learning-hub .math-status-filters button { padding-inline: 8px; font-size: 11px; }
    .math-hub-collection .math-rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Admin: lesson list page and add/edit page */
/* Compact, illustrated catalog. Only one server page is rendered. */
.math-learning-hub .math-lesson-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.math-learning-hub .math-lesson-card { padding: 14px 10px 10px; border: 2px solid #30bd81; background: linear-gradient(155deg, #d1fae5, #effff5); border-radius: 22px; text-align: center; gap: 8px; box-shadow: 0 4px 0 #a8e7cb; display: flex; flex-direction: column; min-width: 0; }
.math-learning-hub .math-card-1 { background: linear-gradient(155deg, #e4d4ff, #f8f2ff); border-color: #9961ec; box-shadow: 0 4px 0 #d1b8f4; }
.math-learning-hub .math-card-2 { background: linear-gradient(155deg, #ffd4e4, #fff4f8); border-color: #ec6ba0; box-shadow: 0 4px 0 #f3b5ce; }
.math-learning-hub .math-card-3 { background: linear-gradient(155deg, #c7efff, #f0fbff); border-color: #27afd7; box-shadow: 0 4px 0 #a6dcec; }
.math-learning-hub .math-card-top { flex-direction: column-reverse; gap: 8px; margin-bottom: 0; }
.math-learning-hub .math-card-icon { width: 64px; height: 64px; font-size: 42px; margin: auto; background: #ffffffb3; border-radius: 20px; }
.math-learning-hub .math-card-state { font-size: 10px; padding: 0; background: transparent; }
.math-card-art { position: relative; width: 92px; height: 82px; margin: auto; }
.math-card-art .hvo-mascot { display: block; width: 82px; height: 82px; object-fit: contain; }
.math-card-art > span { position: absolute; bottom: 0; right: -4px; font-size: 24px; width: 34px; height: 34px; background: #fff; border-radius: 12px; box-shadow: 0 2px 6px #203a5715; }
.math-learning-hub .math-lesson-card h3 { font-size: 15px; line-height: 1.35; margin: 0; min-height: 41px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.math-learning-hub .math-card-meta { flex-direction: column; justify-content: center; gap: 2px; font-size: 11px; margin: auto 0 0; }
.math-learning-hub .math-lesson-card button { font-size: 12px; min-height: 44px; padding: 8px 4px; margin: 0; border-radius: 13px; background: #7650c5; border-color: #6542b0; color: #fff; box-shadow: 0 3px 0 #53318e; }
.math-learning-hub .math-lesson-card button:hover:not(:disabled) { background: #6540b6; border-color: #53318e; }
.math-learning-hub .math-card-3 button { background: #146bba; border-color: #11599e; box-shadow: 0 3px 0 #10497d; }
.math-learning-hub .math-card-3 button:hover:not(:disabled) { background: #11599e; border-color: #10497d; }
.math-learning-hub .math-age-choices button:nth-child(1) { background: #d7f9e4; border-color: #58c68b; }
.math-learning-hub .math-age-choices button:nth-child(2) { background: #ffe7b8; border-color: #e5ad3a; }
.math-learning-hub .math-age-choices button:nth-child(3) { background: #e7d9ff; border-color: #a37ae3; }
.math-learning-hub .math-age-choices button[aria-pressed=true] { background: #754ac4; border-color: #754ac4; box-shadow: 0 0 0 3px #754ac429; }
.math-learning-hub .math-topic-choices .math-topic-numbers { background: #d6f5e5; border-color: #54be8b; }
.math-learning-hub .math-topic-choices .math-topic-patterns { background: #e9d8ff; border-color: #a47bdd; }
.math-learning-hub .math-topic-choices .math-topic-observe { background: #ffdfeb; border-color: #e98fb1; }
.math-learning-hub .math-topic-choices .math-topic-connect { background: #d5f0ff; border-color: #60bbdf; }
.math-learning-hub .math-hub-welcome { background: radial-gradient(ellipse at 100% 0, #d4beff, transparent 60%), linear-gradient(120deg, #d3f7e7, #e4dcff); border-color: #c6ade9; }
.math-learning-hub .math-progress-sidebar { background: linear-gradient(160deg, #fff4ca, #fff 60%); border-color: #edd58a; }
.math-catalog-search { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 13px; font-weight: 800; }
.math-catalog-search input { flex: 1; width: 100%; min-width: 0; border: 1px solid #d5dfea; border-radius: 14px; padding: 10px 12px; min-height: 44px; background: #f8fafc; }
.math-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.math-pagination p { margin: 0; color: #61758a; font-size: 12px; }
.math-pagination > div { display: flex; align-items: center; gap: 4px; }
.math-learning-hub .math-pagination button { min-width: 40px; min-height: 44px; padding: 6px; border-radius: 12px; }
.math-pagination button[aria-current=page] { background: #7856b5; color: #fff; border-color: #7856b5; }
.math-pagination button:disabled { opacity: .45; cursor: default; }
#math-lessons { scroll-margin-top: 100px; }
@media (min-width: 1600px) { .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) and (max-width: 1199px) { .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575px) {
    .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .math-learning-hub .math-lesson-card { padding: 12px 8px 8px; }
    .math-catalog-search { display: grid; gap: 6px; }
    .math-pagination { justify-content: center; }
    .math-learning-hub .math-pagination button { min-width: 34px; }
}

.math-admin :is(.ant-card, .math-admin-editor) { min-width: 0; }
.math-admin-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.math-admin .math-back { display: inline-block; margin-bottom: 6px; font-weight: 700; }
.math-list-filters { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto; gap: 10px; margin: 16px 0; }
.math-list-title { display: grid; gap: 2px; min-width: 180px; }
.math-list-title small { color: #65758a; font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.math-list-type { margin-right: 4px; font-size: 18px; }
.math-list-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.math-edit-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; margin: 16px 0; align-items: start; }
.math-edit-questions { position: sticky; top: 12px; }
.math-edit-questions .ant-card-body { display: grid; gap: 12px; }
.math-edit-question-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 46vh; overflow-y: auto; }
.math-edit-question-list button { display: grid; gap: 2px; width: 100%; padding: 8px 12px; text-align: left; border: 1px solid #cdd5dc; border-radius: 10px; background: #fff; cursor: pointer; }
.math-edit-question-list small { color: #65758a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.math-edit-question-list .is-current button { background: #eef4ff; border-color: #1677ff; }
.math-edit-question-tools { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1100px) { .math-list-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 991px) {
    .math-edit-layout { grid-template-columns: minmax(0, 1fr); }
    .math-edit-questions { position: static; }
    .math-edit-question-list { max-height: 240px; }
}
@media (max-width: 479px) { .math-list-filters { grid-template-columns: minmax(0, 1fr); } }
.math-admin label .ant-switch { align-self: flex-start; }
.math-list-actions { gap: 4px; }

/* Admin: chip / palette editor for lesson items */
.math-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid #dfe3e7; border-radius: 12px; background: #fbfcfe; min-width: 0; }
.math-items-label { font-weight: 700; font-size: 14px; }
.math-items-label small { font-weight: 400; color: #65758a; }
.math-items-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; padding: 8px; border: 1px dashed #cdd5dc; border-radius: 10px; background: #fff; align-items: center; }
.math-items-chips em { color: #65758a; font-size: 13px; }
.math-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px; font-size: 24px; line-height: 1; border: 1px solid #cdd5dc; border-radius: 10px; background: #fff; cursor: pointer; }
.math-chip img { width: 32px; height: 32px; object-fit: contain; }
.math-chip.is-selected { border-color: #1677ff; background: #eef4ff; box-shadow: 0 0 0 2px #1677ff40; }
.math-items-tools, .math-items-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.math-items .math-items-qty { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.math-items .math-items-upload { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.math-items .ant-input { flex: 1; min-width: 140px; }
.math-items input[type=file] { max-width: 100%; min-width: 0; }
.math-items-add > * { min-width: 0; }
.math-items > small { color: #65758a; }
.math-palette { border: 1px solid #dfe3e7; border-radius: 10px; background: #fff; padding: 8px; display: grid; gap: 8px; }
.math-palette-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.math-palette-tabs button { padding: 4px 10px; border: 1px solid #cdd5dc; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; }
.math-palette-tabs button.is-selected { background: #1677ff; border-color: #1677ff; color: #fff; }
.math-palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.math-palette-grid button { height: 48px; font-size: 26px; border: 1px solid #e3e7ea; border-radius: 10px; background: #fff; cursor: pointer; }
.math-palette-grid button:hover:not(:disabled) { background: #eef4ff; border-color: #1677ff; }
.math-group-row { display: grid; grid-template-columns: 24px minmax(80px, 1fr) minmax(100px, 1fr) auto auto; gap: 8px; align-items: center; }
.math-group-index { font-weight: 700; color: #65758a; }
.math-group-preview { display: flex; flex-wrap: wrap; gap: 2px; font-size: 22px; min-height: 32px; align-items: center; }
.math-group-preview img { width: 28px; height: 28px; object-fit: contain; }
.math-group-picker { grid-column: 1 / -1; display: grid; gap: 8px; }
@media (max-width: 599px) {
    .math-group-row { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
    .math-group-preview { grid-column: 2 / -1; grid-row: 1; }
    .math-group-row .ant-input { grid-column: 1 / 3; grid-row: 2; min-width: 0; }
    .math-group-row .ant-btn { white-space: nowrap; }
}

/* A colorful garden entrance, with the existing animated Capy as the guide. */
.math-hub-welcome.math-garden-welcome { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: clamp(24px, 4vw, 52px); border: 0; border-radius: 36px 64px 36px 64px; background: radial-gradient(circle at 15% 12%, #ffffff19 2px, transparent 3px) 0 0 / 28px 28px, #285a9b; box-shadow: 0 7px 0 #183e73; }
.math-garden-copy { position: relative; z-index: 1; min-width: 0; }
.math-garden-welcome .math-eyebrow { color: #ffe18b; font-size: 12px; letter-spacing: .08em; }
.math-garden-welcome h1 { color: white; font-size: clamp(36px, 4.7vw, 68px); margin: 14px 0 18px; line-height: 1.12; }
.math-garden-welcome h1 span { color: #ffda68; display: inline-block; transform: rotate(-4deg); }
.math-garden-welcome .math-garden-copy > p { color: #e7f2ff; max-width: 540px; margin: 0 0 24px; font-size: 17px; }
.math-garden-welcome .math-hub-nav { gap: 12px; }
.math-garden-welcome .math-hub-nav button { background: #fff; border-color: #b7d8f5; box-shadow: 0 4px 0 #173e73; color: #243c59; }
.math-garden-welcome .math-hub-nav button[aria-pressed=true] { background: #ffd35e; border-color: #ffd35e; color: #243c59; box-shadow: 0 4px 0 #d59b31; }
.math-garden-note { display: block; color: #ffe7a6; font-size: 13px; font-weight: 800; margin-top: 20px; }
.math-garden-scene { position: relative; min-width: 0; height: 300px; background: #ffedb5; border-radius: 48% 45% 42% 40%; transform: rotate(-3deg); }
.math-garden-scene > .hvo-mascot { position: absolute; width: 210px; height: 240px; object-fit: contain; left: 50%; bottom: 22px; transform: translateX(-50%) rotate(3deg); z-index: 2; filter: drop-shadow(0 8px 0 #dba94c45); }
.math-garden-rainbow { position: absolute; left: 20%; top: 20px; width: 62%; height: 70%; border-radius: 140px 140px 25px 25px; background: radial-gradient(ellipse at center bottom, transparent 47%, #a8d9f8 48% 56%, #b5dfb9 57% 65%, #ffce67 66% 74%, #f2a7bb 75% 83%, transparent 84%); transform: rotate(3deg); }
.math-garden-cloud { position: absolute; left: 9%; top: 80px; width: 62px; height: 24px; background: white; border-radius: 22px; }
.math-garden-cloud::before { content: ''; position: absolute; background: white; width: 35px; height: 35px; border-radius: 50%; left: 12px; bottom: 0; }
.math-garden-star { position: absolute; font-size: 40px; color: #eda737; animation: math-garden-bob 4s ease-in-out infinite; }
.math-garden-star-one { right: 9%; top: 8px; }.math-garden-star-two { left: 9%; bottom: 20px; color: #ec7d93; animation-delay: -2s; }
.math-garden-number { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 4px solid white; border-radius: 16px; font-size: 29px; font-weight: 900; box-shadow: 0 4px 0 #bb8f4233; animation: math-garden-bob 4.5s ease-in-out infinite; z-index: 3; }
.math-garden-one { left: 12%; bottom: 58px; background: #ffcf69; color: #855021; rotate: -12deg; }.math-garden-two { right: 8%; top: 94px; background: #a0dfca; color: #255c4e; rotate: 12deg; animation-delay: -1.5s; }.math-garden-three { right: 15%; bottom: 32px; background: #d3b5ef; color: #654293; rotate: -8deg; animation-delay: -3s; }
.math-garden-equation { position: absolute; left: 5%; top: 6px; background: white; padding: 9px 16px; border-radius: 14px; font-weight: 900; color: #a06925; rotate: -8deg; }
.math-garden-speech { position: absolute; left: 50%; bottom: -4px; translate: -50% 0; z-index: 4; background: #fff; padding: 8px 14px; border-radius: 16px; white-space: nowrap; font-size: 13px; font-weight: 900; color: #6d4e92; transform: rotate(3deg); }
.math-garden-flower { position: absolute; font-size: 50px; color: #f58ba6; bottom: -3px; left: 2%; }.math-garden-flower-two { left: auto; right: 0; color: #ad8fd4; font-size: 42px; }
@keyframes math-garden-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.math-collected-gift { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px auto; padding: 12px 20px; width: fit-content; max-width: 100%; border-radius: 22px; background: #f0e4ff; border: 2px solid #d6bfef; }
.math-collected-gift img { width: 64px; height: 64px; object-fit: contain; }.math-collected-gift > span { font-size: 44px; }
.math-next-games { margin: 28px 0; padding: 24px; border-radius: 28px; background: #e3f5eb; border: 2px solid #addbc2; text-align: left; }
.math-next-games h3 { font-size: 28px; margin: 8px 0; scroll-margin-top: 20px; }.math-next-games > p { margin: 8px 0 20px; }
.math-next-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.math-player .math-next-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 14px; border-radius: 24px; text-align: left; background: #ffdf87; border-color: #dfb751; box-shadow: 0 4px 0 #ce9e40; }
.math-player .math-next-card-1 { background: #d6c3f4; border-color: #b299d4; box-shadow: 0 4px 0 #a389c6; }.math-player .math-next-card-2 { background: #a9d8fa; border-color: #86bce6; box-shadow: 0 4px 0 #71a3cd; }
.math-next-art { position: relative; display: block; height: 110px; border-radius: 16px; background: #ffffff70; margin-bottom: 12px; }
.math-next-art .hvo-mascot { display: block; width: 100%; height: 110px; object-fit: contain; }.math-next-art > span { position: absolute; right: 10px; bottom: 6px; font-size: 26px; }
.math-next-card strong { overflow-wrap: anywhere; line-height: 1.4; margin-bottom: 8px; }.math-next-card small { display: block; font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.math-next-play { display: block; padding: 9px; border-radius: 12px; background: #fff; text-align: center; margin-top: auto; }
@media (max-width: 767px) {
    .math-hub-welcome.math-garden-welcome { grid-template-columns: 1fr; padding: 24px 20px 32px; border-radius: 28px 40px 28px 40px; gap: 24px; }
    .math-garden-scene { width: 100%; max-width: 440px; height: 260px; justify-self: center; }
    .math-garden-scene > .hvo-mascot { width: 180px; height: 215px; bottom: 18px; }
    .math-garden-number { width: 44px; height: 44px; font-size: 25px; }.math-garden-equation { font-size: 13px; }
    .math-garden-welcome .math-garden-copy > p { font-size: 16px; }.math-garden-note { margin-top: 16px; }
    .math-next-games { padding: 16px; }.math-next-grid { grid-template-columns: 1fr; }
    .math-player .math-next-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 0 12px; padding: 12px; }
    .math-next-art { grid-column: 1; grid-row: 1 / 4; height: 100%; min-height: 110px; margin: 0; }.math-next-art .hvo-mascot { height: 100%; max-height: 120px; }
    .math-next-card strong, .math-next-card small, .math-next-play { grid-column: 2; }.math-next-play { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .math-garden-scene * { animation: none; } }
.math-mobile-journey { display: none; }
@media (max-width: 1023px) {
    .math-mobile-journey { position: sticky; top: 12px; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 12px; margin-top: 18px; border-radius: 20px; border: 2px solid #e9c865; background: #fff4ca; box-shadow: 0 4px 0 #e8d595; }
    .math-mobile-journey strong { display: block; font-size: 13px; }.math-mobile-journey small { display: block; font-size: 11px; color: #5e6170; }
    .math-world .math-mobile-journey button { min-height: 44px; padding: 8px 10px; font-size: 12px; background: #e5d5fa; border-color: #bda1dc; border-radius: 14px; white-space: nowrap; }
    .math-world .math-mobile-journey .math-mobile-resume { grid-column: 1 / -1; background: #fff; min-height: 44px; }
    .math-learning-hub .math-progress-sidebar { display: none; }
    .math-learning-hub .math-hub-layout { grid-template-columns: minmax(0, 1fr); }
}

/* App layout for phones and portrait tablets. Desktop keeps the learning hub. */
/* Explicit sizes beat the shared button font reset: picture answers must stay large. */
.math-player .math-question-content .math-object { width: 120px; min-height: 120px; font-size: 72px; line-height: 1.15; padding: 10px; }
.math-player .math-question-content .math-object img { width: 96px; height: 96px; max-width: 100%; object-fit: contain; }
.math-player .math-question-content .math-option img { width: 88px; height: 88px; max-width: 100%; object-fit: contain; }
.math-player .math-question-content .math-draggable.is-used { background: transparent; border: 2px dashed #d5dfeb; box-shadow: none; opacity: .45; }
.math-player .math-question-content .math-draggable { min-width: 112px; min-height: 112px; font-size: 64px; }
.math-player .math-question-content .math-drop { width: 104px; min-height: 104px; font-size: 60px; }
.math-player .math-question-content .math-option { min-width: 120px; min-height: 108px; font-size: 42px; line-height: 1.3; }
.math-player .math-question-content .math-color-number { font-size: 64px; }
.math-player .math-question-content .math-gap { font-size: 42px; }
.math-player .math-question-content .math-match-item { font-size: 36px; line-height: 1.2; }
.math-player .math-question-content .math-interactive-objects { max-width: 850px; gap: 16px; }
.math-player .math-question-content .math-interactive-objects .math-object { width: 112px; min-height: 112px; font-size: 64px; }
@media (max-width: 575px) {
    .math-player .math-question-content .math-object { width: 90px; min-height: 90px; font-size: 58px; padding: 8px; border-radius: 18px; }
    .math-player .math-question-content .math-object img { width: 72px; height: 72px; }
    .math-player .math-question-content .math-option img { width: 64px; height: 64px; }
    .math-player .math-question-content .math-draggable { min-width: 84px; min-height: 84px; font-size: 50px; }
    .math-player .math-question-content .math-drop { width: 84px; min-height: 84px; font-size: 50px; }
    .math-player .math-question-content .math-option { min-width: 80px; min-height: 88px; font-size: 36px; padding: 10px; }
    .math-player .math-question-content .math-interactive-objects { gap: 10px; }
    .math-player .math-question-content .math-interactive-objects .math-object { width: 84px; min-height: 84px; font-size: 50px; }
    .math-player .math-question-content .math-color-number { font-size: 56px; }
    .math-player .math-question-content .math-gap { font-size: 36px; }
    .math-player .math-question-content .math-match-item { font-size: 26px; }
}
.math-app-only, .math-app-header, .math-app-nav, .math-app-intro { display: none; }
.math-learning-hub .math-topic-choices .math-app-only { display: none; }
.math-learning-hub .math-age-choices .math-app-only { display: none; }
.math-filter-sheet { box-sizing: border-box; width: min(100%, 560px); max-width: 100%; max-height: 88vh; max-height: 88dvh; margin: auto auto 0; padding: 10px 20px max(16px, env(safe-area-inset-bottom)); border: 0; border-radius: 28px 28px 0 0; background: #fff; color: #243c59; font: 15px/1.5 'Nunito', system-ui, sans-serif; box-shadow: 0 -12px 60px #243c5933; }
.math-filter-sheet::backdrop { background: #192c4b80; backdrop-filter: blur(3px); }
.math-filter-sheet[open] { display: flex; flex-direction: column; }
.math-filter-sheet * { box-sizing: border-box; }
.math-sheet-handle { width: 38px; height: 4px; margin: 0 auto 16px; border-radius: 10px; background: #d6dce6; flex-shrink: 0; }
.math-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.math-sheet-heading small { font-size: 10px; font-weight: 900; letter-spacing: .08em; color: #7c63b8; }
.math-sheet-heading h2 { font-size: 24px; font-weight: 900; margin: 3px 0 0; }
.math-filter-sheet button { font: inherit; font-weight: 800; cursor: pointer; border: 1px solid #dce2ed; border-radius: 14px; min-height: 44px; background: #f6f7fc; color: #43556e; }
.math-sheet-heading > button { width: 44px; height: 44px; display: grid; place-items: center; }
.math-sheet-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 3px; }
.math-sheet-content fieldset { border: 0; margin: 0 0 20px; padding: 0; }
.math-sheet-content legend, .math-sheet-content > label { float: none; width: auto; font-size: 14px; font-weight: 900; margin-bottom: 10px; }
.math-sheet-content > label { display: grid; gap: 10px; margin-bottom: 20px; }
.math-sheet-content select { width: 100%; min-height: 48px; border: 1px solid #dce2ed; border-radius: 14px; padding: 10px; background: #f6f7fc; color: #243c59; font: inherit; font-size: 16px; }
.math-sheet-ages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.math-sheet-ages button { font-size: 12px; padding: 6px 2px; }
.math-sheet-status { display: grid; gap: 8px; }
.math-sheet-status button { display: flex; align-items: center; text-align: left; padding: 10px 12px; gap: 10px; }
.math-sheet-radio { border: 2px solid #c9d2e1; border-radius: 50%; width: 19px; height: 19px; margin-left: auto; }
.math-filter-sheet button[aria-pressed=true] { background: #f0e9ff; border-color: #8659ce; color: #6740ab; }
.math-sheet-status button[aria-pressed=true] .math-sheet-radio { border: 5px solid #8053c5; background: #fff; }
.math-sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding-top: 16px; border-top: 1px solid #edf0f6; }
.math-sheet-actions button:last-child { background: #7650c5; border-color: #7650c5; color: white; }
.math-filter-sheet :is(button, select):focus-visible { outline: 3px solid #a17add; outline-offset: 2px; }
@media (max-width: 1023px) {
    body[data-math-app] { background: #f5f6fc; }
    body[data-math-app] :is(.sg-header, .footer, .hvo-support-dock, .hvo-category-tabs) { display: none; }
    body[data-math-app] :is(#VPortal, #page-content, #component-to-load) { margin: 0; padding: 0; min-width: 0; }
    .math-learning-hub { min-height: 100vh; min-height: 100dvh; background: #f5f6fc; }
    .math-learning-hub .math-hub-container { max-width: 760px; padding: 0 0 calc(94px + env(safe-area-inset-bottom)); }
    .math-app-only { display: block; }
    .math-learning-hub :is(.math-garden-welcome, .math-mobile-journey) { display: none; }
    .math-app-header { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: #f5f6fcf5; backdrop-filter: blur(16px); }
    .math-app-header > div { flex: 1; min-width: 0; }
    .math-app-header small { display: block; color: #7e6c9d; font-size: 9px; font-weight: 900; letter-spacing: .07em; }
    .math-app-header strong { display: block; font-size: 18px; font-weight: 900; line-height: 1.5; }
    .math-app-back { display: grid; place-items: center; width: 44px; height: 44px; color: #435571; background: white; border-radius: 14px; border: 1px solid #e6e8f0; }
    .math-world .math-app-wallet { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; padding: 7px 10px; min-height: 44px; border: 1px solid #f1d587; background: #fff0bc; border-radius: 16px; color: #8c5a17; }
    .math-app-wallet svg { width: 21px; height: 21px; }
    .math-learning-hub .math-app-intro { display: flex; align-items: center; position: relative; overflow: hidden; isolation: isolate; min-height: 140px; padding: 16px 20px; margin: 4px 16px 16px; border-radius: 26px; background: radial-gradient(circle at 5% 15%, #ffffff1c 1px, transparent 2px) 0 0 / 18px 18px, linear-gradient(115deg, #244f8b, #4c57a7); box-shadow: 0 5px 0 #dce1f3; }
    .math-app-intro > div { flex: 1; position: relative; z-index: 1; }
    .math-app-kicker { color: #d9e4ff; font-size: 8px; letter-spacing: .08em; font-weight: 900; }
    .math-app-intro h1 { font-size: 27px; line-height: 1.17; margin: 8px 0 10px; color: #fff; }
    .math-app-intro h1 span { color: #ffe188; }
    .math-app-intro p { color: #e3ebff; font-size: 11px; font-weight: 700; margin: 0; }
    .math-app-intro > .hvo-mascot { width: 102px; height: 112px; object-fit: contain; margin: 0 -8px -10px 0; z-index: 1; filter: drop-shadow(0 6px 0 #162f6533); }
    .math-world .math-app-intro button { min-height: 44px; background: #ffda75; border-color: #ffda75; color: #574119; border-radius: 13px; font-size: 12px; padding: 6px 14px; }
    .math-app-spark { position: absolute; right: 16px; top: 12px; color: #ffdb80; font-size: 24px; }
    .math-learning-hub .math-hub-layout { margin-top: 0; gap: 0; }
    .math-learning-hub .math-hub-main { gap: 16px; }
    .math-learning-hub :is(.math-age-panel, .math-topic-panel, .math-catalog) { min-width: 0; }
    .math-learning-hub :is(.math-age-panel, .math-topic-panel) { border: 0; border-radius: 0; padding: 0 16px; background: transparent; }
    .math-age-panel .math-panel-heading { margin-bottom: 12px; }
    .math-age-panel .math-panel-heading h2 { font-size: 15px; }
    .math-age-panel .math-panel-heading h2 > span { display: none; }
    .math-learning-hub .math-age-panel .math-show-all { display: none; }
    .math-age-choices { gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .math-learning-hub .math-age-choices button { min-height: 48px; align-items: center; padding: 8px; border: 1px solid; border-radius: 15px; text-align: center; }
    .math-age-choices strong { font-size: 13px; }
    .math-learning-hub .math-age-choices .math-age-all { display: block; order: -1; background: #fff; border-color: #ded5ef; font-size: 12px; }
    .math-learning-hub .math-age-choices .math-age-all[aria-pressed=true] { color: #fff; background: #7650c5; border-color: #7650c5; }
    .math-age-choices small, .math-age-choices button > span { display: none; }
    .math-topic-panel > .math-panel-heading { display: none; }
    .math-learning-hub .math-topic-choices { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 5px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .math-topic-choices::-webkit-scrollbar { display: none; }
    .math-learning-hub .math-topic-choices button { flex: 0 0 auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 7px; min-height: 44px; border-width: 1px; border-radius: 14px; scroll-snap-align: start; }
    .math-topic-choices button > span { flex: 0 0 23px; height: 24px; border-radius: 7px; font-size: 19px; }
    .math-topic-choices strong { font-size: 12px; }
    .math-topic-choices small { display: none; }
    .math-learning-hub .math-topic-choices .math-topic-all { display: flex; background: #fff; border-color: #ded9ec; }
    .math-learning-hub .math-topic-choices button[aria-pressed=true] { border-color: #8054c8; box-shadow: 0 0 0 1px #8054c8; }
    .math-learning-hub .math-catalog { border: 0; border-radius: 26px; padding: 18px 16px; background: #fff; }
    .math-catalog > .math-panel-heading { flex-wrap: nowrap; margin-bottom: 12px; }
    .math-catalog .math-panel-heading h2 { font-size: 18px; }
    .math-catalog .math-panel-heading p { font-size: 11px; margin-top: 3px; }
    .math-world .math-app-filter-toggle { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 12px; padding: 8px 10px; min-height: 44px; border: 1px solid #ded5ed; border-radius: 14px; background: #f4effc; color: #7551af; }
    .math-app-filter-toggle svg { width: 18px; height: 18px; }
    .math-app-filter-toggle > span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: #7650c5; color: white; font-size: 10px; }
    .math-catalog :is(.math-more-filters, .math-status-filters) { display: none; }
    .math-learning-hub .math-catalog-search { display: block; margin: 0 0 16px; position: relative; }
    .math-catalog-search > span { position: absolute; left: 12px; top: 12px; font-size: 0; line-height: 24px; pointer-events: none; }
    .math-catalog-search > span::before { content: '⌕'; font: 26px/24px system-ui; color: #8a86a1; }
    .math-catalog-search input { background: #f5f6fb; border-color: #ececf4; border-radius: 16px; min-height: 48px; padding-left: 38px; font: 16px/1.4 'Nunito', system-ui, sans-serif; }
    .math-app-active-filters { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -6px 0 14px; font-size: 11px; color: #7754ad; }
    .math-app-active-filters > span { min-width: 0; overflow-wrap: anywhere; }
    .math-world .math-app-active-filters button { min-height: 44px; flex-shrink: 0; padding: 4px 8px; border: 0; font-size: 11px; background: #f5efff; }
    .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
    .math-learning-hub .math-lesson-card { border-width: 1px; border-radius: 22px; padding: 12px 9px 10px; gap: 7px; }
    .math-learning-hub .math-card-top { position: relative; gap: 6px; }
    .math-learning-hub .math-card-state { font-size: 9px; background: #ffffffa6; border-radius: 7px; padding: 2px 7px; }
    .math-card-art { height: 76px; width: 86px; }
    .math-card-art .hvo-mascot { height: 76px; width: 76px; }
    .math-card-art > span { font-size: 21px; width: 30px; height: 30px; border-radius: 10px; }
    .math-learning-hub .math-lesson-card h3 { font-size: 13px; min-height: 36px; }
    .math-learning-hub .math-card-meta { font-size: 10px; padding-top: 0; }
    .math-learning-hub .math-lesson-card > button { font-size: 11px; padding: 7px 4px; border-radius: 12px; }
    .math-learning-hub .math-pagination { justify-content: center; gap: 12px; margin-top: 24px; }
    .math-learning-hub .math-pagination > div { gap: 5px; }
    .math-learning-hub .math-pagination button { min-width: 44px; min-height: 44px; }
    .math-learning-hub .math-pagination :is(.math-page-number, .math-page-gap) { display: none; }
    .math-app-page-select select { min-height: 44px; padding: 6px 10px; border: 1px solid #ded7ee; border-radius: 13px; background: #f4effc; color: #7551af; font: 16px/1.5 'Nunito', system-ui, sans-serif; }
    .math-learning-hub .math-hub-collection { margin: 12px 16px 0; padding: 20px 16px; border: 1px solid #ebe3f5; border-radius: 26px; background: #fff; }
    .math-hub-collection .math-panel-heading h2 { font-size: 23px; }
    .math-hub-collection .math-panel-heading > button { display: none; }
    .math-hub-collection > p { font-size: 13px; color: #748298; }
    .math-learning-hub .math-hub-collection .math-rewards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .math-hub-collection .math-rewards article { position: relative; border-width: 1px; background: linear-gradient(145deg, #f0e2ff, #faf6ff); padding: 16px 10px; }
    .math-hub-collection .math-rewards strong { font-size: 13px; text-align: center; }
    .math-hub-collection .math-rewards img { width: 76px; height: 76px; }
    .math-hub-collection .math-rewards > article > .math-gift-count { font-size: 12px; padding: 3px 10px; }
    .math-learning-hub[data-screen=journey] .math-hub-main { display: none; }
    .math-learning-hub[data-screen=journey] .math-progress-sidebar { display: block; position: static; margin: 12px 16px 0; padding: 24px 18px; border-radius: 28px; text-align: center; background: linear-gradient(145deg, #fff0b8, #fff9e7 45%, #fff); }
    .math-learning-hub[data-screen=journey] .math-journey-heading { justify-content: center; }
    .math-app-journey-art { position: relative; width: 150px; height: 140px; margin: 0 auto 16px; border-radius: 50%; background: #ffe399; }
    .math-app-journey-art .hvo-mascot { width: 136px; height: 140px; object-fit: contain; }
    .math-app-journey-art > span { position: absolute; right: 0; top: 6px; font-size: 32px; color: #d49b30; }
    .math-journey-heading > span { display: none; }
    .math-journey-heading h2 { font-size: 24px; }
    .math-learning-hub .math-journey-stats { max-width: none; margin: 22px 0; gap: 8px; }
    .math-journey-stats > div { padding: 12px 4px; border-radius: 17px; background: #fff; border: 1px solid #f0e5bd; }
    .math-learning-hub .math-journey-progress { max-width: none; }
    .math-learning-hub .math-progress-sidebar > button { width: 100%; min-height: 48px; margin: 8px 0 0; }
    .math-progress-sidebar .math-app-explore { background: #7650c5; border-color: #7650c5; color: white; }
    .math-learning-hub .math-parent-tips { text-align: left; padding: 16px; background: #faf7ff; border: 0; border-radius: 18px; margin-top: 20px; }
    .math-learning-hub[data-screen=gifts] .math-app-intro, .math-learning-hub[data-screen=journey] .math-app-intro { display: none; }
    .math-app-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border-top: 1px solid #e9e5f3; border-radius: 24px 24px 0 0; background: #fffffffa; box-shadow: 0 -5px 26px #4232630b; backdrop-filter: blur(20px); }
    .math-world .math-app-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 4px; border: 0; border-radius: 16px; background: transparent; color: #8990a5; font-size: 10px; font-weight: 800; }
    .math-world .math-app-nav button:hover { background: transparent; }
    .math-app-nav-icon { position: relative; display: grid; place-items: center; width: 54px; height: 30px; border-radius: 12px; }
    .math-app-nav button[aria-current=page] { color: #7850ba; }
    .math-app-nav button[aria-current=page] .math-app-nav-icon { background: #efe7ff; }
    .math-app-nav .math-app-badge { position: absolute; top: -3px; right: 2px; padding: 1px 4px; min-width: 15px; border-radius: 6px; background: #ffda73; color: #77501a; font-size: 8px; border: 1px solid white; line-height: 13px; }
    #math-lessons { scroll-margin-top: 85px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
    .math-learning-hub .math-lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .math-app-intro { padding: 24px 32px; }
    .math-app-intro > .hvo-mascot { width: 140px; height: 140px; margin-right: 24px; }
    .math-app-intro h1 { font-size: 32px; }
    .math-app-nav { max-width: 760px; margin: 0 auto; border: 1px solid #e9e5f3; border-bottom: 0; }
    .math-learning-hub .math-hub-collection .math-rewards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
    .math-filter-sheet[open] { animation: math-sheet-enter .2s ease-out; }
    @keyframes math-sheet-enter { from { transform: translateY(30px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
}

/* Teacher authoring: short steps, visual answers and a scoped live canvas. */
.math-list-help { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 14px 18px; margin-bottom: 18px; border: 1px solid #c8ddfb; border-radius: 14px; background: #f0f6ff; }
.math-author-steps { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 14px 18px; background: #f0f6ff; border: 1px solid #d7e5fa; border-radius: 14px; margin-bottom: 18px; }
.math-author-steps span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.math-author-steps b { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: #2467b5; border-radius: 50%; }
.math-author .math-edit-layout { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); }
.math-author .math-admin-editor { container-type: inline-size; }
.math-author-workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.math-author-preview { min-width: 0; }
.math-author-preview .ant-card-body { display: grid; gap: 12px; }
.math-author-preview small, .math-preview-caption { font-size: 12px; color: #64758b; margin: 0; }
.math-question-guide { padding: 16px; margin-bottom: 20px; background: #eef5ff; border: 1px solid #d2e2f6; border-radius: 12px; }
.math-question-guide strong { font-size: 18px; }
.math-question-guide p { margin: 8px 0 12px; }
.math-question-validation { margin-top: 20px; }
.math-edit-question-list em { float: right; font-size: 11px; font-style: normal; font-weight: 600; }
.math-edit-question-list em.ready { color: #23714c; }
.math-edit-question-list em.needs-work { color: #ad5b14; }
.math-author-details { border: 1px solid #dce3ec; border-radius: 12px; padding: 12px 14px; background: #fbfcfe; min-width: 0; }
.math-author-details summary { cursor: pointer; font-weight: 600; }
.math-author-details[open] > :not(summary) { margin-top: 14px; }
.math-author-details input[type=file] { max-width: 100%; }
.math-publish-setting { padding: 14px; background: #f7f9fb; border-radius: 12px; }
.math-publish-setting label { flex-direction: row; align-items: center; }
.math-publish-setting small { display: block; margin-top: 8px; color: #65758a; }
.math-author-progress { font-size: 13px; color: #27704f; font-weight: 700; }
.math-author .ant-btn { max-width: 100%; height: auto; min-height: 32px; white-space: normal; }
.math-audio-file { display: flex; flex-wrap: wrap; gap: 8px; }
.math-audio-file audio { max-width: 100%; height: 40px; }
.math-choice-editor, .math-answer-field { display: grid; gap: 12px; min-width: 0; }
.math-choice-editor > small, .math-answer-field > small { font-size: 12px; color: #65758a; }
.math-choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid #d4deea; border-radius: 12px; background: #fbfcfe; min-width: 0; }
.math-choice-row.is-answer { border: 2px solid #52a47b; background: #effaf3; padding: 11px; }
.math-choice-correct { display: grid; place-items: center; gap: 2px; width: 100px; min-height: 64px; padding: 6px; background: white; border: 1px solid #b9c9dc; border-radius: 10px; color: #3f5d7c; font-size: 24px; cursor: pointer; }
.math-choice-correct small { font-size: 11px; }
.is-answer .math-choice-correct { color: #20774a; border-color: #52a47b; }
.math-choice-marker { font-size: 12px; color: #64758b; }
.math-choice-value { display: grid; place-items: center; font-size: 30px; min-width: 40px; max-width: 80px; overflow-wrap: anywhere; }
.math-choice-value img { width: 48px; height: 48px; object-fit: contain; }
.math-choice-row > .ant-input { flex: 1 1 120px; width: 120px; min-width: 0; }
.math-choice-picker { flex-basis: 100%; display: grid; gap: 12px; min-width: 0; }
.math-choice-picker input[type=file] { max-width: 100%; }
.math-answer-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.math-answer-tiles button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 8px; border: 2px solid #d4deea; border-radius: 14px; background: #fff; font-size: 36px; cursor: pointer; overflow-wrap: anywhere; min-width: 0; }
.math-answer-tiles img { width: 64px; height: 64px; object-fit: contain; }
.math-answer-tiles button.is-answer { background: #effaf3; border-color: #52a47b; }
.math-answer-tiles small { font-size: 12px; color: #315f4b; }
.math-gap-answers { display: grid; gap: 12px; }
.math-gap-answers .ant-select-selection-item { font-size: 22px; }
.math-gap-answers img, .math-pair-token img, .math-type-dialog img { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
.math-pair-token { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.math-pair-token > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.math-pair-token > span > span { font-size: 20px; }
.math-maze-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.math-maze-tools button, .math-type-filters button { padding: 8px 12px; border: 1px solid #c3d4e8; border-radius: 10px; background: #fff; cursor: pointer; color: #28496c; }
.math-maze-tools button[aria-pressed=true], .math-type-filters button[aria-pressed=true] { background: #2467b5; border-color: #2467b5; color: #fff; }
.math-maze-editor .math-maze button { min-width: 0; overflow: hidden; font-size: clamp(14px, 2vw, 28px); }
.math-author-canvas.math-player { padding: 14px; border-radius: 14px; margin: 0; width: 100%; }
.math-author-canvas h3 { font-size: 18px; line-height: 1.5; margin: 0 0 16px; overflow-wrap: anywhere; }
.math-author-canvas .math-question-content { padding: 10px; border-radius: 14px; }
.math-author-canvas.math-player .math-question-content .math-object { width: 52px; min-height: 52px; padding: 4px; font-size: 30px; border-radius: 12px; }
.math-author-canvas.math-player .math-question-content .math-object img { width: 40px; height: 40px; }
.math-author-canvas.math-player .math-question-content .math-option { min-width: 58px; min-height: 60px; padding: 8px; font-size: 24px; }
.math-author-canvas .math-option small { margin: 0 4px 0 0; }
.math-author-canvas .math-objects, .math-author-canvas .math-options, .math-author-canvas .math-drop-row, .math-author-canvas .math-sequence { gap: 6px; }
.math-author-canvas.math-player .math-question-content .math-match-item { font-size: 22px; }
.math-author-canvas.math-player .math-question-content .math-gap, .math-author-canvas.math-player .math-question-content .math-drop { width: 52px; min-height: 52px; font-size: 26px; }
.math-author-canvas button:disabled { opacity: 1; }
.math-author-canvas .math-keypad { gap: 4px; }
.math-author-canvas .math-keypad button { padding: 4px; font-size: 18px; }
.math-author-canvas .math-maze button { min-width: 0; font-size: 18px; }
.math-preview-placeholder { text-align: center; padding: 24px 12px; background: #f7f9fc; border: 1px dashed #cfdae8; border-radius: 14px; }
.math-preview-placeholder > span { display: block; font-size: 36px; }
.math-preview-placeholder p { font-size: 13px; color: #65758a; }
.math-type-dialog { color: #243c59; }
.math-type-dialog .ant-modal-body { max-height: 72vh; overflow-y: auto; }
.math-type-dialog .ant-input-search { margin: 0 0 12px; }
.math-type-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.math-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.math-type-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; text-align: left; border: 1px solid #d3dfef; border-radius: 16px; background: #f8fbff; color: #243c59; cursor: pointer; min-width: 0; }
.math-type-card:hover, .math-type-card:focus-visible { border-color: #2467b5; background: #edf5ff; }
.math-type-icon { font-size: 30px; }
.math-type-card strong { font-size: 16px; }
.math-type-example { display: block; padding: 8px; border-radius: 8px; background: #fff; font-size: 17px; overflow-wrap: anywhere; }
.math-type-card small { font-size: 12px; line-height: 1.6; color: #63778e; }
@container (min-width: 900px) {
    .math-author-workbench { grid-template-columns: minmax(0, 1fr) 330px; }
    .math-author-preview { position: sticky; top: 16px; }
}
@media (max-width: 991px) { .math-author .math-edit-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
    .math-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .math-type-card { padding: 12px; }
    .math-author .ant-card-head { padding-inline: 14px; }
    .math-author .ant-card-body { padding: 14px; }
    .math-author-steps { gap: 8px; font-size: 12px; }
    .math-author .math-admin-save { padding: 12px; gap: 8px; bottom: 4px; }
}
@media (max-width: 479px) {
    .math-type-grid { grid-template-columns: minmax(0, 1fr); }
    .math-choice-row { gap: 6px; }
    .math-choice-correct { width: 84px; }
    .math-choice-value { min-width: 30px; font-size: 26px; }
    .math-author .math-admin-row > label { min-width: 100px; }
}

.math-age-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.math-age-picker button { padding: 10px 16px; min-height: 44px; border: 2px solid #c8d8e8; border-radius: 12px; background: #fff; color: #243c59; font-weight: 700; cursor: pointer; }
.math-age-picker button[aria-pressed=true] { border-color: #165d92; background: #e5f2ff; box-shadow: 0 0 0 2px #165d9218; }
.math-age-field { flex: 1 1 240px; display: grid; align-content: start; gap: 10px; min-width: 0; }
.math-native-number { width: 110px; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #bdcddd; border-radius: 10px; font: inherit; background: #fff; color: #243c59; }
.math-lesson-starter > .ant-card { max-width: 800px; margin: 0 auto; }
.math-lesson-starter form { display: grid; gap: 24px; }
.math-starter-field { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.math-starter-selected { display: grid; gap: 10px; background: #f0f6ff; border: 1px solid #c5dbf4; border-radius: 14px; padding: 18px; width: 100%; }
.math-starter-selected b { font-size: 18px; }
.math-starter-selected span { font-size: 24px; }
