:root {
    --bg: #0b0f1a;
    --card: #161d2f;
    --accent: #00f2ff;
    --text: #f8fafc;
    --dim: #475569;
    --error: #ff4757;
    --success: #2ed573;
}

body {
    background: radial-gradient(circle at center, #1e293b 0%, #0b0f1a 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.app-container {
    background: var(--card);
    width: 90%;
    max-width: 900px;
    padding: 3rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

.selector-wrapper .label { font-size: 0.7rem; font-weight: 800; color: var(--dim); display: block; margin-bottom: 5px; }
select {
    background: #1e293b; color: white; border: 1px solid var(--accent);
    padding: 10px 15px; border-radius: 12px; outline: none; cursor: pointer;
}

.stats-bar { display: flex; gap: 40px; }
.stat { font-size: 0.7rem; color: var(--dim); font-weight: 800; text-align: center; }
.stat span { display: block; font-size: 2.2rem; color: var(--accent); text-shadow: 0 0 15px rgba(0, 242, 255, 0.3); }

.progress-wrapper { width: 100%; height: 6px; background: #0f172a; border-radius: 10px; margin-bottom: 30px; overflow: hidden; }
#progress-bar { width: 0%; height: 100%; background: linear-gradient(to right, var(--accent), var(--success)); transition: width 0.3s; }

.text-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    line-height: 1.6;
    color: var(--dim);
    margin-top: 1rem;
    user-select: none;
}

#keyboard-handler { position: absolute; opacity: 0; pointer-events: none; }

.char.correct { color: var(--text); text-shadow: 0 0 5px rgba(255,255,255,0.2); }
.char.incorrect { color: var(--error); border-bottom: 2px solid var(--error); background: rgba(255, 71, 87, 0.1); }
.char.current { border-left: 3px solid var(--accent); background: rgba(0, 242, 255, 0.1); animation: blink 0.8s infinite; }

@keyframes blink { 50% { border-color: transparent; } }

.feedback-msg { color: var(--dim); font-style: italic; font-size: 0.9rem; }
.btn-glass { background: rgba(255,255,255,0.05); border: 1px solid var(--dim); color: var(--text); padding: 10px 20px; border-radius: 10px; cursor: pointer; }
.btn-glass:hover { background: rgba(255,255,255,0.1); border-color: var(--text); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.hidden { display: none; }
.modal-content { background: var(--card); padding: 4rem; border-radius: 30px; text-align: center; border: 1px solid var(--accent); }
.btn-next { background: var(--accent); color: #000; border: none; padding: 15px 30px; border-radius: 12px; font-weight: 800; cursor: pointer; margin-top: 20px; }