:root {
            --primary-color: #007bff;
            --light-bg: #222; /* Arka plan */
            --dark-text: #333;
            --border-color: #ddd;
            --vurgu-yesil: #28a745;
            --vurgu-kirmizi: #dc3545;
            --vurgu-sari: #ffc107;
        }

        body, button, select {
            font-family: 'Noto Naskh Arabic', 'Tahoma', sans-serif;
            line-height: 1.6;
        }
        body {
            background-color: var(--light-bg);
            color: var(--dark-text);
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100vw;
            height: 100vh;
            margin: 0;
            padding: 0;
            overflow: hidden; 
        }

        /* --- Ana Kapsayıcı (Varsayılan 16:9) --- */
        .activity-container {
            width: 95vw; 
            height: calc(95vw * 9 / 16);
            max-height: 95vh;
            max-width: calc(95vh * 16 / 9);
            margin: 0;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            display: flex; 
            flex-direction: column; 
            overflow: hidden;
            transition: all 0.3s ease;
        }
        
        /* --- Başlık ve Kontrol Alanı --- */
        .header {
            padding: 15px 20px;
            background-color: #fff;
            border-bottom: 2px solid var(--border-color);
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 15px;
            flex-shrink: 0;
        }
        
        .header h1 {
            text-align: left; margin: 0; color: var(--primary-color);
            flex-basis: 100%; order: 1; 
            font-size: 2em;
        }
        
        .secim-alani {
            display: flex; flex-direction: column; gap: 5px;
            flex-grow: 1; order: 2;
        }
        
        #sure-secici {
            font-size: 1.4em;
            padding: 8px;
            border-radius: 8px;
            border: 1px solid var(--border-color); width: 100%;
        }

        /* --- 4'lü Navigasyon Sekmeleri --- */
        .aktivite-nav {
            display: flex; background-color: #f1f1f1;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
        }
        
        .nav-btn {
            flex-grow: 1; padding: 12px 10px;
            cursor: pointer; border: none;
            background-color: transparent; 
            font-size: 1.2em;
            font-weight: 700;
            color: #555; transition: all 0.3s;
            border-bottom: 3px solid transparent;
        }
        
        .nav-btn:hover { background-color: #e9e9e9; }
        .nav-btn.aktif {
            color: var(--primary-color);
            border-bottom: 3px solid var(--primary-color);
            background-color: #fff;
        }

        /* --- Aktivite İçerik Alanı --- */
        .aktivite-penceresi {
            padding: 20px;
            flex-grow: 1;
            overflow-y: auto;
            background-color: #fdfdfd;
        }
        
        .mod-icerik { display: none; }
        .mod-icerik.aktif { display: block; animation: fadeIn 0.5s; }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* --- Ortak Stiller --- */
        .sirala-aciklama { text-align: center; font-size: 1.5em; margin-bottom: 15px; color: #555; }
        .sonuc-mesaji { text-align: center; font-size: 1.5em; font-weight: bold; margin-top: 15px; padding: 12px; border-radius: 8px; }
        .sonuc-mesaji.dogru { background-color: #d4edda; color: #155724; }
        .sonuc-mesaji.yanlis { background-color: #f8d7da; color: #721c24; }
        .kontrol-butonu { display: block; width: 50%; margin: 20px auto 0 auto; padding: 10px; font-size: 1.5em; font-weight: bold; background-color: var(--vurgu-yesil); color: white; border: none; border-radius: 8px; cursor: pointer; }
        .kart-navigasyon { display: flex; justify-content: space-between; align-items: center; margin: 15px auto 0 auto; width: 80%; }
        .kart-nav-btn { font-size: 1.4em; padding: 8px 16px; background-color: var(--primary-color); color: white; border: none; border-radius: 8px; cursor: pointer; }
        .kart-nav-btn:disabled { background-color: #aaa; }
        .kart-sayac { font-size: 1.4em; font-weight: 700; }

        /* --- MOD 1: Kelime Anlamı --- */
        #mod1-ayet-soru {
            font-size: 2.8em; 
            line-height: 1.8;
            text-align: right;
            direction: rtl; margin-bottom: 15px;
            background: #fff; border: 1px solid #eee;
            padding: 15px; border-radius: 8px;
            min-height: 80px;
        }
        #mod1-ayet-soru span.kelime {
            cursor: pointer; padding: 2px 4px; border-radius: 4px;
            transition: background-color 0.2s;
        }
        #mod1-ayet-soru span.kelime:hover, 
        #mod1-ayet-soru span.kelime.vurgulu {
            background-color: var(--vurgu-sari);
        }
        #anlam-kutusu {
            text-align: center; font-size: 2em;
            font-weight: bold; color: #0056b3;
            background-color: #e6f7ff; border: 2px dashed #0056b3;
            padding: 12px; border-radius: 8px; margin-top: 15px; min-height: 30px;
        }

        /* --- MOD 2: Meal Testi --- */
        #mod2-ayet-soru {
            font-size: 2.75em;
            font-weight: 700; line-height: 1.8;
            text-align: center; direction: rtl; background: #fff;
            padding: 8px; border-radius: 8px; border: 1px solid #eee;
            margin-bottom: 8px;
        }
        .test-secenekleri { display: flex; flex-direction: column; gap: 4px; }
        .test-secenek { 
            padding: 5px; border: 2px solid var(--border-color); 
            border-radius: 8px; cursor: pointer; 
            font-size: 1.5em;
            transition: all 0.2s; 
        }
        .test-secenek:hover { background-color: #f0f0f0; border-color: var(--primary-color); }
        .test-secenek.dogru { background-color: #d4edda; border-color: var(--vurgu-yesil); color: #155724; font-weight: bold; }
        .test-secenek.yanlis { background-color: #f8d7da; border-color: var(--vurgu-kirmizi); color: #721c24; }
        .test-secenek.disabled { pointer-events: none; opacity: 0.8; }
        #mod2-sonraki-btn { background-color: var(--primary-color); }

        /* --- MOD 3: Bilgi Kartları --- */
        #mod3-kart-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            grid-template-rows: repeat(3, 1fr);
            gap: 12px;
            height: 340px;
            perspective: 1000px;
        }
        
        .grid-kart {
            width: 100%; height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.6s;
            cursor: pointer;
            border-radius: 10px;
        }
        
        .grid-kart.cevrildi {
            transform: rotateY(180deg);
        }
        
        .kart-yuzu {
            position: absolute;
            width: 100%; height: 100%;
            backface-visibility: hidden;
            border-radius: 10px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 8px;
            box-sizing: border-box;
            border: 2px solid var(--border-color);
        }
        
        .kart-arka { /* Türkçe */
            background: #fff;
            transform: rotateY(180deg);
            font-size: 1.7em;
            color: var(--primary-color);
        }
        
        .kart-on { /* Arapça */
            background: #fff;
            color: var(--dark-text);
            font-size: 2.2em;
            font-weight: 700;
            direction: rtl;
        }
        
        #mod3-restart-btn {
            background-color: var(--vurgu-kirmizi);
            margin-top: 15px;
        }
        
        /* --- YENİ MOD 4: Ezber Modu --- */
        #mod4-ayet-soru {
            font-size: 5em; /* Büyük font */
            font-weight: 700;
            line-height: 1.8;
            text-align: right; /* Sağdan başlasın */
            direction: rtl;
            background: #fff;
            border: 1px solid #eee;
            padding: 20px;
            border-radius: 8px;
            min-height: 100px;
        }
        
        
        /* ========================================
           TAM EKRAN STİLLERİ
        ======================================== */
        #fullscreen-btn {
            background: #f0f0f0; color: #555; border: 1px solid #ccc; border-radius: 1.5vmin;
            cursor: pointer; width: clamp(40px, 8vmin, 55px); height: clamp(40px, 8vmin, 55px);
            padding: 0; display: flex; align-items: center; justify-content: center;
            margin-right: 10px; flex-shrink: 0; order: 3;
        }
        #fullscreen-btn:hover { background: #e0e0e0; }
        #fullscreen-btn svg { width: clamp(24px, 5vmin, 30px); height: clamp(24px, 5vmin, 30px); fill: currentColor; }
        #fullscreen-btn .icon-open { display: block; }
        #fullscreen-btn .icon-close { display: none; }
        body.fullscreen #fullscreen-btn .icon-open { display: none; }
        body.fullscreen #fullscreen-btn .icon-close { display: block; }
        body.fullscreen { background: #000; padding: 0; }
        body.fullscreen .activity-container {
            width: 100vw; height: calc(100vw * 9 / 16);
            max-height: 100vh; max-width: calc(100vh * 16 / 9);
            margin: 0; border-radius: 0; box-shadow: none;
        }
        
        /* --- Geri Tuşu (Header İçin) --- */
        .back-button-container {
            display: flex;
            order: 2;
        }
        .back-button {
            background: #f0f0f0;
            color: #555;
            border: 1px solid #ccc;
            border-radius: 1.5vmin;
            cursor: pointer;
            width: clamp(40px, 8vmin, 55px);
            height: clamp(40px, 8vmin, 55px);
            padding: 0;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .back-button:hover {
            background: #e0e0e0;
        }
        .back-button svg {
            width: clamp(24px, 5vmin, 30px);
            height: clamp(24px, 5vmin, 30px);
            fill: currentColor;
        }
        
        /* ========================================================
           YENİ: MOBİL PORTRE MODU (9:16) ve FONT KÜÇÜLTME
        ======================================================== */
        @media (orientation: portrait) {
            
            /* Fullscreen (100% ekran) için 9:16 ayarı */
            body.fullscreen .activity-container {
                width: 100vw; 
                height: calc(100vw * 16 / 9);
                max-height: 100vh; 
                max-width: calc(100vh * 9 / 16);
            }

            /* Normal (fullscreen olmayan) durum için 9:16 ayarı */
            body:not(.fullscreen) .activity-container {
                width: 95vw; 
                height: calc(95vw * 16 / 9); /* 9:16 en-boy oranı */
                max-height: 95vh;
                max-width: calc(95vh * 9 / 16);
            }

            /* Portre modundaki TÜM fontları küçült */
            .header h1 { 
                font-size: 1.5em; /* 2em'den küçültüldü */
            }
            #sure-secici { 
                font-size: 1.1em; /* 1.4em'den küçültüldü */
            }
            .nav-btn { 
                font-size: 0.9em; /* 1.2em'den küçültüldü */
                padding: 10px 5px; /* Sığdırmak için */
            }
            .sirala-aciklama { 
                font-size: 1.1em; /* 1.5em'den küçültüldü */
                margin-bottom: 10px;
            }
            .kontrol-butonu { 
                font-size: 1.2em; /* 1.5em'den küçültüldü */
                padding: 8px;
                width: 60%;
            }
            .kart-nav-btn, .kart-sayac { 
                font-size: 1.1em; /* 1.4em'den küçültüldü */
            }
            .aktivite-penceresi { 
                padding: 10px; /* İç boşluğu azalt */
            }
    
            /* --- MOD 1: Kelime Anlamı --- */
            #mod1-ayet-soru { 
                font-size: 1.8em; /* 2.8em'den küçültüldü */
                min-height: 60px;
            }
            #anlam-kutusu { 
                font-size: 1.4em; /* 2em'den küçültüldü */
                padding: 8px;
            }
    
            /* --- MOD 2: Meal Testi --- */
            #mod2-ayet-soru { 
                font-size: 1.75em; /* 3em'den küçültüldü */
                margin-bottom: 10px;
            }
            .test-secenek { 
                font-size: 1.1em; /* 1.5em'den küçültüldü */
                padding: 5px;
            }
    
            /* --- MOD 3: Bilgi Kartları --- */
            #mod3-kart-grid {
                /* 3x4 (12 kart) sığdırmak için ayar */
                grid-template-columns: repeat(3, 1fr);
                grid-template-rows: repeat(4, 1fr);
                gap: 8px;
                height: 320px; /* Yüksekliği ayarla */
            }
            .kart-on { /* Arapça */
                font-size: 1.5em; /* 2.2em'den küçültüldü */
            }
            .kart-arka { /* Türkçe */
                font-size: 1.2em; /* 1.7em'den küçültüldü */
            }
            
            /* --- MOD 4: Ezber Modu --- */
            #mod4-ayet-soru { 
                font-size: 2.5em; /* 5em'den küçültüldü */
                min-height: 80px;
            }
        }