:root {
    --sidebar-width: min(20vw, 400px);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
}

.reading-container {
    width: calc(100% - var(--sidebar-width));
    margin-left: 0;
    margin-right: 0;
    padding: 30px 20px 30px 40px;
    min-height: 100vh;
    transition: width 0.3s ease;
    overflow-x: hidden;
}

.reading-container p {
    width: 100%;
    max-width: 45ch;
    margin: 0 auto;
    font-size: 26px;
    line-height: 1.7;
    padding-top: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.paste-mode-spacer {
    width: 100%;
    flex-shrink: 0;
}

.bottom-spacer {
    width: 100%;
    flex-shrink: 0;
}

.word {
    color: #e0e0e0;
    transition: none;
}

.word.revealed {
    color: #000000;
}

.controls {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    padding: 30px 25px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.05);
}

.controls::-webkit-scrollbar {
    width: 6px;
}

.controls::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.controls::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.controls::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.controls h3 {
    margin: 0 0 25px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.control-group select,
.control-group input[type="range"],
.control-group textarea {
    width: 100%;
    font-family: inherit;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.control-group select:hover {
    border-color: #999;
}

.control-group select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.control-group input[type="range"] {
    margin-top: 8px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

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

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #357abd;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #357abd;
}

.value-display {
    display: inline-block;
    margin-left: 8px;
    color: #4a90e2;
    font-weight: 600;
    font-size: 13px;
}

.paste-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.paste-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.paste-section textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.paste-section textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.paste-section button {
    width: 100%;
    padding: 12px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.paste-section button:hover {
    background: #357abd;
}

.paste-section button:active {
    transform: scale(0.98);
}

.paste-section button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

