/* ==========================================================================
   Slovra - CANLI OYUN STİLLERİ (GAME.CSS) - FİNAL REVİZE (FULL DOSYA)
   ========================================================================== */

/* --- 1. ANİMASYONLAR --- */
@keyframes ringScale { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes slideInRank { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.pulse-ring {
    width: 60px; height: 60px; border-radius: 50%;
    border: 4px solid var(--color-green);
    margin: 0 auto 20px auto;
    animation: ringScale 2s infinite ease-out;
}

/* --- 2. GİRİŞ EKRANI (LOBBY) --- */
.live-join-box {
    background: var(--card-bg);
    padding: 30px 20px !important;
    width: 90% !important;
    max-width: 350px !important; /* Varsayılan Mobil Genişlik */
    border-radius: 24px !important;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important;
    margin: 30px auto !important;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
    /* Genişliği 350px'den 600px'e çıkarıyoruz */
        max-width: 600px !important;
}

/* 2. LIGHT MODE (BEYAZ TEMA) UYUMU */
body.light-mode .live-join-box, 
body.light .live-join-box {
    /* Arka planı bembeyaz yap */
    background: #ffffff !important;
    
    /* Kenarlığı gri yap */
    border: 1px solid #e2e8f0 !important;
    
    /* Gölgeyi yumuşat (Siyah değil gri gölge) */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1) !important;
    
    /* Yazı rengini koyulaştır */
    color: #1e293b !important;
}

/* Başlık rengini koyu yap (Görünmez olmaması için) */
body.light-mode .live-join-box h1,
body.light .live-join-box h1 {
    color: #0f172a !important;
}

/* İçindeki PIN Inputunu beyaz moda uyarla */
body.light-mode #live-pin-input,
body.light #live-pin-input {
    background: #f1f5f9 !important; /* Hafif gri zemin */
    color: #334155 !important;      /* Koyu yazı */
    border-color: #cbd5e1 !important;
}

/* Inputa tıklayınca kenarlık yeşil olsun */
body.light-mode #live-pin-input:focus,
body.light #live-pin-input:focus {
    background: #ffffff !important;
    border-color: var(--color-green) !important;
}


.live-join-box h1 { font-size: 22px !important; margin-bottom: 15px !important; }

#live-pin-input {
    font-size: 28px !important;
    letter-spacing: 6px !important;
    text-align: center !important;
    font-weight: 900 !important;
    background: rgba(0,0,0,0.2) !important;
    border: 3px solid var(--color-cyan) !important;
    padding: 10px !important;
    height: 60px !important;
    border-radius: 18px !important;
    color: var(--color-cyan) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 10px 0 20px 0 !important;
    transition: 0.3s;
}
#live-pin-input:focus { 
    border-color: var(--color-green) !important; 
    box-shadow: 0 0 15px rgba(88, 204, 2, 0.3); 
}

#waiting-pin-display {
    font-size: 48px !important; font-weight: 900;
    margin: 10px 0 30px 0 !important; color: #fff;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#student-wait-msg {
    color: var(--color-cyan) !important; font-size: 16px !important;
    margin-top: 20px !important; opacity: 0.8;
    animation: floatY 3s ease-in-out infinite;
}

/* --- 3. SÜRE BARI (YAPIŞKAN) --- */
#live-timer-wrapper {
    position: sticky; top: 75px; z-index: 60;
    background: rgba(255, 255, 255, 0.05) !important;
    width: 100%; height: 8px !important;
    border-radius: 4px; overflow: hidden; margin-bottom: 0;
}
#live-timer-bar {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff) !important;
    box-shadow: 0 0 10px #00c6ff; border-radius: 4px;
}

/* --- 4. OYUN ALANI & SORU METNİ --- */
#live-game-ui { padding-bottom: 120px !important; }

#live-q-text-container {
    min-height: auto !important; padding: 15px 10px !important; flex: 0 !important;
}
#live-q-text {
    font-size: 22px !important; margin: 10px 0 !important; font-weight: 900; line-height: 1.3;
}

/* --- 5. ŞIKLAR IZGARASI (GRID) --- */
#live-options-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 0 10px 80px 10px !important;
    max-width: 600px; margin: 0 auto;
    width: 100% !important;
    box-sizing: border-box;
}

/* --- 6. ŞIK KARTLARI --- */
.live-opt-card {
    min-height: 60px !important; padding: 10px !important;
    font-size: 16px !important; border-radius: 14px !important;
    font-weight: 800; color: white; text-align: center; cursor: pointer;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    line-height: 1.2; transition: transform 0.1s; pointer-events: auto !important;
    width: 100% !important; box-sizing: border-box;
}
.live-opt-card:active { transform: translateY(4px); box-shadow: none; }

.live-color-0 { background: #e21b3c; }
.live-color-1 { background: #1368ce; }
.live-color-2 { background: #d89e00; }
.live-color-3 { background: #26890c; }

/* Kilitli Durumlar */
#live-options-grid[style*="pointer-events: none"] .live-opt-card, 
.dimmed-card { 
    opacity: 0.3 !important; 
    pointer-events: none !important; 
}

/* SÜRE BİTİMİ */
.grid-disabled-timeout .live-opt-card { 
    opacity: 0.7 !important; 
    filter: grayscale(90%); 
    pointer-events: none !important; 
}

/* --- 7. GERİ BİLDİRİM EFEKTLERİ --- */
.selected-waiting {
    opacity: 1 !important; transform: scale(0.98);
    border: 3px solid #fff !important; box-shadow: 0 0 15px rgba(255,255,255,0.4);
}
.selected-waiting::after { content: "⏳"; display: block; font-size: 14px; margin-left: 5px; }

.correct-instant {
    background-color: #d7ffb8 !important; border: 3px solid #58cc02 !important; color: #58cc02 !important;
    opacity: 1 !important; transform: scale(1.02); box-shadow: 0 0 15px rgba(88, 204, 2, 0.6) !important;
}
.correct-instant::after { content: "✅"; display: block; margin-left: 5px; }

.wrong-instant {
    background-color: #ffdfe0 !important; border: 3px solid #ff4b4b !important; color: #ff4b4b !important;
    opacity: 1 !important; transform: scale(0.95);
}
.wrong-instant::after { content: "❌"; display: block; margin-left: 5px; }

/* Cevap Gizleme (Öğretmen Modu) */
.blur-answer-mode .live-opt-card { border: none !important; opacity: 1 !important; }
.blur-answer-mode .checkmark-icon { display: none !important; }
.blur-answer-mode .live-opt-card.correct-answer-card::after {
    content: "★"; position: absolute; top: 5px; right: 10px; font-size: 10px; color: rgba(255,255,255,0.3);
}

/* --- 8. AÇIK UÇLU SORU --- */
.open-question-wrapper {
    grid-column: 1 / -1 !important;
    width: 90% !important; max-width: 500px !important;
    margin: 20px auto !important;
    transform: translateX(-17px) !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; text-align: center !important;
    box-sizing: border-box !important;
}

#live-text-answer, #submit-text-btn {
    width: 100% !important; max-width: 100% !important; 
    margin: 0 auto 15px auto !important; display: block !important;
    box-sizing: border-box;
}

/* --- 9. OYUNCU LİSTESİ (CHIPS) --- */
#live-player-list, #live-game-player-list {
    display: flex !important; flex-wrap: wrap !important; justify-content: center !important; gap: 8px !important;
}
#live-game-player-list > div, #live-player-list > div {
    padding: 5px 12px !important; font-size: 12px !important;
    border-radius: 20px !important; background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #ddd; white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.player-answered-badge {
    background: var(--color-green) !important; border-color: var(--color-green) !important; color: white !important;
}

/* --- 10. ÖĞRETMEN KONTROLLERİ --- */
#teacher-controls {
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 30px;
    transform: translateY(-20px);
    width: 90% !important; max-width: 350px; /* Varsayılan */
    margin: 20px auto !important;
}

.teacher-header { text-align: center; margin-bottom: 25px; }
.teacher-title {
    color: #ffffff; font-weight: 900; font-size: 1.4rem; margin: 0;
    text-transform: uppercase; letter-spacing: 1px; text-shadow: 0px 4px 10px rgba(0,0,0,0.5);
}
.teacher-separator {
    height: 4px; width: 60px; background-color: var(--color-cyan);
    margin: 10px auto; border-radius: 2px;
}
.teacher-subtitle { color: #00ff0d; font-size: 1rem; font-weight: 500; }

/* ========================================================
   ÖĞRETMEN BAŞLAT BUTONU DÜZELTMESİ (GİZLENME SORUNU FIX)
   ======================================================== */

/* 1. Sadece "hidden" sınıfı YOKSA göster */
#teacher-start-btn:not(.hidden) {
    /* Fixed yerine Relative yapıyoruz ki içeriğin altına insin */
    position: relative !important; 
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    
    /* Ortalama ve boşluk ayarları */
    width: 90% !important; 
    max-width: 350px !important;
    margin: 30px auto 50px auto !important; /* Üstten ve alttan boşluk bırak */
    
    /* Görünürlük ayarları - SADECE hidden değilse flex uygula */
    display: flex !important; 
    justify-content: center !important;
    align-items: center !important; 
    z-index: 100 !important;
    pointer-events: auto !important;
}

#teacher-start-btn button {
    width: 100% !important; 
    display: block !important;
    border-radius: 50px !important; 
    font-size: 18px !important; 
    padding: 15px !important;
    box-shadow: 0 10px 30px rgba(88, 204, 2, 0.5) !important;
    animation: floatY 2s ease-in-out infinite;
}

/* 2. Eğer "hidden" sınıfı varsa KESİNLİKLE gizle */
#teacher-start-btn.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* --- ÖĞRETMEN YÜZEN KONTROLLER (SONRAKİ SORU vs.) --- */
#teacher-next-q-btn {
    position: fixed !important; bottom: 90px !important;
    left: 50% !important; transform: translateX(-50%) !important;
    width: auto !important; max-width: 95%; min-width: 200px;
    background: rgba(20, 20, 25, 0.95) !important; backdrop-filter: blur(15px);
    padding: 8px 12px !important; border-radius: 50px !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    z-index: 10000 !important;
    /* Sadece hidden yoksa gösterilecek şekilde JS kontrolünde */
    display: flex; 
    align-items: center; justify-content: center; gap: 12px;
}

/* Bu kontrol de hidden sınıfı alınca gizlensin */
#teacher-next-q-btn.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#teacher-next-q-btn button {
    margin: 0 !important; border-radius: 25px !important; font-size: 14px !important;
    box-shadow: none !important; display: flex !important; align-items: center; justify-content: center;
}

#toggle-answer-btn {
    width: 40px !important; height: 40px !important; padding: 0 !important;
    border-radius: 50% !important; font-size: 18px !important; flex-shrink: 0;
}

#main-control-btn { 
    padding: 10px 20px !important; white-space: nowrap; 
}

/* --- 11. OYUN SONU --- */
.podium-container {
    display: flex; justify-content: center; align-items: flex-end; height: 250px; gap: 15px; margin-bottom: 30px;
}
.podium-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 80px; }
.podium-bar {
    width: 100%; border-radius: 10px 10px 0 0; display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); animation: growUp 1s ease-out forwards; transform-origin: bottom;
}
.place-1 { height: 180px; background: linear-gradient(45deg, #ffd700, #ffec8b); border: 3px solid #e6c200; z-index: 2; }
.place-2 { height: 130px; background: linear-gradient(45deg, #c0c0c0, #e0e0e0); border: 3px solid #a8a8a8; }
.place-3 { height: 90px; background: linear-gradient(45deg, #cd7f32, #edafa0); border: 3px solid #b06b2a; }
.podium-name { color: white; font-weight: 800; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); font-size: 14px; text-align: center; }
.podium-score { background: #333; color: var(--color-cyan); padding: 4px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; margin-top: 5px; }

#live-ranking-list { display: flex; flex-direction: column; gap: 10px; max-width: 500px; margin: 0 auto; }
.live-rank-item {
    background: #202f36; padding: 15px 20px; border-radius: 16px;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid #37464f; box-shadow: 0 4px 10px rgba(0,0,0,0.2); animation: slideInRank 0.5s ease-out;
}
.live-rank-item:nth-child(1) { border: 2px solid #ffd700; background: rgba(255, 215, 0, 0.1); }
.live-rank-item:nth-child(2) { border: 2px solid #c0c0c0; background: rgba(192, 192, 192, 0.1); }
.live-rank-item:nth-child(3) { border: 2px solid #cd7f32; background: rgba(205, 127, 50, 0.1); }

/* --- 12. PC / PROJEKTÖR MODU (GÜNCELLENDİ: BÜYÜTME) --- */
@media (min-width: 768px) {
    /* Giriş ve Bilgi Kutularını PC'de Büyüt */
    #teacher-controls {
        max-width: 600px !important; /* Genişliği 350'den 600'e çıkardık */
        padding: 40px !important;    /* Daha ferah */
        margin-top: 60px !important; /* Ortaya aldık */
        border-radius: 30px !important;
    }

    /* Yazıları Büyüt */
    .teacher-title {
        font-size: 28px !important;
        margin-bottom: 25px !important;
    }

    #live-pin-input {
        height: 70px !important;
        font-size: 36px !important;
        letter-spacing: 10px !important;
        border-width: 4px !important;
    }

    /* Diğer PC Ayarları */
    #live-options-grid { gap: 20px !important; max-width: 800px !important; padding-bottom: 50px !important; }
    .live-opt-card { min-height: 80px !important; font-size: 24px !important; border-width: 3px !important; }
    #live-q-text { font-size: 32px !important; margin-bottom: 20px !important; }
    .open-question-wrapper b { font-size: 34px !important; }
    #live-text-answer { font-size: 20px !important; padding: 20px !important; }
    #live-ranking-list { max-width: 650px; }
    .live-rank-item { padding: 20px 30px; font-size: 18px; }
    .place-1 { height: 220px; } .place-2 { height: 160px; } .place-3 { height: 120px; }
}

/* --- 13. MOBİL ÖZEL AYARLAR (GÜNCELLENDİ: HİZALAMA) --- */
@media (max-width: 600px) {
    /* Genel Genişlik ve Hizalama */
    #teacher-controls, 
    .live-join-box { 
        width: 92% !important; 
        max-width: 92% !important;
        /* Üstten boşluğu 10px yaparak Header'a yaklaştırdık */
        margin: 10px auto 20px auto !important; 
    }

    /* Şık Kartları Mobilde Daha Kompakt */
    .live-opt-card {
        pointer-events: auto !important; 
        cursor: pointer;
        min-height: 55px !important; font-size: 14px !important; padding: 5px !important;
    }
    #live-options-grid { gap: 8px !important; }

    /* KİLİTLİ DURUMLAR (FIX) */
    #live-options-grid[style*="pointer-events: none"] .live-opt-card {
        pointer-events: none !important; cursor: default; opacity: 0.3 !important; 
    }
    .dimmed-card { opacity: 0.3 !important; pointer-events: none !important; }
    .grid-disabled-timeout .live-opt-card { 
        opacity: 0.7 !important; filter: grayscale(90%); pointer-events: none !important; 
    }

    /* Diğer Mobil Ayarları */
    .open-question-wrapper {
        transform: none !important; margin: 15px auto !important; width: 94% !important; 
        grid-column: 1 / -1 !important; justify-self: center !important;
    }
    #live-text-answer, #submit-text-btn { width: 100% !important; }
    #live-timer-wrapper { top: 65px; }
}

/* ==========================================================================
   BÖLÜM 14: AÇIK TEMA (LIGHT MODE) UYUMLULUĞU
   ========================================================================== */

body.light-mode #teacher-controls {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    color: #333 !important;
}

body.light-mode .teacher-title {
    color: #222 !important;
}

body.light-mode #live-pin-input {
    background: #f3f4f6 !important;
    border-color: #ccc !important;
    color: #222 !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05) !important;
}

body.light-mode #live-pin-input:focus {
    border-color: var(--color-green) !important;
    background: #fff !important;
}

body.light-mode #waiting-pin-display {
    color: #222 !important;
    text-shadow: none !important;
}

body.light-mode #student-wait-msg {
    color: #555 !important;
}

/* Soru Metni ve Alanı */
body.light-mode #live-q-text {
    color: #111 !important;
    text-shadow: none !important;
}

/* Oyuncu Listesi (Chips) */
body.light-mode #live-player-list > div, 
body.light-mode #live-game-player-list > div {
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
}

/* Şık Kartları (Renkler kalır, gölgeler yumuşar) */
body.light-mode .live-opt-card {
    box-shadow: 0 4px 0 rgba(0,0,0,0.15) !important;
    border-color: rgba(0,0,0,0.1) !important;
}
body.light-mode .live-opt-card:active {
    box-shadow: none !important;
}

/* Açık Uçlu Soru */
body.light-mode #live-text-answer {
    background: #fff !important;
    border: 2px solid #ccc !important;
    color: #333 !important;
}

/* Liderlik Tablosu (Sıralama) */
body.light-mode .live-rank-item {
    background: #ffffff !important;
    color: #333 !important;
    border: 1px solid #eee !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* Podium İsimleri */
body.light-mode .podium-name {
    color: #333 !important;
    text-shadow: none !important;
}

body.light-mode #teacher-next-q-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    color: #333 !important;
}
body.light-mode #teacher-next-q-btn button {
    color: #333 !important;
}

/* Süre Barı */
body.light-mode #live-timer-wrapper {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Geri Bildirim Kutuları (Correct/Wrong Instant) */
body.light-mode .correct-instant {
    background-color: #e6ffda !important; /* Daha açık yeşil */
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
}

body.light-mode .wrong-instant {
    background-color: #ffebee !important; /* Daha açık kırmızı */
    border-color: #ef5350 !important;
    color: #c62828 !important;
}

/* ==========================================================================
   BÖLÜM 15: GÖRSEL İYİLEŞTİRMELER (HEADER & KARTLAR)
   ========================================================================== */

/* --- 1. ÜST BİLGİ BARI (Header) --- */
.live-game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin-bottom: 10px;
    background: transparent; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#live-q-counter {
    color: var(--color-cyan);
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 198, 255, 0.4);
}

.live-ans-badge {
    background: var(--color-green);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(88, 204, 2, 0.3);
}

/* --- LIGHT MODE (AÇIK TEMA) İÇİN HEADER --- */
body.light-mode .live-game-info-bar {
    background: #ffffff !important; 
    border-bottom: 1px solid #eee !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
}

body.light-mode #live-q-counter {
    color: #0072ff !important; 
    text-shadow: none !important;
}


/* --- 2. SÜRE BİTTİĞİNDE / CEVAP VERİLDİĞİNDE KART GÖRÜNÜMÜ --- */

/* DARK MODE: Sönük Kartlar */
.grid-disabled-timeout .live-opt-card,
.dimmed-card {
    opacity: 0.2 !important; 
    filter: grayscale(100%) brightness(0.5) !important; 
    transform: scale(0.98);
}

/* DARK MODE: Doğru Cevap (Parlasın) */
.grid-disabled-timeout .live-opt-card.correct-answer-card {
    opacity: 1 !important;
    filter: none !important;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(88, 204, 2, 0.6) !important;
    z-index: 10;
}

/* --- LIGHT MODE: Sönük Kartlar (KİRLİ GÖRÜNTÜ DÜZELTMESİ) --- */
body.light-mode .grid-disabled-timeout .live-opt-card,
body.light-mode .dimmed-card {
    opacity: 1 !important; 
    background: #f3f4f6 !important; 
    color: #9ca3af !important; 
    border: 1px solid #e5e7eb !important; 
    box-shadow: none !important;
    filter: none !important; 
    cursor: default !important;
}

/* LIGHT MODE: Doğru Cevap (Canlı Yeşil) */
body.light-mode .grid-disabled-timeout .live-opt-card.correct-answer-card {
    background: #dcfce7 !important; 
    color: #166534 !important; 
    border: 2px solid #22c55e !important;
    opacity: 1 !important;
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.3) !important;
}

/* ==========================================================================
   DÜZELTME: HEADER VE ALT ALAN (GÖRÜNTÜ KESME SORUNU GİDERİLDİ)
   ========================================================================== */

/* --- 1. ÜST HEADER BAR --- */
.live-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px); 
}


/* Cevaplayan Badge (Yeşil kutu) */
.live-ans-badge {
    background: var(--color-green); 
    color: white; 
    padding: 3px 10px; 
    border-radius: 12px; 
    font-weight: bold; 
    font-size: 14px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- 2. ALT ALAN (PLAYER STATUS) --- */
#live-player-status-area {
    padding: 20px; 
    padding-bottom: 100px; 
    background: transparent !important; 
    border-top: none; 
}

/* --- 3. LIGHT MODE (AÇIK TEMA) AYARLARI --- */
body.light-mode .live-header-bar {
    background: #ffffff !important; 
    border-bottom: 1px solid #e0e0e0 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

body.light-mode #live-q-counter {
    color: #0072ff !important; 
    text-shadow: none !important;
}


body.light-mode #live-player-status-area {
    background: #f8f9fa !important; 
    border-top: 1px solid #e0e0e0 !important; 
}

body.light-mode #live-game-player-list > div {
    background: #ffffff !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ==========================================================================
   DÜZELTME: LIGHT MODE (AÇIK TEMA) DETAYLARI - V2
   ========================================================================== */

/* --- 1. AÇIK UÇLU SORU CEVAP KUTUSU (Öğretmen Ekranı) --- */
body.light-mode .open-question-wrapper {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    color: #333333 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
    border-radius: 16px !important;
}

body.light-mode .open-question-wrapper b {
    color: #0072ff !important; 
    text-shadow: none !important;
    font-weight: 800 !important;
}

/* --- 2. OYUNCU "CEVAPLANDI" ROZETİ (Kullanıcı Ekranı) --- */
body.light-mode .player-answered-badge {
    background: #dcfce7 !important; 
    color: #14532d !important;      
    border: 1px solid #86efac !important;
    box-shadow: none !important;
}

.player-answered-badge span {
    color: #333 !important; 
}

body.dark-mode .player-answered-badge span {
    color: #fff !important;
}





/* --- LIGHT MODE (BEYAZ TEMA) --- */

body.light-mode .info-icon {
    background: #fff;
    border-color: #e2e8f0;
    color: #0284c7;
}
body.light-mode .info-text strong { color: #0f172a; }
body.light-mode .info-text span { color: #64748b; }
/* --- LIGHT MODE (AÇIK TEMA) UYUMU --- */

body.light-mode .info-item {
    background: #f7f9fa !important;
    border-color: #eee !important;
}

body.light-mode .info-icon {
    background: #ffffff !important;
    border: 1px solid #eee !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

body.light-mode .info-text strong { color: #333 !important; }
body.light-mode .info-text span { color: #666 !important; }

/* ========================================================
   OYUN MERKEZİ (GAMES HUB) TASARIMI
   ======================================================== */

.games-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.game-card {
    background: var(--card-bg);
    border: 2px solid #37464f; 
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    position: relative;
    overflow: hidden;
    top: -20px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.game-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.game-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.game-info { flex: 1; }
.game-info h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text-main); }
.game-info p { margin: 4px 0 0 0; font-size: 13px; color: var(--text-muted); }

.game-arrow { font-size: 20px; font-weight: 900; color: var(--text-muted); }

.active-game:hover {
    border-color: var(--color-green);
    background: rgba(88, 204, 2, 0.05);
}
.active-game .game-arrow { color: var(--color-green); }

.disabled-game {
    opacity: 0.7;
    cursor: default;
    border-color: transparent;
    background: rgba(255,255,255,0.05);
}
.disabled-game:active { transform: none; }

.soon-badge {
    background: #333;
    color: #aaa;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

/* ========================================================
   GAMES HUB - LIGHT MODE (KESİN ÇÖZÜM)
   ======================================================== */

/* 1. Kapsayıcıyı medya sorgusundan çıkardık. */

body.light-mode .game-card, 
body.light .game-card {
    background: #ffffff !important;
    border: 2px solid #e5e5e5 !important;
    box-shadow: 0 4px 0 #e5e5e5 !important;
    color: #333 !important; 
}

body.light-mode .game-card h3, 
body.light .game-card h3,
body.light-mode .game-card p, 
body.light .game-card p {
    color: #1f2937 !important;
}

body.light-mode .game-icon-box, 
body.light .game-icon-box {
    background-color: #f3f4f6 !important;
    color: #4f46e5 !important;
}

body.light-mode .active-game:hover, 
body.light .active-game:hover {
    border-color: var(--color-green) !important;
    background: #f0fdf4 !important; 
    transform: translateY(-3px);
}

body.light-mode .disabled-game, 
body.light .disabled-game {
    background: #f9fafb !important;
    border-color: #f3f4f6 !important;
    opacity: 0.7 !important;
    box-shadow: none !important;
}

body.light-mode .soon-badge, 
body.light .soon-badge {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
}

body.light-mode .game-arrow, 
body.light .game-arrow {
    color: #9ca3af !important;
}


/* 2. ÖĞRETMEN PANELİ GÖRÜNÜRLÜK SORUNU */
/* ========================================================
   ÖĞRETMEN PANELİ (MOBİL VE PC UYUMLU)
   ======================================================== */

#teacher-controls {
    /* Senin verdiğin görsel ayarlar */
    background: var(--card-bg); /* Eğer bu değişken yoksa #1e293b gibi koyu bir renk de verebilirsin */
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    position: relative !important;
    z-index: 10 !important;
    border-radius: 24px !important; /* Köşeleri yuvarladık */

    /* Varsayılan (Mobil Öncelikli) Konum Ayarları */
    width: 90% !important;
    max-width: 350px !important; /* Mobilde çok genişlemesin */
    margin: 15px auto 30px auto !important; /* Üstten biraz boşluk, ortala */
    padding: 20px !important; /* Mobilde iç boşluk ideal seviyede */
    box-sizing: border-box !important;
}

/* --- PC SÜRÜMÜ (Ekran Genişleyince) --- */
@media (min-width: 768px) {
    #teacher-controls {
        max-width: 600px !important; /* PC'de daha geniş olsun */
        padding: 40px !important;    /* İçerik ferahlasın */
        margin-top: 50px !important;
    }
}

/* --- LIGHT MODE (BEYAZ TEMA) DÜZELTMESİ --- */
/* Arka plan değişkeni (var--card-bg) beyaz modda çalışmazsa burası devreye girer */
body.light-mode #teacher-controls {
    background: #ffffff !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    color: #333 !important;
}


/* ========================================================
   SELECT KUTULARI - DAHA KOYU ARKA PLAN
   ======================================================== */

#teacher-category-select,
#teacher-test-select {
    /* İstenen koyu renk (neredeyse siyah ama gri tonlu) */
    background-color: #1a1a1e !important; 
    
    /* Yazılar net okunsun diye beyaz */
    color: #ffffff !important;
    
    /* Kenarlıklar çok sırıtmamalı */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Light Mode (Beyaz Tema) için düzeltme */
body.light-mode #teacher-category-select,
body.light-mode #teacher-test-select {
    background-color: #f3f4f6 !important;
    color: #333 !important;
    border: 1px solid #d1d5db !important;
}

/* Light Mode için Öğretmen Paneli */
body.light-mode #teacher-controls {
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

/* ==========================================================================
   NASIL OYNANIR KUTUSU (LIVE INFO BOX) - SIFIRDAN TEMİZ KURULUM
   ========================================================================== */

/* 1. KUTU GENEL YAPISI (MOBİL ÖNCELİKLİ) */
.live-info-box {
    /* Görsel Tasarım (Kart Görünümü) */
    background: var(--card-bg, #1e293b) !important; /* Arka plan rengi */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4) !important;
    
    /* Boyut ve Konum */
    width: 90% !important;
    max-width: 350px !important; /* Mobilde Join Box ile aynı genişlik */
    margin: 30px auto !important; /* Üstten ve alttan boşluk */
    padding: 25px 20px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    
    /* Animasyon */
    animation: fadeInUp 0.5s ease-out;
}

/* 2. BAŞLIK */
.live-info-box h3 {
    margin: 0 0 20px 0 !important;
    font-size: 1.2rem !important;
    color: var(--color-cyan, #00d4ff) !important;
    text-transform: uppercase;
    font-weight: 900 !important;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    padding-bottom: 10px !important;
}

/* 3. İÇ KUTULAR (INFO ITEMS) - MOBİLDE YATAY HİZALAMA */
.info-item {
    display: flex !important;
    align-items: center !important; /* İkon ve yazıyı ortala */
    gap: 15px !important;
    
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 15px !important;
    margin-bottom: 15px !important; /* Mobilde alt alta boşluk */
    text-align: left !important;
}

/* Son elemanın alt boşluğunu al */
.info-item:last-child {
    margin-bottom: 0 !important;
}

/* 4. İKON STİLİ */
.info-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 50% !important; /* Yuvarlak */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-shrink: 0 !important; /* Küçülmesini engelle */
}

/* 5. METİN ALANI */
.info-text {
    display: flex !important;
    flex-direction: column !important;
}

.info-text strong {
    color: #fff !important;
    font-size: 15px !important;
    margin-bottom: 4px !important;
}

.info-text span {
    color: #94a3b8 !important; /* Okunabilir gri */
    font-size: 13px !important;
    line-height: 1.3 !important;
}

/* ==========================================================================
   PC / TABLET SÜRÜMÜ (Masaüstü için Özel Ayarlar)
   ========================================================================== */
@media (min-width: 768px) {
    .live-info-box {
        /* Genişlik Artır */
        max-width: 900px !important;
        margin-top: 50px !important;
        
        /* IZGARA SİSTEMİ (YAN YANA 3 KUTU) */
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important; /* 3 Eşit parça */
        gap: 20px !important;
        align-items: stretch !important; /* Kutuların boyunu eşitle (Sarkmayı engeller) */
    }

    /* Başlığı tüm satıra yay */
    .live-info-box h3 {
        grid-column: 1 / -1 !important;
        border-bottom: none !important; /* PC'de çizgi kalksın */
        font-size: 24px !important;
        margin-bottom: 10px !important;
    }

    /* Kutuları Dikey Hale Getir (İkon üstte, yazı altta) */
    .info-item {
        flex-direction: column !important;
        text-align: center !important;
        justify-content: flex-start !important;
        
        margin-bottom: 0 !important; /* Grid olduğu için margin'e gerek yok */
        padding: 30px 20px !important;
        height: auto !important;
        min-height: 100% !important; /* Kutuyu doldur */

        /* İç boşlukları azalt (Yüksekliği düşürür) */
        padding: 5px !important; 
        margin-bottom: 0 !important;
        height: 100% !important; 
    }

    /* İkonu Büyüt ve Ortala */
    .info-icon {
        width: 70px !important;
        height: 70px !important;
        font-size: 32px !important;
        transform: translateY(15px) !important;
        margin: 0 auto 15px auto !important;
    }

    /* Yazı Stilleri */
    .info-text {
        align-items: center !important;
    }
    .info-text strong {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }
    .info-text span {
        font-size: 14px !important;
    }
}

/* ==========================================================================
   LIGHT MODE (BEYAZ TEMA) UYUMU
   ========================================================================== */
body.light-mode .live-info-box {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}
body.light-mode .live-info-box h3 { color: #0284c7 !important; }
body.light-mode .info-item {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
body.light-mode .info-icon {
    background: #fff !important;
    border-color: #e2e8f0 !important;
    color: #0284c7 !important;
}
body.light-mode .info-text strong { color: #0f172a !important; }
body.light-mode .info-text span { color: #64748b !important; }

/* ========================================================
   CEVAPLANDI ROZETİ RENK DÜZELTMESİ (DARK/LIGHT FIX)
   ======================================================== */

/* 1. Varsayılan (Koyu Mod) - Yazılar Beyaz Olsun */
.player-answered-badge,
.player-answered-badge span,
.player-answered-badge b {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* 2. Açık Mod (Light Mode) - Yazılar Koyu Olsun */
body.light-mode .player-answered-badge {
    background: #dcfce7 !important; /* Açık yeşil zemin */
    border: 1px solid #86efac !important;
    color: #14532d !important;      /* Koyu yeşil yazı */
}

body.light-mode .player-answered-badge span,
body.light-mode .player-answered-badge b {
    color: #14532d !important; /* Koyu yeşil/siyah yazı */
}

