:root {
    --ink: #293447;
    --ink-soft: #617086;
    --cream: #fff8e7;
    --paper: #fffdf8;
    --white: #ffffff;
    --green: #45a36b;
    --green-dark: #28764a;
    --green-soft: #ddf3df;
    --yellow: #f6c84f;
    --yellow-light: #ffe58b;
    --orange: #ef8f45;
    --blue: #7cc9d9;
    --blue-dark: #3194ad;
    --purple: #7367b8;
    --purple-soft: #eeeafd;
    --line: #e8e3d7;
    --shadow: 0 22px 65px rgba(68, 76, 92, 0.14);
    --shadow-soft: 0 10px 28px rgba(68, 76, 92, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 9% 14%, rgba(246, 200, 79, 0.16) 0 90px, transparent 92px),
        radial-gradient(circle at 92% 85%, rgba(124, 201, 217, 0.18) 0 120px, transparent 122px),
        var(--cream);
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
    line-height: 1.5;
}

button,
a {
    font: inherit;
}

button {
    color: inherit;
}

button:not(:disabled),
[role="button"] {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.svg-definitions {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(221, 243, 223, 0.75), transparent 43%),
        var(--cream);
    transition: opacity 520ms ease, visibility 520ms ease;
}

.intro-screen.is-leaving {
    opacity: 0;
    visibility: hidden;
}

.intro-silhouette {
    width: min(72vw, 530px);
    padding: 0;
    border: 0;
    color: rgba(50, 88, 67, 0.2);
    background: transparent;
    outline: none;
    filter: drop-shadow(0 22px 32px rgba(50, 88, 67, 0.09));
}

.intro-silhouette svg {
    width: 100%;
    overflow: visible;
    fill: currentColor;
    stroke: rgba(40, 118, 74, 0.27);
    stroke-dasharray: 7 11;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
}

.intro-screen.needs-interaction .intro-silhouette,
.intro-silhouette:focus-visible {
    animation: silhouetteInvite 1.35s ease-in-out infinite alternate;
}

.intro-screen.is-speaking .intro-silhouette {
    animation: silhouetteListening 1.1s ease-in-out infinite alternate;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--white);
    background: var(--green-dark);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.activity-page {
    width: min(1440px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 40px 44px;
}

.activity-header {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.activity-brand-group {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.activity-back-link {
    min-height: 43px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px 8px 11px;
    border: 1px solid rgba(41, 52, 71, 0.11);
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 5px 15px rgba(41, 52, 71, 0.06);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.activity-back-link:hover,
.activity-back-link:focus-visible {
    color: var(--green-dark);
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transform: translateX(-2px);
}

.activity-back-link svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
}

.brand-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(40, 118, 74, 0.13);
    border-radius: 17px;
    background: var(--white);
    box-shadow: 0 7px 18px rgba(40, 118, 74, 0.11);
    transform: rotate(-3deg);
}

.brand-icon svg {
    width: 37px;
    height: 37px;
    overflow: visible;
}

.brand-icon path {
    fill: var(--green-soft);
    stroke: var(--green-dark);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.7;
}

.brand-icon circle {
    fill: var(--yellow);
    stroke: var(--orange);
    stroke-width: 2.4;
}

.brand-copy {
    display: grid;
    line-height: 1.15;
}

.brand-copy strong {
    color: var(--green-dark);
    font-size: clamp(1rem, 2vw, 1.28rem);
    letter-spacing: -0.03em;
}

.brand-copy small {
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stage-progress,
.sound-toggle {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid rgba(41, 52, 71, 0.1);
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.83rem;
    font-weight: 800;
}

.stage-progress {
    display: grid;
    gap: 3px;
    padding-inline: 17px;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.progress-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d8d3c7;
    transition: width 220ms ease, background 220ms ease;
}

.progress-dots span.is-done {
    background: var(--green);
}

.progress-dots span.is-current {
    width: 20px;
    border-radius: 999px;
    background: var(--orange);
}

.sound-toggle {
    border-color: rgba(115, 103, 184, 0.18);
    color: var(--purple);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sound-toggle .sound-on-icon path:first-child,
.listen-icon path:first-child,
.piece-audio path:first-child {
    fill: currentColor;
    stroke: none;
}

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

.sound-toggle[aria-pressed="true"] .sound-on-icon {
    display: none;
}

.sound-toggle[aria-pressed="true"] .sound-off-icon {
    display: block;
}

.game-shell {
    min-height: calc(100vh - 136px);
    display: grid;
    grid-template-columns: minmax(420px, 1.08fr) minmax(480px, 0.92fr);
    overflow: hidden;
    border: 1px solid rgba(41, 52, 71, 0.09);
    border-radius: 34px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.scene-card {
    position: relative;
    min-height: 680px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    background: #eaf5ec;
    transition: background 700ms ease;
}

.scene-card[data-stage="lago"],
.scene-card[data-stage="sol"] {
    background: linear-gradient(180deg, #c8edf1 0%, #e4f6e8 61%, #9bd6b3 62%, #5eb78a 100%);
}

.scene-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: 14%;
    z-index: -1;
    width: 190px;
    height: 250px;
    border-radius: 50% 0 0 50%;
    background:
        radial-gradient(ellipse at 92% 15%, #3f9b69 0 24%, transparent 25%),
        radial-gradient(ellipse at 62% 35%, #54ad76 0 24%, transparent 25%),
        radial-gradient(ellipse at 88% 53%, #2f875c 0 26%, transparent 27%),
        radial-gradient(ellipse at 55% 76%, #4da66f 0 27%, transparent 28%);
    opacity: 0;
    transition: opacity 600ms ease;
}

.scene-card[data-stage="lago"]::after,
.scene-card[data-stage="sol"]::after {
    opacity: 0.9;
}

.sky-decoration,
.pond,
.pond-details,
.confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sky-decoration {
    opacity: 0;
    transition: opacity 600ms ease;
}

.scene-card[data-stage="lago"] .sky-decoration,
.scene-card[data-stage="sol"] .sky-decoration {
    opacity: 1;
}

.sun-stage {
    position: absolute;
    top: 52px;
    right: 62px;
    z-index: 1;
    width: 132px;
    aspect-ratio: 1;
    pointer-events: none;
}

.sun-silhouette,
.sun-part {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 460ms ease, transform 520ms cubic-bezier(0.2, 0.85, 0.32, 1.2);
}

.sun-silhouette {
    inset: 25px;
    border: 4px dashed rgba(50, 88, 67, 0.33);
    background: rgba(50, 88, 67, 0.13);
}

.scene-card[data-stage="sol"] .sun-silhouette {
    opacity: 1;
    transform: scale(1);
}

.sun-part.is-revealed {
    opacity: 1;
    transform: scale(1);
}

.sun-rays {
    inset: 0;
    border-radius: 0;
    background: repeating-conic-gradient(
        from 3deg,
        rgba(246, 200, 79, 0.92) 0deg 8deg,
        transparent 8deg 24deg
    );
    mask: radial-gradient(circle, transparent 0 51%, #000 52% 100%);
}

.sun-halo {
    inset: 12px;
    border: 9px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 229, 139, 0.28);
    box-shadow: 0 0 0 14px rgba(255, 237, 154, 0.18);
}

.sun-core {
    inset: 27px;
    border: 4px solid #e8ad36;
    background: var(--yellow-light);
    box-shadow: inset -9px -9px 0 rgba(246, 200, 79, 0.45);
}

.sun-stage.is-shining {
    animation: sunFloat 2.6s ease-in-out infinite;
}

.sun-stage.is-shining .sun-rays {
    animation: sunSpin 13s linear infinite;
}

.sun-stage.is-shining .sun-halo {
    animation: sunGlow 1.45s ease-in-out infinite alternate;
}

.cloud {
    position: absolute;
    width: 104px;
    height: 29px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
}

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

.cloud::before {
    left: 17px;
    width: 46px;
    height: 46px;
}

.cloud::after {
    right: 13px;
    width: 58px;
    height: 58px;
}

.cloud-one {
    top: 118px;
    left: 7%;
    transform: scale(0.75);
}

.cloud-two {
    top: 189px;
    right: 8%;
    opacity: 0.55;
    transform: scale(0.55);
}

.scene-label {
    position: absolute;
    top: 34px;
    left: 34px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    color: #29704f;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 24px rgba(40, 118, 74, 0.08);
    backdrop-filter: blur(8px);
    font-size: 0.78rem;
    font-weight: 800;
}

.scene-label-icon {
    color: var(--orange);
    font-size: 1rem;
}

.duck-stage {
    position: relative;
    z-index: 2;
    width: min(90%, 570px);
    margin-top: 54px;
    filter: drop-shadow(0 16px 16px rgba(42, 94, 79, 0.13));
}

.duck-illustration {
    width: 100%;
    overflow: visible;
}

.duck-silhouette {
    fill: rgba(42, 94, 79, 0.13);
    stroke: rgba(255, 255, 255, 0.32);
    stroke-dasharray: 7 10;
    stroke-linecap: round;
    stroke-width: 4;
}

.duck-part {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity 480ms ease, transform 520ms cubic-bezier(0.2, 0.85, 0.32, 1.25);
}

.duck-part.is-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lake-silhouette {
    position: absolute;
    right: -8%;
    bottom: -115px;
    left: -8%;
    z-index: 1;
    height: 300px;
    border: 5px dashed rgba(50, 88, 67, 0.24);
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    background: rgba(50, 88, 67, 0.1);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 520ms ease, transform 620ms cubic-bezier(0.2, 0.85, 0.32, 1.1);
}

.scene-card[data-stage="lago"] .lake-silhouette,
.scene-card[data-stage="sol"] .lake-silhouette {
    opacity: 1;
    transform: translateY(0);
}

.pond.scene-part,
.pond-details.scene-part {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 520ms ease, transform 580ms cubic-bezier(0.2, 0.85, 0.32, 1.1);
}

.pond.scene-part.is-revealed,
.pond-details.scene-part.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.pond {
    z-index: 1;
}

.pond-details {
    z-index: 4;
}

.duck-tail,
.duck-body,
.duck-head {
    fill: var(--yellow);
    stroke: #cc9730;
    stroke-linejoin: round;
    stroke-width: 5;
}

.duck-wing {
    fill: var(--yellow-light);
    stroke: #d7a43b;
    stroke-width: 4;
}

.wing-detail,
.duck-brow {
    fill: none;
    stroke: #b77e27;
    stroke-linecap: round;
    stroke-width: 5;
}

.duck-cheek {
    fill: #f5ae63;
    opacity: 0.65;
}

.duck-beak {
    fill: var(--orange);
    stroke: #cb6e31;
    stroke-linejoin: round;
    stroke-width: 4;
}

.duck-eye {
    fill: var(--ink);
}

.duck-eye-shine {
    fill: var(--white);
}

.duck-ripple {
    fill: none;
    stroke: rgba(255, 255, 255, 0.72);
    stroke-width: 7;
    opacity: 0;
    transition: opacity 420ms ease;
}

.scene-card.has-lake .duck-ripple {
    opacity: 1;
}

.ripple-back {
    stroke-opacity: 0.45;
}

.ripple-front {
    stroke: rgba(49, 148, 173, 0.52);
    stroke-dasharray: 190 70;
    stroke-linecap: round;
}

.duck-stage.is-celebrating {
    animation: duckCelebrate 820ms cubic-bezier(0.3, 0.8, 0.3, 1.2) both;
}

.duck-stage.is-celebrating .duck-wing {
    animation: wingWave 410ms ease-in-out 2;
    transform-box: fill-box;
    transform-origin: 75% 35%;
}

.pond::before {
    content: "";
    position: absolute;
    right: -8%;
    bottom: -115px;
    left: -8%;
    height: 300px;
    border-radius: 50% 50% 0 0;
    background:
        radial-gradient(ellipse at 25% 27%, rgba(255, 255, 255, 0.32) 0 2px, transparent 3px),
        radial-gradient(ellipse at 75% 47%, rgba(255, 255, 255, 0.3) 0 3px, transparent 4px),
        linear-gradient(180deg, rgba(98, 196, 195, 0.85), #3194ad);
    box-shadow: inset 0 15px 0 rgba(255, 255, 255, 0.12);
}

.reed {
    position: absolute;
    bottom: 96px;
    z-index: 3;
    width: 9px;
    height: 91px;
    border-radius: 10px 10px 0 0;
    background: #378457;
    transform-origin: bottom;
}

.reed::before,
.reed::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 14px;
    border-radius: 100% 0 100% 0;
    background: #58a869;
}

.reed::before {
    top: 25px;
    left: 3px;
    transform: rotate(-28deg);
}

.reed::after {
    top: 48px;
    right: 3px;
    transform: rotate(205deg);
}

.reed-one {
    left: 9%;
    transform: rotate(-5deg);
}

.reed-two {
    right: 12%;
    height: 118px;
    transform: rotate(5deg) scale(1.1);
}

.lily {
    position: absolute;
    bottom: 63px;
    z-index: 3;
    width: 69px;
    height: 27px;
    border-radius: 50%;
    background: #60aa67;
    box-shadow: inset -12px -5px 0 rgba(38, 116, 69, 0.25);
}

.lily::before {
    content: "";
    position: absolute;
    top: -22px;
    left: 26px;
    width: 22px;
    height: 27px;
    border-radius: 50% 50% 44% 44%;
    background: #f5a7bb;
    box-shadow: -10px 8px 0 #f8c6d4, 10px 8px 0 #f8c6d4;
}

.lily-one {
    left: 23%;
}

.lily-two {
    right: 25%;
    bottom: 35px;
    transform: scale(0.75);
}

.confetti {
    z-index: 7;
    overflow: hidden;
}

.confetti span {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 11px;
    height: 20px;
    border-radius: 4px;
    background: var(--yellow);
    opacity: 0;
}

.confetti.is-active span {
    animation: confettiBurst 1050ms ease-out both;
}

.confetti span:nth-child(2n) { background: var(--purple); }
.confetti span:nth-child(3n) { background: var(--orange); }
.confetti span:nth-child(4n) { background: var(--green); }
.confetti span:nth-child(5n) { background: var(--blue-dark); }
.confetti span:nth-child(1) { --x: -250px; --y: -190px; --r: 180deg; }
.confetti span:nth-child(2) { --x: -185px; --y: -260px; --r: 310deg; animation-delay: 40ms; }
.confetti span:nth-child(3) { --x: -100px; --y: -205px; --r: 220deg; animation-delay: 80ms; }
.confetti span:nth-child(4) { --x: -42px; --y: -278px; --r: 400deg; animation-delay: 30ms; }
.confetti span:nth-child(5) { --x: 40px; --y: -240px; --r: 260deg; animation-delay: 90ms; }
.confetti span:nth-child(6) { --x: 116px; --y: -285px; --r: 420deg; animation-delay: 20ms; }
.confetti span:nth-child(7) { --x: 190px; --y: -215px; --r: 300deg; animation-delay: 70ms; }
.confetti span:nth-child(8) { --x: 260px; --y: -155px; --r: 470deg; animation-delay: 50ms; }
.confetti span:nth-child(9) { --x: -275px; --y: -75px; --r: 250deg; animation-delay: 110ms; }
.confetti span:nth-child(10) { --x: 280px; --y: -60px; --r: 380deg; animation-delay: 100ms; }
.confetti span:nth-child(11) { --x: -160px; --y: -130px; --r: 330deg; animation-delay: 140ms; }
.confetti span:nth-child(12) { --x: 155px; --y: -125px; --r: 520deg; animation-delay: 130ms; }

.challenge-card {
    position: relative;
    padding: clamp(38px, 4vw, 65px) clamp(34px, 5vw, 76px) 34px;
    background:
        radial-gradient(circle at 100% 0, rgba(115, 103, 184, 0.08), transparent 260px),
        var(--paper);
}

.challenge-heading {
    max-width: 570px;
}

.eyebrow,
.section-label,
.success-kicker {
    margin: 0;
    color: var(--green-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.challenge-heading h1 {
    max-width: 520px;
    margin: 11px 0 11px;
    color: var(--ink);
    font-size: clamp(2rem, 3.7vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.instruction {
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(0.95rem, 1.25vw, 1.08rem);
}

.listen-button {
    width: 100%;
    min-height: 82px;
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 12px 20px;
    border: 2px solid rgba(115, 103, 184, 0.14);
    border-radius: 21px;
    color: var(--purple);
    background: var(--purple-soft);
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.listen-button:hover,
.listen-button:focus-visible {
    border-color: rgba(115, 103, 184, 0.4);
    box-shadow: 0 12px 24px rgba(115, 103, 184, 0.12);
    transform: translateY(-2px);
}

.listen-button.is-speaking .listen-icon {
    animation: audioPulse 620ms ease-in-out infinite alternate;
}

.listen-icon {
    width: 49px;
    height: 49px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--white);
    background: var(--purple);
    box-shadow: 0 8px 18px rgba(115, 103, 184, 0.25);
}

.listen-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.listen-button > span:last-child {
    display: grid;
    line-height: 1.15;
}

.listen-button small {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.listen-button strong {
    margin-top: 4px;
    color: var(--ink);
    font-size: 1.43rem;
    letter-spacing: 0.08em;
}

.puzzle-area {
    margin-top: 27px;
}

.challenge-card.is-complete .pieces-section,
.challenge-card.is-complete .interaction-tip {
    display: none;
}

.challenge-card.is-complete .feedback-panel {
    margin-top: 18px;
}

.challenge-card.is-complete .success-card {
    margin-top: 15px;
}

.slots-section,
.pieces-section {
    display: grid;
    gap: 10px;
}

.pieces-section {
    margin-bottom: 29px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(41, 52, 71, 0.09);
}

.section-label {
    color: var(--ink-soft);
    letter-spacing: 0.09em;
}

.syllable-slots,
.syllable-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
}

.syllable-slots {
    align-items: center;
    transition: gap 600ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.syllable-slot,
.syllable-piece {
    position: relative;
    width: 116px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 20px;
}

.syllable-slot {
    border: 2px dashed #c9c5bb;
    color: #b7b1a5;
    background: rgba(255, 255, 255, 0.56);
    outline: none;
    transition:
        width 600ms cubic-bezier(0.2, 0.8, 0.25, 1),
        height 600ms cubic-bezier(0.2, 0.8, 0.25, 1),
        border-color 180ms ease,
        border-radius 600ms ease,
        background 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.syllable-slot:hover,
.syllable-slot:focus-visible,
.syllable-slot.is-drag-over {
    border-color: var(--purple);
    background: var(--purple-soft);
    box-shadow: 0 0 0 4px rgba(115, 103, 184, 0.1);
}

.slot-number {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #8e887c;
    background: #ede9df;
    font-size: 0.68rem;
    font-weight: 900;
    transition: opacity 240ms ease, transform 240ms ease;
}

.slot-placeholder {
    font-size: 2rem;
    font-weight: 900;
}

.syllable-slot.is-filled {
    border-style: solid;
    border-color: rgba(69, 163, 107, 0.3);
    color: var(--green-dark);
    background: var(--green-soft);
    box-shadow: 0 10px 22px rgba(69, 163, 107, 0.13);
    animation: pieceLand 460ms cubic-bezier(0.2, 0.85, 0.32, 1.35);
}

.syllable-slot.is-filled .slot-number {
    color: var(--white);
    background: var(--green);
}

.syllable-slots.is-reviewing .syllable-slot.is-filled {
    animation: none;
}

.syllable-slot.is-reading {
    z-index: 2;
    border-color: #f1b83d;
    color: #654d18;
    background: #fff0a9;
    box-shadow:
        0 0 0 6px rgba(246, 200, 79, 0.2),
        0 0 30px rgba(246, 200, 79, 0.58),
        0 14px 26px rgba(128, 94, 20, 0.18);
    animation: unitReadGlow 620ms ease-in-out infinite alternate;
}

.syllable-slot.is-read {
    border-color: rgba(69, 163, 107, 0.55);
    background: #e5f6df;
}

.syllable-slots.is-word-joining {
    flex-wrap: nowrap;
    gap: 0;
}

.syllable-slots.is-word-joining .syllable-slot {
    width: 72px;
    height: 80px;
    border-color: var(--green);
    border-radius: 0;
    background: #e8f7e5;
    box-shadow: 0 13px 27px rgba(45, 112, 70, 0.2);
    transform: translateY(-3px);
}

.challenge-card[data-mode="letras"] .syllable-slots.is-word-joining .syllable-slot {
    width: 52px;
}

.syllable-slots.is-word-joining .syllable-slot:first-child {
    border-radius: 18px 0 0 18px;
}

.syllable-slots.is-word-joining .syllable-slot:last-child {
    border-radius: 0 18px 18px 0;
}

.syllable-slots.is-word-joining .syllable-slot:not(:last-child) {
    border-right-width: 1px;
}

.syllable-slots.is-word-joining .slot-number {
    opacity: 0;
    transform: scale(0.65);
}

.syllable-slots.is-word-joining .placed-text {
    letter-spacing: 0;
}

.syllable-slots.is-word-complete {
    animation: completedWordPulse 760ms cubic-bezier(0.2, 0.85, 0.32, 1.25) both;
}

.placed-text {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.syllable-piece {
    border: 0;
    color: var(--ink);
    background: var(--yellow-light);
    box-shadow:
        inset 0 -6px 0 rgba(215, 164, 59, 0.24),
        0 10px 18px rgba(202, 151, 48, 0.13);
    outline: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    touch-action: manipulation;
}

.syllable-piece:nth-child(even) {
    background: #dff0fb;
    box-shadow:
        inset 0 -6px 0 rgba(49, 148, 173, 0.16),
        0 10px 18px rgba(49, 148, 173, 0.1);
}

.syllable-piece:hover,
.syllable-piece:focus-visible {
    transform: translateY(-4px) rotate(-1deg);
    box-shadow:
        inset 0 -6px 0 rgba(215, 164, 59, 0.24),
        0 15px 25px rgba(94, 86, 54, 0.17);
}

.syllable-piece.is-selected {
    box-shadow:
        inset 0 -5px 0 rgba(115, 103, 184, 0.17),
        0 0 0 4px var(--white),
        0 0 0 8px var(--purple),
        0 16px 28px rgba(115, 103, 184, 0.22);
    transform: translateY(-5px) scale(1.03);
}

.syllable-piece.is-hint,
.syllable-slot.is-hint {
    animation: hintGlow 850ms ease-in-out infinite alternate;
}

.piece-text {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.piece-audio {
    position: absolute;
    right: 9px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(41, 52, 71, 0.62);
    background: rgba(255, 255, 255, 0.6);
}

.piece-audio svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.is-wrong {
    animation: gentleNo 340ms ease;
}

.feedback-panel {
    min-height: 63px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    border: 1px solid rgba(69, 163, 107, 0.13);
    border-radius: 17px;
    background: rgba(221, 243, 223, 0.52);
}

.feedback-character {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 5px 12px rgba(68, 76, 92, 0.08);
    font-size: 1.25rem;
}

.feedback {
    margin: 0;
    color: #3f674f;
    font-size: 0.91rem;
    font-weight: 800;
    line-height: 1.35;
}

.hint-card {
    margin-top: 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 15px;
    border: 1px solid rgba(239, 143, 69, 0.2);
    border-radius: 15px;
    color: #7a573b;
    background: #fff1df;
    animation: hintEnter 320ms ease both;
}

.hint-card p {
    margin: 0;
    flex: 1;
    font-size: 0.84rem;
}

.hint-listen-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(239, 143, 69, 0.28);
    border-radius: 50%;
    color: #7a573b;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.hint-listen-button:hover,
.hint-listen-button:focus-visible {
    background: #fff;
    transform: scale(1.06);
}

.success-card {
    margin-top: 21px;
    padding: 20px;
    border: 2px solid rgba(69, 163, 107, 0.22);
    border-radius: 23px;
    background:
        radial-gradient(circle at 12% 8%, rgba(246, 200, 79, 0.23), transparent 95px),
        var(--green-soft);
    text-align: center;
    animation: successEnter 540ms cubic-bezier(0.2, 0.85, 0.32, 1.25) both;
}

.success-stars {
    color: var(--orange);
    letter-spacing: 0.38em;
}

.success-kicker {
    margin-top: 7px;
}

.success-card h2 {
    margin: 0;
    color: var(--green-dark);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    letter-spacing: 0.16em;
    line-height: 1.1;
}

.success-card > p:last-of-type {
    margin: 6px 0 0;
    color: #3f674f;
    font-weight: 800;
}

.success-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.small-action,
.restart-button {
    min-height: 43px;
    padding: 9px 14px;
    border: 0;
    border-radius: 13px;
    font-size: 0.8rem;
    font-weight: 900;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.small-action {
    color: var(--purple);
    background: var(--white);
}

.restart-button {
    color: var(--white);
    background: var(--green-dark);
    box-shadow: 0 8px 17px rgba(40, 118, 74, 0.18);
}

.small-action:hover,
.small-action:focus-visible,
.restart-button:hover,
.restart-button:focus-visible {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.interaction-tip {
    margin: 18px 0 0;
    color: #9a958a;
    font-size: 0.76rem;
    text-align: center;
}

.interaction-tip span {
    margin-right: 4px;
}

.empty-state {
    width: min(620px, calc(100% - 32px));
    margin: 14vh auto 0;
    padding: 50px;
    border-radius: 30px;
    background: var(--white);
    box-shadow: var(--shadow);
    text-align: center;
}

.empty-state > span {
    font-size: 3rem;
}

.empty-state h1 {
    margin: 16px 0 8px;
}

.empty-state p {
    margin: 0;
    color: var(--ink-soft);
}

@keyframes pieceLand {
    0% { opacity: 0.3; transform: translateY(-16px) scale(0.9); }
    70% { transform: translateY(2px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes unitReadGlow {
    from { transform: translateY(-3px) scale(1.02); }
    to { transform: translateY(-7px) scale(1.08); }
}

@keyframes completedWordPulse {
    0% { transform: scale(0.94); }
    58% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes gentleNo {
    0%, 100% { transform: translateX(0); }
    28% { transform: translateX(-7px) rotate(-1deg); }
    58% { transform: translateX(7px) rotate(1deg); }
    82% { transform: translateX(-3px); }
}

@keyframes hintGlow {
    from { box-shadow: 0 0 0 2px rgba(239, 143, 69, 0.12); }
    to { box-shadow: 0 0 0 7px rgba(239, 143, 69, 0.32); }
}

@keyframes hintEnter {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes audioPulse {
    from { transform: scale(0.94); }
    to { transform: scale(1.08); }
}

@keyframes silhouetteInvite {
    from {
        color: rgba(50, 88, 67, 0.17);
        filter: drop-shadow(0 18px 25px rgba(50, 88, 67, 0.07));
        transform: scale(0.98);
    }
    to {
        color: rgba(50, 88, 67, 0.25);
        filter: drop-shadow(0 25px 38px rgba(50, 88, 67, 0.16));
        transform: scale(1.025);
    }
}

@keyframes silhouetteListening {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

@keyframes sunFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sunSpin {
    to { transform: rotate(360deg); }
}

@keyframes sunGlow {
    from { box-shadow: 0 0 0 12px rgba(255, 237, 154, 0.16); }
    to { box-shadow: 0 0 0 24px rgba(255, 237, 154, 0.35), 0 0 38px rgba(246, 200, 79, 0.5); }
}

@keyframes successEnter {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes duckCelebrate {
    0% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(-20px) rotate(-3deg); }
    55% { transform: translateY(1px) rotate(2deg); }
    75% { transform: translateY(-9px) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0); }
}

@keyframes wingWave {
    0%, 100% { transform: rotate(0); }
    50% { transform: rotate(-12deg) translateY(-4px); }
}

@keyframes confettiBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(0) scale(0.4);
    }
    16% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1);
    }
}

@media (max-width: 1050px) {
    .activity-page {
        padding-inline: 24px;
    }

    .game-shell {
        grid-template-columns: minmax(330px, 0.9fr) minmax(430px, 1.1fr);
    }

    .challenge-card {
        padding-inline: 38px;
    }

    .scene-card {
        min-height: 650px;
    }
}

@media (max-width: 820px) {
    .activity-page {
        padding: 0 16px 28px;
    }

    .activity-header {
        min-height: 80px;
    }

    .stage-progress {
        display: none;
    }

    .game-shell {
        min-height: 0;
        grid-template-columns: 1fr;
        border-radius: 25px;
    }

    .scene-card {
        min-height: 370px;
    }

    .duck-stage {
        width: min(84%, 430px);
        margin-top: 63px;
    }

    .pond::before {
        bottom: -185px;
    }

    .reed,
    .lily {
        bottom: 25px;
    }

    .lily-two {
        bottom: 8px;
    }

    .challenge-card {
        padding: 38px 28px 27px;
    }

    .challenge-heading h1 {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }
}

@media (max-width: 520px) {
    .activity-header {
        min-height: 70px;
    }

    .brand-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .brand-icon svg {
        width: 31px;
        height: 31px;
    }

    .brand-copy small,
    .sound-toggle [data-sound-label] {
        display: none;
    }

    .sound-toggle {
        width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0;
    }

    .activity-brand-group {
        gap: 10px;
    }

    .activity-back-link {
        min-height: 44px;
        padding-inline: 10px 12px;
    }

    .scene-card {
        min-height: 260px;
    }

    .scene-label {
        top: 18px;
        left: 18px;
        max-width: calc(100% - 36px);
        font-size: 0.68rem;
    }

    .sun-stage {
        top: 38px;
        right: 18px;
        width: 92px;
    }

    .duck-stage {
        width: 85%;
        margin-top: 50px;
    }

    .challenge-card {
        padding: 26px 20px 24px;
    }

    .listen-button {
        min-height: 68px;
        margin-top: 18px;
    }

    .listen-icon {
        width: 44px;
        height: 44px;
    }

    .syllable-slot,
    .syllable-piece {
        width: calc(50% - 7px);
        height: 74px;
    }

    .puzzle-area {
        margin-top: 19px;
    }

    .pieces-section {
        margin-bottom: 23px;
        padding-bottom: 21px;
    }

    .piece-text,
    .placed-text {
        font-size: 1.75rem;
    }

    .feedback-panel {
        margin-top: 17px;
    }

    .challenge-card.is-complete .challenge-heading,
    .challenge-card.is-complete .listen-button {
        display: none;
    }

    .challenge-card.is-complete .puzzle-area {
        margin-top: 0;
    }

    .success-actions {
        flex-direction: column;
    }
}

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

@media (max-width: 340px) {
    .activity-back-link {
        width: 44px;
        padding: 0;
    }

    .activity-back-link span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
