* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Image d'introduction (Splash Screen) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

#splash-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Vidéo Principale */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    z-index: 1; 
}

#main-video {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    outline: none;
}

/* Bouton unmute fallback */
.unmute-btn {
    position: absolute;
    z-index: 9999;
    padding: 15px 30px;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

/* ECRAN DE FIN */
#end-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.85); /* Fond assombri mais un peu transparent */
    backdrop-filter: blur(15px); /* Rend le fond de la vidéo flou */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

#end-screen.visible {
    opacity: 1;
    visibility: visible;
}

.choices-container {
    display: flex;
    gap: 40px;
    padding: 20px;
}

/* Boutons de choix (Image ou Vidéo) */
.choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.choice:active, .choice:hover {
    transform: scale(1.05);
}

.thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #222;
    margin-bottom: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit le carré */
}

.video-thumbnail {
    font-size: 40px;
    color: #fff;
}

.choice-label {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

/* Visionneuse d'image plein écran */
#image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#image-viewer.visible {
    opacity: 1;
    visibility: visible;
}

#image-viewer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Bouton pour fermer l'image */
#close-image-viewer {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    font-size: 20px;
    cursor: pointer;
    z-index: 201;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
