/* ── Story Lesson Reader – light theme ─────────────────────────────── */

/* ── Reader wrapper ─────────────────────────────────────────────────── */

.sf-reader {
    padding: 4px 0 40px;
    color: #1e293b;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.sf-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    margin-bottom: 20px;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    gap: 10px;
}

.sf-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1.5px solid #e5e7eb;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    color: #64748b;
    text-decoration: none;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    -webkit-transition: background 0.15s, color 0.15s;
            transition: background 0.15s, color 0.15s;
}

.sf-back-btn:hover {
    background: #e2e8f0;
    color: #1d4ed8;
}

.sf-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-style: italic;
    color: #1e293b;
    margin: 0;
}

.sf-chapter-pill {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 50px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1d4ed8;
    white-space: nowrap;
}

/* ── Scene (image / placeholder) ────────────────────────────────────── */

.sf-scene {
    width: 100%;
    background: #f1f5f9;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
    -ms-flex-negative: 0;
        flex-shrink: 0;
}

.story-chapter-img {
    width: 100%;
    height: auto;
    display: block;
}

.sf-scene-placeholder {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    color: #cbd5e1;
    font-size: 3rem;
}

/* ── Story card ──────────────────────────────────────────────────────── */

.sf-story-wrap {
    background: #ffffff;
    border: 1.5px solid #b2b5b8;
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 16px;
}

.sf-chapter-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 14px;
}

.sf-story-text {
    font-size: 1.05rem;
    line-height: 2;
    color: #374151;
}

/* ── Blank spans ─────────────────────────────────────────────────────── */

.story-blank {
    display: inline-block;
    min-width: 90px;
    border-bottom: 2.5px dashed #60a5fa;
    color: #f59e0b;
    font-weight: 700;
    cursor: pointer;
    padding: 0 6px 2px;
    border-radius: 4px 4px 0 0;
    -webkit-transition: background 0.15s, border-color 0.15s;
            transition: background 0.15s, border-color 0.15s;
    vertical-align: baseline;
    text-align: center;
    font-style: italic;
    font-size: 0.95rem;
}

.story-blank:hover {
    background: #eff6ff;
}

.story-blank.active {
    border-bottom: 2.5px solid #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

.story-blank.filled {
    border-bottom: 2.5px solid #1d4ed8;
    background: #eff6ff;
    color: #1d4ed8;
    font-style: normal;
    font-weight: 700;
    cursor: default;
}

.story-blank.wrong {
    border-bottom: 2.5px solid #ef4444;
    background: #fef2f2;
    color: #ef4444;
    font-style: normal;
    font-weight: 700;
    cursor: default;
}

/* ── Note strip ─────────────────────────────────────────────────────── */

.sf-note {
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-left: 3px solid #0284c7;
    border-radius: 0 12px 12px 0;
    padding: 12px 16px;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #0369a1;
    margin-bottom: 16px;
    display: none;
    opacity: 0;
}

/* ── Options panel ───────────────────────────────────────────────────── */

.sf-options-panel {
    background: #f8fafc;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px 22px;
    margin-bottom: 16px;
}

.sf-options-label {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #94a3b8;
    margin-bottom: 12px;
}

.sf-options-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    gap: 8px;
}

.story-option-btn {
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    -webkit-transition: border-color 0.15s, color 0.15s, background 0.15s, -webkit-transform 0.1s;
            transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}

.story-option-btn:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
    background: #eff6ff;
    -webkit-transform: translateY(-2px);
            transform: translateY(-2px);
}

.story-option-btn.selected {
    border-color: #1d4ed8;
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Nav row ─────────────────────────────────────────────────────────── */

.sf-nav-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sf-progress-pips {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 6px;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
}

.sf-pip {
    height: 6px;
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    max-width: 60px;
    border-radius: 99px;
    background: #e2e8f0;
    border: 1px solid #e5e7eb;
    -webkit-transition: background 0.4s;
            transition: background 0.4s;
    display: inline-block;
}

.sf-pip.done   { background: #60a5fa; }
.sf-pip.active { background: #f59e0b; }

/* ── Next chapter button ─────────────────────────────────────────────── */

.sf-btn-nav {
    background: -webkit-gradient(linear, left top, right bottom, from(#1d4ed8), to(#1e40af));
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 26px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.18s;
            transition: transform 0.18s;
    white-space: nowrap;
}

.sf-btn-nav:hover {
    -webkit-transform: translateY(-2px);
            transform: translateY(-2px);
}

/* ── Ending card ─────────────────────────────────────────────────────── */

.sf-ending-card {
    background: #ffffff;
    border: 1.5px solid #b2b5b8;
    border-radius: 20px;
    padding: 32px;
    display: none;
}

.sf-ending-card.visible {
    display: block;
}

.sf-ending-title {
    font-size: 1.2rem;
    font-weight: 700;
    font-style: italic;
    color: #1e293b;
    margin-bottom: 6px;
}

.sf-ending-subtitle {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 0;
}

.sf-choices-wrap {
    background: #f8fafc;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 18px;
}

.sf-choices-heading {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 12px;
}

/* ── Choices recap rows ──────────────────────────────────────────────── */

.recap-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.recap-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 50px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.recap-indicator {
    font-size: 0.9rem;
    font-weight: 700;
    -ms-flex-negative: 0;
        flex-shrink: 0;
}

.recap-indicator.correct { color: #16a34a; }
.recap-indicator.wrong   { color: #ef4444; }

.recap-word {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1d4ed8;
}

.recap-word.wrong { color: #ef4444; }

.recap-correct-hint {
    font-size: 0.82rem;
    color: #16a34a;
    font-style: italic;
}

.recap-divider {
    border-color: #e5e7eb;
    opacity: 1;
    margin: 10px 0;
}

/* Ending action buttons */
.sf-btn-primary {
    background: -webkit-gradient(linear, left top, right bottom, from(#1d4ed8), to(#1e40af));
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-transition: opacity 0.15s;
            transition: opacity 0.15s;
    text-align: center;
    display: inline-block;
}

.sf-btn-primary:hover { opacity: 0.88; }

.sf-btn-secondary {
    background: transparent;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    -webkit-transition: border-color 0.15s, color 0.15s;
            transition: border-color 0.15s, color 0.15s;
    display: inline-block;
}

.sf-btn-secondary:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
}

.sf-info-alert {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #1d4ed8;
}

.sf-link { color: #1d4ed8; }
.sf-link:hover { color: #1e40af; }

