@font-face { font-family: 'Arakom'; src: url('../arakom.ttf') format('truetype'); font-display: swap; }
:root {
            --soft-blue: #e3f2fd;
            --soft-green: #e8f5e9;
            --soft-red: #ffebee;
            --soft-yellow: #fffde7;
            --text-dark: #37474f;
            --text-light: #546e7a;
            --border-color: #eceff1;
            --accent-blue: #0d6efd; 
            --accent-green: #198754; 
            --accent-red: #dc3545; 
            --accent-pink: #e91e63; 
            --accent-cyan-blue: #00bcd4; 
            
            --correct-bg: #d1e7dd; 
            --incorrect-bg: #f8d7da; 
            --correct-border: #a3cfbb;
            --incorrect-border: #f1aeae;
            --progress-inactive: #cfd8dc; 
        }

        html { height: 100%; }
        body {
            font-family: 'Arakom', "Marhey", sans-serif !important;
            direction: ltr !important;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 100dvh;
            background-color: #f7f9fc;
            color: var(--text-dark);
            line-height: 1.5;
            padding: 0.5rem;
            box-sizing: border-box;
            overflow-y: auto;
        }

        #game-container {
            width: 100%;
            max-width: 1100px;
            padding: 0;
            text-align: center;
            position: relative;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }

        /* Türkçe Font ve Yön Kuralları */
        h1, h3, h4, #timer-display, #start-game-button, #selection-screen h3, .turkish-meaning, .question-title,
        #difficulty-buttons button, #player-mode-buttons button, .options-container button, #proceed-button, .progress-step,
        .top-left-button { 
             font-family: 'Arakom', "Marhey", sans-serif !important;
             font-synthesis: none;
             direction: ltr !important;
        }
        /* Arapça Font ve Yön Kuralları */
        .arabic-word, .options-container .ar, .options-container button span.ar {
             font-family: 'Arakom', 'Noto Naskh Arabic', "Harmattan", serif !important;
             font-weight: normal !important;
             font-synthesis: none;
             direction: rtl !important;
        }


        h1 { font-size: 1.8rem; margin-bottom: 0.5rem; font-weight: 600;}
        h3 { color: var(--text-light); font-size: 1.1rem; }
        h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem;}

        /* Başlangıç Ekranları */
        #selection-screen {
             max-width: 400px;
             margin-top: auto;
             margin-bottom: auto;
             margin-left: auto;
             margin-right: auto;
             padding: 1rem;
             position: relative;
             width: 100%;
             /* YENİ (HATA DÜZELTMESİ): z-index eklendi */
             z-index: 30;
        }
        #difficulty-selection, #player-mode-selection {
            margin-top: 1rem;
        }
        #difficulty-selection h3, #player-mode-selection h3 {
             margin-bottom: 0.6rem;
        }
        #difficulty-buttons, #player-mode-buttons {
            display: flex; flex-direction: column; gap: 8px;
            margin-top: 0.6rem;
        }
        #difficulty-buttons button, #player-mode-buttons button {
            background-color: #fff;
            border: 1px solid var(--border-color);
            color: var(--text-light);
            padding: 10px 18px;
            font-size: 1.1rem;
            font-weight: 500;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }
        #difficulty-buttons button:hover, #player-mode-buttons button:hover {
            background-color: #f8f9fa;
            border-color: #cfd8dc;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
        }

        #difficulty-buttons button[data-time="60"] { color: var(--accent-green); }
        #difficulty-buttons button[data-time="40"] { color: #f57c00; }
        #difficulty-buttons button[data-time="20"] { color: #d32f2f; }

        .button-selected {
            background-color: var(--accent-blue) !important;
            border-color: var(--accent-blue) !imporant;
            color: white !important;
            transform: none !important;
            box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3) !important;
        }
        .button-selected:hover {
             background-color: var(--accent-blue) !important;
             border-color: var(--accent-blue) !important;
        }

        #start-game-button {
            background-color: var(--accent-green);
            color: white;
            border: none;
            padding: 12px 28px;
            font-size: 1.3rem;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 1.5rem;
            width: 100%;
            box-shadow: 0 4px 10px rgba(25, 135, 84, 0.3);
        }
        #start-game-button:hover {
            background-color: #157347;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(25, 135, 84, 0.4);
        }
        #start-game-button:disabled {
            background-color: #a3cfbb;
            color: #f8f9fa;
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
        }
        
        #proceed-button {
            background-color: var(--accent-green);
            color: white;
            border: none;
            padding: 12px 28px;
            font-size: 1.3rem;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 1rem; 
            box-shadow: 0 4px 10px rgba(25, 135, 84, 0.3);
        }
        #proceed-button:hover {
            background-color: #157347;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(25, 135, 84, 0.4);
        }
        
        #proceed-container { 
            position: absolute; 
            bottom: 2rem; 
            left: 50%;
            transform: translateX(-50%); 
            z-index: 20; 
            width: 100%;
            max-width: 400px; 
            padding: 0 1rem; 
            box-sizing: border-box; 
        }
        #proceed-container button {
             width: 100%; 
        }


        /* --- Oyun Alanı Genel --- */
        #game-area {
            width: 100%;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            padding: 0.5rem;
            position: relative; 
            /* YENİ (HATA DÜZELTMESİ): z-index eklendi */
            z-index: 10;
        }
        #players-container {
            display: flex;
            gap: 1rem;
            flex-grow: 1;
            position: relative; 
        }
        body.mode-1p #players-container {
            justify-content: center;
        }
        
        body.mode-2p #players-container::after {
            content: '';
            position: absolute;
            top: 1rem;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            width: 1px;
            background-color: var(--border-color);
        }

        .player-area {
            padding: 0.5rem;
            margin-bottom: 0;
            flex: 1;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
         .player-area#player2-area.hidden { display: none; }
         body.mode-2p #player1-area { padding-right: 1.5rem; }
         body.mode-2p #player2-area { padding-left: 1.5rem; }
         
         body.mode-1p #player1-area {
             padding-right: 0.5rem; 
             max-width: 600px; 
         }


        /* İlerleme Çubuğu Stilleri */
        .progress-bar-container {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            max-width: 300px;
            margin-bottom: 1rem;
            flex-shrink: 0;
        }
        .progress-step {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: #fff;
            border: 2px solid var(--progress-inactive);
            color: var(--progress-inactive);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: 600;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
        }
        .progress-line {
            flex: 1;
            height: 3px;
            background-color: var(--progress-inactive);
            transition: background-color 0.3s ease;
        }
        /* Durumlar */
        .progress-step.active {
            border-color: var(--accent-blue);
            color: var(--accent-blue);
            transform: scale(1.1);
        }
        .progress-step.completed {
            border-color: var(--accent-green);
            background-color: var(--accent-green);
            color: #fff;
        }
        .progress-step.incorrect {
            border-color: var(--accent-red);
            background-color: var(--accent-red);
            color: #fff;
        }
        .progress-step.active ~ .progress-line { background-color: var(--progress-inactive); }
        .progress-step.active ~ .progress-step { border-color: var(--progress-inactive); color: var(--progress-inactive); }
        
        .progress-step.completed + .progress-line { background-color: var(--accent-green); }
        .progress-step.incorrect + .progress-line { background-color: var(--accent-red); }
        /* --- İlerleme Çubuğu Bitişi --- */


        /* Oyun İçi Elementler */
        .word-display {
            margin: 0.5rem 0 1rem 0;
            padding: 0;
            width: 100%;
        }
        .arabic-word {
            font-size: clamp(3rem, 10vw, 5.5rem);
            font-weight: 600;
            color: var(--text-dark);
            line-height: 1.1;
            margin-bottom: 1rem; 
        }
        body.mode-1p .arabic-word {
             font-size: clamp(3.5rem, 12vw, 6.5rem);
        }
        
        .turkish-meaning {
            font-size: 1.2rem; 
            color: var(--text-light);
            margin-top: 0.2rem;
            background-color: #ffffff;
            padding: 4px 12px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            display: inline-block;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        #timer-display {
            font-size: 1.4rem; font-weight: 600;
            color: var(--text-light);
            margin-bottom: 0.8rem;
            flex-shrink: 0;
            position: absolute;
            top: 1rem;
            right: 1rem;
            background-color: rgba(255,255,255,0.7);
            padding: 3px 10px;
            border-radius: 20px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .question-title {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-light);
            flex-shrink: 0;
        }
        .options-container {
            display: grid; gap: 0.75rem;
            grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            width: 100%;
            max-width: 500px;
            padding-bottom: 0.5rem;
            margin-top: 0;
        }
        body.mode-1p .options-container {
            max-width: 600px;
        }
        
         .options-container.q4-grid {
             grid-template-columns: repeat(3, 1fr);
             max-width: 600px;
         }

        .options-container button {
            background-color: #ffffff;
            border: 1px solid var(--border-color);
            color: var(--text-dark);
            padding: 10px;
            font-size: 1.2rem; 
            font-weight: 500;
            border-radius: 1rem;
            cursor: pointer;
            transition: all 0.15s ease-out;
            display: flex;
            flex-direction: column;
            align-items: center; justify-content: center;
            line-height: 1.3;
            min-height: 70px; 
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
            word-break: break-word;
            position: relative;
            overflow: hidden;
        }
        .options-container button:hover {
            background-color: #f8f9fa;
            border-color: #cfd8dc;
            transform: translateY(-2px);
            box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
        }
        .options-container button:active {
            transform: translateY(0px);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
        }
        .options-container button span.ar {
             display: block;
        }

        /* İpuçları */
        .hint-icon {
            font-size: 0.75em;
            color: #78909c;
            font-weight: normal;
            margin-top: 2px;
            display: inline-flex;
            align-items: center;
        }
        .hint-pink .hint-icon,
        .hint-blue .hint-icon {
             color: #ffffff;
             opacity: 0.8;
        }
        
        .hint-icon .al-hint {
             font-weight: 600; color: #546e7a; font-size: 1.1em; margin-right: 2px;
        }
        .hint-icon .num-hint {
             font-size: 1.2em; font-weight: 600; color: #607d8b; line-height: 1;
        }
        .hint-pink .hint-icon .al-hint,
        .hint-blue .hint-icon .al-hint,
        .hint-pink .hint-icon .num-hint,
        .hint-blue .hint-icon .num-hint {
             color: #ffffff;
        }
        
        .button-correct:not(.hint-pink):not(.hint-blue) .hint-icon,
        .button-correct:not(.hint-pink):not(.hint-blue) .hint-icon .al-hint,
        .button-correct:not(.hint-pink):not(.hint-blue) .hint-icon .num-hint {
            color: #ffffff !important;
            opacity: 0.9;
        }

        .button-incorrect:not(.hint-pink):not(.hint-blue) .hint-icon,
        .button-incorrect:not(.hint-pink):not(.hint-blue) .hint-icon .al-hint,
        .button-incorrect:not(.hint-pink):not(.hint-blue) .hint-icon .num-hint {
            color: #ffffff !important;
            opacity: 0.9;
        }
        
        
        .options-container button.hint-pink { 
            background-color: var(--accent-pink); 
            color: white; 
            border-color: var(--accent-pink); 
        }
        .options-container button.hint-pink:hover {
             background-color: #c2185b; 
             border-color: #c2185b;
        }
        
        .options-container button.hint-blue { 
            background-color: var(--accent-cyan-blue); 
            color: white; 
            border-color: var(--accent-cyan-blue); 
        }
        .options-container button.hint-blue:hover {
             background-color: #0097a7; 
             border-color: #0097a7;
        }
        /* --- Pembe/Mavi Bitişi --- */

        /* --- 4. SORU STİLLERİ --- */
        .options-container button.q4-option {
            font-size: 0.9rem; font-weight: 600;
            padding: 8px 5px; min-height: 75px;
        }
        .options-container .ar {
            font-size: 2rem;
            font-weight: 700; line-height: 1;
            margin-top: 5px;
        }
        /* Q4: hareke/ek daha buyuk, bold degil */
        .options-container.q4-grid button span.ar { font-size: 1.9rem; font-weight: 400; }
        .options-container.q4-grid button.hint-blue,
        .options-container.q4-grid button.hint-pink {
             background-color: #fff;
             color: var(--text-dark);
        }
        .options-container.q4-grid .hint-icon .al-hint,
         .options-container.q4-grid .hint-icon .num-hint {
             color: #607d8b;
         }
        
        .options-container button.hint-q4-green { border-color: var(--accent-green); color: #146c43; }
        .options-container.q4-grid button.hint-q4-blue { border-color: var(--accent-blue); color: #0a58ca; }
        .options-container.q4-grid button.hint-q4-pink { border-color: #f48fb1; color: #c2185b; }
        
        .options-container.q4-grid button.hint-blue:hover,
        .options-container.q4-grid button.hint-pink:hover {
             background-color: #f8f9fa;
        }
        /* --- 4. SORU STİLLERİ BİTİŞİ --- */

        /* Canlı Dolgu Renkleri */
        
        .button-correct:not(.hint-pink):not(.hint-blue) { 
            background-color: var(--accent-green) !important; 
            border-color: var(--accent-green) !important; 
            color: #ffffff !important; 
        }
        
        .button-incorrect:not(.hint-pink):not(.hint-blue) { 
            background-color: var(--accent-red) !important; 
            border-color: var(--accent-red) !important; 
            color: #ffffff !important; 
        }

        .button-correct {
            transition-duration: 0.5s !important; 
        }

        .button-incorrect { 
            animation: shake 0.6s; 
            transition-duration: 0.5s !important; 
        }
        
        @keyframes shake { 0%, 100% { transform: translateX(0); } 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

        
        .top-left-button {
            position: fixed;
            top: 1rem;
            left: 1rem;
            width: 46px; height: 46px;
            display: flex; align-items: center; justify-content: center;
            background-color: #ffffff;
            color: #16A085;
            border: 1px solid #E9EEF5;
            padding: 0;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s;
            z-index: 1000;
            box-shadow: 0 3px 10px rgba(44, 62, 80, 0.1);
        }
        .top-left-button svg { width: 24px; height: 24px; display: block; }
        .top-left-button:hover {
            background-color: #16A085;
            color: #ffffff;
            border-color: #16A085;
            transform: translateX(-2px);
            box-shadow: 0 5px 14px rgba(22, 160, 133, 0.35);
        }
        .top-left-button:active { transform: translateX(-2px) scale(0.94); }


        /* YENİ (HATA DÜZELTMESİ): !important eklendi */
        .hidden { display: none !important; }

        /* Masaustu: tam ekran kullanim + okunurluk */
        @media (min-width: 769px) {
            #game-container { max-width: 1400px; }
            #selection-screen { max-width: 540px; }
            #difficulty-selection, #player-mode-selection { margin-top: 1.75rem; }
            #selection-screen h3, #difficulty-selection h3, #player-mode-selection h3 { font-size: 1.5rem; margin-bottom: 0.9rem; }
            #difficulty-buttons, #player-mode-buttons { gap: 12px; }
            #difficulty-buttons button, #player-mode-buttons button { font-size: 1.5rem; padding: 16px 24px; border-radius: 16px; }
            #start-game-button { font-size: 1.75rem; padding: 16px 44px; }
            .top-left-button { top: 1.2rem; left: 1.2rem; width: 48px; height: 48px; }
            h1 { font-size: 2.6rem; }
            .question-title { font-size: 1.9rem; margin-bottom: 0.75rem; }
            .turkish-meaning { font-size: 1.9rem; }
            .arabic-word { font-size: clamp(4.5rem, 8vw, 7.5rem); }
            #timer-display { font-size: 2.2rem; }
            .options-container { max-width: 1050px; gap: 1.5rem; }
            body.mode-1p .options-container { max-width: 1150px; }
            .options-container.q4-grid { max-width: 1150px; }
            .options-container button { font-size: 1.7rem; min-height: 120px; padding: 20px; border-radius: 1.25rem; }
            .options-container.q4-grid button span.ar { font-size: 2.4rem; font-weight: 400; }
        }

        /* Mobil Dikey Mod (9:16) */
        @media (max-width: 768px) {
            body { padding: 0.3rem; }
            #game-container { padding: 0; }
            #selection-screen { padding: 0.5rem; }
            #game-area { padding: 0.3rem; }
            #players-container { flex-direction: column; gap: 0.5rem; }
            body.mode-2p #players-container::after { display: none; }
            .player-area { padding: 0.3rem; }
            body.mode-2p #player1-area, body.mode-2p #player2-area { padding-right: 0.3rem; padding-left: 0.3rem; }
            
            body.mode-1p #player1-area { max-width: none; }
            body.mode-1p .options-container { max-width: 95%; }
            body.mode-1p .arabic-word { font-size: clamp(2.5rem, 12vw, 4rem); } 

             h1 { font-size: 1.5rem; }
             h3 { font-size: 1rem; }
             .arabic-word { font-size: clamp(2.5rem, 12vw, 4rem); margin-bottom: 0.5rem; }
             .turkish-meaning { font-size: 1rem; padding: 3px 10px;}
             .question-title { font-size: 1rem; margin-bottom: 0.5rem; }
             #timer-display { font-size: 1rem; padding: 2px 8px; top: 0.6rem; right: 0.6rem; }
             .options-container { gap: 0.5rem; max-width: 95%; }
             .options-container button { font-size: 1.1rem; padding: 8px; min-height: 60px; border-radius: 0.8rem;}
             .options-container button.q4-option { min-height: 60px; font-size: 0.75rem;}
             .options-container .ar { font-size: 1.8rem; margin-top: 3px; } 
             
             .top-left-button {
                 width: 40px; height: 40px; padding: 0; 
                 top: 0.6rem; 
                 left: 0.6rem;
             }
             
             #start-game-button { font-size: 1.2rem; padding: 10px 22px; }
             
             #proceed-button { font-size: 1.2rem; padding: 10px 22px; } 
             #proceed-container { 
                 bottom: 1rem;
                 max-width: 100%;
                 padding: 0 0.5rem;
             }
        }
         
        /* Mobil Yatay Mod (16:9) */
        @media (max-height: 500px) and (orientation: landscape) {
             body { 
                 padding: 0.2rem; 
                 overflow-x: hidden; 
             }
             #game-area {
                 padding-top: 2.5rem; 
             }
             
            body.mode-1p #player1-area { max-width: none; }
            body.mode-1p .options-container { max-width: 100%; }
            body.mode-1p .arabic-word { font-size: clamp(2rem, 10vh, 2.8rem); } 
             
             h1 { font-size: 1.3rem; margin-bottom: 0.2rem; }
             h3 { font-size: 0.9rem; }
             
             .progress-bar-container { margin-bottom: 0.5rem; max-width: 250px; }
             .progress-step { width: 22px; height: 22px; font-size: 0.8rem; border-width: 2px;}
             .progress-line { height: 2px; }

             #players-container { 
                 flex-direction: row; 
                 gap: 0.5rem; 
                 align-items: flex-start; 
             }
             body.mode-2p #players-container::after { display: block; top: 0.5rem; bottom: 0.5rem; }
             
             .player-area { padding: 0.2rem; }
             body.mode-2p #player1-area { padding-right: 1rem; }
             body.mode-2p #player2-area { padding-left: 1rem; }
             
             .word-display { margin-bottom: 0.5rem; }

             .arabic-word { 
                 font-size: clamp(2rem, 10vh, 2.8rem); 
                 margin-bottom: 0.3rem; 
             }
             .turkish-meaning { font-size: 0.9rem; padding: 2px 8px;} 
             .question-title { font-size: 0.9rem; margin-bottom: 0.3rem; }
             
             #timer-display { 
                 font-size: 0.9rem; padding: 1px 6px; 
                 top: 0.4rem; right: 0.4rem; 
             }
             
             .top-left-button {
                 width: 36px; height: 36px; padding: 0;
                 top: 0.4rem;
                 left: 0.4rem;
             }
             .top-left-button svg { width: 19px; height: 19px; }
             
             .options-container { 
                 gap: 0.4rem; 
                 grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
             }
             .options-container button { 
                 font-size: 0.9rem; padding: 6px; 
                 min-height: 45px; 
                 border-radius: 0.7rem;
             }
             .options-container button.q4-option { 
                 min-height: 50px; 
                 font-size: 0.7rem;
             }
             .options-container .ar { font-size: 1.5rem; } 

             #proceed-container { 
                 position: static; 
                 transform: none;
                 max-width: 400px;
                 margin: 0.5rem auto 0.2rem auto; 
                 padding: 0 0.5rem;
             }
             #proceed-button { 
                 font-size: 1rem; 
                 padding: 8px 18px;
                 margin-top: 0;
             }
        }


        /* Sarf ekleri renklendirme */
        .sarf-al { color: #1a9c4a; }
        .sarf-ta { color: #e0218a; }
        .sarf-ek { color: #1565c0; }