/* Importation de polices améliorées */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;600;700&family=Roboto:wght@300;400;700&display=swap');

/* Variables de couleur améliorées */
:root {
    --color-background: #000000;
    --color-text-primary: #f0f0f0;
    --color-text-secondary: #aaa;
    --color-accent-neon: #00ffff;
    --color-accent-neon-glow: rgba(0, 255, 255, 0.6);
    --color-alert-red: #ff3366;
    --color-alert-red-glow: rgba(255, 51, 102, 0.5);
    --color-surface-dark: #1a1a1a;
    --color-surface-darker: #0a0a0a;
    --color-success: #00ff88;
    --color-warning: #ffaa00;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et styles de base améliorés */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Fond immersif amélioré avec animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 40, 80, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 51, 102, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
    z-index: -2;
    animation: backgroundPulse 20s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* Scanlines améliorées */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    background: linear-gradient(
        to bottom,
        transparent 95%,
        rgba(0, 255, 255, 0.03) 96%,
        transparent 97%
    );
    background-size: 100% 8px;
    animation: scanlines 8s linear infinite;
}

/* HUD des crédits amélioré */
.credit-hud {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(10, 10, 30, 0.9) 0%, rgba(20, 20, 40, 0.9) 100%);
    border: 1px solid var(--color-accent-neon);
    border-radius: 6px;
    padding: 10px 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1em;
    font-weight: 400;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.credit-hud:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.credit-hud #current-credits {
    font-weight: 700;
    color: var(--color-accent-neon);
    transition: var(--transition-smooth);
    margin-left: 8px;
    text-shadow: 0 0 10px var(--color-accent-neon-glow);
}

/* Animation de crédits critiques */
.credit-hud.low-credits #current-credits {
    color: var(--color-alert-red);
    text-shadow: 0 0 10px var(--color-alert-red-glow);
    animation: pulseCritical 1s ease-in-out infinite alternate;
}

@keyframes pulseCritical {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Conteneur principal amélioré */
.scene-container {
    max-width: 900px;
    width: 100%;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.85) 0%, rgba(10, 10, 20, 0.9) 100%);
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(0, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 255, 255, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    margin: 40px auto;
    overflow: hidden;
}

.scene-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--color-accent-neon), 
        var(--color-alert-red), 
        transparent, 
        transparent
    );
    border-radius: 14px;
    z-index: -1;
    opacity: 0.1;
    animation: borderGlow 4s linear infinite;
}

@keyframes borderGlow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Titre de scène amélioré */
.scene-title {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 2em;
    text-transform: uppercase;
    color: transparent;
    background: linear-gradient(90deg, 
        var(--color-accent-neon) 0%, 
        #ff66cc 50%, 
        var(--color-accent-neon) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    margin: 40px auto 60px;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    animation: 
        typing 3s steps(40, end) forwards,
        shine 3s linear infinite,
        titleGlow 2s ease-in-out infinite alternate;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(0, 255, 255, 0.3); }
    100% { text-shadow: 0 0 40px rgba(0, 255, 255, 0.6), 0 0 60px rgba(255, 51, 102, 0.3); }
}

/* Section de notification améliorée */
.notification-section {
    text-align: center;
    margin: 60px 0;
    transition: var(--transition-slow);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-text {
    font-size: 1.6em;
    line-height: 1.6;
    background: linear-gradient(135deg, 
        rgba(26, 26, 36, 0.95) 0%, 
        rgba(40, 40, 60, 0.95) 100%
    );
    padding: 30px;
    border-left: 4px solid var(--color-alert-red);
    border-right: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(255, 51, 102, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
    font-weight: 400;
    text-align: center;
    position: relative;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
}

.notification-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 51, 102, 0.1), 
        transparent
    );
    animation: textScan 3s linear infinite;
}

.notification-text::after {
    content: '⚠️ URGENT';
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--color-alert-red);
    color: white;
    font-size: 0.7em;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    animation: blinkAlert 1.5s ease-in-out infinite;
}

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

/* Image de notification améliorée */
.notification-image {
    width: 90%;
    max-width: 700px;
    height: auto;
    margin: 0 auto 40px;
    display: block;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.3),
        0 0 80px rgba(255, 51, 102, 0.2),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    transition: var(--transition-smooth);
    filter: contrast(1.1) saturate(1.2);
}

.notification-image:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 
        0 0 60px rgba(0, 255, 255, 0.5),
        0 0 100px rgba(255, 51, 102, 0.3),
        inset 0 0 40px rgba(0, 255, 255, 0.2);
    border-color: var(--color-accent-neon);
}

/* Animation de l'image */
@keyframes imageGlow {
    0%, 100% { 
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 0.3),
            0 0 80px rgba(255, 51, 102, 0.2),
            inset 0 0 30px rgba(0, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(0, 255, 255, 0.4),
            0 0 100px rgba(255, 51, 102, 0.25),
            inset 0 0 40px rgba(0, 255, 255, 0.15);
    }
}

.notification-image, .notification-section img {
    animation: imageGlow 3s ease-in-out infinite alternate;
}

/* Section de question interactive améliorée */
.question-interactive {
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards 1s;
}

.question-interactive h2 {
    font-size: 1.4em;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
    font-family: 'Roboto Mono', monospace;
    text-align: center;
    line-height: 1.5;
    max-width: 800px;
}

/* Conteneur de boutons amélioré */
.buttons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.buttons-container button {
    position: relative;
    padding: 20px 30px;
    font-size: 1.1em;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    background: linear-gradient(135deg, 
        rgba(20, 20, 40, 0.9) 0%, 
        rgba(30, 30, 60, 0.9) 100%
    );
    color: var(--color-text-primary);
    transition: var(--transition-smooth);
    text-align: left;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 0.5px;
}

.buttons-container button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
    z-index: -1;
}

.buttons-container button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 25px rgba(0, 255, 255, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent-neon);
    color: var(--color-accent-neon);
}

.buttons-container button:hover::before {
    left: 100%;
}

.buttons-container button.selected {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.2) 0%, 
        rgba(0, 200, 200, 0.3) 100%
    );
    color: var(--color-background);
    border-color: var(--color-accent-neon);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Animation pour les boutons sélectionnés */
@keyframes buttonPulse {
    0% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.6); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.4); }
}

.buttons-container button.selected {
    animation: buttonPulse 2s infinite;
}

/* Section de révélation améliorée */
.revelation-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
    background: linear-gradient(135deg, 
        rgba(15, 15, 25, 0.7) 0%, 
        rgba(10, 10, 20, 0.8) 100%
    );
    padding: 40px;
    border-radius: 8px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 5px 20px rgba(0, 0, 0, 0.3);
}

.revelation-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.revelation-section h3 {
    color: var(--color-alert-red);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 25px;
    font-size: 1.3em;
    letter-spacing: 1px;
    font-family: 'Roboto Mono', monospace;
}

.revelation-section p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--color-text-secondary);
    line-height: 1.6;
    position: relative;
    padding-left: 20px;
}

.revelation-section p::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-accent-neon);
}

.revelation-section p:last-child {
    font-style: italic;
    color: var(--color-text-primary);
    background: rgba(255, 51, 102, 0.1);
    padding: 20px;
    border-radius: 6px;
    border-left: 3px solid var(--color-alert-red);
    margin-top: 30px;
}

/* Bouton continuer amélioré */
.buttons-continuer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.buttons-continuer button {
    position: relative;
    padding: 18px 40px;
    font-size: 1.2em;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    border: 2px solid var(--color-accent-neon);
    border-radius: 8px;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.1) 0%, 
        rgba(0, 200, 255, 0.2) 100%
    );
    color: var(--color-accent-neon);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    overflow: hidden;
    z-index: 1;
}

.buttons-continuer button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.6s ease;
    z-index: -1;
}

.buttons-continuer button:hover {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.2) 0%, 
        rgba(0, 200, 255, 0.3) 100%
    );
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(0, 255, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.3);
    color: white;
}

.buttons-continuer button:hover::before {
    left: 100%;
}

/* Animation d'icône pour le bouton continuer */
.buttons-continuer button::after {
    content: '→';
    margin-left: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.buttons-continuer button:hover::after {
    transform: translateX(5px);
}

/* Effets de particules pour l'arrière-plan */
.floating-data {
    position: fixed;
    color: rgba(0, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    pointer-events: none;
    z-index: -1;
    animation: floatData 20s linear infinite;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

@keyframes floatData {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive amélioré */
@media (max-width: 768px) {
    .scene-container {
        max-width: 95%;
        padding: 30px 20px;
        margin: 20px auto;
    }
    
    .scene-title {
        font-size: 1.5em;
        margin: 30px auto 40px;
    }
    
    .notification-text {
        font-size: 1.3em;
        padding: 20px 15px;
    }
    
    .notification-image {
        width: 95%;
        margin-bottom: 30px;
    }
    
    .buttons-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .buttons-container button,
    .buttons-continuer button {
        padding: 16px 20px;
        font-size: 1em;
    }
    
    .revelation-section {
        padding: 25px 20px;
    }
    
    .credit-hud {
        top: 10px;
        right: 10px;
        font-size: 0.9em;
        padding: 8px 15px;
    }
}

/* Animation pour les crédits qui changent */
@keyframes creditChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.credit-change {
    animation: creditChange 0.5s ease;
}

/* Mode sombre amélioré (si jamais activé) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0a0a0a;
        --color-surface-dark: #151515;
    }
}

/* Accessibilité : focus visible */
button:focus-visible {
    outline: 2px solid var(--color-accent-neon);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 255, 255, 0.1);
}

/* Animation de chargement */
.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

.loading-indicator.active {
    display: block;
}

/* Effet de transition entre sections */
.section-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-transition.visible {
    opacity: 1;
    transform: translateY(0);
}