:root {
    --bg: #0b0c15; --panel: rgba(20, 25, 40, 0.9);
    --primary: #00e5ff; --secondary: #9d00ff; --success: #00ff88; --danger: #ff3366;
    --text: #fff;
}

body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: 'Exo 2', sans-serif; height: 100vh; overflow: hidden;
}

/* Éléments Spatiaux (Fond) */
.stars, .twinkling { position: absolute; top:0; left:0; width:100%; height:100%; pointer-events:none; }
.stars { background: #000 url('http://www.script-tutorials.com/demos/360/images/stars.png') repeat top center; z-index: -2; }
.twinkling { background: transparent url('http://www.script-tutorials.com/demos/360/images/twinkling.png') repeat top center; z-index: -1; animation: move 200s linear infinite; opacity: 0.5; }
@keyframes move { from {background-position:0 0;} to {background-position:-10000px 5000px;} }

.container { display: flex; justify-content: center; align-items: center; height: 100%; }

/* Écrans */
.screen {
    width: 90%; max-width: 1000px; height: 85vh;
    background: var(--panel); border: 1px solid rgba(0,229,255,0.3);
    border-radius: 15px; padding: 20px;
    display: flex; flex-direction: column; align-items: center;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}
.hidden { display: none !important; }

/* Menu & Tabs */
h1 { font-family: 'Orbitron'; font-size: 3rem; margin: 10px 0 0; color: var(--primary); text-shadow: 0 0 15px var(--primary); }
.subtitle { color: #888; letter-spacing: 4px; margin-bottom: 20px; }

.tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.tab-btn {
    background: rgba(255,255,255,0.05); border: 1px solid #444; color: #aaa;
    padding: 10px 20px; cursor: pointer; font-family: 'Orbitron'; transition: 0.3s;
}
.tab-btn.active, .tab-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); }

.level-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px; width: 100%; overflow-y: auto; padding: 10px;
}
.level-card {
    background: rgba(0,0,0,0.3); border: 1px solid #444; padding: 15px;
    cursor: pointer; transition: 0.2s; text-align: center;
}
.level-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,229,255,0.2); }
.level-title { font-weight: bold; color: var(--primary); margin-bottom: 5px; }
.level-desc { font-size: 0.8rem; color: #ccc; }

/* Jeu */
.hud { display: flex; justify-content: space-between; width: 100%; margin-bottom: 15px; font-family: 'Orbitron'; font-size: 1.2rem; }
.text-display-area {
    flex-grow: 1; width: 100%; background: rgba(0,0,0,0.5); border-radius: 10px;
    padding: 30px; margin-bottom: 20px; font-family: 'Roboto Mono'; font-size: 2rem;
    white-space: pre-wrap; line-height: 1.5; overflow-y: auto; text-align: left;
    border: 2px solid #333;
}

/* Lettres */
.correct { color: var(--success); text-shadow: 0 0 5px var(--success); }
.wrong { color: var(--danger); text-decoration: underline; background: rgba(255,50,100,0.2); }
.current { background: var(--primary); color: #000; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.6; } }

/* Clavier */
.keyboard { margin-top: auto; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.row { display: flex; gap: 5px; }
.key {
    width: 45px; height: 45px; border: 1px solid #555; border-radius: 5px;
    display: flex; justify-content: center; align-items: center;
    font-family: 'Roboto Mono'; color: #fff; transition: 0.1s;
}
.key.space { width: 250px; }
.key.active { background: var(--primary); color: #000; transform: scale(1.1); box-shadow: 0 0 15px var(--primary); }
.key.error-anim { animation: shake 0.3s; background: var(--danger); }

/* Briefing */
.briefing-card { text-align: left; max-width: 600px; margin: 20px 0; line-height: 1.6; font-size: 1.1rem; }
.key-visual { font-size: 3rem; color: var(--primary); text-align: center; margin-bottom: 20px; font-family: 'Roboto Mono'; }
.finger-advice { margin-top: 15px; font-style: italic; color: #aaa; border-left: 3px solid var(--secondary); padding-left: 15px; }

/* Boutons */
button { font-family: 'Orbitron'; padding: 10px 25px; border: none; cursor: pointer; font-size: 1rem; border-radius: 4px; margin: 5px; }
.primary-btn { background: var(--primary); color: #000; }
.secondary-btn { background: transparent; border: 1px solid #666; color: #ccc; }
.quit-btn { background: #333; color: #fff; margin-top: 10px; }

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