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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

.input-section {
    margin-bottom: 30px;
}

#textInput {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
}

#textInput:focus {
    outline: none;
    border-color: #3498db;
}

#textInput::selection {
    background-color: #f1c40f;
    color: #333;
}

.input-info {
    text-align: right;
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 8px;
}

.reader-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px 40px 10px;

    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.word-display {
    font-size: 32px;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.word-display .focus-letter {
    color: #e74c3c;
    font-weight: 700;
}

.word-display .active {
    color: #8B0000;
}

.reader-info {
    margin-top: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin-top: 25px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.15s ease;
}

.reader-info span {
    margin: 0 5px;
}

.controls-section {
    margin-bottom: 30px;
}

.playback-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.btn-primary {
    background-color: #2ecc71;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #27ae60;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.settings-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.setting {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.setting:last-child {
    margin-bottom: 0;
}

.setting label {
    min-width: 150px;
    font-weight: 500;
}

.setting input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.setting input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
}

.setting span {
    min-width: 60px;
    text-align: right;
    font-weight: 500;
    color: #2c3e50;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .word-display {
        font-size: 24px;
    }

    .playback-controls {
        flex-wrap: wrap;
    }

    .btn {
        padding: 10px 20px;
    }

    .setting {
        flex-wrap: wrap;
    }

    .setting label {
        min-width: 100%;
    }
}