.llp-widget {
    --llp-shadow: 0 10px 28px rgba(11, 30, 53, 0.11);
    margin: 1.2rem 0;
    font-family: 'Avenir Next', 'Segoe UI', sans-serif;
    color: #1f2937;
}

body.llp-has-lesson-progress {
    padding-top: var(--llp-lesson-progress-space, 72px);
}

body.llp-flashcard-fullscreen-active.llp-has-lesson-progress {
    padding-top: 0;
}

body.llp-flashcard-fullscreen-active .llp-lesson-progress {
    display: none;
}

.llp-lesson-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 10020;
    padding: 8px 12px;
    pointer-events: none;
}

.llp-lesson-progress-inner {
    max-width: 980px;
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid #d7dde7;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(4px);
    padding: 10px 12px;
    pointer-events: auto;
}

.llp-lesson-progress-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.llp-lesson-progress-title {
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
}

.llp-lesson-progress-status {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
}

.llp-lesson-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dbe6f2;
    overflow: hidden;
}

.llp-lesson-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.34s ease;
}

.llp-lesson-progress-label {
    margin: 6px 0 0;
    color: #475569;
    font-size: 12px;
}

.llp-lesson-progress.is-complete .llp-lesson-progress-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.llp-lesson-progress.is-complete .llp-lesson-progress-status,
.llp-lesson-progress.is-complete .llp-lesson-progress-label {
    color: #166534;
    font-weight: 700;
}

.llp-empty-state {
    border: 1px dashed #ccd6e1;
    border-radius: 12px;
    padding: 14px;
    background: #f8fafc;
}

.llp-course-access-notice {
    border: 1px solid #d7dde7;
    border-radius: 10px;
    padding: 18px;
    background: #f8fafc;
    box-shadow: var(--llp-shadow);
}

.llp-course-access-notice p {
    margin: 0 0 12px;
}

.llp-course-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.llp-course-access-button,
.llp-course-access-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.llp-course-access-button {
    background: #2271b1;
    color: #fff;
}

.llp-course-access-link {
    border: 1px solid #cbd5e1;
    color: #1f2937;
    background: #fff;
}

.llp-course-lessons {
    margin: 2rem 0;
}

.llp-course-lessons-list {
    display: grid;
    gap: 12px;
}

.llp-course-lesson {
    border: 1px solid #d7dde7;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
}

.llp-course-lesson h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.llp-course-lesson p {
    margin: 0;
    color: #475569;
}

.llp-my-courses {
    margin: 1.5rem 0;
}

.llp-my-courses-header {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
}

.llp-my-courses-header h2 {
    margin: 0;
}

.llp-my-courses-search {
    display: grid;
    gap: 4px;
    min-width: min(100%, 280px);
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.llp-my-courses-search input {
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

.llp-my-courses-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.llp-course-card {
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid #d7dde7;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.llp-course-card.is-hidden {
    display: none;
}

.llp-course-card-image {
    display: block;
    aspect-ratio: 16 / 9;
    background: #e2e8f0;
    overflow: hidden;
}

.llp-course-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.llp-course-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.llp-course-card-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.llp-course-card-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 9px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.llp-course-card-status--owned {
    background: #dcfce7;
    color: #166534;
}

.llp-course-card-status--locked {
    background: #fee2e2;
    color: #991b1b;
}

.llp-course-card-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.llp-course-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.llp-course-card h3 a {
    color: #0f172a;
    text-decoration: none;
}

.llp-course-card p {
    margin: 0;
    color: #475569;
}

.llp-course-card-actions {
    margin-top: auto;
}

.llp-course-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 6px;
    background: #2271b1;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.llp-course-card-button--buy {
    background: #0f766e;
}

.llp-my-courses-empty.is-hidden {
    display: none;
}

.llp-vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.llp-vocab-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.llp-vocab-toolbar button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 12px;
    cursor: pointer;
}

.llp-vocab-manage-trigger {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.llp-vocab-manage-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.llp-vocab-manage-actions.is-hidden,
.llp-vocab-manage-trigger.is-hidden,
.llp-vocab-known-empty.is-hidden {
    display: none;
}

.llp-vocab-reset-all {
    margin-left: auto;
}

.llp-vocab-button {
    border: none;
    border-radius: 14px;
    padding: 14px;
    min-height: 92px;
    text-align: center;
    background: linear-gradient(
        180deg,
        var(--llp-vocab-gradient-start, var(--llp-vocab-button-bg)),
        var(--llp-vocab-gradient-end, #1e293b)
    );
    color: var(--llp-vocab-button-text);
    box-shadow: var(--llp-shadow);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.llp-vocab-button--with-image {
    padding: 12px;
    min-height: 120px;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(86px, 200px) minmax(140px, 1fr);
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    grid-column: span 2;
}

.llp-vocab-image-wrap {
    width: 100%;
    max-width: 200px;
    max-height: 200px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.2);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.llp-vocab-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 9px;
}

.llp-vocab-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px 12px;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.llp-vocab-button--with-image .llp-vocab-word,
.llp-vocab-button--with-image .llp-vocab-phonetic,
.llp-vocab-button--with-image .llp-vocab-english {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.llp-vocab-button:hover,
.llp-vocab-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(11, 30, 53, 0.18);
}

.llp-vocab-button.is-known {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.llp-vocab-button.is-known-hidden {
    display: none;
}

.llp-vocab-known-empty {
    margin: 10px 0 0;
    color: #475569;
    font-size: 0.95rem;
}

.llp-vocab-word {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.llp-vocab-phonetic {
    display: block;
    font-size: 0.95rem;
    line-height: 1.25;
    opacity: 0.9;
    margin: 0;
}

.llp-vocab-english {
    display: block;
    font-size: 0.9rem;
    line-height: 1.3;
    opacity: 0.88;
    margin: 0;
}

.llp-gender-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.23);
}

.llp-definition-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    place-items: center;
    z-index: 9999;
    padding: 16px;
}

.llp-definition-modal[hidden] {
    display: none !important;
}

.llp-definition-modal.is-open {
    display: grid !important;
}

.llp-definition-card {
    position: relative;
    width: min(460px, 100%);
    border-radius: 14px;
    padding: 22px;
    background: var(--llp-definition-popup-bg);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.26);
    z-index: 10000;
}

.llp-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.08);
}

.llp-definition-word {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.llp-definition-text {
    margin: 0;
}

.llp-conversation-list {
    display: grid;
    gap: 10px;
}

.llp-conversation-line {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--llp-conversation-bg);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    position: relative;
}

.llp-conversation-line--has-image {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.llp-conversation-line--has-image .llp-conversation-copy {
    padding: 12px;
    background: var(--llp-conversation-bg);
}

.llp-conversation-line--male.llp-conversation-line--has-image .llp-conversation-copy {
    background: var(--llp-conversation-male-bg, var(--llp-conversation-bg));
}

.llp-conversation-line--female.llp-conversation-line--has-image .llp-conversation-copy {
    background: var(--llp-conversation-female-bg, var(--llp-conversation-bg));
}

.llp-conversation-image-wrap {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    margin: 0;
    background: #e2e8f0;
}

.llp-conversation-image {
    display: block;
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: min(300px, 42vw);
    object-fit: cover;
}

.llp-conversation-line--image-left .llp-conversation-image-wrap {
    order: 0;
}

.llp-conversation-line--image-left .llp-conversation-copy {
    order: 1;
}

.llp-conversation-line--image-right .llp-conversation-copy {
    order: 0;
}

.llp-conversation-line--image-right .llp-conversation-image-wrap {
    order: 1;
}

.llp-conversation-line.llp-conversation-line--male {
    background: var(--llp-conversation-male-bg, var(--llp-conversation-bg));
}

.llp-conversation-line.llp-conversation-line--female {
    background: var(--llp-conversation-female-bg, var(--llp-conversation-bg));
}

.llp-conversation-line.is-clickable {
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.llp-conversation-line.is-clickable:hover,
.llp-conversation-line.is-clickable:focus-within {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
}

.llp-conversation-line.is-clickable:focus-visible {
    outline: 2px solid rgba(29, 78, 216, 0.55);
    outline-offset: 2px;
}

.llp-conversation-copy {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding-right: 82px;
    position: relative;
}

.llp-conversation-play-trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    background: var(--llp-conversation-play-button-bg, #236736);
    color: #fff;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.llp-conversation-play-trigger:hover,
.llp-conversation-play-trigger:focus-visible {
    filter: brightness(0.92);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.llp-conversation-play-trigger:active {
    transform: scale(0.98);
}

.llp-play-icon {
    position: relative;
    display: block;
    width: 14px;
    height: 16px;
}

.llp-play-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid currentColor;
}

.llp-conversation-play-trigger.is-paused .llp-play-icon::before {
    width: 4px;
    height: 16px;
    border: 0;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 8px 0 0 currentColor;
}

.llp-language-text {
    margin: 0;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.25;
}

.llp-english-text {
    margin: 2px 0 0;
    opacity: 0.88;
    font-size: 1.55rem;
}

.llp-phonetic-text {
    margin: 2px 0 0;
    opacity: 0.82;
    font-style: italic;
    font-size: 1.05rem;
}

.llp-language-token {
    border-radius: 6px;
    transition: background-color 0.12s ease, color 0.12s ease;
    padding: 0 1px;
    cursor: inherit;
}

.llp-language-token.is-selected-range {
    background: rgba(249, 115, 22, 0.22);
    color: #0f172a;
}

.llp-language-token.llp-conversation-vocab-term {
    color: var(--llp-conversation-word-accent, var(--llp-accent-color, #1d4ed8));
    font-weight: 700;
    position: relative;
}

.llp-language-token.llp-conversation-vocab-term:hover::after,
.llp-language-token.llp-conversation-vocab-term:focus-visible::after {
    content: attr(data-definition);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 140px;
    max-width: min(360px, 82vw);
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.86rem;
    line-height: 1.3;
    text-align: center;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.28);
    z-index: 30;
    white-space: normal;
    pointer-events: none;
}

.llp-language-token.llp-conversation-vocab-term:hover::before,
.llp-language-token.llp-conversation-vocab-term:focus-visible::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #0f172a;
    z-index: 31;
}

.llp-language-token.is-speaking {
    background: rgba(29, 78, 216, 0.2);
    color: #0f172a;
}

.llp-conversation-waveform {
    margin-top: 10px;
    width: 100%;
    height: 58px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
    cursor: crosshair;
    position: relative;
    touch-action: none;
    user-select: none;
}

.llp-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.llp-conversation-line.is-playing .llp-conversation-waveform {
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.35);
}

.llp-flashcard-widget {
    --llp-study-font: "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Khmer", "Noto Sans Lao", "Noto Sans Myanmar", "Noto Sans Ethiopic", "Noto Sans Georgian", "Noto Sans Armenian", "Noto Sans CJK SC", "Noto Sans CJK TC", "Noto Sans CJK JP", "Noto Sans CJK KR", system-ui, -apple-system, "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Helvetica Neue", Arial, sans-serif;
    max-width: 900px;
    margin: 24px auto;
}

.llp-flashcard-frame {
    border: 1px solid #dcdcde;
    border-radius: 14px;
    padding: 20px;
    background: linear-gradient(180deg, #fbfbfc 0%, var(--llp-flashcard-bg) 100%);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    perspective: 1200px;
}

.llp-flashcard-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 20%, rgba(34, 113, 177, 0.12), transparent 55%);
}

.llp-srs-header,
.llp-flashcard-definition,
.llp-srs-prompt,
.llp-srs-options,
.llp-srs-spelling,
.llp-flashcard-controls,
.llp-flashcard-feedback {
    position: relative;
    z-index: 1;
}

.llp-srs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #50575e;
}

.llp-srs-header-main {
    display: grid;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 180px;
}

.llp-srs-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.llp-srs-stage,
.llp-flashcard-counter {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.llp-srs-stage {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #f0f2f4;
    color: #1d2327;
    white-space: nowrap;
}

.llp-srs-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e9ef;
    overflow: hidden;
    position: relative;
}

.llp-srs-progress-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.3s ease;
}

.llp-fullscreen {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #1d2327;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.llp-fullscreen:active {
    transform: scale(0.98);
}

.llp-flashcard-definition {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.llp-flashcard-image-wrap {
    margin: 0 0 12px;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    background: #f8fafc;
    padding: 6px;
    width: fit-content;
    max-width: min(100%, 320px);
}

.llp-flashcard-image-wrap.is-hidden {
    display: none;
}

.llp-flashcard-image {
    display: block;
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 9px;
}

.llp-srs-prompt {
    margin-bottom: 12px;
    min-height: 26px;
}

.llp-srs-hint {
    margin: 0;
    color: #50575e;
    font-size: 14px;
}

.llp-srs-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 12px;
}

.llp-option-button {
    font-family: var(--llp-study-font);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 32px;
    line-height: 1.3;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.llp-option-button:hover {
    border-color: #2271b1;
}

.llp-option-button.is-selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
    transform: translateY(-1px);
}

.llp-option-button.is-incorrect,
.llp-option-button.is-incorrect:hover,
.llp-option-button.is-incorrect:focus-visible,
.llp-option-button.is-incorrect.is-selected {
    color: #b32d2e;
    border-color: #e07a7a;
    background: rgba(211, 47, 47, 0.08);
    box-shadow: 0 0 0 2px rgba(179, 45, 46, 0.16);
}

.llp-srs-spelling {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.llp-spell-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.llp-spell-slot {
    min-width: 26px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px dashed #c3c4c7;
    border-radius: 6px;
    font-family: var(--llp-study-font);
    font-size: 34px;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.llp-spell-slot.is-space {
    border: none;
    min-width: 12px;
    padding: 6px 0;
}

.llp-spell-slot.is-reveal-correct {
    color: #1d7f3c;
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.14);
    animation: llp-spell-reveal 0.24s ease;
}

.llp-spell-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.llp-keyboard-key {
    font-family: var(--llp-study-font);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d0d4d8;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    font-size: 28px;
    line-height: 1.2;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.llp-keyboard-key:active {
    transform: scale(0.98);
}

.llp-keyboard-key.is-used {
    opacity: 0.4;
    background: #e9edf1;
    color: #7a828a;
    border-color: #c3c8cf;
}

.llp-spell-tools {
    display: flex;
    gap: 8px;
}

.llp-spell-tools button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

.llp-spell-result {
    min-height: 20px;
}

.llp-spell-attempt-wrong {
    margin: 2px 0 0;
    color: #b32d2e;
    font-size: 0.88rem;
    line-height: 1.35;
}

.llp-flashcard-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.llp-flashcard-controls button {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: #1d2327;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.llp-flashcard-controls button:hover {
    background: #2271b1;
}

.llp-flashcard-controls button:active {
    transform: scale(0.98);
}

.llp-flashcard-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.llp-flashcard-controls button.is-hidden {
    display: none;
}

.llp-flashcard-feedback {
    margin-top: 12px;
    font-weight: 600;
    min-height: 20px;
}

.llp-flashcard-feedback.is-correct {
    color: #1d7f3c;
}

.llp-flashcard-feedback.is-wrong {
    color: #b32d2e;
}

.llp-flashcard-stats {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e4e7;
    background: #f9fafb;
    min-height: 100%;
    box-sizing: border-box;
}

.llp-flashcard-inner {
    position: relative;
    min-height: 360px;
}

.llp-flashcard-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.llp-flashcard-front {
    --llp-front-scale: 1;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(var(--llp-front-scale));
    transform-origin: top center;
}

.llp-flashcard-back {
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    overflow-y: auto;
}

.llp-flashcard-frame.is-flipped .llp-flashcard-front {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px) scale(var(--llp-front-scale));
}

.llp-flashcard-frame.is-flipped .llp-flashcard-back {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.llp-flashcard-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.llp-flashcard-stats-title {
    margin: 0;
    font-size: 1.1rem;
}

.llp-flashcard-stats-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.llp-flashcard-stats-actions button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.llp-flashcard-stats-actions button:active {
    transform: scale(0.98);
}

.llp-flashcard-stats-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.llp-stat-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.llp-stat-label {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.llp-stat-value {
    font-size: 19px;
    font-weight: 700;
    color: #1d2327;
}

.llp-flashcard-stats-search-wrap {
    margin-bottom: 10px;
}

.llp-flashcard-stats-search {
    width: 100%;
    max-width: 360px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d0d4d8;
    background: #fff;
    font-size: 13px;
}

.llp-flashcard-stats-list {
    display: grid;
    gap: 10px;
}

.llp-flashcard-stats-row {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e4e7;
    background: #fff;
    display: grid;
    gap: 8px;
}

.llp-flashcard-stats-main {
    min-width: 0;
}

.llp-flashcard-stats-word {
    font-family: var(--llp-study-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: #1d2327;
}

.llp-flashcard-stats-definition {
    font-size: 0.92rem;
    color: #5b6672;
}

.llp-flashcard-stats-meta {
    font-size: 12px;
    color: #6b7280;
}

.llp-flashcard-stats-bar {
    position: relative;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #d7dde5;
    background: #eef2f6;
    overflow: hidden;
}

.llp-flashcard-stats-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2271b1, #54a3f3);
    transition: width 0.3s ease;
}

.llp-flashcard-stats-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #1d2327;
    font-weight: 600;
}

.llp-flashcard-stats-empty {
    margin: 0;
    padding: 10px 0 2px;
    color: #6b7280;
    font-size: 13px;
}

.llp-flashcard-stats-empty.is-hidden {
    display: none;
}

.llp-flashcard-frame:fullscreen,
.llp-flashcard-frame:-webkit-full-screen,
.llp-flashcard-frame.is-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.llp-flashcard-frame.is-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
    overflow: hidden;
    z-index: 9999;
    background: linear-gradient(180deg, #fbfbfc 0%, var(--llp-flashcard-bg) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.llp-flashcard-frame:fullscreen .llp-flashcard-inner,
.llp-flashcard-frame:-webkit-full-screen .llp-flashcard-inner,
.llp-flashcard-frame.is-fullscreen .llp-flashcard-inner,
.llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-inner {
    width: min(980px, 100%);
    margin: 0 auto;
}

body.llp-pseudo-lock {
    overflow: hidden;
}

.llp-word-order-widget {
    max-width: 900px;
    margin: 24px auto;
}

.llp-word-order-english {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
}

.llp-word-order-image-wrap {
    margin: 0 0 10px;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    background: #f8fafc;
    padding: 6px;
    width: fit-content;
    max-width: min(100%, 420px);
}

.llp-word-order-image-wrap.is-hidden {
    display: none;
}

.llp-word-order-image {
    display: block;
    max-width: 100%;
    max-height: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 9px;
}

.llp-word-order-instruction {
    margin: 0 0 12px;
}

.llp-word-order-target,
.llp-word-order-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 10px;
    min-height: 64px;
    padding: 10px;
    margin-bottom: 10px;
}

.llp-word-order-target {
    border: 1px dashed #94a3b8;
    background: #f8fafc;
}

.llp-word-order-bank {
    border: 1px solid #d0d7e2;
    background: #fff;
}

.llp-word-order-placeholder {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.llp-word-order-token {
    font-family: var(--llp-study-font);
    border: 1px solid #d0d4d8;
    border-radius: 999px;
    background: #fff;
    color: #1d2327;
    padding: 8px 14px;
    line-height: 1.2;
    font-size: 1.15rem;
    cursor: grab;
    transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.llp-word-order-token:hover {
    border-color: #2271b1;
}

.llp-word-order-token:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.llp-word-order-token.is-answer {
    background: #eef4ff;
    border-color: #bcd0ef;
}

.llp-word-order-token.is-dragging {
    opacity: 0.55;
}

.llp-word-order-controls {
    margin-top: 6px;
}

.llp-srs-options,
.llp-srs-spelling,
.llp-flashcard-controls,
.llp-flashcard-feedback {
    animation: llp-fade-up 0.25s ease;
}

@keyframes llp-fade-up {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes llp-spell-reveal {
    from {
        opacity: 0.4;
        transform: translateY(4px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .llp-lesson-progress {
        padding: 6px 8px;
    }

    .llp-lesson-progress-inner {
        padding: 8px 10px;
    }

    .llp-lesson-progress-title,
    .llp-lesson-progress-status {
        font-size: 12px;
    }

    .llp-lesson-progress-track {
        height: 9px;
    }

    .llp-vocab-toolbar {
        align-items: stretch;
    }

    .llp-vocab-reset-all {
        margin-left: 0;
    }

    .llp-conversation-line {
        flex-direction: column;
        align-items: stretch;
    }

    .llp-conversation-line--has-image {
        flex-direction: row;
    }

    .llp-conversation-controls {
        width: 100%;
        justify-content: space-between;
    }

    .llp-conversation-image {
        max-width: min(44vw, 180px);
    }

    .llp-vocab-button--with-image {
        min-height: 104px;
        grid-column: span 1;
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 10px;
    }

    .llp-vocab-image-wrap {
        width: min(100%, 110px);
        max-width: 110px;
        max-height: 110px;
    }

    .llp-vocab-text-wrap {
        align-items: center;
        text-align: center;
        padding: 10px 10px 12px;
    }

    .llp-flashcard-frame {
        padding: 16px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen {
        padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    }

    .llp-flashcard-definition {
        font-size: 20px;
    }

    .llp-word-order-english {
        font-size: 18px;
    }

    .llp-word-order-token {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .llp-option-button {
        font-size: clamp(20px, 6.2vw, 30px);
    }

    .llp-keyboard-key {
        font-size: clamp(18px, 6vw, 28px);
        padding: 10px 12px;
    }

    .llp-spell-slot {
        font-size: clamp(18px, 6vw, 28px);
        min-height: 34px;
    }

    .llp-flashcard-controls {
        width: 100%;
    }

    .llp-srs-header {
        align-items: flex-start;
    }

    .llp-srs-header-main {
        min-width: 120px;
    }

    .llp-srs-header-actions {
        justify-content: flex-end;
    }

    .llp-fullscreen {
        font-size: 14px;
        padding: 8px 14px;
    }

    .llp-flashcard-inner {
        min-height: 360px;
    }

    .llp-flashcard-stats {
        padding: 14px;
    }

    .llp-flashcard-stats-actions button {
        font-size: 12px;
        padding: 7px 12px;
    }

    .llp-flashcard-stats-search {
        max-width: none;
    }
}

/* =====================================================
   MOBILE PSEUDO-FULLSCREEN OVERHAUL
   All rules are narrower-specificity than the base
   pseudo-fullscreen block, so they safely override.
   Desktop fullscreen (> 768px) is never touched.
   ===================================================== */
@media (max-width: 768px) {

    /* 1. Frame: stack from top, stretch inner to fill width */
    .llp-flashcard-frame.is-pseudo-fullscreen {
        justify-content: flex-start;
        align-items: stretch;
    }

    /*
     * 2. Inner: grow to fill all available height inside the frame.
     *    The frame is already display:flex flex-direction:column with
     *    height:100dvh and padding.  Setting flex:1 makes the inner
     *    occupy every pixel not consumed by that padding so the
     *    absolutely-positioned faces are as tall as the viewport.
     */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-inner {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
        width: 100%;
    }

    /*
     * 3. Front face: make it scrollable.
     *    position/inset/transition are unchanged (kept absolute) so
     *    the flip animation to the stats panel still works.
     */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-front {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        display: flex;
        flex-direction: column;
        touch-action: pan-y;
    }

    /*
     * 4. Front inner: flex column so margin-top:auto on controls
     *    pushes them to the bottom when there is spare space.
     */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-front-inner {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100%;
        padding-bottom: 4px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-definition,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-prompt,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-options,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-spelling,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls,
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-feedback {
        flex-shrink: 0;
    }

    /* 5. Header: two rows so the action buttons never get clipped */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 8px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header-main {
        width: 100%;
        min-width: 0;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* 6. Action buttons: compact so all three fit on one line */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-stage {
        font-size: 10px;
        padding: 3px 8px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-fullscreen {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* 7. Definition: slightly tighter */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-definition {
        font-size: 17px;
        margin-bottom: 8px;
    }

    /* 8. Image: constrained so it doesn't dominate the screen */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-image-wrap {
        max-width: min(100%, 200px);
        margin-bottom: 8px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-image {
        max-height: 130px;
    }

    /* 9. Reference / option buttons: smaller Thai text */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-option-button {
        font-size: clamp(16px, 5vw, 22px);
        padding: 8px 12px;
    }

    /* 10. Prompt area: tighter */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-prompt {
        margin-bottom: 8px;
    }

    /* 11. Spelling area: tighter gaps */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-spelling {
        gap: 8px;
        margin-bottom: 8px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-spell-slots {
        gap: 4px;
    }

    /* 12. Spell slots: smaller Thai characters */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-spell-slot {
        font-size: clamp(14px, 4.5vw, 20px);
        min-height: 24px;
        min-width: 20px;
        padding: 5px 7px;
    }

    .llp-flashcard-frame.is-pseudo-fullscreen .llp-spell-bank {
        gap: 6px;
    }

    /* 13. Keyboard keys: smaller but still tappable */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-keyboard-key {
        font-size: clamp(14px, 4.5vw, 20px);
        padding: 8px 10px;
    }

    /*
     * 14. Controls: pushed to bottom of the flex column.
     *     position:sticky ensures they stay visible at the bottom
     *     of the scroll container even when the user scrolls up.
     *     The gradient fade masks the content edge cleanly.
     */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls {
        margin-top: auto;
        position: sticky;
        bottom: 0;
        padding-top: 10px;
        padding-bottom: 2px;
        background: linear-gradient(
            to top,
            var(--llp-flashcard-bg, #f8f9fa) 70%,
            transparent
        );
        width: 100%;
    }

    /* 15. Feedback: tighter */
    .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-feedback {
        margin-top: 6px;
    }
}

/* ============================================================
   GAME FEEDBACK & LEVEL SYSTEM (shared across all LLP pages)
   ============================================================ */

/* Card entrance animation */
.llp-flashcard-front.llp-card-enter {
    animation: llp-card-enter .32s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes llp-card-enter {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Feedback animations */
.llp-flashcard-feedback.is-correct {
    animation: llp-correct-pop .35s ease;
}
.llp-flashcard-feedback.is-wrong {
    animation: llp-wrong-shake .4s ease;
}
@keyframes llp-correct-pop {
    0%   { transform: scale(.93); }
    55%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}
@keyframes llp-wrong-shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-8px); }
    40%     { transform: translateX(8px); }
    60%     { transform: translateX(-5px); }
    80%     { transform: translateX(5px); }
}

/* ── Streak badge ──────────────────────────────────────────── */
.llp-streak-badge {
    align-items: center;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    gap: 4px;
    margin-top: 5px;
    padding: 3px 9px;
}
.llp-streak-badge.llp-streak-pop {
    animation: llp-streak-pop .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes llp-streak-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}

/* ── Level display ─────────────────────────────────────────── */
.llp-level-display {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.llp-level-badge {
    align-items: center;
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 900;
    height: 28px;
    justify-content: center;
    width: 28px;
}
.llp-level-info {
    align-items: center;
    display: flex;
    flex: 1;
    gap: 6px;
    min-width: 0;
}
.llp-level-title {
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
}
.llp-xp-track {
    background: rgba(0,0,0,.1);
    border-radius: 999px;
    flex: 1;
    height: 5px;
    min-width: 30px;
    overflow: hidden;
}
.llp-xp-fill {
    border-radius: 999px;
    height: 100%;
    transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.llp-xp-text {
    font-size: .65rem;
    font-weight: 700;
    opacity: .6;
    white-space: nowrap;
}

/* ── XP float ──────────────────────────────────────────────── */
.llp-xp-float {
    animation: llp-xp-float .75s ease forwards;
    font-size: .95rem;
    font-weight: 800;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 40%;
    transform: translateX(-50%);
    z-index: 10;
}
@keyframes llp-xp-float {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(.9); }
    60%  { opacity: 1; transform: translateX(-50%) translateY(-36px) scale(1.1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1); }
}

/* ── Particles ─────────────────────────────────────────────── */
.llp-particle {
    animation: llp-particle .7s ease forwards;
    border-radius: 50%;
    height: 8px;
    pointer-events: none;
    position: absolute;
    width: 8px;
    z-index: 10;
}
@keyframes llp-particle {
    0%   { opacity: 1; transform: translate(0,0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx),var(--ty)) rotate(var(--r)) scale(0); }
}

/* ── Level-up overlay ──────────────────────────────────────── */
.llp-levelup-overlay {
    align-items: center;
    animation: llp-lvl-in .4s ease both;
    border-radius: inherit;
    bottom: 0; left: 0; right: 0; top: 0;
    display: flex;
    justify-content: center;
    pointer-events: all;
    position: absolute;
    z-index: 200;
}
.llp-levelup-overlay.llp-levelup-exit { animation: llp-lvl-out .35s ease forwards; }
@keyframes llp-lvl-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes llp-lvl-out { from { opacity: 1; } to { opacity: 0; } }
.llp-levelup-box {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    text-align: center;
}
.llp-levelup-badge {
    align-items: center;
    animation: llp-badge-pop .65s cubic-bezier(.34,1.56,.64,1) .1s both;
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 2.6rem;
    font-weight: 900;
    height: 100px;
    justify-content: center;
    width: 100px;
}
@keyframes llp-badge-pop {
    from { opacity: 0; transform: scale(0) rotate(-180deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.llp-levelup-headline {
    animation: llp-slide-up .45s ease .3s both;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: .04em;
}
.llp-levelup-subtitle {
    animation: llp-slide-up .45s ease .42s both;
    font-size: 1.05rem;
    font-weight: 700;
}
.llp-levelup-dismiss {
    animation: llp-slide-up .45s ease .55s both;
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 700;
    margin-top: 4px;
    padding: 11px 28px;
    transition: opacity .15s;
}
.llp-levelup-dismiss:hover { opacity: .85; }
@keyframes llp-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Settings panel (used on all pages via llpOpenSettingsPanel) */
.llp-settings-overlay {
    background: rgba(0,0,0,.45);
    bottom: 0; left: 0; right: 0; top: 0;
    position: fixed;
    z-index: 9998;
}
.llp-settings-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
    left: 50%;
    max-width: 420px;
    padding: 22px;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    z-index: 9999;
}
.llp-gs-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.llp-gs-header h3 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.llp-gs-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.15rem;
    height: 30px;
    line-height: 1;
    width: 30px;
}
.llp-gs-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 12px 14px;
}
.llp-gs-label { font-weight: 700; }
.llp-gs-desc  { color: #64748b; font-size: .8rem; margin: 2px 0 0; }
.llp-gs-toggle {
    background: #e2e8f0;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    display: block;
    flex-shrink: 0;
    height: 26px;
    position: relative;
    transition: background .2s;
    width: 48px;
}
.llp-gs-toggle input { height: 0; opacity: 0; position: absolute; width: 0; }
.llp-gs-toggle-knob {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    height: 18px;
    left: 3px;
    position: absolute;
    top: 2px;
    transition: transform .2s;
    width: 18px;
}
.llp-gs-toggle.is-on { background: #6366f1; }
.llp-gs-toggle.is-on .llp-gs-toggle-knob { transform: translateX(22px); }

/* ============================================================
   NEW GAME STAGES — structural CSS (theming applied separately)
   ============================================================ */

/* ── Big speaker button (Sound Match + Listening Dictation) ── */
.llp-speaker-center {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0 6px;
}

.llp-speaker-center--image {
    width: 100%;
}

.llp-speaker-big {
    align-items: center;
    background: var(--llp-accent-color, #1f7a8c);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 92px;
    justify-content: center;
    transition: transform .15s, opacity .15s;
    width: 92px;
}

.llp-speaker-big:hover { opacity: .88; transform: scale(1.06); }

.llp-speaker-big.is-playing {
    animation: llp-speaker-pulse 1s ease infinite;
}

.llp-audio-image-prompt {
    background: #f8fafc;
    border: 1px solid #d7dde5;
    border-radius: 16px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    max-width: min(100%, 340px);
    overflow: hidden;
    padding: 6px;
    position: relative;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    width: fit-content;
}

.llp-audio-image-prompt:hover,
.llp-audio-image-prompt.is-playing {
    border-color: #2271b1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
    transform: translateY(-1px);
}

.llp-audio-image-prompt img {
    border-radius: 11px;
    display: block;
    height: auto;
    max-height: 240px;
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.llp-audio-image-badge {
    align-items: center;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 999px;
    bottom: 12px;
    color: #fff;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    left: 12px;
    position: absolute;
    width: 38px;
}

.llp-audio-image-badge svg {
    height: 20px;
    width: 20px;
}

@keyframes llp-speaker-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

.llp-speaker-label {
    color: inherit;
    font-size: .82rem;
    margin: 0;
    opacity: .6;
}

/* ── Self-Rate revealed word ─────────────────────────────────── */
.llp-self-rate-word {
    font-size: 2.2rem;
    font-weight: 900;
    padding: 16px 0 8px;
    text-align: center;
}

/* ── Reverse Quiz — definition-text option buttons ──────────── */
.llp-option-def {
    font-size: .9rem;
    line-height: 1.4;
    min-height: 60px;
    padding: 10px 14px;
    text-align: left;
    white-space: normal;
}

/* ── Pair Match ──────────────────────────────────────────────── */
.llp-pair-match {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin: 0 auto;
    max-width: 760px;
    padding: 4px 4px 12px;
    width: 100%;
}

.llp-pair-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.llp-pair-item {
    align-items: center;
    border: 1.5px solid;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    font-size: 1.05rem;
    font-weight: 700;
    justify-content: center;
    min-height: 58px;
    padding: 10px 12px;
    text-align: center;
    transition: transform .1s, opacity .15s;
}

.llp-pair-def {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
}

.llp-pair-item:hover    { transform: scale(1.03); }
.llp-pair-item.is-selected { outline: 2px solid currentColor; }
.llp-pair-item.is-matched { animation: llp-pair-match-pop .35s ease; cursor: default; }
.llp-pair-item.is-error   { animation: llp-pair-shake .4s ease; }

@keyframes llp-pair-match-pop {
    0%   { transform: scale(.94); }
    55%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

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

/* ── Speed Round timer ───────────────────────────────────────── */
.llp-speed-wrap {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 4px 0;
}

.llp-speed-bar {
    background: rgba(0,0,0,.1);
    border-radius: 999px;
    flex: 1;
    height: 8px;
    overflow: hidden;
}

.llp-speed-fill {
    background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
    border-radius: 999px;
    height: 100%;
    transition: width .06s linear;
}

.llp-speed-label {
    font-size: .82rem;
    font-weight: 800;
    min-width: 24px;
    opacity: .7;
    text-align: right;
}

/* ── Context Fill — English translation hint ─────────────────── */
.llp-context-en {
    font-size: .82rem;
    font-style: italic;
    margin: 4px 0 0;
    opacity: .6;
    text-align: center;
}

/* ── Default colours for non-dark-theme pages ────────────────── */
.llp-level-badge      { background: var(--llp-accent-color, #1f7a8c); }
.llp-xp-fill          { background: var(--llp-accent-color, #1f7a8c); }
.llp-xp-float         { color: var(--llp-accent-color, #1f7a8c); }
.llp-streak-badge     { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.llp-streak-badge.is-hot { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.llp-levelup-overlay  { background: rgba(255,255,255,.88); backdrop-filter: blur(8px); }
.llp-levelup-badge    { background: var(--llp-accent-color, #1f7a8c); box-shadow: 0 0 40px rgba(31,122,140,.45); }
.llp-levelup-headline { color: var(--llp-accent-color, #1f7a8c); }
.llp-levelup-subtitle { color: #374151; }
.llp-levelup-dismiss  { background: var(--llp-accent-color, #1f7a8c); box-shadow: 0 4px 14px rgba(31,122,140,.4); }
.llp-speed-bar        { background: rgba(0,0,0,.08); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 540px) {
    .llp-pair-item { font-size: .95rem; min-height: 50px; }
    .llp-pair-def  { font-size: .78rem; }
    .llp-speaker-big { height: 78px; width: 78px; }
    .llp-self-rate-word { font-size: 1.8rem; }
}

/* ============================================================
   Shared flashcard game theme
   ============================================================ */

.llp-flashcard-game {
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: visible;
}

.llp-flashcard-game .llp-flashcard-frame {
    background: linear-gradient(155deg, #0d1117 0%, #161b2e 45%, #0d1117 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.15), 0 30px 60px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
    overflow: hidden;
}

.llp-flashcard-game .llp-flashcard-frame::after {
    background:
        radial-gradient(circle at 20% 12%, rgba(34, 211, 238, 0.16), transparent 34%),
        radial-gradient(circle at 80% 0%, rgba(99, 102, 241, 0.16), transparent 36%);
}

.llp-flashcard-game .llp-flashcard-frame:fullscreen,
.llp-flashcard-game .llp-flashcard-frame:-webkit-full-screen,
.llp-flashcard-game .llp-flashcard-frame.is-fullscreen,
.llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen {
    background: linear-gradient(155deg, #0d1117 0%, #161b2e 45%, #0d1117 100%);
}

.llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls {
    background: linear-gradient(to top, #0d1117 70%, rgba(13, 17, 23, 0));
}

.llp-flashcard-game .llp-srs-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 12px;
    padding: 12px 18px;
}

.llp-flashcard-game .llp-flashcard-counter {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.llp-flashcard-game .llp-srs-progress-bar,
.llp-flashcard-game .llp-xp-track,
.llp-flashcard-game .llp-speed-bar,
.llp-flashcard-game .llp-flashcard-stats-bar {
    background: rgba(255, 255, 255, 0.08);
}

.llp-flashcard-game .llp-srs-progress-fill {
    background: linear-gradient(90deg, #6366f1, #22d3ee, #34d399);
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    transition: width 0.4s ease;
}

.llp-flashcard-game .llp-srs-stage {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 999px;
    color: #c7d2fe;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 3px 11px;
    text-transform: uppercase;
}

.llp-flashcard-game .llp-fullscreen,
.llp-flashcard-game .llp-flashcard-stats-actions button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.llp-flashcard-game .llp-fullscreen:hover,
.llp-flashcard-game .llp-flashcard-stats-actions button:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
}

.llp-flashcard-game .llp-settings-btn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.llp-flashcard-game .llp-settings-btn:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
    color: #fde68a;
}

.llp-flashcard-game .llp-theme-toggle {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 40px;
    padding-left: 0;
    padding-right: 0;
}

.llp-flashcard-game .llp-theme-toggle-icon {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
}

.llp-flashcard-game .llp-flashcard-definition {
    color: #e2e8f0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.55;
    margin: 0;
    padding: 30px 28px 10px;
    text-align: center;
}

.llp-flashcard-game .llp-flashcard-image-wrap {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0 auto 12px;
}

.llp-flashcard-game .llp-srs-hint,
.llp-flashcard-game .llp-speaker-label,
.llp-flashcard-game .llp-context-en {
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
}

.llp-flashcard-game .llp-srs-prompt {
    text-align: center;
}

.llp-flashcard-game .llp-srs-options {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0;
    padding: 4px 24px 16px;
}

.llp-flashcard-game .llp-option-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #f1f5f9;
    cursor: pointer;
    font-size: 1.55rem;
    font-weight: 800;
    min-height: 80px;
    padding: 16px 12px;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.llp-flashcard-game .llp-option-def {
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
}

.llp-flashcard-game .llp-option-button:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: #6366f1;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.llp-flashcard-game .llp-option-button.is-selected {
    background: rgba(99, 102, 241, 0.3);
    border-color: #818cf8;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.llp-flashcard-game .llp-option-button:disabled {
    opacity: 0.7;
}

.llp-flashcard-game .llp-word-option {
    align-items: center;
    display: flex;
    font-size: 2rem;
    grid-column: 1 / -1;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    min-height: 100px;
    min-width: min(240px, 100%);
    width: fit-content;
}

.llp-flashcard-game .llp-srs-prompt .llp-word-option {
    max-width: min(100%, 420px);
}

.llp-flashcard-game .llp-typing-error-word {
    color: #fca5a5;
}

.llp-flashcard-game .llp-typing-error-word span {
    display: inline-block;
}

.llp-flashcard-game .llp-typing-error-letter {
    background: rgba(239, 68, 68, 0.32);
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.4);
    color: #fee2e2;
    padding: 0 0.08em;
}

.llp-flashcard-game .llp-option-button.is-correct,
.llp-flashcard-game .llp-pair-item.is-matched {
    animation: stnld-pop 0.35s ease;
    background: rgba(34, 197, 94, 0.25) !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 22px rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.llp-flashcard-game .llp-option-button.is-incorrect,
.llp-flashcard-game .llp-pair-item.is-error {
    animation: stnld-shake 0.4s ease;
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #fca5a5;
}

.llp-flashcard-game .llp-speaker-big {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 0 35px rgba(8, 145, 178, 0.55);
}

.llp-flashcard-game .llp-speaker-big:hover {
    box-shadow: 0 0 50px rgba(8, 145, 178, 0.75);
}

.llp-flashcard-game .llp-speaker-big.is-playing {
    box-shadow: 0 0 60px rgba(8, 145, 178, 0.9);
}

.llp-flashcard-game .llp-audio-image-prompt {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.llp-flashcard-game .llp-audio-image-prompt:hover,
.llp-flashcard-game .llp-audio-image-prompt.is-playing {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 32px rgba(8, 145, 178, 0.35);
}

.llp-flashcard-game .llp-self-rate-word {
    color: #f1f5f9;
    font-size: 2.4rem;
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
    width: 100%;
}

.llp-flashcard-game .llp-pair-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.llp-flashcard-game .llp-pair-match {
    grid-column: 1 / -1;
    justify-self: center;
}

.llp-flashcard-game .llp-pair-item:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

.llp-flashcard-game .llp-pair-item.is-selected {
    background: rgba(99, 102, 241, 0.3);
    border-color: #818cf8;
    outline: none;
}

.llp-flashcard-game .llp-speed-label {
    color: #94a3b8;
}

.llp-flashcard-game .llp-spell-slots {
    justify-content: center;
    padding: 12px 24px 4px;
}

.llp-flashcard-game .llp-spell-slot {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 1.4rem;
    font-weight: 800;
    min-height: 52px;
    min-width: 44px;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}

.llp-flashcard-game .llp-spell-slot.is-filled {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

.llp-flashcard-game .llp-spell-slot.is-reveal-correct,
.llp-flashcard-game .llp-spell-slot.is-correct {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #86efac;
}

.llp-flashcard-game .llp-spell-slot.is-wrong {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

.llp-flashcard-game .llp-spell-bank {
    justify-content: center;
    padding: 8px 24px;
}

.llp-flashcard-game .llp-keyboard-key {
    background: rgba(99, 102, 241, 0.15);
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    border-radius: 10px;
    color: #c7d2fe;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 800;
    min-width: 44px;
    padding: 10px 12px;
    text-align: center;
    transition: background 0.12s, transform 0.1s;
}

.llp-flashcard-game .llp-keyboard-key:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(1.08);
}

.llp-flashcard-game .llp-keyboard-key.is-used {
    opacity: 0.35;
}

.llp-flashcard-game .llp-spell-tools {
    justify-content: center;
}

.llp-flashcard-game .llp-spell-tools button {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #94a3b8;
}

.llp-flashcard-game .llp-flashcard-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 14px 24px 18px;
}

.llp-flashcard-game .llp-flashcard-controls button {
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 12px 28px;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

.llp-flashcard-game .llp-flashcard-controls button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.llp-flashcard-game .llp-flashcard-controls [data-action="primary"] {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.5);
    color: #fff;
}

.llp-flashcard-game .llp-flashcard-controls [data-action="secondary"] {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #94a3b8;
}

.llp-flashcard-game .llp-flashcard-controls [data-action="reset"] {
    background: rgba(239, 68, 68, 0.1);
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.llp-flashcard-game .llp-flashcard-feedback {
    border-radius: 12px;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 800;
    margin: 0 24px 16px;
    min-height: 2em;
    padding: 10px 18px;
    text-align: center;
    transition: background 0.2s;
}

.llp-flashcard-game .llp-flashcard-feedback.is-correct {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.llp-flashcard-game .llp-flashcard-feedback.is-wrong {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.llp-flashcard-game .llp-flashcard-back,
.llp-flashcard-game .llp-flashcard-stats {
    background: #0d1117;
}

.llp-flashcard-game .llp-flashcard-stats {
    border: none;
    border-radius: 20px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.llp-flashcard-game .llp-flashcard-stats-header {
    margin-bottom: 0;
}

.llp-flashcard-game .llp-flashcard-stats-title {
    color: #f1f5f9;
    font-size: 1.15rem;
    font-weight: 800;
}

.llp-flashcard-game .llp-flashcard-stats-metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 0;
}

.llp-flashcard-game .llp-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    text-align: center;
}

.llp-flashcard-game .llp-stat-label {
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.llp-flashcard-game .llp-stat-value {
    color: #e2e8f0;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
}

.llp-flashcard-game .llp-stat-card:nth-child(1) .llp-stat-value { color: #34d399; }
.llp-flashcard-game .llp-stat-card:nth-child(2) .llp-stat-value { color: #f87171; }
.llp-flashcard-game .llp-stat-card:nth-child(3) .llp-stat-value { color: #60a5fa; }
.llp-flashcard-game .llp-stat-card:nth-child(5) .llp-stat-value { color: #a78bfa; }

.llp-flashcard-game .llp-flashcard-stats-search {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-sizing: border-box;
    color: #e2e8f0;
    font-size: 0.88rem;
    max-width: none;
    outline: none;
    padding: 9px 14px;
    transition: border-color 0.15s;
    width: 100%;
}

.llp-flashcard-game .llp-flashcard-stats-search::placeholder {
    color: #475569;
}

.llp-flashcard-game .llp-flashcard-stats-search:focus {
    border-color: rgba(99, 102, 241, 0.5);
}

.llp-flashcard-game .llp-flashcard-stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.llp-flashcard-game .llp-flashcard-stats-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid #334155;
    border-radius: 10px;
    display: grid;
    gap: 4px;
    padding: 10px 14px;
}

.llp-flashcard-game .llp-flashcard-stats-row[data-stage="0"] { border-left-color: #475569; }
.llp-flashcard-game .llp-flashcard-stats-row[data-stage="1"] { border-left-color: #6366f1; }
.llp-flashcard-game .llp-flashcard-stats-row[data-stage="2"] { border-left-color: #22d3ee; }
.llp-flashcard-game .llp-flashcard-stats-row[data-stage="3"] { border-left-color: #f59e0b; }
.llp-flashcard-game .llp-flashcard-stats-row[data-stage="4"] { border-left-color: #34d399; }

.llp-flashcard-game .llp-flashcard-stats-word {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 800;
}

.llp-flashcard-game .llp-flashcard-stats-definition {
    color: #64748b;
    font-size: 0.82rem;
}

.llp-flashcard-game .llp-flashcard-stats-meta {
    color: #475569;
    font-size: 0.75rem;
    margin: 2px 0;
}

.llp-flashcard-game .llp-flashcard-stats-bar {
    border: none;
    height: 5px;
    margin-top: 4px;
}

.llp-flashcard-game .llp-flashcard-stats-bar-fill,
.llp-flashcard-game .llp-xp-fill {
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
}

.llp-flashcard-game .llp-flashcard-stats-bar-label {
    display: none;
}

.llp-flashcard-game .llp-flashcard-stats-empty {
    color: #475569;
    text-align: center;
}

.llp-flashcard-game .llp-level-display {
    align-items: center;
    display: flex;
    gap: 9px;
    margin-top: 7px;
}

.llp-flashcard-game .llp-level-badge {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.55);
    height: 30px;
    width: 30px;
}

.llp-flashcard-game .llp-level-display[data-level="5"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="6"] .llp-level-badge {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 0 14px rgba(8, 145, 178, 0.55);
}

.llp-flashcard-game .llp-level-display[data-level="10"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="11"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="12"] .llp-level-badge {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 0 14px rgba(5, 150, 105, 0.55);
}

.llp-flashcard-game .llp-level-display[data-level="15"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="16"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="17"] .llp-level-badge {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 0 14px rgba(217, 119, 6, 0.55);
}

.llp-flashcard-game .llp-level-display[data-level="18"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="19"] .llp-level-badge,
.llp-flashcard-game .llp-level-display[data-level="20"] .llp-level-badge {
    background: linear-gradient(135deg, #be185d, #9d174d);
    box-shadow: 0 0 18px rgba(190, 24, 93, 0.65);
}

.llp-flashcard-game .llp-level-title {
    color: #64748b;
}

.llp-flashcard-game .llp-xp-text {
    color: #475569;
    opacity: 1;
}

.llp-flashcard-game .llp-streak-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.llp-flashcard-game .llp-streak-badge.is-hot {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

.llp-flashcard-game .llp-xp-float {
    color: #a5f3fc;
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

.llp-flashcard-game .llp-levelup-overlay {
    background: rgba(5, 5, 20, 0.88);
    backdrop-filter: blur(10px);
}

.llp-flashcard-game .llp-levelup-badge {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.7), 0 0 30px rgba(168, 85, 247, 0.5);
    height: 110px;
    width: 110px;
}

.llp-flashcard-game .llp-levelup-headline {
    background: linear-gradient(90deg, #a5f3fc, #818cf8, #f9a8d4, #a5f3fc);
    background-clip: text;
    background-size: 200% auto;
    color: transparent;
    font-size: 2.4rem;
    -webkit-background-clip: text;
}

.llp-flashcard-game .llp-levelup-subtitle {
    color: #cbd5e1;
}

.llp-flashcard-game .llp-levelup-dismiss {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.55);
}

.llp-settings-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.llp-settings-panel {
    background: #161b2e;
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.2), 0 30px 60px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
}

.llp-gs-header h3 {
    color: #f1f5f9;
}

.llp-gs-close {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.llp-gs-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
}

.llp-gs-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.llp-gs-label {
    color: #e2e8f0;
}

.llp-gs-desc {
    color: #64748b;
}

.llp-gs-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.llp-gs-toggle.is-on {
    background: #6366f1;
    border-color: #6366f1;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-frame {
    background: linear-gradient(155deg, #f8fbff 0%, #eef8f6 48%, #ffffff 100%);
    border-color: rgba(37, 99, 235, 0.24);
    box-shadow: 0 0 42px rgba(14, 165, 233, 0.14), 0 24px 48px rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-frame::after {
    background:
        radial-gradient(circle at 17% 11%, rgba(34, 211, 238, 0.18), transparent 34%),
        radial-gradient(circle at 83% 0%, rgba(99, 102, 241, 0.14), transparent 36%);
}

.llp-flashcard-game.is-light-theme .llp-flashcard-frame:fullscreen,
.llp-flashcard-game.is-light-theme .llp-flashcard-frame:-webkit-full-screen,
.llp-flashcard-game.is-light-theme .llp-flashcard-frame.is-fullscreen,
.llp-flashcard-game.is-light-theme .llp-flashcard-frame.is-pseudo-fullscreen {
    background: linear-gradient(155deg, #f8fbff 0%, #eef8f6 48%, #ffffff 100%);
}

.llp-flashcard-game.is-light-theme .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls {
    background: linear-gradient(to top, #ffffff 70%, rgba(255, 255, 255, 0));
}

.llp-flashcard-game.is-light-theme .llp-srs-header {
    background: rgba(255, 255, 255, 0.72);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.llp-flashcard-game.is-light-theme .llp-flashcard-counter,
.llp-flashcard-game.is-light-theme .llp-speed-label {
    color: #52647a;
}

.llp-flashcard-game.is-light-theme .llp-srs-progress-bar,
.llp-flashcard-game.is-light-theme .llp-xp-track,
.llp-flashcard-game.is-light-theme .llp-speed-bar,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-bar {
    background: rgba(15, 23, 42, 0.09);
}

.llp-flashcard-game.is-light-theme .llp-srs-stage {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(79, 70, 229, 0.28);
    color: #4338ca;
}

.llp-flashcard-game.is-light-theme .llp-fullscreen,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-actions button {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.12);
    color: #52647a;
}

.llp-flashcard-game.is-light-theme .llp-fullscreen:hover,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-actions button:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.38);
    color: #3730a3;
}

.llp-flashcard-game.is-light-theme .llp-settings-btn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(217, 119, 6, 0.28);
    color: #92400e;
}

.llp-flashcard-game.is-light-theme .llp-settings-btn:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(217, 119, 6, 0.42);
    color: #78350f;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-definition,
.llp-flashcard-game.is-light-theme .llp-self-rate-word,
.llp-flashcard-game.is-light-theme .llp-stat-value,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-title,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-word {
    color: #0f172a;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-image-wrap {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.1);
}

.llp-flashcard-game.is-light-theme .llp-srs-hint,
.llp-flashcard-game.is-light-theme .llp-speaker-label,
.llp-flashcard-game.is-light-theme .llp-context-en,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-definition,
.llp-flashcard-game.is-light-theme .llp-level-title {
    color: #64748b;
}

.llp-flashcard-game.is-light-theme .llp-option-button,
.llp-flashcard-game.is-light-theme .llp-pair-item {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(15, 23, 42, 0.13);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    color: #111827;
}

.llp-flashcard-game.is-light-theme .llp-option-button:hover,
.llp-flashcard-game.is-light-theme .llp-pair-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.46);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.14);
}

.llp-flashcard-game.is-light-theme .llp-option-button.is-selected,
.llp-flashcard-game.is-light-theme .llp-pair-item.is-selected {
    background: rgba(99, 102, 241, 0.16);
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.llp-flashcard-game.is-light-theme .llp-option-button.is-correct,
.llp-flashcard-game.is-light-theme .llp-pair-item.is-matched,
.llp-flashcard-game.is-light-theme .llp-spell-slot.is-reveal-correct,
.llp-flashcard-game.is-light-theme .llp-spell-slot.is-correct {
    background: rgba(34, 197, 94, 0.14) !important;
    border-color: #16a34a !important;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.2);
    color: #166534;
}

.llp-flashcard-game.is-light-theme .llp-option-button.is-incorrect,
.llp-flashcard-game.is-light-theme .llp-pair-item.is-error,
.llp-flashcard-game.is-light-theme .llp-spell-slot.is-wrong {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: #dc2626 !important;
    color: #991b1b;
}

.llp-flashcard-game.is-light-theme .llp-typing-error-word {
    color: #991b1b;
}

.llp-flashcard-game.is-light-theme .llp-typing-error-letter {
    background: rgba(239, 68, 68, 0.16);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
    color: #7f1d1d;
}

.llp-flashcard-game.is-light-theme .llp-speaker-big {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    box-shadow: 0 0 28px rgba(14, 165, 233, 0.38);
}

.llp-flashcard-game.is-light-theme .llp-speaker-big:hover,
.llp-flashcard-game.is-light-theme .llp-speaker-big.is-playing {
    box-shadow: 0 0 42px rgba(14, 165, 233, 0.55);
}

.llp-flashcard-game.is-light-theme .llp-audio-image-prompt {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.llp-flashcard-game.is-light-theme .llp-audio-image-prompt:hover,
.llp-flashcard-game.is-light-theme .llp-audio-image-prompt.is-playing {
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 16px 34px rgba(14, 165, 233, 0.18);
}

.llp-flashcard-game.is-light-theme .llp-spell-slot {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(15, 23, 42, 0.14);
    color: #111827;
}

.llp-flashcard-game.is-light-theme .llp-spell-slot.is-filled {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(79, 70, 229, 0.56);
}

.llp-flashcard-game.is-light-theme .llp-keyboard-key {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(79, 70, 229, 0.32);
    color: #3730a3;
}

.llp-flashcard-game.is-light-theme .llp-keyboard-key:hover {
    background: rgba(99, 102, 241, 0.18);
}

.llp-flashcard-game.is-light-theme .llp-spell-tools button,
.llp-flashcard-game.is-light-theme .llp-flashcard-controls [data-action="secondary"] {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(15, 23, 42, 0.14);
    color: #52647a;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-controls [data-action="primary"] {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.3);
}

.llp-flashcard-game.is-light-theme .llp-flashcard-controls [data-action="reset"] {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(220, 38, 38, 0.28);
    color: #991b1b;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-feedback {
    color: #64748b;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-feedback.is-correct {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(22, 163, 74, 0.28);
    color: #166534;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-feedback.is-wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(220, 38, 38, 0.26);
    color: #991b1b;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-back,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats {
    background: #f8fbff;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-stats {
    color: #0f172a;
}

.llp-flashcard-game.is-light-theme .llp-stat-card,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-row {
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(15, 23, 42, 0.08);
}

.llp-flashcard-game.is-light-theme .llp-stat-label,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-meta,
.llp-flashcard-game.is-light-theme .llp-flashcard-stats-empty,
.llp-flashcard-game.is-light-theme .llp-xp-text {
    color: #64748b;
}

.llp-flashcard-game.is-light-theme .llp-stat-card:nth-child(1) .llp-stat-value { color: #15803d; }
.llp-flashcard-game.is-light-theme .llp-stat-card:nth-child(2) .llp-stat-value { color: #b91c1c; }
.llp-flashcard-game.is-light-theme .llp-stat-card:nth-child(3) .llp-stat-value { color: #1d4ed8; }
.llp-flashcard-game.is-light-theme .llp-stat-card:nth-child(5) .llp-stat-value { color: #7c3aed; }

.llp-flashcard-game.is-light-theme .llp-flashcard-stats-search {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.llp-flashcard-game.is-light-theme .llp-flashcard-stats-search::placeholder {
    color: #94a3b8;
}

.llp-flashcard-game.is-light-theme .llp-streak-badge {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.1);
    color: #52647a;
}

.llp-flashcard-game.is-light-theme .llp-streak-badge.is-hot {
    background: rgba(254, 243, 199, 0.9);
    border-color: rgba(217, 119, 6, 0.34);
    box-shadow: 0 0 16px rgba(217, 119, 6, 0.16);
    color: #92400e;
}

.llp-flashcard-game.is-light-theme .llp-xp-float {
    color: #0891b2;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.24);
}

.llp-flashcard-game.is-light-theme .llp-levelup-overlay {
    background: rgba(248, 250, 252, 0.9);
}

.llp-flashcard-game.is-light-theme .llp-levelup-subtitle {
    color: #475569;
}

.llp-settings-panel.is-light-theme {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
    color: #0f172a;
}

.llp-settings-panel.is-light-theme .llp-gs-header h3,
.llp-settings-panel.is-light-theme .llp-gs-label {
    color: #0f172a;
}

.llp-settings-panel.is-light-theme .llp-gs-close {
    background: #eef2ff;
    color: #475569;
}

.llp-settings-panel.is-light-theme .llp-gs-close:hover {
    background: #e0e7ff;
    color: #3730a3;
}

.llp-settings-panel.is-light-theme .llp-gs-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.llp-settings-panel.is-light-theme .llp-gs-desc {
    color: #64748b;
}

.llp-settings-panel.is-light-theme .llp-gs-toggle {
    background: #dbe3ef;
    border-color: #dbe3ef;
}

.llp-settings-panel.is-light-theme .llp-gs-toggle.is-on {
    background: #4f46e5;
    border-color: #4f46e5;
}

@keyframes stnld-pop {
    0% { opacity: 0.6; transform: scale(0.92); }
    55% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes stnld-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-9px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@media (max-width: 600px) {
    .llp-flashcard-game .llp-srs-options {
        grid-template-columns: 1fr;
    }

    .llp-flashcard-game .llp-flashcard-stats-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .llp-flashcard-game .llp-option-button {
        font-size: 1.8rem;
        min-height: 70px;
    }

    .llp-flashcard-game .llp-flashcard-controls {
        flex-wrap: wrap;
    }

    .llp-flashcard-game .llp-flashcard-controls button {
        flex: 1 1 auto;
    }

    .llp-flashcard-game .llp-srs-header-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .llp-flashcard-widget.llp-flashcard-game {
        margin: 16px auto;
        max-width: min(100%, calc(100vw - 24px));
        width: min(100%, calc(100vw - 24px));
    }

    .llp-flashcard-game .llp-flashcard-frame {
        border-radius: 16px;
        padding: 12px;
    }

    .llp-flashcard-game .llp-srs-header {
        display: grid;
        gap: 10px;
        grid-template-columns: 1fr;
        margin-bottom: 10px;
        padding: 10px 12px;
    }

    .llp-flashcard-game .llp-srs-header-main {
        min-width: 0;
        width: 100%;
    }

    .llp-flashcard-game .llp-srs-header-actions {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        width: 100%;
    }

    .llp-flashcard-game .llp-srs-header-actions .llp-srs-stage {
        grid-column: 1 / -1;
        justify-self: start;
        max-width: 100%;
    }

    .llp-flashcard-game .llp-fullscreen {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        line-height: 1.1;
        min-height: 38px;
        min-width: 0;
        padding: 7px 8px;
        text-align: center;
        white-space: normal;
        width: 100%;
    }

    .llp-flashcard-game .llp-theme-toggle {
        min-width: 0;
    }

    .llp-flashcard-game .llp-level-display {
        gap: 8px;
        min-width: 0;
        width: 100%;
    }

    .llp-flashcard-game .llp-level-info {
        flex: 1 1 auto;
        min-width: 0;
    }

    .llp-flashcard-game .llp-xp-track {
        max-width: 100%;
    }

    .llp-flashcard-game .llp-xp-text {
        white-space: nowrap;
    }

    .llp-flashcard-game .llp-streak-badge {
        justify-content: flex-start;
        width: 100%;
    }

    .llp-flashcard-game .llp-flashcard-definition {
        font-size: clamp(1.15rem, 5.2vw, 1.6rem);
        padding: 20px 12px 8px;
    }

    .llp-flashcard-game .llp-flashcard-image-wrap {
        margin-bottom: 10px;
        max-width: min(100%, 330px);
    }

    .llp-flashcard-game .llp-flashcard-image {
        max-height: min(32vh, 260px);
        width: 100%;
    }

    .llp-flashcard-game .llp-audio-image-prompt img {
        max-height: min(30vh, 240px);
    }

    .llp-flashcard-game .llp-speaker-center--image {
        gap: 6px;
        padding: 4px 0 8px;
    }

    .llp-flashcard-game .llp-audio-image-prompt {
        max-width: min(74vw, 260px);
    }

    .llp-flashcard-game .llp-srs-hint,
    .llp-flashcard-game .llp-speaker-label,
    .llp-flashcard-game .llp-context-en {
        font-size: 0.78rem;
    }

    .llp-flashcard-game .llp-srs-options {
        gap: 8px;
        padding: 4px 8px 12px;
    }

    .llp-flashcard-game .llp-option-button {
        font-size: clamp(1.25rem, 7vw, 1.8rem);
        min-height: 58px;
        padding: 12px 10px;
    }

    .llp-flashcard-game .llp-option-def {
        font-size: 0.9rem;
        text-align: center;
    }

    .llp-flashcard-game .llp-word-option {
        min-height: 70px;
    }

    .llp-flashcard-game .llp-pair-match {
        gap: 8px;
        padding: 4px 0 10px;
    }

    .llp-flashcard-game .llp-pair-col {
        gap: 8px;
        min-width: 0;
    }

    .llp-flashcard-game .llp-pair-item {
        font-size: 0.95rem;
        min-height: 50px;
        padding: 8px;
        word-break: break-word;
    }

    .llp-flashcard-game .llp-pair-def {
        font-size: 0.78rem;
    }

    .llp-flashcard-game .llp-spell-slots,
    .llp-flashcard-game .llp-spell-bank {
        gap: 6px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .llp-flashcard-game .llp-spell-slot {
        font-size: 1.2rem;
        min-height: 44px;
        min-width: 36px;
    }

    .llp-flashcard-game .llp-keyboard-key {
        font-size: 1.15rem;
        min-width: 40px;
        padding: 9px 10px;
    }

    .llp-flashcard-game .llp-flashcard-controls {
        gap: 8px;
        padding: 12px 8px 16px;
    }

    .llp-flashcard-game .llp-flashcard-controls button {
        flex: 1 1 0;
        font-size: 0.95rem;
        min-width: 0;
        padding: 11px 14px;
    }

    .llp-flashcard-game .llp-flashcard-feedback {
        margin-left: 8px;
        margin-right: 8px;
    }
}

@media (max-width: 768px) {
    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen {
        border-radius: 0;
        padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header {
        display: grid;
        gap: 8px;
        grid-template-columns: 1fr;
        margin-bottom: 8px;
        padding: 10px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-header-actions {
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-stage {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-fullscreen {
        align-items: center;
        display: inline-flex;
        font-size: 0.75rem;
        justify-content: center;
        line-height: 1.1;
        min-height: 34px;
        min-width: 0;
        padding: 5px 6px;
        text-align: center;
        white-space: normal;
        width: 100%;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-definition {
        font-size: clamp(1.05rem, 4.6vw, 1.35rem);
        padding: 12px 8px 6px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-image-wrap {
        max-width: min(100%, 260px);
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-image {
        max-height: min(24vh, 210px);
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-audio-image-prompt img {
        max-height: min(18vh, 160px);
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-speaker-center--image {
        gap: 4px;
        padding: 2px 0 8px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-audio-image-prompt {
        max-width: min(60vw, 220px);
        padding: 5px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-srs-options {
        grid-template-columns: 1fr;
        margin-top: 4px;
        padding: 4px 6px 10px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-option-button {
        font-size: clamp(1.15rem, 6vw, 1.6rem);
        min-height: 54px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-pair-match {
        grid-template-columns: 1fr 1fr;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-pair-item {
        min-height: 48px;
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls {
        flex-wrap: nowrap;
        padding: 10px 6px calc(8px + env(safe-area-inset-bottom));
    }

    .llp-flashcard-game .llp-flashcard-frame.is-pseudo-fullscreen .llp-flashcard-controls button {
        flex: 1 1 0;
        min-width: 0;
    }
}
