@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    color-scheme: only dark;
    --bg: #0b0f14;
    --bar: #0f1722;
    --card: #111a24;
    --card-border: #1f2a38;
    --button: #142235;
    --text: #e6edf3;
    --text-strong: #f6f7fb;
    --muted: #8b94a7;
    --accent: #4aa3ff;
    --accent-strong: #2b7fdc;
    --accent-neon: #66ccff;
    --success: #42e7b0;
    --danger: #ff6b6b;
    --glow: rgba(74, 163, 255, 0.28);
    --neon-glow: 0 0 16px rgba(74, 163, 255, 0.35), 0 0 32px rgba(74, 163, 255, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(74, 163, 255, 0.2), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(102, 204, 255, 0.16), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(63, 126, 255, 0.14), transparent 50%);
    background-attachment: fixed;
}

.page {
    min-height: 100vh;
    animation: page-in 0.5s ease both;
}

.topbar {
    background: #0e1520;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.topbar h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.topbar-title {
    color: var(--text-strong);
    text-decoration: none;
}

.settings-link,
.telegram-link {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
    text-decoration: none;
    line-height: 0;
    flex: 0 0 26px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.settings-link img,
.telegram-link img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.settings-link:hover,
.telegram-link:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}


.session-banner {
    grid-column: 1 / -1;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(115, 189, 255, 0.24), rgba(74, 163, 255, 0.18));
    border: 1px solid rgba(144, 206, 255, 0.48);
    color: #f7fbff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 30px rgba(38, 88, 148, 0.28);
}

.cards {
    max-width: 360px;
    margin: 20px auto 0;
    display: grid;
    gap: 14px;
    padding: 0 14px 40px;
}

.trainer-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 12px 10px;
    box-shadow: 0 10px 26px rgba(5, 10, 16, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: card-in 0.6s ease both;
}

.trainer-card:nth-child(1) { animation-delay: 0.05s; }
.trainer-card:nth-child(2) { animation-delay: 0.1s; }
.trainer-card:nth-child(3) { animation-delay: 0.15s; }
.trainer-card:nth-child(4) { animation-delay: 0.2s; }
.trainer-card:nth-child(5) { animation-delay: 0.25s; }

.trainer-button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, rgba(74, 163, 255, 0.35), rgba(74, 163, 255, 0.08));
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    color: var(--text-strong);
    border: 1px solid rgba(74, 163, 255, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trainer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(5, 10, 16, 0.6);
}

.trainer-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px var(--glow), var(--neon-glow);
}

.trainer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    margin-top: 8px;
}

.progress {
    color: var(--muted);
}

.progress .num {
    color: var(--accent-neon);
    font-weight: 700;
}

.reset {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 107, 107, 0.18);
    border: 1px solid rgba(255, 107, 107, 0.5);
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.reset:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 107, 107, 0.85);
    box-shadow: 0 0 14px rgba(255, 107, 107, 0.45), 0 0 24px rgba(255, 107, 107, 0.2);
}

.trainer {
    width: min(760px, calc(100% - 20px));
    margin: 12px auto 32px;
    padding: 16px;
    display: grid;
    gap: 14px;
    border-radius: 18px;
    background: rgba(13, 19, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 22px 48px rgba(5, 10, 16, 0.6);
    overflow: hidden;
}

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.title-row h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-strong);
}

.trainer h2,
.trainer h3 {
    color: var(--text-strong);
}

.close {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.close:hover {
    transform: translateY(-1px);
    background: rgba(255, 107, 107, 0.18);
    box-shadow: 0 0 14px rgba(255, 107, 107, 0.35);
}

.trainer .progress {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(8px, 1fr);
    gap: 5px;
    height: 10px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.seg {
    display: block;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: 100%;
    min-width: 8px;
}

.seg-current {
    background: rgba(74, 163, 255, 0.8);
    box-shadow: 0 0 10px rgba(74, 163, 255, 0.6);
}

.seg-correct {
    background: rgba(66, 231, 176, 0.85);
    box-shadow: 0 0 10px rgba(66, 231, 176, 0.5);
}

.seg-incorrect {
    background: rgba(255, 107, 107, 0.9);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.seg-skipped {
    background: rgba(255, 255, 255, 0.45);
}

.seg-empty {
    background: rgba(255, 255, 255, 0.06);
}

.hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.hint-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    animation: rise-in 0.5s ease both;
}

.hint-group:nth-child(1) { animation-delay: 0.05s; }
.hint-group:nth-child(2) { animation-delay: 0.1s; }
.hint-group:nth-child(3) { animation-delay: 0.15s; }

.chip {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-strong);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chip strong {
    color: #ffffff;
}

.chip:hover {
    transform: translateY(-1px);
    border-color: rgba(74, 163, 255, 0.45);
    box-shadow: var(--neon-glow);
}

.tag {
    min-width: 84px;
    text-align: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.tag.masc {
    color: #7ab8ff;
    border-color: rgba(122, 184, 255, 0.45);
    box-shadow: 0 0 10px rgba(122, 184, 255, 0.2);
}

.tag.fem {
    color: #ff8fd1;
    border-color: rgba(255, 143, 209, 0.45);
    box-shadow: 0 0 10px rgba(255, 143, 209, 0.2);
}

.tag.neut {
    color: #7cf2ff;
    border-color: rgba(124, 242, 255, 0.45);
    box-shadow: 0 0 10px rgba(124, 242, 255, 0.2);
}

.tag.nom {
    color: var(--accent-neon);
    border-color: rgba(74, 163, 255, 0.45);
}

.tag.num {
    color: #ffc36b;
    border-color: rgba(255, 195, 107, 0.55);
    box-shadow: 0 0 10px rgba(255, 195, 107, 0.2);
}

.question {
    border-radius: 16px;
    padding: 16px;
    background: rgba(17, 26, 36, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 30px rgba(5, 10, 16, 0.5);
    display: grid;
    gap: 10px;
}

.question.correct-flash {
    animation: correct-flash 0.9s ease-out;
}

.sentence {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-strong);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.trainer .translation {
    color: rgba(230, 237, 243, 0.82);
    font-size: 13px;
}

.trial-limit-card {
    display: grid;
    gap: 12px;
    padding: 4px 0;
}

.trial-limit-title {
    color: var(--text-strong);
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
}

.trial-limit-copy {
    color: rgba(230, 237, 243, 0.88);
    font-size: 15px;
    line-height: 1.6;
}

.trial-limit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4aa3ff, #2b7fdc);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(43, 127, 220, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trial-limit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(43, 127, 220, 0.4);
}

.trial-limit-note {
    color: rgba(230, 237, 243, 0.66);
    font-size: 13px;
    line-height: 1.5;
}

.trial-limit-success {
    color: #9cf7c4;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 700;
}

.trial-limit-error {
    color: #ffdbe3;
    font-size: 13px;
    line-height: 1.5;
}

.trial-limit-button:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
    box-shadow: 0 14px 28px rgba(43, 127, 220, 0.2);
}

.blank {
    border: 1px solid rgba(74, 163, 255, 0.35);
    background: rgba(74, 163, 255, 0.08);
    color: var(--text-strong);
    border-radius: 10px;
    padding: 2px 8px;
    margin: 0 2px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blank.active {
    border-color: rgba(74, 163, 255, 0.7);
    box-shadow: var(--neon-glow);
}

.blank.blink {
    animation: blank-blink 0.9s ease-in-out 2;
}

.blank:disabled {
    opacity: 0.6;
    cursor: default;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
}

.option {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-strong);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: rise-in 0.5s ease both;
}

.option:nth-child(1) { animation-delay: 0.05s; }
.option:nth-child(2) { animation-delay: 0.08s; }
.option:nth-child(3) { animation-delay: 0.11s; }
.option:nth-child(4) { animation-delay: 0.14s; }
.option:nth-child(5) { animation-delay: 0.17s; }
.option:nth-child(6) { animation-delay: 0.2s; }
.option:nth-child(7) { animation-delay: 0.23s; }
.option:nth-child(8) { animation-delay: 0.26s; }

.option:hover {
    transform: translateY(-1px);
    border-color: rgba(74, 163, 255, 0.45);
    box-shadow: var(--neon-glow);
}

.option.active {
    background: rgba(74, 163, 255, 0.18);
    border-color: rgba(74, 163, 255, 0.75);
    box-shadow: var(--neon-glow);
}

.option:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.feedback {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 111, 140, 0.14);
    border: 1px solid rgba(255, 111, 140, 0.4);
    color: #ffdbe3;
    font-size: 14px;
}

.feedback .answer {
    color: #ff99b3;
    font-weight: 700;
}

@keyframes correct-flash {
    0% {
        box-shadow: 0 14px 30px rgba(5, 10, 16, 0.5);
    }
    35% {
        box-shadow: 0 14px 34px rgba(5, 10, 16, 0.45), 0 0 12px rgba(88, 255, 199, 0.35);
    }
    100% {
        box-shadow: 0 14px 30px rgba(5, 10, 16, 0.5);
    }
}

.next,
.submit {
    border: none;
    background: linear-gradient(135deg, #4aa3ff, #2b7fdc);
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.next:disabled,
.submit:disabled,
.skip:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.next:hover,
.submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(43, 127, 220, 0.4);
}

.skip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.skip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 22px rgba(5, 10, 16, 0.4);
}

.end-screen {
    margin-top: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(74, 163, 255, 0.14);
    border: 1px solid rgba(74, 163, 255, 0.4);
    box-shadow: 0 0 20px rgba(74, 163, 255, 0.2);
}

.end-title {
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 6px;
}

.end-text {
    color: var(--muted);
    font-size: 13px;
}

@keyframes blank-blink {
    0%,
    100% {
        box-shadow: none;
    }
    50% {
        box-shadow: var(--neon-glow);
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 420px) {
    .trainer {
        width: calc(100% - 16px);
        margin: 8px auto 24px;
        padding: 12px;
        border-radius: 14px;
    }

    .title-row h2 {
        font-size: 18px;
    }

    .trainer .progress {
        padding: 4px;
        height: 8px;
    }

    .sentence {
        font-size: 16px;
    }

    .chip {
        font-size: 11px;
        padding: 4px 8px;
    }

    .tag {
        min-width: 68px;
        font-size: 10px;
        padding: 4px 8px;
    }

    .options {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }

    .option {
        font-size: 15px;
        padding: 8px 10px;
    }
}

.stats-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 18px 32px;
    display: grid;
    gap: 8px;
}

.stats-page-title {
    margin: 6px 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-strong);
}

.stats-back {
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-neon);
}

.stats-back:hover {
    text-decoration: underline;
}

.stats-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 14px 28px rgba(5, 10, 16, 0.5);
}

.stats-accordion {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2px 4px;
    box-shadow: 0 14px 28px rgba(5, 10, 16, 0.5);
}

.stats-summary {
    list-style: none;
    cursor: pointer;
    display: block;
    width: 100%;
    padding: 6px 6px;
}

.stats-summary::-webkit-details-marker {
    display: none;
}

.stats-summary::marker {
    content: "";
}

.stats-accordion-body {
    display: grid;
    gap: 6px;
    padding: 2px 4px 6px;
}

.stats-subaccordion {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 2px 4px;
}

.stats-subsummary {
    list-style: none;
    cursor: pointer;
    display: block;
    width: 100%;
    padding: 5px 5px;
    color: var(--muted);
    font-size: 12px;
}

.stats-summary-inner {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    width: 100%;
}

.stats-count {
    margin-left: 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.stats-summary-metrics {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stats-subsummary::-webkit-details-marker {
    display: none;
}

.stats-subsummary::marker {
    content: "";
}

.stats-toggle {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.stats-toggle::before {
    content: "▾";
}

details[open] > .stats-summary .stats-toggle,
details[open] > .stats-subsummary .stats-toggle {
    transform: rotate(180deg);
}

.stats-subbody {
    display: grid;
    gap: 6px;
    padding: 2px 4px 6px;
}

.stats-case {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 9px;
    padding: 8px 10px;
}

.stats-title,
.stats-subtitle {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 560px) {
    .stats-summary-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title toggle"
            "metrics metrics";
        row-gap: 6px;
    }

    .stats-title,
    .stats-subtitle {
        grid-area: title;
    }

    .stats-summary-metrics {
        grid-area: metrics;
        justify-content: flex-start;
    }

    .stats-toggle {
        grid-area: toggle;
        align-self: center;
        justify-self: end;
    }

}

.stats-error {
    color: var(--danger);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.stats-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-strong);
}

.stats-total {
    font-size: 11px;
    color: var(--muted);
}

.stats-bar {
    margin: 6px 0 4px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}

.stats-correct {
    background: var(--success);
}

.stats-incorrect {
    background: var(--danger);
}

.stats-meta {
    font-size: 11px;
    line-height: 1.2;
    color: var(--muted);
}

.stats-ok {
    color: var(--success);
}

.stats-bad {
    color: var(--danger);
}

.welcome-page {
    display: flex;
    align-items: center;
    justify-content: center;
}


.welcome-shell {
    width: min(720px, 100%);
    padding: 32px 18px 40px;
    display: grid;
    gap: 18px;
}

.welcome-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 26px 22px 24px;
    box-shadow: 0 18px 38px rgba(5, 10, 16, 0.55);
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(74, 163, 255, 0.16);
    color: var(--accent-neon);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 11px;
}

.welcome-card h1 {
    margin: 14px 0 10px;
    font-size: 28px;
    line-height: 1.15;
}

.welcome-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
}

.welcome-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: grid;
    gap: 10px;
    font-size: 14px;
}

.welcome-list li {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
}

.welcome-actions {
    display: grid;
    gap: 10px;
}

.welcome-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    background: linear-gradient(135deg, #4aa3ff, #2b7fdc);
    color: #ffffff;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(43, 127, 220, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(43, 127, 220, 0.4);
}

.welcome-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    background: transparent;
    border: none;
    color: var(--accent-neon);
    text-decoration: none;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.welcome-secondary:hover {
    text-decoration: underline;
}

.welcome-footnote {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

.onboarding-shell {
    gap: 18px;
}

.onboarding-card {
    position: relative;
    overflow: hidden;
}

.onboarding-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 214, 102, 0.12), transparent 28%),
        radial-gradient(circle at bottom left, rgba(74, 163, 255, 0.12), transparent 32%);
    pointer-events: none;
}

.onboarding-progress,
.onboarding-highlight,
.onboarding-paths,
.onboarding-actions,
.onboarding-language-grid {
    position: relative;
    z-index: 1;
}

.onboarding-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.onboarding-dot.is-active {
    width: 28px;
    background: linear-gradient(135deg, rgba(255, 214, 102, 0.95), rgba(255, 179, 71, 0.88));
    border-color: rgba(255, 214, 102, 0.55);
}

.onboarding-highlight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 18px 0;
}

.onboarding-highlight-compact {
    margin: 8px 0 18px;
    padding: 14px;
}

.onboarding-highlight-number {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    color: #10141d;
    background: linear-gradient(145deg, #ffd666, #ffb347);
}

.onboarding-highlight-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-strong);
}

.onboarding-highlight-copy {
    margin-top: 4px;
    color: rgba(231, 237, 246, 0.7);
    font-size: 13px;
    line-height: 1.5;
}

.onboarding-list {
    margin-bottom: 20px;
}

.onboarding-actions {
    display: grid;
    gap: 10px;
}

.onboarding-language-grid {
    margin-top: 20px;
}

.onboarding-language-grid-extra {
    margin-top: 12px;
}

.onboarding-more-languages {
    margin-top: 8px;
    margin-bottom: 14px;
}

.onboarding-more-trigger {
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(74, 163, 255, 0.18);
    color: rgba(231, 237, 246, 0.92);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.onboarding-more-trigger:hover {
    text-decoration: none;
    transform: translateY(-1px);
    background: rgba(74, 163, 255, 0.1);
    border-color: rgba(74, 163, 255, 0.45);
}

.onboarding-paths {
    display: grid;
    gap: 12px;
    margin: 22px 0 12px;
}

.onboarding-path {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-strong);
    text-decoration: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.onboarding-path:hover {
    transform: translateY(-1px);
    border-color: rgba(74, 163, 255, 0.35);
    box-shadow: 0 12px 28px rgba(3, 8, 20, 0.22);
}

.onboarding-path-primary {
    background: linear-gradient(145deg, rgba(74, 163, 255, 0.22), rgba(74, 163, 255, 0.08));
    border-color: rgba(74, 163, 255, 0.42);
}

.onboarding-path-title {
    font-size: 15px;
    font-weight: 700;
}

.onboarding-path-copy {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(231, 237, 246, 0.68);
}

.dashboard-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 18px 40px;
    display: grid;
    gap: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.dashboard-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 12px 24px rgba(5, 10, 16, 0.5);
}

.dashboard-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.dashboard-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-strong);
}

.dashboard-table h2 {
    margin: 0 0 10px;
    font-size: 14px;
}

.dashboard-rows {
    display: grid;
    gap: 8px;
}

.dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text);
}

.language-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-shell {
    width: min(760px, 100%);
    padding: 32px 18px 50px;
}

.language-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 26px 22px 24px;
    box-shadow: 0 18px 38px rgba(5, 10, 16, 0.55);
}

.language-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.language-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.language-grid {
    display: grid;
    gap: 10px;
}

.language-option {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.language-option.is-active {
    border-color: rgba(74, 163, 255, 0.6);
    background: rgba(74, 163, 255, 0.14);
}

.language-recommended {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 214, 102, 0.95);
    background: rgba(255, 214, 102, 0.12);
    border: 1px solid rgba(255, 214, 102, 0.18);
}

.settings-save {
    margin-top: 16px;
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #4aa3ff, #2b7fdc);
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-save:disabled {
    opacity: 0.6;
    cursor: default;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.settings-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(43, 127, 220, 0.3);
}

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

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 560px) {
    .topbar h1 {
        font-size: 18px;
    }

    .cards {
        max-width: 420px;
    }

    .welcome-shell {
        padding: 60px 24px 60px;
    }

    .welcome-card {
        padding: 32px 34px 30px;
    }

    .welcome-card h1 {
        font-size: 34px;
    }

    .language-shell {
        padding: 60px 24px 60px;
    }

    .language-card {
        padding: 32px 34px 30px;
    }

    .language-card h1 {
        font-size: 32px;
    }

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

.trainer-card-admin {
    background:
        radial-gradient(circle at top right, rgba(255, 214, 102, 0.22), transparent 42%),
        linear-gradient(160deg, rgba(24, 30, 44, 0.96), rgba(12, 17, 28, 0.98));
    border-color: rgba(255, 214, 102, 0.28);
}

.dashboard-admin-shell {
    gap: 20px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(255, 214, 102, 0.18), transparent 30%),
        linear-gradient(145deg, rgba(22, 31, 48, 0.96), rgba(10, 15, 25, 0.98));
    box-shadow: 0 18px 42px rgba(3, 8, 20, 0.28);
}

.dashboard-kicker {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 214, 102, 0.9);
    margin-bottom: 10px;
}

.dashboard-headline {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
}

.dashboard-copy {
    margin: 10px 0 0;
    color: rgba(231, 237, 246, 0.72);
    max-width: 420px;
}

.dashboard-hero-badge {
    min-width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    font-size: 28px;
    font-weight: 700;
    color: #0f1320;
    background: linear-gradient(145deg, #ffd666, #ffb347);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

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

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.4fr);
    gap: 20px;
}

.dashboard-panel {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 20, 32, 0.9);
    box-shadow: 0 16px 36px rgba(3, 8, 20, 0.2);
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-panel-head h3,
.dashboard-table-detail h4 {
    margin: 0;
    font-size: 16px;
}

.dashboard-panel-head span {
    color: rgba(231, 237, 246, 0.62);
    font-size: 13px;
}

.dashboard-user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 720px;
    overflow: auto;
}

.dashboard-user-item {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    border-radius: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-user-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 214, 102, 0.35);
}

.dashboard-user-item.is-active {
    background: linear-gradient(145deg, rgba(255, 214, 102, 0.16), rgba(255, 179, 71, 0.08));
    border-color: rgba(255, 214, 102, 0.42);
}

.dashboard-user-main,
.dashboard-user-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-user-name,
.dashboard-detail-name {
    font-size: 15px;
    font-weight: 700;
}

.dashboard-user-meta,
.dashboard-detail-subline {
    color: rgba(231, 237, 246, 0.62);
    font-size: 12px;
}

.dashboard-user-stats {
    align-items: flex-end;
    font-size: 12px;
    color: rgba(231, 237, 246, 0.8);
}

.dashboard-detail-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-detail-role {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 214, 102, 0.14);
    border: 1px solid rgba(255, 214, 102, 0.2);
    color: rgba(255, 214, 102, 0.96);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-detail-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-detail-card span {
    font-size: 12px;
    color: rgba(231, 237, 246, 0.58);
}

.dashboard-detail-card strong {
    font-size: 14px;
}

.dashboard-grid-detail {
    margin-bottom: 14px;
}

.dashboard-card-soft {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.dashboard-table-detail {
    margin-top: 6px;
}

.dashboard-row-detail {
    font-size: 13px;
}

@media (max-width: 820px) {
    .dashboard-hero,
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-admin,
    .dashboard-detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-badge {
        width: 84px;
        height: 84px;
        min-width: 84px;
        font-size: 24px;
    }
}

.trainer-card-placement {
    border-color: rgba(102, 204, 255, 0.5);
    background: linear-gradient(180deg, rgba(17, 26, 36, 0.96), rgba(10, 21, 32, 0.96));
}

.placement-test-shell {
    width: min(760px, calc(100% - 20px));
    margin: 18px auto 36px;
    display: grid;
    gap: 14px;
}

.placement-hero-card,
.placement-question-card,
.placement-report-card,
.placement-progress-block {
    background: rgba(13, 19, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 22px 48px rgba(5, 10, 16, 0.6);
}

.placement-hero-card,
.placement-question-card,
.placement-report-card {
    padding: 18px;
}

.placement-question-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-neon);
    margin-bottom: 8px;
}

.placement-hero-card h1,
.placement-question-card h2,
.placement-report-card h2,
.placement-step-block h3,
.placement-report-card h3 {
    margin: 0;
    color: var(--text-strong);
}

.placement-hero-card p,
.placement-feedback-text,
.placement-report-empty {
    color: var(--muted);
    line-height: 1.6;
}

.placement-primary-button {
    border: 1px solid rgba(74, 163, 255, 0.45);
    background: linear-gradient(135deg, rgba(74, 163, 255, 0.35), rgba(74, 163, 255, 0.08));
    color: var(--text-strong);
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.placement-primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px var(--glow), var(--neon-glow);
}

.placement-primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.placement-inline-error {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 107, 107, 0.14);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: #ffd8d8;
}

.placement-progress-block {
    padding: 14px 16px;
}

.placement-progress-meta,
.placement-question-meta,
.placement-feedback-grid,
.placement-report-summary,
.placement-report-columns,
.placement-skill-row {
    display: grid;
    gap: 10px;
}

.placement-progress-meta,
.placement-question-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    color: var(--muted);
    font-size: 13px;
}

.placement-progress-rail {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.placement-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-neon), var(--accent-strong));
}

.placement-step-block {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.placement-step-label,
.placement-feedback-debug,
.placement-skill-row span,
.placement-report-summary span {
    color: var(--muted);
    font-size: 12px;
}

.placement-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}

.placement-option-button {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-strong);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.placement-option-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(102, 204, 255, 0.48);
}

.placement-option-button:disabled {
    cursor: default;
}

.placement-option-button-selected {
    border-color: rgba(102, 204, 255, 0.6);
    background: rgba(74, 163, 255, 0.16);
}

.placement-option-button-correct {
    border-color: rgba(66, 231, 176, 0.65);
    background: rgba(66, 231, 176, 0.18);
}

.placement-option-button-wrong {
    border-color: rgba(255, 107, 107, 0.6);
    background: rgba(255, 107, 107, 0.18);
}

.placement-feedback {
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.placement-feedback-success {
    background: rgba(66, 231, 176, 0.12);
    border-color: rgba(66, 231, 176, 0.3);
}

.placement-feedback-error {
    background: rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.28);
}

.placement-feedback-title {
    font-weight: 700;
    margin-bottom: 10px;
}

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

.placement-feedback-grid strong,
.placement-report-summary strong,
.placement-skill-row strong {
    color: var(--text-strong);
}

.placement-report-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--text);
}

.placement-report-summary {
    margin: 14px 0 8px;
}

.placement-report-summary > div,
.placement-skill-row {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.placement-skill-table {
    display: grid;
    gap: 10px;
}

.placement-skill-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

@media (max-width: 640px) {
    .placement-test-shell {
        width: calc(100% - 16px);
        margin-top: 12px;
    }

    .placement-progress-meta,
    .placement-question-meta,
    .placement-feedback-grid,
    .placement-report-summary,
    .placement-report-columns,
    .placement-skill-row {
        grid-template-columns: 1fr;
    }
}
