:root {
    --primary: #4a90e2;
    --secondary: #f5a623;
    --bg: #f0f4f8;
    --text: #333;
    --correct: #2ecc71;
    --wrong: #e74c3c;
    --dark: #2c3e50;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--text);
}

.container {
    background: white;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screen {
    width: 100%;
    animation: fadeIn 0.3s;
}

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

.hidden {
    display: none !important;
}

/* Giriş */
input {
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    width: 80%;
    margin-bottom: 20px;
    text-align: center;
}

/* Avatar Seçimi */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    justify-items: center;
}

.avatar-option {
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    filter: grayscale(100%);
    user-select: none;
}

.avatar-option:hover {
    transform: scale(1.1);
}

.avatar-option.selected {
    filter: grayscale(0%);
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Liderlik Tablosu */
.leaderboard-container {
    margin-top: 30px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #eee;
}

.leaderboard-container h3 {
    margin: 0 0 10px 0;
    color: var(--dark);
    font-size: 1.1rem;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lb-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.lb-rank {
    font-weight: bold;
    margin-right: 10px;
    width: 20px;
}

.rank-1 .lb-rank { color: var(--gold); font-size: 1.2rem; }
.rank-2 .lb-rank { color: var(--silver); font-size: 1.1rem; }
.rank-3 .lb-rank { color: var(--bronze); font-size: 1.1rem; }

.lb-name {
    flex-grow: 1;
    text-align: left;
    font-weight: bold;
}

.lb-score {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.empty-lb {
    color: #999;
    font-style: italic;
}

/* Genel Butonlar */
button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 10px;
}

button:hover { filter: brightness(1.1); }
button:active { transform: scale(0.98); }

.small-btn {
    background-color: #95a5a6;
    margin-top: 15px;
    font-size: 0.9rem;
    padding: 10px;
}

/* Mod Seçimi */
.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.big-btn {
    padding: 25px;
    font-size: 1.3rem;
    font-weight: bold;
}

.secondary {
    background-color: var(--dark);
}

/* Lobi Listesi */
.player-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 10px;
    margin: 15px 0;
    text-align: left;
}

.player-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.player-item:hover {
    background-color: #f9f9f9;
}

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

.player-status {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: #eee;
    color: #666;
}

.status-auto { background: #d1f7c4; color: #2ecc71; }
.status-lobby { background: #dbeafe; color: #4a90e2; }

/* Bekleme Animasyonu */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Oyun Ekranı */
.header { display: flex; justify-content: space-between; margin-bottom: 20px; font-weight: bold; }
.player-avatar { display: block; font-size: 2rem; margin-bottom: 5px; } 
.score { font-size: 1.5rem; color: var(--primary); }
.question-box { background: #eef2f7; padding: 20px; border-radius: 15px; margin-bottom: 20px; }
.question-box h1 { font-size: 3rem; margin: 0; }
.status-message { height: 20px; margin-bottom: 10px; font-weight: bold; color: var(--secondary); }
.options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option-btn { background: white; border: 2px solid var(--primary); color: var(--primary); font-size: 1.5rem; padding: 20px 0; font-weight: bold; }
.option-btn:hover { background: var(--primary); color: white; }
.option-btn.disabled { opacity: 0.5; cursor: not-allowed; background: #ccc; border-color: #999; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; }
.accept-btn { background: var(--correct); }
.decline-btn { background: var(--wrong); }

/* Yeni Sonuç Ekranı Butonları */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}
.rematch-btn {
    background-color: var(--secondary); /* Turuncu */
    font-weight: bold;
}
.rematch-status {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 20px;
}

/* ÖĞRETMEN BİLDİRİMİ (TOAST) */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 9999;
}
.toast-notification.show {
    transform: translateY(0);
}
