/* style.css - Modern & Animated */

/* Importeer een mooi modern lettertype */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700;900&display=swap');

/* --- ALGEMENE SETTINGS --- */
body { 
    background: radial-gradient(circle at center, #2c3e50 0%, #000000 100%); /* Luxe gradient */
    color: #ffffff; 
    font-family: 'Poppins', sans-serif;
    margin: 0; 
    height: 100vh; 
    overflow: hidden;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
}

/* --- START SCHERM --- */
#start-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(10px); /* Modern blur effect */
    z-index: 2000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.start-btn {
    padding: 20px 50px; 
    font-size: 2rem; 
    background: linear-gradient(45deg, #e74c3c, #c0392b); 
    color: white;
    border: none; 
    border-radius: 50px; 
    cursor: pointer; 
    text-transform: uppercase;
    font-weight: 900; 
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4); 
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
}

.start-btn:hover { 
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.6); 
}

/* --- PREVIEW BADGE --- */
.preview-badge {
    position: absolute; top: 20px; left: 20px; 
    background: #f1c40f; color: #000; 
    padding: 8px 15px; 
    font-weight: bold; border-radius: 8px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 3000;
}

/* --- GAME UI --- */
/* --- GAME UI --- */
#game-container { 
    width: 95%; /* Bijna volledige breedte */
    height: 90vh; /* 90% van de schermhoogte */
    max-width: none; /* Geen limiet meer */
    text-align: center; 
    position: relative; 
    z-index: 10;
    
    /* Zorg dat onderdelen de ruimte netjes verdelen */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

h1#question-text { 
    font-size: 3rem; /* Iets kleiner om ruimte te maken voor media */
    margin: 10px 0 20px 0; 
    flex-shrink: 0; /* Titel mag niet krimpen */
    text-shadow: 0 5px 15px rgba(0,0,0,0.5); 
    color: #f1c40f;
    letter-spacing: 1px;
    z-index: 20;
}

/* --- MEDIA BOX (Foto's & Tegels) --- */
#media-box { 
    position: relative; 
    width: 100%; 
    max-width: 1600px; /* Mag nu heel breed worden */
    
    /* FLEX TRUC: Vul alle resterende verticale ruimte! */
    flex: 1; 
    min-height: 0; /* Belangrijk voor flexbox scrolling bug preventie */
    
    margin: 0 auto; 
    background: #111; 
    border: 2px solid #333; 
    border-radius: 20px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
}

#media-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* Zorgt dat de hele foto zichtbaar blijft zonder uitrekken */
    display: block; 
}

/* --- YOUTUBE POPUP (Video) --- */
#yt-wrapper { 
    position: absolute; 
    top: 50%; left: 50%;
    
    /* GROOT FORMAAT: 85% van schermbreedte */
    width: 85vw; 
    /* Dwing 16:9 verhouding af zodat video altijd klopt */
    aspect-ratio: 16 / 9;
    max-height: 90vh; /* Voorkom dat hij van het scherm valt bij ultrabreed */

    /* Standaard verborgen */
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    
    /* Uiterlijk */
    border: 8px solid white;
    border-radius: 20px;
    box-shadow: 0 0 100px rgba(0,0,0,0.9);
    background: #000;
    overflow: hidden;
    
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    z-index: 400; 
}

/* De speler zelf vult nu de wrapper */
#yt-player {
    width: 100%;
    height: 100%;
}

/* De class die hem zichtbaar maakt */
#yt-wrapper.active {
    /* Scale naar 1 (normaal) want de basis size is nu al groot genoeg */
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 500 !important;
}

/* --- NIEUW ANTWOORD BLOK (Definitief) --- */
#answer-overlay {
    /* Positie: Altijd vast op het scherm, negeer de rest */
    position: fixed;
    bottom: 10%;
    left: 50%;
    
    /* Start situatie (Onzichtbaar) */
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
    display: none;

    /* Uiterlijk */
    min-width: 300px;
    max-width: 90vw;
    padding: 20px 50px;
    
    background: #27ae60;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    border: 5px solid white;
    border-radius: 50px;
    
    /* Zeer hoge Z-index zodat hij BOVEN de video komt */
    z-index: 10000;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
    
    /* De Magie: Transition zorgt dat hij blijft staan */
    transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* STAND B: ZICHTBAAR (Wordt door JS toegevoegd) */
#answer-display.visible {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
}
/* --- FEEDBACK (GOED/FOUT) --- */
#feedback { 
    position: fixed; top: 50%; left: 50%; 
    transform: translate(-50%, -50%);
    font-size: 10rem; font-weight: 900; 
    text-transform: uppercase;
    text-shadow: 0 10px 50px rgba(0,0,0,0.8); 
    pointer-events: none; z-index: 700;
    font-family: 'Poppins', sans-serif;
}

/* --- YOUTUBE POPUP --- */
#yt-wrapper { 
    position: absolute; 
    top: 50%; left: 50%;
    /* Standaard verborgen via scale en opacity */
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none; /* Klikken gaat er doorheen als hij weg is */
    
    /* Uiterlijk */
    border: 8px solid white;
    border-radius: 20px;
    box-shadow: 0 0 100px rgba(0,0,0,0.9);
    background: #000;
    overflow: hidden;
    
    /* Animatie settings */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    z-index: 400; /* Onder de feedback tekst (die is 700), maar boven de rest */
}

/* De class die hem zichtbaar maakt */
#yt-wrapper.active {
    transform: translate(-50%, -50%) scale(1.2) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 500 !important;
}

/* --- CONTROLS HINT --- */
.controls-hint { 
    position: fixed; bottom: 20px; right: 20px; 
    color: rgba(255,255,255,0.3); font-size: 0.9em; 
}

/* --- ANIMATIES --- */
/* Aangepaste animatie die rekening houdt met het centreren */
@keyframes bounceInOverlay {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) scale(0.3); 
    }
    50% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.05); 
    }
    70% { 
        transform: translateX(-50%) scale(0.9); 
    }
    100% { 
        transform: translateX(-50%) scale(1); 
    }
}

/* --- EIND SCHERM --- */
.winner-box {
    animation: zoomIn 1s ease;
    text-align: center;
}
.winner-title {
    font-size: 2rem; color: #aaa; text-transform: uppercase; letter-spacing: 2px;
}
.winner-name {
    font-size: 5rem; font-weight: 900; color: #f1c40f;
    text-shadow: 0 0 30px rgba(241, 196, 15, 0.6);
    margin: 10px 0;
    animation: pulseWinner 2s infinite;
}
.winner-score {
    font-size: 2.5rem; color: white; margin-bottom: 40px;
}

.rank-list {
    text-align: left; width: 100%; max-width: 500px; margin: 0 auto;
    background: rgba(255,255,255,0.1); border-radius: 10px; padding: 20px;
}
.rank-item {
    display: flex; justify-content: space-between;
    padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.2rem;
}
.rank-item:first-child { color: #f1c40f; font-weight: bold; font-size: 1.4rem; } /* Goud */
.rank-item:nth-child(2) { color: #bdc3c7; } /* Zilver */
.rank-item:nth-child(3) { color: #cd7f32; } /* Brons */

@keyframes pulseWinner {
    0% { transform: scale(1); text-shadow: 0 0 30px rgba(241, 196, 15, 0.6); }
    50% { transform: scale(1.05); text-shadow: 0 0 60px rgba(241, 196, 15, 1); }
    100% { transform: scale(1); text-shadow: 0 0 30px rgba(241, 196, 15, 0.6); }
}

@keyframes flashRed {
    0% { background-color: rgba(231, 76, 60, 0); }
    50% { background-color: rgba(231, 76, 60, 0.3); }
    100% { background-color: rgba(231, 76, 60, 0); }
}

/* --- TEGEL GRID (Voor de foto reveal) --- */
.tile-grid {
    position: absolute; /* Zorgt dat het raster BOVENOP de foto ligt */
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    display: flex;
    flex-wrap: wrap; /* Zorgt dat de blokjes netjes in rijen komen */
    z-index: 50; /* Moet hoger zijn dan de foto (die is standaard 0 of 1) */
}

.tile {
    background-color: #111; /* De kleur van de blokjes (zwart/donkergrijs) */
    /* Breedte en hoogte worden door de Javascript geregeld (12.5%) */
    border: 1px solid #222; /* Optioneel: dun lijntje zodat je het raster ziet */
    box-sizing: border-box; /* Zorgt dat randjes niet de maat verpesten */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Zorgt voor soepel verdwijnen */
}