        @import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Poppins:wght@400;600;700&display=swap');

        * { box-sizing: border-box; }

        :root {
            /* 6-hue palette — ChatGPT review: fewer colors = clearer, more memorable */
            --hue-1: #FF6B6B; --hue-1-dark: #C13D3D;   /* red */
            --hue-2: #FFD23F; --hue-2-dark: #C99B14;   /* yellow */
            --hue-3: #4ECDC4; --hue-3-dark: #2EA399;   /* green/teal */
            --hue-4: #4A90E2; --hue-4-dark: #2A6BB8;   /* blue */
            --hue-5: #9B59B6; --hue-5-dark: #6E3C84;   /* purple */
            --hue-6: #F47286; --hue-6-dark: #BD3F5A;   /* pink */
            --navy: #1F2747;
            --navy-soft: #4B547A;
            --cream: #FFF6E6;
            --cream-deep: #FFEFD5;
            /* Calmer meta UI — muted indigo/violet */
            --meta-indigo: #6E72A0;
            --meta-indigo-soft: #E8E9F3;
            --meta-violet-grad-a: #7E76C9;
            --meta-violet-grad-b: #9A8FE0;
            /* Ghost berry — warm neutral gray, harmonizes with white-cream ten-frame */
            --ghost-stroke: rgba(74, 70, 60, 0.30);
            --ghost-fill: rgba(74, 70, 60, 0.04);
            /* White-cream play surface (matches design) */
            --play-surface-a: #FFFFFF;
            --play-surface-b: #FFF8E8;
            /* Card outline — fine navy boundary used on every box (matches design line-art style) */
            --box-border: rgba(31, 39, 71, 0.28);
        }

        body {
            font-family: 'Poppins', sans-serif;
            margin: 0;
            padding: 14px 20px 20px;
            background: linear-gradient(135deg, #0F1729 0%, #1A2440 50%, #0F1729 100%);
            min-height: 100vh;
            color: var(--navy);
            background-attachment: scroll;   /* was fixed — caused full-viewport repaint on every scroll frame */
        }

        .site-home-wrap { max-width: 1200px; margin: 0 auto 8px; }
        .site-home-link {
            display: inline-flex; align-items: center; gap: 6px;
            color: #cbd5e1; text-decoration: none; font-size: 0.95em;
            font-weight: 600; padding: 8px 14px; border-radius: 999px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            transition: all 0.2s ease;
        }
        .site-home-link + .site-home-link { margin-left: 8px; }
        .site-home-link:hover {
            background: rgba(255, 255, 255, 0.12); color: #ffffff;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px 28px 22px;
            background: linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
            border-radius: 26px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
            position: relative;
            overflow: hidden;
        }

        /* Decorative scenery — sun, vines, leafy corners */
        .scenery-sun {
            display: none;   /* retired: top-right now holds the flanking reward stars */
            position: absolute; top: 12px; right: 14px; width: 116px; height: 116px;
            pointer-events: none; z-index: 0; opacity: 0.95;
        }
        .scenery-vine-tl, .scenery-vine-br, .scenery-vine-bl {
            position: absolute; pointer-events: none; z-index: 0; opacity: 0.75;
        }
        .scenery-vine-tl { top: 0; left: 0; width: 200px; height: 200px; }
        .scenery-vine-br { bottom: 0; right: 0; width: 230px; height: 230px; transform: scaleX(-1); }
        .scenery-vine-bl { bottom: 6px; left: 8px; width: 230px; height: 200px; transform: scaleX(-1); }

        h1.mega-title {
            text-align: center;
            font-family: 'Fredoka', 'Poppins', sans-serif;
            font-size: clamp(2rem, 4.5vw, 2.8rem);
            font-weight: 700;
            margin: 0 0 4px;
            letter-spacing: -0.02em;
            position: relative;
            z-index: 1;
        }
        .mega-title .rainbow-text {
            background: linear-gradient(90deg, #FF6B6B, #FFC93C, #5DD3A9, #6BB6FF, #A78BFA, #F472B6);
            background-size: 300% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            -webkit-text-stroke: 2px var(--navy);
            paint-order: stroke fill;
            animation: rainbow-flow 8s linear infinite;
            filter: drop-shadow(0 4px 0 rgba(31, 39, 71, 0.15));
        }
        @keyframes rainbow-flow {
            from { background-position: 0% 50%; }
            to { background-position: 300% 50%; }
        }

        .subtitle {
            text-align: center;
            color: var(--navy-soft);
            font-size: 0.98em;
            font-weight: 500;
            margin: 0 0 8px;
            position: relative;
            z-index: 1;
        }

        .title-row {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 16px;
            position: relative;
            z-index: 1;
            margin-bottom: 4px;
        }
        .title-left { justify-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
        .title-right { justify-self: end; }
        .title-center { text-align: center; }
        .title-center .mega-title { margin: 0; }
        .title-center .subtitle { margin: 0; }

        .game-grid {
            display: grid;
            grid-template-columns: 245px 1fr;
            gap: 18px;
            position: relative;
            z-index: 1;
        }

        /* ============ GOAL COLUMN (left) — card + mascot area below ============ */
        .goal-column {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }
        .goal-card {
            background: linear-gradient(160deg, #FFFFFF 0%, #FFF8E8 100%);
            border-radius: 22px;
            padding: 10px 18px 12px;
            border: 2px solid var(--box-border);
            box-shadow: 0 8px 24px rgba(31, 39, 71, 0.08);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            position: relative;
            overflow: hidden;
            width: 100%;
        }
        .mascot-area {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            width: 100%;
            margin-top: 4px;
        }
        .goal-label {
            font-size: 0.92em;
            font-weight: 700;
            letter-spacing: 0.14em;
            color: var(--navy);
            text-transform: uppercase;
        }
        .target-display {
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            font-size: 10rem;
            line-height: 0.92;
            margin: 2px 0 0;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.30) 30%, rgba(255, 255, 255, 0) 55%, rgba(31, 39, 71, 0.15) 100%),
                linear-gradient(90deg, #FF6B6B 0%, #FFC93C 22%, #5DD3A9 42%, #6BB6FF 62%, #A78BFA 82%, #F472B6 100%);
            background-size: 100% 100%, 100% 100%;
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            -webkit-text-stroke: 3px var(--navy);
            paint-order: stroke fill;
            filter: drop-shadow(0 6px 0 rgba(31, 39, 71, 0.18)) drop-shadow(0 14px 24px rgba(31, 39, 71, 0.22));
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .berries-label {
            font-family: 'Fredoka', sans-serif;
            font-size: 1.4em;
            font-weight: 600;
            color: var(--navy);
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: -2px;
        }
        .berries-label .basket-icon { font-size: 1.6em; line-height: 1; }

        /* === Mascot — Berry, full 8-state set per MASCOT-SYSTEM.md ===
           Mirrors games/berry_workspace.html. Universal cues (cheer/sad/track
           glow + filter) come from /static/css/mascot-system.css. */
        .mascot-stage {
            position: relative;
            margin-top: 0;
            width: 236px; height: 252px;
            display: flex; align-items: flex-end; justify-content: center;
        }
        .mascot-stage::before {
            content: ''; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
            width: 212px; height: 212px; border-radius: 50%;
            background: radial-gradient(circle at 50% 45%, rgba(255,255,255,0.9) 0%, rgba(255,246,230,0.55) 46%, rgba(255,246,230,0) 72%);
            z-index: 0; pointer-events: none;
        }
        .mascot {
            width: 190px; height: 244px;
            overflow: visible; position: relative; z-index: 1;
        }
        .mascot .berry-upper {
            transform-origin: 70px 140px;
            animation: berry-upper-anim 3s ease-in-out infinite;
        }
        @keyframes berry-upper-anim {
            0%, 100% { transform: rotate(-2.5deg) scaleY(1)     scaleX(1);     }
            50%      { transform: rotate(2.5deg)  scaleY(1.035) scaleX(0.985); }
        }
        .mascot .mascot-eyes {
            transform-origin: 70px 84px;
            animation: berry-blink 4.5s ease-in-out infinite;
        }
        @keyframes berry-blink {
            0%, 92%, 100% { transform: scaleY(1);    }
            94%, 96%, 98% { transform: scaleY(0.08); }
        }
        .mascot .berry-eyebrows {
            animation: berry-brow-lift 3s ease-in-out infinite;
            transform-origin: 70px 72px;
        }
        @keyframes berry-brow-lift {
            0%, 100% { transform: translateY(0);    }
            50%      { transform: translateY(-1px); }
        }
        /* RIGHT ARM — 20s varied wave cycle (pendulum bursts + rests) */
        .mascot .berry-arm-right {
            transform-origin: 116px 96px;
            animation: berry-wave-cycle 20s ease-in-out infinite;
        }
        @keyframes berry-wave-cycle {
            0%   { transform: rotate(0deg);   }
            2%   { transform: rotate(-28deg); }
            4%   { transform: rotate(30deg);  }
            6%   { transform: rotate(-32deg); }
            8%   { transform: rotate(28deg);  }
            10%  { transform: rotate(-30deg); }
            12%  { transform: rotate(26deg);  }
            14%  { transform: rotate(-28deg); }
            16%  { transform: rotate(22deg);  }
            18%  { transform: rotate(-24deg); }
            20%  { transform: rotate(15deg);  }
            22%  { transform: rotate(0deg);   }
            32%  { transform: rotate(155deg); }
            52%  { transform: rotate(155deg); }
            60%  { transform: rotate(0deg);   }
            62%  { transform: rotate(-26deg); }
            64%  { transform: rotate(28deg);  }
            66%  { transform: rotate(-28deg); }
            68%  { transform: rotate(0deg);   }
            75%  { transform: rotate(155deg); }
            82%  { transform: rotate(155deg); }
            86%  { transform: rotate(0deg);   }
            88%  { transform: rotate(-30deg); }
            90%  { transform: rotate(28deg);  }
            92%  { transform: rotate(-30deg); }
            94%  { transform: rotate(25deg);  }
            96%  { transform: rotate(-22deg); }
            98%  { transform: rotate(15deg);  }
            100% { transform: rotate(0deg);   }
        }
        /* LEFT ARM — 13s cycle: gentle hang most of the time, occasionally lifts to wave too */
        .mascot .berry-arm-left {
            transform-origin: 24px 98px;
            animation: berry-arm-left-cycle 13s ease-in-out infinite;
        }
        @keyframes berry-arm-left-cycle {
            0%   { transform: rotate(0deg);   }
            8%   { transform: rotate(6deg);   }
            16%  { transform: rotate(2deg);   }
            24%  { transform: rotate(10deg);  }
            30%  { transform: rotate(0deg);   }
            38%  { transform: rotate(108deg); }
            40%  { transform: rotate(80deg);  }
            42%  { transform: rotate(135deg); }
            44%  { transform: rotate(82deg);  }
            46%  { transform: rotate(132deg); }
            48%  { transform: rotate(85deg);  }
            50%  { transform: rotate(130deg); }
            52%  { transform: rotate(90deg);  }
            54%  { transform: rotate(125deg); }
            56%  { transform: rotate(95deg);  }
            58%  { transform: rotate(108deg); }
            68%  { transform: rotate(0deg);   }
            76%  { transform: rotate(8deg);   }
            84%  { transform: rotate(3deg);   }
            92%  { transform: rotate(11deg);  }
            100% { transform: rotate(0deg);   }
        }

        /* Hidden overlays — only shown in their state */
        .mascot .berry-mouth-sad,
        .mascot .berry-mouth-o,
        .mascot .berry-mouth-small,
        .mascot .berry-eyebrows-sad,
        .mascot .berry-arm-right-waist-path,
        .mascot .berry-arm-left-waist-path,
        .mascot .berry-arm-right-waist-hand,
        .mascot .berry-arm-left-waist-hand,
        .mascot .berry-arm-right-think-arm,
        .mascot .berry-arm-right-think-hand { display: none; }

        /* === CHEER — squat → launch → flip → land === */
        .mascot.expr-cheer .berry-upper {
            animation: berry-cheer 0.8s ease-in-out 3;
            transform-origin: 70px 140px;
        }
        @keyframes berry-cheer {
            0%, 100% { transform: translateY(0)     rotate(0deg);   }
            8%       { transform: translateY(6px)   rotate(0deg);   }
            16%      { transform: translateY(-22px) rotate(0deg);   }
            30%      { transform: translateY(-22px) rotate(-12deg); }
            55%      { transform: translateY(-14px) rotate(0deg);   }
            80%      { transform: translateY(-22px) rotate(12deg);  }
            92%      { transform: translateY(-2px)  rotate(0deg);   }
        }
        .mascot.expr-cheer .berry-legs {
            animation: berry-legs-cheer 0.8s ease-in-out 3;
            transform-origin: 70px 168px;
        }
        @keyframes berry-legs-cheer {
            0%, 100% { transform: translateY(0)     scaleY(1);    }
            8%       { transform: translateY(0)     scaleY(0.62); }
            16%      { transform: translateY(-22px) scaleY(1);    }
            30%, 80% { transform: translateY(-22px) scaleY(1);    }
            92%      { transform: translateY(0)     scaleY(0.82); }
        }
        .mascot.expr-cheer .berry-feet {
            animation: berry-feet-cheer 0.8s ease-in-out 3;
        }
        @keyframes berry-feet-cheer {
            0%, 100% { transform: translateY(0);     }
            8%       { transform: translateY(0);     }
            16%      { transform: translateY(-22px); }
            30%, 80% { transform: translateY(-22px); }
            92%      { transform: translateY(0);     }
        }

        /* === SAD — both arms hang, body slumps + horizontal ellipse, brows sad, frown === */
        .mascot.expr-sad .berry-upper {
            animation: berry-sad-sigh 4s ease-in-out infinite;
            transform-origin: 70px 140px;
        }
        @keyframes berry-sad-sigh {
            0%, 100% { transform: translateY(3px) scaleY(0.96) scaleX(1.06) rotate(-1.5deg); }
            25%      { transform: translateY(3px) scaleY(0.96) scaleX(1.06) rotate(0deg);    }
            50%      { transform: translateY(2px) scaleY(0.94) scaleX(1.08) rotate(1.5deg);  }
            75%      { transform: translateY(3px) scaleY(0.96) scaleX(1.06) rotate(0deg);    }
        }
        .mascot.expr-sad .mascot-eyes {
            animation: berry-sad-blink 4.5s ease-in-out infinite;
            transform-origin: 70px 84px;
        }
        @keyframes berry-sad-blink {
            0%, 92%, 100% { transform: scaleY(0.5)  translateY(9px); }
            94%, 96%, 98% { transform: scaleY(0.04) translateY(9px); }
        }
        .mascot.expr-sad .berry-eyebrows-sad {
            transform: translateY(6px);
            transform-origin: 70px 76px;
        }
        .mascot.expr-sad .berry-arm-right {
            animation: none;
            transform: rotate(150deg);
            transform-origin: 116px 96px;
        }
        .mascot.expr-sad .berry-arm-left {
            animation: none;
            transform: rotate(0deg);
        }
        .mascot.expr-sad .berry-mouth-happy { display: none; }
        .mascot.expr-sad .berry-mouth-sad   { display: block; }
        .mascot.expr-sad .berry-eyebrows     { display: none; }
        .mascot.expr-sad .berry-eyebrows-sad { display: block; }

        /* === THINKING — head tilt, eyes up, pursed mouth, hand to cheek === */
        .mascot.expr-think .berry-upper {
            animation: berry-think-tilt 5s ease-in-out infinite;
            transform-origin: 70px 140px;
        }
        @keyframes berry-think-tilt {
            0%, 100% { transform: rotate(-4deg) scaleY(1);    }
            50%      { transform: rotate(-6deg) scaleY(1.02); }
        }
        .mascot.expr-think .berry-arm-right { display: none; }
        .mascot.expr-think .berry-arm-right-think-arm,
        .mascot.expr-think .berry-arm-right-think-hand { display: block; }
        .mascot.expr-think .berry-arm-left {
            animation: none;
            transform: rotate(0deg);
        }
        .mascot.expr-think .mascot-eyes {
            animation: berry-think-blink 4.5s ease-in-out infinite;
            transform-origin: 70px 84px;
        }
        @keyframes berry-think-blink {
            0%, 92%, 100% { transform: translateY(-2px) scaleY(0.8);  }
            94%, 96%, 98% { transform: translateY(-2px) scaleY(0.05); }
        }
        .mascot.expr-think .berry-mouth-happy { display: none; }
        .mascot.expr-think .berry-mouth-small { display: block; }

        /* === SURPRISED — gasp pose, hands on waist, wide eyes, "o" mouth === */
        .mascot.expr-surprised .berry-upper {
            animation: berry-surprised-pose 0.9s ease-out forwards;
            transform-origin: 70px 140px;
        }
        @keyframes berry-surprised-pose {
            0%   { transform: scaleX(1)    scaleY(1)    translateY(0);    }
            18%  { transform: scaleX(0.92) scaleY(1.18) translateY(-4px); }
            100% { transform: scaleX(0.98) scaleY(1.06) translateY(-1px); }
        }
        .mascot.expr-surprised .berry-arm-right,
        .mascot.expr-surprised .berry-arm-left { display: none; }
        .mascot.expr-surprised .berry-arm-right-waist-path,
        .mascot.expr-surprised .berry-arm-left-waist-path,
        .mascot.expr-surprised .berry-arm-right-waist-hand,
        .mascot.expr-surprised .berry-arm-left-waist-hand { display: block; }
        .mascot.expr-surprised .mascot-eyes {
            animation: berry-surprised-blink 4.5s ease-in-out infinite;
            transform-origin: 70px 84px;
        }
        @keyframes berry-surprised-blink {
            0%, 92%, 100% { transform: scaleX(1.3) scaleY(1.3);  }
            94%, 96%, 98% { transform: scaleX(1.3) scaleY(0.06); }
        }
        .mascot.expr-surprised .berry-mouth-happy { display: none; }
        .mascot.expr-surprised .berry-mouth-o     { display: block; }
        .mascot.expr-surprised .berry-eyebrows {
            animation: none;
            transform: translateY(-4px);
        }

        /* === EXCITED — rhythmic squat-bounce + both arms waving fast === */
        .mascot.expr-excited .berry-upper {
            animation: berry-excited-upper 0.55s ease-in-out infinite;
            transform-origin: 70px 140px;
        }
        @keyframes berry-excited-upper {
            0%, 100% { transform: translateY(0)   scaleY(1);    }
            50%      { transform: translateY(7px) scaleY(0.94); }
        }
        .mascot.expr-excited .berry-legs {
            animation: berry-excited-legs 0.55s ease-in-out infinite;
            transform-origin: 70px 168px;
        }
        @keyframes berry-excited-legs {
            0%, 100% { transform: scaleY(1);    }
            50%      { transform: scaleY(0.72); }
        }
        .mascot.expr-excited .berry-arm-right {
            animation: berry-excited-arm-r 0.4s ease-in-out infinite;
            transform-origin: 116px 96px;
        }
        @keyframes berry-excited-arm-r {
            0%, 100% { transform: rotate(-22deg); }
            50%      { transform: rotate(12deg);  }
        }
        .mascot.expr-excited .berry-arm-left {
            animation: berry-excited-arm-l 0.4s ease-in-out infinite;
            transform-origin: 24px 98px;
        }
        @keyframes berry-excited-arm-l {
            0%, 100% { transform: rotate(108deg); }
            50%      { transform: rotate(140deg); }
        }

        /* === WINK — right eye blinks alone + slight head tilt === */
        .mascot.expr-wink .berry-upper {
            animation: none;
            transform: rotate(-3deg);
            transform-origin: 70px 140px;
        }
        .mascot.expr-wink .mascot-eyes { animation: none; }
        .mascot.expr-wink .mascot-eye-right {
            animation: berry-wink-right 6s ease-in-out infinite;
            transform-origin: 86px 84px;
        }
        @keyframes berry-wink-right {
            0%, 92%, 100% { transform: scaleY(1);    }
            94%, 98%      { transform: scaleY(0.05); }
        }
        .mascot-shadow {
            position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
            width: 86px; height: 12px;
            background: radial-gradient(ellipse, rgba(31, 39, 71, 0.22) 0%, transparent 70%);
            border-radius: 50%;
        }
        .mascot-name-tag {
            position: absolute;
            bottom: -18px; left: 50%; transform: translateX(-50%);
            background: var(--navy);
            color: #FFFFFF;
            font-family: 'Fredoka', sans-serif;
            font-size: 0.85em;
            font-weight: 700;
            letter-spacing: 0.1em;
            padding: 4px 14px;
            border-radius: 999px;
            box-shadow: 0 4px 10px rgba(31, 39, 71, 0.25);
            white-space: nowrap;
        }
        .mascot-speech {
            position: absolute;
            top: 4px; left: -16px;
            background: #FFFFFF;
            color: var(--navy);
            font-size: 0.82em;
            font-weight: 700;
            padding: 7px 14px;
            border-radius: 16px;
            border: 2px solid var(--navy);
            box-shadow: 0 3px 0 var(--navy);
            white-space: nowrap;
            animation: speech-pulse 4s ease-in-out infinite;
        }
        .mascot-speech::after {
            content: '';
            position: absolute; left: 22px; bottom: -10px;
            width: 14px; height: 14px;
            background: #FFFFFF;
            border-right: 2px solid var(--navy);
            border-bottom: 2px solid var(--navy);
            transform: rotate(45deg);
        }
        @keyframes speech-pulse {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-3px) scale(1.03); }
        }

        /* ============ PLAY PANEL (right) ============ */
        .play-panel {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .progress-strip { display: contents; }
        .round-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--meta-indigo-soft);
            border: 2px solid var(--navy);
            border-radius: 999px;
            padding: 7px 18px;
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            color: var(--navy);
            font-size: 1em;
            box-shadow: 0 2px 5px rgba(31, 39, 71, 0.12);
        }
        .round-pill .label {
            color: var(--navy);
            font-size: 0.8em;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            font-weight: 700;
        }
        .round-pill .value {
            font-size: 1.15em;
            font-weight: 700;
            color: var(--navy);
        }
        .round-pill .sep {
            color: rgba(110, 114, 160, 0.35);
            margin: 0 4px;
        }
        .streak-flame {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            color: var(--meta-indigo);
            font-weight: 700;
        }
        .streak-flame.hot {
            color: var(--hue-6);
            animation: streak-pulse 2s ease-in-out infinite;
        }
        @keyframes streak-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.08); }
        }
        .level-badge {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1px;
            background: var(--meta-indigo-soft);
            color: var(--navy);
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            padding: 6px 16px 7px;
            border-radius: 13px;
            box-shadow: none;
            border: 1.5px solid rgba(31, 39, 71, 0.12);
            line-height: 1.1;
            text-shadow: none;
            min-width: 150px;
            white-space: nowrap;
        }
        /* v2 #3 — quiet round-progress dots (replaced the Round/streak pill) */
        .title-headline { display: flex; align-items: center; justify-content: center; gap: 16px; }
        .title-headline-text { display: flex; flex-direction: column; }
        .title-stars { display: inline-flex; align-items: center; gap: 5px; min-width: 1px; }
        .title-stars.left { justify-content: flex-end; }
        .title-stars.right { justify-content: flex-start; }
        .title-stars .reward {
            width: 40px; height: 40px;
            display: inline-flex; align-items: center; justify-content: center;
            animation: tstar-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        /* Glossy gel prize SHAPES — gloss is baked into the star/gem/crown SVG itself */
        .title-stars .reward .prize { width: 100%; height: 100%; display: block; overflow: visible; }
        .prize-fly { position: fixed; z-index: 9998; pointer-events: none; }
        .prize-fly .prize { width: 100%; height: 100%; display: block; overflow: visible; }
        img.prize { object-fit: contain; }   /* PNG prizes keep their aspect (crown is landscape) */
        .prize-fly.flash { animation: prize-flash 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
        @keyframes prize-flash { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 55% { transform: scale(1.25) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
        /* brief focus dim behind the held prize (board stays faintly visible) */
        .prize-backdrop {
            position: fixed; inset: 0; z-index: 9997; pointer-events: none; opacity: 0;
            transition: opacity 0.4s ease;
            background: radial-gradient(circle at 50% 50%, rgba(10, 14, 30, 0.58) 0%, rgba(10, 14, 30, 0.42) 30%, rgba(10, 14, 30, 0) 68%);
        }
        .prize-backdrop.on { opacity: 1; }
        /* sparkles bursting out of the held prize */
        .prize-sparkle {
            position: fixed; z-index: 9999; pointer-events: none; line-height: 1;
            color: #FFF4C2; text-shadow: 0 0 6px #FFD23F, 0 0 13px #FFB300;
            transform: translate(-50%, -50%); will-change: transform, opacity;
            animation: prize-sparkle 1s ease-out forwards;
        }
        @keyframes prize-sparkle {
            0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
            25%  { opacity: 1; transform: translate(calc(-50% + var(--sx) * 0.45), calc(-50% + var(--sy) * 0.45)) scale(1.15) rotate(70deg); }
            100% { opacity: 0; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0.25) rotate(140deg); }
        }
        .level-up-toast .prize { width: 36px; height: 36px; vertical-align: middle; margin-left: 6px; }
        /* Grand finale overlay — shown once when all levels are completed */
        .champion-overlay {
            position: fixed; inset: 0; z-index: 70;
            display: flex; align-items: center; justify-content: center;
            background: rgba(31, 39, 71, 0.55);
            opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
        }
        .champion-overlay.show { opacity: 1; }
        .champion-card {
            background: linear-gradient(160deg, #FFFFFF 0%, #FFF6E0 100%);
            border: 3px solid #FFC93C; border-radius: 26px;
            padding: 26px 40px 28px; text-align: center; max-width: 90vw;
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
            transform: scale(0.82); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .champion-overlay.show .champion-card { transform: scale(1); }
        .champion-trophy { font-size: 3.4rem; line-height: 1; }
        .champion-title { font-family: 'Fredoka', sans-serif; font-weight: 800; font-size: 2rem; color: #1F2747; margin-top: 4px; }
        .champion-sub { font-size: 1.12rem; color: #4B547A; margin-top: 4px; }
        .champion-prizes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 4px; }
        .champion-prizes img, .champion-prizes svg { width: 48px; height: 48px; }
        .champion-foot { font-size: 1rem; color: #6b6353; margin-top: 8px; }
        @keyframes tstar-pop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.25) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
        /* v2 — level medals: one bounded reward per level cleared (replaced the unbounded star tally) */
        .level-medals { display: inline-flex; align-items: center; gap: 6px; padding-left: 2px; }
        .level-medals .medal {
            width: 19px; height: 19px; border-radius: 50%;
            background: rgba(31, 39, 71, 0.06);
            border: 1.5px solid rgba(31, 39, 71, 0.16);
            transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
        }
        .level-medals .medal.earned { border-color: var(--navy); box-shadow: 0 2px 4px rgba(31,39,71,0.2); }
        .level-medals .medal.current { box-shadow: 0 0 0 3px rgba(255,201,60,0.5); }
        .level-medals .medal.earned.current { box-shadow: 0 0 0 3px rgba(255,201,60,0.5), 0 2px 4px rgba(31,39,71,0.2); }
        .level-medals .medal:nth-child(1).earned { background: var(--hue-1); }
        .level-medals .medal:nth-child(2).earned { background: var(--hue-2); }
        .level-medals .medal:nth-child(3).earned { background: var(--hue-3); }
        .level-medals .medal:nth-child(4).earned { background: var(--hue-4); }
        .level-medals .medal:nth-child(5).earned { background: var(--hue-5); }
        .lvl-main {
            font-size: 1.15em;
            font-weight: 700;
            letter-spacing: 0.02em;
        }
        .lvl-main .lvl-num {
            font-size: 1.1em;
            font-weight: 700;
        }
        .lvl-sub {
            font-size: 0.78em;
            font-weight: 600;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            margin-top: 2px;
        }
        .level-badge .lvl-num {
            font-size: 1.05em;
            font-weight: 700;
        }
        .level-up-toast {
            position: fixed;
            top: 30px;
            left: 50%;
            transform: translate(-50%, -180%);
            opacity: 0;
            pointer-events: none;
            background: linear-gradient(135deg, var(--hue-3) 0%, var(--hue-4) 100%);
            color: #FFFFFF;
            font-family: 'Fredoka', sans-serif;
            font-weight: 700;
            padding: 16px 30px;
            border-radius: 22px;
            box-shadow: 0 14px 40px rgba(31, 39, 71, 0.35);
            border: 3px solid #FFFFFF;
            z-index: 200;
            transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
            text-align: center;
        }
        .level-up-toast.show {
            transform: translate(-50%, 0);
            opacity: 1;
        }
        .level-up-toast .big {
            display: block;
            font-size: 1.4em;
            line-height: 1.1;
        }
        .level-up-toast .small {
            display: block;
            font-size: 0.85em;
            opacity: 0.9;
            margin-top: 4px;
        }

        .count-readout {
            background: transparent;
            border: none;
            box-shadow: none;
            padding: 2px 6px;
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }
        .count-readout > .level-badge,
        .count-readout > .round-pill {
            flex: 0 0 auto;
        }
        .count-readout-label {
            font-family: 'Fredoka', sans-serif;
            font-size: 1.5em;
            font-weight: 700;
            color: var(--navy);
        }
        .count-readout-numbers {
            font-family: 'Fredoka', sans-serif;
            font-size: 2.6em;
            font-weight: 700;
            color: var(--navy);
            display: flex;
            align-items: baseline;
            gap: 6px;
        }
        .count-current {
            color: var(--hue-4);
            -webkit-text-stroke: 2.5px var(--navy);
            paint-order: stroke fill;
            transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
            display: inline-block;
        }
        .count-current.match { color: var(--hue-3); animation: count-pop 0.45s ease-out; }
        @keyframes count-pop {
            0% { transform: scale(1); }
            50% { transform: scale(1.35); }
            100% { transform: scale(1); }
        }
        .count-slash { color: var(--navy-soft); }
        .count-suffix {
            font-family: 'Fredoka', sans-serif;
            font-size: 0.5em;
            font-weight: 600;
            color: var(--navy-soft);
            margin-left: 8px;
            align-self: center;
        }
        .count-target { color: var(--navy); }
        .progress-track {
            flex: 1 1 200px;
            height: 12px;
            background: rgba(31, 39, 71, 0.08);
            border-radius: 999px;
            overflow: hidden;
            position: relative;
            box-shadow: inset 0 1px 2px rgba(31, 39, 71, 0.08);
        }
        .progress-fill {
            position: absolute;
            inset: 0;
            background: linear-gradient(
                90deg,
                var(--hue-1) 0%,
                var(--hue-2) 22%,
                var(--hue-3) 42%,
                var(--hue-4) 62%,
                var(--hue-5) 82%,
                var(--hue-6) 100%
            );
            border-radius: 999px;
            clip-path: inset(0 calc(100% - var(--fill-pct, 0%)) 0 0 round 999px);
            transition: clip-path 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .frames-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .frames-row.single {
            grid-template-columns: minmax(0, 480px);
            justify-content: center;
        }
        /* #5 — a FULL ten-frame becomes "a ten" (links the frames to the Tens place) */
        .ten-frame { transition: box-shadow 0.3s ease; }
        .ten-badge {
            position: absolute; top: 0; right: 14px; transform: translateY(-50%);
            display: none; align-items: center; gap: 5px;
            background: #2EA078; color: #FFFFFF;
            font-family: 'Fredoka', sans-serif; font-size: 0.82em; font-weight: 700;
            letter-spacing: 0.04em; padding: 5px 13px 6px; border-radius: 999px;
            box-shadow: 0 3px 8px rgba(46,160,120,0.4); white-space: nowrap; z-index: 3;
            animation: ten-pop 0.45s cubic-bezier(0.34,1.56,0.64,1);
        }
        .ten-frame.is-ten .ten-badge { display: inline-flex; }
        .ten-frame.is-ten .ten-frame-grid {
            box-shadow: 0 0 0 3px #5DD3A9, 0 0 16px rgba(93,211,169,0.45);
            border-radius: 6px;
        }
        @keyframes ten-pop { 0% { transform: translateY(-50%) scale(0); } 65% { transform: translateY(-50%) scale(1.18); } 100% { transform: translateY(-50%) scale(1); } }
        .ten-frame {
            background: linear-gradient(180deg, var(--play-surface-a) 0%, var(--play-surface-b) 100%);
            border-radius: 22px;
            padding: 22px 14px 16px;
            border: 2px solid var(--box-border);
            box-shadow: 0 8px 24px rgba(31, 39, 71, 0.08);
            position: relative;
        }
        .ten-frame-label {
            position: absolute;
            top: 0;
            left: 16px;
            transform: translateY(-50%);
            margin: 0;
            background: var(--navy);
            color: #FFFFFF;
            font-family: 'Fredoka', sans-serif;
            font-size: 0.82em;
            font-weight: 700;
            letter-spacing: 0.12em;
            text-transform: uppercase;
            padding: 5px 14px 6px;
            border-radius: 999px;
            box-shadow: 0 3px 8px rgba(31, 39, 71, 0.28);
            white-space: nowrap;
            z-index: 2;
        }
        .ten-frame-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 0;
            aspect-ratio: 5 / 2;
            /* Classic ten-frame gridlines drawn via background */
            background-image:
                linear-gradient(to right, rgba(31, 39, 71, 0.32) 1.5px, transparent 1.5px),
                linear-gradient(to bottom, rgba(31, 39, 71, 0.32) 1.5px, transparent 1.5px);
            background-size: 20% 50%;
            /* Outer border closes the chart on right and bottom */
            border-right: 1.5px solid rgba(31, 39, 71, 0.32);
            border-bottom: 1.5px solid rgba(31, 39, 71, 0.32);
            border-radius: 4px;
        }
        .berry-slot {
            /* Reduce slot fill so berries don't touch grid lines */
            margin: 6%;
        }
        .berry-slot {
            background: var(--ghost-fill);
            border: 2px solid var(--ghost-stroke);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            position: relative;
            transition: all 0.25s ease;
            box-shadow:
                inset 0 2px 4px rgba(74, 70, 60, 0.13),
                inset 0 -1.5px 1px rgba(255, 255, 255, 0.55);
        }
        .berry-slot.has-berry {
            background: transparent;
            border: 2px solid transparent;
            box-shadow: none;
        }
        /* v2 — direct manipulation: tap a slot to drop / take a berry */
        .berry-slot { cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease; }
        .berry-slot.ghost:hover {
            background: rgba(255, 179, 71, 0.16);
            border-color: rgba(226, 169, 26, 0.6);
        }
        .berry-slot.last:hover .berry { transform: scale(0.9); }
        .berry-slot.armed {
            border: 2px dashed #E2A91A;
            background: rgba(255, 201, 60, 0.14);
            animation: slot-armed-pulse 1.3s ease-in-out infinite;
        }
        @keyframes slot-armed-pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(226, 169, 26, 0); }
            50%      { box-shadow: 0 0 0 5px rgba(255, 201, 60, 0.30); }
        }
        .berry-slot.nudge { animation: slot-nudge 0.4s ease; }
        @keyframes slot-nudge { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.12); } }
        .berry {
            width: 100%;
            height: 100%;
            position: relative;
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #FF6B6B; /* default body hue; overridden inline by paintBerry */
        }
        .berry svg {
            width: 118%;   /* allow leaves + stem to extend above slot */
            height: 118%;
            overflow: visible;
            display: block;
            filter: drop-shadow(0 3px 4px rgba(31, 39, 71, 0.22));
        }
        .berry-slot.ghost .berry {
            opacity: 0;
        }
        .berry-slot.ghost .berry svg { display: none; }
        .berry-slot.has-berry .berry {
            animation: berry-drop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes berry-drop {
            0% { transform: translateY(-40px) scale(0.4); opacity: 0; }
            70% { transform: translateY(4px) scale(1.1); opacity: 1; }
            100% { transform: translateY(0) scale(1); opacity: 1; }
        }
        /* The berry SVG uses currentColor for its body and a built-in radial gradient
           overlay to give depth without per-instance gradient stops. */
        #berry-symbol .berry-body-fill { fill: currentColor; }

        /* Action bar */
        .action-bar {
            display: flex;
            justify-content: center;
            gap: 16px;
            flex-wrap: wrap;
        }
        .action-btn {
            flex: 0 0 auto;
            min-width: 110px;
        }
        .action-btn.clear,
        .action-btn.check {
            min-width: 130px;
        }
        .action-btn {
            font-family: 'Fredoka', sans-serif;
            font-size: 2em;
            font-weight: 700;
            padding: 14px 18px 16px;
            border: 3px solid var(--navy);
            border-radius: 18px;
            cursor: pointer;
            color: #FFFFFF;
            box-shadow:
                0 6px 0 var(--navy),
                0 10px 20px rgba(31, 39, 71, 0.18);
            transition: all 0.12s ease;
            letter-spacing: 0.02em;
            text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
            position: relative;
            overflow: hidden;
        }
        .action-btn::before {
            /* Glossy top highlight band */
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 50%;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0) 100%);
            border-radius: 14px 14px 0 0;
            pointer-events: none;
        }
        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow:
                0 8px 0 var(--navy),
                0 14px 24px rgba(31, 39, 71, 0.22);
        }
        .action-btn:active {
            transform: translateY(5px);
            box-shadow:
                0 1px 0 var(--navy),
                0 3px 6px rgba(31, 39, 71, 0.18);
        }
        .action-btn.add1,
        .action-btn.add5,
        .action-btn.add10 {
            -webkit-text-stroke: 1.5px var(--navy);
            paint-order: stroke fill;
        }
        .action-btn.add1  { background: linear-gradient(180deg, #93CBFF 0%, #6BB6FF 55%, #4592E0 100%); }
        .action-btn.add5  { background: linear-gradient(180deg, #82E0BD 0%, #5DD3A9 55%, #3AAE85 100%); }
        .action-btn.add10 { background: linear-gradient(180deg, #C2ACFC 0%, #A78BFA 55%, #8068DC 100%); }

        /* first-instruction pointing hand (same as the lessons) — points at the +1 button */
        .berry-hand {
            position: fixed; width: 54px; height: 68px; display: none;
            pointer-events: none; z-index: 9999; transform-origin: 14px 10px;
            filter: drop-shadow(0 6px 5px rgba(8, 14, 32, 0.35));
        }
        .berry-hand svg { display: block; width: 100%; height: 100%; }
        .berry-hand.on { display: block; }
        .berry-hand.tapanim { animation: berry-tap 1.02s ease-in-out infinite; }
        @keyframes berry-tap {
            0%, 100% { transform: rotate(-22deg) translate(0, 0); }
            45%      { transform: rotate(-22deg) translate(-6px, -13px); }
        }

        /* step-efficiency reward shown in the celebration (brief: walkthrough + scoring) */
        .step-reward {
            margin-top: 14px; text-align: center; background: #FFF6E6;
            border: 2px solid #EADFC4; border-radius: 16px; padding: 8px 20px;
            box-shadow: 0 6px 14px rgba(31, 39, 71, 0.18);
            animation: sr-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .sr-stars { font-size: 2rem; letter-spacing: 5px; color: #FFC23C; line-height: 1.1; text-shadow: 0 1px 1px rgba(31,39,71,0.25); }
        .sr-msg { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; color: #1F2747; margin-top: 2px; }
        @keyframes sr-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

        /* "See the fast way" button (shown after a long-way solve) + input lock during its demo */
        /* Persistent on-board helper: "See the fast way" + its post-walkthrough tally */
        #fastWayBtn {
            display: none; position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
            align-items: center; gap: 8px; z-index: 60;
            font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700; font-size: 1.02rem;
            color: #2A1A05; background: linear-gradient(180deg, #FFD23F, #FFA940); border: none; cursor: pointer;
            padding: 11px 24px; border-radius: 999px;
            box-shadow: 0 5px 0 #C9821C, 0 12px 22px -8px rgba(255, 169, 64, 0.7);
            animation: fwPulse 2.2s ease-in-out infinite;
        }
        #fastWayBtn:hover { filter: brightness(1.05); }
        #fastWayBtn:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 2px 0 #C9821C, 0 6px 14px -8px rgba(255, 169, 64, 0.6); }
        @keyframes fwPulse { 0%, 100% { box-shadow: 0 5px 0 #C9821C, 0 12px 22px -8px rgba(255, 169, 64, .7); } 50% { box-shadow: 0 5px 0 #C9821C, 0 12px 30px -6px rgba(255, 169, 64, .95); } }
        .fw-tally {
            display: none; position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
            align-items: center; gap: 10px; z-index: 61;
            font-family: 'Fredoka', system-ui, sans-serif; font-weight: 600; font-size: 1.05rem;
            color: #FFF7E8; background: rgba(31, 39, 71, 0.96); border: 2px solid #FFD23F;
            padding: 10px 22px; border-radius: 999px; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.6);
        }
        .fw-tally b { color: #FFD23F; }
        .fw-tally .fw-dot { opacity: 0.5; padding: 0 2px; }
        .action-btn.shake { animation: btnShake 0.35s ease; }
        @keyframes btnShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
        .action-btn.clear {
            background: linear-gradient(180deg, #FFFFFF 0%, #F2F2F2 100%);
            color: var(--navy);
            text-shadow: none;
            box-shadow:
                0 6px 0 rgba(31, 39, 71, 0.55),
                0 10px 20px rgba(31, 39, 71, 0.15);
        }
        .action-btn.clear:hover { box-shadow: 0 8px 0 rgba(31, 39, 71, 0.55), 0 14px 24px rgba(31, 39, 71, 0.2); }
        .action-btn.clear:active { box-shadow: 0 1px 0 rgba(31, 39, 71, 0.55), 0 3px 6px rgba(31, 39, 71, 0.15); }
        .action-btn.check {
            background: linear-gradient(180deg, #FFE174 0%, #FFC93C 55%, #E2A91A 100%);
            color: var(--navy);
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
        }

        /* Place value strip — unified card with dashed divider, ChatGPT-style */
        .place-value-card {
            display: inline-grid;
            grid-template-columns: auto auto auto;
            gap: 0;
            align-items: stretch;
            background: linear-gradient(180deg, #FCFBED 0%, #F4F0DA 100%);
            border: 2px solid var(--navy);
            border-radius: 20px;
            box-shadow: 0 6px 16px rgba(31, 39, 71, 0.10);
            margin-top: 4px;
            min-height: 84px;
            overflow: visible;
        }
        .place-value {
            display: flex;
            justify-content: center;
        }
        .pv-section {
            display: grid;
            grid-template-columns: auto auto;
            grid-template-rows: auto auto;
            gap: 4px 14px;
            padding: 10px 22px 12px;
            align-items: center;
        }
        .pv-label {
            grid-column: 1 / 3;
            font-family: 'Fredoka', sans-serif;
            font-size: 0.95em;
            font-weight: 700;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            text-align: center;
        }
        .pv-tens .pv-label { color: #2EA078; }
        .pv-ones .pv-label { color: #E2901C; }
        .pv-visual {
            grid-row: 2;
            grid-column: 1;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 5px;
            min-width: 110px;
        }
        .pv-value {
            grid-row: 2;
            grid-column: 2;
            font-family: 'Fredoka', sans-serif;
            font-size: 3.4em;
            font-weight: 700;
            line-height: 1;
            text-align: center;
            -webkit-text-stroke: 2.5px var(--navy);
            paint-order: stroke fill;
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .pv-tens .pv-value { color: #5DD3A9; }
        .pv-ones .pv-value { color: #FFB347; }
        .pv-value.bump { transform: scale(1.25); }
        .pv-divider {
            border-left: 2.5px dashed rgba(31, 39, 71, 0.32);
            margin: 8px 0;
        }
        /* TENS: a 2x5 grid of green base-10 blocks per ten */
        .tens-pile {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 3px;
            width: 100px;
            height: 44px;
            padding: 4px;
            background: rgba(46, 160, 120, 0.10);
            border: 2px solid #2EA078;
            border-radius: 6px;
            animation: pile-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .tens-pile .tens-block {
            background: linear-gradient(180deg, #6FE0A7 0%, #3FA875 100%);
            border: 1px solid #1F2747;
            border-radius: 2px;
            box-shadow: inset -1px -1px 0 rgba(42, 122, 85, 0.45);
        }
        @keyframes pile-pop {
            0% { transform: scale(0); opacity: 0; }
            70% { transform: scale(1.15); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }
        /* ONES: berry SVGs matching the ten-frame berries */
        .ones-berry {
            width: 28px;
            height: 28px;
            animation: dot-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            flex-shrink: 0;
        }
        /* Keep strokes visible at the small ones-place berry size */
        .ones-berry svg * {
            vector-effect: non-scaling-stroke;
        }
        .ones-berry svg { width: 100%; height: 100%; overflow: visible; }
        @keyframes dot-pop {
            0% { transform: scale(0); opacity: 0; }
            70% { transform: scale(1.3); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }

        /* Celebration overlay */
        .celebration-overlay {
            position: fixed; inset: 0;
            display: none; flex-direction: column; align-items: center; justify-content: center;
            pointer-events: none;
            z-index: 100;
        }
        .celebration-overlay.active { display: flex; }
        .celebration-number {
            font-family: 'Fredoka', sans-serif;
            font-size: 18rem;
            font-weight: 700;
            -webkit-text-stroke: 8px var(--navy);
            paint-order: stroke fill;
            text-shadow: 0 12px 0 rgba(31, 39, 71, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
            animation: celebrate-bloom 1.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes celebrate-bloom {
            0% { transform: scale(0) rotate(-30deg); opacity: 0; }
            60% { transform: scale(1.2) rotate(0); opacity: 1; }
            100% { transform: scale(1) rotate(0); opacity: 1; }
        }
        .confetti-piece {
            position: absolute;
            width: 14px; height: 14px;
            border-radius: 3px;
            top: 50%; left: 50%;
            animation: confetti-fly 1.6s ease-out forwards;
        }
        @keyframes confetti-fly {
            0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
            100% {
                transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--dr));
                opacity: 0;
            }
        }

        /* Mobile */
        @media (max-width: 860px) {
            body { padding: 12px; }
            .container { padding: 18px 16px 20px; border-radius: 22px; }
            .scenery-sun, .scenery-vine-tl, .scenery-vine-br { display: none; }
            .game-grid { grid-template-columns: 1fr; gap: 14px; }
            .goal-panel { padding: 16px; }
            .target-display { font-size: 5.5rem; }
            .mascot-stage { width: 180px; height: 200px; margin-top: 4px; }
            .mascot { width: 140px; height: 180px; }
            .mascot-speech { font-size: 0.75em; padding: 5px 10px; }
            .count-readout { padding: 12px 14px; gap: 10px; }
            .count-readout-label { font-size: 1.1em; }
            .count-readout-numbers { font-size: 2em; }
            .frames-row { gap: 10px; }
            .ten-frame { padding: 10px 8px 12px; }
            .ten-frame-grid { gap: 5px; }
            .action-bar {
                grid-template-columns: 1fr 1fr 1fr;
            }
            .action-btn.clear, .action-btn.check {
                grid-column: span 1;
            }
            .action-btn { font-size: 1em; padding: 12px 8px; border-radius: 14px; }
            .celebration-number { font-size: 8rem; -webkit-text-stroke: 5px var(--navy); }
        }

        @media (max-width: 480px) {
            .frames-row { grid-template-columns: 1fr; }
            .action-bar {
                grid-template-columns: 1fr 1fr;
            }
        }

        /* ===== About-this-game modal (SEO body content) ===== */
        .about-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(15, 23, 41, 0.65); z-index: 9999;
            align-items: center; justify-content: center; padding: 1rem;
        }
        .about-overlay.active { display: flex; }
        .about-modal {
            background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF7 100%);
            border-radius: 22px; max-width: 720px; width: 100%;
            max-height: 85vh; display: flex; flex-direction: column;
            box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); overflow: hidden;
            color: #1F2747; font-family: 'Poppins', sans-serif;
        }
        .about-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 1.1rem 1.4rem 0.8rem;
            border-bottom: 1px solid rgba(31, 39, 71, 0.08);
        }
        .about-header h2 { color: #1F2747; font-size: 1.2rem; margin: 0; font-weight: 800; }
        .about-close {
            background: transparent; border: none; color: #4B547A;
            font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 0 0.4rem;
        }
        .about-close:hover { color: #1F2747; }
        .about-replay {
            background: #FFF6E6; border: 1.5px solid #EADFC4; color: #1F2747; cursor: pointer;
            font-family: 'Fredoka', system-ui, sans-serif; font-weight: 700; font-size: 0.8rem;
            padding: 6px 12px; border-radius: 999px; margin-left: auto; margin-right: 0.6rem; white-space: nowrap;
        }
        .about-replay:hover { background: #FFEFD5; }
        .about-tabs {
            display: flex; gap: 0.4rem; padding: 0.7rem 1.1rem 0;
            border-bottom: 1px solid rgba(31, 39, 71, 0.08); overflow-x: auto;
        }
        .about-tab {
            background: #FFF6E6; color: #4B547A;
            border: 1px solid rgba(31, 39, 71, 0.08);
            padding: 0.5rem 0.95rem; border-radius: 10px 10px 0 0;
            font-size: 0.9rem; font-weight: 700; cursor: pointer;
            white-space: nowrap; transition: all 0.2s ease;
        }
        .about-tab:hover { background: #FFEFD5; color: #1F2747; }
        .about-tab.active {
            background: linear-gradient(135deg, #FFC93C, #FFA940);
            color: #1F2747; border-color: #FFA940;
            box-shadow: 0 -2px 8px rgba(255, 169, 64, 0.3);
        }
        .about-body {
            padding: 1.3rem 1.5rem 1.5rem; overflow-y: auto;
            color: #1F2747; line-height: 1.65;
        }
        .about-pane { display: none; }
        .about-pane.active { display: block; }
        .about-pane h3 {
            color: #4B547A; font-size: 1rem; font-weight: 800;
            margin: 0.4rem 0 0.6rem; text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .about-pane p { margin-bottom: 0.85rem; font-size: 0.96rem; }
        .about-pane ul { margin: 0.3rem 0 0.9rem 1.4rem; }
        .about-pane li { margin-bottom: 0.45rem; font-size: 0.95rem; }
        .about-pane strong { color: #1F2747; font-weight: 700; }
        .about-pane .lede {
            color: #4B547A; font-style: italic;
            margin-bottom: 1rem; font-size: 1rem;
        }
        @media (max-width: 640px) {
            .about-modal { max-height: 92vh; }
            .about-header { padding: 0.9rem 1rem 0.6rem; }
            .about-header h2 { font-size: 1.05rem; }
            .about-tabs { padding: 0.5rem 0.8rem 0; }
            .about-tab { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
            .about-body { padding: 1rem 1.1rem 1.2rem; }
            .about-pane p, .about-pane li { font-size: 0.92rem; }
        }

        /* ════════════════════════════════════════════════════════════
           WELCOME SCREEN — per WELCOME-SCREEN-SPEC.md (ported from the
           Counting game). Kid-path landing card over the navy dotted board;
           "Let's Play" reveals + fullscreens the game. About content reuses
           the existing in-game About modal.
           ════════════════════════════════════════════════════════════ */
        .ws-screen {
            --ws-navy:        #0F1B3A;
            --ws-cream:       #FAF6E9;
            --ws-cream-soft:  #F2EBD3;
            --ws-cream-edge:  #E8DFC2;
            --ws-ink:         #1A1E2E;
            --ws-ink-soft:    #4A526B;
            --ws-ink-mute:    #8A8FA3;
            --ws-row-1: #E04848; --ws-row-3: #E8B324;
            --ws-row-4: #4FA85A; --ws-row-5: #2E8AC9; --ws-row-7: #9148BF;
            --ws-cta-from:    #FFC73B;
            --ws-cta-to:      #F08A1E;
            --ws-cta-ink:     #2A1A05;
            --ws-font-display:"Fraunces", "Fredoka", system-ui, sans-serif;
            --ws-font-ui:     "Fredoka", "Inter", system-ui, sans-serif;
            --ws-r-md: 14px; --ws-r-lg: 22px; --ws-r-xl: 32px; --ws-r-pill: 999px;
            --ws-sh-card:   0 4px 0 var(--ws-cream-edge), 0 18px 40px -18px rgba(10, 18, 40, 0.55);
            --ws-sh-circle: 0 3px 0 rgba(0, 0, 0, 0.10), 0 6px 14px -4px rgba(10, 18, 40, 0.35);
            --ws-sh-button: 0 4px 0 var(--ws-cta-ink), 0 10px 20px -8px rgba(240, 138, 30, 0.6);
            position: fixed; inset: 0;
            background: var(--ws-navy);
            overflow-y: auto;
            z-index: 9999;
            font-family: var(--ws-font-ui);
            color: var(--ws-ink);
            animation: wsFadeIn 0.5s ease;
        }
        .ws-screen::before {
            content: ""; position: fixed; inset: 0;
            background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
            background-size: 22px 22px;
            pointer-events: none;
        }
        .ws-screen.hidden { animation: wsFadeOut 0.5s ease forwards; pointer-events: none; }
        @keyframes wsFadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes wsFadeOut { from { opacity: 1; } to { opacity: 0; } }
        @keyframes wsScaleIn { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

        .ws-topbar {
            position: relative; z-index: 2;
            max-width: 1100px; margin: 0 auto;
            padding: 18px 24px 0;
            display: flex; justify-content: space-between; align-items: center;
        }
        .ws-back-link {
            color: var(--ws-cream); opacity: 0.8; text-decoration: none;
            font-weight: 600; font-size: 14px;
            padding: 8px 12px; border-radius: var(--ws-r-pill);
            transition: background 0.15s, opacity 0.15s;
        }
        .ws-back-link:hover { background: rgba(255,255,255,0.08); opacity: 1; }
        .ws-sound-btn {
            background: rgba(255,255,255,0.08); color: var(--ws-cream);
            border: 1.5px solid rgba(255,255,255,0.18);
            width: 38px; height: 38px; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; font-size: 16px; transition: background 0.15s;
        }
        .ws-sound-btn:hover { background: rgba(255,255,255,0.16); }

        .ws-kid-section {
            position: relative; z-index: 2;
            min-height: calc(100vh - 60px);
            display: flex; align-items: center; justify-content: center;
            padding: 20px 20px 40px;
        }
        .ws-card {
            position: relative;
            background: var(--ws-cream);
            padding: 48px 44px 40px;
            border-radius: var(--ws-r-xl);
            box-shadow: var(--ws-sh-card);
            max-width: 560px; width: 100%;
            text-align: center;
            animation: wsScaleIn 0.6s ease;
            overflow: hidden;
        }
        .ws-card::before {
            content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
            background: linear-gradient(90deg, var(--ws-row-1) 0%, var(--ws-row-1) 45%, transparent 100%);
        }
        .ws-start-badge {
            display: inline-flex; align-items: center; gap: 6px;
            background: var(--ws-row-1); color: var(--ws-cream);
            font-weight: 600; font-size: 13px; letter-spacing: 0.06em;
            padding: 6px 14px 6px 10px; border-radius: var(--ws-r-pill);
            box-shadow: 0 3px 0 rgba(125, 30, 30, 0.4);
            margin-bottom: 18px; transform: rotate(-2deg);
        }
        .ws-start-badge svg { width: 14px; height: 14px; }
        .ws-cluster {
            display: inline-flex; gap: 6px;
            font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
            color: var(--ws-ink-mute); margin-bottom: 14px;
        }
        .ws-cluster b { color: var(--ws-ink); font-weight: 700; }
        .ws-card h1 {
            font-family: var(--ws-font-display);
            font-size: clamp(40px, 6vw, 56px); line-height: 1.05;
            font-weight: 700; letter-spacing: -0.02em;
            color: var(--ws-ink); margin: 0 0 12px; text-align: center;
        }
        .ws-card h1 .accent { font-style: italic; color: var(--ws-row-1); }
        .ws-tagline {
            font-size: 17px; color: var(--ws-ink-soft);
            max-width: 420px; margin: 0 auto 16px; line-height: 1.45;
        }
        .ws-chips { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
        .ws-chip {
            display: inline-flex; align-items: center; gap: 6px;
            background: var(--ws-cream-soft); border: 1.5px solid var(--ws-cream-edge);
            color: var(--ws-ink-soft); font-size: 12px; font-weight: 600;
            padding: 6px 12px; border-radius: var(--ws-r-pill);
        }
        .ws-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ws-row-4); }
        .ws-chip.class .dot { background: var(--ws-row-5); }

        .ws-mascot { position: relative; width: 180px; height: 180px; margin: 0 auto 26px; }
        .ws-mascot::before {
            content: ""; position: absolute; bottom: 6px; left: 50%;
            width: 160px; height: 14px;
            background: radial-gradient(ellipse at center, rgba(10,18,40,0.18), transparent 70%);
            transform: translateX(-50%); border-radius: 50%;
        }
        .ws-mascot .floaters { position: absolute; inset: -10px -30px; pointer-events: none; }
        .ws-mascot .f {
            position: absolute; width: 40px; height: 40px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-family: var(--ws-font-display); font-weight: 700; font-size: 18px;
            color: var(--ws-cream); box-shadow: var(--ws-sh-circle);
            border: 3px solid var(--ws-cream);
        }
        .ws-mascot .f.a { top: 12%; left: -4%; background: var(--ws-row-3); transform: rotate(-8deg); }
        .ws-mascot .f.b { top: 0%; right: 0%; background: var(--ws-row-5); width: 46px; height: 46px; transform: rotate(6deg); }
        .ws-mascot .f.c { bottom: 16%; left: 0%; background: var(--ws-row-4); width: 32px; height: 32px; font-size: 14px; transform: rotate(10deg); }
        .ws-mascot .f.d { bottom: 4%; right: -4%; background: var(--ws-row-7); width: 36px; height: 36px; font-size: 16px; transform: rotate(-6deg); }
        /* Berry hero — reuses the in-page #berry-symbol, tinted via color. */
        .ws-mascot .ws-berry {
            position: relative; width: 100%; height: 100%; z-index: 1; overflow: visible;
            color: #D63B6E;
            filter: drop-shadow(0 8px 10px rgba(31, 39, 71, 0.30));
            animation: ws-berry-bob 4s ease-in-out infinite;
            transform-origin: center bottom;
        }
        @keyframes ws-berry-bob {
            0%, 100% { transform: translateY(0) rotate(-2deg); }
            50%      { transform: translateY(-6px) rotate(2deg); }
        }

        .ws-cta {
            display: inline-flex; align-items: center; gap: 10px;
            background: linear-gradient(180deg, var(--ws-cta-from), var(--ws-cta-to));
            color: var(--ws-cta-ink); font-weight: 700; font-size: 20px; letter-spacing: 0.01em;
            padding: 16px 32px; border: none; border-radius: var(--ws-r-pill);
            box-shadow: var(--ws-sh-button); cursor: pointer;
            transition: transform 0.15s ease; font-family: var(--ws-font-ui);
        }
        .ws-cta:hover { transform: translateY(-2px); }
        .ws-cta .arrow {
            width: 26px; height: 26px; background: var(--ws-cta-ink); color: var(--ws-cta-from);
            border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
        }
        .ws-cta-group { display: flex; flex-direction: column; align-items: center; gap: 14px; }
        .ws-cta-secondary-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
        .ws-cta-secondary {
            display: inline-flex; align-items: center; gap: 6px;
            background: var(--ws-cream-soft); border: 1.5px solid var(--ws-cream-edge);
            color: var(--ws-ink-soft); font-family: var(--ws-font-ui);
            font-weight: 600; font-size: 13.5px; padding: 9px 16px;
            border-radius: var(--ws-r-pill); cursor: pointer;
            transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
        }
        .ws-cta-secondary:hover { transform: translateY(-1px); background: var(--ws-cream-edge); color: var(--ws-ink); }
        .ws-cta-secondary span { color: var(--ws-row-1); font-size: 15px; line-height: 1; }

        /* FULLSCREEN — "Let's Play" makes the whole PAGE immersive: the navy board
           AND the cream card fill the screen (fullscreen <html>, not just the card). */
        html:fullscreen { overflow-y: auto; overflow-x: hidden; }
        html:fullscreen::backdrop { background: #0F1729; }
        /* Center the game vertically on screen instead of letting it sit top-aligned.
           Children keep their max-width:1200 + margin:auto (so still centred horizontally);
           if the content is ever taller than the viewport it just scrolls from the top. */
        html:fullscreen body {
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-height: 100vh;
        }
        /* As flex items the card/links would collapse to content width — keep them full
           width so max-width:1200 + margin:auto still gives the centred 1200px card. */
        html:fullscreen body > .container,
        html:fullscreen body > .site-home-wrap { width: 100%; }

        @media (max-width: 560px) {
            .ws-card { padding: 36px 24px 32px; }
            .ws-card h1 { font-size: 36px; }
            .ws-mascot { width: 150px; height: 150px; }
            .ws-topbar { padding: 12px 16px 0; }
        }
