/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Écrans */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: block;
}

/* Écran d'accueil */
#welcome-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

.chaos-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
}

.floating-papers {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="20">📄</text></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="15">📊</text></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="18">📈</text></svg>');
    background-size: 50px 50px, 30px 30px, 40px 40px;
    background-position: 0 0, 25px 25px, 50px 10px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(360deg); }
}

.glitch-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 0, 0, 0.03) 2px,
        rgba(255, 0, 0, 0.03) 4px
    );
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translateX(0); }
    95% { transform: translateX(2px); }
}

.welcome-content {
    position: relative;
    z-index: 10;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-top: 5vh;
}

.glitch-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 
        0 0 10px #ff4444,
        2px 2px 0 #ff0000,
        -2px -2px 0 #00ffff;
    animation: pulse 2s infinite;
    margin-bottom: 1rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.welcome-content h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: #00ffff;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px #00ffff;
}

.alert-box {
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid #ff4444;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.alert-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.highlight {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 5px #ffff00;
}

.mission-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.icon {
    font-size: 1.5rem;
}

.team-selection {
    margin: 2rem 0;
}

.team-selection h3 {
    margin-bottom: 1rem;
    color: #00ffff;
}

.team-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.team-btn {
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.team-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.team-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 0 20px currentColor;
}

.team-btn.blue.selected { border-color: #4444ff; background: rgba(68, 68, 255, 0.2); }
.team-btn.red.selected { border-color: #ff4444; background: rgba(255, 68, 68, 0.2); }
.team-btn.yellow.selected { border-color: #ffff44; background: rgba(255, 255, 68, 0.2); }
.team-btn.green.selected { border-color: #44ff44; background: rgba(68, 255, 68, 0.2); }

.start-btn {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1rem 2rem;
    background: linear-gradient(45deg, #ff4444, #ff6666);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 68, 68, 0.6);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Interface de jeu */
#game-screen {
    background: linear-gradient(135deg, #2c1810 0%, #1a1a2e 50%, #16213e 100%);
    padding: 1rem;
}

.game-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem 2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-container {
    text-align: left;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #0080ff);
    width: 10%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #00ffff;
}

.timer-container, .score-container {
    text-align: center;
}

.timer, .score {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.timer {
    color: #ff4444;
    text-shadow: 0 0 10px #ff4444;
}

.score {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.timer-label, .score-label {
    font-size: 0.8rem;
    color: #cccccc;
}

.codes-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.codes-container h4 {
    color: #ffff00;
    margin-bottom: 0.5rem;
}

.codes-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.code-slot {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.code-slot.revealed {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    animation: codeReveal 0.5s ease;
}

@keyframes codeReveal {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.enigma-container {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1rem;
    min-height: 400px;
}

.enigma-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: #00ffff;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px #00ffff;
}

.enigma-content {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.question-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    border-left: 4px solid #ffff00;
}

.answers-container {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.answer-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ffff;
    transform: translateX(5px);
}

.answer-btn.correct {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
}

.answer-btn.incorrect {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff0000;
}

.submit-btn {
    background: linear-gradient(45deg, #00ffff, #0080ff);
    border: none;
    border-radius: 10px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem auto;
    display: block;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback */
.feedback-container {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    padding: 2rem;
    margin: 1rem 0;
    border: 2px solid;
    animation: feedbackAppear 0.5s ease;
}

@keyframes feedbackAppear {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.feedback-container.success {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.feedback-container.error {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.feedback-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.feedback-container.success .feedback-title {
    color: #00ff00;
}

.feedback-container.error .feedback-title {
    color: #ff0000;
}

.code-revealed {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffff00;
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 0, 0.1);
    border-radius: 10px;
    text-shadow: 0 0 10px #ffff00;
}

.next-btn {
    background: linear-gradient(45deg, #00ff00, #00cc00);
    border: none;
    border-radius: 10px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem auto;
    display: block;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.4);
}

/* Écran final */
#final-screen {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
    padding: 2rem;
    text-align: center;
}

.final-content {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 2rem;
}

.success-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
    margin-bottom: 1rem;
    animation: successPulse 2s infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.final-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 1.1rem;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    color: #00ffff;
}

.codes-revelation {
    margin: 2rem 0;
}

.codes-revelation h3 {
    color: #ffff00;
    margin-bottom: 1rem;
}

.final-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.final-code {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.validation-section {
    background: rgba(255, 255, 0, 0.1);
    border: 2px solid #ffff00;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.validation-section h3 {
    color: #ffff00;
    margin-bottom: 1rem;
}

#final-code-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    text-align: center;
    margin: 1rem;
    width: 300px;
    max-width: 100%;
}

#final-code-input:focus {
    outline: none;
    border-color: #ffff00;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.validate-btn {
    background: linear-gradient(45deg, #ffff00, #ffcc00);
    border: none;
    border-radius: 10px;
    padding: 1rem 2rem;
    color: #000;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem;
}

.validate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 0, 0.4);
}

.program-revelation {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.program-revelation h3 {
    color: #00ff00;
    margin-bottom: 1rem;
}

.program-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.program-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #00ff00;
}

.master-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
    margin-top: 2rem;
    animation: masterGlow 3s infinite;
}

@keyframes masterGlow {
    0%, 100% { text-shadow: 0 0 15px #ffff00; }
    50% { text-shadow: 0 0 25px #ffff00, 0 0 35px #ffff00; }
}

.restart-btn, .retry-btn {
    background: linear-gradient(45deg, #4444ff, #6666ff);
    border: none;
    border-radius: 10px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2rem auto;
    display: block;
}

.restart-btn:hover, .retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(68, 68, 255, 0.4);
}

/* Écran d'échec */
#failure-screen {
    background: linear-gradient(135deg, #2c1810 0%, #1a1a2e 50%, #16213e 100%);
    padding: 2rem;
    text-align: center;
}

.failure-content {
    max-width: 600px;
    margin: 0 auto;
    padding-top: 5rem;
}

.failure-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    color: #ff4444;
    text-shadow: 0 0 20px #ff4444;
    margin-bottom: 1rem;
    animation: failurePulse 2s infinite;
}

@keyframes failurePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.failure-stats {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff4444;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.encouragement {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .game-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .progress-bar {
        width: 100%;
        max-width: 300px;
        margin: 0 auto 0.5rem;
    }
    
    .team-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .glitch-title {
        font-size: 2rem;
    }
    
    .enigma-container {
        padding: 1rem;
    }
    
    .program-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .team-buttons {
        grid-template-columns: 1fr;
    }
    
    .codes-list {
        justify-content: center;
    }
    
    .final-codes {
        justify-content: center;
    }
    
    #final-code-input {
        width: 100%;
    }
}



/* Copyright et logo Reper International */
.copyright-section {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.reper-logo {
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.copyright-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    font-weight: 300;
}

@media (max-width: 768px) {
    .reper-logo {
        height: 30px;
    }
    
    .copyright-text {
        font-size: 10px;
    }
}


/* Styles pour les options de retry */
.retry-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.retry-btn, .skip-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.retry-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
}

.retry-btn:hover {
    background: linear-gradient(135deg, #e55a2b, #e8851a);
    transform: translateY(-2px);
}

.skip-btn {
    background: linear-gradient(135deg, #666, #888);
    color: white;
}

.skip-btn:hover {
    background: linear-gradient(135deg, #555, #777);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .retry-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .retry-btn, .skip-btn {
        width: 100%;
    }
}


/* Barre de progression visuelle améliorée */
.progress-container {
    position: relative;
    margin-bottom: 10px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, #00ff88, #00ccff);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Indicateurs d'étapes */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 10px;
}

.progress-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    transition: all 0.3s ease;
}

.progress-step.completed {
    background: #00ff88;
    color: #000;
}

.progress-step.current {
    background: #ffff44;
    color: #000;
    transform: scale(1.2);
}

/* Animations de réussite/échec */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.feedback-container.success {
    animation: successPulse 0.6s ease;
}

.feedback-container.error {
    animation: errorShake 0.6s ease;
}

/* Alternative mobile pour drag & drop */
.mobile-alternative {
    display: none;
}

@media (max-width: 768px) {
    .drag-drop-container {
        display: none;
    }
    
    .mobile-alternative {
        display: block;
    }
    
    .mobile-select {
        width: 100%;
        padding: 10px;
        margin: 5px 0;
        border: 2px solid #444;
        border-radius: 8px;
        background: #333;
        color: white;
        font-size: 16px;
    }
    
    .mobile-item {
        background: #444;
        padding: 10px;
        margin: 5px 0;
        border-radius: 8px;
        border: 2px solid #666;
    }
}

