:root {
    --primary-bg: #020b20;
    --secondary-bg: #0a1533;
    --border-color: #8a9bb8;
    --gold-color: #d4af37;
    --orange-text: #ff9d00;
    --text-color: #ffffff;
    --correct-bg: #155724;
    --wrong-bg: #721c24;
    --glow-blue: rgba(0, 162, 255, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #000;
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Video Alanı (Split Screen) */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    display: flex;
    flex-direction: row; /* Masaüstünde yan yana */
}

.video-box {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-right: 2px solid var(--border-color);
    background: #000;
}

.video-box:last-child {
    border-right: none;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#local-video {
    transform: scaleX(-1); /* Ayna */
}

.player-label {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--gold-color);
    z-index: 2;
    font-size: 1.2rem;
}

#waiting-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    opacity: 0.7;
}

/* Overlay (Koyu filtre) */
.video-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 11, 32, 0.6); /* Biraz daha koyu */
    pointer-events: none;
}

/* Ekran Yönetimi */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 10; /* Videoların üstünde */
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Giriş Ekranı */
.logo-area {
    text-align: center;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

.logo-area h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fff, #8a9bb8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.room-controls {
    text-align: center;
    background: rgba(0,0,0,0.8);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
}

/* Yeni Eklenen PIN Stilleri */
#room-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.divider {
    color: var(--border-color);
    font-weight: bold;
    margin: 10px 0;
    position: relative;
}

.join-room-area {
    display: flex;
    gap: 10px;
}

#room-pin-input {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-align: center;
    font-weight: bold;
    letter-spacing: 2px;
}

#room-pin-input::placeholder {
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    letter-spacing: 0;
}

#room-pin-display {
    font-size: 4rem;
    font-weight: 900;
    color: var(--gold-color);
    letter-spacing: 10px;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.small-btn {
    background: var(--gold-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #000;
}

.blink {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Oyun Ekranı */
#game-screen {
    justify-content: flex-end; /* Alt tarafa yasla */
    padding-bottom: 40px;
}

.top-bar {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.timer-box {
    width: 80px;
    height: 80px;
    position: relative;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 5px;
    border: 2px solid var(--border-color);
}

.timer-svg { transform: rotate(-90deg); }
.timer-bg { stroke: rgba(255,255,255,0.1); stroke-width: 6; fill: none; }
.timer-progress { stroke: var(--orange-text); stroke-width: 6; fill: none; transition: stroke-dashoffset 1s linear; stroke-dasharray: 283; }
#timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: bold; color: #fff; font-size: 1.5rem; }

/* Soru Alanı */
.question-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-grow: 0;
}

.question-box {
    background: linear-gradient(to bottom, #101c3d, #020b20);
    border: 2px solid var(--border-color);
    padding: 20px;
    text-align: center;
    width: 95%;
    max-width: 800px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

/* Şıklar */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    padding: 0 10px;
}

.option-btn {
    width: 100%;
    background: linear-gradient(90deg, #020b20 0%, #101c3d 50%, #020b20 100%);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: white;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:active {
    transform: scale(0.95);
    background: #1e3a6e;
}

.option-letter {
    color: var(--orange-text);
    margin-right: 10px;
    font-weight: 900;
}

/* Durumlar */
.option-btn.correct {
    background: #155724;
    border-color: #2ecc71;
    box-shadow: 0 0 15px #2ecc71;
}

.option-btn.wrong {
    background: #721c24;
    border-color: #e74c3c;
    box-shadow: 0 0 15px #e74c3c;
}

.option-btn.opponent-selected {
    border-color: #f1c40f;
    box-shadow: 0 0 15px #f1c40f; /* Rakip seçtiğinde sarı yanar (henüz doğru/yanlış belli değilse) - bizde direkt sonuç geliyor gerçi */
}

/* Sonuç Ekranı */
#result-screen {
    background: rgba(0,0,0,0.9);
    z-index: 20;
}

.winner-announce {
    font-size: 2rem;
    color: var(--gold-color);
    text-align: center;
    margin-top: 20px;
}

#status-message {
    height: 30px;
    color: var(--orange-text);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .video-container {
        flex-direction: column; /* Mobilde alt alta */
    }
    
    .video-box {
        height: 50%;
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .logo-area h1 {
        font-size: 2rem;
    }
    
    .question-box {
        font-size: 1rem;
        padding: 15px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .timer-box {
        width: 60px;
        height: 60px;
    }
    
    #game-screen {
        padding-bottom: 20px;
    }
}

/* Buton stilleri */
.action-btn {
    background: linear-gradient(to bottom, #1a2a4f, #020b20);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 15px 20px; /* Biraz daralttım */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--glow-blue);
    text-transform: uppercase;
}

.action-btn.small {
    padding: 10px 20px;
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(0, 210, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}