/* ── Variables ─────────────────────────────────────────────────── */
:root {
    --primary: #FF6B6B;
    --primary-dark: #e55555;
    --secondary: #4ECDC4;
    --secondary-dark: #3dbdb5;
    --accent: #FFE66D;
    --success: #2ECC71;
    --error: #E74C3C;
    --bg: #FFF9F0;
    --bg-card: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7f8c8d;
    --border: #ecf0f1;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-small: 8px;
    --font-body: 'Nunito', sans-serif;
    --font-chinese: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: white;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-name {
    font-weight: 700;
    color: var(--text);
}

.stat-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-badge.points {
    background: var(--accent);
    color: #856404;
}

.stat-badge.streak {
    background: #dff0d8;
    color: #3c763d;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px 28px;
    border: 3px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    min-height: 48px;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-mandarin { background: #ff7675; color: white; }
.btn-cantonese { background: #6c5ce7; color: white; }

.btn-speak { background: var(--secondary); color: white; font-size: 1.3rem; }

.btn-quiz {
    background: white;
    border: 3px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    padding: 16px 24px;
    width: 100%;
    margin-bottom: 8px;
}
.btn-quiz:hover { border-color: var(--primary); }

.btn-large { font-size: 1.3rem; padding: 16px 36px; min-height: 60px; }
.btn-small { font-size: 0.85rem; padding: 6px 16px; min-height: auto; }

/* ── Profile Selection ────────────────────────────────────────── */
.profile-select { text-align: center; padding: 60px 0; }

.welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--text);
}

.profile-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    min-width: 200px;
    cursor: pointer;
    border: 3px solid transparent;
}

.profile-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.profile-avatar.new {
    background: var(--border);
    color: var(--text-light);
}

.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-info { font-size: 0.9rem; color: var(--text-light); margin-top: 4px; }
.profile-streak { font-size: 0.9rem; color: var(--success); font-weight: 700; margin-top: 4px; }

.new-profile-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.new-profile-form h2 { text-align: center; margin-bottom: 20px; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.input-large {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.1rem;
    border: 3px solid var(--border);
    border-radius: var(--radius-small);
    font-family: var(--font-body);
}

.input-large:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Dashboard ────────────────────────────────────────────────── */
.dashboard h1 {
    font-size: 2rem;
    margin-bottom: 24px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card.accent {
    background: var(--accent);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 700;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--border);
}

.action-card.primary { border-left-color: var(--primary); }
.action-card.secondary { border-left-color: var(--secondary); }

.action-card h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.unit-title {
    color: var(--text-light);
    margin-bottom: 12px;
}

.preview-char {
    font-family: var(--font-chinese);
    font-size: 2rem;
    margin-right: 8px;
}

/* ── Unit Browser ─────────────────────────────────────────────── */
.unit-browser { margin-top: 20px; }
.unit-browser h2 { margin-bottom: 16px; }

.unit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    text-decoration: none;
    color: var(--text);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.unit-item:hover { border-color: var(--primary); }
.unit-item.current { border-color: var(--primary); background: #fff0f0; }
.unit-item.completed { border-color: var(--success); }
.unit-item.locked { opacity: 0.5; pointer-events: none; }

.unit-num { font-weight: 800; min-width: 60px; }
.unit-name { flex: 1; }
.unit-count { color: var(--text-light); font-size: 0.9rem; }

/* ── Lesson ───────────────────────────────────────────────────── */
.lesson-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.lesson-header h1 {
    flex: 1;
    font-size: 1.5rem;
}

.lesson-progress {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.character-showcase {
    text-align: center;
    margin-bottom: 24px;
}

.character-big {
    font-family: var(--font-chinese);
    font-size: 8rem;
    font-weight: 900;
    line-height: 1.1;
}

#hanzi-writer-target {
    display: inline-block;
    margin: 16px auto;
    border: 3px solid var(--border);
    border-radius: var(--radius);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.character-info-panel {
    text-align: center;
    margin-bottom: 24px;
}

.pinyin-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.meaning-display {
    font-size: 1.5rem;
    color: var(--text-light);
}

.audio-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.example-section {
    margin-bottom: 32px;
}

.example-section h3 {
    margin-bottom: 12px;
}

.example-word {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    margin-bottom: 8px;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.example-word:hover { border-color: var(--primary); }

.word-chinese {
    font-family: var(--font-chinese);
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
}

.word-pinyin {
    color: var(--primary);
    font-weight: 700;
    min-width: 80px;
}

.word-meaning {
    color: var(--text-light);
    flex: 1;
}

.word-audio-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.word-audio-btns .btn-small {
    font-size: 0.75rem;
    padding: 4px 10px;
    min-height: auto;
    border-radius: 6px;
}

.speak-section {
    text-align: center;
    margin-bottom: 32px;
}

.speech-result {
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.result-correct { color: var(--success); }
.result-retry { color: var(--primary); }

.stroke-section {
    text-align: center;
    margin-bottom: 32px;
}

.stroke-section h3 { margin-bottom: 12px; }
.stroke-section .btn { margin: 0 8px; }

.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

/* ── Quiz (legacy in-lesson) ──────────────────────────────────── */
.quiz-mode {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.quiz-mode h2 { margin-bottom: 24px; }

.quiz-char {
    font-family: var(--font-chinese);
    font-size: 6rem;
    font-weight: 900;
    margin-bottom: 16px;
}

.quiz-question p { font-size: 1.2rem; margin-bottom: 20px; }

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.quiz-feedback {
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 40px;
}

.quiz-score {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 12px;
}

/* ── Quiz Menu Page ──────────────────────────────────────────── */
.quiz-menu-page .page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.quiz-menu-page h1 { font-size: 1.8rem; }

.quiz-cumulative-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--primary);
    margin-bottom: 32px;
    text-align: center;
}

.quiz-cumulative-card h2 { margin-bottom: 8px; }
.quiz-cumulative-card p { color: var(--text-light); margin-bottom: 16px; }

.section-title { margin-bottom: 16px; }

.quiz-unit-list { display: flex; flex-direction: column; gap: 8px; }

.quiz-unit-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.quiz-unit-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.quiz-unit-card h3 { font-size: 1rem; margin-bottom: 4px; }

.qu-chars .preview-char {
    font-family: var(--font-chinese);
    font-size: 1.2rem;
    margin-right: 4px;
}

.qu-go {
    font-weight: 800;
    color: var(--primary);
    font-size: 1rem;
}

/* ── Quiz Page (active quiz) ─────────────────────────────────── */
.quiz-page { max-width: 600px; margin: 0 auto; }

.quiz-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.quiz-header h1 { flex: 1; font-size: 1.4rem; }

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    text-align: center;
    min-height: 350px;
}

.quiz-prompt-label {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.quiz-prompt-char {
    font-family: var(--font-chinese);
    font-size: 6rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
}

.quiz-prompt-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.listening-icon { font-size: 4rem; display: block; margin-bottom: 12px; }

.quiz-listen-btn { margin-bottom: 16px; }

.quiz-card .quiz-options {
    max-width: 400px;
    margin: 0 auto 16px;
}

.quiz-card .btn-quiz.correct {
    background: var(--success) !important;
    color: white !important;
    border-color: var(--success) !important;
}

.quiz-card .btn-quiz.wrong {
    background: var(--error) !important;
    color: white !important;
    border-color: var(--error) !important;
}

.quiz-progress {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-light);
}

.result-detail {
    font-size: 1.1rem;
    color: var(--text-light);
    margin: 16px 0;
}

.result-breakdown {
    margin-top: 24px;
    text-align: left;
}

.quiz-results { margin-top: 20px; }

.sentence-maker { margin-top: 20px; }

.learned-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.learned-word {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-chinese);
}

.sentence-prompt {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Input mode toggle */
.input-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-light, #f0f0f0);
    border-radius: 12px;
    padding: 4px;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Speech input */
.speech-input-wrap {
    text-align: center;
    margin: 20px 0;
}

.btn-record {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: white;
    cursor: pointer;
    margin: 0 auto 16px;
    transition: all 0.2s;
}

.btn-record:hover {
    background: #fff0f0;
    transform: scale(1.05);
}

.btn-record.recording {
    border-color: #e53e3e;
    background: #fff5f5;
    animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.3); }
    50% { box-shadow: 0 0 0 16px rgba(229, 62, 62, 0); }
}

.record-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.record-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 4px;
}

.speech-hint {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 8px 0 0;
}

.speech-transcript {
    background: var(--bg-light, #f7f7f7);
    border-radius: var(--radius-small);
    padding: 16px;
    margin: 16px 0;
}

.transcript-text {
    font-family: var(--font-chinese);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
}

.transcript-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.sentence-input-wrap {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}

.sentence-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-small);
    font-size: 1rem;
    font-family: var(--font-chinese);
}

.sentence-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.mood-response {
    text-align: center;
    margin-top: 20px;
}

.mood-emoji {
    font-size: 3rem;
    margin: 20px 0;
    animation: bounce 0.6s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.mood-message {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
    margin: 16px 0 24px;
}

.quiz-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    text-align: left;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg);
    border-radius: var(--radius-small);
}

.bd-label { color: var(--text-light); }
.bd-score { font-weight: 800; }

.quiz-action-card { border-left-color: var(--accent) !important; }

/* ── Completion ───────────────────────────────────────────────── */
.complete-mode {
    text-align: center;
    padding: 40px 0;
}

.completion-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.completion-card h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--success);
}

.big-score {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
}

.completion-points {
    font-size: 1.3rem;
    color: var(--success);
    margin: 16px 0;
}

.completion-chars {
    font-family: var(--font-chinese);
    font-size: 1.3rem;
    margin-bottom: 24px;
}

/* ── Progress Page ────────────────────────────────────────────── */
.progress-page .page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-page h1 { font-size: 1.8rem; }

.section {
    margin-bottom: 40px;
}

.section h2 {
    margin-bottom: 16px;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.char-card {
    background: var(--bg-card);
    border-radius: var(--radius-small);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.char-big {
    font-family: var(--font-chinese);
    font-size: 2.5rem;
    font-weight: 900;
    display: block;
}

.char-scores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 4px;
}

.unit-progress-card {
    background: var(--bg-card);
    border-radius: var(--radius-small);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.unit-progress-card h3 { margin-bottom: 8px; }

.unit-bar {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.unit-bar-fill.mastered { background: var(--success); }
.unit-bar-fill.practiced { background: var(--accent); }

.unit-stats {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 6px;
}

.session-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.session-table th, .session-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.session-table th {
    background: var(--bg);
    font-weight: 700;
}

/* ── Cantonese Display ────────────────────────────────────────── */
.cantonese-display {
    font-size: 1.1rem;
    color: #6c5ce7;
    font-weight: 700;
    margin-top: 4px;
}

/* ── Practice Tabs ────────────────────────────────────────────── */
.practice-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--border);
    border-radius: var(--radius);
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: var(--text);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab:hover:not(.active) { color: var(--text); }

.practice-panel {
    min-height: 200px;
    text-align: center;
}

.practice-panel h3 {
    margin-bottom: 16px;
}

.practice-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.practice-feedback {
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 30px;
}

/* ── Skill Cards (Practice Menu) ──────────────────────────────── */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    border: 3px solid transparent;
    transition: all 0.2s;
}

.skill-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.skill-icon { font-size: 2.5rem; margin-bottom: 8px; }
.skill-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.skill-desc { font-size: 0.9rem; color: var(--text-light); text-align: center; }

.skill-card.writing { border-left: 4px solid var(--secondary); }
.skill-card.speaking { border-left: 4px solid var(--primary); }
.skill-card.listening { border-left: 4px solid #6c5ce7; }
.skill-card.pinyin { border-left: 4px solid var(--accent); }

.listen-options, .pinyin-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
    margin: 16px auto;
}

/* ── Review ───────────────────────────────────────────────────── */
.review-container {
    max-width: 600px;
    margin: 0 auto;
}

.review-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 24px;
}

.review-instruction {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.review-answer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.rating-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.btn-rating {
    font-size: 1.1rem;
    padding: 12px 28px;
    border: 3px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.btn-rating:hover { transform: translateY(-2px); }

.btn-rating.hard { background: #ffe0e0; color: var(--error); border-color: var(--error); }
.btn-rating.okay { background: #fff3cd; color: #856404; border-color: #ffc107; }
.btn-rating.easy { background: #d4edda; color: #155724; border-color: var(--success); }

.review-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-easy { color: var(--success); }
.stat-okay { color: #856404; }
.stat-hard { color: var(--error); }

.example-words-mini {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.word-chip {
    font-family: var(--font-chinese);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.practice-card {
    border-left-color: #6c5ce7 !important;
}

/* ── Worksheets ──────────────────────────────────────────────── */
.worksheets-page .page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.worksheets-page h1 { font-size: 1.8rem; }

.page-desc {
    color: var(--text-light);
    margin-bottom: 24px;
}

.worksheet-types-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.wtype-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
}

.wtype-icon { font-size: 1.8rem; margin-bottom: 4px; }
.wtype-desc { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }

.worksheet-unit-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-small);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    border-left: 4px solid var(--secondary);
}

.wu-header h3 { font-size: 1.1rem; margin-bottom: 4px; }

.wu-chars .preview-char {
    font-family: var(--font-chinese);
    font-size: 1.3rem;
    margin-right: 4px;
}

.wu-downloads { display: flex; gap: 8px; flex-shrink: 0; }

.btn-worksheet {
    font-size: 0.85rem !important;
    padding: 6px 14px !important;
    min-height: auto !important;
}

.btn-ws-writing { background: var(--secondary); color: white; }
.btn-ws-writing:hover { background: var(--secondary-dark); }
.btn-ws-pinyin { background: var(--primary); color: white; }
.btn-ws-pinyin:hover { background: var(--primary-dark); }
.btn-ws-dictation { background: #6c5ce7; color: white; }
.btn-ws-dictation:hover { background: #5a4bd1; }

.worksheet-card { border-left-color: var(--secondary) !important; }

/* ── Login Page ───────────────────────────────────────────────── */
.login-page {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.floating-chars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.float-char {
    position: absolute;
    font-family: var(--font-chinese);
    font-size: 4rem;
    opacity: 0.06;
    font-weight: 900;
    animation: floatChar 12s ease-in-out infinite;
}

.f1 { top: 10%; left: 5%; animation-delay: 0s; }
.f2 { top: 20%; right: 8%; animation-delay: 2s; }
.f3 { bottom: 15%; left: 12%; animation-delay: 4s; }
.f4 { top: 60%; right: 15%; animation-delay: 6s; }
.f5 { bottom: 30%; left: 50%; animation-delay: 8s; }

@keyframes floatChar {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.login-header {
    margin-bottom: 32px;
}

.login-mascot {
    font-size: 4rem;
    margin-bottom: 8px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #6c5ce7, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 600;
}

.login-error {
    background: #ffe0e0;
    color: var(--error);
    padding: 12px 20px;
    border-radius: var(--radius-small);
    font-weight: 700;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
}

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

/* ── Profile Picker (avatar buttons) ─────────────────────────── */
.picker-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
}

.avatar-profiles {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.avatar-profile-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 3px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    min-width: 110px;
}

.avatar-profile-btn:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(255,107,107,0.2);
}

.avatar-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.av-panda { background: #e8f5e9; }
.av-dragon { background: #fff3e0; }
.av-rabbit { background: #fce4ec; }
.av-tiger { background: #fff8e1; }
.av-star { background: #e3f2fd; }
.av-rocket { background: #f3e5f5; }

.av-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.av-streak {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
}

/* ── Login Form ──────────────────────────────────────────────── */
.login-form-section {
    margin-bottom: 16px;
}

.login-form {
    text-align: left;
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-form .form-group { margin-bottom: 16px; }

.login-form label {
    display: block;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text);
}

.input-fun {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.15rem;
    font-family: var(--font-body);
    border: 3px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-fun:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,107,107,0.15);
}

.input-fun::placeholder {
    color: #bbb;
}

.form-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.btn-fun {
    width: 100%;
    border-radius: 12px;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

/* ── Login Divider ───────────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-light);
    font-weight: 700;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
}

/* ── Avatar Picker (signup) ──────────────────────────────────── */
.avatar-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.avatar-option {
    cursor: pointer;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 2.2rem;
    border-radius: 50%;
    border: 3px solid var(--border);
    transition: all 0.2s;
    background: var(--bg);
}

.avatar-option input[type="radio"]:checked + .avatar-choice {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255,107,107,0.2);
    transform: scale(1.1);
    background: white;
}

.avatar-choice:hover {
    border-color: var(--secondary);
    transform: scale(1.05);
}

/* ── Secret Word Picker ──────────────────────────────────────── */
.secret-word-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.secret-word-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-body);
    border: 3px solid var(--border);
    border-radius: 24px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: capitalize;
}

.secret-word-btn:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.secret-word-btn.selected {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(78,205,196,0.3);
}

/* ── Secret Animal Picker ────────────────────────────────────── */
.secret-animal-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.secret-animal-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: 3px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    min-width: 72px;
}

.secret-animal-btn:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.secret-animal-btn.selected {
    border-color: var(--primary);
    background: #fff0f0;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(255,107,107,0.25);
}

.sa-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

.sa-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-light);
}

.secret-animal-btn.selected .sa-label {
    color: var(--primary);
}

/* ── Signup Section ──────────────────────────────────────────── */
.signup-section {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Rewards ─────────────────────────────────────────────────── */
.rewards-page .page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.rewards-page h1 { font-size: 1.8rem; margin: 0; }

.rewards-balance {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--accent);
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.balance-label {
    font-weight: 700;
    color: #856404;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #856404;
    flex: 1;
}

.reward-tier-section {
    margin-bottom: 28px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-bottom: 3px solid var(--border);
}

.tier-header.tier-bronze { border-bottom-color: #cd7f32; }
.tier-header.tier-silver { border-bottom-color: #c0c0c0; }
.tier-header.tier-gold { border-bottom-color: #ffd700; }
.tier-header.tier-platinum { border-bottom-color: #b0a4e3; }

.tier-icon { font-size: 1.5rem; }

.tier-header h2 {
    flex: 1;
    font-size: 1.2rem;
    margin: 0;
}

.tier-points {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.9rem;
}

.reward-items {
    display: flex;
    flex-direction: column;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.reward-item:hover { background: #fafafa; }
.reward-item.locked { opacity: 0.5; }

.reward-icon { font-size: 1.5rem; flex-shrink: 0; }

.reward-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reward-name { font-weight: 700; font-size: 1rem; }
.reward-desc { font-size: 0.85rem; color: var(--text-light); }

.reward-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.reward-cost {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary);
}

.btn-redeem {
    font-size: 0.85rem !important;
    padding: 6px 16px !important;
    min-height: auto !important;
}

/* Rewards pending card */
.rewards-pending-card {
    text-align: center;
    background: white;
    border-radius: var(--radius);
    padding: 48px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 40px auto;
}

.pending-icon { font-size: 4rem; margin-bottom: 16px; }
.rewards-pending-card h2 { margin-bottom: 12px; }
.pending-hint { color: var(--text-light); margin-top: 8px; }

/* Dashboard reward card */
.reward-card { border-left-color: #ffd700 !important; }
.reward-card.disabled {
    opacity: 0.6;
    background: #f5f5f5 !important;
}

/* Reward history */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.history-icon { font-size: 1.5rem; }

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.history-name { font-weight: 700; }
.history-tier { font-size: 0.85rem; color: var(--text-light); }
.history-date { font-size: 0.8rem; color: var(--text-light); }

.history-cost {
    font-weight: 800;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ── Reward Setup (Parent Page) ──────────────────────────────── */
.reward-setup-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 16px;
}

.setup-header { margin-bottom: 32px; }
.setup-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.setup-desc { color: var(--text-light); line-height: 1.5; }

.setup-tier-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.setup-tier-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tier-name-input { max-width: 200px; }
.tier-points-input { max-width: 120px; }

.tier-points-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-points-group label {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.setup-rewards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setup-reward-item {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.setup-reward-item .input-fun {
    flex: 1;
    min-width: 140px;
}

.reward-cost-input { max-width: 100px !important; flex: 0 0 100px !important; }

.setup-actions {
    text-align: center;
    margin-top: 24px;
}

.setup-success-card {
    text-align: center;
    background: #d4edda;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.success-icon { font-size: 3rem; margin-bottom: 8px; }
.setup-success-card h2 { color: #155724; margin-bottom: 8px; }
.setup-hint { color: var(--text-light); margin-top: 8px; }

.setup-error-card {
    text-align: center;
    background: #ffe0e0;
    border-radius: var(--radius);
    padding: 32px;
}

.setup-error-card h2 { color: var(--error); margin-bottom: 8px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .character-big { font-size: 5rem; }
    .quiz-char { font-size: 4rem; }
    .welcome-title { font-size: 1.8rem; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .action-cards { grid-template-columns: 1fr; }
    .lesson-nav { flex-direction: column; }
    .navbar { flex-direction: column; gap: 8px; }
    .login-header h1 { font-size: 1.8rem; }
    .avatar-profiles { gap: 10px; }
    .avatar-profile-btn { min-width: 90px; padding: 12px 14px; }
    .float-char { font-size: 2.5rem; }
    .reward-item { flex-wrap: wrap; }
    .setup-tier-header { flex-direction: column; align-items: stretch; }
    .setup-reward-item { flex-direction: column; }
    .reward-cost-input { max-width: 100% !important; flex: 1 !important; }
    .tier-name-input { max-width: 100%; }
}

/* ── Onboarding Chat ────────────────────────────────────────── */

.chat-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.chat-header {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.chat-mascot {
    font-size: 3rem;
    margin-bottom: 4px;
}

.chat-header h1 {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 2px;
}

.chat-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.mute-btn {
    position: absolute;
    top: 8px;
    right: 0;
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mute-btn:hover {
    background: var(--border);
}

/* Chat messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Bubbles */
.chat-bubble {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
    animation: bubbleIn 0.3s ease-out;
}

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

.chat-bubble.bot {
    align-self: flex-start;
}

.chat-bubble.child {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bubble-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-content {
    padding: 10px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 1rem;
    word-break: break-word;
}

.chat-bubble.bot .bubble-content {
    background: white;
    border: 2px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.chat-bubble.child .bubble-content {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 4px;
}

.bubble-content .chinese {
    font-family: var(--font-chinese);
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary);
}

.chat-bubble.child .bubble-content .chinese {
    color: white;
}

.bubble-speak-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
    align-self: center;
}

.bubble-speak-btn:hover {
    opacity: 1;
}

/* Typing indicator */
.chat-typing {
    display: none;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--secondary);
}

.chat-input:disabled {
    background: #f5f5f5;
    opacity: 0.6;
}

.chat-send-btn {
    border-radius: 24px !important;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    min-height: auto !important;
}

/* Mic button */
.mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mic-btn:hover {
    border-color: var(--secondary);
    background: #f0fffe;
}

.mic-btn.listening {
    border-color: var(--primary);
    background: #fff0f0;
    animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.mic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer / skip link */
.chat-footer {
    text-align: center;
    padding: 8px 0;
}

.skip-link {
    color: var(--text-light);
    font-size: 0.85rem;
    text-decoration: none;
}

.skip-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Assessment result overlay */
.assessment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.assessment-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px 32px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: cardPop 0.4s ease-out;
}

@keyframes cardPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.assessment-mascot {
    font-size: 3rem;
    margin-bottom: 12px;
}

.assessment-card h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--text);
}

.assessment-card p {
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 20px;
}

.unit-badge {
    display: inline-block;
    background: var(--accent);
    color: #856404;
    font-weight: 800;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .chat-page { padding: 10px 0; height: calc(100vh - 20px); }
    .chat-header h1 { font-size: 1.3rem; }
    .chat-bubble { max-width: 92%; }
    .bubble-content { padding: 8px 12px; font-size: 0.95rem; }
    .assessment-card { padding: 28px 20px; }
}
