:root {
    --board-bg: #f5edf7;
    --board-wood: #eddbe7;
    --border-ink: #2b4e43;
    --hauna-green: #3f7f4f;
    --hauna-olive: #9BB46B;
}

body.phonics-board-page {
    background: #faeef8;
    background-image:
        radial-gradient(#f0d2eb 1.5px, transparent 1.5px),
        radial-gradient(#f7e1f4 1.5px, #faeef8 1.5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    color: #2c3e50;
    font-family: 'Roboto', 'Outfit', sans-serif;
    min-height: 100vh;
    padding-top: 100px;
}

/* App Board Canvas Area */
.phonics-stage-wrapper {
    max-width: 1220px;
    margin: 1.5rem auto 4rem;
    padding: 0 1.2rem;
}

.phonics-board-card {
    background: #fbf5fc;
    border: 12px solid #ffffff;
    border-radius: 40px;
    box-shadow:
        0 25px 70px rgba(162, 108, 179, 0.22),
        0 0 0 2px #eed0eb;
    padding: 2.5rem 2.5rem 1.8rem;
    position: relative;
    overflow: hidden;
}

.board-top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px dashed #eccae8;
}

.board-title-box h1 {
    font-family: 'Playpen Sans', cursive;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: #3b2049;
    margin: 0;
    line-height: 1.1;
}

.board-title-box p {
    margin: 0.3rem 0 0;
    color: #8c6a99;
    font-weight: 500;
    font-size: 0.95rem;
}

.board-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sound-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 2px solid #9BB46B;
    color: #2b4e43;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(155, 180, 107, 0.2);
    transition: all 0.2s ease;
}

.sound-toggle-btn:hover {
    background: #9BB46B;
    color: #ffffff;
}

/* Main Board Grid System exactly resembling the layout */
.board-main-layout {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.2rem;
    align-items: stretch;
}

@media (min-width: 1200px) {
    .board-main-layout {
        gap: 1.3rem;
    }
}

/* 3D Preschool Wooden Blocks */
.board-block-item {
    aspect-ratio: 1 / 1;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-block-item:hover {
    transform: translateY(-8px) scale(1.04);
    z-index: 10;
}

.board-block-item:active {
    transform: translateY(-2px) scale(0.97);
}

/* 3D Beveled Cube Exterior */
.block-3d-box {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background-color: var(--block-body, #e53e3e);
    position: relative;
    box-shadow:
        -5px 5px 0 var(--block-shade-side, #c53030),
        -9px 9px 0 var(--block-shade-bottom, #9b2c2c),
        -12px 14px 20px rgba(59, 20, 73, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9%;
    transition: all 0.25s ease;
}

.board-block-item:hover .block-3d-box {
    box-shadow:
        -6px 6px 0 var(--block-shade-side, #c53030),
        -11px 11px 0 var(--block-shade-bottom, #9b2c2c),
        -15px 18px 25px rgba(59, 20, 73, 0.38);
}

/* Inner Lined Notebook Face */
.block-inner-face {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
    background-image: repeating-linear-gradient(transparent,
            transparent 9px,
            rgba(100, 149, 237, 0.22) 10px,
            rgba(100, 149, 237, 0.22) 11px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Big Vibrant Letter Character */
.block-text {
    font-family: 'Playpen Sans', 'Fredoka One', cursive;
    font-weight: 800;
    font-size: clamp(2rem, 3.8vw, 3.4rem);
    line-height: 1;
    color: var(--letter-color, #e53e3e);
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-block-item:hover .block-text {
    transform: scale(1.12);
}

/* Digraph font size balance */
.board-block-item.is-digraph .block-text {
    font-size: clamp(1.4rem, 2.6vw, 2.4rem);
    letter-spacing: -0.03em;
}

/* Subtle corner sound badge */
.block-ipa-tag {
    position: absolute;
    bottom: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 4px;
    border-radius: 6px;
}

.block-sound-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.board-block-item:hover .block-sound-icon {
    opacity: 0.9;
}

/* Side Action Banner Modules (Crayons & Music Kids matching reference image) */
.side-feature-banner {
    grid-column: span 2;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    box-shadow:
        -4px 4px 0 rgba(0, 0, 0, 0.1),
        -8px 8px 0 rgba(0, 0, 0, 0.08),
        -10px 12px 20px rgba(59, 20, 73, 0.18);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 110px;
}

.side-feature-banner:hover {
    transform: translateY(-6px) scale(1.02);
}

/* Crayons Box */
.banner-crayons {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: 3px solid #86efac;
}

.crayons-illustration {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px 6px;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.crayon-stick {
    width: 14px;
    height: 45px;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.crayon-stick::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 8px solid currentColor;
}

.c-red {
    background: #ef4444;
    color: #ef4444;
}

.c-orange {
    background: #f97316;
    color: #f97316;
}

.c-yellow {
    background: #eab308;
    color: #eab308;
}

.c-green {
    background: #10b981;
    color: #10b981;
}

.c-blue {
    background: #3b82f6;
    color: #3b82f6;
}

.c-purple {
    background: #a855f7;
    color: #a855f7;
}

/* Songs / Rhymes Box */
.banner-music {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 3px solid #6ee7b7;
}

.music-illustration {
    background: linear-gradient(135deg, #ec4899, #d946ef);
    border-radius: 12px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.music-kid-avatar {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: swayKid 1.5s ease-in-out infinite alternate;
}

@keyframes swayKid {
    from {
        transform: rotate(-5deg);
    }

    to {
        transform: rotate(5deg);
    }
}

.music-notes-text {
    font-family: 'Playpen Sans', cursive;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.side-more-tab {
    background: #15803d;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    padding: 0.8rem 0.35rem;
    border-radius: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* Cube Color Variations faithfully matching reference */
.color-red {
    --block-body: #ef4444;
    --block-shade-side: #dc2626;
    --block-shade-bottom: #991b1b;
    --letter-color: #dc2626;
}

.color-blue {
    --block-body: #3b82f6;
    --block-shade-side: #2563eb;
    --block-shade-bottom: #1d4ed8;
    --letter-color: #2563eb;
}

.color-yellow {
    --block-body: #eab308;
    --block-shade-side: #ca8a04;
    --block-shade-bottom: #854d0e;
    --letter-color: #d97706;
}

.color-brown {
    --block-body: #a16207;
    --block-shade-side: #854d0e;
    --block-shade-bottom: #54330b;
    --letter-color: #854d0e;
}

.color-orange {
    --block-body: #f97316;
    --block-shade-side: #ea580c;
    --block-shade-bottom: #9a3412;
    --letter-color: #ea580c;
}

.color-purple {
    --block-body: #a855f7;
    --block-shade-side: #9333ea;
    --block-shade-bottom: #6b21a8;
    --letter-color: #9333ea;
}

.color-green {
    --block-body: #22c55e;
    --block-shade-side: #16a34a;
    --block-shade-bottom: #14532d;
    --letter-color: #16a34a;
}

.color-pink {
    --block-body: #ec4899;
    --block-shade-side: #db2777;
    --block-shade-bottom: #9d174d;
    --letter-color: #db2777;
}

.color-teal {
    --block-body: #14b8a6;
    --block-shade-side: #0d9488;
    --block-shade-bottom: #115e59;
    --letter-color: #0d9488;
}

.color-indigo {
    --block-body: #6366f1;
    --block-shade-side: #4f46e5;
    --block-shade-bottom: #3730a3;
    --letter-color: #4f46e5;
}

/* ==========================================================================
   Hanging Bottom Rainbow Ribbon with Medallions (From Reference Image)
   ========================================================================== */
.rainbow-ornaments-bar {
    margin-top: 3.5rem;
    position: relative;
    padding-top: 1rem;
}

.rainbow-track {
    height: 12px;
    width: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316, #facc15, #22c55e, #3b82f6, #a855f7, #ec4899);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    position: relative;
}

.rainbow-track-beads {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
}

.track-bead {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.medallions-chain-flex {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: -2px;
}

.hanging-token {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hanging-token:hover {
    transform: translateY(-8px) scale(1.08);
}

.token-hook-ring {
    width: 12px;
    height: 14px;
    border: 3px solid #64748b;
    border-radius: 50%;
    margin-bottom: -4px;
    z-index: 1;
}

.token-circle-disc {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.18),
        inset 0 2px 0 rgba(255, 255, 255, 0.8),
        inset 0 -2px 0 rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playpen Sans', cursive;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
    position: relative;
}

.token-abc-badge {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #ffffff;
}

.token-hand-badge {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #ffffff;
    font-size: 1.4rem;
}

.token-vowel-a {
    background: linear-gradient(135deg, #fbcfe8, #f472b6);
    color: #be185d;
}

.token-vowel-e {
    background: linear-gradient(135deg, #fed7aa, #fb923c);
    color: #c2410c;
}

.token-vowel-i {
    background: linear-gradient(135deg, #bbf7d0, #4ade80);
    color: #15803d;
}

.token-vowel-o {
    background: linear-gradient(135deg, #bae6fd, #38bdf8);
    color: #0369a1;
}

.token-vowel-u {
    background: linear-gradient(135deg, #ddd6fe, #a78bfa);
    color: #6d28d9;
}

/* Full-screen reusable PhonicsLesson experience */
body.lesson-open {
    overflow: hidden;
}

.phonics-lesson {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 15% 15%, #fff9db, transparent 32%), linear-gradient(135deg, #fffaf1 0%, #edf9ed 100%);
    color: #24413a;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.03);
    transition: opacity .28s ease, transform .28s ease;
}

.phonics-lesson.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.lesson-header,
.lesson-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 4rem);
}

.lesson-header {
    justify-content: space-between;
    background: rgba(255, 255, 255, .8);
    border-bottom: 1px solid rgba(63, 127, 79, .14);
}

.lesson-title-group {
    display: grid;
    gap: .18rem;
    text-align: center;
}

.lesson-level,
.lesson-scene-label {
    color: #6e5b7c;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.lesson-title-group strong {
    color: #2d573f;
    font-family: 'Playpen Sans', cursive;
    font-size: clamp(1.05rem, 2.5vw, 1.55rem);
}

.lesson-icon-btn,
.lesson-control-btn,
.lesson-repeat-btn {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform .2s ease, background .2s ease;
}

.lesson-icon-btn {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    background: #eff7e9;
    color: #3f7f4f;
    font-size: 1.45rem;
}

.lesson-icon-btn:hover,
.lesson-control-btn:hover,
.lesson-repeat-btn:hover {
    transform: translateY(-2px);
}

.lesson-progress {
    height: 7px;
    background: #dcebd8;
}

.lesson-progress-fill {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #f6b73c, #5da66c);
    transition: width .35s ease;
}

.lesson-stage {
    display: grid;
    grid-template-columns: minmax(280px, 1.05fr) minmax(300px, .95fr);
    align-items: center;
    gap: clamp(1.5rem, 5vw, 6rem);
    width: min(1180px, 100%);
    flex: 1;
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 4rem);
    outline: none;
}

.lesson-media {
    min-height: min(55vh, 510px);
    display: grid;
    place-items: center;
}

.lesson-copy {
    max-width: 500px;
}

.lesson-copy h2 {
    margin: .6rem 0 .8rem;
    color: #2c4e43;
    font-family: 'Playpen Sans', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
}

.lesson-copy p {
    margin: 0;
    color: #556b68;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.lesson-feedback {
    min-height: 2rem;
    margin-top: 1rem;
    color: #267a43;
    font-size: 1.1rem;
    font-weight: 800;
}

.lesson-controls {
    justify-content: space-between;
    background: rgba(255, 255, 255, .82);
    border-top: 1px solid rgba(63, 127, 79, .14);
}

.lesson-control-btn {
    padding: .75rem 1.2rem;
    border-radius: 50px;
    background: #3f7f4f;
    color: #fff;
}

.lesson-control-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}

.lesson-dots {
    display: flex;
    gap: .55rem;
}

.lesson-dot {
    width: .7rem;
    height: .7rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #bbd5b5;
    cursor: pointer;
}

.lesson-dot.is-active {
    width: 2rem;
    border-radius: 1rem;
    background: #f3ad37;
}

.lesson-character-scene {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1.15;
    display: grid;
    place-items: end center;
    isolation: isolate;
    border-radius: 34px;
    background: linear-gradient(180deg, #8edcff 0%, #dff7ff 59%, #94d878 60%, #5bad59 100%);
    box-shadow: inset 0 -22px 35px rgba(82, 139, 85, .12), 0 20px 45px rgba(66, 113, 78, .16);
    overflow: hidden;
}

.animated-phonics-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .28) 47%, transparent 68%);
    transform: translateX(-120%);
    animation: sceneShimmer 5s ease-in-out infinite 1.2s;
}

.scene-sky,
.scene-props,
.scene-ground,
.scene-letter-trail,
.scene-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scene-sky {
    z-index: 0;
}

.scene-sun {
    position: absolute;
    top: 8%;
    left: 9%;
    width: 58px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #ffd64d;
    box-shadow: 0 0 0 10px rgba(255, 214, 77, .2), 0 0 34px #fff4a8;
    animation: sunGlow 2.4s ease-in-out infinite alternate;
}

.scene-cloud {
    position: absolute;
    width: 105px;
    height: 30px;
    border-radius: 40px;
    background: rgba(255, 255, 255, .9);
    filter: drop-shadow(0 5px 5px rgba(55, 121, 148, .12));
}

.scene-cloud::before,
.scene-cloud::after {
    content: '';
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: inherit;
}

.scene-cloud::before {
    left: 18px;
    width: 42px;
    height: 42px;
}

.scene-cloud::after {
    right: 18px;
    width: 55px;
    height: 55px;
}

.cloud-one {
    top: 18%;
    left: -25%;
    animation: cloudTravel 11s linear infinite;
}

.cloud-two {
    top: 34%;
    left: -30%;
    transform: scale(.65);
    opacity: .72;
    animation: cloudTravel 15s linear infinite 4s;
}

.scene-ground {
    top: 60%;
    z-index: 1;
    background: repeating-linear-gradient(90deg, transparent 0 42px, rgba(255, 255, 255, .4) 43px 65px, transparent 66px 112px);
    animation: groundTravel 2.2s linear infinite;
}

.scene-ground::before {
    content: '';
    position: absolute;
    inset: 22% 0 auto;
    height: 8px;
    background: rgba(52, 129, 58, .32);
    box-shadow: 0 9px 0 rgba(255, 255, 255, .15);
}

.scene-ground i {
    position: absolute;
    bottom: 4%;
    width: 6px;
    height: 23px;
    border-radius: 50% 50% 0 0;
    background: #358c45;
    transform-origin: bottom;
    animation: grassSway .8s ease-in-out infinite alternate;
}

.scene-ground i:nth-child(1) {
    left: 8%;
}

.scene-ground i:nth-child(2) {
    left: 29%;
    animation-delay: -.3s;
}

.scene-ground i:nth-child(3) {
    right: 27%;
    animation-delay: -.55s;
}

.scene-ground i:nth-child(4) {
    right: 8%;
    animation-delay: -.15s;
}

.scene-props {
    z-index: 4;
}

.scene-prop {
    position: absolute;
    display: grid;
    place-items: center;
    width: clamp(55px, 16%, 82px);
    aspect-ratio: 1;
    border: 4px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 9px 18px rgba(38, 83, 56, .2);
    font-size: clamp(2rem, 6vw, 3.5rem);
    opacity: 0;
    animation: propEnter .8s cubic-bezier(.2, 1.35, .45, 1) forwards, propOrbit 4s ease-in-out infinite;
    animation-delay: calc(.45s + var(--prop-order) * .25s), calc(1.25s + var(--prop-order) * .25s);
}

.scene-prop-1 {
    left: 5%;
    bottom: 18%;
}

.scene-prop-2 {
    right: 5%;
    bottom: 24%;
}

.scene-prop-3 {
    right: 19%;
    top: 7%;
}

.scene-letter-trail {
    z-index: 3;
}

.scene-letter-trail span {
    position: absolute;
    left: 43%;
    top: 45%;
    color: rgba(255, 255, 255, .92);
    font: 800 clamp(1.4rem, 5vw, 3rem) 'Playpen Sans', cursive;
    text-shadow: 0 3px 0 rgba(56, 117, 78, .3);
    opacity: 0;
    animation: letterFly 3.2s ease-out infinite;
    animation-delay: calc(var(--letter-order) * .55s);
}

.scene-confetti {
    z-index: 8;
    display: none;
}

.scene-goodbye .scene-confetti {
    display: block;
}

.scene-confetti b {
    position: absolute;
    top: -12%;
    color: #ffca3a;
    font-size: 1.5rem;
    animation: confettiFall 2.8s linear infinite;
}

.scene-confetti b:nth-child(1) {
    left: 8%;
    animation-delay: -.4s;
}

.scene-confetti b:nth-child(2) {
    left: 28%;
    color: #ff6b8a;
    animation-delay: -1.7s;
}

.scene-confetti b:nth-child(3) {
    left: 51%;
    color: #8f68d8;
    animation-delay: -.9s;
}

.scene-confetti b:nth-child(4) {
    left: 73%;
    color: #37a6d4;
    animation-delay: -2.2s;
}

.scene-confetti b:nth-child(5) {
    left: 91%;
    color: #ff8c42;
    animation-delay: -1.2s;
}

.replay-animation .scene-prop,
.replay-animation .scene-letter-trail span {
    animation-name: replayPop !important;
    animation-duration: .75s !important;
    animation-iteration-count: 2 !important;
}

.lesson-letter-bubble {
    position: absolute;
    top: 12%;
    right: 13%;
    display: flex;
    gap: .25rem;
    color: #fff;
    font-family: 'Playpen Sans', cursive;
    font-size: clamp(2.2rem, 7vw, 5.5rem);
    font-weight: 800;
    text-shadow: 0 4px 0 #d99228;
    transform: rotate(-6deg);
    z-index: 3;
}

.lesson-letter-bubble span:last-child {
    color: #5b9863;
    text-shadow: 0 4px 0 #3c7044;
    font-size: .7em;
    align-self: end;
}

.lesson-sound-waves i,
.action-rings i {
    position: absolute;
    border: 4px solid rgba(243, 173, 55, .5);
    border-radius: 50%;
    animation: soundPulse 2s ease-out infinite;
}

.lesson-sound-waves i:nth-child(1) {
    inset: 23% 25%;
}

.lesson-sound-waves i:nth-child(2) {
    inset: 16% 18%;
    animation-delay: .35s;
}

.lesson-sound-waves i:nth-child(3) {
    inset: 9% 11%;
    animation-delay: .7s;
}

.lesson-video {
    width: 100%;
    max-height: 58vh;
    border-radius: 28px;
    background: #17352c;
    box-shadow: 0 20px 40px rgba(38, 76, 52, .2);
}

.vocabulary-stage {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .85rem;
    width: 100%;
}

.vocabulary-parade {
    min-height: 360px;
    align-content: center;
    padding: 1.5rem 1rem 4.5rem;
    border-radius: 30px;
    overflow: hidden;
    background: linear-gradient(180deg, #8fddff 0 57%, #76c861 58% 74%, #59666d 75% 100%);
    box-shadow: 0 20px 42px rgba(46, 92, 75, .18);
}

.parade-road {
    position: absolute;
    inset: 79% 0 auto;
    height: 9px;
    background: repeating-linear-gradient(90deg, #fff 0 35px, transparent 36px 72px);
    animation: paradeRoad 1.2s linear infinite;
}

.vocabulary-parade .vocabulary-item {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateX(-140%);
    animation: cardParade 1s cubic-bezier(.2, 1.25, .45, 1) forwards, cardCruise 2.4s ease-in-out infinite;
    animation-delay: calc(var(--card-order) * .35s), calc(1s + var(--card-order) * .35s);
}

.vocabulary-parade .vocabulary-item:last-child {
    grid-column: 1 / -1;
    width: 55%;
    justify-self: center;
}

.vocabulary-item {
    display: grid;
    gap: .25rem;
    padding: 1rem;
    border: 2px solid #d8e9d2;
    border-radius: 22px;
    background: rgba(255, 255, 255, .85);
    color: #31564a;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 8px 18px rgba(79, 117, 73, .1);
}

.vocabulary-item:hover {
    border-color: #f3ad37;
    transform: translateY(-3px);
}

.vocabulary-emoji {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    text-align: center;
}

.vocabulary-item strong {
    font-family: 'Playpen Sans', cursive;
    font-size: 1.25rem;
}

.vocabulary-item span:last-child {
    color: #6e7c75;
    font-size: .78rem;
    line-height: 1.3;
}

.lesson-repeat-btn {
    margin-top: 1.2rem;
    padding: .8rem 1.2rem;
    border-radius: 50px;
    background: #f3ad37;
    color: #593c16;
}

.lesson-action-scene,
.scene-action {
    background: linear-gradient(180deg, #b5e6ff 0%, #eee0ff 59%, #9adb78 60%, #62af5c 100%);
}

.action-sound {
    position: absolute;
    top: 13%;
    right: 13%;
    color: #8656af;
    font: 800 clamp(2rem, 6vw, 4.5rem) 'Playpen Sans', cursive;
    transform: rotate(8deg);
}

.find-letter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: min(100%, 500px);
}

.find-letter-tile {
    aspect-ratio: 1;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: #397149;
    box-shadow: 0 8px 18px rgba(67, 105, 64, .16);
    font: 800 clamp(2rem, 6vw, 4rem) 'Playpen Sans', cursive;
    cursor: pointer;
}

.find-letter-tile:hover {
    background: #fff6cc;
    transform: scale(1.05);
}

.find-letter-tile.is-correct {
    background: #b8e5b2;
    color: #216337;
    animation: correctPop .4s ease;
}

.find-letter-tile.is-wrong {
    background: #ffd0cf;
    color: #a83c39;
    animation: shake .4s ease;
}

.lesson-goodbye-scene {
    background: linear-gradient(145deg, #c9f5df, #fff0ac);
}

.goodbye-letter {
    position: absolute;
    top: 10%;
    right: 14%;
    color: #ed9e2c;
    font: 800 clamp(3rem, 10vw, 7rem) 'Playpen Sans', cursive;
    transform: rotate(8deg);
}

.celebration-stars {
    position: absolute;
    top: 7%;
    left: 10%;
    color: #f4ad35;
    font-size: 2rem;
    animation: starSpin 2s ease-in-out infinite;
}

.celebration-stars span {
    color: #8c62c2;
    font-size: 1.4em;
}

@keyframes cloudTravel {
    from {
        translate: 0 0;
    }

    to {
        translate: 700px 0;
    }
}

@keyframes groundTravel {
    to {
        background-position-x: -112px;
    }
}

@keyframes grassSway {
    to {
        transform: rotate(18deg) scaleY(.85);
    }
}

@keyframes sunGlow {
    to {
        transform: scale(1.1) rotate(12deg);
        box-shadow: 0 0 0 17px rgba(255, 214, 77, .13), 0 0 42px #fff4a8;
    }
}

@keyframes propEnter {
    from {
        opacity: 0;
        transform: translateY(90px) scale(.2) rotate(-35deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

@keyframes propOrbit {

    0%,
    100% {
        translate: 0 0;
        rotate: -3deg;
    }

    33% {
        translate: 8px -14px;
        rotate: 5deg;
    }

    66% {
        translate: -7px -7px;
        rotate: -5deg;
    }
}

@keyframes letterFly {
    0% {
        opacity: 0;
        transform: translate(0, 45px) scale(.4) rotate(-12deg);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(180px, -150px) scale(1.35) rotate(20deg);
    }
}

@keyframes sceneShimmer {

    0%,
    70% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(120%);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0);
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    100% {
        transform: translateY(470px) rotate(540deg);
        opacity: .8;
    }
}

@keyframes paradeRoad {
    to {
        background-position-x: -72px;
    }
}

@keyframes cardParade {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes cardCruise {

    0%,
    100% {
        translate: 0 0;
        rotate: -1deg;
    }

    50% {
        translate: 0 -9px;
        rotate: 1deg;
    }
}

@keyframes replayPop {

    0%,
    100% {
        transform: scale(1) rotate(0);
    }

    50% {
        transform: scale(1.12) translateY(-16px) rotate(6deg);
    }
}

@keyframes soundPulse {
    0% {
        transform: scale(.5);
        opacity: .8;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes correctPop {
    50% {
        transform: scale(1.15) rotate(4deg);
    }
}

@keyframes shake {
    25% {
        transform: translateX(-7px);
    }

    75% {
        transform: translateX(7px);
    }
}

@keyframes starSpin {
    50% {
        transform: rotate(14deg) scale(1.15);
    }
}

/* Responsive grid adjustments */
@media (max-width: 991px) {
    .board-main-layout {
        grid-template-columns: repeat(4, 1fr);
    }

    .side-feature-banner {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .phonics-board-card {
        padding: 1.2rem 1rem;
        border-width: 6px;
    }

    .board-main-layout {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .side-feature-banner {
        grid-column: span 3;
    }

    .token-circle-disc {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
}

@media (max-width: 700px) {
    .lesson-stage {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        overflow-y: auto;
        padding: 1rem;
    }

    .lesson-media {
        min-height: 0;
        width: 100%;
    }

    .lesson-character-scene {
        width: min(100%, 360px);
    }

    .vocabulary-parade {
        min-height: 265px;
        padding: .8rem .6rem 3rem;
    }

    .scene-sun {
        width: 38px;
    }

    .scene-cloud {
        transform: scale(.7);
    }

    .scene-prop {
        border-width: 2px;
    }

    .lesson-copy {
        width: 100%;
        text-align: center;
    }

    .lesson-copy h2 {
        font-size: clamp(1.75rem, 8vw, 2.6rem);
    }

    .lesson-controls {
        padding: .8rem 1rem;
    }

    .lesson-control-btn {
        padding: .65rem .8rem;
        font-size: .86rem;
    }

    .vocabulary-stage {
        grid-template-columns: repeat(3, 1fr);
        gap: .45rem;
    }

    .vocabulary-item {
        padding: .45rem;
        text-align: center;
        border-radius: 14px;
    }

    .vocabulary-item strong {
        font-size: .95rem;
    }

    .vocabulary-item span:last-child {
        display: none;
    }

    .vocabulary-emoji {
        font-size: 2.2rem;
    }
}

/* Polished lesson presentation: restrained choreography and viewport-safe controls */
.phonics-lesson {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.lesson-header,
.lesson-progress,
.lesson-controls {
    flex: 0 0 auto;
}

.lesson-header {
    position: relative;
    z-index: 30;
    min-height: 68px;
    padding-block: .65rem;
    box-shadow: 0 5px 18px rgba(35, 76, 61, .08);
}

.lesson-stage {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-block: clamp(1rem, 2.5vh, 2.4rem);
}

.lesson-media {
    min-height: 0;
}

.lesson-controls {
    position: relative;
    z-index: 40;
    min-height: 76px;
    padding-block: .7rem;
    background: #ffffff;
    box-shadow: 0 -8px 24px rgba(35, 76, 61, .1);
}

.lesson-control-btn {
    min-width: 126px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 2px solid #2f7045;
    box-shadow: 0 5px 0 #245a37, 0 8px 16px rgba(36, 90, 55, .16);
    font-size: 1rem;
}

.lesson-control-btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #245a37;
}

.lesson-control-btn:focus-visible,
.lesson-icon-btn:focus-visible,
.lesson-dot:focus-visible {
    outline: 4px solid rgba(243, 173, 55, .55);
    outline-offset: 3px;
}

.lesson-back-btn {
    background: #ffffff;
    color: #2f7045;
}

.lesson-next-btn {
    background: linear-gradient(135deg, #41945c, #2f7045);
}

.lesson-character-scene {
    width: min(100%, 500px);
    max-height: min(50vh, 445px);
    border: 8px solid rgba(255, 255, 255, .9);
    border-radius: 30px;
    background: linear-gradient(180deg, #a9e4fb 0%, #e9f8fc 58%, #b8df8f 58%, #73b85f 100%);
    box-shadow: 0 18px 45px rgba(38, 83, 56, .17), inset 0 -20px 35px rgba(44, 107, 55, .12);
}

.animated-phonics-stage::after {
    display: none;
}

.scene-hills {
    position: absolute;
    inset: 43% 0 25%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.scene-hills i {
    position: absolute;
    bottom: -70%;
    width: 52%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #97cd7c;
}

.scene-hills i:nth-child(1) {
    left: -12%;
}

.scene-hills i:nth-child(2) {
    left: 27%;
    bottom: -78%;
    background: #82c16d;
}

.scene-hills i:nth-child(3) {
    right: -14%;
}

.scene-sun {
    top: 7%;
    left: 8%;
    animation: sunBreathe 4s ease-in-out infinite;
}

.cloud-one {
    top: 16%;
    animation: cloudDrift 24s linear infinite;
}

.cloud-two {
    top: 33%;
    animation: cloudDrift 32s linear infinite 8s;
}

.scene-ground {
    top: 68%;
    background: none;
    animation: none;
}

.scene-prop {
    width: clamp(62px, 17%, 88px);
    padding: .35rem;
    aspect-ratio: auto;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    gap: .08rem;
    opacity: 0;
    border: 3px solid #ffffff;
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 24px rgba(38, 83, 56, .16);
    animation: propReveal .65s cubic-bezier(.2, .9, .3, 1.2) forwards;
    animation-delay: calc(.55s + var(--prop-order) * .28s);
}

.scene-prop-picture {
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1;
}

.scene-prop small {
    max-width: 100%;
    overflow: hidden;
    color: #31564a;
    font: 800 clamp(.58rem, 1.6vw, .78rem) 'Playpen Sans', cursive;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-prop-1 {
    left: 4%;
    bottom: 10%;
}

.scene-prop-2 {
    right: 4%;
    bottom: 12%;
}

.scene-prop-3 {
    right: 6%;
    top: 8%;
}

.scene-letter-trail span {
    left: 45%;
    top: 44%;
    animation: letterSpark 4.5s ease-out infinite;
    animation-delay: calc(1.1s + var(--letter-order) * 1.15s);
}

.lesson-letter-bubble {
    top: 9%;
    right: 27%;
    padding: .18rem .65rem .3rem;
    border: 3px solid rgba(255, 255, 255, .9);
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    color: #f4a62f;
    font-size: clamp(2rem, 6vw, 4.6rem);
    text-shadow: 0 3px 0 #bd7620;
    transform: rotate(-3deg);
    backdrop-filter: blur(5px);
}

.lesson-sound-waves {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: .42;
}

.vocabulary-parade {
    min-height: min(45vh, 390px);
    padding: 2rem 1.2rem 3.5rem;
    border: 8px solid rgba(255, 255, 255, .92);
    background: linear-gradient(180deg, #b5e8fa 0 62%, #a4d57e 62% 78%, #637078 78% 100%);
}

.vocabulary-parade .vocabulary-item {
    opacity: 0;
    transform: translateY(28px) scale(.94);
    animation: cardReveal .65s cubic-bezier(.2, .9, .3, 1.12) forwards;
    animation-delay: calc(.18s + var(--card-order) * .2s);
}

.vocabulary-parade .vocabulary-item:hover {
    transform: translateY(-4px);
}

.parade-road {
    animation: paradeRoad 3s linear infinite;
}

.replay-animation .scene-prop {
    animation: propReplay .55s ease-out 1 both !important;
    animation-delay: calc(var(--prop-order) * .12s) !important;
}

.replay-animation .scene-letter-trail span {
    animation: letterSpark 1.8s ease-out 1 both !important;
    animation-delay: calc(var(--letter-order) * .18s) !important;
}

@keyframes propReveal {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(.82);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes propReplay {
    0% {
        opacity: .4;
        transform: scale(.8);
    }

    70% {
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes letterSpark {
    0% {
        opacity: 0;
        transform: translate(0, 15px) scale(.65);
    }

    20% {
        opacity: .92;
    }

    75% {
        opacity: .55;
    }

    100% {
        opacity: 0;
        transform: translate(100px, -95px) scale(1.12);
    }
}

@keyframes cloudDrift {
    from {
        translate: 0 0;
    }

    to {
        translate: 680px 0;
    }
}

@keyframes sunBreathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Child-focused scene choreography: bright, staged, and interactive. */
.animated-phonics-stage {
    isolation: isolate;
}

.animated-phonics-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, .72), transparent 12%);
    opacity: 0;
    animation: sceneSpotlight 1.15s ease-out .15s both;
}

.scene-rainbow {
    position: absolute;
    top: 5%;
    left: 50%;
    z-index: 1;
    width: 74%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(.78);
    filter: drop-shadow(0 8px 8px rgba(70, 90, 120, .12));
    animation: rainbowReveal .95s cubic-bezier(.2, .85, .35, 1.12) .12s both;
}

.scene-rainbow::before {
    content: '';
    position: absolute;
    inset: 0;
    border: clamp(8px, 2vw, 15px) solid #ff647c;
    border-bottom: 0;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    box-shadow:
        inset 0 clamp(8px, 2vw, 15px) 0 #ffad45,
        inset 0 clamp(16px, 4vw, 30px) 0 #ffe35a,
        inset 0 clamp(24px, 6vw, 45px) 0 #58c978,
        inset 0 clamp(32px, 8vw, 60px) 0 #53a8ee,
        inset 0 clamp(40px, 10vw, 75px) 0 #9673e8;
}

.scene-magic,
.scene-action-notes {
    position: absolute;
    inset: 0;
    z-index: 6;
    overflow: hidden;
    pointer-events: none;
}

.scene-magic b,
.scene-action-notes b {
    position: absolute;
    display: grid;
    place-items: center;
    opacity: 0;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .8), 0 5px 10px rgba(44, 75, 65, .16);
}

.scene-magic b {
    color: #ffd348;
    font-size: clamp(.75rem, 2.5vw, 1.45rem);
    animation: magicTwinkle 3.2s ease-in-out infinite;
}

.scene-magic b:nth-child(1) {
    left: 12%;
    top: 28%;
    animation-delay: .45s;
}

.scene-magic b:nth-child(2) {
    left: 77%;
    top: 25%;
    color: #ff7189;
    animation-delay: 1.15s;
}

.scene-magic b:nth-child(3) {
    left: 21%;
    top: 58%;
    color: #54b9ef;
    animation-delay: 1.8s;
}

.scene-magic b:nth-child(4) {
    left: 68%;
    top: 52%;
    color: #9e75e8;
    animation-delay: 2.35s;
}

.scene-magic b:nth-child(5) {
    left: 46%;
    top: 12%;
    color: #ff9d42;
    animation-delay: 2.8s;
}

.scene-magic b:nth-child(6) {
    left: 84%;
    top: 66%;
    color: #52c985;
    animation-delay: 3.25s;
}

.scene-prop {
    position: absolute;
    z-index: 8;
    appearance: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.scene-prop:hover {
    border-color: #ffe46b;
    box-shadow: 0 13px 27px rgba(38, 83, 56, .2), 0 0 0 4px rgba(255, 222, 83, .3);
    transform: translateY(-5px) rotate(-2deg);
}

.scene-prop:active {
    transform: translateY(1px) scale(.95);
}

.scene-prop:focus-visible {
    outline: 4px solid #ffca3a;
    outline-offset: 4px;
}

.prop-spark {
    position: absolute;
    top: -12px;
    right: -9px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #fff5a7;
    color: #f5a623;
    font-style: normal;
    opacity: 0;
    transform: scale(.2) rotate(-45deg);
    box-shadow: 0 4px 10px rgba(87, 64, 15, .18);
    pointer-events: none;
}

.scene-prop.is-tapped {
    animation: propTap .62s cubic-bezier(.2, .9, .3, 1.25) both !important;
}

.scene-prop.is-tapped .prop-spark {
    animation: propSpark .7s ease-out both;
}

.scene-action .scene-rainbow {
    opacity: .42;
    animation-delay: .05s;
}

.scene-action .scene-action-notes b {
    color: #ec5c8c;
    font-size: clamp(1.15rem, 4vw, 2.3rem);
    animation: noteBounce 2.2s ease-in-out infinite;
}

.scene-action .scene-action-notes b:nth-child(1) {
    left: 12%;
    bottom: 28%;
    animation-delay: .65s;
}

.scene-action .scene-action-notes b:nth-child(2) {
    left: 75%;
    bottom: 31%;
    color: #745bd6;
    animation-delay: 1.05s;
}

.scene-action .scene-action-notes b:nth-child(3) {
    left: 18%;
    top: 20%;
    color: #ffb52e;
    animation-delay: 1.45s;
}

.scene-action .scene-action-notes b:nth-child(4) {
    right: 12%;
    top: 16%;
    color: #38ad79;
    animation-delay: 1.8s;
}

.scene-goodbye {
    background: linear-gradient(180deg, #9cdcf9 0%, #f6dcff 57%, #b7df8c 57%, #70b75d 100%);
}

.scene-goodbye .scene-rainbow {
    width: 82%;
    animation: rainbowReveal .8s cubic-bezier(.2, .9, .3, 1.15) both, rainbowGlow 2.4s ease-in-out .8s infinite;
}

.scene-goodbye .scene-confetti {
    z-index: 10;
    opacity: 1;
}

.scene-goodbye .scene-confetti b {
    animation-duration: 2.8s;
}

.scene-goodbye .lesson-letter-bubble {
    animation: starBubbleCelebrate 1.8s ease-in-out .65s infinite;
}

.scene-intro .lesson-letter-bubble {
    animation: letterHeroReveal .9s cubic-bezier(.15, .9, .3, 1.3) .45s both, letterHeroFloat 3s ease-in-out 1.35s infinite;
}

.scene-intro .scene-prop,
.scene-action .scene-prop,
.scene-goodbye .scene-prop {
    animation-name: propReveal, propGentleFloat;
    animation-duration: .65s, 3.4s;
    animation-timing-function: cubic-bezier(.2, .9, .3, 1.2), ease-in-out;
    animation-fill-mode: forwards, none;
    animation-iteration-count: 1, infinite;
    animation-delay: calc(.55s + var(--prop-order) * .28s), calc(1.3s + var(--prop-order) * .35s);
}

@keyframes sceneSpotlight {
    0% {
        opacity: 0;
        transform: scale(.45);
    }

    45% {
        opacity: .9;
    }

    100% {
        opacity: 0;
        transform: scale(3.4);
    }
}

@keyframes rainbowReveal {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(18px) scale(.78);
    }

    70% {
        opacity: .86;
    }

    100% {
        opacity: .62;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes rainbowGlow {

    0%,
    100% {
        filter: drop-shadow(0 8px 8px rgba(70, 90, 120, .12)) saturate(1);
    }

    50% {
        filter: drop-shadow(0 8px 15px rgba(255, 123, 91, .25)) saturate(1.2);
    }
}

@keyframes magicTwinkle {

    0%,
    100% {
        opacity: 0;
        transform: translateY(8px) scale(.3) rotate(0);
    }

    25% {
        opacity: .95;
        transform: translateY(0) scale(1) rotate(90deg);
    }

    60% {
        opacity: .55;
        transform: translateY(-12px) scale(.72) rotate(180deg);
    }
}

@keyframes propGentleFloat {

    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -5px;
    }
}

@keyframes propTap {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }

    35% {
        opacity: 1;
        transform: scale(1.16) rotate(-5deg);
    }

    65% {
        opacity: 1;
        transform: scale(.96) rotate(3deg);
    }
}

@keyframes propSpark {
    0% {
        opacity: 0;
        transform: scale(.2) rotate(-45deg);
    }

    35% {
        opacity: 1;
        transform: scale(1.25) rotate(12deg);
    }

    100% {
        opacity: 0;
        transform: translate(13px, -18px) scale(.7) rotate(80deg);
    }
}

@keyframes noteBounce {

    0%,
    100% {
        opacity: 0;
        transform: translateY(18px) scale(.65) rotate(-10deg);
    }

    25%,
    70% {
        opacity: 1;
    }

    55% {
        opacity: .9;
        transform: translateY(-24px) scale(1.1) rotate(8deg);
    }
}

@keyframes letterHeroReveal {
    0% {
        opacity: 0;
        transform: scale(.35) rotate(-18deg);
    }

    65% {
        opacity: 1;
        transform: scale(1.12) rotate(3deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(-3deg);
    }
}

@keyframes letterHeroFloat {

    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: 0 -5px;
    }
}

@keyframes starBubbleCelebrate {

    0%,
    100% {
        transform: rotate(-3deg) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: rotate(3deg) scale(1.08);
        filter: brightness(1.12);
    }
}

@media (max-height: 720px) and (min-width: 701px) {
    .lesson-stage {
        grid-template-columns: minmax(260px, .9fr) minmax(300px, 1.1fr);
        gap: 2rem;
    }

    .lesson-character-scene,
    .vocabulary-parade {
        max-height: 390px;
    }

    .lesson-copy h2 {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }
}

@media (max-width: 700px) {
    .lesson-header {
        min-height: 58px;
    }

    .lesson-stage {
        justify-content: flex-start;
        padding: .7rem .9rem;
    }

    .lesson-character-scene {
        width: min(100%, 330px);
        max-height: 39vh;
        border-width: 5px;
        border-radius: 24px;
    }

    .lesson-copy h2 {
        margin-block: .35rem;
    }

    .lesson-copy p {
        line-height: 1.35;
    }

    .lesson-controls {
        min-height: 68px;
        gap: .55rem;
        padding: .55rem .75rem max(.55rem, env(safe-area-inset-bottom));
    }

    .lesson-control-btn {
        min-width: 102px;
        min-height: 44px;
        padding-inline: .75rem;
    }

    .lesson-dots {
        gap: .35rem;
    }

    .lesson-dot {
        width: .55rem;
        height: .55rem;
    }

    .lesson-dot.is-active {
        width: 1.25rem;
    }

    .scene-prop {
        min-height: 58px;
        width: 62px;
        border-radius: 16px;
    }

    .scene-prop-picture {
        font-size: 1.75rem;
    }

    .lesson-letter-bubble {
        right: 25%;
    }

    .vocabulary-parade {
        min-height: 250px;
        max-height: 38vh;
        padding: 1rem .55rem 2.7rem;
        border-width: 5px;
    }
}

@media (max-width: 390px) {
    .lesson-dots {
        display: none;
    }

    .lesson-controls::before {
        content: attr(data-step);
        color: #60746a;
        font-size: .78rem;
        font-weight: 800;
    }
}

/* Mobile board polish */
@media (max-width: 640px) {
    body.phonics-board-page {
        padding-top: 78px;
    }

    .phonics-stage-wrapper {
        width: 100%;
        margin: 0 auto 2rem;
        padding: 0 0.55rem;
    }

    .phonics-board-card {
        border-radius: 22px;
        padding: 1rem 0.7rem 1.35rem;
        border-width: 5px;
        box-shadow: 0 14px 32px rgba(162, 108, 179, 0.18), 0 0 0 1px #eed0eb;
    }

    .board-top-controls {
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1.35rem;
        padding-bottom: 1rem;
    }

    .board-title-box h1 {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    .board-title-box p {
        max-width: 32rem;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .board-actions,
    .sound-toggle-btn {
        width: 100%;
    }

    .sound-toggle-btn {
        justify-content: center;
        min-height: 44px;
        padding: 0.55rem 0.8rem;
    }

    .board-main-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem 0.7rem;
        padding: 0 0.15rem 0.25rem;
    }

    .board-block-item {
        min-width: 0;
    }

    .block-3d-box {
        border-radius: 14px;
        box-shadow:
            -3px 3px 0 var(--block-shade-side, #c53030),
            -5px 5px 0 var(--block-shade-bottom, #9b2c2c),
            -6px 8px 12px rgba(59, 20, 73, 0.2);
    }

    .board-block-item:hover {
        transform: none;
    }

    .board-block-item:hover .block-3d-box {
        box-shadow:
            -3px 3px 0 var(--block-shade-side, #c53030),
            -5px 5px 0 var(--block-shade-bottom, #9b2c2c),
            -6px 8px 12px rgba(59, 20, 73, 0.2);
    }

    .block-text {
        font-size: clamp(2rem, 13vw, 3rem);
    }

    .board-block-item.is-digraph .block-text {
        font-size: clamp(1.45rem, 9vw, 2.15rem);
    }

    .block-ipa-tag {
        bottom: 2px;
        font-size: 0.62rem;
    }

    .block-sound-icon {
        display: none;
    }

    .rainbow-ornaments-bar {
        margin-top: 2rem;
        padding-top: 0.7rem;
    }

    .rainbow-track {
        height: 8px;
    }

    .track-bead {
        width: 10px;
        height: 10px;
        top: 1px;
    }

    .medallions-chain-flex {
        gap: 0.7rem 0.55rem;
        margin-top: 0;
    }

    .hanging-token {
        flex: 0 0 calc(20% - 0.55rem);
        min-width: 48px;
    }

    .token-hook-ring {
        width: 9px;
        height: 11px;
        border-width: 2px;
    }

    .token-circle-disc {
        width: 48px;
        height: 48px;
        border-width: 3px;
        font-size: 1.35rem;
    }

    .token-hand-badge {
        font-size: 1.1rem;
    }
}

@media (max-width: 390px) {
    .phonics-stage-wrapper {
        padding-inline: 0.35rem;
    }

    .phonics-board-card {
        padding-inline: 0.55rem;
    }

    .board-main-layout {
        gap: 0.7rem 0.55rem;
    }

    .medallions-chain-flex {
        gap: 0.65rem 0.35rem;
    }

    .hanging-token {
        flex-basis: calc(20% - 0.35rem);
        min-width: 44px;
    }

    .token-circle-disc {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

@media (max-width: 700px) {
    .lesson-stage.is-game {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.45rem;
        padding: 0.75rem 0.9rem 1rem;
    }

    .lesson-stage.is-game .lesson-media {
        flex: 0 0 auto;
        min-height: 0;
        padding: 0.2rem 0;
    }

    .lesson-stage.is-game .lesson-copy {
        flex: 0 0 auto;
        text-align: center;
    }

    .lesson-stage.is-game .lesson-copy h2 {
        margin: 0.15rem 0 0.35rem;
        font-size: clamp(1.55rem, 7vw, 2.15rem);
    }

    .lesson-stage.is-game .lesson-copy p {
        font-size: 0.98rem;
        line-height: 1.3;
    }

    .lesson-stage.is-game .lesson-feedback {
        min-height: 1.5rem;
        margin-top: 0.55rem;
        font-size: 0.95rem;
    }

    .lesson-media:has(.find-letter-grid) {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: auto;
    }

    .find-letter-grid {
        width: min(100%, 22rem);
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(0.45rem, 2.5vw, 0.7rem);
        margin: 0 auto;
    }

    .find-letter-tile {
        min-width: 0;
        min-height: 0;
        border-radius: 14px;
        font-size: clamp(1.8rem, 10vw, 3rem);
        box-shadow: 0 5px 12px rgba(67, 105, 64, .14);
        touch-action: manipulation;
    }

    .find-letter-tile:hover {
        transform: none;
    }

    .lesson-stage.is-game .lesson-copy {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 390px) {
    .find-letter-grid {
        width: min(100%, 19rem);
        gap: 0.45rem;
    }

    .find-letter-tile {
        border-radius: 12px;
        font-size: clamp(1.65rem, 11vw, 2.4rem);
    }
}

@media (prefers-reduced-motion: reduce) {

    .phonics-lesson *,
    .phonics-lesson *::before,
    .phonics-lesson *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}