:root {
            --nom: #3b82f6;
            --acc: #ef4444;
            --dat: #10b981;
            --gen: #8b5cf6;
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            --plural: #84cc16;
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --success: #22c55e;
            --error: #ef4444;
            --warning: #f59e0b;
            --bg: #f8fafc;
            --card: #ffffff;
            --text: #1e293b;
            --text-light: #64748b;
            --border: #e2e8f0;
            --shadow: 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', Tahoma, Geneva, Verdana, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            padding-bottom: 2rem;
        }
        
        /* Header */
        .chapter-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            padding: 2rem 1rem;
            text-align: center;
        }
        
        .chapter-badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        .chapter-header h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }
        
        .chapter-header p {
            opacity: 0.9;
            font-size: 1.125rem;
        }
        
        /* Navigation */
        .chapter-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 900px;
            margin: 1.5rem auto;
            padding: 0 1rem;
            gap: 1rem;
        }
        
        .chapter-nav a {
            color: var(--primary);
            text-decoration: none;
            padding: 0.75rem 1rem;
            border-radius: 0.5rem;
            transition: all 0.2s;
            font-weight: 500;
        }
        
        .chapter-nav a:hover {
            background: var(--primary);
            color: white;
        }
        
        .progress-bar {
            background: var(--border);
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-size: 0.875rem;
            color: var(--text-light);
            white-space: nowrap;
        }
        
        /* Main Container */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 0 1rem;
        }
        
        /* Streak Counter */
        .streak-bar {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
            margin: 1rem 0;
            padding: 0.75rem;
            background: var(--card);
            border-radius: 0.5rem;
            box-shadow: var(--shadow);
        }
        
        .streak-bar span {
            font-size: 1.5rem;
        }
        
        .streak-count {
            font-weight: 700;
            color: var(--warning);
        }
        
        /* Section Cards */
        .section {
            background: var(--card);
            border-radius: 1rem;
            padding: 1.5rem;
            margin: 1.5rem 0;
            box-shadow: var(--shadow);
        }
        
        .section h2 {
            color: var(--primary);
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--border);
        }
        
        .section h3 {
            color: var(--text);
            margin: 1.5rem 0 0.75rem;
        }
        
        /* Theory Cards */
        .theory-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1rem;
            margin: 1rem 0;
        }
        
        .theory-card {
            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
            border-radius: 0.75rem;
            padding: 1.25rem;
            border-left: 4px solid var(--primary);
        }
        
        .theory-card.nicht {
            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
            border-left-color: var(--error);
        }
        
        .theory-card.kein {
            background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
            border-left-color: var(--success);
        }
        
        .theory-card h4 {
            color: var(--text);
            margin-bottom: 0.75rem;
            font-size: 1.1rem;
        }
        
        .theory-card p {
            color: var(--text-light);
            font-size: 0.95rem;
            margin-bottom: 0.5rem;
        }
        
        /* Example Box */
        .example-box {
            background: #f8fafc;
            border-radius: 0.5rem;
            padding: 1rem;
            margin: 0.75rem 0;
            border: 1px solid var(--border);
        }
        
        .example {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0;
            border-bottom: 1px dashed var(--border);
        }
        
        .example:last-child {
            border-bottom: none;
        }
        
        .example .de {
            font-weight: 600;
            color: var(--text);
        }
        
        .example .en {
            color: var(--text-light);
            font-size: 0.9rem;
        }
        
        .audio-btn {
            background: var(--primary);
            color: white;
            border: none;
            width: 2rem;
            height: 2rem;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        
        .audio-btn:hover {
            background: var(--primary-dark);
            transform: scale(1.1);
        }
        
        /* Rules List */
        .rules-list {
            list-style: none;
            margin: 1rem 0;
        }
        
        .rules-list li {
            padding: 0.75rem 0;
            padding-left: 1.5rem;
            position: relative;
            border-bottom: 1px solid var(--border);
        }
        
        .rules-list li::before {
            content: "→";
            position: absolute;
            left: 0;
            color: var(--primary);
            font-weight: bold;
        }
        
        .rules-list li:last-child {
            border-bottom: none;
        }
        
        /* Kein Table */
        .endings-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            font-size: 0.95rem;
        }
        
        .endings-table th,
        .endings-table td {
            padding: 0.75rem;
            text-align: center;
            border: 1px solid var(--border);
        }
        
        .endings-table th {
            background: var(--primary);
            color: white;
            font-weight: 600;
        }
        
        .endings-table td:first-child {
            font-weight: 600;
            background: #f8fafc;
        }
        
        .endings-table .masc {
            background: rgba(6, 182, 212, 0.1);
            color: var(--masc);
            font-weight: 600;
        }
        
        .endings-table .fem {
            background: rgba(236, 72, 153, 0.1);
            color: var(--fem);
            font-weight: 600;
        }
        
        .endings-table .neut {
            background: rgba(245, 158, 11, 0.1);
            color: var(--neut);
            font-weight: 600;
        }
        
        .endings-table .plural {
            background: rgba(132, 204, 22, 0.1);
            color: var(--plural);
            font-weight: 600;
        }
        
        /* Exercise Styles */
        .exercise {
            background: var(--card);
            border-radius: 1rem;
            padding: 1.5rem;
            margin: 1.5rem 0;
            box-shadow: var(--shadow);
        }
        
        .exercise-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid var(--border);
        }
        
        .exercise-header h3 {
            color: var(--primary);
            margin: 0;
        }
        
        .exercise-progress {
            background: var(--border);
            padding: 0.25rem 0.75rem;
            border-radius: 1rem;
            font-size: 0.875rem;
            color: var(--text-light);
        }
        
        .exercise-item {
            padding: 1rem;
            margin: 0.75rem 0;
            background: #f8fafc;
            border-radius: 0.5rem;
            border: 1px solid var(--border);
        }
        
        .exercise-item .question {
            margin-bottom: 0.75rem;
            font-weight: 500;
        }
        
        .exercise-item .hint {
            font-size: 0.85rem;
            color: var(--text-light);
            margin-bottom: 0.5rem;
        }
        
        /* Input Styles */
        .input-group {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        
        .input-group input[type="text"] {
            padding: 0.5rem 0.75rem;
            border: 2px solid var(--border);
            border-radius: 0.375rem;
            font-size: 1rem;
            min-width: 150px;
            transition: border-color 0.2s;
        }
        
        .input-group input[type="text"]:focus {
            outline: none;
            border-color: var(--primary);
        }
        
        .input-group input.correct {
            border-color: var(--success);
            background: rgba(34, 197, 94, 0.1);
        }
        
        .input-group input.incorrect {
            border-color: var(--error);
            background: rgba(239, 68, 68, 0.1);
        }
        
        /* Select Dropdown */
        .select-group {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
        }
        
        .select-group select {
            padding: 0.5rem 2rem 0.5rem 0.75rem;
            border: 2px solid var(--border);
            border-radius: 0.375rem;
            font-size: 1rem;
            background: white;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.5rem center;
        }
        
        .select-group select:focus {
            outline: none;
            border-color: var(--primary);
        }
        
        .select-group select.correct {
            border-color: var(--success);
            background-color: rgba(34, 197, 94, 0.1);
        }
        
        .select-group select.incorrect {
            border-color: var(--error);
            background-color: rgba(239, 68, 68, 0.1);
        }
        
        /* Buttons */
        .btn {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 0.375rem;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .btn-primary {
            background: var(--primary);
            color: white;
        }
        
        .btn-primary:hover {
            background: var(--primary-dark);
        }
        
        .btn-success {
            background: var(--success);
            color: white;
        }
        
        .btn-success:hover {
            background: #16a34a;
        }
        
        .btn-check {
            background: var(--primary);
            color: white;
            margin-top: 0.5rem;
        }
        
        /* Feedback */
        .feedback {
            margin-top: 0.5rem;
            padding: 0.5rem 0.75rem;
            border-radius: 0.375rem;
            font-size: 0.9rem;
            display: none;
        }
        
        .feedback.show {
            display: block;
        }
        
        .feedback.correct {
            background: rgba(34, 197, 94, 0.1);
            color: #166534;
        }
        
        .feedback.incorrect {
            background: rgba(239, 68, 68, 0.1);
            color: #991b1b;
        }
        
        /* Checklist */
        .checklist {
            list-style: none;
        }
        
        .checklist li {
            padding: 0.75rem 0;
            padding-left: 2rem;
            position: relative;
            cursor: pointer;
            transition: all 0.2s;
            border-bottom: 1px solid var(--border);
        }
        
        .checklist li:hover {
            background: #f8fafc;
        }
        
        .checklist li::before {
            content: "☐";
            position: absolute;
            left: 0.5rem;
            color: var(--text-light);
            font-size: 1.2rem;
        }
        
        .checklist li.checked::before {
            content: "☑";
            color: var(--success);
        }
        
        .checklist li.checked {
            color: var(--text-light);
            text-decoration: line-through;
        }
        
        /* Connectivity Section */
        .connectivity {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin: 2rem 0;
        }
        
        .connectivity > div {
            background: var(--card);
            padding: 1.25rem;
            border-radius: 0.75rem;
            box-shadow: var(--shadow);
        }
        
        .connectivity h4 {
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        
        .connectivity p {
            color: var(--text-light);
            font-size: 0.95rem;
        }
        
        .from-prev {
            border-left: 4px solid var(--primary);
        }
        
        .to-next {
            border-right: 4px solid var(--success);
            text-align: right;
        }
        
        /* Either/Or Section */
        .either-or-box {
            background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
            border-radius: 0.75rem;
            padding: 1.25rem;
            margin: 1rem 0;
            border: 2px solid #fbbf24;
        }
        
        .either-or-box h4 {
            color: #92400e;
            margin-bottom: 0.75rem;
        }
        
        .either-or-list {
            list-style: none;
        }
        
        .either-or-list li {
            padding: 0.5rem 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .either-or-list .slash {
            color: #f59e0b;
            font-weight: bold;
        }
        
        /* Position Guide */
        .position-guide {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin: 1rem 0;
        }
        
        .position-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            background: #f8fafc;
            border-radius: 0.5rem;
            flex-wrap: wrap;
        }
        
        .position-item .rule {
            font-weight: 500;
            color: var(--text);
        }
        
        .position-item .example {
            font-family: monospace;
            background: white;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            color: var(--primary);
        }
        
        /* Translation exercise */
        .translation-hint {
            font-size: 0.85rem;
            color: var(--text-light);
            font-style: italic;
            margin-top: 0.25rem;
        }
        
        /* Mobile Responsive */
        @media (max-width: 768px) {
            .chapter-header h1 {
                font-size: 1.75rem;
            }
            
            .chapter-nav {
                flex-direction: column;
                text-align: center;
            }
            
            .chapter-nav a {
                width: 100%;
            }
            
            .connectivity {
                grid-template-columns: 1fr;
            }
            
            .to-next {
                text-align: left;
                border-right: none;
                border-left: 4px solid var(--success);
            }
            
            .endings-table {
                font-size: 0.8rem;
            }
            
            .endings-table th,
            .endings-table td {
                padding: 0.5rem 0.25rem;
            }
            
            .input-group {
                flex-direction: column;
                align-items: stretch;
            }
            
            .input-group input[type="text"] {
                width: 100%;
            }
        }
        
        /* Animation */
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        .pulse {
            animation: pulse 0.3s ease;
        }
        
        /* Success animation */
        @keyframes success-bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }
        
        .success-animate {
            animation: success-bounce 0.5s ease;
        }
