
.test-container {
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}

.test-header {
    margin-bottom: 2rem;
}

.test-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #ffffff;
    border: 1px solid #333333;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

.difficulty-btn.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.difficulty-btn:hover {
    border-color: #ffffff;
    background: #ffffff;
    color: #000000;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    background: #111111;
    border: 1px solid #333333;
    padding: 1rem;
    margin-bottom: 2rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 0.8rem;
    color: #cccccc;
    margin-top: 0.25rem;
}

.test-area {
    background: #111111;
    border: 2px solid #333333;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: text;
    overflow: hidden;
}

.test-area.active {
    border-color: #ffffff;
}

.words-container {
    width: 100%;
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.words-display {
    font-size: 1.5rem;
    line-height: 1.5;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.word {
    margin: 0 1.5rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.word.completed {
    color: #4CAF50;
    opacity: 0.4;
}

.word.current {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.word.upcoming {
    color: #666666;
    opacity: 0.6;
}

.word.error {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.word-container {
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.current-input-display {
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
    font-size: 0.9rem;
    color: #888888;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.3rem;
    border-top: 1px solid #333333;
}

.char {
    position: relative;
    transition: all 0.2s ease;
}

.char.correct {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 2px;
}

.char.incorrect {
    color: #f44336;
    background: rgba(244, 67, 54, 0.3);
    border-radius: 2px;
    animation: shake 0.3s ease-in-out;
}

.char.current {
    background: #ffffff;
    color: #000000;
    animation: blink 1s infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

.char.pending {
    color: #888888;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.6; }
}

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

.real-time-feedback {
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.real-time-feedback.show {
    opacity: 1;
}

.real-time-feedback.correct {
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.real-time-feedback.incorrect {
    color: #f44336;
    border: 1px solid #f44336;
}

.typing-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #333333;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 0.3s ease;
}

.test-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.results-content {
    background: #111111;
    border: 2px solid #ffffff;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.results-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.results-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.result-stat {
    padding: 1rem;
    background: #000000;
    border: 1px solid #333333;
}

.result-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.result-stat-label {
    font-size: 0.9rem;
    color: #cccccc;
    margin-top: 0.5rem;
}

.achievements-unlocked {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333333;
}

.achievement {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    color: #000000;
    border-radius: 20px;
    font-size: 0.8rem;
    animation: slideIn 0.5s ease-out;
}

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

@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .difficulty-selector {
        flex-direction: column;
        align-items: center;
    }

    .test-area {
        padding: 1rem;
    }

    .words-display {
        font-size: 1rem;
    }

    .results-stats {
        grid-template-columns: 1fr;
    }

    .test-controls {
        flex-direction: column;
        align-items: center;
    }
}
