/* Quiz Modal Styles */
/* Cheerful design aligned with Word Stories Onigiri Chat aesthetic */

/* ============================================
   THEME SYSTEM - CSS Custom Properties
   ============================================ */
.quiz-modal {
    /* Default: Indigo Theme (matches Word Stories) */
    --quiz-primary: #6366f1;
    --quiz-primary-hover: #4f46e5;
    --quiz-primary-light: #e0e7ff;
    --quiz-primary-lighter: #eef2ff;
    --quiz-primary-dark: #4338ca;
    --quiz-primary-rgb: 99, 102, 241;

    /* Number badges - purple gradient by default (cheerful) */
    --quiz-num-bg: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    --quiz-num-text: #4338ca;
    --quiz-num-hover-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --quiz-num-hover-text: white;

    /* Selected state */
    --quiz-selected-bg: linear-gradient(90deg, #eef2ff 0%, #f5f3ff 100%);
    --quiz-selected-border: var(--quiz-primary);
    --quiz-selected-text: var(--quiz-primary-dark);

    /* Correct - vibrant green (culture bubble style) */
    --quiz-correct-bg: linear-gradient(90deg, #d1fae5 0%, #ecfdf5 100%);
    --quiz-correct-border: #10b981;
    --quiz-correct-text: #047857;
    --quiz-correct-num-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --quiz-correct-num-text: white;

    /* Incorrect - softer peach/coral (less harsh than red) */
    --quiz-incorrect-bg: linear-gradient(90deg, #fef2f2 0%, #fff7f5 100%);
    --quiz-incorrect-border: #fca5a5;
    --quiz-incorrect-text: #b91c1c;
    --quiz-incorrect-num-bg: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    --quiz-incorrect-num-text: #b91c1c;

    /* Hint - Green for correct feedback */
    --quiz-hint-bg: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    --quiz-hint-border: rgba(16, 185, 129, 0.25);
    --quiz-hint-text: #064e3b;

    /* Learning feedback (yellow tip style) */
    --quiz-learning-bg: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    --quiz-learning-border: rgba(234, 179, 8, 0.25);
    --quiz-learning-text: #713f12;
    --quiz-learning-label: #a16207;

    /* Progress bar */
    --quiz-progress-bg: #e2e8f0;
    --quiz-progress-fill: var(--quiz-primary);

    /* Buttons */
    --quiz-btn-gradient: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 100%);
}

/* Theme 1: Indigo + Warm (Refined) */
.quiz-modal.theme-indigo {
    --quiz-primary: #6366f1;
    --quiz-primary-hover: #4f46e5;
    --quiz-primary-light: #e0e7ff;
    --quiz-primary-lighter: #eef2ff;
    --quiz-primary-dark: #3730a3;
    --quiz-primary-rgb: 99, 102, 241;

    --quiz-num-bg: #f5f3ff;
    --quiz-num-text: #7c7c8a;

    --quiz-correct-bg: rgba(134, 239, 172, 0.1);
    --quiz-correct-border: rgba(74, 222, 128, 0.4);
    --quiz-correct-text: #166534;
    --quiz-correct-num-bg: rgba(134, 239, 172, 0.18);
    --quiz-correct-num-text: #15803d;

    --quiz-incorrect-bg: rgba(251, 146, 134, 0.1);
    --quiz-incorrect-border: rgba(248, 113, 113, 0.4);
    --quiz-incorrect-text: #b91c1c;
    --quiz-incorrect-num-bg: rgba(251, 146, 134, 0.18);
    --quiz-incorrect-num-text: #dc2626;

    --quiz-hint-bg: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    --quiz-hint-border: rgba(139, 92, 246, 0.2);
    --quiz-hint-text: #5b21b6;
}

/* Theme 2: Teal (Fresh & Calm) */
.quiz-modal.theme-teal {
    --quiz-primary: #14b8a6;
    --quiz-primary-hover: #0d9488;
    --quiz-primary-light: #ccfbf1;
    --quiz-primary-lighter: #f0fdfa;
    --quiz-primary-dark: #0f766e;
    --quiz-primary-rgb: 20, 184, 166;

    --quiz-num-bg: #f0fdfa;
    --quiz-num-text: #5f7a76;

    --quiz-correct-bg: rgba(56, 189, 248, 0.1);
    --quiz-correct-border: rgba(56, 189, 248, 0.4);
    --quiz-correct-text: #0369a1;
    --quiz-correct-num-bg: rgba(56, 189, 248, 0.18);
    --quiz-correct-num-text: #0284c7;

    --quiz-incorrect-bg: rgba(251, 191, 36, 0.1);
    --quiz-incorrect-border: rgba(251, 191, 36, 0.4);
    --quiz-incorrect-text: #b45309;
    --quiz-incorrect-num-bg: rgba(251, 191, 36, 0.18);
    --quiz-incorrect-num-text: #d97706;

    --quiz-hint-bg: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    --quiz-hint-border: rgba(20, 184, 166, 0.2);
    --quiz-hint-text: #0f766e;
}

/* Theme 3: Violet (Modern Creative) */
.quiz-modal.theme-violet {
    --quiz-primary: #8b5cf6;
    --quiz-primary-hover: #7c3aed;
    --quiz-primary-light: #ede9fe;
    --quiz-primary-lighter: #f5f3ff;
    --quiz-primary-dark: #5b21b6;
    --quiz-primary-rgb: 139, 92, 246;

    --quiz-num-bg: #faf5ff;
    --quiz-num-text: #7e7590;

    --quiz-correct-bg: rgba(45, 212, 191, 0.1);
    --quiz-correct-border: rgba(45, 212, 191, 0.4);
    --quiz-correct-text: #0f766e;
    --quiz-correct-num-bg: rgba(45, 212, 191, 0.18);
    --quiz-correct-num-text: #0d9488;

    --quiz-incorrect-bg: rgba(244, 114, 182, 0.1);
    --quiz-incorrect-border: rgba(244, 114, 182, 0.4);
    --quiz-incorrect-text: #be185d;
    --quiz-incorrect-num-bg: rgba(244, 114, 182, 0.18);
    --quiz-incorrect-num-text: #db2777;

    --quiz-hint-bg: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
    --quiz-hint-border: rgba(192, 132, 252, 0.2);
    --quiz-hint-text: #7e22ce;
}

/* Theme 4: Warm Neutral + Gold (Japanese-Inspired) */
.quiz-modal.theme-zen {
    --quiz-primary: #d97706;
    --quiz-primary-hover: #b45309;
    --quiz-primary-light: #fef3c7;
    --quiz-primary-lighter: #fffbeb;
    --quiz-primary-dark: #92400e;
    --quiz-primary-rgb: 217, 119, 6;

    --quiz-num-bg: #fefce8;
    --quiz-num-text: #78716c;

    --quiz-correct-bg: rgba(163, 177, 138, 0.12);
    --quiz-correct-border: rgba(132, 147, 108, 0.4);
    --quiz-correct-text: #3f5229;
    --quiz-correct-num-bg: rgba(163, 177, 138, 0.22);
    --quiz-correct-num-text: #4d6631;

    --quiz-incorrect-bg: rgba(194, 130, 114, 0.12);
    --quiz-incorrect-border: rgba(180, 110, 94, 0.4);
    --quiz-incorrect-text: #7c2d12;
    --quiz-incorrect-num-bg: rgba(194, 130, 114, 0.22);
    --quiz-incorrect-num-text: #9a3412;

    --quiz-hint-bg: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    --quiz-hint-border: rgba(217, 119, 6, 0.2);
    --quiz-hint-text: #92400e;
}

/* Theme 5: Monochrome Blue (Ultra-Cohesive) */
.quiz-modal.theme-mono {
    --quiz-primary: #3b82f6;
    --quiz-primary-hover: #2563eb;
    --quiz-primary-light: #dbeafe;
    --quiz-primary-lighter: #eff6ff;
    --quiz-primary-dark: #1e40af;
    --quiz-primary-rgb: 59, 130, 246;

    --quiz-num-bg: #f0f9ff;
    --quiz-num-text: #64748b;

    --quiz-correct-bg: rgba(34, 211, 238, 0.1);
    --quiz-correct-border: rgba(34, 211, 238, 0.4);
    --quiz-correct-text: #0e7490;
    --quiz-correct-num-bg: rgba(34, 211, 238, 0.18);
    --quiz-correct-num-text: #0891b2;

    --quiz-incorrect-bg: rgba(167, 139, 250, 0.1);
    --quiz-incorrect-border: rgba(167, 139, 250, 0.4);
    --quiz-incorrect-text: #6d28d9;
    --quiz-incorrect-num-bg: rgba(167, 139, 250, 0.18);
    --quiz-incorrect-num-text: #7c3aed;

    --quiz-hint-bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --quiz-hint-border: rgba(59, 130, 246, 0.2);
    --quiz-hint-text: #1d4ed8;
}

/* Theme Toggle UI */
.quiz-theme-toggle {
    position: absolute;
    top: 8px;
    right: 52px;
    display: flex;
    gap: 3px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    z-index: 10000;
}

.quiz-theme-toggle button {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.quiz-theme-toggle button:hover {
    transform: scale(1.15);
    border-color: white;
}

.quiz-theme-toggle button.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.quiz-theme-toggle [data-theme="default"] { background: #3b82f6; }
.quiz-theme-toggle [data-theme="indigo"] { background: #6366f1; }
.quiz-theme-toggle [data-theme="teal"] { background: #14b8a6; }
.quiz-theme-toggle [data-theme="violet"] { background: #8b5cf6; }
.quiz-theme-toggle [data-theme="zen"] { background: #d97706; }
.quiz-theme-toggle [data-theme="mono"] { background: linear-gradient(135deg, #3b82f6, #22d3ee); }

/* ============================================
   TYPOGRAPHY - Layered Font System
   Matches Word Stories with Klee One + Nunito
   ============================================ */

/*
   LAYER 1: Japanese text - Klee One calligraphy
   Used for: kana, kanji in answer cards and review
   Note: quiz-answer-btn now uses .quiz-answer-text + .quiz-jp wrapping
*/
.answer-card-word,
.answer-card-preview-word,
.quiz-review-word,
.quiz-kanji-text,
.quiz-kana-text {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
}

/* Question text - Nunito for English prompts */
.quiz-question-text {
    font-family: 'Nunito', sans-serif;
}

/* Inline Japanese text - Klee One calligraphy */
/* Used in questions, answers, and feedback */
.quiz-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    color: #1a1a2e;
    letter-spacing: 0.02em;
}

/* Question content entrance animation */
@keyframes questionContentReveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-question-content {
    animation: questionContentReveal 0.3s ease-out;
}

/* Answer button text wrapper - Nunito base with Japanese wrapped */
.quiz-answer-text {
    font-family: 'Nunito', sans-serif;
}

/* Slightly larger Japanese text for better readability */
.answer-card-word {
    font-size: 1.15em;
}

.answer-card-preview-word {
    font-size: 1.85rem;
}

/*
   LAYER 2: Romanization - Nunito italic
   Used for: pronunciation guides, romaji
*/
.answer-card-roma,
.answer-card-preview-roma,
.quiz-review-romanization,
.quiz-hint-text[data-type="romanization"] {
    font-family: 'Nunito', sans-serif;
    font-style: italic;
    letter-spacing: 0.02em;
    color: #a8a29e;
}

/*
   LAYER 3: English/UI text - Nunito
   Used for: all English text, buttons, labels, feedback
*/
.quiz-modal {
    font-family: 'Nunito', sans-serif;
}

/* Answer card English */
.answer-card-english,
.answer-card-preview-english,
.quiz-review-english {
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
}

/* Feedback text */
.quiz-feedback,
.quiz-feedback .feedback-status,
.quiz-feedback .feedback-explanation {
    font-family: 'Nunito', sans-serif;
}

/* Hint and tip text */
.quiz-hint,
.quiz-tip-content,
.quiz-hint-text {
    font-family: 'Nunito', sans-serif;
}

/* Buttons and controls */
.quiz-start-btn,
.quiz-submit-btn,
.quiz-finish-btn,
.quiz-nav-btn,
.quiz-hint-btn,
.quiz-resume-btn,
.quiz-start-new-btn,
.quiz-end-early-btn {
    font-family: 'Nunito', sans-serif;
}

/* Labels and status text */
.quiz-status,
.quiz-progress-label,
.quiz-progress-stats,
.quiz-type-label,
.hint-label,
.answer-card-pos,
.answer-card-preview-pos {
    font-family: 'Nunito', sans-serif;
}

/* Progress dots */
.quiz-progress-dot {
    font-family: 'Nunito', sans-serif;
}

/* Streak badge */
.quiz-streak-badge {
    font-family: 'Nunito', sans-serif;
}

/* Results screen */
.quiz-results-score,
.quiz-results-summary,
.quiz-performance-chart {
    font-family: 'Nunito', sans-serif;
}

/* ============================================ */

/* ============================================
   PREMIUM ANIMATIONS - Staggered reveals, bounces
   ============================================ */

/* Staggered answer button entrance */
@keyframes quizAnswerSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress dot state change bounce */
@keyframes quizDotBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Correct answer celebration pulse */
@keyframes quizCorrectPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Very subtle wobble for incorrect - barely perceptible nudge */
@keyframes quizIncorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1.5px); }
    50% { transform: translateX(1.5px); }
    75% { transform: translateX(-1px); }
}

/* Bouncy selection animation - premium feel */
@keyframes quizSelectBounce {
    0% { transform: translateY(-2px) scale(1); }
    30% { transform: translateY(-3px) scale(1.02); }
    50% { transform: translateY(-2px) scale(0.99); }
    70% { transform: translateY(-2px) scale(1.01); }
    100% { transform: translateY(-2px) scale(1); }
}

/* Streak milestone celebration pulse */
@keyframes streakMilestonePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* Submit button lock animation */
@keyframes submitLock {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Feedback slide in from below */
@keyframes feedbackSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score counter reveal with bounce */
@keyframes scoreCounterBounce {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Avatar idle breathing - subtle life */
@keyframes quizAvatarBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Reduced motion - disable all animations */
@media (prefers-reduced-motion: reduce) {
    .quiz-answer-btn,
    .quiz-progress-dot,
    .quiz-avatar {
        animation: none !important;
        transition: opacity 0.1s ease !important;
    }
}

/* Overlay - simple dark blur */
.quiz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Clean card style */
.quiz-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(480px, 92vw);
    min-height: min(580px, 75vh);
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Layered shadow system - premium depth */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.quiz-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* No decorative orbs - clean design */

/* ============================================
   CHEERFUL HEADER - Onigiri Chat Style
   ============================================ */
.quiz-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    /* Warm purple tint - cheerful, not gray */
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-bottom: 2px solid rgba(139, 92, 246, 0.15);
    z-index: 10;
    flex-shrink: 0;
}

/* Header left - avatar + title area */
.quiz-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Onigiri avatar - warm peach glow with subtle breathing */
.quiz-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2.5px solid rgba(234, 88, 12, 0.2);
    box-shadow:
        0 2px 4px rgba(234, 88, 12, 0.1),
        0 4px 12px rgba(234, 88, 12, 0.12);
    display: flex;
    animation: quizAvatarBreath 4s ease-in-out infinite;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    overflow: hidden;
}

.quiz-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.quiz-title-area {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quiz-modal-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #5b21b6;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

/* Quiz status line with pulsing dot */
.quiz-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #7c3aed;
    font-weight: 600;
}

.quiz-status-dot {
    width: 7px;
    height: 7px;
    background: #a78bfa;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
    animation: pulse-status-dot 2s ease-in-out infinite;
}

@keyframes pulse-status-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.quiz-title-icon {
    width: 1.4em;
    height: 1.4em;
    object-fit: contain;
}

/* Quiz button icon in header */
.quiz-icon-img {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

#quizProgressText {
    font-size: 0.9em;
    font-weight: 600;
    color: #64748b;
    min-width: 60px;
    text-align: center;
}

/* Segmented Progress Bar - LEGACY, hidden in favor of numbered dots */
.quiz-progress-bar {
    display: none !important;
}

.quiz-progress-segment {
    height: 6px;
    min-width: 8px;
    flex: 1;
    background: var(--quiz-progress-bg);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.quiz-progress-segment.correct {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.quiz-progress-segment.incorrect {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.quiz-progress-segment.current {
    background: var(--quiz-primary);
    opacity: 0.6;
    animation: pulse-segment 1.5s ease-in-out infinite;
}

@keyframes pulse-segment {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Compact Progress Counter - LEGACY, hidden */
.quiz-progress-counter {
    display: none !important;
}

/* Legacy progress colors - keep for reference */
.progress-correct {
    color: #10b981;
}

.progress-incorrect {
    color: #ef4444;
}

.quiz-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================================
   PROGRESS SECTION - Premium Numbered Dots
   ============================================ */
.quiz-progress-section {
    padding: 16px 20px;
    /* Subtle gradient background for depth */
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Subtle top highlight */
.quiz-progress-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
}

.quiz-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.quiz-progress-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72em;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.quiz-progress-stats {
    display: flex;
    gap: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82em;
    font-weight: 800;
}

.quiz-progress-stats .progress-correct {
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quiz-progress-stats .progress-incorrect {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Numbered Progress Dots - Premium Clickable Navigation */
.quiz-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 0;
}

.quiz-progress-dot {
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    /* Premium layered shadow */
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.02),
        0 2px 4px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1.5px solid #e5e5e5;
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #78716c;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-dot:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    color: #6366f1;
    transform: translateY(-1px) scale(1.03);
    box-shadow:
        0 2px 4px rgba(99, 102, 241, 0.1),
        0 4px 8px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Current question - larger indigo pill */
.quiz-progress-dot.current {
    min-width: 44px;
    height: 36px;
    border-color: #6366f1;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: scale(1.08);
}

/* Answered correctly - green pill with bounce */
.quiz-progress-dot.correct {
    border-color: #10b981;
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 100%);
    color: white;
    animation: quizDotBounce 0.4s ease-out;
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.15),
        0 4px 8px rgba(16, 185, 129, 0.12);
}

/* Answered incorrectly - softer coral/peach with subtle bounce */
.quiz-progress-dot.incorrect {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #b91c1c;
    animation: quizDotBounce 0.4s ease-out;
    box-shadow:
        0 2px 4px rgba(239, 68, 68, 0.1),
        0 4px 8px rgba(239, 68, 68, 0.08);
}

/* Current + answered - show both states */
.quiz-progress-dot.correct.current,
.quiz-progress-dot.incorrect.current {
    min-width: 44px;
    height: 36px;
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   STREAK BADGE - Golden Amber Celebration
   ============================================ */
.quiz-streak-badge {
    position: absolute;
    top: 140px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #92400e;
    /* Layered shadow for premium depth */
    box-shadow:
        0 2px 4px rgba(251, 191, 36, 0.15),
        0 4px 12px rgba(251, 191, 36, 0.2);
    animation: streak-badge-pop 0.3s ease;
    z-index: 5;
}

@keyframes streak-badge-pop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Streak milestone celebration - gold pulse glow */
.quiz-streak-badge.milestone-celebration {
    animation: streakMilestonePulse 0.6s ease-out 2;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 4px rgba(251, 191, 36, 0.3),
        0 4px 20px rgba(251, 191, 36, 0.4);
}

/* Submit button submitting state */
.quiz-submit-btn.submitting {
    animation: submitLock 0.2s ease-out;
    pointer-events: none;
}

/* ============================================
   FINISH BUTTON - Green Completion
   ============================================ */
.quiz-finish-btn {
    padding: 11px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    /* Premium layered shadow */
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.15),
        0 4px 12px rgba(16, 185, 129, 0.25);
    animation: pulse-finish 2s ease-in-out infinite;
}

.quiz-finish-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(16, 185, 129, 0.2),
        0 8px 20px rgba(16, 185, 129, 0.3);
}

@keyframes pulse-finish {
    0%, 100% {
        box-shadow:
            0 2px 4px rgba(16, 185, 129, 0.15),
            0 4px 12px rgba(16, 185, 129, 0.25);
    }
    50% {
        box-shadow:
            0 4px 8px rgba(16, 185, 129, 0.2),
            0 8px 20px rgba(16, 185, 129, 0.35),
            0 0 0 4px rgba(16, 185, 129, 0.08);
    }
}

/* ============================================
   CHARACTER REACTION - Onigiri Celebration
   ============================================ */
.quiz-character-reaction {
    position: absolute;
    bottom: 90px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: bounce-in-reaction 0.4s ease;
    z-index: 10;
}

@keyframes bounce-in-reaction {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.quiz-character-reaction .reaction-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 3px solid rgba(234, 88, 12, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
    overflow: hidden;
}

.quiz-character-reaction .reaction-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.quiz-character-reaction .reaction-bubble {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #047857;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Incorrect reaction - softer yellow learning bubble */
.quiz-character-reaction.incorrect .reaction-bubble {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: #713f12;
}

/* ===== START SCREEN ===== */
.quiz-start-screen {
    position: relative;
    padding: 24px 28px;
    text-align: center;
    z-index: 1;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* Hero Section - Icon + Title + Badge */
.quiz-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.quiz-start-icon {
    font-size: 4.5em;
    margin-bottom: 4px;
    animation: floatBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(var(--quiz-primary-rgb), 0.3));
}

.quiz-start-icon-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow:
        0 6px 24px rgba(var(--quiz-primary-rgb), 0.2),
        0 3px 10px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 12px;
    border: 2px solid rgba(var(--quiz-primary-rgb), 0.08);
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.02); }
}

.quiz-start-title {
    font-size: 1.8em;
    font-weight: 800;
    background: linear-gradient(135deg, #1f2937 0%, var(--quiz-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Pool Badge - Subtle question count */
.quiz-pool-badge {
    font-size: 0.9em;
    font-weight: 500;
    color: #64748b;
    margin: 0 0 8px 0;
    padding: 6px 14px;
    background: rgba(100, 116, 139, 0.08);
    border-radius: 20px;
}

.quiz-pool-badge span {
    font-weight: 700;
    color: var(--quiz-primary);
}

/* Daily Streak Display */
.quiz-streak-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 16px 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-radius: 20px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.quiz-streak-fire {
    font-size: 1.2em;
    animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.quiz-streak-count {
    font-size: 1.3em;
    font-weight: 800;
    color: #d97706;
}

.quiz-streak-label {
    font-size: 0.95em;
    font-weight: 600;
    color: #92400e;
}

.quiz-streak-best {
    font-size: 0.85em;
    color: #b45309;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(180, 83, 9, 0.2);
}

.quiz-streak-best:empty {
    display: none;
}

/* Settings wrapper - legacy */
.quiz-start-subtitle {
    display: none;
}

.quiz-start-stats {
    display: none;
}

/* Config Cards - Premium card design for settings */
.quiz-config-card {
    background: #f1f5f9;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-config-header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-config-label {
    font-size: 0.8em;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quiz Length Buttons - Pill selector */
.quiz-length-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 5px;
    gap: 4px;
    width: 100%;
    max-width: 320px;
}

/* Hide container when empty */
.quiz-length-buttons:empty {
    display: none;
}

.quiz-length-btn {
    flex: 1;
    min-width: 48px;
    padding: 10px 12px;
    font-size: 0.95em;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-length-btn:hover:not(.active) {
    color: #1a1a2e;
    background: rgba(var(--quiz-primary-rgb), 0.08);
}

.quiz-length-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 100%);
    box-shadow: 0 2px 8px rgba(var(--quiz-primary-rgb), 0.3);
}

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

/* Quiz Mode Buttons - Larger card-style buttons */
.quiz-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quiz-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 12px;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.quiz-mode-btn:hover:not(.active) {
    border-color: rgba(var(--quiz-primary-rgb), 0.3);
    background: rgba(var(--quiz-primary-rgb), 0.04);
}

.quiz-mode-btn.active {
    border-color: var(--quiz-primary);
    background: linear-gradient(135deg, rgba(var(--quiz-primary-rgb), 0.08) 0%, rgba(var(--quiz-primary-rgb), 0.04) 100%);
    box-shadow: 0 0 0 3px rgba(var(--quiz-primary-rgb), 0.12);
}

.quiz-mode-icon {
    font-size: 1.6em;
    line-height: 1;
}

.quiz-mode-label {
    font-size: 0.9em;
    font-weight: 700;
    color: #1f2937;
}

.quiz-mode-btn.active .quiz-mode-label {
    color: var(--quiz-primary-dark);
}

.quiz-mode-desc {
    font-size: 0.75em;
    font-weight: 500;
    color: #94a3b8;
}

.quiz-mode-btn.active .quiz-mode-desc {
    color: var(--quiz-primary);
}

/* ============================================
   PREMIUM RING TIMER
   ============================================ */
.quiz-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
}

/* Ring Timer */
.quiz-timer-ring {
    position: relative;
    width: 90px;
    height: 90px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: var(--quiz-primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 264; /* 2 * PI * 42 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(var(--quiz-primary-rgb), 0.4));
}

.timer-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.timer-seconds {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--quiz-primary-dark);
    line-height: 1;
    transition: color 0.3s ease, transform 0.1s ease;
}

.timer-label {
    font-size: 0.65em;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Glow effect behind ring */
.timer-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--quiz-primary-rgb), 0.15) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* === URGENCY STATES === */

/* Warning state (50-25% time) */
.quiz-timer-ring.timer-warning .timer-progress {
    stroke: #f59e0b;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.quiz-timer-ring.timer-warning .timer-seconds {
    color: #d97706;
}

.quiz-timer-ring.timer-warning .timer-glow {
    opacity: 1;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
}

/* Critical state (<25% time) */
.quiz-timer-ring.timer-critical .timer-progress {
    stroke: #ef4444;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
    animation: ringPulse 0.6s ease-in-out infinite;
}

.quiz-timer-ring.timer-critical .timer-seconds {
    color: #dc2626;
    animation: numberPulse 0.6s ease-in-out infinite;
}

.quiz-timer-ring.timer-critical .timer-glow {
    opacity: 1;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, transparent 70%);
    animation: glowPulse 0.6s ease-in-out infinite;
}

/* Urgent state (<10% time) - more intense */
.quiz-timer-ring.timer-urgent .timer-progress {
    stroke: #dc2626;
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.7));
    animation: ringPulse 0.4s ease-in-out infinite;
}

.quiz-timer-ring.timer-urgent .timer-seconds {
    color: #b91c1c;
    animation: numberPulse 0.4s ease-in-out infinite, shake 0.4s ease-in-out infinite;
}

.quiz-timer-ring.timer-urgent .timer-glow {
    opacity: 1;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, transparent 70%);
    animation: glowPulse 0.4s ease-in-out infinite;
}

/* Timer animations */
@keyframes ringPulse {
    0%, 100% {
        stroke-width: 6;
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
    }
    50% {
        stroke-width: 7;
        filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.8));
    }
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-2px) scale(1.08); }
    75% { transform: translateX(2px) scale(1.08); }
}

/* === TIME BONUS === */
.time-bonus {
    position: absolute;
    top: -10px;
    right: -20px;
    font-size: 1.1em;
    font-weight: 800;
    color: #10b981;
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.time-bonus.show {
    animation: bonusPopup 1s ease-out forwards;
}

@keyframes bonusPopup {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(-5px) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateY(-15px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-25px) scale(0.9);
    }
}

/* === SPEED STREAK === */
.speed-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.speed-streak .streak-fire {
    font-size: 1em;
    animation: fireWiggle 0.5s ease-in-out infinite;
}

.speed-streak .streak-count {
    font-size: 0.9em;
    font-weight: 800;
    color: #d97706;
}

@keyframes fireWiggle {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.1); }
}

/* Speed mode - show minutes:seconds format */
.quiz-timer-ring.speed-mode .timer-label {
    display: none;
}

.quiz-timer-ring.speed-mode .timer-seconds {
    font-size: 1.4em;
}

/* ===== NEW QUIZ START SCREEN VIEWS ===== */

/* Resume View - shown when there's saved progress */
.quiz-resume-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.quiz-resume-view .quiz-start-title {
    font-size: 1.5em;
    margin-bottom: 8px;
}

/* Visual progress dots for resume */
.quiz-resume-progress-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.quiz-resume-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 280px;
}

.quiz-resume-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.quiz-resume-dot.filled {
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 100%);
    box-shadow: 0 2px 6px rgba(var(--quiz-primary-rgb), 0.3);
}

.quiz-resume-dot.empty {
    background: #e2e8f0;
}

.quiz-resume-count {
    font-size: 1.1em;
    font-weight: 700;
    color: #475569;
}

.quiz-resume-view .quiz-resume-time {
    font-size: 0.9em;
    color: #94a3b8;
}

/* New Quiz View - shown when no saved progress */
.quiz-new-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.quiz-new-view .quiz-start-title {
    font-size: 1.8em;
    margin-bottom: 0;
}

.quiz-new-view .quiz-length-buttons {
    margin: 8px 0;
}

/* Secondary button style (Start Fresh) */
.quiz-secondary-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1em;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-secondary-btn:hover {
    color: #475569;
    background: rgba(0, 0, 0, 0.04);
}

/* Legacy Resume Section (can be removed after migration) */
.quiz-resume-section {
    display: none;
}

/* Settings wrapper */
.quiz-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-top: 4px;
}

.quiz-start-btn {
    position: relative;
    width: 100%;
    padding: 16px 32px;
    margin-top: 4px;
    font-size: 1.1em;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 50%, var(--quiz-primary) 100%);
    background-size: 200% 100%;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 15px rgba(var(--quiz-primary-rgb), 0.35),
        0 0 0 0 rgba(var(--quiz-primary-rgb), 0.4);
    letter-spacing: 0.02em;
    overflow: hidden;
}

.quiz-start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.quiz-start-btn:hover:not(:disabled)::before {
    left: 100%;
}

.quiz-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
        0 8px 25px rgba(var(--quiz-primary-rgb), 0.45),
        0 0 0 3px rgba(var(--quiz-primary-rgb), 0.12);
}

.quiz-start-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.quiz-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: none;
}

/* ===== QUESTION SCREEN ===== */
.quiz-question-screen {
    position: relative;
    padding: 20px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    /* Warm cream background matching mockup */
    background: #FDF8F3;
    /* Base transition for slide animations */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Question slide transitions for navigation */
.quiz-question-screen.slide-exit-left {
    transform: translateX(-40px) scale(0.97);
    opacity: 0;
}

.quiz-question-screen.slide-enter-right {
    transform: translateX(40px) scale(0.97);
    opacity: 0;
    transition: none; /* Instant positioning before animate-in */
}

.quiz-question-screen.slide-enter-active {
    transform: translateX(0) scale(1);
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

/* Styled scrollbar for quiz content */
.quiz-question-screen::-webkit-scrollbar {
    width: 6px;
}

.quiz-question-screen::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.quiz-question-screen::-webkit-scrollbar-thumb {
    background: rgba(var(--quiz-primary-rgb), 0.3);
    border-radius: 3px;
}

.quiz-question-screen::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--quiz-primary-rgb), 0.5);
}

.quiz-badges-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
    /* Subtle entrance animation */
    animation: badgesRowReveal 0.3s ease-out;
}

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

.quiz-question-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 7px 16px;
    /* Premium gradient pill badge */
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 100px;
    /* Layered shadow for depth + subtle glow */
    box-shadow:
        0 1px 2px rgba(139, 92, 246, 0.2),
        0 4px 8px rgba(139, 92, 246, 0.15),
        0 0 20px rgba(139, 92, 246, 0.1);
    /* Subtle inner highlight */
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* Subtle shine effect on badge */
.quiz-question-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 100px 100px 0 0;
    pointer-events: none;
}

/* Word mastery status badge - Premium glass morphism style */
.quiz-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 100px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.quiz-status-badge[data-status="new"] {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    box-shadow:
        0 1px 3px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.quiz-status-badge[data-status="seen"] {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.1) 0%, rgba(148, 163, 184, 0.06) 100%);
    border-color: rgba(148, 163, 184, 0.15);
    color: #64748b;
    box-shadow:
        0 1px 3px rgba(148, 163, 184, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Animated dot indicator with pulse */
.quiz-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
    animation: statusDotPulse 2s ease-in-out infinite;
}

@keyframes statusDotPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.quiz-question-text {
    /* Nunito for English prompts - set in typography section */
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.65;
    letter-spacing: -0.01em;
    /* Use block + text-align instead of flex for proper text flow */
    display: block;
    text-align: center;
    padding: 18px 22px;
    /* Premium gradient background */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    /* Layered shadow for depth */
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

/* Japanese text in questions - elegant calligraphy */
.quiz-question-text .quiz-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 1.1em;
    color: #1a1a2e;
    letter-spacing: 0.03em;
}

.quiz-hint {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--quiz-hint-text);
    text-align: center;
    padding: 14px 20px;
    background: var(--quiz-hint-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--quiz-hint-border);
    border-radius: 14px;
    display: none;
    flex-shrink: 0; /* Prevent hints from being compressed - push content down */
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 4px 12px var(--quiz-hint-border);
}

/* ============================================
   UNIFIED HINT BAR
   ============================================ */
.quiz-hint-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 5px;
    background: rgba(241, 245, 249, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    margin: 0 auto;
    width: fit-content;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.quiz-hint-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.82em;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-hint-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--quiz-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.quiz-hint-btn.active {
    background: white;
    color: var(--quiz-primary);
    border-color: rgba(var(--quiz-primary-rgb), 0.15);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 2px 6px rgba(var(--quiz-primary-rgb), 0.08);
}

.quiz-hint-btn.hidden {
    display: none;
}

.quiz-hint-btn .hint-icon {
    font-size: 1em;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.quiz-hint-btn .hint-label {
    font-size: 0.9em;
}

/* Kanji button - special styling */
#quizKanjiToggle .hint-icon {
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

/* Hint Content Area */
.quiz-hint-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex-shrink: 0; /* Ensure hints push content down, not overlay on mobile */
}

.quiz-hint-content:empty {
    display: none;
}

/* Shared hint text styles */
.quiz-hint-text {
    display: none;
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    padding: 12px 18px;
    border-radius: 12px;
    line-height: 1.5;
    animation: hintFadeIn 0.25s ease-out;
}

.quiz-hint-text.visible {
    display: block;
}

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

/* Romanized Text - Purple/Primary theme */
.quiz-romanized-text {
    color: var(--quiz-primary);
    background: linear-gradient(135deg, rgba(var(--quiz-primary-rgb), 0.06) 0%, rgba(var(--quiz-primary-rgb), 0.03) 100%);
    border: 1px solid rgba(var(--quiz-primary-rgb), 0.15);
}

/* Kanji Text - Indigo/Blue theme */
.quiz-kanji-text {
    color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(79, 70, 229, 0.03) 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
    font-size: 1.15em;
    font-weight: 600;
}

/* Kana Text - Rose/Pink theme */
.quiz-kana-text {
    color: #e11d48;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.06) 0%, rgba(225, 29, 72, 0.03) 100%);
    border: 1px solid rgba(225, 29, 72, 0.15);
    font-size: 1.15em;
    font-weight: 600;
}

/* English Text - Green theme */
.quiz-english-text {
    color: #059669;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06) 0%, rgba(5, 150, 105, 0.03) 100%);
    border: 1px solid rgba(5, 150, 105, 0.15);
}

/* Answer Buttons */
.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
    flex: 0 0 auto; /* Use natural size - don't grow to fill space */
}

.quiz-answer-btn {
    position: relative;
    padding: 14px 16px;
    background: white;
    border: 2px solid #E5E5E5;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    min-height: 60px;
    will-change: transform, box-shadow;
}

.quiz-answer-btn .answer-jp {
    font-size: 1.15em;
    font-weight: 600;
    color: #2D2D2D;
    flex: 1;
}

.quiz-answer-btn .answer-en {
    font-size: 0.85em;
    color: #6B6B6B;
    margin-left: auto;
    /* Staggered entrance animation */
    opacity: 0;
    animation: quizAnswerSlideIn 0.35s ease forwards;
    /* Layered shadow for depth */
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Stagger delays for each answer button - spread for visible cascade */
.quiz-answer-btn:nth-child(1) { animation-delay: 0s; }
.quiz-answer-btn:nth-child(2) { animation-delay: 0.08s; }
.quiz-answer-btn:nth-child(3) { animation-delay: 0.16s; }
.quiz-answer-btn:nth-child(4) { animation-delay: 0.24s; }

/* Left accent stripe - appears on hover/select */
.quiz-answer-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.2s ease;
}

.quiz-answer-btn:hover:not(:disabled) {
    border-color: #a5b4fc;
    background: linear-gradient(90deg, #f5f3ff 0%, white 20%);
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(99, 102, 241, 0.08),
        0 4px 12px rgba(99, 102, 241, 0.12);
}

.quiz-answer-btn:hover:not(:disabled)::before {
    background: linear-gradient(180deg, #6366f1, #a78bfa);
}

.quiz-answer-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
}

/* Number badge - colorful gradient by default (cheerful) */
.quiz-answer-num {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--quiz-num-bg);
    color: var(--quiz-num-text);
    font-size: 0.85em;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s ease;
    z-index: 1;
}

.quiz-answer-btn:hover:not(:disabled) .quiz-answer-num {
    background: var(--quiz-num-hover-bg);
    color: var(--quiz-num-hover-text);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Selected State (before submit) - clean lift effect */
.quiz-answer-btn.selected {
    background: var(--quiz-selected-bg);
    border-color: var(--quiz-selected-border);
    color: var(--quiz-selected-text);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 0 3px rgba(var(--quiz-primary-rgb), 0.2), 0 4px 12px rgba(var(--quiz-primary-rgb), 0.15);
    /* No bounce animation - smooth transition is cleaner */
}

.quiz-answer-btn.selected::before {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}

.quiz-answer-btn.selected .quiz-answer-num {
    background: var(--quiz-num-hover-bg);
    color: var(--quiz-num-hover-text);
    box-shadow: 0 2px 8px rgba(var(--quiz-primary-rgb), 0.4);
}

/* Correct/Incorrect States - Cheerful Celebration */
.quiz-answer-btn.correct {
    background: var(--quiz-correct-bg) !important;
    border-color: var(--quiz-correct-border) !important;
    color: var(--quiz-correct-text) !important;
    font-weight: 600;
    animation: quizCorrectPulse 0.6s ease-out;
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.1),
        0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

.quiz-answer-btn.correct::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.quiz-answer-btn.correct .quiz-answer-num {
    background: var(--quiz-correct-num-bg) !important;
    color: var(--quiz-correct-num-text) !important;
}

/* Incorrect - softer peach/coral instead of harsh red */
.quiz-answer-btn.incorrect {
    background: linear-gradient(90deg, #fef2f2 0%, #fff7f5 100%) !important;
    border-color: #fca5a5 !important;
    border-width: 2.5px !important;
    color: #b91c1c !important;
    /* No shake - clean state change is more elegant */
}

.quiz-answer-btn.incorrect::before {
    background: linear-gradient(180deg, #fca5a5, #f87171);
}

.quiz-answer-btn.incorrect .quiz-answer-num {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%) !important;
    color: #b91c1c !important;
}

.quiz-answer-btn:disabled {
    cursor: default;
}

/* ============================================
   ANSWER CARDS (after submit) - Quiz Results Format
   ============================================ */

/* Switch from 2x2 grid to vertical list */
.quiz-answers.answered-mode {
    display: flex;
    flex-direction: column;
    gap: 0;
    order: 2; /* Move answers below feedback */
    flex: 0 0 auto; /* Don't grow/shrink, use natural size */
    padding-bottom: 24px; /* Visual end indicator */
    animation: answersAppear 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ============================================
   COLLAPSIBLE ANSWERS SECTION (matches word stories style)
   ============================================ */
.answers-collapsible {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
}

.answers-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.answers-collapsible-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.collapsible-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Expand hint (matches word stories .expand-hint) */
.answers-collapsible .expand-hint {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.4);
    margin-left: 8px;
    text-transform: lowercase;
}

/* Expanded state */
.answers-collapsible-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 12px;
    max-height: 800px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, padding 0.3s ease;
}

/* Collapsed state (matches word stories pattern) */
.answers-collapsible.collapsed .answers-collapsible-content {
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

/* Hide navigation arrows when answered (Continue button replaces them) */
.quiz-question-screen:has(.quiz-answers.answered-mode) .quiz-navigation {
    display: none;
}

@keyframes answersAppear {
    from {
        opacity: 0.7;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Move feedback above answers when in answered mode */
.quiz-answers.answered-mode ~ .quiz-feedback {
    order: 1;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* Hide Tip button after submission (user-suggested) */
.quiz-question-screen:has(.quiz-answers.answered-mode) #quizTipToggle {
    display: none;
}

/* Hide badges row after submission to save space */
.quiz-question-screen:has(.quiz-answers.answered-mode) .quiz-badges-row {
    display: none;
}

/* Hide hint bar after submission */
.quiz-question-screen:has(.quiz-answers.answered-mode) .quiz-hint-bar {
    display: none;
}

/* Ensure hints push content down properly after submission */
.quiz-question-screen:has(.quiz-answers.answered-mode) .quiz-hint-content,
.quiz-question-screen:has(.quiz-answers.answered-mode) .quiz-hint {
    flex-shrink: 0;
}

.quiz-answer-card {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    cursor: pointer;
    /* Smoother transition with GPU acceleration */
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    will-change: transform;
}

.quiz-answer-card:hover {
    background: rgba(0, 0, 0, 0.045);
    border-color: rgba(0, 0, 0, 0.06);
    transform: translateX(3px);
}

/* Correct answer card */
.quiz-answer-card.correct {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.quiz-answer-card.correct:hover {
    background: rgba(16, 185, 129, 0.12);
}

/* Incorrect answer card */
.quiz-answer-card.incorrect {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.quiz-answer-card.incorrect:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Previewing state */
.quiz-answer-card.previewing {
    border-left: 3px solid var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.06);
    padding-left: 13px;
}

.quiz-answer-card.correct.previewing {
    border-left-color: #10b981;
}

.quiz-answer-card.incorrect.previewing {
    border-left-color: #ef4444;
}

/* Compact view - matches quiz results format exactly */
.answer-card-compact {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.answer-card-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 3px;
}

.quiz-answer-card.correct .answer-card-num {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    position: relative;
}

.quiz-answer-card.incorrect .answer-card-num {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    position: relative;
}

/* Small X indicator on incorrect answer card number */
.quiz-answer-card.incorrect .answer-card-num::after {
    content: '✗';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

/* Correct answer card gets a checkmark badge */
.quiz-answer-card.correct .answer-card-num::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

/* Content area - two line layout like quiz results */
.answer-card-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* Row 1: Word + meta (pos + dots) */
.answer-card-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.answer-card-word {
    font-size: 1.35em;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: 0.01em;
}

.answer-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-card-pos {
    font-size: 0.75em;
    color: var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.1);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.answer-card-dots {
    color: #94a3b8;
    font-size: 0.9em;
    letter-spacing: 2px;
}

/* Row 2: Roma · English */
.answer-card-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    margin-top: 2px;
}

.answer-card-roma {
    color: var(--quiz-primary);
    font-weight: 600;
}

.answer-card-sep {
    color: #94a3b8;
}

.answer-card-english {
    color: #475569;
    font-weight: 500;
}

/* Preview (shown on hover) - matches quiz results exactly */
.answer-card-preview {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    background: linear-gradient(135deg, rgba(var(--quiz-primary-rgb), 0.06) 0%, rgba(var(--quiz-primary-rgb), 0.03) 100%);
    border-radius: 14px;
    gap: 14px;
    align-items: center;
    /* Quick reveal animation */
    animation: answerPreviewFadeIn 0.15s ease-out;
    will-change: opacity, transform;
}

/* Green tint for correct answer preview */
.quiz-answer-card.correct .answer-card-preview {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
}

/* Red tint for incorrect answer preview */
.quiz-answer-card.incorrect .answer-card-preview {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.04) 100%);
}

@keyframes answerPreviewFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.quiz-answer-card.previewing .answer-card-preview {
    display: flex;
}

.quiz-answer-card.previewing .answer-card-compact {
    display: none;
}

/* Preview Image - matches review-preview-image */
.answer-card-image {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    /* Prevent layout shift - reserve space with background */
    background: linear-gradient(135deg, #f5f5f4 0%, #e7e5e4 100%);
    /* Images are preloaded, no transition needed */
}

/* Preview Content - matches review-preview-content (centered) */
.answer-card-preview-content {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.answer-card-preview-word {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    line-height: 1.3;
}

.answer-card-preview-roma {
    font-size: 0.9rem;
    color: var(--quiz-primary);
    margin-bottom: 4px;
    font-weight: 500;
}

.answer-card-preview-english {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.4;
    margin-bottom: 6px;
}

.answer-card-preview-pos {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.1);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 500;
}

/* Answer Feedback Animations */
@keyframes correctPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    30% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.3);
    }
    60% {
        transform: scale(1.01);
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
}

@keyframes incorrectShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-6px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(6px);
    }
}

/* Feedback text animations */
.quiz-feedback.correct {
    animation: feedbackSlideIn 0.3s ease-out;
}

.quiz-feedback.incorrect {
    animation: feedbackSlideIn 0.3s ease-out;
}

@keyframes feedbackSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Confetti container */
.quiz-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
}

@keyframes confettiBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) rotate(540deg) scale(0.3);
    }
}

/* Results screen celebration confetti - longer, more dramatic */
@keyframes confettiResultsBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) rotate(720deg) scale(0.2);
    }
}

.confetti-results {
    /* Slightly larger for results celebration */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .quiz-answer-btn.correct,
    .quiz-answer-btn.incorrect {
        animation: none;
    }

    .quiz-answer-btn:hover:not(:disabled) {
        transform: none;
    }

    .quiz-feedback.correct,
    .quiz-feedback.incorrect {
        animation: none;
    }

    .confetti-piece {
        display: none;
    }

    .quiz-modal::before,
    .quiz-modal::after {
        animation: none;
    }

    .quiz-start-icon {
        animation: none;
    }

    .quiz-results-icon {
        animation: none;
    }

    .quiz-streak-fire {
        animation: none;
    }

    .quiz-score-value {
        animation: none;
    }

    .quiz-progress-segment.current {
        animation: none;
        opacity: 0.6;
    }

    .quiz-timer-ring.timer-warning .timer-progress,
    .quiz-timer-ring.timer-critical .timer-progress,
    .quiz-timer-ring.timer-urgent .timer-progress,
    .quiz-timer-ring.timer-critical .timer-seconds,
    .quiz-timer-ring.timer-urgent .timer-seconds,
    .quiz-timer-ring.timer-critical .timer-glow,
    .quiz-timer-ring.timer-urgent .timer-glow,
    .speed-streak .streak-fire {
        animation: none;
    }

    .quiz-start-btn::before {
        display: none;
    }
}

/* Submit Button - positioned in navigation row */
.quiz-submit-btn {
    flex: 1;
    max-width: 200px;
    padding: 11px 18px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    /* Vibrant indigo gradient */
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    /* Premium layered shadow */
    box-shadow:
        0 2px 4px rgba(99, 102, 241, 0.15),
        0 4px 12px rgba(99, 102, 241, 0.25);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    pointer-events: none;
}

.quiz-submit-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.quiz-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(99, 102, 241, 0.2),
        0 8px 20px rgba(99, 102, 241, 0.3);
}

.quiz-submit-btn:active {
    transform: translateY(0) scale(0.99);
}

/* Audio Question Styling */
.quiz-audio-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.quiz-audio-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 40px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.quiz-audio-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.quiz-audio-play-btn:active {
    transform: scale(0.98);
}

.quiz-audio-play-btn .audio-icon {
    font-size: 2.5em;
}

.quiz-audio-play-btn .audio-label {
    font-size: 0.95em;
    color: white;
    font-weight: 500;
}

.quiz-audio-instruction {
    font-size: 1.1em;
    color: #64748b;
    text-align: center;
    margin: 0;
}

/* Context Hint with Character */
.quiz-context-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FDF8F3 0%, #FEF7ED 100%);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 16px;
    margin: 12px 0 8px;
    animation: fadeInUp 0.3s ease;
}

.quiz-context-hint.hidden {
    display: none;
}

.quiz-context-hint .context-character {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
}

.quiz-context-hint .context-text {
    font-size: 0.95em;
    color: #78716c;
    line-height: 1.5;
    font-style: italic;
}

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

/* ===== RICH FEEDBACK (Mockup v3 style) ===== */
/* ============================================
   FEEDBACK SECTION - Premium Visual Polish
   ============================================ */
.quiz-feedback {
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    animation: feedbackSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Premium layered shadow */
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.04);
}

.quiz-feedback:empty {
    min-height: 0;
    padding: 0;
    box-shadow: none;
}

/* Correct feedback - refined emerald theme */
.quiz-feedback.correct {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid rgba(16, 185, 129, 0.15);
    /* Gradient accent strip instead of harsh border */
    position: relative;
}

.quiz-feedback.correct::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
    border-radius: 20px 20px 0 0;
}

/* Incorrect feedback - warm amber theme */
.quiz-feedback.incorrect {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
    border: 1px solid rgba(245, 158, 11, 0.15);
    position: relative;
}

.quiz-feedback.incorrect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%);
    border-radius: 20px 20px 0 0;
}

/* Feedback overlay content container */
.feedback-overlay-content {
    padding: 24px;
}

/* Staggered entrance for content sections */
.feedback-header {
    animation: feedbackElementReveal 0.35s ease-out 0.05s both;
}

.feedback-body {
    animation: feedbackElementReveal 0.35s ease-out 0.15s both;
}

.feedback-footer {
    animation: feedbackElementReveal 0.35s ease-out 0.25s both;
}

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

/* Feedback header - icon + title */
.feedback-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.feedback-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    /* Premium shadow for depth */
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
    animation: feedbackIconBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.1s both;
}

@keyframes feedbackIconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-icon.correct {
    background: linear-gradient(145deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.1),
        0 4px 8px rgba(16, 185, 129, 0.12);
}

.feedback-icon.wrong {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    box-shadow:
        0 2px 4px rgba(245, 158, 11, 0.1),
        0 4px 8px rgba(245, 158, 11, 0.12);
}

.feedback-title {
    font-family: 'Nunito', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.feedback-title.correct {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feedback-title.wrong {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Feedback body - answer + explanation */
.feedback-body {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.01) 100%);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}

.quiz-feedback.correct .feedback-body {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-color: rgba(16, 185, 129, 0.08);
}

.quiz-feedback.incorrect .feedback-body {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.04) 0%, rgba(245, 158, 11, 0.02) 100%);
    border-color: rgba(245, 158, 11, 0.08);
}

/* Answer display */
.feedback-answer {
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    color: #374151;
    line-height: 1.7;
}

/* Card-based comparison layout (v2 enhanced) */
.feedback-comparison {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-card {
    padding: 16px 18px;
    border-radius: 14px;
    border: 2px solid;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feedback-card:hover {
    transform: translateY(-1px);
}

/* Wrong answer card - warm amber theme */
.feedback-card-wrong {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(217, 119, 6, 0.25);
    box-shadow:
        0 2px 8px rgba(217, 119, 6, 0.08),
        0 4px 16px rgba(217, 119, 6, 0.06);
    animation: feedbackCardReveal 0.4s ease-out 0.1s both;
}

/* Correct answer card - emerald theme */
.feedback-card-correct {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow:
        0 2px 8px rgba(16, 185, 129, 0.1),
        0 4px 16px rgba(16, 185, 129, 0.08);
    animation: feedbackCardReveal 0.4s ease-out 0.2s both;
}

@keyframes feedbackCardReveal {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feedback-card-label {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 8px;
}

.feedback-card-wrong .feedback-card-label {
    color: #b45309;
}

.feedback-card-correct .feedback-card-label {
    color: #047857;
}

.feedback-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.feedback-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.feedback-card-badge.wrong {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    color: #92400e;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
}

.feedback-card-badge.correct {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.feedback-card-details {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

/* Legacy row layout (backward compat) */
.feedback-answer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}

.feedback-answer-row:last-child {
    margin-bottom: 0;
}

.feedback-label {
    font-family: 'Nunito', sans-serif;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 85px;
}

/* Word styling in feedback - Use Klee One for Japanese */
.feedback-word-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 1.6em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.feedback-word-jp.correct-text {
    color: #047857;
    text-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

/* In card layout, wrong text has warmer color */
.feedback-card-wrong .feedback-word-jp.wrong-text {
    color: #92400e;
    opacity: 1;
}

/* Legacy row layout styling */
.feedback-word-jp.wrong-text {
    color: #78716c;
    opacity: 0.85;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Small inline "not quite" indicator - only in legacy layout */
.feedback-answer-row .feedback-word-jp.wrong-text::after {
    content: '✗';
    font-size: 0.55em;
    font-weight: 700;
    color: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid rgba(217, 119, 6, 0.2);
    vertical-align: middle;
    flex-shrink: 0;
}

/* Card layout doesn't need ::after since we have the badge */
.feedback-card .feedback-word-jp.wrong-text::after {
    display: none;
}

.feedback-word-roman {
    font-family: 'Nunito', sans-serif;
    color: #78716c;
    font-size: 13px;
    font-style: italic;
}

/* Contextual roman text colors */
.feedback-card-wrong .feedback-word-roman {
    color: #a16207;
}

.feedback-card-correct .feedback-word-roman {
    color: #047857;
    opacity: 0.8;
}

.feedback-word-en {
    font-family: 'Nunito', sans-serif;
    color: var(--quiz-primary);
    font-size: 14px;
    font-weight: 600;
}

/* Contextual English text colors */
.feedback-card-wrong .feedback-word-en {
    color: #92400e;
}

.feedback-card-correct .feedback-word-en {
    color: #047857;
}

/* Explanation section - learning tip style (enhanced v2) */
.feedback-why {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 18px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border-radius: 14px;
    border: 1.5px solid rgba(234, 179, 8, 0.25);
    box-shadow:
        0 2px 8px rgba(234, 179, 8, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: feedbackTipReveal 0.4s ease-out 0.35s both;
}

@keyframes feedbackTipReveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-why-icon {
    font-size: 20px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    animation: feedbackTipIconPulse 2s ease-in-out 1s infinite;
}

@keyframes feedbackTipIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.feedback-why-text {
    font-family: 'Nunito', sans-serif;
    font-size: 14.5px;
    color: #78350f;
    line-height: 1.7;
}

.feedback-why-text strong {
    color: #92400e;
    font-weight: 700;
}

/* Japanese text in why section */
.feedback-why-text .quiz-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    color: #1f2937;
}

/* Mascot encouragement (legacy full layout) */
.feedback-mascot {
    display: flex;
    align-items: center;
    gap: 14px;
}

.feedback-mascot .mascot-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid rgba(234, 88, 12, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow:
        0 2px 4px rgba(234, 88, 12, 0.08),
        0 4px 8px rgba(234, 88, 12, 0.06);
}

.feedback-mascot .mascot-speech {
    flex: 1;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #6b7280;
}

.feedback-mascot .mascot-speech.correct {
    color: #059669;
    font-weight: 600;
}

/* Feedback footer - mascot inline + continue button */
.feedback-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.feedback-mascot-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Mascot avatar - warm Onigiri styling */
.feedback-mascot-inline .mascot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    /* Warm peach gradient like main avatar */
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 2.5px solid rgba(234, 88, 12, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* Subtle depth shadow */
    box-shadow:
        0 2px 4px rgba(234, 88, 12, 0.08),
        0 4px 12px rgba(234, 88, 12, 0.1);
    transition: transform 0.2s ease;
}

.feedback-mascot-inline .mascot-avatar:hover {
    transform: scale(1.05);
}

.feedback-mascot-inline .mascot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.feedback-mascot-inline .mascot-speech-inline {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.45;
    font-weight: 500;
}

.feedback-mascot-inline .mascot-speech-inline.correct {
    color: #059669;
    font-weight: 600;
}

/* Continue button in feedback - premium styling */
.feedback-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    /* Premium layered shadow */
    box-shadow:
        0 2px 4px rgba(var(--quiz-primary-rgb), 0.15),
        0 4px 8px rgba(var(--quiz-primary-rgb), 0.2),
        0 8px 16px rgba(var(--quiz-primary-rgb), 0.15);
}

.feedback-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(var(--quiz-primary-rgb), 0.2),
        0 8px 16px rgba(var(--quiz-primary-rgb), 0.25),
        0 12px 24px rgba(var(--quiz-primary-rgb), 0.2);
}

.feedback-continue-btn:active {
    transform: translateY(0);
    box-shadow:
        0 2px 4px rgba(var(--quiz-primary-rgb), 0.2),
        0 4px 8px rgba(var(--quiz-primary-rgb), 0.15);
}

/* Finish button - celebratory green */
.feedback-continue-btn.finish {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow:
        0 2px 4px rgba(16, 185, 129, 0.15),
        0 4px 8px rgba(16, 185, 129, 0.2),
        0 8px 16px rgba(16, 185, 129, 0.15);
}

.feedback-continue-btn.finish:hover {
    box-shadow:
        0 4px 8px rgba(16, 185, 129, 0.2),
        0 8px 16px rgba(16, 185, 129, 0.25),
        0 12px 24px rgba(16, 185, 129, 0.2);
}

/* Legacy feedback status/explanation (for backwards compat) */
.quiz-feedback .feedback-status {
    display: block;
    font-weight: 700;
    font-size: 1.05em;
}

.quiz-feedback .feedback-explanation {
    display: block;
    font-weight: 400;
    font-size: 0.92em;
    line-height: 1.5;
    opacity: 0.9;
}

/* ===== QUESTION NAVIGATION ===== */
.quiz-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding: 14px 18px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

/* End Quiz Early Button */
.quiz-end-early-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-end-early-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* End Quiz Confirmation Dialog */
.quiz-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10100;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quiz-confirm-overlay.active {
    opacity: 1;
}

.quiz-confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 28px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.quiz-confirm-overlay.active .quiz-confirm-dialog {
    transform: scale(1);
}

.quiz-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.quiz-confirm-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.quiz-confirm-message {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 24px;
}

.quiz-confirm-warning {
    color: #f59e0b;
    font-weight: 500;
}

.quiz-confirm-buttons {
    display: flex;
    gap: 12px;
}

.quiz-confirm-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-confirm-cancel {
    background: #f3f4f6;
    border: none;
    color: #374151;
}

.quiz-confirm-cancel:hover {
    background: #e5e7eb;
}

.quiz-confirm-end {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
}

.quiz-confirm-end:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Hide dots - navigation is via arrows only */
.quiz-nav-dots {
    display: none;
}

.quiz-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #57534e;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.quiz-nav-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #4f46e5;
    background: #f5f3ff;
    transform: translateY(-1px);
}

.quiz-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.quiz-nav-arrow {
    font-size: 1.1em;
    font-weight: 600;
}

.quiz-nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
    border: 2px solid #b4bfcc;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.quiz-nav-dot:hover {
    transform: scale(1.25);
    background: linear-gradient(145deg, #d1d5db 0%, #9ca3af 100%);
    border-color: #6b7280;
}

.quiz-nav-dot.current {
    background: linear-gradient(145deg, #818cf8 0%, #667eea 100%);
    border-color: #667eea;
    transform: scale(1.35);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
}

.quiz-nav-dot.correct {
    background: linear-gradient(145deg, #34d399 0%, #10b981 100%);
    border-color: #10b981;
}

.quiz-nav-dot.incorrect {
    background: linear-gradient(145deg, #f87171 0%, #ef4444 100%);
    border-color: #ef4444;
}

.quiz-nav-dot.current.correct {
    background: linear-gradient(145deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

.quiz-nav-dot.current.incorrect {
    background: linear-gradient(145deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
}

/* ===== RESULTS SCREEN ===== */
.quiz-results-screen {
    position: relative;
    padding: 30px;
    text-align: center;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
    z-index: 1;
}

.quiz-results-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    border-radius: 16px;
    margin: -10px -10px 20px -10px;
    padding: 20px;
}

.quiz-results-icon {
    font-size: 4em;
    margin-bottom: 12px;
    animation: celebrateIcon 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 24px rgba(102, 126, 234, 0.3));
}

@keyframes celebrateIcon {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(10deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.quiz-results-title {
    font-size: 1.6em;
    font-weight: 900;
    background: linear-gradient(135deg, #1f2937 0%, var(--quiz-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.quiz-results-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.quiz-score-value {
    font-size: 3.5em;
    font-weight: 900;
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 50%, var(--quiz-primary) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: scoreReveal 0.6s ease-out 0.3s both, shimmer 3s linear 1s infinite;
}

@keyframes scoreReveal {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-score-total {
    font-size: 1.5em;
    font-weight: 700;
    color: #94a3b8;
}

.quiz-results-percent {
    font-size: 1.1em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    display: inline-block;
}

/* Quick Stats Row */
/* Minimal Stats Row */
.quiz-results-stats-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 16px;
    font-size: 0.9em;
    color: #64748b;
}

.quiz-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quiz-stat-icon {
    font-size: 0.9em;
}

.quiz-stat-divider {
    color: #cbd5e1;
}

/* Interactive Review Section - Exact Vocab Search Style */
.quiz-review-section {
    margin-bottom: 20px;
}

.quiz-review-header {
    font-size: 0.75em;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.quiz-review-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Review as Flashcards Button */
.quiz-review-flashcards-btn {
    width: 100%;
    margin-top: 12px;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 600;
    color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quiz-review-flashcards-btn:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.quiz-review-flashcards-btn:active {
    transform: translateY(0);
}

/* Review Item - matches vocab-search-result */
.quiz-review-item {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-review-item:hover {
    background: rgba(0, 0, 0, 0.045);
    border-color: rgba(0, 0, 0, 0.06);
    transform: translateX(3px);
}

/* Previewing state - accent tint */
.quiz-review-item.previewing {
    border-left: 3px solid var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.06);
    padding-left: 13px;
}

/* Compact view - shown by default */
.review-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-compact .review-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.review-word {
    font-size: 1.15em;
    font-weight: 600;
    color: #1a1a2e;
}

.review-details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.review-roma {
    color: var(--quiz-primary);
    font-weight: 500;
}

.review-separator {
    color: #cbd5e1;
}

.review-english {
    color: #4a5568;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-pos {
    font-size: 0.7em;
    color: var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.review-dots {
    color: #cbd5e1;
    font-size: 0.75em;
    letter-spacing: 2px;
}

/* Mini Preview - shown on hover */
.review-preview {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    background: linear-gradient(135deg, rgba(var(--quiz-primary-rgb), 0.06) 0%, rgba(var(--quiz-primary-rgb), 0.03) 100%);
    border-radius: 14px;
    gap: 14px;
    align-items: center;
    animation: reviewPreviewFadeIn 0.2s ease-out;
}

@keyframes reviewPreviewFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Show preview, hide compact on hover */
.quiz-review-item.previewing .review-preview {
    display: flex;
}

.quiz-review-item.previewing .review-compact {
    display: none;
}

/* Preview Image */
.review-preview-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

/* Preview Content */
.review-preview-content {
    flex: 1;
    min-width: 0;
}

.review-preview-word {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
    line-height: 1.3;
}

.review-preview-roma {
    font-size: 0.85rem;
    color: var(--quiz-primary);
    margin-bottom: 3px;
    font-weight: 500;
}

.review-preview-english {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.35;
    margin-bottom: 4px;
}

.review-preview-pos {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--quiz-primary);
    background: rgba(var(--quiz-primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* Legacy styles - keep for compatibility */
.quiz-results-stats {
    display: none;
}

.quiz-results-breakdown {
    display: none;
}

.quiz-results-weak {
    display: none;
}

.quiz-results-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.quiz-results-stat-icon {
    font-size: 1.2em;
}

.quiz-results-stat-value {
    font-size: 1.3em;
    font-weight: 800;
    color: #1a1a2e;
}

.quiz-results-stat-label {
    font-size: 0.7em;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Titles */
.quiz-results-section-title {
    font-size: 0.85em;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
    text-align: left;
}

/* Breakdown by Type */
.quiz-results-breakdown {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(var(--quiz-primary-rgb), 0.04) 0%, rgba(var(--quiz-primary-rgb), 0.02) 100%);
    border-radius: 16px;
    border: 1px solid rgba(var(--quiz-primary-rgb), 0.08);
}

.quiz-breakdown-header {
    font-size: 0.75em;
    font-weight: 700;
    color: var(--quiz-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: left;
}

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

.quiz-breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
}

.quiz-breakdown-label {
    flex: 1;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quiz-breakdown-bar {
    flex: 2;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.quiz-breakdown-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: barFillReveal 0.6s ease-out;
}

@keyframes barFillReveal {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

.quiz-breakdown-fill.perfect {
    background: linear-gradient(90deg, #10b981, #059669);
}

.quiz-breakdown-fill.good {
    background: linear-gradient(90deg, var(--quiz-primary), var(--quiz-primary-hover));
}

.quiz-breakdown-fill.needs-work {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.quiz-breakdown-fill.struggling {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.quiz-breakdown-score {
    font-size: 0.85em;
    font-weight: 700;
    color: #64748b;
    min-width: 40px;
    text-align: right;
}

/* Weak Words Section */
.quiz-results-weak {
    margin-bottom: 20px;
}

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

.quiz-weak-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: 10px;
    text-align: left;
}

.quiz-weak-word {
    flex: 1;
    font-size: 1em;
    font-weight: 700;
    color: #1a1a2e;
}

.quiz-weak-answer {
    font-size: 0.85em;
    color: #dc2626;
    font-weight: 600;
}

.quiz-weak-answer::before {
    content: '→ ';
    color: #94a3b8;
}

.quiz-results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.quiz-retry-btn,
.quiz-close-btn {
    padding: 14px 32px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-retry-btn {
    color: white;
    background: linear-gradient(135deg, var(--quiz-primary) 0%, var(--quiz-primary-hover) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(var(--quiz-primary-rgb), 0.4);
}

.quiz-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--quiz-primary-rgb), 0.5);
}

.quiz-close-btn {
    color: #64748b;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
}

.quiz-close-btn:hover {
    background: #e2e8f0;
    color: #1a1a2e;
}

/* ===== DESKTOP ENHANCEMENTS ===== */
@media (min-width: 769px) {
    .quiz-modal {
        width: min(520px, 90vw);
        min-height: min(600px, 80vh);
    }

    .quiz-start-screen {
        padding: 36px 40px;
        gap: 24px;
    }

    .quiz-results-screen {
        padding: 48px 40px;
    }

    .quiz-question-screen {
        padding: 28px 40px 24px;
        gap: 16px;
    }

    .quiz-start-icon-img {
        width: 140px;
        height: 140px;
        padding: 14px;
    }

    .quiz-results-icon {
        font-size: 5em;
    }

    .quiz-start-title {
        font-size: 2em;
    }

    .quiz-results-title {
        font-size: 1.8em;
    }

    .quiz-pool-badge {
        font-size: 0.95em;
        padding: 8px 18px;
        margin-bottom: 12px;
    }

    .quiz-settings {
        gap: 16px;
        margin-top: 8px;
    }

    .quiz-config-card {
        padding: 16px 18px;
        gap: 12px;
    }

    .quiz-length-btn {
        padding: 14px 10px;
        font-size: 1em;
    }

    .quiz-mode-btn {
        padding: 20px 16px;
    }

    .quiz-mode-icon {
        font-size: 1.8em;
    }

    .quiz-mode-label {
        font-size: 0.95em;
    }

    .quiz-mode-desc {
        font-size: 0.8em;
    }

    .quiz-start-btn {
        padding: 18px 40px;
        font-size: 1.15em;
        margin-top: 12px;
    }

    .quiz-question-text {
        font-size: 1.3em;
        padding: 16px 20px;
    }

    /* Hint Bar - Desktop */
    .quiz-hint-bar {
        padding: 8px;
        gap: 8px;
    }

    .quiz-hint-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    .quiz-hint-text {
        padding: 14px 20px;
        font-size: 1.05em;
    }

    .quiz-kanji-text,
    .quiz-kana-text {
        font-size: 1.2em;
    }

    .quiz-answers {
        gap: 14px;
    }

    .quiz-answer-btn {
        padding: 20px 22px;
        font-size: 1.15em;
        border-radius: 16px;
    }

    .quiz-answer-num {
        width: 36px;
        height: 36px;
        font-size: 0.95em;
    }

    .quiz-feedback {
        font-size: 1.1em;
        padding: 16px 20px;
    }

    .quiz-score-value {
        font-size: 4em;
    }

    .quiz-score-total {
        font-size: 1.6em;
    }

    .quiz-results-percent {
        font-size: 1.2em;
    }

    .quiz-results-stats {
        gap: 32px;
        padding: 20px 0;
    }

    .quiz-results-stat-value {
        font-size: 1.5em;
    }

    .quiz-retry-btn,
    .quiz-close-btn {
        padding: 16px 40px;
        font-size: 1.05em;
    }

    .quiz-progress-bar {
        width: 160px;
        gap: 4px;
    }

    .quiz-progress-segment {
        height: 8px;
    }

    #quizProgressText {
        font-size: 1em;
    }

    .quiz-timer-ring {
        width: 100px;
        height: 100px;
    }

    .timer-seconds {
        font-size: 2em;
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Mobile: Bottom sheet slide-up pattern (like Word Stories) */
    .quiz-modal {
        /* Override centered positioning - anchor to bottom */
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        min-height: auto;
        /* Slide up from bottom (use translate3d for GPU acceleration) */
        -webkit-transform: translate3d(0, 100%, 0);
        transform: translate3d(0, 100%, 0);
        /* Bottom sheet border radius */
        border-radius: 24px 24px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        /* Smoother spring-like animation */
        -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                            opacity 0.3s ease,
                            visibility 0.3s ease;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.3s ease,
                    visibility 0.3s ease;
        /* Bottom sheet shadow */
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.25);
        /* Enable smooth touch scrolling */
        -webkit-overflow-scrolling: touch;
    }

    .quiz-modal.active {
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
    }

    /* Drag handle indicator for swipe-to-close affordance */
    .quiz-modal::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        z-index: 10;
    }

    /* Add top padding to account for drag handle */
    .quiz-modal-header {
        padding: 20px 16px 14px;
    }

    .quiz-progress-bar {
        width: 80px;
        gap: 2px;
    }

    .quiz-progress-segment {
        height: 5px;
        min-width: 6px;
    }

    .quiz-start-screen {
        padding: 24px 20px;
        gap: 16px;
        max-height: calc(90vh - 80px);
    }

    .quiz-question-screen,
    .quiz-results-screen {
        padding: 20px 16px;
        max-height: calc(90vh - 80px);
    }

    .quiz-hero {
        gap: 6px;
    }

    .quiz-start-icon,
    .quiz-results-icon {
        font-size: 2.5em;
        margin-bottom: 4px;
    }

    .quiz-start-icon-img {
        width: 90px;
        height: 90px;
        padding: 10px;
    }

    .quiz-start-title {
        font-size: 1.5em;
    }

    .quiz-results-title {
        font-size: 1.3em;
    }

    .quiz-pool-badge {
        font-size: 0.85em;
        padding: 5px 12px;
    }

    .quiz-settings {
        gap: 14px;
    }

    .quiz-config-card {
        padding: 12px 14px;
        gap: 8px;
        border-radius: 14px;
    }

    .quiz-config-label {
        font-size: 0.75em;
    }

    .quiz-length-buttons {
        border-radius: 10px;
        padding: 3px;
        gap: 3px;
    }

    .quiz-length-btn {
        padding: 10px 6px;
        font-size: 0.9em;
        border-radius: 8px;
    }

    .quiz-mode-buttons {
        gap: 8px;
    }

    .quiz-mode-btn {
        padding: 14px 10px;
        border-radius: 10px;
    }

    .quiz-mode-icon {
        font-size: 1.4em;
    }

    .quiz-mode-label {
        font-size: 0.85em;
    }

    .quiz-mode-desc {
        font-size: 0.7em;
    }

    .quiz-start-btn {
        padding: 14px 32px;
        font-size: 1em;
        margin-top: 2px;
    }

    .quiz-question-text {
        font-size: 1.1em;
        padding: 12px 16px;
    }

    .quiz-answers {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quiz-answer-btn {
        padding: 16px 18px;
        font-size: 1em;
    }

    /* Mobile: Tap-to-expand answer cards */
    .quiz-answer-card {
        transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
        cursor: pointer;
        /* Subtle tap affordance via dots */
    }

    /* Animate dots to hint at tap interaction */
    .quiz-answer-card .answer-card-dots {
        transition: opacity 0.2s ease;
    }

    .quiz-answer-card.previewing .answer-card-dots {
        opacity: 0;
    }

    /* Fast expand animation - instant feel on mobile */
    .answer-card-preview {
        animation: answerPreviewFadeIn 0.1s ease-out;
    }

    .answer-card-compact {
        transition: opacity 0.15s ease;
    }

    /* Active state feedback on tap */
    .quiz-answer-card:active {
        transform: scale(0.98);
        background: rgba(0, 0, 0, 0.04);
    }

    .answer-card-image {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
    }

    /* Same tap-to-expand for review items */
    .quiz-review-item {
        cursor: pointer;
        transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    }

    .quiz-review-item:active {
        transform: scale(0.98);
        background: rgba(0, 0, 0, 0.04);
    }

    .quiz-review-item .review-dots {
        transition: opacity 0.2s ease;
    }

    .quiz-review-item.previewing .review-dots {
        opacity: 0;
    }

    .quiz-stat-value {
        font-size: 1.4em;
    }

    .quiz-stat-label {
        font-size: 0.6em;
    }

    .quiz-score-value {
        font-size: 2.5em;
    }

    .quiz-results-stats {
        gap: 16px;
        padding: 12px 0;
    }

    .quiz-results-stat-value {
        font-size: 1.1em;
    }

    .quiz-results-stat-label {
        font-size: 0.65em;
    }

    .quiz-breakdown-item {
        padding: 8px 12px;
    }

    .quiz-breakdown-label {
        font-size: 0.75em;
        flex: 1.2;
    }

    .quiz-breakdown-bar {
        flex: 1.5;
    }

    .quiz-weak-item {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .quiz-timer-container {
        margin-bottom: 12px;
    }

    .quiz-timer-ring {
        width: 70px;
        height: 70px;
    }

    .timer-seconds {
        font-size: 1.5em;
    }

    .timer-label {
        font-size: 0.55em;
    }

    .time-bonus {
        font-size: 0.9em;
    }

    .speed-streak {
        padding: 3px 8px;
    }

    .quiz-results-actions {
        flex-direction: column;
    }

    .quiz-retry-btn,
    .quiz-close-btn {
        width: 100%;
    }

    /* Hint Bar - Mobile */
    .quiz-hint-bar {
        padding: 4px;
        gap: 4px;
        border-radius: 10px;
    }

    .quiz-hint-btn {
        padding: 8px 12px;
        gap: 4px;
        border-radius: 6px;
    }

    .quiz-hint-btn .hint-label {
        font-size: 0.8em;
    }

    .quiz-hint-text {
        padding: 10px 14px;
        font-size: 0.95em;
    }

    .quiz-kanji-text,
    .quiz-kana-text {
        font-size: 1.1em;
    }

    /* Submit Button in Nav Row - Mobile */
    .quiz-navigation {
        gap: 10px;
    }

    .quiz-submit-btn {
        padding: 10px 16px;
        font-size: 0.95em;
        max-width: 160px;
    }

    /* Feedback Cards - Mobile: Tighter spacing */
    .feedback-comparison {
        gap: 10px;
    }

    .feedback-card {
        padding: 14px 16px;
        border-radius: 12px;
    }

    .feedback-card-content {
        gap: 8px;
    }

    .feedback-word-jp {
        font-size: 1.4em;
    }

    .feedback-card-badge {
        top: 10px;
        right: 10px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .feedback-card-label {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .feedback-why {
        padding: 14px 16px;
        gap: 12px;
        margin-top: 14px;
    }

    .feedback-why-icon {
        font-size: 18px;
    }

    .feedback-why-text {
        font-size: 13.5px;
    }

    .feedback-title {
        font-size: 24px;
    }

    .feedback-icon {
        width: 46px;
        height: 46px;
        font-size: 22px;
    }

    /* Feedback Footer - Mobile: Stack vertically */
    .feedback-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .feedback-mascot-inline {
        justify-content: center;
        text-align: center;
    }

    .feedback-continue-btn {
        width: 100%;
        padding: 14px 24px;
    }

    /* Collapsible Answers - Mobile */
    .answers-collapsible-header {
        padding: 10px 14px;
    }

    .collapsible-title {
        font-size: 12px;
    }

    .answers-collapsible .expand-hint {
        font-size: 0.65rem;
    }

    .answers-collapsible-content {
        padding: 0 10px 10px;
        gap: 6px;
    }

    .answers-collapsible.collapsed .answers-collapsible-content {
        padding: 0 10px;
    }
}

/* Extra small screens - icons only */
@media (max-width: 400px) {
    .quiz-hint-btn .hint-label {
        display: none;
    }

    .quiz-hint-btn {
        padding: 10px 14px;
    }

    .quiz-hint-btn .hint-icon {
        font-size: 1.1em;
    }
}

/* ===== MOBILE UX IMPROVEMENTS ===== */

/* Safe area insets for notched phones (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    .quiz-modal {
        padding-bottom: env(safe-area-inset-bottom);
    }

    @media (max-width: 768px) {
        .quiz-modal {
            /* Extra padding for notched devices */
            padding-bottom: max(16px, env(safe-area-inset-bottom));
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
        }

        /* Navigation row needs extra bottom padding on notched phones */
        .quiz-navigation {
            padding-bottom: max(8px, env(safe-area-inset-bottom));
        }
    }
}

/* Minimum 44px touch targets for mobile (Apple HIG / WCAG) */
@media (max-width: 768px) {
    /* Hint buttons - ensure 44px minimum */
    .quiz-hint-btn {
        min-height: 44px;
        padding: 10px 14px;
    }

    /* Length/count buttons - ensure 44px minimum */
    .quiz-length-btn {
        min-height: 44px;
        padding: 12px 8px;
    }

    /* Navigation arrows - ensure 44px minimum */
    .quiz-nav-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Progress dots - larger tap area with pseudo-element */
    .quiz-nav-dot {
        position: relative;
        /* Visual size stays small, but tap area is larger */
    }

    .quiz-nav-dot::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 32px;
        height: 32px;
        border-radius: 50%;
    }

    /* Mode buttons - ensure minimum touch target */
    .quiz-mode-btn {
        min-height: 60px;
    }

    /* Submit button - ensure minimum touch target */
    .quiz-submit-btn {
        min-height: 44px;
    }
}

/* Focus-visible indicators for accessibility */
.quiz-answer-btn:focus-visible,
.quiz-hint-btn:focus-visible,
.quiz-nav-btn:focus-visible,
.quiz-nav-dot:focus-visible,
.quiz-length-btn:focus-visible,
.quiz-mode-btn:focus-visible,
.quiz-submit-btn:focus-visible,
.quiz-retry-btn:focus-visible,
.quiz-close-btn:focus-visible,
.quiz-start-btn:focus-visible,
.quiz-resume-btn:focus-visible {
    outline: 2px solid var(--quiz-primary);
    outline-offset: 2px;
}

/* Ensure proper focus ring visibility on dark backgrounds */
.quiz-answer-card:focus-visible {
    outline: 2px solid var(--quiz-primary);
    outline-offset: 2px;
}

/* Remove default focus outlines (we're using focus-visible) */
.quiz-answer-btn:focus:not(:focus-visible),
.quiz-hint-btn:focus:not(:focus-visible),
.quiz-nav-btn:focus:not(:focus-visible),
.quiz-nav-dot:focus:not(:focus-visible),
.quiz-length-btn:focus:not(:focus-visible),
.quiz-mode-btn:focus:not(:focus-visible),
.quiz-submit-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Visual swipe feedback animation */
.quiz-question-screen.swipe-left {
    animation: swipeLeftFeedback 0.2s ease-out;
}

.quiz-question-screen.swipe-right {
    animation: swipeRightFeedback 0.2s ease-out;
}

@keyframes swipeLeftFeedback {
    0% { transform: translateX(0); }
    50% { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}

@keyframes swipeRightFeedback {
    0% { transform: translateX(0); }
    50% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .quiz-question-screen.swipe-left,
    .quiz-question-screen.swipe-right {
        animation: none;
    }

    /* Disable slide transitions */
    .quiz-question-screen,
    .quiz-question-screen.slide-exit-left,
    .quiz-question-screen.slide-enter-right,
    .quiz-question-screen.slide-enter-active {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   DARK MODE SUPPORT (DISABLED)
   Force light theme for consistency across devices
   ============================================ */
@media (prefers-color-scheme: dark) and (min-width: 999999px) {
    .quiz-modal {
        background: rgba(30, 30, 35, 0.98);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .quiz-modal-header {
        background: linear-gradient(135deg, #1e1e2e 0%, #2d2d3d 100%);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .quiz-modal-title {
        color: #c4b5fd;
    }

    .quiz-status {
        color: #a78bfa;
    }

    .quiz-modal-close {
        background: rgba(139, 92, 246, 0.15);
        color: #a78bfa;
    }

    .quiz-modal-close:hover {
        background: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }

    .quiz-progress-section {
        background: #1e1e2e;
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .quiz-progress-label {
        color: #71717a;
    }

    .quiz-progress-dot {
        background: linear-gradient(180deg, #2d2d3d 0%, #252530 100%);
        border-color: #4a4a5a;
        color: #a1a1aa;
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .quiz-progress-dot:hover {
        background: linear-gradient(180deg, #3d3d4d 0%, #353540 100%);
        border-color: #6366f1;
        color: #a5b4fc;
        box-shadow:
            0 2px 4px rgba(99, 102, 241, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .quiz-start-screen,
    .quiz-question-screen,
    .quiz-results-screen {
        background: transparent;
    }

    .quiz-start-title,
    .quiz-results-title {
        background: linear-gradient(135deg, #e5e5e5 0%, #a78bfa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .quiz-pool-badge {
        background: rgba(100, 116, 139, 0.2);
        color: #94a3b8;
    }

    .quiz-config-card {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .quiz-config-label {
        color: #71717a;
    }

    .quiz-length-buttons {
        background: rgba(0, 0, 0, 0.3);
    }

    .quiz-length-btn {
        background: transparent;
        color: #a1a1aa;
    }

    .quiz-length-btn.active {
        background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
        color: white;
    }

    .quiz-question-text {
        color: #e5e5e5;
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .quiz-answer-btn {
        background: #2d2d3d;
        border-color: #4a4a5a;
    }

    .quiz-answer-btn .answer-jp {
        color: #e5e5e5;
    }

    .quiz-answer-btn .answer-en {
        color: #94a3b8;
    }

    .quiz-answer-btn:hover:not(:disabled) {
        border-color: #818cf8;
        background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, #2d2d3d 20%);
    }

    .quiz-answer-num {
        background: rgba(99, 102, 241, 0.15);
        color: #a5b4fc;
    }

    .quiz-hint-btn {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #a1a1aa;
    }

    .quiz-hint-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #e5e5e5;
    }

    .quiz-hint-text {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .quiz-romanized-text {
        color: #a5b4fc;
        background: rgba(99, 102, 241, 0.1);
        border-color: rgba(99, 102, 241, 0.2);
    }

    .quiz-feedback {
        background: linear-gradient(180deg, #2d2d3d 0%, #252530 100%);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow:
            0 2px 4px rgba(0, 0, 0, 0.2),
            0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .quiz-feedback.correct {
        background: linear-gradient(180deg, #1a2e24 0%, #1e2e26 100%);
        border-color: rgba(16, 185, 129, 0.25);
    }

    .quiz-feedback.correct::before {
        background: linear-gradient(90deg, #059669 0%, #10b981 50%, #34d399 100%);
    }

    .quiz-feedback.incorrect {
        background: linear-gradient(180deg, #2d2518 0%, #2e2820 100%);
        border-color: rgba(245, 158, 11, 0.25);
    }

    .quiz-feedback.incorrect::before {
        background: linear-gradient(90deg, #b45309 0%, #d97706 50%, #f59e0b 100%);
    }

    .feedback-header {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .feedback-icon.correct {
        background: linear-gradient(145deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
        color: #6ee7b7;
    }

    .feedback-icon.wrong {
        background: linear-gradient(145deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
        color: #fcd34d;
    }

    .feedback-title.correct {
        background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .feedback-title.wrong {
        background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .feedback-body {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.06);
    }

    .quiz-feedback.correct .feedback-body {
        background: rgba(16, 185, 129, 0.08);
        border-color: rgba(16, 185, 129, 0.12);
    }

    .quiz-feedback.incorrect .feedback-body {
        background: rgba(245, 158, 11, 0.08);
        border-color: rgba(245, 158, 11, 0.12);
    }

    .feedback-answer {
        color: #e5e5e5;
    }

    .feedback-answer-row {
        background: rgba(255, 255, 255, 0.04);
    }

    /* Dark mode card-based comparison */
    .feedback-card-wrong {
        background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
        border-color: rgba(217, 119, 6, 0.25);
    }

    .feedback-card-correct {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.06) 100%);
        border-color: rgba(16, 185, 129, 0.25);
    }

    .feedback-card-wrong .feedback-card-label {
        color: #fcd34d;
    }

    .feedback-card-correct .feedback-card-label {
        color: #6ee7b7;
    }

    .feedback-card-wrong .feedback-word-jp.wrong-text {
        color: #fcd34d;
    }

    .feedback-card-wrong .feedback-word-roman,
    .feedback-card-wrong .feedback-word-en {
        color: #fbbf24;
        opacity: 0.8;
    }

    .feedback-card-correct .feedback-word-roman,
    .feedback-card-correct .feedback-word-en {
        color: #6ee7b7;
        opacity: 0.8;
    }

    .feedback-card-badge.wrong {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        color: #451a03;
    }

    .feedback-card-badge.correct {
        background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
        color: #022c22;
    }

    .feedback-label {
        color: #71717a;
    }

    .feedback-word-jp {
        color: #e5e5e5;
    }

    .feedback-word-jp.correct-text {
        color: #6ee7b7;
    }

    .feedback-word-jp.wrong-text {
        color: #71717a;
    }

    .feedback-word-roman {
        color: #71717a;
    }

    .feedback-word-en {
        color: #a5b4fc;
    }

    .feedback-why {
        background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(234, 179, 8, 0.08) 100%);
        border-color: rgba(234, 179, 8, 0.25);
    }

    .feedback-why-text {
        color: #fef3c7;
    }

    .feedback-why-text strong {
        color: #fcd34d;
    }

    .feedback-footer {
        border-top-color: rgba(255, 255, 255, 0.06);
    }

    .feedback-mascot-inline .mascot-avatar {
        background: linear-gradient(145deg, #3d3225 0%, #4a3c2a 100%);
        border-color: rgba(234, 88, 12, 0.25);
    }

    .feedback-mascot-inline .mascot-speech-inline {
        color: #a1a1aa;
    }

    .feedback-mascot-inline .mascot-speech-inline.correct {
        color: #6ee7b7;
    }

    .feedback-status-text.correct {
        color: #6ee7b7;
    }

    .feedback-status-text.incorrect {
        color: #fca5a5;
    }

    .feedback-explanation {
        color: #d4d4d8;
    }

    .feedback-tip-wrapper {
        background: rgba(251, 191, 36, 0.1);
        border-color: rgba(251, 191, 36, 0.2);
    }

    .feedback-tip-text {
        color: #fcd34d;
    }

    .feedback-distractor-card {
        background: rgba(255, 255, 255, 0.04);
    }

    .quiz-answer-card {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .quiz-answer-card:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .answer-card-word {
        color: #e5e5e5;
    }

    .answer-card-num {
        background: rgba(255, 255, 255, 0.08);
        color: #a1a1aa;
    }

    /* Dark mode: Answer card result indicator badges */
    .quiz-answer-card.correct .answer-card-num::after {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        box-shadow: 0 1px 3px rgba(16, 185, 129, 0.5);
    }

    .quiz-answer-card.incorrect .answer-card-num::after {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        box-shadow: 0 1px 3px rgba(239, 68, 68, 0.5);
    }

    /* Dark mode: Question type badge */
    .quiz-question-type {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow:
            0 1px 2px rgba(139, 92, 246, 0.3),
            0 4px 8px rgba(139, 92, 246, 0.2),
            0 0 20px rgba(139, 92, 246, 0.15);
    }

    /* Dark mode: Status badge */
    .quiz-status-badge[data-status="new"] {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
        border-color: rgba(99, 102, 241, 0.3);
        color: #a5b4fc;
    }

    .quiz-status-badge[data-status="seen"] {
        background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.1) 100%);
        border-color: rgba(148, 163, 184, 0.2);
        color: #94a3b8;
    }

    /* Dark mode: Wrong text indicator badge */
    .feedback-word-jp.wrong-text::after {
        color: #fcd34d;
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.15) 100%);
        border-color: rgba(245, 158, 11, 0.35);
    }

    /* Dark mode: Progress section gradient */
    .quiz-progress-section {
        background: linear-gradient(180deg, #1e1e2e 0%, #1a1a28 100%);
    }

    .answers-collapsible {
        background: rgba(255, 255, 255, 0.02);
    }

    .collapsible-title {
        color: #a1a1aa;
    }

    .quiz-navigation {
        background: #1e1e2e;
        border-top-color: rgba(255, 255, 255, 0.06);
    }

    .quiz-nav-btn {
        background: #2d2d3d;
        border-color: #4a4a5a;
        color: #a1a1aa;
    }

    .quiz-nav-btn:hover:not(:disabled) {
        border-color: #6366f1;
        color: #a5b4fc;
        background: rgba(99, 102, 241, 0.1);
    }

    .quiz-results-header {
        background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    }

    .quiz-score-total {
        color: #71717a;
    }

    .quiz-results-percent {
        color: #94a3b8;
        background: rgba(99, 102, 241, 0.15);
    }

    .quiz-results-stats-minimal {
        color: #94a3b8;
    }

    .quiz-results-breakdown {
        background: rgba(99, 102, 241, 0.06);
        border-color: rgba(99, 102, 241, 0.12);
    }

    .quiz-breakdown-header {
        color: #a5b4fc;
    }

    .quiz-breakdown-item {
        background: rgba(255, 255, 255, 0.04);
    }

    .quiz-breakdown-label {
        color: #d4d4d8;
    }

    .quiz-breakdown-bar {
        background: #3d3d4d;
    }

    .quiz-breakdown-score {
        color: #a1a1aa;
    }

    .quiz-review-item {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .review-word {
        color: #e5e5e5;
    }

    .review-roma,
    .review-english {
        color: #a1a1aa;
    }

    .quiz-retry-btn {
        color: #a5b4fc;
        background: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.3);
    }

    .quiz-retry-btn:hover {
        background: rgba(99, 102, 241, 0.25);
    }

    .quiz-close-btn {
        background: #3d3d4d;
        color: #d4d4d8;
    }

    .quiz-close-btn:hover {
        background: #4a4a5a;
    }

    .quiz-confirm-dialog {
        background: #2d2d3d;
    }

    .quiz-confirm-title {
        color: #e5e5e5;
    }

    .quiz-confirm-message {
        color: #a1a1aa;
    }

    .quiz-confirm-cancel {
        background: #3d3d4d;
        color: #d4d4d8;
    }

    .quiz-theme-toggle {
        background: rgba(0, 0, 0, 0.6);
    }
}
