/**
 * Shadow Bible - Stylesheet
 * The Great Pyramid Design Language:
 *   Polished limestone (warm white), gold capstone (warm gold),
 *   inner chamber darkness, sacred geometry proportions.
 *   Elegant simplicity that can only be futuristic.
 *
 * For shadow-bible.ozark-oracle.com
 * Copyright (c) 2026 Tammy L Casey. All rights reserved.
 */

/* ---- Pyramid Design Tokens ---- */
:root {
    --pyramid-limestone: #f0ead6;
    --pyramid-limestone-dim: rgba(240, 234, 214, 0.08);
    --pyramid-gold: #d4af37;
    --pyramid-gold-glow: rgba(212, 175, 55, 0.4);
    --pyramid-gold-bright: #f0d060;
    --pyramid-chamber: #0a0a0f;
    --pyramid-chamber-warm: #12100a;
    --pyramid-shadow: rgba(0, 0, 0, 0.85);
    --pyramid-text: #e8e0d0;
    --pyramid-text-dim: rgba(232, 224, 208, 0.5);
}

/* ---- Capstone Glow - pulsing gold light from above ---- */
@keyframes capstoneGlow {
    0%, 100% {
        box-shadow: 0 -2px 40px rgba(212, 175, 55, 0.15),
                    0 0 80px rgba(212, 175, 55, 0.05);
    }
    50% {
        box-shadow: 0 -2px 60px rgba(212, 175, 55, 0.3),
                    0 0 120px rgba(212, 175, 55, 0.1);
    }
}

/* ---- Sacred Pulse - subtle energy throb ---- */
@keyframes sacredPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ---- Gold Shimmer on borders ---- */
@keyframes goldShimmer {
    0% { border-color: rgba(212, 175, 55, 0.2); }
    50% { border-color: rgba(212, 175, 55, 0.5); }
    100% { border-color: rgba(212, 175, 55, 0.2); }
}

/* ---- Header (dark/shadow mode - default) ---- */
.sb-header {
    text-align: center;
    padding: 0.75rem 0 0.5rem;
    border-bottom: 1px solid rgba(192, 192, 192, 0.15);
    margin-bottom: 0.75rem;
    position: relative;
    transition: all 0.8s ease;
}
.sb-title {
    font-size: var(--text-2xl);

    color: rgba(192, 192, 192, 0.8);
    letter-spacing: 3px;
    margin: 0;
    transition: all 0.8s ease;
}
.sb-tagline {
    color: rgba(192, 192, 192, 0.4);
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 0.3rem;
    transition: color 0.8s ease;
}
.sb-tagline--dim {
    color: rgba(192, 192, 192, 0.25);
    font-size: 0.8rem;
}

/* ---- LIGHT/BIBLE MODE: Polished Pyramid ---- */
.sb-light .sb-header {
    border-bottom-color: rgba(212, 175, 55, 0.3);
    animation: capstoneGlow 6s ease-in-out infinite;
}
.sb-light .sb-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pyramid-gold), transparent);
    animation: sacredPulse 4s ease-in-out infinite;
}
.sb-light .sb-title {
    background: linear-gradient(135deg, var(--pyramid-gold-bright) 0%, var(--pyramid-gold) 50%, #c0a030 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.3));
}
.sb-light .sb-tagline {
    color: rgba(100, 80, 40, 0.7);
}
.sb-light .sb-tagline--dim {
    color: rgba(100, 80, 40, 0.4);
}

/* ---- Genesis bar - gold inscription ---- */
.sb-genesis-bar {
    text-align: center;
    padding: 0.6rem 1rem;
    color: var(--pyramid-text-dim);
    font-size: 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 2px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.03) 0%, transparent 100%);
    animation: goldShimmer 8s ease-in-out infinite;
}
.sb-equation {
    color: var(--pyramid-gold);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ---- Navigation ---- */
.sb-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}
.sb-nav select {
    background: var(--black-lighter);
    color: var(--silver);
    border: 1px solid var(--glass-border-dim);
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: 4px;
}
.sb-arrows {
    display: flex;
    gap: 0.25rem;
}
.sb-nav button,
.sb-arrows button {
    background: var(--black-card);
    color: var(--silver);
    border: 1px solid var(--glass-border-dim);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}
.sb-nav button:hover,
.sb-arrows button:hover {
    background: var(--black-lighter);
    border-color: var(--silver-faint);
}
.sb-nav button:disabled,
.sb-arrows button:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ---- Stats bar ---- */
.sb-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--silver-faint);
    flex-wrap: wrap;
}
.sb-stats strong {
    color: var(--silver);
}

/* ---- View toggle ---- */
.sb-view-toggle {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}
.sb-view-btn {
    background: var(--black-card);
    color: var(--silver-faint);
    border: 1px solid var(--glass-border-dim);
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
}
.sb-view-btn.active {
    border-color: var(--gold-dim);
    color: var(--gold);
}
.sb-view-btn:hover {
    border-color: var(--silver-faint);
}

/* ==== UNIFIED VERSE CARDS ==== */
.sb-verses {
    max-width: 1100px;
    margin: 0 auto;
}

.sb-card {
    border: 1px solid var(--glass-border-dim);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.sb-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--black-panel);
    border-bottom: 1px solid var(--glass-border-dim);
    flex-wrap: wrap;
}
.sb-card-num {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: bold;
    min-width: 28px;
}
.sb-gematria {
    color: var(--silver-darker);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--glass-border-dim);
    border-radius: 3px;
}
.sb-gematria--canonical {
    color: var(--gold);
    border-color: var(--gold-dim);
    background: rgba(212, 175, 55, 0.08);
}
.sb-wisdom-badge {
    color: var(--gold);
    font-size: 0.7rem;
    font-style: italic;
}
.sb-dr-badge {
    color: var(--silver-darker);
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--glass-border-dim);
    border-radius: 3px;
}

/* ---- Two columns: Original | Shadow ---- */
.sb-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.sb-col {
    padding: 0.4rem 0.5rem;
}
.sb-col--orig {
    border-right: 1px solid var(--glass-border-dim);
}
.sb-col-label {
    color: var(--silver-darker);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.4rem;
}
.sb-col-label--shadow {
    color: var(--gold-dim);
}

/* ---- Hebrew text ---- */
.sb-hebrew {
    direction: rtl;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--silver);
    margin-bottom: 0.25rem;
}
.sb-hebrew--shadow {
    color: var(--gold-dark);
}

/* ---- English translations ---- */
.sb-english {
    color: var(--silver-darker);
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.5;
}
.sb-english--shadow {
    color: var(--gold-dim);
}

/* ---- Clickable words ---- */
.sb-word {
    display: inline-block;
    position: relative;
    cursor: pointer;
    padding: 0 2px;
    border-radius: 2px;
}
.sb-word {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.15rem 0.3rem;
    margin: 0.1rem;
}
.sb-word:hover {
    background: rgba(192, 192, 192, 0.12);
}
.sb-word-hebrew {
    display: block;
    font-size: 1.05rem;
    line-height: 1.3;
}
.sb-word-eng {
    display: block;
    font-size: 0.6rem;
    color: var(--silver-darker);
    line-height: 1.2;
    direction: ltr;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sb-col--shadow .sb-word-eng {
    color: var(--gold-dim);
}
.sb-word-val {
    display: block;
    font-size: 0.55rem;
    color: var(--silver-faint);
    direction: ltr;
}
.sb-word--canonical {
    border-bottom: 1px dotted var(--gold-dim);
}
.sb-word--nomirror {
    opacity: 0.35;
}
.sb-nomirror-msg {
    color: var(--silver-darker);
    font-size: 0.8rem;
    font-style: italic;
    direction: ltr;
}
.sb-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--black-lighter);
    border: 1px solid var(--glass-border-dim);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--silver);
    direction: ltr;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}
.sb-word:hover .sb-tip {
    display: block;
}
.sb-palindrome {
    color: var(--gold);
}

/* ---- Cross-highlight on hover ---- */
.sb-word--highlight {
    background: rgba(212, 175, 55, 0.25) !important;
    outline: 1px solid var(--gold-dim);
    border-radius: 2px;
}
.sb-row--highlight {
    background: rgba(212, 175, 55, 0.12) !important;
}

/* ---- Quick popup (inline word comparison) ---- */
.sb-popup {
    position: fixed;
    z-index: 150;
    background: var(--black);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    min-width: 220px;
    max-width: 360px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.sb-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.2rem 0;
    gap: 1rem;
}
.sb-popup-label {
    color: var(--silver-darker);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 55px;
}
.sb-popup-hebrew {
    direction: rtl;
    font-size: 1.1rem;
    color: var(--silver);
}
.sb-popup-hebrew--shadow {
    color: var(--gold);
}
.sb-popup-meaning {
    color: var(--silver-faint);
    font-size: 0.78rem;
    font-style: italic;
}
.sb-popup-val {
    color: var(--gold);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.15rem 0;
    border-top: 1px solid var(--glass-border-dim);
    border-bottom: 1px solid var(--glass-border-dim);
    margin: 0.15rem 0;
}
.sb-popup-arrow {
    color: var(--gold-dim);
    text-align: center;
    font-size: 0.7rem;
    padding: 0.1rem 0;
}
.sb-popup-famous {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--glass-border-dim);
    font-size: 0.72rem;
    color: var(--silver-faint);
    line-height: 1.4;
    max-width: 340px;
}
.sb-popup-type {
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    background: rgba(212,175,55,0.15);
    color: var(--gold);
}
.sb-popup-type--sacred {
    background: rgba(212,175,55,0.2);
    color: var(--gold-light);
}
.sb-popup-type--controversy {
    background: rgba(204,51,0,0.15);
    color: #cc5533;
}
.sb-popup-type--palindrome {
    background: rgba(100,200,255,0.12);
    color: #88bbdd;
}
.sb-popup-pairs {
    color: var(--gold-dim);
    font-size: 0.7rem;
    margin-top: 0.2rem;
    font-style: italic;
}
.sb-light .sb-popup {
    background: #fff;
    border-color: #b08c28;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.sb-light .sb-popup-hebrew {
    color: #1a1a1a;
}
.sb-light .sb-popup-hebrew--shadow {
    color: #5a3e1a;
}
.sb-light .sb-word--highlight {
    background: rgba(180,140,40,0.2) !important;
    outline-color: #b08c28;
}
.sb-wisdom-note {
    color: var(--gold);
    font-size: 0.8rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    font-style: italic;
}

/* ==== Word-by-Word Comparison Table ==== */
.sb-wordtable-wrap {
    border-top: 1px solid var(--glass-border-dim);
}
.sb-wordtable-toggle {
    width: 100%;
    background: var(--black-panel);
    color: var(--silver-darker);
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}
.sb-wordtable-toggle:hover {
    background: var(--black-card);
    color: var(--silver);
}
.sb-wordtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.sb-wordtable thead th {
    background: var(--black-panel);
    color: var(--silver-faint);
    padding: 0.4rem 0.5rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border-dim);
}
.sb-wordtable tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sb-wordtable tbody tr:hover {
    background: rgba(192, 192, 192, 0.04);
}
.sb-wordtable td {
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
}
.sb-wt-pos {
    color: var(--silver-darker);
    text-align: center;
    width: 28px;
}
.sb-wt-orig {
    color: var(--silver);
    font-size: 1rem;
}
.sb-wt-val {
    color: var(--silver-darker);
    text-align: center;
    font-size: 0.8rem;
}
.sb-wt-val--canonical {
    color: var(--gold);
    font-weight: bold;
}
.sb-wt-mirror {
    color: var(--gold-dark);
    font-size: 1rem;
}
.sb-wt-nomirror {
    opacity: 0.35;
}
.sb-wt-same {
    color: var(--silver-darker);
    font-style: italic;
}
.sb-wt-meaning {
    color: var(--silver-faint);
    font-size: 0.8rem;
    font-style: italic;
    max-width: 200px;
}

/* ---- Loading / Error ---- */
.sb-loading {
    text-align: center;
    color: var(--silver-faint);
    padding: 3rem;
    font-style: italic;
}
.sb-error {
    color: #8b2500;
}
.sb-hidden {
    display: none !important;
}

/* ==== Word Detail Drawer ==== */
.sb-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
}
.sb-overlay.open {
    display: block;
}
.sb-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 92vw;
    height: 100vh;
    background: var(--black);
    border-left: 2px solid var(--glass-border-dim);
    overflow-y: auto;
    z-index: 201;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.sb-overlay.open .sb-drawer {
    transform: translateX(0);
}
.sb-drawer-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: 1px solid var(--glass-border-dim);
    color: var(--silver-faint);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.sb-drawer-close:hover {
    color: var(--silver);
    border-color: var(--silver-faint);
}
.sb-drawer-hebrew {
    font-size: 2.5rem;
    direction: rtl;
    text-align: center;
    color: var(--silver);
    margin: 0.5rem 0;
}
.sb-drawer-translit {
    text-align: center;
    color: var(--silver);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 0.2rem;
}
.sb-drawer-def {
    text-align: center;
    color: var(--gold-light);
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
    padding: 0.3rem 0.5rem;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 4px;
}
.sb-drawer-strongs {
    text-align: center;
    color: var(--silver-darker);
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
}
.sb-drawer-gematria {
    text-align: center;
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ---- Sections inside drawer ---- */
.sb-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--glass-border-dim);
    border-radius: 4px;
}
.sb-section-title {
    color: var(--silver-faint);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border-dim);
    padding-bottom: 0.25rem;
}

/* ---- Letter breakdown ---- */
.sb-letters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    direction: rtl;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}
.sb-letter-card {
    text-align: center;
    padding: 0.5rem;
    background: var(--black-lighter);
    border: 1px solid var(--glass-border-dim);
    border-radius: 4px;
    min-width: 55px;
}
.sb-letter-char {
    font-size: 1.5rem;
    color: var(--silver);
}
.sb-letter-name {
    font-size: 0.6rem;
    color: var(--silver-faint);
    margin-top: 0.15rem;
}
.sb-letter-pic {
    font-size: 0.6rem;
    color: var(--gold-dim);
    margin-top: 0.1rem;
}
.sb-letter-val {
    font-size: 0.7rem;
    color: var(--gold);
}

/* ---- Dictionary rows ---- */
.sb-dict-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.85rem;
}
.sb-dict-row:last-child {
    border-bottom: none;
}
.sb-dict-label {
    color: var(--silver-faint);
}
.sb-dict-val {
    color: var(--silver);
    text-align: right;
    max-width: 60%;
}

/* ---- Corruption timeline chain ---- */
.sb-chain-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sb-chain-step:last-child {
    border-bottom: none;
}
.sb-step-num {
    background: var(--black-card);
    color: var(--gold);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    border: 1px solid var(--gold-dim);
}
.sb-step-body {
    flex: 1;
}
.sb-step-era {
    color: var(--gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sb-step-word {
    color: var(--silver);
    font-size: 1rem;
    margin: 0.15rem 0;
}
.sb-step-meaning {
    color: var(--silver-faint);
    font-size: 0.8rem;
    font-style: italic;
}
.sb-step-corruption {
    color: #cc3300;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(204, 51, 0, 0.08);
    border-left: 2px solid #cc3300;
    border-radius: 0 4px 4px 0;
}
.sb-step-pending {
    color: var(--silver-darker);
    font-size: 0.8rem;
    font-style: italic;
}
.sb-chain-arrow {
    text-align: center;
    color: var(--glass-border-dim);
    font-size: 1rem;
    padding: 0.1rem 0;
}

/* ---- Mirror equivalents table ---- */
.sb-mirror-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 0.3rem;
}
.sb-mirror-table thead th {
    color: var(--silver-darker);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid var(--glass-border-dim);
    text-align: left;
}
.sb-mirror-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sb-mirror-table tbody tr:hover {
    background: rgba(212,175,55,0.06);
}
.sb-mirror-hebrew {
    font-size: 1rem;
    color: var(--silver);
    padding: 0.25rem 0.4rem;
}
.sb-mirror-val {
    color: var(--gold-dim);
    text-align: center;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}
.sb-mirror-eng {
    color: var(--silver-faint);
    font-style: italic;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

/* ---- RTL helper ---- */
.sb-rtl {
    direction: rtl;
}

/* ==== Responsive ==== */
@media (max-width: 768px) {
    .sb-columns {
        grid-template-columns: 1fr;
    }
    .sb-col--orig {
        border-right: none;
        border-bottom: 1px solid var(--glass-border-dim);
    }
    .sb-header {
        padding: 1rem 0;
    }
    .sb-title {
        font-size: 1.4rem;
    }
    .sb-genesis-bar {
        flex-direction: column;
        gap: 0.25rem;
    }
    .sb-hebrew {
        font-size: 1rem;
        line-height: 1.8;
    }
    .sb-drawer {
        width: 100vw;
        max-width: 100vw;
    }
    .sb-letters {
        gap: 0.3rem;
    }
    .sb-letter-card {
        min-width: 42px;
        padding: 0.35rem;
    }
    .sb-wordtable {
        font-size: 0.75rem;
    }
    .sb-wt-meaning {
        max-width: 100px;
    }
    .sb-card-header {
        gap: 0.4rem;
    }
}

/* ======================================================
   SUN/MOON TOGGLE BUTTON
   ====================================================== */
.sb-theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    border-radius: 16px;
    border: 2px solid rgba(192, 192, 192, 0.4);
    background: linear-gradient(135deg, #1a1a2e 0%, #0a0a1a 100%);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    transition: background 0.6s ease, border-color 0.6s ease;
}
.sb-theme-toggle .sb-sun,
.sb-theme-toggle .sb-moon {
    position: absolute;
    top: 50%;
    font-size: var(--text-lg);
    line-height: 1;
    transition: transform 0.6s ease, opacity 0.6s ease;
}
.sb-theme-toggle .sb-sun {
    left: 6px;
    transform: translateY(-50%) scale(0.5);
    opacity: 0.3;
    color: #f0c040;
}
.sb-theme-toggle .sb-moon {
    right: 6px;
    transform: translateY(-50%) scale(1);
    opacity: 1;
    color: #c0c0c0;
}
/* Light mode: sun rises, moon sets */
.sb-light .sb-theme-toggle {
    background: linear-gradient(135deg, #e8d5a0 0%, #f5f0e0 100%);
    border-color: rgba(180, 150, 80, 0.5);
}
.sb-light .sb-theme-toggle .sb-sun {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}
.sb-light .sb-theme-toggle .sb-moon {
    transform: translateY(-50%) scale(0.5);
    opacity: 0.3;
}

/* ======================================================
   SHADOW FALL ANIMATION
   A shadow sweeps across the screen when toggling themes
   ====================================================== */
.sb-shadow-fall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0) 100%
    );
    opacity: 0;
    transform: translateY(-100%);
    transition: none;
}
.sb-shadow-fall--active {
    animation: shadowFallDown 0.9s ease-in-out forwards;
}
@keyframes shadowFallDown {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    30% {
        opacity: 1;
        transform: translateY(0%);
    }
    70% {
        opacity: 1;
        transform: translateY(0%);
    }
    100% {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* ======================================================
   LIGHT THEME
   Toggle: body.sb-light
   ====================================================== */
/* Polished limestone pyramid - warm white, gold accents, clean geometry */
.sb-light {
    background: linear-gradient(180deg, var(--pyramid-limestone) 0%, #e8e0d0 100%) !important;
    color: #2a2418 !important;
    transition: background 0.8s ease, color 0.8s ease;
}
/* Gold line at very top of page - the capstone */
.sb-light::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, var(--pyramid-gold) 30%, var(--pyramid-gold-bright) 50%, var(--pyramid-gold) 70%, transparent 95%);
    z-index: 100;
    animation: sacredPulse 5s ease-in-out infinite;
}
.sb-light .sb-header {
    border-bottom-color: rgba(0,0,0,0.1);
}
.sb-light .sb-title {
    color: #1a1a1a;
}
.sb-light .sb-tagline {
    color: #555;
}
.sb-light .sb-genesis-bar {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.06) 0%, transparent 100%);
    border-color: rgba(212, 175, 55, 0.2);
    color: #6b5c3e;
    animation: goldShimmer 8s ease-in-out infinite;
}
.sb-light .sb-nav select {
    background: #fff;
    border-color: #ccc;
    color: #222;
}
.sb-light .sb-stats {
    color: #555;
}
.sb-light .sb-view-btn {
    background: rgba(0,0,0,0.04);
    border-color: #ccc;
    color: #444;
}
.sb-light .sb-card {
    border-color: #ddd;
    background: #fff;
}
.sb-light .sb-card-header {
    background: #f5f0e5;
    border-bottom-color: #ddd;
}
.sb-light .sb-col--orig {
    border-right-color: #ddd;
}
.sb-light .sb-col-label {
    color: #888;
}
.sb-light .sb-hebrew {
    color: #1a1a1a;
}
.sb-light .sb-hebrew--shadow {
    color: #5a3e1a;
}
.sb-light .sb-english {
    color: #555;
}
.sb-light .sb-english--shadow {
    color: #8a6d20;
}
.sb-light .sb-word {
    color: inherit;
}
.sb-light .sb-word:hover {
    background: rgba(180,140,40,0.15);
}
.sb-light .sb-wordtable-toggle {
    background: #f5f0e5;
    color: #666;
}
.sb-light .sb-wordtable thead th {
    background: #f5f0e5;
    color: #666;
}
.sb-light .sb-wordtable tbody tr:hover {
    background: rgba(180,140,40,0.06);
}
.sb-light .sb-wt-orig {
    color: #1a1a1a;
}
.sb-light .sb-wt-mirror {
    color: #5a3e1a;
}
.sb-light .sb-wt-meaning {
    color: #666;
}
.sb-light .sb-loading {
    color: #888;
}
.sb-light .sb-drawer {
    background: #fff;
    border-color: #ccc;
    color: #222;
}
.sb-light .sb-drawer-close {
    color: #666;
}
.sb-light .sb-overlay {
    background: rgba(0,0,0,0.3);
}
.sb-light .sb-arrows button {
    background: #fff;
    border-color: #ccc;
    color: #444;
}
.sb-light .sb-arrows button:hover:not(:disabled) {
    background: rgba(180,140,40,0.1);
    border-color: #b08c28;
    color: #8a6d20;
}

/* ---- 70 Faces ---- */
.sb-faces-btn {
    display: block;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.05));
    border: 1px solid rgba(212,175,55,0.5);
    border-radius: 6px;
    color: #d4af37;

    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sb-faces-btn:hover {
    background: linear-gradient(135deg, rgba(212,175,55,0.35), rgba(212,175,55,0.15));
    box-shadow: 0 0 12px rgba(212,175,55,0.3);
}
.sb-faces-panel {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 4px;
}
.sb-faces-count {
    text-align: center;
    color: #d4af37;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-style: italic;
}
.sb-faces-original {
    color: #c0c0c0;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(192,192,192,0.2);
}
.sb-faces-reading {
    color: #e8e0cc;
    font-size: 0.9rem;
    margin: 0.4rem 0;
    padding: 0.4rem 0.5rem;
    background: rgba(212,175,55,0.05);
    border-left: 2px solid rgba(212,175,55,0.3);
    border-radius: 0 4px 4px 0;
}
.sb-faces-num {
    color: #d4af37;
    font-weight: bold;
    margin-right: 0.3rem;
}
.sb-faces-more {
    display: block;
    margin: 0.5rem auto 0;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid rgba(192,192,192,0.3);
    border-radius: 4px;
    color: #c0c0c0;
    cursor: pointer;
    font-size: 0.8rem;
}
.sb-faces-more:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* Shuffle Area */
.sb-shuffle-area {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
}
.sb-shuffle-reading {
    font-size: 1.1rem;
    color: #e8e8e8;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    min-height: 2em;
}
.sb-shuffle-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.sb-shuffle-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: #000;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;

    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}
.sb-shuffle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}
.sb-shuffle-btn:active {
    transform: scale(0.98);
}
.sb-shuffle-counter {
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
}
.sb-shuffle-history {
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}
.sb-shuffle-history-entry {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(192, 192, 192, 0.1);
    color: #aaa;
    font-size: 0.85rem;
}
.sb-shuffle-history-entry:first-child {
    color: #c0c0c0;
}
.sb-faces-label {
    color: #d4af37;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.3rem;
}
.sb-faces-reading--primary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Word-by-word candidates grid */
.sb-faces-details {
    margin-top: 1rem;
}
.sb-faces-details summary {
    color: #d4af37;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}
.sb-faces-grid {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}
.sb-faces-word-col {
    min-width: 100px;
    flex-shrink: 0;
}
.sb-faces-word-pos {
    color: #d4af37;
    font-size: 0.7rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.sb-faces-candidate {
    font-size: 0.75rem;
    color: #999;
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.sb-faces-candidate--top {
    color: #d4af37;
    font-weight: 600;
}
.sb-faces-candidate--more {
    color: #666;
    font-style: italic;
}
