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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0B0E14;
    color: #F8FAFC;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 48px;
    padding-top: 32px;
}

.header h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #38BDF8 0%, #22D3EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.tagline {
    font-size: 16px;
    color: #94A3B8;
    font-weight: 400;
}

.controls {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-of-type {
    margin-bottom: 32px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #F8FAFC;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.button-group {
    display: flex;
    gap: 12px;
}

.filter-btn {
    flex: 1;
    padding: 12px 20px;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94A3B8;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #1E293B;
    border-color: #38BDF8;
    color: #F8FAFC;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #38BDF8;
    border-color: #38BDF8;
    color: #0B0E14;
    font-weight: 600;
}

.topic-select {
    width: 100%;
    padding: 12px 16px;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #F8FAFC;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topic-select:hover,
.topic-select:focus {
    border-color: #38BDF8;
    outline: none;
}

.topic-select option {
    background: #1E293B;
    color: #F8FAFC;
}

.start-btn,
.reset-btn,
.restart-btn {
    width: 100%;
    padding: 16px;
    background: #F97316;
    border: none;
    border-radius: 8px;
    color: #FFF;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.start-btn:hover,
.restart-btn:hover {
    background: #EA580C;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.reset-btn {
    background: #475569;
    margin-top: 24px;
}

.reset-btn:hover {
    background: #64748B;
    box-shadow: 0 8px 24px rgba(71, 85, 105, 0.3);
}

.test-area {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 32px;
}

.timer-box {
    text-align: center;
    margin-bottom: 32px;
}

.timer {
    display: inline-block;
    font-size: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #22D3EE;
    padding: 12px 32px;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 8px;
}

.text-display {
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    font-size: 18px;
    line-height: 1.8;
    letter-spacing: 0.01em;
    min-height: 200px;
}

.text-display span {
    position: relative;
    color: #64748B;
}

.text-display span.correct {
    color: #22D3EE;
}

.text-display span.incorrect {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 2px;
}

.text-display span.current {
    background: #38BDF8;
    color: #0B0E14;
    font-weight: 600;
}

.input-area {
    margin-bottom: 0;
}

.user-input {
    width: 100%;
    min-height: 200px;
    padding: 24px;
    background: #0F172A;
    border: 2px solid #334155;
    border-radius: 8px;
    color: #F8FAFC;
    font-size: 18px;
    line-height: 1.8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    resize: vertical;
    transition: all 0.2s ease;
}

.user-input:focus {
    outline: none;
    border-color: #38BDF8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.user-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.results h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #F8FAFC;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-card {
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    border-color: #38BDF8;
}

.result-label {
    font-size: 13px;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 12px;
}

.result-value {
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #38BDF8;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .result-cards {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 36px;
    }
}