/* Reference-inspired game UI, shared by every child-facing screen. */
*, *::before, *::after { box-sizing: border-box; }
html { background: #6035df; }
body.jp-child-page {
    margin: 0;
    min-height: 100dvh;
    background: radial-gradient(ellipse at 50% 40%, #673be7, #6035df 78%) !important;
    color: var(--jp-ink);
    font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif;
    isolation: isolate;
}
body.jp-child-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: url("images/game-confetti.svg") center top / cover no-repeat;
}
.jp-child-page :where(button, input, textarea, select) { font-family: inherit; }
.jp-child-page :where(a, button) { touch-action: manipulation; }
.jp-child-page :where(a, button, input, textarea, select):focus-visible {
    outline: 4px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 7px #291178;
}
.jp-child-page :where(button, input, textarea, select) { max-width: 100%; }
.jp-child-page [hidden] { display: none !important; }
.jp-child-page :where(h1, h2, h3, p, strong, small, label) { overflow-wrap: anywhere; }
.jp-child-header, .game-ui { width: min(1650px, 90.5%); margin-inline: auto; }
.jp-child-header { margin-top: clamp(36px, 3.1vw, 56px); padding-top: 30px; }
.jp-child-header[data-dashboard="false"] { padding-top: 0; }
.jp-hud {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.4fr) minmax(0, .82fr) minmax(0, .91fr) minmax(70px, .37fr);
    align-items: center;
    gap: clamp(10px, 1.1vw, 20px);
    min-height: 116px;
    padding: 0 0 0 clamp(14px, 2.9vw, 52px);
    background: linear-gradient(90deg, #2e117e, #271073);
    border-radius: 28px 26px 26px 28px;
    color: #fff;
}
.jp-child-profile { display: flex; align-items: center; gap: clamp(12px, 1vw, 20px); min-width: 0; }
.jp-child-avatar {
    width: clamp(94px, 8vw, 145px);
    height: clamp(94px, 8vw, 145px);
    flex-shrink: 0;
    margin-top: -42px; margin-bottom: -8px;
    border: 5px solid #fff0ff;
    border-radius: 34px;
    background: #ffa4eb;
    padding: 7px;
    box-shadow: 0 0 0 3px #ee72ef, 0 7px 0 #210d69, inset 0 0 0 2px #f674e3;
}
.jp-child-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
.jp-child-profile-copy { min-width: 0; padding-block: 8px; transform: translateY(-8px); }
.jp-greeting { display: block; font-size: clamp(20px, 1.65vw, 30px); font-weight: 1000; line-height: 1.15; }
.jp-child-profile-copy > strong {
    display: flex; align-items: center; gap: 7px;
    color: #ff88e8; font-size: clamp(32px, 3.35vw, 61px); font-weight: 1000; line-height: 1.1;
    letter-spacing: -1.8px; text-shadow: 0 3px 0 #b340ba;
}
.jp-child-profile-copy [data-child-name] { min-width: 0; white-space: nowrap; overflow-wrap: normal; }
.jp-heart { font-size: .75em; flex-shrink: 0; }
.jp-child-level { display: flex; align-items: center; gap: clamp(12px, 1.5vw, 28px); min-width: 0; }
.jp-level-badge {
    position: relative; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: clamp(74px, 6vw, 108px); min-height: clamp(108px, 7.25vw, 132px); margin-top: -36px;
    padding: 15px 8px 9px; border: 4px solid #200b69; border-radius: 31px;
    background: linear-gradient(145deg, #ff9ad9, #f347b2 60%, #cf2997);
    box-shadow: inset 0 0 0 4px #f77bcc, inset 3px 4px 0 3px #ffecfc, 0 6px 0 #16094f;
}
.jp-level-badge > .jp-art { position: absolute; width: 72%; height: 64px; top: -33px; }
.jp-level-badge > span { font-size: clamp(18px, 1.4vw, 26px); font-weight: 1000; line-height: 1.15; }
.jp-level-badge > strong { font-size: clamp(43px, 3.35vw, 61px); font-weight: 1000; line-height: 1; paint-order: stroke fill; -webkit-text-stroke: 5px #251055; text-shadow: 0 3px 0 #251055; }
.jp-child-level-copy { min-width: 0; flex: 1; padding-block: 6px; }
.jp-child-level-copy > strong { display: block; font-size: clamp(14px, 1.16vw, 21px); line-height: 1.2; font-weight: 1000; }
.jp-child-level-bar { height: clamp(25px, 2.1vw, 39px); margin: 7px 0 8px; border: 4px solid #9356ee; border-radius: 99px; background: #1c0a61; box-shadow: inset 0 3px 5px #100438, 0 3px 0 #130748; overflow: hidden; }
.jp-child-level-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(#fff779, #ffdf39 55%, #ffca19); border-top: 3px solid #fffaa7; box-shadow: 2px 0 0 #fff487; }
.jp-child-level-copy > small { display: block; color: #ffe650; font-size: clamp(13px, 1.23vw, 22px); line-height: 1.15; font-weight: 1000; }
.jp-child-daily { display: flex; align-items: center; min-width: 0; gap: 12px; padding: 6px 0 6px clamp(12px, 1.4vw, 26px); border-left: 3px solid #7640d8; }
.jp-child-daily > .jp-art { width: clamp(39px, 3.3vw, 60px); height: 68px; }
.jp-child-daily-copy { min-width: 0; }
.jp-child-daily-copy > span, .jp-child-daily-copy > small { display: block; font-size: clamp(12px, 1.1vw, 20px); font-weight: 850; line-height: 1.2; }
.jp-child-daily-copy > strong { display: block; color: #ffe225; font-size: clamp(21px, 1.85vw, 34px); font-weight: 1000; line-height: 1.25; }
.jp-child-total {
    display: flex; justify-content: space-between; align-items: center; gap: 5px; min-width: 0;
    min-height: clamp(82px, 5.6vw, 103px);
    padding: 2px clamp(5px, .7vw, 12px) 2px 2px;
    background: linear-gradient(#2e137d, #1c075e);
    color: #fff; text-decoration: none; border: 5px solid #3c198d; border-radius: 34px;
    box-shadow: inset 0 0 0 5px #8147e9, 0 7px 0 #190748;
}
.jp-child-total > .jp-art { width: clamp(38px, 3.5vw, 62px); height: clamp(38px, 3.5vw, 62px); margin-block: -4px; }
.jp-child-total > strong { flex: 1 1 auto; min-width: 0; white-space: nowrap; text-align: center; font-size: clamp(16px, 1.25vw, 23px); font-weight: 1000; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: 0; }
.jp-total-plus {
    flex-shrink: 0; display: grid; place-items: center; width: clamp(32px, 2.6vw, 46px); height: clamp(32px, 2.6vw, 46px);
    padding-bottom: 4px; border: 3px solid #078626; border-top-color: #81fb77; border-radius: 50%;
    color: #fff; background: linear-gradient(#33f953, #00c638); font-size: clamp(28px, 2.35vw, 42px); font-weight: 900; line-height: 1;
    box-shadow: inset 2px 2px 0 #75ff78, 0 5px 0 #0d4227;
}
.jp-child-exit {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 100%; min-height: clamp(89px, 6.1vw, 111px); padding: 7px; border: 4px solid #291076; border-radius: 31px;
    background: linear-gradient(#fffaff, #ffe4f7); color: #171047; cursor: pointer;
    box-shadow: inset 0 0 0 3px #ffa5e7, 0 6px 0 #1f0b60; font-size: clamp(16px, 1.3vw, 24px); font-weight: 1000;
}
.jp-child-exit > .jp-art { width: 53px; height: 53px; }
.jp-child-nav { display: flex; align-items: center; gap: 16px; margin-top: 27px; }
.jp-child-nav form { margin: 0; flex-shrink: 0; }
.jp-child-home {
    display: inline-flex; gap: 10px; align-items: center; justify-content: center; min-height: 52px;
    padding: 9px 18px; border: 3px solid #2a1178; border-radius: 18px;
    background: #fff7ff; box-shadow: 0 5px 0 #291177; color: #201150; text-decoration: none;
    font-size: 18px; font-weight: 950; cursor: pointer;
}
.jp-child-home span { font-size: 27px; line-height: 1; }
.jp-child-module { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; font-size: clamp(23px, 2.2vw, 38px); font-weight: 1000; text-shadow: 0 3px 0 #34107e; }
.jp-child-module h1 { margin: 0; font-size: inherit; line-height: 1.15; font-weight: inherit; }
.jp-child-module > .jp-art { width: 65px; height: 65px; }
.game-ui { margin-top: 36px; padding-bottom: 56px; container-type: inline-size; }
.menu-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
[data-theme="blue"], [data-child-module="streaks_v1"] { --jp-card-a: #8eddf9; --jp-card-b: #6bd2fc; --jp-border: #167eda; --jp-accent: #147bdf; }
[data-theme="yellow"], [data-child-module="videos_v1"] { --jp-card-a: #fff197; --jp-card-b: #ffe764; --jp-border: #cda61b; --jp-accent: #d6ad18; }
[data-theme="green"], [data-child-module="texts_v1"] { --jp-card-a: #b1fbbd; --jp-card-b: #8cf6ae; --jp-border: #27bf62; --jp-accent: #2bc467; }
[data-theme="pink"], [data-child-module="acertijos_v1"] { --jp-card-a: #ffc5e6; --jp-card-b: #ff9fcf; --jp-border: #dc4c99; --jp-accent: #df479a; }
[data-theme="lavender"], [data-child-module="rewards_v1"] { --jp-card-a: #e0caff; --jp-card-b: #cdb3fa; --jp-border: #8650e1; --jp-accent: #8650e1; }
[data-theme="aqua"], [data-child-module="math_ops_v1"] { --jp-card-a: #b0f5ee; --jp-card-b: #80e5de; --jp-border: #159bba; --jp-accent: #159bba; }
.menu-card, .menu-card-skeleton {
    min-width: 0; min-height: clamp(294px, 17vw, 311px); border: 3px solid #341078; border-radius: 32px;
    padding: 20px 27px 22px; background: linear-gradient(125deg, var(--jp-card-a), var(--jp-card-b));
    box-shadow: inset 0 0 0 2px var(--jp-border), 0 6px 0 #29116c;
}
.menu-card { display: flex; flex-direction: column; color: #12103f; text-decoration: none; }
.menu-card > .icon { width: clamp(125px, 7.8vw, 142px); height: clamp(125px, 7.8vw, 142px); align-self: center; margin: 0 0 3px; }
.menu-card > .icon > .jp-art { overflow: visible; transform: scale(1.1); }
.menu-card:is([data-slug="videos_v1"], [data-slug="texts_v1"], [data-slug="rewards_v1"]) > .icon > .jp-art { transform: scale(1.28); }
.menu-card-heading { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.menu-title { margin: 0; font-size: clamp(25px, 2vw, 37px); font-weight: 1000; line-height: 1.15; letter-spacing: -.8px; }
.menu-arrow { display: grid; place-items: center; width: 55px; height: 55px; flex-shrink: 0; border: 4px solid var(--jp-border); border-radius: 50%; background: #fff; box-shadow: 0 2px 0 #ffffff7a; }
.menu-arrow svg { width: 29px; height: 29px; }
.menu-subtitle { margin: 4px 0 0; font-size: clamp(15px, 1.05vw, 19px); font-weight: 650; line-height: 1.2; }
.menu-card[data-slug="streaks_v1"] .menu-subtitle { background: #1456d6; color: #fff; text-align: center; border-radius: 99px; padding: 10px 8px; margin-top: 5px; font-weight: 950; font-size: clamp(18px, 1.35vw, 25px); }
.menu-card.is-disabled { opacity: .8; filter: saturate(.45); }
.menu-disabled { display: block; font-size: 13px; font-weight: 850; margin-top: 7px; }
.menu-card-skeleton { display: flex; flex-direction: column; gap: 15px; background: #9870ec; }
.menu-card-skeleton span { display: block; border-radius: 14px; background: linear-gradient(100deg, #b694f1 30%, #dbc2ff 50%, #b694f1 70%); background-size: 220% 100%; animation: jp-shimmer 1.5s linear infinite; }
.menu-card-skeleton .sk-icon { width: 130px; height: 130px; align-self: center; }
.menu-card-skeleton .sk-name { height: 32px; width: 80%; }
.menu-card-skeleton .sk-small { height: 46px; width: 100%; }
.empty-state { grid-column: 1 / -1; padding: 32px; background: #fff197; border: 3px solid #301175; border-radius: 28px; box-shadow: 0 6px 0 #29116c; text-align: center; font-size: 22px; font-weight: 900; }
.empty-state button { display: block; margin: 16px auto 0; border-radius: 12px; padding: 12px 20px; background: #fff; color: #29116c; font-size: 18px; font-weight: 900; cursor: pointer; }
@keyframes jp-shimmer { to { background-position: -220% 0; } }
/* Module content uses the same outlines, accent colors and illustrations. */
.jp-child-page :is(.videos-app, .texts-app, .math-app) { background: transparent; min-height: 0; padding: 0 0 56px; margin: 22px auto 0; width: min(1250px, 91%); color: var(--jp-ink); }
.jp-child-page :is(.texts-shell, .math-shell) { width: 100%; }
.jp-child-page .page { width: min(1500px, 91%); margin: 24px auto 0; padding: 0 0 56px; container-type: inline-size; }
.jp-child-page .page > .top { display: none; }
.jp-child-page :is(.math-top) { flex-wrap: wrap; gap: 12px; }
.jp-child-page .is-module-home { display: none; }
.jp-child-page :is(.math-title) { font-size: clamp(26px, 2.5vw, 40px); line-height: 1.15; color: #fff; }
.jp-child-page :is(.section-title) { font-size: clamp(23px, 1.6vw, 30px); font-weight: 1000; }
.jp-child-page :is(.text-card) { border: 3px solid #32116f; border-radius: 28px; background: linear-gradient(125deg, var(--jp-card-a), var(--jp-card-b)); box-shadow: inset 0 0 0 2px var(--jp-accent), 0 6px 0 #281063; color: var(--jp-ink); font-family: inherit; }
.jp-child-page :is(.text-card-body) { padding: 21px; }
.jp-child-page :is(.text-card h3) { font-size: 23px; font-weight: 1000; color: var(--jp-ink); }
.jp-child-page :is(.text-meta) { flex-wrap: wrap; }
.jp-child-page :is(.text-pill) { background: #fff8; color: #26124e; font-size: 13px; }
.jp-child-page :is(.math-panel, .math-game-card, .tp-card, .panel) {
    border: 3px solid #311170; border-radius: 28px; background: #fffafc;
    box-shadow: inset 0 0 0 2px var(--jp-accent), 0 6px 0 #29116c; color: var(--jp-ink);
}
.jp-child-page :is(.math-panel, .tp-card) { padding: clamp(18px, 2.3vw, 34px); }
.jp-child-page :is(.math-back, .math-button, .tp-primary, .redeem-btn, .pager-btn) { min-height: 48px; border-radius: 16px; font-weight: 900; }
.jp-child-page :is(.math-back) { border: 2px solid #311170; }
.jp-child-page :is(.math-button, .tp-primary, .redeem-btn) {
    border: 3px solid #b88919; background: linear-gradient(#fff080, #ffcf32); color: #211044; box-shadow: 0 5px 0 #9c721e;
}
.jp-child-page :is(.video-frame iframe) { max-width: 100%; border-radius: 20px; }
.jp-child-page :is(.videos-loading, .texts-loading, .math-loading) { border-radius: 24px; background: #fff6fccc; border: 3px solid #35137d; padding: 30px; color: #25124f; }
.jp-child-page .math-icon { width: 100px; height: 100px; }
.jp-child-page .math-task-icon { width: 70px; height: 70px; }
.jp-child-page .math-intro { grid-template-columns: auto minmax(0, 1fr); }
.jp-child-page .math-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-child-page .math-fact { overflow-wrap: anywhere; }
.jp-child-page .math-game-main { grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr); }
.jp-child-page .math-expression--large { font-size: clamp(32px, 4vw, 60px); overflow-wrap: anywhere; }
.jp-child-page .math-keypad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-child-page .math-keypad button { min-width: 0; min-height: 64px; }
.jp-child-page .math-result-row { grid-template-columns: minmax(0, 1fr) auto; }
.jp-child-page .tp-card { min-width: 0; }
.jp-child-page .tp-card h2 { font-size: clamp(26px, 2.6vw, 42px); line-height: 1.2; margin: 26px 0; }
.jp-child-page .tp-tier { overflow-wrap: anywhere; }
.jp-child-page .tp-stars { word-break: break-all; }
.jp-child-page .tp-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Store and streak retain their own functional layouts. */
.jp-child-page .store-ui { width: min(1500px, 91%); margin: 26px auto 0; padding-bottom: 56px; }
.jp-child-page .store-ui .content-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, .38fr); gap: 22px; }
.jp-child-page .prize-grid { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 18px; }
.jp-child-page .title-icon:has(.jp-art) { width: 45px; height: 45px; }
.jp-child-page .prize-card { border: 3px solid #311170; border-radius: 27px; box-shadow: 0 6px 0 #29116c; min-width: 0; }
.jp-child-page .prize-name { color: #20124a; font-size: 23px; }
.jp-child-page .redemption-item { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; }
.jp-child-page .redemption-item > div { min-width: 0; }
.jp-child-page .redeem-title { overflow-wrap: anywhere; }
.jp-child-page .toast-game { max-width: calc(100% - 32px); }
.jp-child-page .hero { border: 3px solid #2a1679; border-radius: 28px; background: linear-gradient(125deg, #a6eaff, #77d7fe); box-shadow: 0 6px 0 #29116c; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); }
.jp-child-page .stack { min-width: 0; }
.jp-child-page .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.jp-child-page .day { min-width: 0; padding-inline: 3px; }
.jp-child-page .day-icon { font-size: clamp(16px, 2vw, 26px); }
.jp-child-page .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-child-page .pin-card { width: min(360px, 100%); border: 4px solid #321173; border-radius: 32px; background: linear-gradient(#fffaff, #ffe6f8); box-shadow: inset 0 0 0 3px #f798de, 0 7px 0 #2a126c; padding: 28px; }
.jp-login-avatar { width: 96px; height: 96px; margin: 0 auto 20px; padding: 5px; border: 3px solid #f484db; border-radius: 26px; background: #ffc1ed; box-shadow: 0 5px 0 #cb56b5; }
.jp-login-avatar img { display: block; width: 100%; height: 100%; border-radius: 17px; }
.jp-child-page .keypad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jp-child-page .key { min-width: 0; min-height: 56px; border-radius: 16px; border: 2px solid #9a5fde; box-shadow: 0 4px 0 #7140ba; }
@container (max-width: 700px) {
    .jp-child-page .hero { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .calendar { gap: 4px; }
    .jp-child-page .day { padding-inline: 1px; }
    .jp-child-page .day-icon { font-size: 20px; }
    .jp-child-page .today-pill { font-size: 9px; padding-inline: 3px; }
}
@media (max-width: 1350px) and (min-width: 1101px) {
    .jp-hud { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.32fr) minmax(0, .9fr) minmax(0, .85fr) 70px; padding-left: 14px; gap: 12px; }
    .jp-child-profile-copy > strong { font-size: 35px; letter-spacing: -1px; }
    .jp-child-avatar { width: 90px; height: 102px; }
    .jp-child-daily { padding-left: 12px; gap: 6px; }
    .jp-child-daily > .jp-art { width: 34px; }
    .jp-child-total > .jp-art { width: 42px; height: 48px; margin-block: 0; }
    .jp-child-total > strong { font-size: clamp(16px, 1.4vw, 20px); letter-spacing: 0; }
    .menu-card { padding: 18px; }
    .menu-arrow { width: 43px; height: 43px; border-width: 3px; }
    .menu-title { font-size: 26px; }
}
@media (max-width: 1100px) {
    .jp-child-header { margin-top: 25px; padding-top: 0; }
    .jp-hud { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) minmax(0, .65fr) 75px; gap: 18px; padding: 18px 22px; border-radius: 28px; }
    .jp-child-profile { grid-column: 1 / 4; }
    .jp-child-avatar { width: 90px; height: 90px; margin: 0; border-radius: 25px; padding: 5px; }
    .jp-child-avatar img { border-radius: 15px; }
    .jp-child-profile-copy > strong { font-size: 44px; }
    .jp-child-profile-copy { transform: none; }
    .jp-greeting { font-size: 22px; }
    .jp-child-exit { grid-column: 4; grid-row: 1; min-height: 80px; border-radius: 24px; font-size: 17px; }
    .jp-child-exit > .jp-art { width: 40px; height: 40px; }
    .jp-child-level { grid-column: 1 / 3; grid-row: 2; }
    .jp-level-badge { width: 69px; min-height: 90px; margin: 0; border-radius: 24px; padding: 15px 6px 5px; }
    .jp-level-badge > .jp-art { height: 43px; top: -19px; }
    .jp-level-badge > span { font-size: 16px; }
    .jp-level-badge > strong { font-size: 42px; }
    .jp-child-level-copy > strong { font-size: 16px; }
    .jp-child-level-copy > small { font-size: 16px; }
    .jp-child-level-bar { height: 29px; }
    .jp-child-daily { grid-column: 3 / 5; grid-row: 2; padding-left: 20px; }
    .jp-child-daily-copy > span, .jp-child-daily-copy > small { font-size: 15px; }
    .jp-child-daily-copy > strong { font-size: 26px; }
    .jp-child-daily > .jp-art { width: 40px; }
    .jp-child-total { grid-column: 3 / 5; grid-row: 1; margin-right: 98px; display: none; }
    .jp-child-profile { padding-right: 170px; }
    .jp-child-total { display: flex; position: absolute; right: 118px; top: 45px; width: 180px; min-height: 68px; margin: 0; }
    .jp-child-header { position: relative; }
    .jp-child-total { gap: 3px; padding: 2px 5px 2px 2px; }
    .jp-child-total > .jp-art { width: 36px; height: 42px; margin-block: 0; }
    .jp-child-total > strong { font-size: clamp(15px, 1.7vw, 19px); letter-spacing: 0; }
    .jp-total-plus { width: 32px; height: 34px; font-size: 28px; }
    .game-ui { margin-top: 25px; }
    .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
    .menu-card { min-height: 290px; padding: 18px 21px; }
    .menu-card > .icon { width: 140px; height: 140px; }
    .menu-title { font-size: 29px; }
    .menu-arrow { width: 45px; height: 45px; border-width: 3px; }
    .jp-child-page .store-ui .content-grid { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .side-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 760px) {
    .jp-child-header, .game-ui { width: calc(100% - 28px); }
    .jp-child-header { margin-top: 18px; }
    .jp-hud { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 60px; gap: 14px 10px; padding: 14px; }
    .jp-child-profile { grid-column: 1 / 3; padding-right: 0; gap: 13px; }
    .jp-child-avatar { width: 70px; height: 76px; border-width: 3px; border-radius: 23px; padding: 4px; }
    .jp-child-profile-copy > strong { font-size: clamp(26px, 6.6vw, 42px); letter-spacing: -1px; gap: 4px; }
    .jp-child-profile-copy [data-child-name] { font-size: clamp(24px, 6vw, 36px); }
    .jp-greeting { font-size: 19px; }
    .jp-child-exit { grid-column: 3; grid-row: 1; min-height: 72px; border-width: 3px; border-radius: 21px; font-size: 15px; }
    .jp-child-exit > .jp-art { width: 36px; height: 36px; }
    .jp-child-level { grid-column: 1 / 4; grid-row: 2; gap: 13px; }
    .jp-level-badge { width: 58px; min-height: 75px; border-width: 3px; border-radius: 21px; padding: 14px 4px 5px; }
    .jp-level-badge > span { font-size: 14px; }
    .jp-level-badge > strong { font-size: 34px; -webkit-text-stroke-width: 4px; }
    .jp-child-level-copy { padding-block: 0; }
    .jp-child-level-copy > strong { font-size: 16px; }
    .jp-child-level-copy > small { font-size: 15px; }
    .jp-child-daily { grid-column: 1; grid-row: 3; border-left: 0; padding: 0; gap: 6px; }
    .jp-child-daily > .jp-art { width: 33px; height: 47px; }
    .jp-child-daily-copy > span, .jp-child-daily-copy > small { font-size: 12px; }
    .jp-child-daily-copy > strong { font-size: 21px; }
    .jp-child-total { grid-column: 2 / 4; grid-row: 3; position: static; width: auto; min-height: 63px; border-radius: 24px; border-width: 3px; padding-right: 6px; }
    .jp-child-total { gap: 2px; padding: 2px 4px 2px 1px; }
    .jp-child-total > .jp-art { width: 34px; height: 38px; margin-block: 0; }
    .jp-child-total > strong { font-size: clamp(15px, 4.8vw, 19px); letter-spacing: 0; }
    .jp-total-plus { width: 31px; height: 32px; font-size: 26px; border-width: 2px; }
    .jp-child-nav { margin-top: 22px; gap: 12px; }
    .jp-child-home { min-height: 48px; font-size: 16px; padding: 8px 12px; gap: 6px; border-radius: 15px; }
    .jp-child-module { font-size: 24px; gap: 6px; }
    .jp-child-module > .jp-art { width: 49px; height: 49px; }
    .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
    .menu-card, .menu-card-skeleton { border-radius: 25px; min-height: 269px; padding: 14px; }
    .menu-card > .icon { width: 125px; height: 125px; margin-bottom: 8px; }
    .menu-title { font-size: 24px; letter-spacing: -.7px; }
    .menu-arrow { width: 37px; height: 37px; border-width: 3px; }
    .menu-arrow svg { width: 23px; height: 23px; }
    .menu-subtitle { font-size: 15px; line-height: 1.25; }
    .menu-card[data-slug="streaks_v1"] .menu-subtitle { font-size: 17px; margin-top: 9px; padding-inline: 4px; }
    .jp-child-page :is(.videos-app, .texts-app, .math-app, .store-ui, .page) { width: calc(100% - 28px); }
    .jp-child-page :is(.tp-card, .math-panel) { padding: 18px; border-radius: 24px; }
    .jp-child-page .math-game-main { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .math-intro { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .jp-child-page .math-icon { margin-inline: auto; }
    .jp-child-page .math-facts { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .math-fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .jp-child-page .math-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jp-child-page .side-col { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .info-grid { grid-template-columns: minmax(0, 1fr); }
    .jp-child-page .redemption-item { grid-template-columns: 34px minmax(0, 1fr); }
    .jp-child-page .redemption-status { grid-column: 2; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
}
@media (max-width: 420px) {
    .jp-hud { padding: 12px 10px; gap: 12px 8px; }
    .jp-child-profile { gap: 10px; }
    .jp-child-avatar { width: 60px; height: 69px; }
    .jp-child-profile-copy > strong { font-size: 29px; }
    .jp-child-profile-copy [data-child-name] { font-size: clamp(22px, 6.6vw, 27px); }
    .jp-child-daily > .jp-art { display: none; }
    .jp-child-daily-copy > strong { font-size: 21px; }
    .jp-child-total > .jp-art { width: 30px; height: 34px; }
    .jp-child-total > strong { font-size: 15px; }
    .jp-total-plus { width: 28px; height: 29px; font-size: 24px; }
    .menu-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .menu-card, .menu-card-skeleton { min-height: 255px; padding: 17px 23px 22px; border-radius: 29px; }
    .menu-card > .icon { width: 140px; height: 140px; margin-bottom: 3px; }
    .menu-title { font-size: 31px; }
    .menu-arrow { width: 47px; height: 47px; }
    .menu-subtitle { font-size: 17px; }
    .menu-card[data-slug="streaks_v1"] .menu-subtitle { font-size: 21px; }
    .jp-child-page .day { font-size: 11px; }
    .jp-child-page .calendar { gap: 4px; }
    .jp-child-page .hero { flex-direction: column; padding: 20px; }
    .jp-child-page .tp-result-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Keep these after viewport rules: browser zoom can narrow the content
   without changing the viewport's media query width. */
@container (max-width: 700px) {
    .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 400px) {
    .menu-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .jp-child-page *, .jp-child-page *::before, .jp-child-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .jp-child-page :is(a, button):hover { transform: none !important; }
}
/* Keep progress and controls still when a child changes pages or hovers. */
.jp-child-page *, .jp-child-page *::before, .jp-child-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}
.jp-child-page :is(a, button):is(:hover, :active) {
    transform: none !important;
    filter: none !important;
}
