/* Reset & font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: #161b22;
    border-radius: 16px;
    padding: 30px 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid #30363d;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #f0f6fc;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 15px;
    color: #8b949e;
    margin-bottom: 22px;
}

/* Textarea */
#textInput {
    width: 100%;
    min-height: 200px;
    background: #0d1117;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 16px;
    line-height: 1.7;
    resize: vertical;
    transition: border 0.2s;
    font-family: inherit;
}

#textInput:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#textInput::placeholder {
    color: #484f58;
}

/* Stats grid */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 24px 0 20px;
}

.stat-item {
    background: #0d1117;
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #21262d;
    transition: border 0.2s;
}

.stat-item:hover {
    border-color: #30363d;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #f0f6fc;
}

.stat-item.highlight .stat-value {
    color: #58a6ff;
}

/* Settings */
.settings {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #0d1117;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid #21262d;
    margin-bottom: 18px;
}

.settings label {
    font-size: 14px;
    color: #c9d1d9;
}

.settings input[type="number"] {
    width: 80px;
    background: #0d1117;
    color: #e6edf3;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.settings input[type="number"]:focus {
    outline: none;
    border-color: #58a6ff;
}

.settings input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
}

.wpm-unit {
    font-size: 14px;
    color: #8b949e;
}

/* Button */
#loadSampleBtn {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#loadSampleBtn:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #f0f6fc;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px 16px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    h1 {
        font-size: 22px;
    }

    .stat-value {
        font-size: 20px;
    }

    .settings {
        flex-direction: column;
        align-items: stretch;
    }

    .settings input[type="number"] {
        width: 100%;
    }
}