/* ══════════════════════════════════════════
   TrainEng — Bright & Energetic Stylesheet
   A fresh, study-friendly light theme
   ══════════════════════════════════════════ */

/* ── CSS Variables ───────────────────────── */
:root {
    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-light: rgba(99, 102, 241, 0.12);
    --border-default: #e2e8f0;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent-indigo: #6366f1;
    --accent-indigo-light: #e0e7ff;
    --accent-indigo-glow: rgba(99, 102, 241, 0.15);
    --accent-emerald: #10b981;
    --accent-emerald-light: #d1fae5;
    --accent-emerald-glow: rgba(16, 185, 129, 0.15);
    --accent-green: #10b981;
    --accent-green-light: #d1fae5;
    --accent-coral: #ef4444;
    --accent-coral-light: #fee2e2;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fef3c7;
    --accent-sky: #0ea5e9;
    --accent-sky-light: #e0f2fe;

    --gradient-header: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-btn: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 12px rgba(99, 102, 241, 0.08);
    --shadow-glow-indigo: 0 4px 20px rgba(99, 102, 241, 0.2);
    --shadow-glow-emerald: 0 4px 20px rgba(16, 185, 129, 0.2);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Subtle decorative background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(99, 102, 241, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Lucide Icon Sizes ───────────────────── */
.icon-xs {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.icon-sm {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-btn {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.icon-lg {
    width: 36px;
    height: 36px;
}

.icon-xl {
    width: 56px;
    height: 56px;
    color: var(--accent-indigo);
}

.icon-amber {
    color: #d97706;
}

.stat-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-indigo);
    margin-bottom: 8px;
    opacity: 0.6;
}

.score-icon {
    margin-bottom: 8px;
}

.score-perfect .score-icon {
    color: #059669;
}

.score-good .score-icon {
    color: var(--accent-indigo);
}

.score-partial .score-icon {
    color: #d97706;
}

.score-low .score-icon {
    color: #dc2626;
}

/* ── Header ──────────────────────────────── */
.app-header {
    background: var(--gradient-header);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo .accent {
    color: #fde68a;
}

.header-stats {
    display: flex;
    gap: 10px;
}

.admin-header-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.admin-header-link:hover {
    background: rgba(255, 255, 255, .28);
    color: white;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 4px 14px;
}

.stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fde68a;
}

/* Progress bar */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fde68a, #fbbf24);
    border-radius: 0 2px 2px 0;
    transition: width var(--transition-normal);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* ── Main Content ────────────────────────── */
.main-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
}

/* ── Topic Selection ────────────────────── */
.topics-container {
    animation: fadeSlideIn 0.4s ease;
}

.topics-header {
    text-align: center;
    margin-bottom: 32px;
}

.topics-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.topics-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Level filter row: tabs + action chips in one line */
.level-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.level-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 18px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
}

.filter-tab.active {
    background: var(--gradient-btn);
    color: white;
    border-color: transparent;
}

/* "Cần ôn" review filter tab */
.filter-tab-review {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-color: rgba(139, 92, 246, .4);
    color: #7c3aed;
}

.filter-tab-review:hover {
    border-color: #7c3aed;
    background: rgba(139, 92, 246, .06);
    color: #7c3aed;
}

.filter-tab-review.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
}

.review-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7c3aed;
    color: white;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    line-height: 1;
}

.filter-tab-review.active .review-filter-count {
    background: rgba(255, 255, 255, .3);
}

/* ── Tag Filter Row ──────────────────────── */
.tag-filter-row {
    max-width: 800px;
    margin: 0 auto 8px;
    padding: 0 16px;
}

.tag-filter-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.tag-filter-icon {
    color: var(--text-muted);
    margin-right: 2px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    border: 1.5px solid var(--border-default);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tag-pill:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.04);
}

.tag-pill.active {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: white;
}

/* Tag color variants — pill active state */
.tag-pill.active.tag-emerald {
    background: #10b981;
    border-color: #10b981;
}

.tag-pill.active.tag-amber {
    background: #f59e0b;
    border-color: #f59e0b;
}

.tag-pill.active.tag-rose {
    background: #f43f5e;
    border-color: #f43f5e;
}

.tag-pill.active.tag-sky {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.tag-pill.active.tag-purple {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.tag-pill.active.tag-teal {
    background: #14b8a6;
    border-color: #14b8a6;
}

.tag-pill.active.tag-orange {
    background: #f97316;
    border-color: #f97316;
}

.tag-pill.active.tag-pink {
    background: #ec4899;
    border-color: #ec4899;
}

.tag-pill.active.tag-slate {
    background: #64748b;
    border-color: #64748b;
}

/* Tag color variants — pill hover (non-active) */
.tag-pill.tag-emerald:not(.active):hover {
    border-color: #10b981;
    color: #10b981;
}

.tag-pill.tag-amber:not(.active):hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.tag-pill.tag-rose:not(.active):hover {
    border-color: #f43f5e;
    color: #f43f5e;
}

.tag-pill.tag-sky:not(.active):hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.tag-pill.tag-purple:not(.active):hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.tag-pill.tag-teal:not(.active):hover {
    border-color: #14b8a6;
    color: #14b8a6;
}

.tag-pill.tag-orange:not(.active):hover {
    border-color: #f97316;
    color: #f97316;
}

.tag-pill.tag-pink:not(.active):hover {
    border-color: #ec4899;
    color: #ec4899;
}

.tag-pill.tag-slate:not(.active):hover {
    border-color: #64748b;
    color: #64748b;
}

/* ── Topic Card Bottom Row ──────────────── */
.topic-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
    gap: 8px;
}

.topic-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.topic-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--accent-indigo-light);
    color: var(--accent-indigo);
}

.tag-chip-icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Tag chip color variants */
.topic-tag-chip.tag-emerald {
    background: #d1fae5;
    color: #059669;
}

.topic-tag-chip.tag-amber {
    background: #fef3c7;
    color: #d97706;
}

.topic-tag-chip.tag-rose {
    background: #ffe4e6;
    color: #e11d48;
}

.topic-tag-chip.tag-sky {
    background: #e0f2fe;
    color: #0284c7;
}

.topic-tag-chip.tag-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.topic-tag-chip.tag-teal {
    background: #ccfbf1;
    color: #0d9488;
}

.topic-tag-chip.tag-orange {
    background: #ffedd5;
    color: #ea580c;
}

.topic-tag-chip.tag-pink {
    background: #fce7f3;
    color: #db2777;
}

.topic-tag-chip.tag-slate {
    background: #f1f5f9;
    color: #475569;
}

/* Level badges */
.level-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-beginner {
    background: #d1fae5;
    color: #065f46;
}

.level-intermediate {
    background: #fef3c7;
    color: #92400e;
}

.level-advanced {
    background: #fee2e2;
    color: #991b1b;
}

.level-mixed {
    background: #ede9fe;
    color: #5b21b6;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Share mode overrides */
.topic-grid.share-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.topic-grid.share-mode .topic-card {
    width: 100%;
    max-width: 420px;
    height: 300px;
    /* Fixed height for consistency */
}

.topic-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 28px;
    cursor: default;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 220px;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-header);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-indigo);
    border-color: rgba(99, 102, 241, 0.3);
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-indigo-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.topic-card:hover .topic-card-icon {
    background: var(--gradient-btn);
}

.topic-icon-svg {
    width: 28px;
    height: 28px;
    color: var(--accent-indigo);
    transition: color var(--transition-normal);
}

.topic-card:hover .topic-icon-svg {
    color: white;
}

.topic-card-body {
    flex: 1;
}

.topic-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.topic-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.9em;
}

.topic-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.topic-pair-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.topic-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gradient-btn);
    border: none;
    font-family: var(--font-family);
    cursor: pointer;
    padding: 7px 16px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.topic-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    border-radius: inherit;
}

.topic-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.topic-start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.start-btn-arrow {
    transition: transform 0.2s ease;
}

.topic-start-btn:hover .start-btn-arrow {
    transform: translateX(3px);
}

.topic-card:hover .topic-start-btn {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

/* Lesson top bar */
.lesson-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Back button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: var(--accent-indigo-light);
}

.btn-view-results {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: var(--accent-indigo-light);
}

.btn-view-results:hover {
    background: var(--gradient-btn);
    color: white;
    border-color: transparent;
}

/* ── Loading ─────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--accent-indigo-light);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Question Card ───────────────────────── */
.question-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-header);
}

.question-card.card-correct {
    border-color: var(--accent-emerald);
    box-shadow: var(--shadow-glow-emerald);
}

.question-card.card-correct::before {
    background: var(--gradient-success);
}

.question-card.card-partial::before {
    background: linear-gradient(90deg, var(--accent-amber), #fb923c);
}

.card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-indigo);
    margin-bottom: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}



.vietnamese-text {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Grammar note toggle (collapsed by default) */
.grammar-toggle-area {
    margin-top: 12px;
}

.grammar-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 50px;
    border: 1.5px solid rgba(245, 158, 11, .35);
    background: var(--accent-amber-light);
    color: #92400e;
    font-family: var(--font-family);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.grammar-toggle-btn:hover {
    border-color: #f59e0b;
    background: #fde68a;
}

.grammar-toggle-btn.grammar-open {
    border-color: #f59e0b;
    background: #fde68a;
}

/* Chevron rotates without Lucide icon swap */
.grammar-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.grammar-chevron.rotated {
    transform: rotate(180deg);
}

.grammar-note {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--accent-indigo-light);
    border-left: 4px solid var(--accent-indigo);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.note-icon {
    flex-shrink: 0;
}

/* Compact shuffle toggle inside lesson top bar */
.btn-shuffle-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 50px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-shuffle-mini:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
}

.btn-shuffle-mini.shuffle-on {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: white;
}

/* ── Input Section ───────────────────────── */
.input-section {
    margin-bottom: 20px;
}

.input-wrapper {
    margin-bottom: 16px;
}

.input-wrapper.input-disabled {
    opacity: 0.6;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.answer-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1.1rem;
    resize: none;
    transition: all var(--transition-fast);
    outline: none;
}

.answer-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px var(--accent-indigo-glow);
    background: white;
}

.answer-input::placeholder {
    color: var(--text-muted);
}

.answer-input:disabled {
    cursor: not-allowed;
    background: #f8fafc;
}

/* ── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-submit {
    background: var(--gradient-btn);
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(99, 102, 241, 0.2);
    letter-spacing: 0.3px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-indigo);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1rem;
}

/* ── Hint Section ────────────────────────── */
.hint-section {
    margin-bottom: 24px;
}

.hint-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-hint {
    flex: 1;
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    color: var(--text-secondary);
    padding: 10px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-hint:hover:not(:disabled) {
    border-color: var(--accent-amber);
    color: #b45309;
    background: var(--accent-amber-light);
}

.btn-hint.hint-used {
    border-color: var(--accent-amber);
    background: var(--accent-amber-light);
    color: #b45309;
    font-weight: 600;
}

.btn-hint.hint-locked {
    opacity: 0.3;
}

.hint-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-amber-light);
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: 4px;
}

.hint-display {
    background: var(--accent-amber-light);
    border: 2px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    animation: fadeSlideIn 0.3s ease;
}

.hint-label {
    font-size: 0.75rem;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hint-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* ── Feedback Section ────────────────────── */
.feedback-section {
    margin-bottom: 24px;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-display {
    text-align: center;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.score-display.score-perfect {
    background: var(--accent-emerald-light);
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.score-display.score-good {
    background: var(--accent-indigo-light);
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.score-display.score-partial {
    background: var(--accent-amber-light);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.score-display.score-low {
    background: var(--accent-coral-light);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.score-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.score-perfect .score-number {
    color: #059669;
}

.score-good .score-number {
    color: var(--accent-indigo);
}

.score-partial .score-number {
    color: #d97706;
}

.score-low .score-number {
    color: #dc2626;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Diff display */
.diff-display {
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 12px;
}

.diff-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.diff-word {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.diff-correct {
    background: var(--accent-emerald-light);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.diff-wrong {
    background: var(--accent-coral-light);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
    text-decoration: line-through;
}

.diff-missing {
    background: var(--accent-amber-light);
    color: #d97706;
    border: 1px dashed rgba(245, 158, 11, 0.4);
    font-style: italic;
}

/* Correct answer */
.correct-answer {
    background: var(--accent-emerald-light);
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 12px;
}

.correct-label {
    font-size: 0.75rem;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.correct-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* TTS (Text-to-Speech) buttons */
.correct-answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tts-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tts-buttons.tts-inline {
    margin-left: auto;
}

.btn-tts {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border-default);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--accent-indigo);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-tts:hover {
    border-color: var(--accent-indigo);
    background: var(--accent-indigo-light);
    transform: scale(1.1);
}

.btn-tts:active {
    transform: scale(0.95);
}

.btn-tts-slow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.btn-tts-slow:hover {
    color: var(--accent-indigo);
}

.penalty-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #d97706;
    padding: 8px;
    font-weight: 500;
}

/* ── Navigation (sticky bottom) ─────────── */
.nav-section {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    background: rgba(237, 233, 254, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    z-index: 10;
}

.btn-nav {
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    color: var(--text-secondary);
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 100px;
}

.btn-nav:hover:not(:disabled) {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: var(--accent-indigo-light);
}

.btn-next {
    background: var(--gradient-btn);
    color: white;
    border: none;
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-indigo);
    color: white;
}

.nav-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-dot:hover {
    transform: scale(1.3);
    background: #cbd5e1;
}

.nav-dot.dot-current {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 8px var(--accent-indigo-glow);
    transform: scale(1.2);
}

.nav-dot.dot-correct {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

.nav-dot.dot-partial {
    background: var(--accent-amber);
    border-color: var(--accent-amber);
}

.nav-dot.dot-wrong {
    background: var(--accent-coral);
    border-color: var(--accent-coral);
}

/* ── Keyboard Shortcuts Bar ──────────────── */
.shortcut-bar {
    margin-top: 16px;
    text-align: center;
}

.shortcut-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shortcut-toggle:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
}

.shortcut-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

kbd {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.7rem;
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border-default);
    line-height: 1.4;
}

/* ── Results Screen ──────────────────────── */
.results-container {
    animation: fadeSlideIn 0.5s ease;
}

.results-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.results-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.results-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--accent-indigo);
}

.results-topic {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.result-stat {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    min-width: 130px;
}

.result-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-indigo);
    line-height: 1;
    margin-bottom: 6px;
}

.result-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.results-breakdown {
    text-align: left;
    margin-bottom: 32px;
}

.results-breakdown h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.breakdown-item:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.breakdown-item.item-perfect {
    border-left: 4px solid var(--accent-emerald);
    background: rgba(16, 185, 129, 0.04);
}

.breakdown-index {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    min-width: 24px;
}

.breakdown-vi {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breakdown-score {
    font-weight: 800;
    font-size: 0.9rem;
}

.score-good {
    color: #059669;
}

.score-bad {
    color: #dc2626;
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.results-actions .btn {
    min-width: 170px;
}

/* ── Empty State ─────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 0;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

.empty-state code {
    background: var(--accent-indigo-light);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--accent-indigo);
    font-weight: 600;
}

/* ── Footer ──────────────────────────────── */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 2px solid var(--border-light);
    background: var(--bg-secondary);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 640px) {
    .header-content {
        padding: 12px 16px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 20px 16px;
    }

    .question-card {
        padding: 24px 20px;
    }

    .vietnamese-text {
        font-size: 1.2rem;
    }

    .hint-buttons {
        flex-direction: column;
    }

    .results-stats {
        flex-direction: column;
        align-items: center;
    }

    .result-stat {
        width: 100%;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }

    .nav-dots {
        display: none;
    }
}

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Selection ───────────────────────────── */
::selection {
    background: var(--accent-indigo-light);
    color: var(--accent-indigo);
}

/* ══════════════════════════════════════════
   Phase 2.4 — Progress / Dashboard
   ══════════════════════════════════════════ */

/* Header dashboard pill button */
.btn-dashboard-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, .22);
    border: 1.5px solid rgba(255, 255, 255, .4);
    color: white;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-dashboard-pill:hover {
    background: rgba(255, 255, 255, .35);
    border-color: rgba(255, 255, 255, .65);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

/* ── Topic stat chip (on topic cards) ────── */
.topic-stat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--accent-indigo-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--accent-indigo);
    font-weight: 600;
    margin-top: 2px;
}

.topic-stat-sep {
    color: var(--text-muted);
    font-weight: 300;
}

/* ── Dashboard container ─────────────────── */
.dashboard-container {
    animation: fadeSlideIn 0.35s ease;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Stat grid ───────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.stat-icon-indigo {
    background: var(--accent-indigo-light);
    color: var(--accent-indigo);
}

.stat-icon-emerald {
    background: #d1fae5;
    color: #059669;
}

.stat-icon-amber {
    background: var(--accent-amber-light);
    color: #b45309;
}

.stat-icon-rose {
    background: #fee2e2;
    color: #dc2626;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.stat-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-card-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Topic stats list ────────────────────── */
.dashboard-section {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.topic-stats-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.topic-stat-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.topic-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.topic-stat-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.topic-stat-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.stat-pill-green {
    background: #d1fae5;
    color: #059669;
    border-color: rgba(5, 150, 105, .2);
}

/* Mini progress bar */
.topic-stat-bar {
    height: 5px;
    background: var(--border-light);
    border-radius: 50px;
    overflow: hidden;
}

.topic-stat-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.8s ease;
}

.bar-green {
    background: linear-gradient(90deg, #10b981, #059669);
}

.bar-amber {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.bar-red {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ── Guest info box (inside dashboard) ───── */
.guest-info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent-indigo-light);
    border: 1px solid rgba(99, 102, 241, .2);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* ── Guest banner (fixed bottom toast) ────── */
.guest-banner {
    position: fixed;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-xl);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-glow-indigo);
    z-index: 200;
    max-width: 500px;
    width: calc(100% - 48px);
    animation: slideUpIn 0.4s ease;
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.guest-banner-icon {
    color: #fde68a;
    flex-shrink: 0;
}

.guest-banner-text {
    flex: 1;
    font-size: 0.82rem;
    line-height: 1.4;
}

.guest-banner-note {
    display: block;
    color: rgba(255, 255, 255, .65);
    font-size: 0.77rem;
}

.guest-banner-dismiss {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    color: white;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast);
    font-family: var(--font-family);
}

.guest-banner-dismiss:hover {
    background: rgba(255, 255, 255, .28);
}

/* ══════════════════════════════════════════
   Phase 2.5 — Bookmarks  /  2.6 — Shuffle
   ══════════════════════════════════════════ */

/* ── Topics toolbar (shuffle + bookmark info) */
.topics-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shuffle-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    border: 2px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shuffle-toggle:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
}

.shuffle-toggle.shuffle-on {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
    color: white;
}

.shuffle-status {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bookmark-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b45309;
    background: var(--accent-amber-light);
    border-radius: 50px;
    padding: 5px 12px;
}

/* ── Bookmark button (in lesson top bar) ─── */
.btn-bookmark {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 50px;
    border: 2px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-bookmark:hover {
    border-color: #f59e0b;
    color: #b45309;
}

.btn-bookmark.bookmarked {
    background: var(--accent-amber-light);
    border-color: #f59e0b;
    color: #b45309;
}

.btn-bookmark.bookmarked svg {
    fill: #f59e0b;
}

/* ── Breakdown star (in results) ─────────── */
.breakdown-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.breakdown-star:hover {
    color: #f59e0b;
}

.breakdown-star.star-active {
    color: #f59e0b;
}

.breakdown-star.star-active svg {
    fill: #f59e0b;
}

/* ── Bookmark list in Dashboard ─────────── */
.bookmark-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    background: #f59e0b;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 4px;
}

.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.bookmark-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.bookmark-row:hover {
    background: var(--accent-amber-light);
}

.bookmark-pair-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.bookmark-vi {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.bookmark-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.bookmark-en {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.bookmark-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.bookmark-remove:hover {
    color: #ef4444;
}

.bookmark-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

/* Dashboard section header row (title + action button) */
.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dashboard-section-header .dashboard-section-title {
    margin-bottom: 0;
}

/* Practice Bookmarks button */
.btn-practice-bookmarks {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(16, 185, 129, .3);
}

.btn-practice-bookmarks:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, .4);
}

/* ══════════════════════════════════════════
   Share features
   ══════════════════════════════════════════ */

/* Share topic link button — inside topic-card-bottom */
.btn-share-topic {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.btn-share-topic:hover {
    color: var(--accent-indigo);
}

/* ── Review due badge (on topic card) ── */
.review-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 6px;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.review-due-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

/* ── Review mode banner (top of lesson) ── */
.review-mode-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.review-mode-count {
    margin-left: auto;
    font-weight: 400;
    opacity: 0.85;
    font-size: 0.8rem;
}

/* Results share card (captured by html2canvas) */
.results-share-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px 20px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.share-card-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-indigo);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.share-card-footer {
    margin-top: 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Share result button */
.btn-share-result {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
    border-color: transparent !important;
}

.btn-share-result:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}

/* Share toast notification */
.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-family);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
    z-index: 9999;
}

/* ══════════════════════════════════════════
   Auth — Header Area
   ══════════════════════════════════════════ */

.header-auth-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Login button (guest) */
.btn-auth-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.btn-auth-login:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
}

/* User pill (logged in) */
.auth-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-pill:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Guest banner login CTA */
.btn-guest-login {
    padding: 6px 14px;
    border: 1.5px solid white;
    border-radius: 50px;
    background: transparent;
    color: white;
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-guest-login:hover {
    background: white;
    color: var(--accent-indigo);
}

/* Info box login CTA */
.btn-info-login {
    margin-left: 8px;
    padding: 4px 12px;
    border: 1.5px solid var(--accent-indigo);
    border-radius: 50px;
    background: transparent;
    color: var(--accent-indigo);
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-info-login:hover {
    background: var(--accent-indigo);
    color: white;
}

/* Synced info box (logged in) */
.guest-info-synced {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

/* ══════════════════════════════════════════
   Auth Modal
   ══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 36px;
    position: relative;
    width: 100%;
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal-box {
    max-width: 400px;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border-default);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--border-default);
    color: var(--text-primary);
}

/* Auth Modal Header */
.auth-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-indigo);
}

.auth-modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Error message */
.auth-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 14px;
    margin-bottom: 16px;
    text-align: center;
}

/* Form fields */
.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    outline: none;
}

.auth-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px var(--accent-indigo-glow);
    background: white;
}

.auth-submit-btn {
    margin-top: 8px;
}

/* Spinner inside button */
.auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

/* Switch mode link */
.auth-switch-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    background: none;
    border: none;
    color: var(--accent-indigo);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity var(--transition-fast);
}

.auth-switch-btn:hover {
    opacity: 0.75;
}

/* User modal (logged in view) */
.auth-modal-avatar {
    text-align: center;
    margin-bottom: 12px;
    color: var(--accent-indigo);
}

.auth-modal-greeting {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.auth-modal-greeting strong {
    color: var(--text-primary);
    font-size: 1.15rem;
    display: block;
    margin-top: 2px;
}

.auth-modal-email {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 2px solid #fee2e2;
    border-radius: var(--radius-md);
    background: #fff5f5;
    color: #dc2626;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* ══════════════════════════════════════════
   Claim Device Modal
   ══════════════════════════════════════════ */

.claim-modal-box {
    max-width: 380px;
    text-align: center;
}

.claim-modal-icon {
    color: var(--accent-indigo);
    margin-bottom: 16px;
}

.claim-modal-box h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.claim-modal-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.claim-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.claim-modal-actions .btn-submit {
    width: 100%;
}

.claim-modal-actions .btn-nav {
    width: 100%;
    justify-content: center;
}

/* ═══════════════════════════════════════════════ */
/* AI Explain Feature                              */
/* ═══════════════════════════════════════════════ */

.ai-explain-section {
    margin-top: 12px;
}

.btn-ai-explain {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-ai-explain:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

.btn-ai-explain:disabled {
    opacity: 0.7;
    cursor: wait;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: spin 1s linear infinite;
}

.ai-explain-panel {
    margin-top: 12px;
    background: var(--bg-card);
    border: 1.5px solid rgba(99, 102, 241, .25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, .12);
}

.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(99, 102, 241, .1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(99, 102, 241, .15);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-indigo);
}

.ai-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.ai-panel-close:hover {
    color: var(--text-primary);
}

.ai-panel-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-explain-row {
    display: flex;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.55;
    padding-left: 10px;
    border-left: 3px solid transparent;
}

.ai-explain-row.ai-error {
    border-color: #ef4444;
}

.ai-explain-row.ai-rule {
    border-color: #f59e0b;
}

.ai-explain-row.ai-example {
    border-color: #10b981;
}

.ai-row-label {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 65px;
}

/* ── AI Appeal ──────────────────────── */
.btn-ai-appeal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.btn-ai-appeal:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
}

.btn-ai-appeal:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ai-appeal-panel {
    margin-top: 12px;
    background: var(--bg-card);
    border: 1.5px solid rgba(245, 158, 11, .25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(245, 158, 11, .12);
}

.ai-appeal-panel .appeal-accepted {
    background: linear-gradient(90deg, rgba(16, 185, 129, .15) 0%, transparent 100%);
    border-bottom-color: rgba(16, 185, 129, .25);
    color: #059669;
}

.ai-appeal-panel .appeal-rejected {
    background: linear-gradient(90deg, rgba(239, 68, 68, .10) 0%, transparent 100%);
    border-bottom-color: rgba(239, 68, 68, .20);
    color: #dc2626;
}

.appeal-score {
    margin-left: auto;
    margin-right: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .6);
    color: var(--text-primary);
}

/* Highlighted row when AI changed the score */
.ai-appeal-score-changed {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding-left: 10px !important;
}

/* ── App Footer ────────────────────── */
.app-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.footer-copyright {
    font-size: 0.75rem;
    opacity: 0.6;
    padding-top: 6px;
    width: 60%;
    max-width: 300px;
}

/* ── Leave Lesson Confirm Modal ──────── */
.leave-modal-box {
    max-width: 380px;
    text-align: center;
    padding: 32px 24px 24px;
}

.leave-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    animation: leave-pulse 1.5s ease-in-out infinite;
}

@keyframes leave-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.leave-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.leave-modal-msg {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.leave-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-leave-stay {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-leave-stay:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-leave-go {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 2px solid #ef4444;
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-leave-go:hover {
    background: #ef4444;
    color: #fff;
}

/* ── Ready Modal (Pre-lesson) ──────────── */
.ready-modal-box {
    text-align: center;
    max-width: 380px;
    padding: 32px 28px 24px;
}

.ready-modal-icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

.ready-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ready-modal-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ready-badge {
    background: var(--accent-indigo-light);
    color: var(--accent-indigo);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
}

.ready-pairs {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
}

.ready-modal-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 0 4px;
}

.ready-toggles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin: 0 auto 24px auto;
    width: fit-content;
    padding: 16px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.ready-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.ready-toggle:hover {
    color: var(--text-primary);
}

.ready-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: var(--bg-card);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin: 0;
}

.ready-toggle input[type="checkbox"]:hover {
    border-color: var(--accent-indigo-light);
}

.ready-toggle input[type="checkbox"]:checked {
    background-color: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

.ready-toggle input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
}

.btn-ready-start {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ready-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-ready-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: #f97316;
    cursor: pointer;
    padding: 6px;
    font-weight: 600;
    transition: color 0.2s;
}

.btn-ready-cancel:hover {
    color: #ea580c;
}

/* ── Shared mode branded back button ──────── */
.btn-back-shared {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    background: var(--gradient-header);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.btn-back-shared:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.shared-logo-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.shared-logo-text {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shared-logo-text .accent {
    color: #fde68a;
}

.back-shared-sep {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 2px;
}

/* ── Results secondary row ─────────────── */
.results-secondary {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Lesson timer ──────────────────────── */
.lesson-timer {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--accent-indigo);
    background: var(--bg-primary);
    border: 2px solid var(--accent-indigo-light);
    padding: 2px 12px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

@media (min-width: 848px) {
    .lesson-timer {
        left: calc(50% - 400px + 24px);
    }
}

@media (max-width: 768px) {
    .lesson-timer {
        left: 16px;
    }
}