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

:root {
    --bg-top: #dbeafe;
    --bg-bottom: #fde68a;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #0f766e;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --danger: #dc2626;
    --good: #15803d;
    --border: rgba(15, 23, 42, 0.14);
    --shadow: 0 24px 45px rgba(15, 23, 42, 0.18);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.75), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(15, 118, 110, 0.16), transparent 45%),
        linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
    color: var(--text-main);
    font-family: "DM Sans", sans-serif;
}

.container {
    width: min(880px, 100%);
    padding: 28px;
    border-radius: 28px;
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
    animation: reveal 360ms ease;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 6px 10px;
    border-radius: 999px;
}

h1 {
    margin-top: 14px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.1;
}

.subtitle {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 1rem;
}

.timer-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.timer-buttons button {
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-buttons button:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.45);
}

.timer-buttons button.active {
    background: linear-gradient(135deg, #115e59, #0f766e);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.paragraph-box {
    margin-top: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.8;
    color: #1e293b;
    min-height: 138px;
}

.paragraph-box span {
    transition: color 0.16s ease, background-color 0.16s ease;
}

.input-label {
    margin-top: 16px;
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    height: 125px;
    margin-top: 8px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    background: var(--surface-strong);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
    border-color: rgba(15, 118, 110, 0.65);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.controls-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#restart-btn {
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#restart-btn:hover {
    border-color: rgba(15, 118, 110, 0.45);
}

#progress-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.progress-track {
    margin-top: 10px;
    height: 9px;
    width: 100%;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0f766e, #14b8a6);
    border-radius: inherit;
    transition: width 0.18s ease;
}

.stats {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
}

.card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.card h2 {
    margin-top: 5px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.3rem, 4vw, 1.65rem);
}

.paragraph-box .active {
    background: #fef3c7;
    border-radius: 4px;
}

.paragraph-box .correct {
    color: var(--good);
}

.paragraph-box .wrong {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.14);
    border-radius: 4px;
}

@media (max-width: 700px) {
    .container {
        padding: 20px;
        border-radius: 20px;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    body {
        padding: 14px;
    }

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

    .timer-buttons button {
        flex: 1;
        min-width: 78px;
    }

    .controls-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
