/* ========================================
   LEARN PERSIAN ALPHABET - MODERN UI
   A premium, mobile-first responsive design
   ======================================== */

/* CSS Variables - Design System */
:root {
    /* Safe Area Insets für Edge-to-Edge */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-dark: #5a67d8;
    --primary-light: #818cf8;

    /* Secondary Colors */
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Neutral Colors */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.1);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Success/Error */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.4);

    /* Effects */
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
    --border-glass: 1px solid rgba(255, 255, 255, 0.1);
    --blur-glass: blur(20px);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Disable text selection for native app feel */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Disable context menu on long press */
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #0f0f23 !important;


    /* Force dark background */
    background-image:
        radial-gradient(ellipse at top, rgba(102, 126, 234, 0.377) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    /* Fixed height - kein Scroll */
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    color: var(--text-primary);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Persian Text Font */
.persian-text,
.letter-large,
.example-word,
.option-form,
.persian-title {
    font-family: 'Noto Sans Arabic', 'Vazirmatn', sans-serif;
}

/* ========================================
   GLASS CARD COMPONENT
   ======================================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
}

/* ========================================
   AUTH STYLES
   ======================================== */
.auth-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--safe-area-top) + var(--spacing-md)) var(--spacing-md) calc(var(--safe-area-bottom) + var(--spacing-md)) var(--spacing-md);
}


.auth-card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.auth-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.5));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Form Inputs */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    margin-left: 4px;
}

.glass-input {
    width: 100%;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.glass-input::placeholder {
    color: var(--text-muted);
}

/* Primary Button */
/* Primary Button */
.primary-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Footer & Text Buttons */
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-lg);
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer .auth-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
    font-family: inherit;
}

.text-btn:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.text-btn.highlight {
    color: #4facfe;
    font-weight: 600;
}

.text-btn.highlight:hover {
    color: #00f2fe;
}

.auth-separator {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    opacity: 0.5;
}

/* Skip Button */
.skip-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.skip-btn .arrow {
    transition: transform var(--transition-normal);
}

.skip-btn:hover .arrow {
    transform: translateX(4px);
}

/* Google Sign-In Button */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: 20px;
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.google-signin-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.google-signin-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.google-signin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.google-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

.google-icon svg {
    width: 16px;
    height: 16px;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 15px;
}

/* Migration Modal */
.migration-modal {
    max-width: 500px;
    padding: 30px;
    text-align: center;
}

.migration-modal .tooltip-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.migration-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.migration-modal p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.migration-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.migration-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    font-family: inherit;
}

.migration-btn.skip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.migration-btn.skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.migration-btn.upload-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.migration-btn.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.migration-btn.upload-btn:active {
    transform: translateY(0);
}

/* Data Comparison Modal */
.data-comparison-modal {
    max-width: 700px;
    padding: 30px;
    text-align: center;
}

.data-comparison-modal .tooltip-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.data-comparison-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.sync-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.data-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .data-comparison {
        grid-template-columns: 1fr;
    }
}

.data-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
}

.data-option.recommended {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.1);
}

.data-option:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.option-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.option-header h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.badge {
    background: var(--primary-gradient);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.option-btn {
    width: 100%;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    font-family: inherit;
}

.option-btn.local-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.option-btn.local-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.option-btn.cloud-btn {
    background: rgba(52, 168, 83, 0.2);
    border: 1px solid rgba(52, 168, 83, 0.4);
    color: #34a853;
}

.option-btn.cloud-btn:hover {
    background: rgba(52, 168, 83, 0.3);
    transform: translateY(-1px);
}

.merge-btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    font-family: inherit;
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.merge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.merge-btn:active {
    transform: translateY(0);
}

/* ========================================
   MAIN APP CONTAINER
   ======================================== */
#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
}



.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow: visible;
}

/* ========================================
   MAIN MENU
   ======================================== */
.menu-header {
    text-align: center;
    padding: clamp(4px, 1vh, 20px) var(--spacing-sm);
    margin-bottom: clamp(4px, 0.8vh, 16px);
    flex-shrink: 1;
}

.app-logo {
    width: clamp(60px, 12vh, 120px);
    height: clamp(60px, 12vh, 120px);
    object-fit: contain;
    margin-bottom: var(--spacing-md);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.persian-title {
    font-size: clamp(1.5rem, 4vh, 2.5rem);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.menu-subtitle {
    font-size: clamp(0.8rem, 2vh, 1rem);
    color: var(--text-secondary);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vh, 8px);
    flex: 1;
    justify-content: center;
    overflow: visible;
    min-height: 0;
    padding-bottom: clamp(8px, 1vh, 12px);
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: clamp(6px, 1.2vh, 16px) var(--spacing-md);
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: left;
    flex-shrink: 1;
    min-height: 0;
}


.menu-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(8px);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-btn:active {
    transform: translateX(4px);
}

.menu-btn .btn-icon {
    font-size: clamp(1rem, 2.5vh, 1.5rem);
    width: clamp(32px, 5vh, 44px);
    height: clamp(32px, 5vh, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}

.menu-btn .btn-content {
    flex: 1;
}

.menu-btn .btn-title {
    font-size: clamp(0.85rem, 2vh, 1rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.menu-btn .btn-desc {
    font-size: clamp(0.65rem, 1.5vh, 0.75rem);
    color: var(--text-muted);
}

.menu-btn .btn-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.menu-btn:hover .btn-arrow {
    transform: translateX(4px);
    color: var(--text-primary);
}

/* Menu Buttons Row - Side by Side Layout */
.menu-buttons-row {
    display: flex;
    gap: var(--spacing-sm);
    width: 100%;
}

.menu-buttons-row .menu-btn {
    flex: 1;
    min-width: 0;
}

.menu-buttons-row .menu-btn .btn-arrow {
    display: none;
}

.menu-buttons-row .menu-btn .btn-desc {
    display: none;
}

.menu-buttons-row .menu-btn .btn-content {
    text-align: center;
}

.menu-buttons-row .menu-btn .btn-icon {
    width: clamp(28px, 4vh, 36px);
    height: clamp(28px, 4vh, 36px);
    font-size: clamp(0.9rem, 2vh, 1.2rem);
}





/* Quiz Button Accent */
.menu-btn.quiz-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

.menu-btn.quiz-btn .btn-icon {
    background: var(--primary-gradient);
}

.menu-btn.quiz-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    box-shadow: var(--shadow-glow);
}

/* ==================== FEEDBACK BUTTON ACCENT ==================== */
.menu-btn.feedback-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.25) 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

.menu-btn.feedback-btn .btn-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.menu-btn.feedback-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(5, 150, 105, 0.35) 100%);
    transform: translateX(8px);
}

/* ==================== FEEDBACK MODAL ==================== */
.feedback-modal {
    max-width: 420px !important;
    max-height: 90vh;
    overflow-y: auto;
}

.feedback-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
}

.feedback-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.feedback-textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.feedback-info-toggle {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.feedback-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.feedback-buttons .tooltip-btn {
    flex: 1;
}

/* Menu Footer */
.menu-footer {
    text-align: center;
    padding: var(--spacing-sm) 0;
    padding-bottom: var(--spacing-sm);
    flex-shrink: 0;
    margin-top: auto;
}

.menu-footer .company-name {
    font-size: clamp(0.7rem, 1.5vh, 0.85rem);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.menu-footer .version-info {
    font-size: clamp(0.6rem, 1.2vh, 0.75rem);
    color: var(--text-muted);
    opacity: 0.7;
}

/* ========================================
   MENU WRAPPER - Main Menu Content Container
   ======================================== */
.menu-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
}

/* ========================================
   LEARNING AREA CARDS
   ======================================== */
.learning-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: clamp(14px, 2vh, 20px);
    margin-bottom: clamp(10px, 1.5vh, 16px);
}

.learning-card-header {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vh, 16px);
    margin-bottom: clamp(12px, 1.5vh, 16px);
}

.learning-card-icon {
    width: clamp(44px, 6vh, 56px);
    height: clamp(44px, 6vh, 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(22px, 3vh, 28px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    flex-shrink: 0;
}

.learning-card-info {
    flex: 1;
    min-width: 0;
}

.learning-card-title {
    display: block;
    font-size: clamp(16px, 2.2vh, 20px);
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.learning-card-desc {
    display: block;
    font-size: clamp(11px, 1.4vh, 13px);
    color: rgba(255, 255, 255, 0.6);
}

.learning-card-actions {
    display: flex;
    gap: clamp(6px, 1vh, 10px);
}

.learning-card-actions button {
    flex: 1;
    padding: clamp(10px, 1.3vh, 12px) clamp(6px, 1vh, 8px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: clamp(11px, 1.4vh, 13px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.learning-card-actions button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.learning-card-actions button:active {
    transform: translateY(0);
}

.learning-card-actions button.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.learning-card-actions button.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Letters card accent */
.learning-card.letters-card {
    border-color: rgba(102, 126, 234, 0.3);
}

/* Numbers card accent */
.learning-card.numbers-card .learning-card-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.learning-card.numbers-card {
    border-color: rgba(240, 147, 251, 0.3);
}

/* Words card accent */
.learning-card.words-card .learning-card-icon {
    background: linear-gradient(135deg, #10b981 0%, #4facfe 100%);
}

.learning-card.words-card {
    border-color: rgba(16, 185, 129, 0.3);
}

/* ========================================
   WORD QUIZ STYLES
   ======================================== */

.word-display-box {
    min-height: 100px;
}

.word-persian-large {
    font-size: clamp(32px, 6vh, 52px);
    line-height: 1.4;
}

.word-translit-hint {
    font-size: clamp(13px, 1.8vh, 16px);
    color: var(--text-muted);
    margin-top: 4px;
    font-family: var(--font-body);
    opacity: 0.7;
}

.word-type-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px;
    width: 100%;
}

.word-type-prompt {
    font-size: 14px;
    color: var(--text-secondary);
}

.word-type-input-wrapper {
    width: 100%;
    max-width: 320px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-glass);
    background: var(--bg-glass);
    transition: border-color var(--transition-fast);
}

.word-type-input-wrapper:focus-within {
    border-color: var(--primary-light);
}

.word-type-input-wrapper.input-correct {
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.word-type-input-wrapper.input-wrong {
    border-color: var(--error);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.word-type-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
}

.word-type-input::placeholder {
    color: var(--text-muted);
}

.word-check-btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.word-check-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.word-check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.word-letter-breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.word-letter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 16px;
    direction: rtl;
}

.word-letter-chip small {
    font-size: 11px;
    color: var(--text-muted);
    direction: ltr;
}

.word-correct-answer {
    text-align: center;
    padding: 10px;
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.word-option .option-content {
    font-size: clamp(14px, 2vh, 17px);
}

/* ========================================
   UTILITY GRID (2x2)
   ======================================== */
/* Utility Grid Wrapper - ermöglicht Schrumpfen */
.utility-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.utility-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.2vh, 12px);
    margin-top: clamp(6px, 1vh, 10px);
    flex: 0 1 auto;
    min-height: 0;
}

.utility-grid .menu-btn {
    padding: clamp(10px, 1.5vh, 16px) clamp(12px, 2vw, 16px);
    flex-direction: row;
    text-align: left;
    gap: clamp(8px, 1.2vh, 12px);
    min-height: 0;
    height: auto;
    align-items: center;
}

.utility-grid .menu-btn .btn-icon {
    width: clamp(32px, 4.5vh, 42px);
    height: clamp(32px, 4.5vh, 42px);
    font-size: clamp(0.9rem, 2vh, 1.3rem);
    flex-shrink: 0;
    min-height: 0;
}

.utility-grid .menu-btn .btn-content {
    text-align: left;
    flex-shrink: 1;
    min-height: 0;
}

.utility-grid .menu-btn .btn-title {
    font-size: clamp(0.7rem, 1.5vh, 0.9rem);
}

.utility-grid .menu-btn .btn-arrow,
.utility-grid .menu-btn .btn-desc {
    display: none;
}

.utility-grid .menu-btn:hover {
    transform: translateY(-3px);
}

/* ========================================
   QUIZ VIEW
   ======================================== */

/* Minimalistischer Topbar */
.quiz-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    margin-bottom: var(--spacing-sm);
    flex: 0 0 auto;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Level Pill mit Progress Ring */
.level-pill {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-num {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    z-index: 1;
}

.level-progress {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(#fbbf24 0% var(--progress),
            rgba(255, 255, 255, 0.1) var(--progress) 100%);
    mask: radial-gradient(transparent 55%, black 56%);
    -webkit-mask: radial-gradient(transparent 55%, black 56%);
}

/* Daily Challenge Pill mit Streak */
.daily-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.daily-progress {
    color: rgba(255, 255, 255, 0.6);
}

.daily-streak {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.daily-pill.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.daily-pill.completed .daily-progress {
    color: #10b981;
}

.daily-pill.completed .daily-streak {
    border-color: rgba(16, 185, 129, 0.3);
}

/* Icon Buttons */
.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Sterne dezent */
.stars-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.stars-row .star {
    font-size: 24px;
    transition: all 0.2s ease;
}

.stars-row .star.filled {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.stars-row .star.empty {
    color: rgba(255, 255, 255, 0.15);
}

/* Stats Row für Combined Numbers */
.stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.stats-accuracy {
    color: var(--accent-green);
    font-weight: 600;
}

.stats-count {
    color: var(--text-secondary);
}

/* Legacy styles für Kompatibilität */
.quiz-header {
    display: none;
}

.daily-challenge {
    display: none;
}

.stars-display {
    display: none;
}

.challenge-progress {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.challenge-reward {
    font-size: 1rem;
    font-weight: 600;
    color: #f5576c;
}

/* Stars Display */
.stars-display {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.star {
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.star.filled {
    color: #fbbf24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.star {
    position: relative;
}

.star.star-appear {
    animation: starFallBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Haupt-Animation: Von oben fallen mit Bounce */
@keyframes starFallBounce {
    0% {
        transform: translateY(-80px) scale(0.3) rotate(-180deg);
        opacity: 0;
        filter: drop-shadow(0 0 0px rgba(251, 191, 36, 0));
    }

    30% {
        opacity: 1;
        transform: translateY(10px) scale(1.2) rotate(20deg);
    }

    50% {
        transform: translateY(-8px) scale(0.9) rotate(-10deg);
    }

    70% {
        transform: translateY(4px) scale(1.1) rotate(5deg);
    }

    85% {
        transform: translateY(-2px) scale(0.95) rotate(-2deg);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.8));
    }
}

/* Glitzer-Effekt nach dem Landen */
.star.star-appear::before,
.star.star-appear::after {
    content: '✦';
    position: absolute;
    font-size: 0.5em;
    color: #fef08a;
    animation: sparkle 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

.star.star-appear::before {
    top: -8px;
    left: -8px;
    animation-delay: 0.5s;
}

.star.star-appear::after {
    bottom: -8px;
    right: -8px;
    animation-delay: 0.6s;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(360deg) translateY(-10px);
        opacity: 0;
    }
}

/* Extra Glanz-Puls nach dem Landen */
.star.star-appear.filled {
    animation: starFallBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        starGlow 1.5s ease-in-out 0.8s infinite;
}

@keyframes starGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.9)) drop-shadow(0 0 24px rgba(251, 191, 36, 0.4));
    }
}

/* Letter Display Box */
/* Quiz Main Area - 60/40 Split Container */
.quiz-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
}

/* Letter Display Box - 50% */
.letter-display-box {
    flex: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    margin: 0 0px var(--spacing-sm) 0px;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    position: relative;
    overflow: visible;
    min-height: 0;
}

/* ← FIX: Aussprache-Button Styling */
.pronunciation-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%) brightness(5);
}

.pronunciation-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.pronunciation-btn:active {
    transform: scale(0.95);
}

.pronunciation-btn:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 3px;
}

.letter-display-box::before {
    content: '';
    position: absolute;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.2) 30%, transparent 70%);
    animation: glowRotation 10s linear infinite;
    animation-delay: calc(-1s * var(--anim-offset, 0));
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
}

.letter-display-box::after {
    content: '';
    position: absolute;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 60%);
    animation: glowRotation 7s linear reverse infinite;
    animation-delay: calc(-1s * var(--anim-offset, 0));
    filter: blur(30px);
    pointer-events: none;
    z-index: -1;
}

@keyframes glowRotation {
    0% {
        transform: translate(-10%, -10%) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(5%, -5%) rotate(120deg) scale(1.2);
    }

    66% {
        transform: translate(-5%, 10%) rotate(240deg) scale(0.9);
    }

    100% {
        transform: translate(-10%, -10%) rotate(360deg) scale(1);
    }
}

/* Removed old pulse animation */

.letter-large {
    font-size: clamp(4rem, 20vw, 8rem);
    font-weight: 400;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
}

/* Quiz Content */
/* Quiz Content - 50% */
#quiz-main-content {
    flex: 5;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
    position: relative;
    z-index: 10;
}

/* Quiz Options Grid */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--spacing-sm);
    flex: 1;
    min-height: 0;
    height: 100%;
}

.option-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-sm);
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    cursor: pointer;
    min-height: 0;
    transition: all var(--transition-normal);
    /* min-height: 120px; */
}

.option-button:hover {
    background: rgba(255, 255, 255, 0.12);
    /* transform: translateY(-4px); ← ENTFERNEN */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.option-button:active {
    /* transform: translateY(-2px); ← ENTFERNEN */
}

.option-button:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Answer Feedback - transform explizit auf none setzen */
.option-button.flash-green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: var(--success);
    box-shadow: 0 0 30px var(--success-glow);
    animation: successPulse 0.5s ease-out;
    transform: none !important;
}

.option-form,
.option-name {
    color: var(--text-primary);
}

.option-form {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.option-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.option-form-type {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Bidirectional Quiz - Latin name as question display */
.latin-name-display {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text-primary);
}

/* Bidirectional Quiz - Persian letters as options */
.option-button.persian-option .option-form {
    font-size: 2.2rem;
    font-weight: 600;
}

/* Question type label */
.question-type-label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
}

/* Answer Feedback */
.flash-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: var(--error);
    box-shadow: 0 0 30px var(--error-glow);
    animation: errorShake 0.5s ease-out;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* Quiz Feedback Grid - Same height as options grid */
.quiz-feedback-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    flex: 1;
    min-height: 0;
}

/* Example Word Box */
.example-word-box {
    flex: 1;
    /* ← Nimmt verfügbaren Platz INNERHALB der 40% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    min-height: 0;
    /* ← Wichtig für Flex-Shrinking */
}

.example-label {
    font-size: 0.625rem;
    /* Two sizes smaller (was 0.875rem) */
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--spacing-sm);
    text-align: left;
    width: 100%;
}

.example-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.example-word {
    font-size: 2rem;
    /* ← Von 2.5rem auf 2rem */
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.example-word .highlight {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.example-transliteration-main {
    font-size: 1.125rem;
    /* ← Von 1.5rem auf 1.125rem */
    color: var(--text-secondary);
    font-style: italic;
}

.example-meaning {
    font-size: 0.875rem;
    /* ← Von 1.125rem auf 0.875rem */
    color: var(--text-muted);
}

/* Next Button */
.next-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* ← Verhindert Schrumpfen */
    height: 56px;
    /* ← Fixe Höhe */
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.next-btn:active {
    transform: translateY(0);
}

/* ========================================
   LETTERS VIEW
   ======================================== */
/* ========================================
   ALPHABET VIEW
   ======================================== */
.alphabet-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
}

.alphabet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
}

.back-btn-alphabet {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn-alphabet:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.alphabet-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
}

.header-spacer {
    width: 80px;
    /* Balance the back button */
}

.alphabet-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-bottom: 40px;
}

.alphabet-row {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-normal);
}

.alphabet-row:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
}

.alphabet-row.locked {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.row-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 24px;
}

.forms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    flex: 1;
}

.form-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.form-symbol {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-tag {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.letter-details {
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.detail-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-pronunciation {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.locked-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.lock-icon {
    font-size: 1rem;
}

.lock-text {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Progress Bar in List */
.progress-bar-container {
    width: 100%;
    margin-top: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.progress-text {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: right;
    font-weight: 600;
}

/* ========================================
   SETTINGS VIEW
   ======================================== */
.settings-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    padding-bottom: calc(var(--safe-area-bottom) + var(--spacing-xl) + 40px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}


.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    background: transparent !important;
}

.back-btn-settings {
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn-settings:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.settings-container h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.settings-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 4px;
}

.settings-icon {
    font-size: 1.25rem;
}

.settings-item {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.label-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.label-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.settings-dropdown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    outline: none;
}

.settings-dropdown option {
    background: #1a1a2e;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-slider {
    background: var(--primary-gradient);
}

input:focus+.toggle-slider {
    box-shadow: 0 0 1px var(--primary-dark);
}

input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* Volume Slider */
.volume-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    max-width: 200px;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.volume-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 35px;
}

/* Danger Zone */
.settings-danger {
    margin-top: var(--spacing-md);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
}

.danger-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: #fca5a5;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.danger-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.danger-btn {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-fast);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #fca5a5;
    transform: translateY(-2px);
}

.danger-btn-secondary {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

.danger-btn-secondary:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fcd34d;
}

.danger-item {
    margin-bottom: var(--spacing-md);
}

.danger-item:last-child {
    margin-bottom: 0;
}

.danger-item .danger-desc {
    margin-bottom: var(--spacing-sm);
}

.settings-footer {
    margin-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.settings-footer span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    background: var(--bg-glass);
    border: var(--border-glass);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-2px);
}

/* End of Settings */

/* ========================================
   MOBILE RESPONSIVE (max-width: 600px)
   ======================================== */
@media screen and (max-width: 1080px) {
    :root {
        --spacing-md: 12px;
        --spacing-lg: 20px;
    }

    body {
        align-items: flex-start;
    }

    #app {
        width: 100% !important;
        max-width: none !important;
        height: 100dvh !important;
        min-height: 100dvh;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden;
        padding: var(--safe-area-top) var(--spacing-md) var(--safe-area-bottom) var(--spacing-md);
        padding-top: 0;
        box-sizing: border-box;
    }



    .app-container {
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding: var(--spacing-md);
        padding-top: var(--safe-area-top);
        padding-bottom: var(--spacing-md);
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: visible;
        /* Quiz und Hauptmenu sollen NICHT scrollen */
    }

    .menu-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
        padding-bottom: min(0px, 0px);
        /*var(--safe-area-bottom)*/
        min-height: 0;
        box-sizing: border-box;
        overflow: visible;
    }

    .auth-container,
    .alphabet-container {
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding: var(--spacing-md);
        padding-top: var(--safe-area-top);
        height: 100dvh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .settings-container {
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding: var(--spacing-md);
        padding-bottom: calc(var(--safe-area-bottom) + var(--spacing-xl) + 40px);
        padding-top: var(--safe-area-top);
        height: 100dvh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }


    .alphabet-list {
        padding-bottom: 20px;
    }

    .alphabet-row {
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .form-symbol {
        font-size: 1.25rem;
    }

    .letter-details {
        width: 100px;
    }

    /* Quiz Layout - Fixed Header, Flexible Letter, Fixed Options */
    .quiz-header {
        flex: 0 0 auto;
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .daily-challenge {
        flex: 0 0 auto;
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .stars-display {
        flex: 0 0 auto;
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-xs);
    }

    .star {
        font-size: 1.75rem;
    }

    .quiz-main-area {
        flex: 1;
        min-height: 0;
    }

    .letter-display-box {
        flex: 6 !important;
        /*margin-bottom: var(--spacing-sm);*/
    }

    .letter-large {
        font-size: clamp(3.5rem, 25vw, 7rem);
    }

    #quiz-main-content {
        flex: 4 !important;
    }

    .quiz-options {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 1fr);
        gap: var(--spacing-md);
        /* ← Gleicher Gap wie Desktop */
        flex: 1;
        min-height: 0;
        height: 100%;
    }

    .quiz-feedback-grid {
        flex: 1;
        gap: var(--spacing-md);
        /* ← Gleicher Gap wie Desktop */
        min-height: 0;
    }

    .option-button {
        padding: var(--spacing-md);
        /*min-height: 105px;*/
    }

    .option-form {
        font-size: 1.75rem;
    }

    .option-name {
        font-size: 1.25rem;
    }

    .option-form-type {
        font-size: 0.75rem;
    }

    /* Feedback View */
    .example-word-box {
        padding: var(--spacing-xs) var(--spacing-sm);
        /* ← Noch weniger Padding mobile */
    }

    .example-word {
        font-size: 1.5rem;
        /* ← Kleiner auf Mobile */
    }

    .example-transliteration-main {
        font-size: 1rem;
    }

    .next-btn {
        padding: var(--spacing-md);
        font-size: 1rem;
    }

    /* Letters Grid */
    .letters-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-xs);
    }

    .letter-card .letter {
        font-size: 1.5rem;
    }

    .letter-card .name {
        font-size: 0.5rem;
    }

    /* Auth */
    .auth-container {
        align-items: center;
        padding: var(--spacing-md);
    }

    .auth-card {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

/* Extra small screens */
@media screen and (max-width: 380px) {
    .persian-title {
        font-size: 2rem;
    }

    .letter-large {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }

    .letters-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .pronunciation-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        bottom: 0.75rem;
        right: 0.75rem;
    }
}

/* ========================================
   LATIN LETTER DISPLAY (Smaller font size)
   ======================================== */
.letter-large.latin-name-display {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: 700;
}

@media (min-width: 960px) {
    .letter-large.latin-name-display {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }
}

@media screen and (max-width: 380px) {
    .letter-large.latin-name-display {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes popOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

.pop-out {
    animation: popOut 0.3s ease-in forwards !important;
}

@keyframes flipIn {
    0% {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }

    50% {
        transform: perspective(400px) rotateY(-10deg);
    }

    100% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes flipOut {
    0% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }

    100% {
        transform: perspective(400px) rotateY(-90deg);
        opacity: 0;
    }
}

.flip-out {
    animation: flipOut 0.3s ease-in forwards !important;
}

/* Staggered Animations for Quiz Options - Only on page entry or new question */
.page-enter .option-button {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.page-enter .option-button:nth-child(1) {
    animation-delay: 0.1s;
}

.page-enter .option-button:nth-child(2) {
    animation-delay: 0.15s;
}

.page-enter .option-button:nth-child(3) {
    animation-delay: 0.2s;
}

.page-enter .option-button:nth-child(4) {
    animation-delay: 0.25s;
}

/* Feedback Animations - Smoother fadeIn without pop-in during answer select */
.quiz-feedback-grid {
    animation: fadeIn 0.4s ease-out;
}

/* We remove the popIn from example-word-box and next-btn to prevent "flipping" when feedback appears */
.example-word-box,
.next-btn {
    animation: none;
}

/* Letter Animation */
.letter-large {
    transform-origin: center center;
    backface-visibility: visible;
}

.letter-enter {
    animation: flipIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.4s ease-out;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-auto {
    margin-top: auto;
}

.mb-auto {
    margin-bottom: auto;
}

.flex-1 {
    flex: 1;
}

.flex-none {
    flex: none;
}

.hidden {
    display: none !important;
}

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}



/* Transition Animations */
.content-fade-out {
    animation: fadeOutDown 0.4s ease-in forwards;
    pointer-events: none;
}

@keyframes fadeOutDown {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.logo-transition-exit {
    animation: logoExit 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes logoExit {
    to {
        transform: scale(1.5) translateY(-60px);
        opacity: 0;
    }
}

.logo-transition-enter {
    animation: logoEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes logoEnter {
    from {
        opacity: 0;
        transform: scale(0.66) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Page Transitions */
.exit-slide-up {
    animation: slideOutUp 0.3s ease-in forwards !important;
}

.exit-slide-down {
    animation: slideOutDown 0.3s ease-in forwards !important;
}

@keyframes slideOutUp {
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes slideOutDown {
    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Page Entry Animations */
.page-enter {
    animation: pageSlideIn 0.4s ease-out backwards;
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Return Animations */
.menu-enter-header {
    animation: slideInDown 0.4s ease-out backwards;
}

.menu-enter-buttons {
    animation: slideInUp 0.4s ease-out backwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Exit Animation */
.page-exit {
    animation: pageSlideOut 0.3s ease-in forwards !important;
}

@keyframes pageSlideOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ========================================
   QUIZ WRAPPER - KORRIGIERT
   ======================================== */
.quiz-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + var(--safe-area-bottom));
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
}


@media screen and (max-width: 600px) {
    .quiz-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: var(--spacing-md);
        padding-top: var(--safe-area-top);
        padding-bottom: calc(var(--spacing-md) + var(--safe-area-bottom));
        height: 100%;
        min-height: 0;
        box-sizing: border-box;
        overflow: visible;
    }
}



/* ========================================
   UNLOCK POPUP
   ======================================== */
.unlock-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease-out;
}

.unlock-popup {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unlock-celebration {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: bounce 1s ease-in-out infinite;
}

.unlock-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-lg);
}

.unlock-letter-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.unlock-letter {
    font-size: 5rem;
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
    margin-bottom: var(--spacing-sm);
}

.unlock-letter-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.unlock-letter-pronunciation {
    font-size: 1rem;
    color: var(--text-secondary);
}

.unlock-forms {
    margin-bottom: var(--spacing-lg);
}

.unlock-forms h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
}

.unlock-forms .forms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.form-showcase {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-showcase .form-value {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-showcase .form-name {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.unlock-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* ========================================
   STAR ANIMATIONS - ERWEITERT
   ======================================== */
.star.star-disappear {
    animation: starDisappear 0.5s ease-out;
}

@keyframes starDisappear {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* ========================================
   BUTTON DISABLED STATE
   ======================================== */
.option-button:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.option-button:disabled:not(.flash-green):not(.flash-red) {
    opacity: 0.6;
}

/* ========================================
   QUIZ CONTAINER (für Unlock)
   ======================================== */
.quiz-container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.daily-popup .streak-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2) 0%, rgba(251, 146, 60, 0.05) 100%);
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.daily-popup .streak-flame {
    font-size: 4rem;
    animation: flameGlow 1s ease-in-out infinite alternate;
}

@keyframes flameGlow {
    from {
        filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.5));
        transform: scale(1);
    }

    to {
        filter: drop-shadow(0 0 25px rgba(251, 146, 60, 0.8));
        transform: scale(1.1);
    }
}

.daily-popup .streak-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.daily-popup .streak-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.daily-popup .streak-message {
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

/* ========================================
   TUTORIAL MODAL
   ======================================== */

.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 16px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.tutorial-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    animation: fadeSlideDown 0.5s ease 0.1s both;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-progress {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tutorial-dot {
    height: 6px;
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tutorial-dot.active {
    width: 32px;
    background: white;
    animation: dotExpand 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dotExpand {
    from {
        width: 6px;
    }

    to {
        width: 32px;
    }
}

.tutorial-dot.completed {
    width: 6px;
    background: rgba(255, 255, 255, 0.5);
}

.tutorial-dot.upcoming {
    width: 6px;
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}

.tutorial-close:hover {
    color: white;
    transform: rotate(90deg);
}

.tutorial-content {
    text-align: center;
}

/* Staggered animation classes */
.tutorial-anim-1 {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.tutorial-anim-2 {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.tutorial-anim-3 {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.tutorial-anim-4 {
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    animation: iconPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes iconPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.tutorial-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.tutorial-icon.purple {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.tutorial-icon.indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.tutorial-icon.green {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.tutorial-icon.pink {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.tutorial-icon.yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tutorial-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.tutorial-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Forms Example Box */
.tutorial-example-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    animation: boxReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

@keyframes boxReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tutorial-example-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 12px;
    animation: fadeSlideUp 0.4s ease 0.5s both;
}

.tutorial-forms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tutorial-form-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tutorial-form-item:nth-child(1) {
    animation: formItemPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.tutorial-form-item:nth-child(2) {
    animation: formItemPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.tutorial-form-item:nth-child(3) {
    animation: formItemPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.tutorial-form-item:nth-child(4) {
    animation: formItemPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

@keyframes formItemPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutorial-form-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.tutorial-form-char {
    font-size: 28px;
    color: white;
    margin-bottom: 2px;
}

.tutorial-form-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.tutorial-form-position {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Word Example */
.tutorial-word-display {
    font-size: 42px;
    color: white;
    margin-bottom: 6px;
    animation: wordPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes wordPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tutorial-word-meaning {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 12px;
    animation: fadeSlideUp 0.4s ease 0.6s both;
}

.tutorial-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tutorial-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.3s ease;
}

.tutorial-breakdown-item:nth-child(1) {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.tutorial-breakdown-item:nth-child(2) {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.tutorial-breakdown-item:nth-child(3) {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.tutorial-breakdown-item:nth-child(4) {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) 1.0s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-breakdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.tutorial-breakdown-char {
    font-size: 24px;
    color: white;
}

.tutorial-breakdown-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Quiz Mock */
.tutorial-quiz-mock {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    animation: boxReveal 0.4s ease 0.5s both;
}

.tutorial-quiz-letter {
    font-size: 56px;
    color: white;
    animation: letterFloat 2s ease-in-out infinite;
}

@keyframes letterFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.tutorial-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.tutorial-quiz-option {
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tutorial-quiz-option:nth-child(1) {
    animation: optionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.tutorial-quiz-option:nth-child(2) {
    animation: optionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.tutorial-quiz-option:nth-child(3) {
    animation: optionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.tutorial-quiz-option:nth-child(4) {
    animation: optionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

@keyframes optionPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.tutorial-quiz-option.correct {
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
    color: #86efac;
    animation: optionPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both,
        correctPulse 1.5s ease-in-out 1.2s infinite;
}

@keyframes correctPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

.tutorial-quiz-option.normal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.tutorial-quiz-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    animation: fadeSlideUp 0.4s ease 1s both;
}

/* Tutorial Buttons */
.tutorial-buttons {
    display: flex;
    gap: 12px;
    animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

.tutorial-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.tutorial-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.tutorial-btn:hover::after {
    opacity: 1;
}

.tutorial-btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tutorial-btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-2px);
}

.tutorial-btn-next {
    color: white;
}

.tutorial-btn-next.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.tutorial-btn-next.purple {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.tutorial-btn-next.indigo {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.tutorial-btn-next.green {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.tutorial-btn-next.pink {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.tutorial-btn-next.yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.tutorial-btn-next.orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.tutorial-btn-next.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tutorial-btn-next.cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.tutorial-btn-next:hover {
    transform: translateX(2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.tutorial-btn-next:active {
    transform: scale(0.98);
}

/* Slide transition for content change */
.tutorial-content-exit {
    animation: contentExit 0.25s ease forwards;
}

@keyframes contentExit {
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

.tutorial-content-enter {
    animation: contentEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contentEnter {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Transitions */
.tutorial-slide-out-left {
    animation: slideOutLeft 0.2s ease forwards;
}

.tutorial-slide-out-right {
    animation: slideOutRight 0.2s ease forwards;
}

.tutorial-slide-in-right {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tutorial-slide-in-left {
    animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideOutLeft {
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Staggered Animations */
.tutorial-stagger-1 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

.tutorial-stagger-2 {
    animation: tutorialFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.tutorial-stagger-3 {
    animation: tutorialFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.tutorial-stagger-4 {
    animation: tutorialFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.tutorial-stagger-5 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.tutorial-stagger-6 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.tutorial-stagger-7 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.tutorial-stagger-8 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.tutorial-stagger-9 {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.tutorial-stagger-10 {
    animation: tutorialFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes tutorialPopIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes tutorialFadeUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon bounce animation */
.tutorial-icon.tutorial-stagger-1 {
    animation: tutorialIconPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

@keyframes tutorialIconPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    60% {
        transform: scale(1.1) rotate(3deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Slide Transitions */
.tutorial-slide-out-left {
    animation: slideOutLeft 0.2s ease forwards;
}

.tutorial-slide-out-right {
    animation: slideOutRight 0.2s ease forwards;
}

@keyframes slideOutLeft {
    to {
        opacity: 0;
        transform: translateX(-40px);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* Fade out for closing */
.tutorial-fade-out {
    animation: tutorialFadeOut 0.3s ease forwards;
}

@keyframes tutorialFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Breakdown items hover effect */
.tutorial-breakdown-item {
    transition: all 0.2s ease;
}

.tutorial-breakdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Form items hover effect */
.tutorial-form-item {
    transition: all 0.2s ease;
}

.tutorial-form-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Quiz letter floating animation */
.tutorial-quiz-letter {
    animation: letterFloat 2s ease-in-out infinite;
}

@keyframes letterFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Correct option pulse */
.tutorial-quiz-option.correct {
    animation: tutorialPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both,
        correctGlow 1.5s ease-in-out 0.8s infinite;
}

@keyframes correctGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(34, 197, 94, 0.3);
    }
}

/* ========================================
   NEW LETTER MODAL
   ======================================== */

.new-letter-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.new-letter-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: newLetterModalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes newLetterModalIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Badge "Neuer Buchstabe!" */
.new-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    background: rgba(250, 204, 21, 0.2);
    color: #facc15;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
    animation: badgePopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes badgePopIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.new-letter-badge .sparkle {
    font-size: 18px;
    animation: sparkleRotate 2s ease-in-out infinite;
}

@keyframes sparkleRotate {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(15deg) scale(1.1);
    }
}

/* Main Letter Display */
.new-letter-char {
    font-size: 120px;
    color: white;
    line-height: 1;
    margin-bottom: 24px;
    animation: letterSpinIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
    text-shadow: 0 0 60px rgba(250, 204, 21, 0.3);
}

@keyframes letterSpinIn {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Letter Info */
.new-letter-info {
    animation: infoFadeUp 0.4s ease 0.5s both;
    text-align: center;
}

@keyframes infoFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-letter-name {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.new-letter-pronunciation {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.new-letter-pronunciation span {
    color: white;
    font-weight: 500;
}

/* Forms Grid */
.new-letter-forms {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 28px;
    animation: formsGridIn 0.4s ease 0.6s both;
}

@keyframes formsGridIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-letter-form-item {
    background: rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    padding: 14px 8px;
    transition: all 0.3s ease;
}

.new-letter-form-item:nth-child(1) {
    animation: formItemPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

.new-letter-form-item:nth-child(2) {
    animation: formItemPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.new-letter-form-item:nth-child(3) {
    animation: formItemPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both;
}

.new-letter-form-item:nth-child(4) {
    animation: formItemPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

@keyframes formItemPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.new-letter-form-item {
    pointer-events: none;
    cursor: default;
}


.new-letter-form-char {
    font-size: 28px;
    color: white;
    display: block;
    margin-bottom: 6px;
}

.new-letter-form-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: capitalize;
}

/* Continue Button */
.new-letter-btn {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: buttonSlideUp 0.4s ease 0.85s both;
    box-shadow: 0 10px 30px -10px rgba(250, 204, 21, 0.4);
}

@keyframes buttonSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-letter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px -10px rgba(250, 204, 21, 0.5);
}

.new-letter-btn:active {
    transform: translateY(-1px);
}

.new-letter-btn .arrow {
    font-size: 20px;
    transition: transform 0.3s;
}

.new-letter-btn:hover .arrow {
    transform: translateX(4px);
}

/* Fade Out Animation */
.new-letter-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.new-letter-overlay.fade-out .new-letter-modal {
    animation: newLetterModalOut 0.3s ease forwards;
}

@keyframes newLetterModalOut {
    to {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
}

/* ==================== STATISTICS PAGE ==================== */

/* ==================== STATISTICS PAGE ==================== */

.stats-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md);
    padding-top: var(--safe-area-top);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    background: transparent !important;
    flex-shrink: 0;
}

.back-btn-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-btn-stats:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.back-btn-stats .back-arrow {
    font-size: 16px;
}

.back-btn-stats .back-text {
    font-weight: 500;
}

.stats-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
    margin: 0;
}

.stats-header .header-spacer {
    width: 90px;
}

.stats-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: var(--spacing-xl);
    -webkit-overflow-scrolling: touch;
}

/* Stats Grid */

/* Stats Mode Tabs */
.stats-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 12px;
}

.stats-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.stats-tab.active {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

.stats-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-yellow {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.1) 100%);
    border-color: rgba(234, 179, 8, 0.3);
}

.stat-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(168, 85, 247, 0.3);
}

.stat-orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: rgba(249, 115, 22, 0.3);
}

.stat-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(8, 145, 178, 0.1) 100%);
    border-color: rgba(6, 182, 212, 0.3);
}

.stat-gradient {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

/* Number Stats Grid */
.number-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .number-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.number-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s;
}

.number-stat-item.mastered {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.number-symbol {
    font-size: 32px;
    margin-bottom: 4px;
}

.number-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.number-accuracy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.accuracy-percent {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.accuracy-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.number-stars {
    font-size: 10px;
    height: 14px;
    overflow: hidden;
}

.stat-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(8, 145, 178, 0.1) 100%);
    border-color: rgba(6, 182, 212, 0.3);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Stats Sections */
.stats-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 20px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
}

.section-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Progress Stats */
.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.progress-value {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.achievement-card {
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.achievement-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    background: rgba(255, 255, 255, 0.15);
}

.achievement-icon-wrapper.locked {
    background: rgba(51, 65, 85, 0.5);
}

.achievement-icon {
    font-size: 22px;
}

.achievement-title {
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.achievement-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* Achievement Colors */
.achievement-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.4);
}

.achievement-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(168, 85, 247, 0.4);
}

.achievement-gold {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.15) 100%);
    border-color: rgba(234, 179, 8, 0.4);
}

.achievement-rainbow {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.4);
}

.achievement-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.4);
}

.achievement-yellow {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.25) 0%, rgba(234, 179, 8, 0.15) 100%);
    border-color: rgba(250, 204, 21, 0.4);
}

.achievement-orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(234, 88, 12, 0.15) 100%);
    border-color: rgba(249, 115, 22, 0.4);
}

.achievement-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(22, 163, 74, 0.15) 100%);
    border-color: rgba(34, 197, 94, 0.4);
}

.achievement-pink {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25) 0%, rgba(219, 39, 119, 0.15) 100%);
    border-color: rgba(236, 72, 153, 0.4);
}

.achievement-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(8, 145, 178, 0.2) 100%);
    border-color: rgba(6, 182, 212, 0.5);
}

.achievement-locked {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(51, 65, 85, 0.4);
    opacity: 0.5;
}

.achievement-locked .achievement-title,
.achievement-locked .achievement-desc {
    color: rgba(255, 255, 255, 0.4);
}

.achievement-locked .achievement-icon {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* ==================== PROFILE HEADER ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vh, 16px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: clamp(10px, 2vh, 16px) clamp(14px, 2.5vh, 20px);
    margin-bottom: clamp(8px, 2vh, 24px);
    flex-shrink: 0;
}

.profile-avatar {
    position: relative;
    width: clamp(40px, 7vh, 56px);
    height: clamp(40px, 7vh, 56px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-icon {
    font-size: clamp(20px, 4vh, 28px);
}

.level-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: clamp(10px, 1.5vh, 12px);
    font-weight: 700;
    width: clamp(18px, 3vh, 24px);
    height: clamp(18px, 3vh, 24px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1a1f3a;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: clamp(14px, 2.5vh, 18px);
    font-weight: 600;
    color: white;
    margin-bottom: clamp(4px, 1vh, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: -8px;
}

.profile-name:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #a78bfa;
}

.profile-name::after {
    content: ' ✏️';
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-name:hover::after {
    opacity: 0.7;
}

.profile-name-static {
    font-size: clamp(14px, 2.5vh, 18px);
    font-weight: 600;
    color: white;
    margin-bottom: clamp(4px, 1vh, 8px);
}

.profile-xp-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xp-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.xp-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* ==================== LEVEL UP POPUP ==================== */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.level-up-modal {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 100%);
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.3);
    animation: levelUpBounce 0.5s ease;
}

@keyframes levelUpBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.level-up-sparkles {
    font-size: 40px;
    margin-bottom: 8px;
    animation: sparkle 1s ease infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.level-up-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.level-up-title {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 8px;
}

.level-up-number {
    font-size: 72px;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
}

.level-up-message {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.level-up-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.level-up-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

/* ==================== ALPHABET MASTERED POPUP ==================== */
.mastered-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.mastered-modal {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 100%);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 0 80px rgba(168, 85, 247, 0.3);
    animation: masteredAppear 0.6s ease;
}

@keyframes masteredAppear {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.05) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.mastered-fireworks {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 40px;
    margin-bottom: 16px;
    animation: fireworks 1.5s ease infinite;
}

@keyframes fireworks {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-10px);
    }

    75% {
        transform: translateY(5px);
    }
}

.mastered-fireworks span:nth-child(2) {
    animation-delay: 0.2s;
}

.mastered-fireworks span:nth-child(3) {
    animation-delay: 0.4s;
}

.mastered-icon {
    font-size: 80px;
    margin-bottom: 16px;
}

.mastered-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.mastered-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
}

.mastered-reward {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.reward-icon {
    font-size: 24px;
}

.reward-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mastered-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.mastered-stats .stat {
    text-align: center;
}

.mastered-stats .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #a855f7;
    display: block;
}

.mastered-stats .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Custom Quiz Unlock Box */
.custom-quiz-unlock-box {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.unlock-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.unlock-box-icon {
    font-size: 28px;
}

.unlock-box-title {
    font-size: 18px;
    font-weight: 700;
    color: #a855f7;
}

.unlock-box-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0;
}

.mastered-btn {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.mastered-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}

/* ==================== CUSTOM QUIZ LOCKED BUTTON ==================== */
.menu-btn.custom-quiz-btn.locked {
    opacity: 0.6;
    cursor: pointer;
    position: relative;
}

.menu-btn.custom-quiz-btn.locked .btn-icon {
    filter: grayscale(1);
}

.menu-btn.custom-quiz-btn.locked .btn-desc {
    color: rgba(255, 255, 255, 0.4);
}

/* ==================== LEADERBOARD STYLES ==================== */
/* Container & Header */
.leaderboard-container {
    width: 100%;
    max-width: 600px;
    padding: var(--spacing-lg);
    padding-top: var(--safe-area-top);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    flex-shrink: 0;
}

.back-btn-leaderboard {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.back-btn-leaderboard:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(-2px);
}

.back-arrow {
    font-size: 1.25rem;
}

.back-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.leaderboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    flex: 1;
}

.settings-icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.settings-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.header-spacer {
    width: 40px;
}

/* Content & Sections */
.leaderboard-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
}

.leaderboard-section {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.current-user-section {
    border: 2px solid rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.section-icon {
    font-size: 1.5rem;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ==================== LEADERBOARD CARDS ==================== */
.leaderboard-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.leaderboard-card.current-user-highlight {
    background: rgba(102, 126, 234, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.4);
}

/* Rank Badge */
.rank-badge-container {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.rank-badge-container .rank-number {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.rank-badge-container.rank-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.rank-badge-container.rank-silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.rank-badge-container.rank-bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
}

/* Player Info */
.player-info-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.player-name-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.player-name-row .player-name {
    font-size: 15px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.you-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* XP Bar */
.player-xp-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.player-xp-bar .xp-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.player-xp-bar .xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 3px;
}

.player-xp-bar .xp-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* Loading & Error States */
.loading-spinner {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.spinner-icon {
    font-size: 3rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.error-state {
    text-align: center;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.error-icon {
    font-size: 3rem;
}

.error-state h3 {
    color: var(--text-primary);
    margin: 0;
}

.error-state p {
    color: var(--text-secondary);
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-style: italic;
}

/* Menu Button Accent */
.menu-btn.leaderboard-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(245, 158, 11, 0.25) 100%);
    border-color: rgba(251, 191, 36, 0.4);
}

.menu-btn.leaderboard-btn .btn-icon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.menu-btn.leaderboard-btn:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.35) 100%);
    transform: translateY(-2px);
}

/* Modal Additions */
.modal-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.tooltip-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    text-align: center;
}

.settings-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

/* ==================== TOOLTIP POPUP ==================== */
.tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.tooltip-modal {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: tooltipAppear 0.3s ease;
}

@keyframes tooltipAppear {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tooltip-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.tooltip-modal h3 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.tooltip-modal p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    line-height: 1.5;
}

.tooltip-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.tooltip-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.tooltip-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tooltip-progress span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.tooltip-remaining {
    font-size: 13px;
    color: #f59e0b;
    margin-bottom: 20px;
}

.tooltip-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tooltip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Name Edit Modal */
.name-edit-modal {
    max-width: 300px;
}

.name-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-align: center;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

.name-input:focus {
    outline: none;
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.08);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.name-edit-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.name-edit-buttons .tooltip-btn {
    flex: 1;
    padding: 12px 16px;
}

.name-edit-buttons .save-btn {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    border-color: transparent;
}

.name-edit-buttons .save-btn:hover {
    background: linear-gradient(135deg, #9333ea 0%, #4f46e5 100%);
}

.name-edit-buttons .cancel-btn {
    background: transparent;
}

/* ==================== CUSTOM QUIZ SETUP ==================== */

/* Select All Button */
.select-all-btn {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.select-all-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

.custom-quiz-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.custom-quiz-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 100px;
    /* Platz für Footer */
}

@media (max-width: 480px) {
    .custom-quiz-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

.custom-letter-card {
    position: relative;
    background: var(--bg-glass);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 4px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.custom-letter-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-letter-card.selected {
    background: rgba(168, 85, 247, 0.15);
    border-color: #a855f7;
}

.custom-letter-char {
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.custom-letter-name {
    font-size: 0.6rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin-top: 4px;
}

.custom-letter-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #a855f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.custom-letter-card.selected .custom-letter-check {
    opacity: 1;
    transform: scale(1);
}

/* ==================== CUSTOM QUIZ FOOTER ==================== */
.custom-quiz-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-top: var(--border-glass);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.selected-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.start-custom-quiz-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.start-custom-quiz-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.start-custom-quiz-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== CUSTOM QUIZ PLAY MODE ==================== */
/* Removed custom background - uses default quiz-wrapper styles */

.custom-quiz-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.expertise-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.expertise-badge.expertise-learning {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.expertise-badge.expertise-bronze {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
}

.expertise-badge.expertise-silver {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
}

.expertise-badge.expertise-gold {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.expertise-badge.expertise-diamond {
    background: rgba(185, 242, 255, 0.2);
    color: #b9f2ff;
}

.stars-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.streak-display {
    font-size: 18px;
    font-weight: 700;
    color: #f59e0b;
}

/* ==================== EXPERTISE COLORS (für Alphabet View) ==================== */
.expertise-learning {
    color: rgba(255, 255, 255, 0.6);
}

.expertise-bronze {
    color: #cd7f32;
}

.expertise-silver {
    color: #c0c0c0;
}

.expertise-gold {
    color: #ffd700;
}

.expertise-diamond {
    color: #b9f2ff;
    text-shadow: 0 0 10px rgba(185, 242, 255, 0.5);
}

/* ==================== FADE OUT ANIMATION ==================== */
.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ==================== QUIZ XP HEADER ==================== */
.quiz-level-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.quiz-level-badge {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    flex-shrink: 0;
}

.quiz-xp-bar {
    flex: 1;
    max-width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.quiz-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.quiz-xp-fill.xp-bar-pulse {
    animation: xpBarPulse 0.3s ease;
}

@keyframes xpBarPulse {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.5);
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    }
}

.quiz-xp-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    min-width: 50px;
}

/* ==================== XP ANIMATION ==================== */
.xp-animation-container {
    position: fixed;
    top: 66%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}


.xp-popup {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.xp-popup .xp-icon {
    font-size: 20px;
}

.xp-popup.xp-animate {
    animation: xpFlyUp 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes xpFlyUp {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.5);
    }

    12% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.2);
    }

    25% {
        transform: translateX(-50%) translateY(-10px) scale(1);
    }

    75% {
        opacity: 1;
        transform: translateX(-50%) translateY(-50px) scale(0.95);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px) scale(0.8);
    }
}

/* Bonus XP (25+) */
.xp-popup.xp-bonus {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.95) 0%, rgba(234, 88, 12, 0.95) 100%);
    box-shadow: 0 4px 25px rgba(249, 115, 22, 0.5);
    font-size: 20px;
}

/* Epic XP (50+) */
.xp-popup.xp-epic {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    box-shadow: 0 4px 30px rgba(168, 85, 247, 0.5);
    font-size: 22px;
    padding: 14px 28px;
}

.xp-popup.xp-epic.xp-animate {
    animation: xpFlyUpEpic 1.8s ease forwards;
}

@keyframes xpFlyUpEpic {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.3) rotate(-10deg);
    }

    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.3) rotate(5deg);
    }

    40% {
        transform: translateX(-50%) translateY(-15px) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px) scale(0.7);
    }
}

/* Legendary XP (200+) */
.xp-popup.xp-legendary {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.95) 0%, rgba(168, 85, 247, 0.95) 50%, rgba(59, 130, 246, 0.95) 100%);
    box-shadow: 0 4px 40px rgba(168, 85, 247, 0.6), 0 0 60px rgba(236, 72, 153, 0.3);
    font-size: 26px;
    padding: 16px 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.xp-popup.xp-legendary.xp-animate {
    animation: xpFlyUpLegendary 2.2s ease forwards;
}

@keyframes xpFlyUpLegendary {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(40px) scale(0.2) rotate(-15deg);
        filter: blur(10px);
    }

    10% {
        filter: blur(0);
    }

    25% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.4) rotate(5deg);
    }

    35% {
        transform: translateX(-50%) translateY(-10px) scale(1.1) rotate(-3deg);
    }

    50% {
        transform: translateX(-50%) translateY(-20px) scale(1) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-120px) scale(0.6);
    }
}

/* Shimmer-Effekt für Legendary */
.xp-popup.xp-legendary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1s ease infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Streak-Anzeige im Quiz Header */
.quiz-streak-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
}

.quiz-streak-display.streak-active {
    animation: streakGlow 1s ease infinite alternate;
}

@keyframes streakGlow {
    0% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }

    100% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
}

/* ==================== DEVELOPER MODE ==================== */
.dev-section .settings-title {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    padding: 12px;
    margin: -12px;
    border-radius: 12px;
}

.dev-section .settings-title:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dev-toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s;
}

.dev-toggle-arrow.open {
    transform: rotate(0deg);
}

.dev-mode-content {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-mode-content.visible {
    display: block;
    animation: devSlideDown 0.3s ease;
}

@keyframes devSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== CHANGELOG STYLES ==================== */
.changelog-section .settings-title {
    cursor: pointer;
}

.changelog-toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.changelog-toggle-arrow.open {
    transform: rotate(0deg);
}

.changelog-content {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.changelog-content.visible {
    display: block;
    animation: devSlideDown 0.3s ease;
}

.changelog-version {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.changelog-version:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.version-number {
    font-size: 15px;
    font-weight: 600;
    color: #a78bfa;
}

.version-date {
    font-size: 12px;
    color: var(--text-muted);
}

.version-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-changes li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.version-changes li:last-child {
    margin-bottom: 0;
}

.version-changes li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.dev-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #f59e0b;
    margin-bottom: 20px;
}

.dev-level-controls {
    display: flex;
    gap: 8px;
}

.dev-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dev-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

.dev-letters-section {
    margin-top: 20px;
}

.dev-letters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.dev-letters-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dev-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dev-btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dev-btn-small.danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.dev-btn-small.danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.dev-letters-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-dot.locked {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-dot.unlocked {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.legend-dot.mastered {
    background: rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.dev-letters-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .dev-letters-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 400px) {
    .dev-letters-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dev-letter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.dev-letter-item:hover {
    transform: scale(1.05);
}

.dev-letter-item:active {
    transform: scale(0.95);
}

.dev-letter-item.locked {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-letter-item.locked .dev-letter-char {
    opacity: 0.3;
}

.dev-letter-item.unlocked {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.dev-letter-item.unlocked .dev-letter-status {
    color: #3b82f6;
}

.dev-letter-item.mastered {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dev-letter-item.mastered .dev-letter-status {
    color: #10b981;
}

.dev-letter-char {
    font-size: 20px;
    margin-bottom: 4px;
}

.dev-letter-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== SPEED BONUS ANIMATION ==================== */
.xp-popup .xp-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xp-bonus-texts {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.9;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Speed Bonus spezifische Styles */
.xp-popup.xp-bonus .xp-bonus-texts,
.xp-popup.xp-epic .xp-bonus-texts {
    font-size: 13px;
    font-weight: 600;
}

/* Blitzschnell Animation */
@keyframes lightning {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.9), 0 0 30px rgba(250, 204, 21, 0.7);
    }
}

.xp-popup.xp-bonus .xp-icon,
.xp-popup.xp-epic .xp-icon {
    animation: lightning 0.5s ease infinite;
}

/* Speed-Indikator im Quiz */
.speed-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 50;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.speed-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.speed-indicator.fast {
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.speed-indicator.superfast {
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
    animation: pulse 0.5s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(168, 85, 247, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    }
}

/* Anpassung für mehrere Bonus-Texte */
.xp-popup {
    flex-direction: column;
    text-align: center;
    min-width: 120px;
}

.xp-popup.xp-bonus,
.xp-popup.xp-epic,
.xp-popup.xp-legendary {
    min-width: 150px;
}

/* ==================== SPEED BONUS DOT ==================== */
/* Minimalistischer Farbpunkt für Speed-Anzeige */
.speed-indicator {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
}

.speed-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Sehr schnell (0-1.25s) - Blau */
.speed-dot.dot-blue {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

/* Schnell (1.25-2.5s) - Cyan */
.speed-dot.dot-cyan {
    background: #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

/* Mittel (2.5-3.75s) - Gelb */
.speed-dot.dot-yellow {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

/* Langsam (3.75-5s) - Orange */
.speed-dot.dot-orange {
    background: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.8);
}

/* Zu langsam (5s+) - Grau */
.speed-dot.dot-gray {
    background: #6b7280;
    box-shadow: none;
    opacity: 0.5;
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   PWA INSTALL PROMPT
   ======================================== */

.install-prompt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.install-prompt-overlay.visible {
    opacity: 1;
}

.install-prompt-overlay.visible .install-prompt {
    transform: translateY(0);
}

.install-prompt {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 100%);
    border-radius: 24px 24px 0 0;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.install-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.install-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.install-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.install-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.install-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.install-text strong {
    color: #818cf8;
}

.ios-instructions {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.ios-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.ios-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.1);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.install-btn:active {
    transform: translateY(0);
}

.install-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.install-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    box-shadow: none;
}

/* ========================================
   ACHIEVEMENT POPUP
   ======================================== */

.achievement-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.achievement-popup-overlay.show {
    opacity: 1;
}

.achievement-popup-overlay.hide {
    opacity: 0;
}

.achievement-popup {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    padding: 32px 28px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    position: relative;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.achievement-popup-overlay.show .achievement-popup {
    transform: scale(1) translateY(0);
}

.achievement-popup-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
    animation: achievementGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes achievementGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.achievement-popup-icon-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: achievementBounce 0.6s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes achievementBounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.achievement-popup-icon {
    font-size: 56px;
    animation: achievementPulse 2s ease-in-out infinite;
}

@keyframes achievementPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.achievement-popup-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    animation: achievementSlideIn 0.5s ease-out 0.2s both;
}

@keyframes achievementSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.achievement-popup-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    animation: achievementSlideIn 0.5s ease-out 0.3s both;
}

.achievement-popup-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
    animation: achievementSlideIn 0.5s ease-out 0.4s both;
}

.achievement-popup-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: achievementSlideIn 0.5s ease-out 0.5s both;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.achievement-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.achievement-popup-btn:active {
    transform: translateY(0);
}

/* Achievement Color Themes */
.achievement-popup.achievement-blue .achievement-popup-glow {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-purple .achievement-popup-glow {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-gold .achievement-popup-glow {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
}

.achievement-popup.achievement-gold .achievement-popup-icon-wrapper {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.1));
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

.achievement-popup.achievement-rainbow .achievement-popup-glow {
    background: conic-gradient(from 0deg,
            rgba(239, 68, 68, 0.15),
            rgba(245, 158, 11, 0.15),
            rgba(16, 185, 129, 0.15),
            rgba(59, 130, 246, 0.15),
            rgba(139, 92, 246, 0.15),
            rgba(239, 68, 68, 0.15));
    animation: achievementRainbow 4s linear infinite;
}

@keyframes achievementRainbow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.achievement-popup.achievement-rainbow .achievement-popup-icon-wrapper {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    box-shadow:
        0 10px 40px rgba(139, 92, 246, 0.3),
        0 0 60px rgba(245, 158, 11, 0.2);
}

.achievement-popup.achievement-red .achievement-popup-glow {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-yellow .achievement-popup-glow {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-orange .achievement-popup-glow {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-green .achievement-popup-glow {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
}

.achievement-popup.achievement-pink .achievement-popup-glow {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
}

/* ==================== LETTER MASTERED IN-PLACE ANIMATION ==================== */
.letter-display-box.letter-mastered-celebration {
    animation: masteredBoxGlow 1.5s ease-in-out infinite;
    border-color: #fbbf24 !important;
}

@keyframes masteredBoxGlow {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(251, 191, 36, 0.5),
            0 0 40px rgba(251, 191, 36, 0.3),
            0 0 60px rgba(251, 191, 36, 0.1),
            inset 0 0 20px rgba(251, 191, 36, 0.05);
        transform: scale(1);
    }

    50% {
        box-shadow:
            0 0 40px rgba(251, 191, 36, 0.7),
            0 0 80px rgba(251, 191, 36, 0.5),
            0 0 120px rgba(251, 191, 36, 0.3),
            inset 0 0 40px rgba(251, 191, 36, 0.1);
        transform: scale(1.02);
    }
}

/* Performance-optimiertes Konfetti für Mobile */
.mastered-confetti-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 100;
}

.confetti-particle {
    position: absolute;
    font-size: 36px;
    will-change: transform, opacity;
    animation: confettiBurst 0.8s ease-out forwards;
}

/* Nur 4 Partikel in 4 Richtungen */
.confetti-particle:nth-child(1) {
    animation-delay: 0s;
}

.confetti-particle:nth-child(2) {
    animation-delay: 0.05s;
}

.confetti-particle:nth-child(3) {
    animation-delay: 0.1s;
}

.confetti-particle:nth-child(4) {
    animation-delay: 0.15s;
}

/* Einfache, GPU-beschleunigte Animation */
@keyframes confettiBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + (var(--index) - 1.5) * 60px),
                calc(-50% - 80px + var(--index) * 15px)) scale(0.5) rotate(180deg);
        opacity: 0;
    }
}

.mastered-inline-badge {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    font-size: 16px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    white-space: nowrap;
    animation: badgePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), badgePulse 2s ease-in-out 0.4s infinite;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    z-index: 100;
}

@keyframes badgePopIn {
    0% {
        transform: translateX(-50%) scale(0) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes badgePulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
    }
}

/* ========================================
   TUTORIAL NEW STEP TYPES
   ======================================== */

/* RTL Step */
.tutorial-rtl-example {
    margin: 20px 0;
    text-align: center;
}

.tutorial-rtl-word {
    font-size: 48px;
    color: var(--accent-color);
    font-family: 'Noto Sans Arabic', sans-serif;
    margin: 15px 0;
    direction: rtl;
}

.tutorial-rtl-arrow {
    font-size: 32px;
    margin: 10px 0;
    animation: slideRTL 1.5s ease-in-out infinite;
}

@keyframes slideRTL {

    0%,
    100% {
        transform: translateX(0);
        opacity: 1;
    }

    50% {
        transform: translateX(-15px);
        opacity: 0.5;
    }
}

/* Form-Falle Examples */
.tutorial-special-cases {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 15px 0;
}

.tutorial-special-case-item {
    background: rgba(255, 100, 100, 0.1);
    border: 2px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    padding: 15px;
}

.tutorial-special-case-word {
    font-size: 32px;
    font-family: 'Noto Sans Arabic', sans-serif;
    direction: rtl;
    margin: 8px 0;
}

.tutorial-special-case-explanation {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 8px;
}

.tutorial-special-case-highlight {
    color: #ff6b6b;
    font-weight: bold;
}

/* Alphabet Overview */
.tutorial-alphabet-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.tutorial-stat {
    text-align: center;
}

.tutorial-stat-number {
    font-size: 48px;
    font-weight: bold;
    color: var(--accent-color);
}

.tutorial-stat-label {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 5px;
}

/* Unlock Visual */
.tutorial-unlock-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    font-size: 22px;
}

.tutorial-unlock-visual>div {
    text-align: center;
}

.tutorial-unlock-arrow {
    font-size: 32px;
    transform: rotate(90deg);
    animation: arrowBounce 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
}

@keyframes arrowBounce {

    0%,
    100% {
        transform: rotate(90deg) translateX(0);
        filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
    }

    50% {
        transform: rotate(90deg) translateX(8px);
        filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.8));
    }
}

/* RTL Breakdown Position Label */
.tutorial-breakdown-position {
    display: block;
    font-size: 12px;
    opacity: 0.6;
    margin-top: 4px;
}

/* ========================================
   IN-QUIZ TOOLTIP SYSTEM (Über Beispielwort)
   ======================================== */

.word-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 100;
    animation: tooltipAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.word-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 6px solid #764ba2;
}

@keyframes tooltipAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Tooltip Farb-Varianten */
.word-tooltip.rtl-hint {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.word-tooltip.rtl-hint::after {
    border-top-color: #2563eb;
}

.word-tooltip.form-trap-hint {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.word-tooltip.form-trap-hint::after {
    border-top-color: #dc2626;
}

.word-tooltip.unlock-hint {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.word-tooltip.unlock-hint::after {
    border-top-color: #059669;
}

/* Star Tooltip (erscheint unter den Sternen, zeigt nach oben) */
.star-tooltip {
    position: absolute;
    bottom: -55px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 100;
    animation: tooltipAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.star-tooltip::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 6px solid #059669;
}

/* ==================== LEADERBOARD CARDS - ANDROID FIX ==================== */
.leaderboard-card {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

/* Rank Badge - Ensure it doesn't shrink */
.rank-badge-container {
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

/* Player Info Container */
.player-info-container {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Player Name Row */
.player-name-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* XP Bar */
.player-xp-bar {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
}

.player-xp-bar .xp-bar-bg {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

/* Leaderboard List */
.leaderboard-list {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Section Header */
.section-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

/* Leaderboard Header */
.leaderboard-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

/* Icon Edit Button */
.settings-btn {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #a5b4fc;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    color: #fff;
}

/* FIX: Alphabet & Stats Header wie Settings */
.alphabet-header,
.stats-header {
    background: transparent !important;
}

.alphabet-title,
.stats-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
}

/* ========================================
   ZAHLEN-MODUS STYLES
   ======================================== */

/* Numbers Menu Container */
.numbers-container {
    min-height: 100vh;
    padding: var(--spacing-md);
    padding-top: calc(var(--safe-area-top) + var(--spacing-md));
    padding-bottom: calc(var(--safe-area-bottom) + var(--spacing-xl));
    background: var(--bg-primary);
}

.numbers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.numbers-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.numbers-intro {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

/* Category Cards */
.category-cards {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.category-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--blur-glass);
    transition: all 0.3s ease;
}

.category-card.clickable {
    cursor: pointer;
}

.category-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(102, 126, 234, 0.5);
}

.category-card.clickable:active {
    transform: translateY(0);
}

.category-card.locked {
    opacity: 0.5;
    position: relative;
    cursor: not-allowed;
}

.category-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.category-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.category-progress .progress-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.category-progress .progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-progress .progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

.lock-icon {
    font-size: 1.5rem;
    opacity: 0.7;
}

/* Numbers Actions */
.numbers-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.numbers-actions .primary-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.numbers-actions .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.numbers-actions .secondary-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.numbers-actions .secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Numbers Quiz Specific Styles */

.number-symbol-large {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.number-value-large {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.number-name-large {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.question-type-label {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

/* Number Option Button */
.option-button.number-option .option-content {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.option-button.number-option .option-content.persian-text {
    font-size: 2rem;
    color: #ffffff;
}

/* Numbers Overview */
.numbers-list {
    gap: var(--spacing-lg);
}

.number-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
}

.number-row.locked {
    opacity: 0.4;
}

.number-symbol-cell {
    font-size: 1.8rem;
    min-width: 80px;
    text-align: center;
    color: var(--text-primary);
}

.lock-overlay {
    position: absolute;
    right: var(--spacing-md);
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Category Section in Overview */
.category-section {
    margin-bottom: var(--spacing-xl);
}

.category-section .category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: var(--blur-glass);
}

.category-section .category-icon {
    font-size: 1.5rem;
}

.category-section .category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-section .category-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Feedback for Numbers */
.feedback-number {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.feedback-number .number-symbol {
    font-size: 4rem;
    color: var(--text-primary);
}

.feedback-number .number-info {
    text-align: left;
}

.feedback-number .number-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.feedback-number .number-value {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.feedback-number .number-pronunciation {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.feedback-category {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Numbers Menu Button in Main Menu */
.menu-btn.numbers-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.menu-btn.numbers-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.25));
    border-color: rgba(59, 130, 246, 0.5);
}

/* New Number Modal Styles */
.new-number-modal .new-number-symbol {
    font-size: 5rem;
}

.new-number-value {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.new-number-category {
    margin-top: 1rem;
}

.new-number-category .category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==================== KOMBINIERTE ZAHLEN STYLES ==================== */

/* Kombinierte Zahlen Container */
.combined-numbers-container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.combined-numbers-info {
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.combined-numbers-info h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.combined-numbers-info ul {
    list-style: none;
    padding: 0;
}

.combined-numbers-info li {
    color: var(--text-secondary);
    padding: var(--spacing-xs) 0;
    font-size: 0.95rem;
}

.combined-numbers-info li strong {
    color: var(--text-primary);
}

/* Ziffern-Eingabe UI */
.digit-input-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
}

.digit-preview {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    min-height: 80px;
    padding: var(--spacing-md);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
}

.digit-preview-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.digit-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.digit-button {
    aspect-ratio: 1;
    font-size: 1.75rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.digit-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.digit-button:active {
    transform: translateY(0);
}

.digit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.backspace-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--text-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.backspace-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

.submit-digit-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-digit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-digit-btn:active {
    transform: translateY(0);
}

.number-value-large {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.number-symbol-large {
    font-size: 3rem;
    font-weight: 700;
}

.question-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-sm);
}

/* Quiz Wrapper für Kombinierte Zahlen Modus */
.quiz-wrapper.combined-numbers-mode {
    background: var(--bg-primary);
}

/* Responsive Anpassungen */
@media (max-width: 600px) {
    .digit-preview-box {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .digit-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .digit-button {
        font-size: 1.5rem;
    }
}

/* ==================== CUSTOM QUIZ FRAGETYP-AUSWAHL ==================== */

.quiz-type-options {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.quiz-type-btn {
    flex: 1;
    min-width: 90px;
    padding: var(--spacing-md) var(--spacing-sm);
    background: var(--bg-glass);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.quiz-type-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.quiz-type-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.quiz-type-icon {
    font-size: 1.5rem;
}

.quiz-type-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.quiz-type-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Custom Quiz Typing Mode */
.digit-input-display {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    padding: var(--spacing-lg);
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
}

.digit-input-display span {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.digit-keyboard {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 10;
}

.digit-btn {
    aspect-ratio: 1;
    min-height: 56px;
    min-width: 56px;
    font-size: 1.75rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    background: var(--bg-glass);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s ease;
    /* Touch-Optimierung */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.digit-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.digit-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.digit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--safe-area-bottom);
    position: relative;
    z-index: 10;
}

.digit-action-btn {
    background: var(--bg-glass);
    border: var(--border-glass);
    color: var(--text-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.digit-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.digit-action-btn.backspace-btn {
    font-size: 1.3rem;
}

.digit-action-btn.clear-btn {
    font-weight: 700;
    color: var(--error);
}

.digit-action-btn.submit-btn {
    background: var(--primary-gradient);
    border: none;
    font-weight: 600;
}

.digit-action-btn.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Typing Feedback Overlay */
.typing-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    animation: feedbackPop 0.3s ease;
    z-index: 100;
}

.typing-feedback.correct {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.typing-feedback.wrong {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

@keyframes feedbackPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .quiz-type-btn {
        min-width: 80px;
        padding: var(--spacing-sm);
    }

    .quiz-type-icon {
        font-size: 1.2rem;
    }

    .quiz-type-label {
        font-size: 0.8rem;
    }

    .quiz-type-desc {
        font-size: 0.65rem;
    }

    .digit-btn {
        font-size: 1.5rem;
    }
}

/* ==================== DEVELOPER MODE EXTENSIONS ==================== */

/* Numbers Info Display */
.dev-numbers-info {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.dev-numbers-info span {
    flex: 1;
    text-align: center;
}

/* Combined Numbers Status */
.dev-combined-info {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combined-range-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 14px;
}

.range-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.range-unlock {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.range-unlock.unlocked {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.range-unlock.locked {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.range-stats {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: right;
}

/* ========================================
   SYNC STATUS UI STYLES
   ======================================== */

/* Sync Status Indicator (top-right) - Subtle error-only indicator */
.sync-indicator {
    position: fixed;
    top: calc(12px + var(--safe-area-top));
    right: calc(12px + var(--safe-area-right));
    background: rgba(244, 67, 54, 0.12);
    backdrop-filter: blur(6px);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    transition: all 0.2s ease;
    opacity: 0.7;
    cursor: pointer;
}

.sync-indicator:hover {
    opacity: 1;
    transform: scale(1.05);
}

.sync-indicator.error {
    background: rgba(244, 67, 54, 0.15);
}

.sync-icon {
    font-size: 14px;
    display: inline-block;
}

/* Sync Error Notification Overlay */
.sync-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.sync-error-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.sync-error-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    margin: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.sync-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.sync-error-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.sync-error-message {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 24px;
}

.sync-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Session Expired Dialog */
.session-expired-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.session-expired-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.session-expired-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    margin: 20px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

.session-expired-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.session-expired-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}

.session-expired-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* Persistent Warning Banner (for anonymous users) - Subtle */
.sync-warning-banner {
    position: fixed;
    top: var(--safe-area-top);
    left: 0;
    right: 0;
    background: rgba(255, 152, 0, 0.9);
    color: white;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    animation: slideDown 0.3s ease;
}

.sync-warning-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.sync-warning-icon {
    font-size: 16px;
}

.sync-warning-text {
    font-size: 12px;
    font-weight: 500;
}

.sync-warning-action {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sync-warning-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.sync-warning-action:active {
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== SPLASH SCREEN ==================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(102, 126, 234, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.2) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
}

.splash-screen.fade-out {
    animation: splashFadeOut 0.8s ease-out forwards;
}

/* Particle container */
.splash-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.splash-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

/* Glow effect */
.splash-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.3) 40%, transparent 70%);
    filter: blur(50px);
    animation: splashGlowPulse 3s ease-in-out infinite;
}

/* Content container */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    z-index: 2;
    padding: var(--spacing-xl);
}

/* Logo styles */
.splash-logo-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.splash-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(118, 75, 162, 0.7));
    animation: splashLogoEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

.splash-logo-ring {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid rgba(102, 126, 234, 0.4);
    border-radius: 50%;
    animation: splashRingExpand 1.5s ease-out 0.3s forwards, splashRingRotate 10s linear infinite;
    opacity: 0;
}

.splash-logo-ring::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary-gradient);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
}

/* Title styles */
.splash-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: var(--spacing-md);
}

.splash-title-word {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(30px);
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
}

.splash-anim-1 {
    animation: splashTextReveal 0.7s ease-out 0.5s forwards;
}

.splash-anim-2 {
    animation: splashTextReveal 0.7s ease-out 0.7s forwards;
}

.splash-anim-3 {
    animation: splashTextReveal 0.7s ease-out 0.9s forwards;
}

/* Description */
.splash-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0;
    animation: splashFadeUp 0.7s ease-out 1.1s forwards;
    max-width: 280px;
}

/* Footer */
.splash-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    animation: splashFadeUp 0.7s ease-out 1.3s forwards;
    margin-top: var(--spacing-sm);
}

.splash-company {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash-version {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Beta badge */
.splash-beta-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(239, 68, 68, 0.25) 100%);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: splashBetaBadge 0.7s ease-out 1.5s forwards;
    box-shadow:
        0 0 25px rgba(245, 158, 11, 0.25),
        inset 0 0 20px rgba(245, 158, 11, 0.1);
    margin-top: var(--spacing-md);
}

.splash-beta-badge .beta-icon {
    font-size: 1.1rem;
}

.splash-beta-badge .beta-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Loader bar */
.splash-loader {
    position: absolute;
    bottom: 80px;
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: splashFadeUp 0.5s ease-out 1.7s forwards;
}

.splash-loader-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 2px;
    animation: splashLoaderProgress 2s ease-in-out 1.8s forwards;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ==================== SPLASH SCREEN ANIMATIONS ==================== */

/* Logo entrance - bouncy scale up with rotation */
@keyframes splashLogoEntrance {
    0% {
        opacity: 0;
        transform: scale(0.2) rotate(-20deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.15) rotate(8deg);
    }

    70% {
        transform: scale(0.92) rotate(-4deg);
    }

    85% {
        transform: scale(1.05) rotate(2deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Ring expand and rotate */
@keyframes splashRingExpand {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splashRingRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Text reveal staggered */
@keyframes splashTextReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Generic fade up */
@keyframes splashFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Beta badge with pop effect */
@keyframes splashBetaBadge {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow pulse */
@keyframes splashGlowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Loader progress */
@keyframes splashLoaderProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* Particle float */
@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) translateX(30px);
        opacity: 0;
    }
}

/* Splash fade out */
@keyframes splashFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

/* ==================== LEADERBOARD ENHANCEMENTS ==================== */

/* Hover effect for player cards */
.leaderboard-player-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-player-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Medal animation */
.rank-medal {
    display: inline-block;
    animation: medalShimmer 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

@keyframes medalShimmer {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1) rotate(-5deg);
    }
}

/* Streak pulse animation */
.streak-display {
    animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Personal progress card slide in */
.personal-progress-card {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}