:root {
            /* Case Colors */
            --nom: #3b82f6;
            --acc: #ef4444;
            --dat: #10b981;
            --gen: #8b5cf6;
            /* Gender Colors */
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            /* UI Colors */
            --bg: #f8fafc;
            --card: #ffffff;
            --text: #1e293b;
            --text-light: #64748b;
            --border: #e2e8f0;
            --success: #22c55e;
            --error: #ef4444;
            --warning: #f59e0b;
        }

        * {
            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;
            padding-bottom: 2rem;
        }

        /* Header & Navigation */
        .chapter-header {
            background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
            color: white;
            padding: 2rem 1rem;
            text-align: center;
        }

        .chapter-badge {
            display: inline-block;
            background: var(--acc);
            color: white;
            padding: 0.25rem 1rem;
            border-radius: 999px;
            font-size: 0.875rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 1rem;
        }

        .chapter-header h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .chapter-header p {
            color: #94a3b8;
            max-width: 600px;
            margin: 0 auto;
        }

        .chapter-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 900px;
            margin: 0 auto;
            padding: 1rem;
            background: rgba(255,255,255,0.1);
            border-radius: 12px;
            margin-top: 1.5rem;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .chapter-nav a {
            color: white;
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            transition: background 0.2s;
            font-size: 0.9rem;
        }

        .chapter-nav a:hover {
            background: rgba(255,255,255,0.2);
        }

        .progress-bar {
            background: rgba(255,255,255,0.2);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.875rem;
        }

        /* Main Content */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1rem;
        }

        /* Theory Cards */
        .theory-card {
            background: var(--card);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            border-left: 4px solid var(--border);
        }

        .theory-card.acc { border-left-color: var(--acc); }
        .theory-card.dat { border-left-color: var(--dat); }
        .theory-card.gen { border-left-color: var(--gen); }
        .theory-card.mixed { border-left: none; background: linear-gradient(135deg, #fef2f2 0%, #f0fdf4 100%); }

        .theory-card h2 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .theory-card h3 {
            font-size: 1.2rem;
            margin: 1.5rem 0 0.75rem;
            color: var(--text);
        }

        .theory-card p {
            margin-bottom: 1rem;
            color: var(--text-light);
        }

        /* Preposition Lists */
        .prep-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 0.75rem;
            margin: 1rem 0;
        }

        .prep-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: var(--bg);
            border-radius: 10px;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .prep-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .prep-word {
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--text);
        }

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

        /* Example Box */
        .example-box {
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            border-radius: 12px;
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            position: relative;
        }

        .example-box .german {
            font-size: 1.1rem;
            color: var(--text);
            margin-bottom: 0.25rem;
        }

        .example-box .english {
            color: var(--text-light);
            font-size: 0.95rem;
        }

        .audio-btn {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            background: white;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            transition: all 0.2s;
        }

        .audio-btn:hover {
            background: var(--acc);
            color: white;
            transform: translateY(-50%) scale(1.1);
        }

        /* Case Badges */
        .case-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .case-badge.acc { background: #fef2f2; color: var(--acc); }
        .case-badge.dat { background: #f0fdf4; color: var(--dat); }
        .case-badge.gen { background: #faf5ff; color: var(--gen); }

        /* Contractions Box */
        .contractions-box {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border-radius: 16px;
            padding: 1.5rem;
            margin: 1.5rem 0;
        }

        .contractions-box h3 {
            color: #92400e;
            margin-bottom: 1rem;
        }

        .contraction-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 0.75rem;
        }

        .contraction-item {
            background: white;
            padding: 0.75rem;
            border-radius: 8px;
            text-align: center;
        }

        .contraction-item .short {
            font-size: 1.25rem;
            font-weight: 700;
            color: #92400e;
        }

        .contraction-item .long {
            font-size: 0.85rem;
            color: #a16207;
        }

        /* Summary Table */
        .summary-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            background: var(--card);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

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

        .summary-table th {
            background: #f8fafc;
            font-weight: 600;
            color: var(--text);
        }

        .summary-table tr:last-child td {
            border-bottom: none;
        }

        /* Exercises */
        .exercise-section {
            background: var(--card);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .exercise-section h2 {
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .exercise-section .instructions {
            color: var(--text-light);
            margin-bottom: 1.5rem;
            font-size: 0.95rem;
        }

        /* Fill-in Exercise */
        .fill-item {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            padding: 1rem;
            background: var(--bg);
            border-radius: 10px;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }

        .fill-number {
            background: var(--acc);
            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;
        }

        .fill-text {
            flex: 1;
            min-width: 250px;
        }

        .fill-input {
            width: 100px;
            padding: 0.5rem 0.75rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            text-align: center;
            transition: border-color 0.2s;
        }

        .fill-input:focus {
            outline: none;
            border-color: var(--acc);
        }

        .fill-input.correct {
            border-color: var(--success);
            background: #f0fdf4;
        }

        .fill-input.incorrect {
            border-color: var(--error);
            background: #fef2f2;
        }

        /* Classification Exercise */
        .classify-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 1rem 0;
        }

        .classify-column {
            background: var(--bg);
            border-radius: 12px;
            padding: 1rem;
            min-height: 200px;
        }

        .classify-column h4 {
            font-size: 0.9rem;
            margin-bottom: 0.75rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid;
        }

        .classify-column.acc h4 { border-color: var(--acc); color: var(--acc); }
        .classify-column.dat h4 { border-color: var(--dat); color: var(--dat); }
        .classify-column.both h4 { 
            border-image: linear-gradient(90deg, var(--acc), var(--dat)) 1;
            color: var(--text);
        }
        .classify-column.gen h4 { border-color: var(--gen); color: var(--gen); }

        .classify-select {
            width: 100%;
            padding: 0.5rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        /* Ending Exercise */
        .ending-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            background: var(--bg);
            border-radius: 10px;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
        }

        .ending-input {
            width: 60px;
            padding: 0.4rem 0.5rem;
            border: 2px solid var(--border);
            border-radius: 6px;
            text-align: center;
            font-size: 0.95rem;
        }

        .gender-hint {
            font-size: 0.75rem;
            color: var(--text-light);
            background: white;
            padding: 0.15rem 0.5rem;
            border-radius: 4px;
        }

        /* Translation Exercise */
        .translation-item {
            padding: 1rem;
            background: var(--bg);
            border-radius: 10px;
            margin-bottom: 0.75rem;
        }

        .translation-prompt {
            font-weight: 500;
            margin-bottom: 0.5rem;
        }

        .translation-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
        }

        /* Checklist */
        .checklist {
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            border-radius: 16px;
            padding: 1.5rem;
        }

        .checklist h3 {
            color: #065f46;
            margin-bottom: 1rem;
        }

        .checklist-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid rgba(6, 95, 70, 0.1);
        }

        .checklist-item:last-child {
            border-bottom: none;
        }

        .checklist-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            accent-color: var(--dat);
            margin-top: 2px;
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        .btn-primary:hover {
            background: #dc2626;
            transform: translateY(-2px);
        }

        .btn-secondary {
            background: var(--bg);
            color: var(--text);
        }

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

        .btn-group {
            display: flex;
            gap: 0.75rem;
            margin-top: 1.5rem;
            flex-wrap: wrap;
        }

        /* Feedback */
        .feedback {
            padding: 0.75rem 1rem;
            border-radius: 8px;
            margin-top: 0.5rem;
            font-size: 0.9rem;
            display: none;
        }

        .feedback.show {
            display: block;
        }

        .feedback.correct {
            background: #f0fdf4;
            color: #166534;
        }

        .feedback.incorrect {
            background: #fef2f2;
            color: #991b1b;
        }

        /* Score Display */
        .score-display {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .score-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--nom);
        }

        /* Streak Counter */
        .streak-counter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            padding: 0.5rem 1rem;
            border-radius: 999px;
            font-weight: 600;
            color: #92400e;
        }

        /* Bridge Section */
        .connectivity {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1rem;
            margin-top: 2rem;
        }

        .connectivity > div {
            padding: 1.25rem;
            border-radius: 12px;
        }

        .from-prev {
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
        }

        .to-next {
            background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
        }

        .connectivity h4 {
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .from-prev h4 { color: #3730a3; }
        .to-next h4 { color: #9d174d; }

        .connectivity p {
            font-size: 0.9rem;
            color: var(--text);
        }

        /* Wechselpräpositionen Visual */
        .wechsel-visual {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin: 1rem 0;
        }

        .wechsel-box {
            padding: 1.25rem;
            border-radius: 12px;
            text-align: center;
        }

        .wechsel-box.acc {
            background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
        }

        .wechsel-box.dat {
            background: linear-gradient(135deg, #f0fdf4 0%, #bbf7d0 100%);
        }

        .wechsel-box h4 {
            margin-bottom: 0.5rem;
        }

        .wechsel-box.acc h4 { color: var(--acc); }
        .wechsel-box.dat h4 { color: var(--dat); }

        .wechsel-icon {
            font-size: 2rem;
            margin: 0.5rem 0;
        }

        /* Responsive */
        @media (max-width: 640px) {
            .chapter-header h1 {
                font-size: 1.5rem;
            }

            .chapter-nav {
                flex-direction: column;
                text-align: center;
            }

            .wechsel-visual {
                grid-template-columns: 1fr;
            }

            .fill-item {
                flex-direction: column;
            }

            .fill-input {
                width: 100%;
            }
        }

        /* Tips Box */
        .tips-box {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            border-radius: 12px;
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            border-left: 4px solid var(--nom);
        }

        .tips-box h4 {
            color: #1e40af;
            margin-bottom: 0.5rem;
        }

        .tips-box ul {
            margin-left: 1.25rem;
            color: var(--text);
        }

        .tips-box li {
            margin-bottom: 0.25rem;
        }

        /* Highlight */
        .highlight-acc { color: var(--acc); font-weight: 600; }
        .highlight-dat { color: var(--dat); font-weight: 600; }
        .highlight-gen { color: var(--gen); font-weight: 600; }
