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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #4a5568;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
}

.stat-item .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-item .value {
    font-size: 2rem;
    font-weight: bold;
    display: inline-block;
}

.stat-item .unit {
    font-size: 1rem;
    opacity: 0.8;
    margin-left: 2px;
}

main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.6);
}

select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-display {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-container {
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: center;
    color: #2d3748;
}

.text-container .correct {
    color: #28a745;
    background-color: #d4edda;
    padding: 2px 4px;
    border-radius: 3px;
}

.text-container .incorrect {
    color: #dc3545;
    background-color: #f8d7da;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: line-through;
}

.text-container .current {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 3px solid #ffc107;
}

.input-area {
    margin-bottom: 20px;
}

#userInput {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

#userInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#userInput:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.results {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    margin-top: 20px;
}

.results h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.result-item {
    text-align: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    min-width: 100px;
}

.result-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.8rem;
    font-weight: bold;
    display: inline-block;
}

.result-unit {
    font-size: 1rem;
    opacity: 0.8;
    margin-left: 2px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        gap: 20px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 20px;
    }
    
    main {
        padding: 20px;
    }
    
    .controls {
        gap: 15px;
    }
    
    .text-container {
        font-size: 1.1rem;
    }
    
    #userInput {
        font-size: 1rem;
        padding: 15px;
    }
    
    .result-stats {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .stats {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .text-container {
        font-size: 1rem;
    }
}