/* Genel Stil, Reset ve Yeni Arka Plan */
:root {
    --primary-color: #5b86e5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --background-start: #e0eafc;
    --background-end: #cfdef3;
    --card-color: #ffffff;
    --text-color: #343a40;
    --player1-color: #00bcd4;
    --player2-color: #ff9800;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /* Okul temalı soft arka plan */
    background-image: url('background.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; 
    
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Ana Konteyner - Daha Geniş */
#game-container {
    background-color: var(--card-color);
    border-radius: 16px; 
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 1200px;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden; 
}

/* Tam Ekran Butonu - FIX: Daha belirgin ve büyük hale getirildi */
.fullscreen-btn {
    position: fixed; /* Ekranın kendisine sabitlendi */
    top: 20px;
    right: 20px;
    background: var(--primary-color); 
    color: white; 
    border: none;
    padding: 15px 18px; 
    border-radius: 10px; 
    font-size: 24px; 
    cursor: pointer;
    z-index: 1000; 
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25); 
    display: flex; 
    align-items: center;
    justify-content: center;
}
.fullscreen-btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Anasayfa Butonu (Oyun İçinde) */
.back-home-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    border: none;
    padding: 12px 15px; 
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    z-index: 30; 
    transition: background-color 0.2s, transform 0.2s;
}
.back-home-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}


/* Ekran Yönetimi */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.active-screen {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logo ve Başlıklar */
.main-menu-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
}
.game-title {
    color: var(--secondary-color);
    font-size: 1.2em;
    margin-top: -10px;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
}
h1 { color: var(--primary-color); margin-bottom: 30px; }
h2 { color: var(--primary-color); margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 10px; }

/* Buton Stilleri ve Animasyonları */
.main-btn, .secondary-btn, .choice-btn, .mode-btn, .score-btn {
    position: relative; 
    overflow: hidden; 
    padding: 12px 25px;
    border: none;
    border-radius: 12px; 
    font-size: 16px;
    cursor: pointer;
    margin: 8px auto;
    transition: all 0.3s ease-in-out; 
    width: 100%;
    max-width: 350px;
    display: block;
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); 
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Işıltı Animasyonu */
.main-btn::before, .secondary-btn::before, .mode-btn::before, .score-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transform: skewX(-20deg);
    transition: all 0.5s;
    pointer-events: none;
}

/* Hover'da Işıltıyı Harekete Geçir */
.main-btn:hover::before, .secondary-btn:hover::before, .mode-btn:hover::before, .score-btn:hover::before {
    left: 100%;
}

.main-btn {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid #0056b3;
}

.main-btn:hover {
    background-color: #0056b3;
    transform: translateY(-4px); 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
    border: 2px solid #4a4a4a;
}

.secondary-btn:hover {
    background-color: #4a4a4a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Mod Seçim Butonları (Daha Büyük) */
.mode-btn {
    max-width: 500px;
    font-size: 24px;
    padding: 20px 40px;
    margin-bottom: 20px;
}

/* Skor Butonları (Daha küçük, ikincil) */
.score-buttons-area {
    margin-top: 30px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px; 
}
.score-buttons-area .secondary-btn, .score-buttons-area .score-btn {
    display: inline-block;
    width: auto; 
    max-width: 250px;
    font-size: 14px;
    padding: 10px 20px;
    margin: 0;
}


/* Giriş Alanları */
.input-group { margin-bottom: 20px; text-align: left; }
.input-group label, .setting-group label { display: block; margin-bottom: 8px; font-weight: bold; }
input[type="text"], select {
    width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: 16px;
    transition: border-color 0.3s;
}
input[type="text"]:focus, select[type="text"]:focus { border-color: var(--primary-color); outline: none; }
/* Yeni Eklenen Sınıf ve Ünite Seçimi Düzeni */
.settings-options { display: flex; justify-content: space-around; flex-wrap: wrap; margin-bottom: 20px; }
.setting-group { width: 45%; min-width: 250px; }
.settings-options .setting-group:nth-child(1),
.settings-options .setting-group:nth-child(2) {
    min-width: 45%; /* Sınıf ve Ünite seçicilerinin yan yana durması için */
}


/* Oyun Ekranı Stilleri */
#game-screen .header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding: 10px; 
    border-bottom: 2px solid #eee;
    position: relative; 
    padding-left: 80px; 
    padding-right: 80px; 
}

/* SÜRE SAYACI */
.timer { 
    font-size: 28px; 
    font-weight: bold; 
    color: var(--danger-color); 
    position: absolute; 
    left: 50%;
    transform: translateX(-50%);
}

.question-info { 
    font-size: 18px; 
    font-weight: 500; 
    margin-left: auto; 
}

#word-question-area {
    margin-bottom: 30px;
}

.word-display {
    font-size: 38px; 
    font-weight: 800; 
    margin: 0 auto; 
    padding: 25px;
    background: #e9f5ff; 
    border-radius: 12px;
    color: var(--primary-color);
    min-height: 120px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Oyuncu Sırası Bilgisi ve Animasyonu */
#player-turn-info-wrapper { margin-top: 20px; position: relative; height: 40px; display: flex; justify-content: center; align-items: center; }
.player-turn-info { font-size: 20px; font-weight: 700; padding: 8px 15px; border-radius: 25px; transition: all 0.4s ease-in-out; background-color: #f0f0f0; color: var(--text-color); position: absolute; min-width: 200px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; }
#current-player-name { font-weight: bold; margin-left: 8px; }
.player-turn-info.player1-turn { background-color: var(--player1-color); color: white; box-shadow: 0 0 15px var(--player1-color), 0 0 25px rgba(0, 188, 212, 0.4); transform: scale(1.05); }
.player-turn-info.player2-turn { background-color: var(--player2-color); color: white; box-shadow: 0 0 15px var(--player2-color), 0 0 25px rgba(255, 152, 0, 0.4); transform: scale(1.05); }

/* Tek Oyuncu Görünümleri */
.hidden { display: none !important; }
.game-mode-1p #player-turn-info-wrapper { display: none; }
.game-mode-1p #score-p2 { visibility: hidden; }


/* ŞIK BUTONLARI ALANI */
.choices-area {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-bottom: 30px;
    margin-top: 30px; 
}

.choice-btn {
    max-width: none; 
    margin: 0;
    background-color: #f4f4f4;
    color: var(--text-color);
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    height: 70px; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
}

/* Cevap Butonu Animasyonları */
.choice-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.choice-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Doğru/Yanlış Durumları */
.choice-btn[data-state="correct"] {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
    animation: pulse 0.5s 2;
}

.choice-btn[data-state="wrong"] {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Cevap Verildikten Sonra Kilitlenme */
.choices-area[data-locked="true"] .choice-btn:not([data-state="correct"]):not([data-state="wrong"]) {
    opacity: 0.4;
    pointer-events: none;
}


.score-display { display: flex; justify-content: space-around; padding-top: 15px; border-top: 1px dashed #ced4da; }
.player-score { font-size: 16px; font-weight: bold; }

/* Feedback Animasyonu ve Konfeti Stilleri */
.feedback-animation {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 80px; font-weight: bold; color: white; opacity: 0; pointer-events: none; z-index: 1000;
}
.correct-anim { color: var(--success-color); text-shadow: 0 0 20px var(--success-color); animation: popIn 0.5s forwards; }
.wrong-anim { color: var(--danger-color); text-shadow: 0 0 20px var(--danger-color); animation: popIn 0.5s forwards; }
@keyframes popIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); } }

#confetti-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; z-index: 50; }
.confetti { position: absolute; animation: confetti-fall linear forwards; opacity: 0; }
@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotateZ(0deg); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(100vh) rotateZ(720deg); opacity: 0; }
}

/* Mobil Uyumluluk (Küçük Ekranlar) */
@media (max-width: 768px) {
    body { padding: 0; }
    #game-container { padding: 20px 15px; border-radius: 0; min-height: 100vh; box-shadow: none; }
    
    #game-screen .header {
        flex-direction: column;
        padding: 10px 15px;
        position: initial;
    }
    .timer { position: static; transform: none; order: 1; margin-top: 5px; }
    .question-info { order: 2; margin-left: 0; }
    
    .fullscreen-btn { top: 10px; right: 10px; padding: 10px 12px; font-size: 18px; position: fixed; }
    .back-home-btn { top: 5px; left: 5px; padding: 10px 12px; font-size: 16px; }

    .main-btn, .secondary-btn, .choice-btn, .mode-btn { font-size: 14px; padding: 10px 15px; max-width: none; }
    .mode-btn { font-size: 18px; padding: 15px; }
    .word-display { font-size: 28px; margin: 30px 0 10px; min-height: 90px;}
    .choices-area { grid-template-columns: 1fr; } 
    .player-turn-info { font-size: 16px; padding: 6px 10px; min-width: 160px;}
    .main-menu-logo { max-width: 180px; }
    
    .score-buttons-area { gap: 5px; }
    .score-buttons-area .secondary-btn {
        width: 49%;
        margin: 5px auto;
    }
}