:root {
    color-scheme: light;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --page: #f4f7fb;
    --card: #ffffff;
    --text: #162033;
    --muted: #667085;
    --line: #dce3ed;
    --primary: #2457d6;
    --primary-dark: #173ea4;
    --soft: #edf3ff;
    --success: #127a4b;
    --success-soft: #e8f7ef;
    --warning: #9a5b00;
    --warning-soft: #fff4dc;
    --danger: #a32929;
    --shadow:
        0 18px 45px
        rgba(31, 43, 67, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(
            180deg,
            #edf3ff 0,
            var(--page) 300px
        );
    color: var(--text);
}

button,
select,
a {
    font: inherit;
}

button,
select {
    min-height: 48px;
}

button {
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    cursor: pointer;
    font-weight: 700;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid
        rgba(36, 87, 214, 0.28);
    outline-offset: 3px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.page {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 16px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.language-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.language-control select {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    padding: 9px 12px;
}

.app-card {
    min-height: 560px;
    border: 1px solid
        rgba(210, 220, 235, 0.9);
    border-radius: 26px;
    background: var(--card);
    box-shadow: var(--shadow);
    padding: clamp(22px, 4vw, 44px);
}

.loading {
    color: var(--muted);
    text-align: center;
    padding: 80px 20px;
}

.preview-badge,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    font-size: 0.88rem;
}

.preview-badge {
    color: var(--warning);
    background: var(--warning-soft);
}

.eyebrow {
    color: var(--primary-dark);
    background: var(--soft);
}

.hero {
    margin-bottom: 26px;
}

.hero h1,
.screen-title {
    margin: 15px 0 10px;
    line-height: 1.12;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.4rem);
}

.screen-title {
    font-size: clamp(1.65rem, 4vw, 2.4rem);
}

.hero p,
.screen-description,
.rule-text,
.example-translation,
.life-result,
.technical-note {
    line-height: 1.65;
}

.hero p,
.screen-description,
.technical-note {
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf5;
    margin: 18px 0 8px;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 180ms ease;
}

.counter {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.rule-card,
.word-card,
.quiz-card,
.finish-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: clamp(20px, 4vw, 32px);
    margin-top: 22px;
}

.rule-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f7f9fd
        );
}

.rule-card h2,
.word-card h2,
.finish-card h2 {
    margin: 0 0 13px;
    font-size: clamp(1.35rem, 3.4vw, 2rem);
}

.rule-example,
.german-example {
    border-inline-start:
        5px solid var(--primary);
    border-radius: 10px;
    background: var(--soft);
    padding: 15px 17px;
    margin-top: 18px;
    color: var(--primary-dark);
    font-weight: 800;
    line-height: 1.55;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.primary-button {
    color: white;
    background: var(--primary);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    color: var(--text);
    background: #edf0f5;
}

.audio-button {
    color: var(--primary-dark);
    background: var(--soft);
}

.quiz-list {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.quiz-card {
    margin-top: 0;
}

.quiz-card legend {
    padding: 0;
    font-weight: 800;
    line-height: 1.45;
}

.quiz-options {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
    cursor: pointer;
}

.quiz-option:hover {
    background: #f7f9fc;
}

.quiz-option input {
    margin-top: 3px;
    inline-size: 19px;
    block-size: 19px;
}

.result-message {
    border-radius: 16px;
    padding: 16px 18px;
    margin-top: 20px;
    font-weight: 800;
    line-height: 1.5;
}

.result-message.success {
    color: var(--success);
    background: var(--success-soft);
}

.result-message.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.word-card {
    text-align: center;
}

.article-badge {
    display: inline-flex;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    padding: 7px 15px;
    font-weight: 900;
    font-size: 1.05rem;
}

.german-word {
    margin: 15px 0 4px;
    font-size: clamp(2.1rem, 8vw, 4rem);
    line-height: 1.1;
    font-weight: 900;
}

.word-translation {
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 700;
}

.word-details {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    text-align: start;
}

.detail-card {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 14px;
}

.detail-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.example-box {
    margin-top: 18px;
    border-radius: 17px;
    background: #f7f9fc;
    padding: 18px;
    text-align: start;
}

.german-example {
    margin-top: 8px;
}

.example-translation {
    color: var(--muted);
    margin-bottom: 0;
}

.life-result {
    border-radius: 16px;
    background: var(--success-soft);
    color: var(--success);
    padding: 16px 18px;
    font-weight: 750;
}

.technical-note {
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding-top: 20px;
    font-size: 0.92rem;
}

.audio-status {
    min-height: 24px;
    margin-top: 12px;
    color: var(--muted);
    font-weight: 700;
}

html[dir="rtl"] body {
    font-family:
        Tahoma,
        Arial,
        sans-serif;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .actions {
    direction: rtl;
}

html[dir="rtl"] .back-link {
    transform: none;
}

html[dir="rtl"] .german-word,
html[dir="rtl"] .german-example,
html[dir="rtl"] .rule-example,
html[dir="rtl"] .article-badge {
    direction: ltr;
    unicode-bidi: isolate;
}

html[dir="rtl"] .word-details,
html[dir="rtl"] .example-box {
    text-align: right;
}

@media (max-width: 650px) {
    .page {
        padding: 10px;
    }

    .topbar {
        align-items: stretch;
    }

    .language-control {
        flex: 1;
        justify-content: flex-end;
    }

    .language-control span {
        display: none;
    }

    .language-control select {
        width: 100%;
        max-width: 190px;
    }

    .app-card {
        min-height: 500px;
        border-radius: 20px;
        padding: 20px 16px;
    }

    .word-details {
        grid-template-columns: 1fr;
    }

    .actions button {
        width: 100%;
    }
}

/* Active writing practice v1 */

.dictation-card {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f7f9fd
        );
    padding: clamp(20px, 4vw, 34px);
}

.dictation-icon {
    text-align: center;
    font-size: clamp(3rem, 9vw, 5rem);
    line-height: 1;
    margin-bottom: 12px;
}

.centered-actions {
    justify-content: center;
}

.practice-label {
    display: block;
    margin-top: 24px;
    margin-bottom: 8px;
    font-weight: 800;
}

.practice-input {
    width: 100%;
    min-height: 56px;
    border: 2px solid var(--line);
    border-radius: 15px;
    background: white;
    color: var(--text);
    padding: 12px 15px;
    font-size: 1.12rem;
    font-weight: 700;
}

.practice-input:focus {
    border-color: var(--primary);
    outline: 3px solid
        rgba(36, 87, 214, 0.15);
}

.german-character-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.character-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    direction: ltr;
}

.character-button {
    min-width: 45px;
    min-height: 43px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.practice-feedback {
    margin-top: 19px;
    border-radius: 16px;
    padding: 17px;
    line-height: 1.55;
}

.practice-feedback.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.practice-feedback h3 {
    margin: 0 0 8px;
}

.answer-comparison {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin-top: 15px;
}

.comparison-card {
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.75);
    padding: 13px;
}

.comparison-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 800;
}

.comparison-card strong {
    display: block;
    color: var(--danger);
    font-size: 1.08rem;
    overflow-wrap: anywhere;
}

.comparison-card.correct strong {
    color: var(--success);
}

.retype-note {
    margin-bottom: 0;
    font-weight: 800;
}

.practice-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.practice-summary > div {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
}

.practice-summary strong {
    display: block;
    color: var(--primary-dark);
    font-size: 1.7rem;
}

.practice-summary span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

html[dir="rtl"] .practice-input {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .answer-comparison strong {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

@media (max-width: 650px) {
    .german-character-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .answer-comparison {
        grid-template-columns: 1fr;
    }

    .practice-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/* BROWSER_VOICE_PRACTICE_V1 */

.voice-practice-card {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #ffffff;
    padding: clamp(20px, 4vw, 34px);
    text-align: center;
}

.voice-target-label {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.voice-target {
    margin: 10px 0 22px;
    color: var(--primary-dark);
    font-size: clamp(2rem, 8vw, 3.7rem);
    font-weight: 900;
    line-height: 1.15;
}

.voice-recorder-panel {
    margin-top: 24px;
    border-radius: 18px;
    background: var(--soft);
    padding: 22px;
}

.voice-microphone-icon {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 14px;
}

.voice-record-button {
    min-height: 56px;
    border: 0;
    border-radius: 15px;
    background: var(--primary);
    color: white;
    padding: 13px 22px;
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
}

.voice-record-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.voice-record-button.recording {
    background: var(--danger);
    animation: voice-recording-pulse 1.15s infinite;
}

.voice-record-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.voice-recording-status {
    min-height: 25px;
    margin-top: 13px;
    color: var(--muted);
    font-weight: 750;
}

.voice-feedback {
    margin-top: 20px;
    border-radius: 17px;
    padding: 18px;
    text-align: start;
}

.voice-feedback.success {
    background: var(--success-soft);
    color: var(--success);
}

.voice-feedback.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.voice-feedback h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.recognized-box {
    margin-top: 14px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.75);
    padding: 13px;
}

.recognized-box span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 800;
}

.recognized-box strong {
    display: block;
    color: var(--text);
    font-size: 1.18rem;
    overflow-wrap: anywhere;
}

.voice-attempt {
    margin-bottom: 0;
    font-size: 0.88rem;
    font-weight: 750;
}

.finish-symbol {
    margin: 24px 0;
    font-size: 4rem;
    text-align: center;
}

html[dir="rtl"] .voice-target,
html[dir="rtl"] .recognized-box strong {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

@keyframes voice-recording-pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 0
            rgba(180, 30, 45, 0.24);
    }

    50% {
        box-shadow:
            0 0 0 10px
            rgba(180, 30, 45, 0);
    }
}

@media (max-width: 650px) {
    .voice-practice-card {
        padding: 20px 15px;
    }

    .voice-record-button {
        width: 100%;
    }
}


/* =========================================================
   WORDS_DARK_THEME_V1
   Unified dark interface for the public Words A0 lesson.
   ========================================================= */

:root {
    color-scheme: dark;

    --text: #f8fafc;
    --muted: #aebbd0;

    --line:
        rgba(148, 163, 184, 0.24);

    --primary: #3b82f6;
    --primary-dark: #93c5fd;

    --soft: #172642;

    --success: #34d399;
    --success-soft:
        rgba(6, 78, 59, 0.54);

    --warning: #fbbf24;
    --warning-soft:
        rgba(120, 53, 15, 0.52);

    --danger: #f87171;
    --danger-soft:
        rgba(127, 29, 29, 0.52);
}


html {
    min-height: 100%;
    background: #070f1f;
}


body {
    min-height: 100vh;

    color: var(--text);

    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(59, 130, 246, 0.23),
            transparent 42%
        ),
        radial-gradient(
            circle at 8% 65%,
            rgba(79, 70, 229, 0.12),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #0b1427 0%,
            #070f1f 58%,
            #050b17 100%
        );

    background-attachment: fixed;
}


.topbar {
    color: var(--text);
}


.back-link,
.language-control select {
    border-color:
        rgba(148, 163, 184, 0.28);

    background:
        rgba(15, 26, 47, 0.92);

    color: #f8fafc;

    box-shadow:
        0 12px 28px
        rgba(2, 6, 23, 0.22);
}


.back-link:hover,
.language-control select:hover {
    border-color:
        rgba(96, 165, 250, 0.62);

    background:
        rgba(23, 38, 66, 0.98);
}


.back-link:focus-visible,
.language-control select:focus-visible {
    outline:
        3px solid
        rgba(96, 165, 250, 0.46);

    outline-offset: 3px;
}


.language-control span {
    color: #b8c5d9;
}


.app-card {
    border-color:
        rgba(148, 163, 184, 0.22);

    background:
        linear-gradient(
            160deg,
            rgba(17, 29, 51, 0.98),
            rgba(11, 21, 39, 0.99)
        );

    box-shadow:
        0 32px 80px
        rgba(2, 6, 23, 0.48);
}


.hero h1,
.screen-title,
.finish-card h2,
.voice-feedback h3,
.practice-feedback h3 {
    color: #f8fafc;
}


.hero > p:not(.eyebrow),
.screen-description {
    color: #aebbd0;
}


.preview-badge {
    border:
        1px solid
        rgba(251, 191, 36, 0.28);

    background:
        rgba(120, 53, 15, 0.50);

    color: #fde68a;
}


.eyebrow {
    border:
        1px solid
        rgba(96, 165, 250, 0.24);

    background:
        rgba(30, 64, 175, 0.28);

    color: #bfdbfe;
}


.progress-track {
    background:
        rgba(148, 163, 184, 0.20);
}


.progress-fill {
    background:
        linear-gradient(
            90deg,
            #2563eb,
            #38bdf8
        );

    box-shadow:
        0 0 18px
        rgba(56, 189, 248, 0.28);
}


.rule-card,
.quiz-card,
.question-card,
.word-card,
.detail-card,
.finish-card,
.dictation-card,
.voice-practice-card,
.practice-summary > div {
    border-color:
        rgba(148, 163, 184, 0.22);

    background:
        linear-gradient(
            145deg,
            rgba(23, 38, 66, 0.88),
            rgba(15, 26, 47, 0.94)
        );
}


.dictation-card {
    background:
        linear-gradient(
            145deg,
            rgba(23, 38, 66, 0.96),
            rgba(11, 21, 39, 0.98)
        );
}


.voice-practice-card {
    background:
        linear-gradient(
            145deg,
            rgba(23, 38, 66, 0.96),
            rgba(11, 21, 39, 0.98)
        );
}


.example-box,
.comparison-card,
.recognized-box {
    border:
        1px solid
        rgba(148, 163, 184, 0.18);

    background:
        rgba(8, 17, 32, 0.72);
}


.voice-recorder-panel {
    border:
        1px solid
        rgba(96, 165, 250, 0.18);

    background:
        rgba(23, 38, 66, 0.82);
}


.practice-input {
    border-color:
        rgba(148, 163, 184, 0.34);

    background:
        rgba(7, 15, 31, 0.88);

    color: #f8fafc;

    caret-color: #60a5fa;
}


.practice-input::placeholder {
    color: #78879f;
}


.practice-input:focus {
    border-color: #60a5fa;

    outline:
        3px solid
        rgba(59, 130, 246, 0.20);

    background:
        rgba(9, 19, 37, 0.98);
}


.audio-button,
.secondary-button,
.character-button,
.quiz-option {
    border-color:
        rgba(96, 165, 250, 0.24);

    background:
        rgba(23, 38, 66, 0.92);

    color: #dbeafe;
}


.audio-button:hover,
.secondary-button:hover,
.character-button:hover,
.quiz-option:hover {
    border-color:
        rgba(96, 165, 250, 0.58);

    background:
        rgba(30, 58, 96, 0.96);
}


.primary-button,
.voice-record-button {
    background:
        linear-gradient(
            135deg,
            #2563eb,
            #0ea5e9
        );

    color: #ffffff;

    box-shadow:
        0 13px 28px
        rgba(37, 99, 235, 0.26);
}


.primary-button:hover:not(:disabled),
.voice-record-button:hover:not(:disabled) {
    box-shadow:
        0 16px 34px
        rgba(14, 165, 233, 0.32);
}


.voice-record-button.recording {
    background:
        linear-gradient(
            135deg,
            #dc2626,
            #f43f5e
        );
}


.article-badge {
    border:
        1px solid
        rgba(96, 165, 250, 0.22);

    background:
        rgba(30, 64, 175, 0.24);

    color: #bfdbfe;
}


.german-word,
.voice-target,
.practice-summary strong {
    color: #93c5fd;
}


.word-translation,
.detail-label,
.example-translation,
.audio-status,
.voice-recording-status,
.voice-attempt,
.practice-summary span,
.german-character-box {
    color: #aebbd0;
}


.counter,
.practice-label,
.voice-target-label {
    color: #cbd5e1;
}


.life-result,
.result-message.success,
.voice-feedback.success {
    border:
        1px solid
        rgba(52, 211, 153, 0.24);

    background:
        rgba(6, 78, 59, 0.50);

    color: #6ee7b7;
}


.result-message.warning,
.practice-feedback.warning,
.voice-feedback.warning {
    border:
        1px solid
        rgba(251, 191, 36, 0.24);

    background:
        rgba(120, 53, 15, 0.50);

    color: #fcd34d;
}


.result-message.error {
    border:
        1px solid
        rgba(248, 113, 113, 0.24);

    background:
        rgba(127, 29, 29, 0.50);

    color: #fca5a5;
}


.comparison-card strong {
    color: #fca5a5;
}


.comparison-card.correct strong {
    color: #6ee7b7;
}


.technical-note {
    border-color:
        rgba(148, 163, 184, 0.22);

    color: #94a3b8;
}


audio {
    color-scheme: dark;
}


@media (max-width: 650px) {
    body {
        background:
            linear-gradient(
                180deg,
                #0b1427 0%,
                #070f1f 100%
            );

        background-attachment: scroll;
    }

    .app-card {
        box-shadow:
            0 22px 50px
            rgba(2, 6, 23, 0.40);
    }
}

/* WORDS_DARK_THEME_V1_END */
