/* ============================================================
   reading-time / style.css
   Prefix: rtc-
   ============================================================ */

.rtc-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Section Cards --- */
.rtc-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border: 1px solid #eee;
    margin-bottom: 16px;
}

.rtc-section-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0d6efd;
}

/* --- Textarea --- */
.rtc-textarea {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    padding: 12px 14px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
    color: #222;
    background: #fff;
    height: 180px;
}

.rtc-textarea:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

/* --- Char info bar --- */
.rtc-char-bar {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #555;
    padding: 6px 4px;
    flex-wrap: wrap;
}

.rtc-char-num {
    font-weight: 700;
    color: #0d6efd;
}

/* --- Preset buttons --- */
.rtc-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.rtc-preset-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    white-space: nowrap;
}

.rtc-preset-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.rtc-preset-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* --- Slider row --- */
.rtc-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rtc-slider-label {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    white-space: nowrap;
}

.rtc-slider {
    flex: 1;
    min-width: 120px;
    accent-color: #0d6efd;
    height: 4px;
    cursor: pointer;
}

.rtc-slider-val {
    font-size: 13px;
    font-weight: 700;
    color: #0d6efd;
    min-width: 80px;
    text-align: right;
    white-space: nowrap;
}

/* --- Main result card --- */
.rtc-result-card {
    background: linear-gradient(135deg, #0d6efd 0%, #0056d2 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 4px;
}

.rtc-result-time {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 6px;
}

.rtc-result-sub {
    font-size: 13px;
    opacity: 0.8;
}

.rtc-result-empty {
    font-size: 16px;
    opacity: 0.7;
    padding: 10px 0;
}

/* --- Comparison Table --- */
.rtc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rtc-table th {
    background: #f0f4ff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #dde4f5;
}

.rtc-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.rtc-table tr.highlighted td {
    background: #eff6ff;
    font-weight: 700;
    color: #0d6efd;
}

.rtc-table tr:last-child td {
    border-bottom: none;
}

.rtc-table td:nth-child(2) {
    text-align: center;
    color: #888;
}

.rtc-table td:nth-child(3) {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* --- Reverse calc --- */
.rtc-reverse-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rtc-reverse-label {
    font-size: 14px;
    color: #444;
    white-space: nowrap;
}

.rtc-num-input {
    width: 72px;
    padding: 7px 10px;
    font-size: 15px;
    font-weight: 700;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    text-align: center;
    transition: border-color 0.2s;
}

.rtc-num-input:focus {
    border-color: #0d6efd;
    outline: none;
}

.rtc-reverse-result {
    font-size: 14px;
    font-weight: 700;
    color: #0d6efd;
    padding: 6px 12px;
    background: #eff6ff;
    border-radius: 6px;
    white-space: nowrap;
}

/* --- Prompter section --- */
.rtc-prompter-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.rtc-ctrl-btn {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.rtc-ctrl-btn.start {
    background: #198754;
    color: #fff;
}

.rtc-ctrl-btn.start:hover {
    background: #146c43;
}

.rtc-ctrl-btn.pause {
    background: #fd7e14;
    color: #fff;
}

.rtc-ctrl-btn.pause:hover {
    background: #d9621d;
}

.rtc-ctrl-btn.reset {
    background: #6c757d;
    color: #fff;
}

.rtc-ctrl-btn.reset:hover {
    background: #545b62;
}

.rtc-ctrl-sep {
    width: 1px;
    height: 28px;
    background: #ddd;
    margin: 0 4px;
}

.rtc-ctrl-label {
    font-size: 12px;
    color: #888;
    font-weight: 700;
    white-space: nowrap;
}

.rtc-speed-slider {
    width: 90px;
    accent-color: #0d6efd;
    cursor: pointer;
}

.rtc-font-select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1.5px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

/* --- Prompter viewport --- */
.rtc-prompter-wrap {
    position: relative;
    height: 280px;
    background: #0f0f1a;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #2d2d4a;
}

.rtc-prompter-guide {
    position: absolute;
    top: 28%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(13, 110, 253, 0.5);
    z-index: 10;
    pointer-events: none;
}

.rtc-prompter-guide::before {
    content: '▶ 読む位置';
    position: absolute;
    left: 8px;
    top: -9px;
    font-size: 10px;
    color: rgba(13, 110, 253, 0.7);
    font-weight: 700;
    white-space: nowrap;
}

.rtc-prompter-scroll {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 28px 40px;
    /* translateY is controlled entirely by JS */
    will-change: transform;
}

.rtc-prompter-text {
    color: #f0f0f0;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    transition: font-size 0.2s;
}

.rtc-prompter-done {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.85);
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #6ee7b7;
    letter-spacing: 0.03em;
}

.rtc-prompter-done.visible {
    display: flex;
}

/* --- Timer bar --- */
.rtc-timer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 0;
    font-size: 13px;
    color: #666;
}

.rtc-timer-elapsed {
    font-weight: 700;
    color: #0d6efd;
    font-variant-numeric: tabular-nums;
}

.rtc-timer-estimate {
    color: #999;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .rtc-presets {
        gap: 4px;
    }

    .rtc-preset-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .rtc-result-time {
        font-size: 32px;
    }

    .rtc-prompter-controls {
        gap: 6px;
    }

    .rtc-ctrl-btn {
        padding: 7px 12px;
        font-size: 13px;
    }

    .rtc-reverse-row {
        flex-direction: column;
        align-items: flex-start;
    }
}