/* ============================================
           CSS VARIABLES & BASE STYLES
           ============================================ */
        :root {
            /* Nominative Case - Blue Theme */
            --nom: #3b82f6;
            --nom-light: #dbeafe;
            --nom-dark: #1d4ed8;
            
            /* Gender Colors */
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            --plural: #8b5cf6;
            
            /* UI Colors */
            --success: #10b981;
            --error: #ef4444;
            --warning: #f59e0b;
            --bg: #f8fafc;
            --card-bg: #ffffff;
            --text: #1e293b;
            --text-muted: #64748b;
            --border: #e2e8f0;
            
            /* Spacing */
            --space-xs: 0.25rem;
            --space-sm: 0.5rem;
            --space-md: 1rem;
            --space-lg: 1.5rem;
            --space-xl: 2rem;
            --space-2xl: 3rem;
            
            /* Border Radius */
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 16px;
            
            /* Shadows */
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            min-height: 100vh;
        }
        
        /* ============================================
           HEADER & NAVIGATION
           ============================================ */
        .chapter-header {
            background: linear-gradient(135deg, var(--nom) 0%, var(--nom-dark) 100%);
            color: white;
            padding: var(--space-xl) var(--space-lg);
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .chapter-header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 300px;
            height: 300px;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
        }
        
        .chapter-badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: var(--space-xs) var(--space-md);
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: var(--space-sm);
        }
        
        .chapter-header h1 {
            font-size: clamp(1.75rem, 5vw, 2.5rem);
            font-weight: 700;
            margin-bottom: var(--space-sm);
        }
        
        .chapter-subtitle {
            opacity: 0.9;
            font-size: 1.1rem;
        }
        
        /* Navigation */
        .chapter-nav {
            background: var(--card-bg);
            padding: var(--space-md) var(--space-lg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border);
            flex-wrap: wrap;
            gap: var(--space-md);
        }
        
        .chapter-nav a {
            color: var(--nom);
            text-decoration: none;
            font-weight: 600;
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-md);
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .chapter-nav a:hover {
            background: var(--nom-light);
            transform: translateY(-1px);
        }
        
        .chapter-nav .prev::before {
            content: '←';
        }
        
        .chapter-nav .next::after {
            content: '→';
        }
        
        .progress-bar {
            background: var(--nom-light);
            padding: var(--space-xs) var(--space-md);
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--nom-dark);
        }
        
        /* ============================================
           MAIN CONTAINER
           ============================================ */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: var(--space-xl) var(--space-lg);
        }
        
        /* ============================================
           THEORY CARDS
           ============================================ */
        .theory-card {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            box-shadow: var(--shadow-md);
            border-left: 4px solid var(--nom);
        }
        
        .theory-card h2 {
            color: var(--nom-dark);
            font-size: 1.5rem;
            margin-bottom: var(--space-md);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .theory-card h2::before {
            content: '📘';
        }
        
        .theory-card p {
            margin-bottom: var(--space-md);
            color: var(--text);
        }
        
        /* ============================================
           MNEMONIC BOX
           ============================================ */
        .mnemonic-box {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border: 2px solid #f59e0b;
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            margin: var(--space-lg) 0;
            position: relative;
        }
        
        .mnemonic-box::before {
            content: '💡';
            font-size: 2rem;
            position: absolute;
            top: -15px;
            left: 20px;
            background: #fef3c7;
            padding: 0 10px;
            border-radius: 50%;
        }
        
        .mnemonic-box h4 {
            color: #92400e;
            margin-bottom: var(--space-sm);
            margin-top: var(--space-sm);
        }
        
        .mnemonic-box p {
            color: #78350f;
            margin: 0;
        }
        
        .mnemonic-formula {
            background: white;
            padding: var(--space-md);
            border-radius: var(--radius-md);
            text-align: center;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--nom-dark);
            margin-top: var(--space-md);
        }
        
        /* ============================================
           EXAMPLE SENTENCES
           ============================================ */
        .example-list {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
            margin: var(--space-lg) 0;
        }
        
        .example-item {
            background: var(--nom-light);
            padding: var(--space-md) var(--space-lg);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            gap: var(--space-md);
            flex-wrap: wrap;
        }
        
        .german-sentence {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text);
        }
        
        .german-sentence .subject {
            color: var(--nom);
            text-decoration: underline;
            text-decoration-color: var(--nom);
            text-decoration-thickness: 3px;
            text-underline-offset: 3px;
        }
        
        .translation {
            color: var(--text-muted);
            font-style: italic;
        }
        
        .audio-btn {
            background: var(--nom);
            color: white;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        
        .audio-btn:hover {
            background: var(--nom-dark);
            transform: scale(1.1);
        }
        
        .audio-btn.playing {
            animation: pulse 1s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        
        /* ============================================
           ENDINGS TABLE
           ============================================ */
        .endings-table {
            width: 100%;
            border-collapse: collapse;
            margin: var(--space-lg) 0;
            background: var(--card-bg);
            border-radius: var(--radius-md);
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }
        
        .endings-table th,
        .endings-table td {
            padding: var(--space-md);
            text-align: left;
            border-bottom: 1px solid var(--border);
        }
        
        .endings-table th {
            background: var(--nom);
            color: white;
            font-weight: 600;
        }
        
        .endings-table th:first-child {
            background: var(--nom-dark);
        }
        
        .endings-table tr:hover {
            background: var(--nom-light);
        }
        
        .endings-table .masc { color: var(--masc); font-weight: 600; }
        .endings-table .fem { color: var(--fem); font-weight: 600; }
        .endings-table .neut { color: var(--neut); font-weight: 600; }
        .endings-table .plural { color: var(--plural); font-weight: 600; }
        
        /* ============================================
           EXERCISE SECTIONS
           ============================================ */
        .exercise-section {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            box-shadow: var(--shadow-md);
        }
        
        .exercise-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-lg);
            flex-wrap: wrap;
            gap: var(--space-md);
        }
        
        .exercise-title {
            color: var(--nom-dark);
            font-size: 1.35rem;
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .exercise-title::before {
            content: '✏️';
        }
        
        .score-display {
            background: var(--nom-light);
            padding: var(--space-xs) var(--space-md);
            border-radius: 20px;
            font-weight: 600;
            color: var(--nom-dark);
        }
        
        .exercise-instructions {
            background: #f1f5f9;
            padding: var(--space-md);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-lg);
            color: var(--text-muted);
        }
        
        /* ============================================
           EXERCISE 11.1 - DROPDOWNS
           ============================================ */
        .dropdown-exercise {
            display: flex;
            flex-direction: column;
            gap: var(--space-md);
        }
        
        .dropdown-item {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            flex-wrap: wrap;
            padding: var(--space-md);
            background: #f8fafc;
            border-radius: var(--radius-md);
        }
        
        .dropdown-item .number {
            background: var(--nom);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.875rem;
            flex-shrink: 0;
        }
        
        .dropdown-item .gender-hint {
            background: #e2e8f0;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--text-muted);
        }
        
        .dropdown-item select {
            padding: var(--space-sm) var(--space-md);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 1rem;
            background: white;
            cursor: pointer;
            min-width: 100px;
        }
        
        .dropdown-item select:focus {
            outline: none;
            border-color: var(--nom);
        }
        
        .dropdown-item select.correct {
            border-color: var(--success);
            background: #d1fae5;
        }
        
        .dropdown-item select.incorrect {
            border-color: var(--error);
            background: #fee2e2;
        }
        
        .dropdown-item .sentence-part {
            font-size: 1.1rem;
        }
        
        .feedback-icon {
            font-size: 1.25rem;
            margin-left: var(--space-sm);
        }
        
        /* ============================================
           EXERCISE 11.2 - CLICK TO UNDERLINE
           ============================================ */
        .underline-exercise {
            display: flex;
            flex-direction: column;
            gap: var(--space-lg);
        }
        
        .underline-item {
            background: #f8fafc;
            padding: var(--space-lg);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }
        
        .underline-item:hover {
            background: var(--nom-light);
            border-color: var(--nom);
        }
        
        .underline-item .number {
            display: inline-block;
            background: var(--nom);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            text-align: center;
            line-height: 28px;
            font-weight: 600;
            font-size: 0.875rem;
            margin-right: var(--space-sm);
        }
        
        .underline-item .sentence {
            font-size: 1.15rem;
            line-height: 2;
        }
        
        .underline-item .word {
            padding: 2px 4px;
            border-radius: 4px;
            transition: all 0.2s;
            cursor: pointer;
        }
        
        .underline-item .word:hover {
            background: rgba(59, 130, 246, 0.2);
        }
        
        .underline-item .word.selected {
            background: var(--nom);
            color: white;
        }
        
        .underline-item .word.correct {
            text-decoration: underline;
            text-decoration-color: var(--success);
            text-decoration-thickness: 3px;
            text-underline-offset: 3px;
            background: #d1fae5;
        }
        
        .underline-item .word.incorrect {
            background: #fee2e2;
        }
        
        .underline-item .result-msg {
            margin-top: var(--space-sm);
            font-weight: 600;
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-sm);
        }
        
        .underline-item .result-msg.correct {
            background: #d1fae5;
            color: #065f46;
        }
        
        .underline-item .result-msg.incorrect {
            background: #fee2e2;
            color: #991b1b;
        }
        
        /* ============================================
           EXERCISE 11.3 - TRANSLATION INPUTS
           ============================================ */
        .translation-exercise {
            display: flex;
            flex-direction: column;
            gap: var(--space-lg);
        }
        
        .translation-item {
            background: #f8fafc;
            padding: var(--space-lg);
            border-radius: var(--radius-md);
        }
        
        .translation-item .number {
            display: inline-block;
            background: var(--nom);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            text-align: center;
            line-height: 28px;
            font-weight: 600;
            font-size: 0.875rem;
            margin-bottom: var(--space-sm);
        }
        
        .translation-item .prompt {
            font-size: 1.1rem;
            margin-bottom: var(--space-md);
            color: var(--text-muted);
        }
        
        .translation-input-wrapper {
            display: flex;
            gap: var(--space-sm);
            flex-wrap: wrap;
        }
        
        .translation-item input {
            flex: 1;
            min-width: 250px;
            padding: var(--space-md);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 1rem;
            transition: all 0.2s;
        }
        
        .translation-item input:focus {
            outline: none;
            border-color: var(--nom);
        }
        
        .translation-item input.correct {
            border-color: var(--success);
            background: #d1fae5;
        }
        
        .translation-item input.incorrect {
            border-color: var(--error);
            background: #fee2e2;
        }
        
        .check-btn {
            background: var(--nom);
            color: white;
            border: none;
            padding: var(--space-md) var(--space-lg);
            border-radius: var(--radius-sm);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .check-btn:hover {
            background: var(--nom-dark);
        }
        
        .translation-item .answer-feedback {
            margin-top: var(--space-md);
            padding: var(--space-md);
            border-radius: var(--radius-sm);
            display: none;
        }
        
        .translation-item .answer-feedback.show {
            display: block;
        }
        
        .translation-item .answer-feedback.correct {
            background: #d1fae5;
            color: #065f46;
        }
        
        .translation-item .answer-feedback.incorrect {
            background: #fee2e2;
            color: #991b1b;
        }
        
        .translation-item .correct-answer {
            font-weight: 600;
            margin-top: var(--space-sm);
        }
        
        /* ============================================
           CHECKLIST
           ============================================ */
        .checklist-section {
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            border: 2px solid var(--success);
        }
        
        .checklist-section h3 {
            color: #065f46;
            font-size: 1.35rem;
            margin-bottom: var(--space-lg);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .checklist-section h3::before {
            content: '✓';
            background: var(--success);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
        }
        
        .checklist-item {
            display: flex;
            align-items: flex-start;
            gap: var(--space-md);
            padding: var(--space-md);
            background: white;
            border-radius: var(--radius-md);
            margin-bottom: var(--space-md);
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .checklist-item:hover {
            transform: translateX(5px);
            box-shadow: var(--shadow-sm);
        }
        
        .checklist-item input[type="checkbox"] {
            width: 22px;
            height: 22px;
            accent-color: var(--success);
            cursor: pointer;
            flex-shrink: 0;
            margin-top: 2px;
        }
        
        .checklist-item label {
            cursor: pointer;
            flex: 1;
            color: #065f46;
        }
        
        .checklist-item .answer-reveal {
            display: none;
            margin-top: var(--space-sm);
            padding: var(--space-sm) var(--space-md);
            background: #ecfdf5;
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }
        
        .checklist-item.checked .answer-reveal {
            display: block;
        }
        
        /* ============================================
           CONNECTIVITY BRIDGE
           ============================================ */
        .connectivity {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-lg);
            margin-bottom: var(--space-xl);
        }
        
        @media (max-width: 600px) {
            .connectivity {
                grid-template-columns: 1fr;
            }
        }
        
        .connectivity > div {
            padding: var(--space-lg);
            border-radius: var(--radius-lg);
        }
        
        .from-prev {
            background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
            border-left: 4px solid #6b7280;
        }
        
        .to-next {
            background: linear-gradient(135deg, var(--nom-light) 0%, #bfdbfe 100%);
            border-left: 4px solid var(--nom);
        }
        
        .connectivity h4 {
            font-size: 1rem;
            margin-bottom: var(--space-sm);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }
        
        .from-prev h4 {
            color: #4b5563;
        }
        
        .from-prev h4::before {
            content: '←';
        }
        
        .to-next h4 {
            color: var(--nom-dark);
        }
        
        .to-next h4::before {
            content: '→';
        }
        
        .connectivity p {
            color: var(--text-muted);
            font-size: 0.95rem;
        }
        
        /* ============================================
           ACTION BUTTONS
           ============================================ */
        .action-buttons {
            display: flex;
            gap: var(--space-md);
            justify-content: center;
            margin-top: var(--space-xl);
            flex-wrap: wrap;
        }
        
        .btn {
            padding: var(--space-md) var(--space-xl);
            border-radius: var(--radius-md);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }
        
        .btn-primary {
            background: var(--nom);
            color: white;
        }
        
        .btn-primary:hover {
            background: var(--nom-dark);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }
        
        .btn-secondary {
            background: white;
            color: var(--nom);
            border: 2px solid var(--nom);
        }
        
        .btn-secondary:hover {
            background: var(--nom-light);
        }
        
        /* ============================================
           STREAK COUNTER
           ============================================ */
        .streak-counter {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: white;
            padding: var(--space-md) var(--space-lg);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            font-weight: 600;
            z-index: 100;
        }
        
        .streak-counter::before {
            content: '🔥';
            font-size: 1.5rem;
        }
        
        /* ============================================
           FOOTER
           ============================================ */
        footer {
            text-align: center;
            padding: var(--space-xl);
            color: var(--text-muted);
            border-top: 1px solid var(--border);
        }
        
        /* ============================================
           UTILITY CLASSES
           ============================================ */
        .highlight {
            background: #fef08a;
            padding: 2px 6px;
            border-radius: 4px;
        }
        
        .verb-highlight {
            color: var(--success);
            font-weight: 600;
        }
        
        .hidden {
            display: none !important;
        }
        
        /* Success animation */
        @keyframes successPop {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }
        
        .success-pop {
            animation: successPop 0.3s ease;
        }
