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

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0f;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Écran d'accueil */
#welcome-screen {
    background: radial-gradient(circle at 50% 50%, #1a0033, #0a0a0f);
}

.glitch-container {
    text-align: center;
    z-index: 10;
}

.glitch {
    font-size: 6rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
    }
    25% {
        text-shadow: -2px 0 10px #00ffff, 2px 2px 20px #ff00ff, -2px -2px 30px #00ff00;
    }
    50% {
        text-shadow: 2px 0 10px #00ff00, -2px -2px 20px #00ffff, 2px 2px 30px #ff00ff;
    }
    75% {
        text-shadow: -2px -2px 10px #ff00ff, 2px 0 20px #00ff00, 0 2px 30px #00ffff;
    }
}

.hint {
    font-size: 1.5rem;
    margin-top: 2rem;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    animation: pulse 2s infinite;
}

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

.code-hint {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.key-icon {
    background: rgba(255, 0, 255, 0.2);
    border: 2px solid #ff00ff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 1.2rem;
    box-shadow: 0 0 10px #ff00ff;
    animation: keyFloat 3s ease-in-out infinite;
}

.key-icon:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes keyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Particules de fond */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* En-tête du jeu */
.game-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    z-index: 100;
    align-items: center;
}

.score-panel {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.stat .label {
    font-size: 0.8rem;
    color: #00ffff;
    text-transform: uppercase;
}

.stat .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #00ffff;
}

.power-ups-display {
    display: flex;
    gap: 0.5rem;
}

/* Conteneur de jeu */
.game-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: 3px solid #ff00ff;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.8), 
                inset 0 0 30px rgba(255, 0, 255, 0.2);
    background: #0a0a0f;
    border-radius: 10px;
}

.effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.controls-info {
    position: absolute;
    bottom: 20px;
    text-align: center;
    color: #00ffff;
    font-size: 0.9rem;
    text-shadow: 0 0 10px #00ffff;
}

/* Écran Game Over */
#gameover-screen {
    background: radial-gradient(circle at 50% 50%, #330000, #0a0a0f);
}

.gameover-content {
    text-align: center;
    z-index: 10;
}

.final-score {
    margin: 2rem 0;
    font-size: 1.5rem;
}

.final-score p {
    margin: 1rem 0;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.final-score span {
    color: #ff00ff;
    font-weight: bold;
    font-size: 2rem;
    text-shadow: 0 0 10px #ff00ff;
}

/* Boutons néon */
.neon-button {
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    margin: 1rem;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
    transition: all 0.3s;
    text-transform: uppercase;
}

.neon-button:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.8);
    transform: scale(1.05);
}

.neon-button.secondary {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.neon-button.secondary:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

/* Effets de particules */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

/* Animation d'activation */
@keyframes activate {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.activating {
    animation: activate 1s ease-out;
}

/* Bouton d'aide */
.help-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    color: #00ffff;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.help-button:hover {
    background: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: scale(1.1) rotate(15deg);
}

/* Panneau d'aide */
.help-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow-y: auto;
}

.help-panel.active {
    display: flex;
}

.help-content {
    background: linear-gradient(135deg, rgba(26, 0, 51, 0.95), rgba(10, 10, 15, 0.95));
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.5);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-help {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    line-height: 1;
}

.close-help:hover {
    background: rgba(255, 0, 255, 0.2);
    transform: rotate(90deg);
}

.help-content h2 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-shadow: 0 0 10px #00ffff;
}

.help-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.help-section:last-child {
    border-bottom: none;
}

.help-section h3 {
    color: #ff00ff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-shadow: 0 0 5px #ff00ff;
}

.help-section p {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.help-section ul {
    list-style: none;
    padding-left: 0;
}

.help-section ul li {
    color: #ccc;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.help-section ul li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #00ffff;
}

.help-section strong {
    color: #00ffff;
}

/* Grille d'éléments */
.element-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.element-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: rgba(0, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.element-icon {
    font-size: 2rem;
    min-width: 30px;
    text-align: center;
}

.element-item strong {
    display: block;
    color: #00ffff;
    margin-bottom: 0.3rem;
}

.element-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* Couleurs des éléments */
.color-green {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.color-magenta {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

.color-cyan {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.color-yellow {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

/* Code secret */
.secret-code {
    background: rgba(255, 0, 255, 0.1);
    border: 2px solid #ff00ff;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    letter-spacing: 0.5rem;
    margin-top: 1rem;
}

/* Scrollbar personnalisée */
.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.help-content::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 10px;
    box-shadow: 0 0 10px #00ffff;
}

.help-content::-webkit-scrollbar-thumb:hover {
    background: #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

/* Responsive */
@media (max-width: 768px) {
    .glitch {
        font-size: 3rem;
    }
    
    .hint {
        font-size: 1rem;
    }
    
    .key-icon {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .score-panel {
        gap: 0.5rem;
    }
    
    .help-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .help-content h2 {
        font-size: 1.5rem;
    }
    
    .element-grid {
        grid-template-columns: 1fr;
    }
    
    .secret-code {
        font-size: 1.2rem;
        letter-spacing: 0.3rem;
    }
}
