/* ===== VARIABLES CSS ===== */
:root {
    --color-primary: #00d9ff;
    --color-secondary: #ff6b35;
    --color-bg-dark: #0a0a0f;
    --color-bg-medium: #15151f;
    --color-bg-light: #1f1f2f;
    --color-text: #ffffff;
    --color-text-dim: #a0a0b0;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --transition-speed: 0.3s;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg-dark);
    color: var(--color-text);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ===== ÉCRANS ===== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ===== BACKGROUNDS ===== */
.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.screen-dark-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1f 0%, #15152f 100%);
    pointer-events: none;
}

/* ===== ÉCRAN DE CHARGEMENT ===== */
#loading-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0a1f 0%, #15152f 100%);
}

.loading-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.logo-container {
    margin-bottom: 30px;
}

.logo {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 0 20px var(--color-primary));
}

.glitch {
    font-size: 4rem;
    font-weight: bold;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 10px;
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 100% { text-shadow: 0 0 10px var(--color-primary); }
    25% { text-shadow: -2px 0 var(--color-secondary), 2px 0 var(--color-primary); }
    50% { text-shadow: 2px 0 var(--color-secondary), -2px 0 var(--color-primary); }
    75% { text-shadow: 0 0 10px var(--color-primary); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-text-dim);
    letter-spacing: 3px;
    margin-bottom: 40px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: var(--color-bg-light);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    width: 0%;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===== MENU PRINCIPAL ===== */
#menu-screen {
    justify-content: center;
    align-items: center;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.menu-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.logo-menu {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--color-primary));
}

.menu-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-bottom: 50px;
    text-shadow: 0 0 20px var(--color-primary);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.menu-btn {
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-primary);
    background: rgba(10, 10, 31, 0.9);
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    opacity: 0.1;
    transition: left 0.3s;
}

.menu-btn:hover::before {
    left: 0;
}

.menu-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    box-shadow: 0 0 20px var(--color-primary);
    transform: translateY(-2px);
}

.btn-icon {
    margin-right: 10px;
}

.menu-footer {
    margin-top: 30px;
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

/* ===== ÉCRAN NOM ===== */
#name-screen {
    justify-content: center;
    align-items: center;
}

.name-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.name-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.name-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-dim);
    margin-bottom: 30px;
}

.name-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    background: var(--color-bg-light);
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    color: var(--color-text);
    margin-bottom: 30px;
    text-align: center;
    transition: all var(--transition-speed);
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 20px var(--color-primary);
}

/* ===== ÉCRAN INTRO ===== */
#intro-screen {
    justify-content: center;
    align-items: center;
}

.intro-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 700px;
    padding: 40px;
}

.logo-intro {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.intro-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 40px;
    letter-spacing: 5px;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 50px;
}

.intro-text strong {
    color: var(--color-secondary);
}

/* ===== BOUTONS STYLISÉS ===== */
.styled-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-primary);
    background: rgba(10, 10, 31, 0.9);
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.styled-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    box-shadow: 0 0 20px var(--color-primary);
    transform: translateY(-2px);
}

/* ===== ÉCRAN DE JEU ===== */
#game-screen {
    display: block;
}

.game-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: var(--color-bg-dark);
    pointer-events: none;
}

.character-zone {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 60%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 217, 255, 0.3));
    transition: opacity 0.5s;
}

.dialogue-zone {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* Boîte de dialogue */
.dialogue-box {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    padding: 20px;
    color: var(--color-text);
    animation: slideUp 0.3s ease-out;
}

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

.dialogue-speaker {
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.dialogue-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
}

/* Boutons de choix */
.choice-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.choice-btn {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-primary);
    background: rgba(10, 10, 31, 0.95);
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: left;
}

.choice-btn:hover {
    background: rgba(0, 217, 255, 0.15);
    box-shadow: 0 0 15px var(--color-primary);
    transform: translateX(10px);
}

/* Input de code */
.code-input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.5rem;
    background: var(--color-bg-light);
    border: 2px solid var(--color-primary);
    border-radius: 5px;
    color: var(--color-text);
    text-align: center;
    letter-spacing: 5px;
    margin: 20px auto;
    display: block;
}

.code-input:focus {
    outline: none;
    box-shadow: 0 0 20px var(--color-primary);
}

/* Bouton menu pause */
.menu-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.menu-icon:hover {
    background: rgba(0, 217, 255, 0.2);
    box-shadow: 0 0 20px var(--color-primary);
}

/* ===== FIN DE CHAPITRE ===== */
#chapter-end-screen {
    justify-content: center;
    align-items: center;
}

.chapter-end-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.chapter-end-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 700px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid var(--color-primary);
    border-radius: 15px;
}

.chapter-end-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 30px;
    letter-spacing: 5px;
    text-shadow: 0 0 20px var(--color-primary);
}

.chapter-end-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 30px;
}

.chapter-end-subtitle {
    font-size: 1.1rem;
    color: var(--color-secondary);
    margin-bottom: 30px;
    letter-spacing: 3px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-bg-medium);
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    padding: 40px;
    max-width: 600px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    color: var(--color-secondary);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--color-primary);
    margin-bottom: 20px;
    font-size: 2rem;
}

.about-text {
    line-height: 1.8;
    color: var(--color-text);
}

.about-text strong {
    color: var(--color-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .glitch {
        font-size: 2.5rem;
    }
    
    .menu-title {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    .character-zone {
        width: 80%;
        height: 50%;
    }
    
    .dialogue-zone {
        width: 95%;
        padding: 10px;
    }
    
    .dialogue-box {
        padding: 15px;
    }
    
    .dialogue-text {
        font-size: 1rem;
    }
}

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}