/* Reset et style de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Canvas prend tout l'écransq */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Overlay pour les dialogues */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Ne bloque pas les clics sur le canvas */
}

#dialogue-box {
    position: absolute;
    display: flex;
    flex-direction: column;
    text-align: center;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.53);
    color: rgb(255, 255, 255);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    pointer-events: all; /* Active les clics sur la boîte de dialogue */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#dialogue-box.hidden {
    display: none;
}

#dialogue-text {
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

#dialogue-continue {
    margin: 0 auto;
    background: rgba(83, 77, 77, 0.29);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

#dialogue-continue:hover {
    background: rgba(83, 77, 77, 0.29);
}

/* Conteneur des choix */
#choices-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

#choices-container.hidden {
    display: none;
}

/* Boutons de choix */
.choice-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    text-align: left;
    transition: all 0.3s;
    position: relative;
}

.choice-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(15, 18, 27, 0.29);
    transform: translateX(5px);
}

.choice-button::before {
    content: '→ ';
    opacity: 0;
    transition: opacity 0.3s;
}

.choice-button:hover::before {
    opacity: 1;
}

/* Indicateur d'interaction */
#interaction-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.15);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    pointer-events: none;
    animation: pulse 2s infinite;
}

#interaction-hint.hidden {
    display: none;
}

#interaction-hint span {
    display: inline-block;
    background: #252732;
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: bold;
    margin: 0 5px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
}


/* Menu d'accueil */
#menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Gradient de secours si la vidéo n'est pas encore ajoutée */
    background: linear-gradient(135deg, #f0e6d2 0%, #c4b5a0 50%, #667eea 100%);
}

#menu-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Couvre tout l'écran sans déformation */
    opacity: 1;
}

#menu-content {
    position: relative;
    text-align: center;
    z-index: 2001;
}

#menu-title {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.43);
    font-weight: bold;
    margin-bottom: 60px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
}

#menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-btn {
    background: rgba(90, 74, 74, 0.29);
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 250px;
}

.menu-btn:hover {
    background: rgba(25, 21, 1, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Écran des crédits */
#credits-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#credits-screen.hidden {
    display: none;
}

#credits-bounce {
    position: absolute;
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

#btn-back {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

#gameCanvas.hidden {
    display: none;
}