.lulu-reaction {
    position: relative;
    width: 100%;
    height: 452px;
    padding-top: 52px;
}

.letter-mentor-scene .lulu-reaction-image {
    height: 400px;
    transform-origin: 50% 90%;
}

.lulu-reaction-message {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 10px 18px;
    border: 1px solid #dce4d4;
    border-radius: 18px;
    background: var(--mint);
    color: var(--green);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.3;
    text-align: center;
    transform: translateX(-50%);
    animation: lulu-message-appear 300ms ease-out;
}

.lulu-reaction-message::after {
    position: absolute;
    bottom: -6px;
    left: calc(50% - 6px);
    width: 10px;
    height: 10px;
    border-right: 1px solid #dce4d4;
    border-bottom: 1px solid #dce4d4;
    background: inherit;
    content: "";
    transform: rotate(45deg);
}

[data-feedback="CORRECT"] .lulu-reaction-image.is-ready {
    animation: lulu-celebrate 1400ms ease-in-out;
}

[data-feedback="RETRY"] .lulu-reaction-image.is-ready {
    animation: lulu-encourage 1200ms ease-in-out;
}

.lulu-spark {
    position: absolute;
    width: 30px;
    height: 30px;
    fill: #f4d989;
    color: #b68b36;
    animation: lulu-spark-appear 800ms ease-out both;
}

.lulu-spark-one {
    top: 23%;
    left: 12%;
    transform: rotate(-12deg);
}

.lulu-spark-two {
    top: 32%;
    right: 9%;
    width: 24px;
    height: 24px;
    animation-delay: 140ms;
    transform: rotate(10deg);
}

.lulu-spark-three {
    right: 13%;
    bottom: 18%;
    width: 20px;
    height: 20px;
    animation-delay: 280ms;
    transform: rotate(-8deg);
}

.lulu-reaction-heart {
    position: absolute;
    top: 30%;
    right: 10%;
    width: 28px;
    height: 28px;
    fill: #d59182;
    animation: lulu-heart-appear 1000ms ease-out;
}

.letter-listening-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-width: 0;
    padding: 30px 26px;
}

.letter-listening-content h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -1px;
}

.listen-button {
    --action-cue-base-shadow: 0 4px 0 #2e503b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 144px;
    min-height: 64px;
    padding: 14px 22px;
    border: 0;
    border-radius: 18px;
    background: var(--green);
    color: var(--paper);
    box-shadow: 0 4px 0 #2e503b;
    font-size: 19px;
    font-weight: 750;
    cursor: pointer;
}

.listen-button .icon {
    width: 27px;
    height: 27px;
}

.listen-button:hover:not(:disabled) {
    background: var(--green-hover);
}

.listen-button:disabled {
    cursor: default;
}

.listen-button[aria-busy="true"] .icon {
    animation: listening-pulse 600ms ease-in-out infinite alternate;
}

.listening-form {
    width: 100%;
    max-width: 330px;
}

.listening-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.listening-choice {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 140px;
    padding: 20px 12px;
    border: 3px solid #dce4d4;
    border-radius: 22px;
    background: #f5f7ef;
    color: var(--green);
    font-family: Verdana, system-ui, sans-serif;
    font-size: clamp(64px, 9vw, 90px);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color 140ms, transform 140ms;
}

.listening-choice:hover:not(:disabled) {
    border-color: #a8bea0;
    transform: translateY(-3px);
}

.listening-choice:disabled {
    cursor: default;
    opacity: 1;
}

.listening-choice-glyph {
    display: block;
    width: min(100%, 110px);
    height: 110px;
    fill: none;
    stroke: currentColor;
    stroke-width: 26;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.listening-choice.is-retry {
    border-color: #bf976e;
}

.listening-choice.is-correct {
    border-color: var(--green);
    background: var(--mint);
    animation: answer-pop 420ms ease-out;
}

.listening-star {
    position: absolute;
    top: -2px;
    right: -2px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #b68b36;
    animation: letter-star 750ms ease-out;
}

.listening-star .icon {
    width: 29px;
    height: 29px;
    fill: #f4d989;
}

.listening-hint {
    min-height: 27px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    font-weight: 650;
    text-align: center;
}

[data-feedback="CORRECT"] .listening-hint {
    color: var(--green);
}

.listening-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 100%;
}

.listening-actions .secondary-button {
    padding: 14px 18px;
    white-space: nowrap;
}

.listening-form.is-submitting {
    pointer-events: none;
}

@keyframes listening-pulse {
    from { opacity: 0.55; }
    to { opacity: 1; }
}

@keyframes lulu-celebrate {
    0%, 100% { transform: none; }
    12% { transform: translateY(4px) scale(1.02, 0.98); }
    30% { transform: translateY(-16px) rotate(-4deg); }
    48% { transform: translateY(2px) scale(1.02, 0.98); }
    68% { transform: translateY(-10px) rotate(3deg); }
    86% { transform: translateY(1px); }
}

@keyframes lulu-encourage {
    0%, 100% { transform: none; }
    35% { transform: translateY(3px) rotate(2deg) scale(1.025); }
    65% { transform: translateY(1px) scale(1.025); }
}

@keyframes lulu-message-appear {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes lulu-spark-appear {
    from { opacity: 0; scale: 0.4; translate: 0 12px; }
    to { opacity: 1; scale: 1; translate: 0 0; }
}

@keyframes lulu-heart-appear {
    0% { opacity: 0; transform: translateY(12px) scale(0.6); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.1); }
    100% { opacity: 1; transform: none; }
}

@keyframes letter-star {
    0% { opacity: 0; transform: scale(0.4) rotate(-20deg); }
    65% { opacity: 1; transform: scale(1.2) rotate(8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 640px) {
    .lulu-reaction {
        width: min(100%, 230px);
        height: 156px;
        padding-top: 34px;
    }

    .letter-mentor-scene .lulu-reaction-image {
        height: 122px;
    }

    .lulu-reaction-message {
        padding: 6px 12px;
        border-radius: 14px;
        font-size: 14px;
    }

    .lulu-spark-one {
        top: 35%;
        left: 23%;
        width: 22px;
        height: 22px;
    }

    .lulu-spark-two, .lulu-reaction-heart {
        top: 42%;
        right: 20%;
        width: 18px;
        height: 18px;
    }

    .lulu-spark-three {
        right: 24%;
        bottom: 8%;
        width: 15px;
        height: 15px;
    }

    .letter-listening-content {
        gap: 20px;
        padding: 20px 24px 28px;
    }

    .listening-choice {
        min-height: 130px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .listening-choice {
        transition: none;
    }

    .listen-button[aria-busy="true"] .icon,
    .listening-choice.is-correct,
    .listening-star,
    [data-feedback] .lulu-reaction-image.is-ready,
    .lulu-reaction-message,
    .lulu-spark,
    .lulu-reaction-heart {
        animation: none;
    }

    .listening-choice:hover:not(:disabled) {
        transform: none;
    }
}
