* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #eef4ff, #dbeafe);
    color: #1f2937;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.app-container {
    width: 100%;
    max-width: 1000px;
}

.hero-section {
    text-align: center;
    margin-bottom: 35px;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    color: #111827;
}

.hero-section p {
    max-width: 650px;
    margin: auto;
    color: #4b5563;
    line-height: 1.6;
    font-size: 1.05rem;
}

.test-card {
    background: white;
    border-radius: 22px;
    padding: 35px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

.settings-section {
    text-align: center;
    margin-bottom: 35px;
}

.settings-section h2 {
    margin-bottom: 18px;
}

.duration-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.duration-btn {
    border: none;
    padding: 12px 26px;
    border-radius: 40px;
    background: #e5e7eb;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: 0.25s;
}

.duration-btn:hover {
    transform: translateY(-2px);
}

.duration-btn.active {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: white;
}

.primary-btn {
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 14px 34px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: 0.25s;
}

.primary-btn:hover {
    transform: translateY(-3px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 35px;
}

.stat-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.stat-label {
    display: block;
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 0.95rem;
}

.stat-box strong {
    font-size: 2rem;
}

.typing-section h2 {
    margin-bottom: 15px;
}

.paragraph-display {
    background: #f9fafb;
    border: 2px solid #dbeafe;
    border-radius: 14px;
    padding: 16px 20px;
    line-height: 1.7;
    font-size: 1.08rem;
    margin-bottom: 22px;
    min-height: 72px;
    display: flex;
    align-items: center;
}

textarea {
    width: 100%;
    min-height: 180px;
    resize: none;
    border-radius: 14px;
    border: 2px solid #d1d5db;
    padding: 18px;
    font-size: 1rem;
    transition: 0.25s;
    outline: none;
}

textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.results-section {
    margin-top: 40px;
}

.results-section h2 {
    text-align: center;
    margin-bottom: 22px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.result-box {
    background: linear-gradient(135deg, #f8fafc, #eef4ff);
    border-radius: 16px;
    text-align: center;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.result-box span {
    display: block;
    color: #6b7280;
    margin-bottom: 10px;
}

.result-box strong {
    font-size: 2rem;
    color: #2563eb;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    body {
        padding: 20px 12px;
    }

    .test-card {
        padding: 22px;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .stats-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .duration-buttons {
        flex-direction: column;
    }

    .duration-btn,
    .primary-btn {
        width: 100%;
    }

    .paragraph-display {
        min-height: 68px;
        font-size: 1rem;
    }
}