:root{
    --syllable-gap: 0.4rem;
    --preview-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

.learning-mode-container{
    padding: 2rem;
}

.learning-option{
    text-align: center;
}

.learning-option-selectors{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.feature-container.lessons svg{
    padding-bottom: 1rem;
}

.lesson-info{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lesson-info h1{
    margin-bottom: 0;
}

.lesson-info__header{
    display: flex;
    justify-content: end;
    align-items: end;
    gap: 1em;
}

.lesson-info__header button{
    background: none;
}

.lesson-info p{
    color: var(--dark-gray);
    margin-top: 0;
}

.korean-text{
    display: inline-flex;
    position: relative;
    align-items: flex-end;
    justify-content: center;
    gap: var(--syllable-gap);
    flex-wrap: wrap;
    font-size: 2.4rem;
    line-height: 1;
    margin: 1.4rem 0;
    padding-bottom: 3.6rem;
}

.syllable{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.05em 0.4em;
    border-radius: 0.4em;
    color: var(--dark-gray);
    transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.syllable.space-syllable,
.syllable--space{
    min-width: 1.2rem;
    padding: 0 0.3rem;
    opacity: 0.4;
    transition: background-color 0.2s ease;
}

.syllable.untyped{
    opacity: 0.55;
    color: #9ca3af;
}

.syllable.next{
    color: #2563eb;
    animation: pulse 1.2s ease-in-out infinite;
}

.syllable--space.next{
    background-color: #2563eb;
    color: var(--text-inverse);
    opacity: 1;
}

.syllable--space.space-after-correct{
    background-color: #2563eb;
    color: var(--text-inverse);
    opacity: 1;
}

.syllable.correct{
    color: #10b981;
    transform: translateY(-2px);
}

.syllable.wrong{
    color: #ef4444;
    animation: shake 0.22s ease-in-out;
}

.syllable--space.wrong{
    background-color: var(--key-wrong);
    color: var(--text-inverse);
    opacity: 1;
}

.composition-preview,
#helper{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.45rem;
    color: #111827;
    margin: 0 auto 1.2rem;
    min-height: 2.2rem;
    padding: 0.45rem 1.2rem;
}

.composition-preview{
    background: rgba(255,255,255,0.95);
    border-radius: 0.65rem;
    box-shadow: var(--preview-shadow);
    pointer-events: none;
}

.composition-preview.error{
    color: #ef4444;
}

.composition-preview strong,
#helper strong{
    font-weight: 700;
}

@keyframes shake{
    0%,100%{ transform: translateX(0); }
    25%{ transform: translateX(-3px); }
    75%{ transform: translateX(3px); }
}

@keyframes pulse{
    0%,100%{ opacity: 1; transform: scale(1); }
    50%{ opacity: 0.7; transform: scale(0.97); }
}

/* Legacy helpers for keyboard highlighting */
.jamo--pending,
.korean-text__jamo.pending{
    color: var(--dark-gray);
}

.jamo--correct,
.korean-text__jamo.correct{
    color: var(--key-correct);
}

.jamo--wrong,
.korean-text__jamo.wrong{
    color: var(--key-wrong);
}

#korean-text > .korean-text__syllable{
    padding: 0;
}

.composition-preview--floating{
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
}
