@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --primary: #54a0ff;
    --primary-dark: #2e86de;
    --primary-light: #0094ff21;
    --accent: #54a0ff;
    --accent-light: #eaf4ff;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --text: #222;
    --text-light: #777;
    --text-muted: #999;
    --border: #eee;
    --shadow: 0 1px 6px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 6px;
    --player-height: 80px;
    --arabic-font: 'Amiri', 'Traditional Arabic', 'Scheherazade', serif;
    --ui-font: -apple-system, system-ui, BlinkMacSystemFont, Helvetica, Roboto, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    --primary: #5eadff;
    --primary-dark: #3d96f0;
    --primary-light: #1a2c42;
    --accent: #5eadff;
    --accent-light: #1a2c42;
    --bg: #111827;
    --bg-card: #1f2937;
    --text: #e5e7eb;
    --text-light: #9ca3af;
    --text-muted: #6b7280;
    --border: #2d3748;
    --shadow: 0 1px 6px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .list-top-bar,
[data-theme="dark"] .list-hero {
    background: var(--bg);
}

[data-theme="dark"] .list-top-bar::before,
[data-theme="dark"] .list-hero::before {
    display: none;
}

/* Анимация движения звёзд (медленный дрейф) */
@keyframes stars-drift {
    0%, 100% { background-position: 0 0, 50px 35px, 80px 20px; }
    33% { background-position: 80px 40px, 0 70px, 0 0; }
    66% { background-position: 160px 120px, 100px 0, 120px 60px; }
}

::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--ui-font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ LIST VIEW (Main screen) ============ */

.list-view {
    min-height: 100vh;
}

.list-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 0;
    min-height: 48px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.list-top-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%2354a0ff' fill-opacity='0.4'%3E%3Ccircle cx='12' cy='8' r='1'/%3E%3Ccircle cx='45' cy='23' r='0.6'/%3E%3Ccircle cx='78' cy='5' r='1.2'/%3E%3Ccircle cx='95' cy='40' r='0.7'/%3E%3Ccircle cx='5' cy='55' r='0.6'/%3E%3Ccircle cx='33' cy='72' r='1'/%3E%3Ccircle cx='62' cy='88' r='0.6'/%3E%3Ccircle cx='88' cy='65' r='0.7'/%3E%3Ccircle cx='18' cy='95' r='0.6'/%3E%3Ccircle cx='125' cy='18' r='0.6'/%3E%3Ccircle cx='52' cy='42' r='0.5'/%3E%3Ccircle cx='72' cy='58' r='0.8'/%3E%3Ccircle cx='112' cy='82' r='0.6'/%3E%3Ccircle cx='138' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='128' r='0.7'/%3E%3Ccircle cx='145' cy='115' r='0.5'/%3E%3Ccircle cx='25' cy='15' r='0.6'/%3E%3Ccircle cx='100' cy='30' r='0.5'/%3E%3Ccircle cx='15' cy='80' r='0.7'/%3E%3Ccircle cx='90' cy='90' r='0.5'/%3E%3Ccircle cx='120' cy='55' r='0.6'/%3E%3Ccircle cx='35' cy='42' r='0.5'/%3E%3Ccircle cx='75' cy='75' r='0.7'/%3E%3Ccircle cx='110' cy='12' r='0.5'/%3E%3Ccircle cx='8' cy='120' r='0.6'/%3E%3Ccircle cx='55' cy='130' r='0.5'/%3E%3Ccircle cx='115' cy='38' r='0.6'/%3E%3Ccircle cx='48' cy='8' r='0.5'/%3E%3Ccircle cx='155' cy='60' r='0.6'/%3E%3Ccircle cx='68' cy='42' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%2354a0ff' fill-opacity='0.25'%3E%3Ccircle cx='20' cy='10' r='0.5'/%3E%3Ccircle cx='55' cy='25' r='0.4'/%3E%3Ccircle cx='8' cy='48' r='0.55'/%3E%3Ccircle cx='42' cy='62' r='0.5'/%3E%3Ccircle cx='68' cy='8' r='0.4'/%3E%3Ccircle cx='15' cy='70' r='0.5'/%3E%3Ccircle cx='72' cy='55' r='0.4'/%3E%3Ccircle cx='85' cy='78' r='0.45'/%3E%3Ccircle cx='32' cy='92' r='0.4'/%3E%3Ccircle cx='5' cy='30' r='0.5'/%3E%3Ccircle cx='40' cy='5' r='0.4'/%3E%3Ccircle cx='90' cy='45' r='0.5'/%3E%3Ccircle cx='25' cy='75' r='0.4'/%3E%3Ccircle cx='60' cy='90' r='0.5'/%3E%3Ccircle cx='78' cy='25' r='0.4'/%3E%3Ccircle cx='50' cy='50' r='0.5'/%3E%3Ccircle cx='95' cy='65' r='0.4'/%3E%3Ccircle cx='18' cy='85' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%2354a0ff' fill-opacity='0.2'%3E%3Ccircle cx='10' cy='5' r='0.5'/%3E%3Ccircle cx='35' cy='20' r='0.4'/%3E%3Ccircle cx='60' cy='8' r='0.6'/%3E%3Ccircle cx='85' cy='35' r='0.4'/%3E%3Ccircle cx='5' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='60' r='0.4'/%3E%3Ccircle cx='55' cy='75' r='0.5'/%3E%3Ccircle cx='75' cy='50' r='0.4'/%3E%3Ccircle cx='15' cy='85' r='0.5'/%3E%3Ccircle cx='95' cy='15' r='0.4'/%3E%3Ccircle cx='42' cy='32' r='0.3'/%3E%3Ccircle cx='68' cy='55' r='0.5'/%3E%3Ccircle cx='92' cy='72' r='0.4'/%3E%3Ccircle cx='18' cy='95' r='0.4'/%3E%3Ccircle cx='50' cy='5' r='0.3'/%3E%3Ccircle cx='105' cy='45' r='0.5'/%3E%3Ccircle cx='8' cy='68' r='0.4'/%3E%3Ccircle cx='115' cy='90' r='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px, 100px 100px, 120px 120px;
    background-position: 0 0, 50px 35px, 80px 20px;
    animation: stars-drift 100s ease-in-out infinite;
    pointer-events: none;
}

.list-top-bar .header-btn,
.list-top-bar .settings-dropdown { position: relative; z-index: 1; }

.list-top-bar .header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.list-hero {
    text-align: center;
    padding: 28px 20px 16px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.list-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%2354a0ff' fill-opacity='0.4'%3E%3Ccircle cx='12' cy='8' r='1'/%3E%3Ccircle cx='45' cy='23' r='0.6'/%3E%3Ccircle cx='78' cy='5' r='1.2'/%3E%3Ccircle cx='95' cy='40' r='0.7'/%3E%3Ccircle cx='5' cy='55' r='0.6'/%3E%3Ccircle cx='33' cy='72' r='1'/%3E%3Ccircle cx='62' cy='88' r='0.6'/%3E%3Ccircle cx='88' cy='65' r='0.7'/%3E%3Ccircle cx='18' cy='95' r='0.6'/%3E%3Ccircle cx='125' cy='18' r='0.6'/%3E%3Ccircle cx='52' cy='42' r='0.5'/%3E%3Ccircle cx='72' cy='58' r='0.8'/%3E%3Ccircle cx='112' cy='82' r='0.6'/%3E%3Ccircle cx='138' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='128' r='0.7'/%3E%3Ccircle cx='145' cy='115' r='0.5'/%3E%3Ccircle cx='25' cy='15' r='0.6'/%3E%3Ccircle cx='100' cy='30' r='0.5'/%3E%3Ccircle cx='15' cy='80' r='0.7'/%3E%3Ccircle cx='90' cy='90' r='0.5'/%3E%3Ccircle cx='120' cy='55' r='0.6'/%3E%3Ccircle cx='35' cy='42' r='0.5'/%3E%3Ccircle cx='75' cy='75' r='0.7'/%3E%3Ccircle cx='110' cy='12' r='0.5'/%3E%3Ccircle cx='8' cy='120' r='0.6'/%3E%3Ccircle cx='55' cy='130' r='0.5'/%3E%3Ccircle cx='115' cy='38' r='0.6'/%3E%3Ccircle cx='48' cy='8' r='0.5'/%3E%3Ccircle cx='155' cy='60' r='0.6'/%3E%3Ccircle cx='68' cy='42' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%2354a0ff' fill-opacity='0.25'%3E%3Ccircle cx='20' cy='10' r='0.5'/%3E%3Ccircle cx='55' cy='25' r='0.4'/%3E%3Ccircle cx='8' cy='48' r='0.55'/%3E%3Ccircle cx='42' cy='62' r='0.5'/%3E%3Ccircle cx='68' cy='8' r='0.4'/%3E%3Ccircle cx='15' cy='70' r='0.5'/%3E%3Ccircle cx='72' cy='55' r='0.4'/%3E%3Ccircle cx='85' cy='78' r='0.45'/%3E%3Ccircle cx='32' cy='92' r='0.4'/%3E%3Ccircle cx='5' cy='30' r='0.5'/%3E%3Ccircle cx='40' cy='5' r='0.4'/%3E%3Ccircle cx='90' cy='45' r='0.5'/%3E%3Ccircle cx='25' cy='75' r='0.4'/%3E%3Ccircle cx='60' cy='90' r='0.5'/%3E%3Ccircle cx='78' cy='25' r='0.4'/%3E%3Ccircle cx='50' cy='50' r='0.5'/%3E%3Ccircle cx='95' cy='65' r='0.4'/%3E%3Ccircle cx='18' cy='85' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%2354a0ff' fill-opacity='0.2'%3E%3Ccircle cx='10' cy='5' r='0.5'/%3E%3Ccircle cx='35' cy='20' r='0.4'/%3E%3Ccircle cx='60' cy='8' r='0.6'/%3E%3Ccircle cx='85' cy='35' r='0.4'/%3E%3Ccircle cx='5' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='60' r='0.4'/%3E%3Ccircle cx='55' cy='75' r='0.5'/%3E%3Ccircle cx='75' cy='50' r='0.4'/%3E%3Ccircle cx='15' cy='85' r='0.5'/%3E%3Ccircle cx='95' cy='15' r='0.4'/%3E%3Ccircle cx='42' cy='32' r='0.3'/%3E%3Ccircle cx='68' cy='55' r='0.5'/%3E%3Ccircle cx='92' cy='72' r='0.4'/%3E%3Ccircle cx='18' cy='95' r='0.4'/%3E%3Ccircle cx='50' cy='5' r='0.3'/%3E%3Ccircle cx='105' cy='45' r='0.5'/%3E%3Ccircle cx='8' cy='68' r='0.4'/%3E%3Ccircle cx='115' cy='90' r='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px, 100px 100px, 120px 120px;
    background-position: 0 0, 50px 35px, 80px 20px;
    animation: stars-drift 100s ease-in-out infinite;
    pointer-events: none;
}

.list-hero .list-logo,
.list-hero .list-hero-quote { position: relative; z-index: 1; }

.list-logo {
    width: 28%;
    max-width: 90px;
    margin-bottom: 8px;
}

.list-hero-quote {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* Toolbar */
.list-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 50;
}

.list-search {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.list-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--ui-font);
    outline: none;
    transition: border-color var(--transition);
}

.list-search input:focus { border-color: var(--primary); }

.list-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

.list-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Tabs */
.list-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 50px;
    background: var(--bg);
    z-index: 49;
}

.sidebar-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    font-family: var(--ui-font);
}

.sidebar-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sidebar-tab:hover { background: var(--primary-light); }

/* Surah grid */
.surah-grid {
    display: flex;
    flex-wrap: wrap;
}

.surah-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text);
    flex-basis: 100%;
    max-width: 100%;
}

.surah-item:nth-child(odd) { background: var(--primary-light); }
.surah-item.active { background: #54a0ff40; }

.surah-number {
    font-size: 22px;
    flex: 0 0 50px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.surah-info {
    flex: 1;
    min-width: 0;
}

.surah-info .name-en {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 2px;
}

.surah-info .meta {
    font-size: 14px;
    color: var(--text-light);
}

.surah-item .name-ar {
    font-family: var(--arabic-font);
    font-size: 22px;
    color: var(--text);
    direction: rtl;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Mobile: responsive columns (no desktop sidebar) */
@media (min-width: 768px) and (max-width: 1023px) {
    .surah-item {
        flex-basis: 50%;
        max-width: 50%;
    }
}

/* ============ READ VIEW ============ */

.read-view {
    min-height: 100vh;
    padding-bottom: calc(var(--player-height) + 20px);
}

/* Mobile default: read-view hidden */
.read-view.hidden-mobile { display: none; }

/* ============ DESKTOP SPLIT LAYOUT (≥1024px) ============ */

@media (min-width: 1024px) {
    :root {
        --sidebar-width: 380px;
    }

    .app-container {
        display: flex;
        min-height: 100vh;
    }

    .list-view {
        width: var(--sidebar-width);
        flex-shrink: 0;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        overflow-y: auto;
        border-right: 1px solid var(--border);
        z-index: 60;
        background: var(--bg);
        min-height: 100vh;
    }

    .list-view .list-hero {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 16px 16px 12px;
        text-align: left;
    }

    .list-view .list-logo {
        max-width: 80px;
        width: 80px;
        height: auto;
        margin-bottom: 0;
        flex-shrink: 0;
        order: 1;
    }

    .list-view .list-hero-quote {
        font-size: 0.8rem;
        order: 2;
        flex: 1;
    }

    .surah-item {
        flex-basis: 100% !important;
        max-width: 100% !important;
        padding: 14px 16px;
    }

    .surah-number { font-size: 18px; flex: 0 0 40px; }
    .surah-info .name-en { font-size: 14px; }
    .surah-info .meta { font-size: 12px; }
    .surah-item .name-ar { font-size: 18px; }

    .read-view {
        margin-left: var(--sidebar-width);
        flex: 1;
        min-height: 100vh;
        display: block !important;
        position: relative;
    }

    .read-view.hidden-mobile {
        display: block !important;
    }

    .read-view .back-btn { display: none; }

    .info-view {
        margin-left: var(--sidebar-width);
        flex: 1;
        min-height: 100vh;
    }

    .info-view .back-btn { display: none; }
    .info-view-header { justify-content: center; }
    .info-view-header .back-btn { display: flex; }

    .read-view.hidden-by-info { display: none !important; }

    .read-view-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 60vh;
        color: var(--text-muted);
        text-align: center;
        padding: 40px 20px;
    }

    .read-view-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
    .read-view-empty-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
    .read-view-empty-hint { font-size: 0.85rem; }

    .list-toolbar {
        position: sticky;
        top: 0;
    }

    .list-tabs {
        position: sticky;
        top: 50px;
    }

    .audio-player {
        left: var(--sidebar-width);
        right: 0;
        bottom: 0;
    }
}

@media (min-width: 1400px) {
    :root {
        --sidebar-width: 420px;
    }
}

.read-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition);
    overflow: hidden;
}

.read-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23fff' fill-opacity='0.55'%3E%3Ccircle cx='12' cy='8' r='1'/%3E%3Ccircle cx='45' cy='23' r='0.6'/%3E%3Ccircle cx='78' cy='5' r='1.2'/%3E%3Ccircle cx='95' cy='40' r='0.7'/%3E%3Ccircle cx='5' cy='55' r='0.6'/%3E%3Ccircle cx='33' cy='72' r='1'/%3E%3Ccircle cx='62' cy='88' r='0.6'/%3E%3Ccircle cx='88' cy='65' r='0.7'/%3E%3Ccircle cx='18' cy='95' r='0.6'/%3E%3Ccircle cx='125' cy='18' r='0.6'/%3E%3Ccircle cx='52' cy='42' r='0.5'/%3E%3Ccircle cx='72' cy='58' r='0.8'/%3E%3Ccircle cx='112' cy='82' r='0.6'/%3E%3Ccircle cx='138' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='128' r='0.7'/%3E%3Ccircle cx='145' cy='115' r='0.5'/%3E%3Ccircle cx='25' cy='15' r='0.6'/%3E%3Ccircle cx='100' cy='30' r='0.5'/%3E%3Ccircle cx='15' cy='80' r='0.7'/%3E%3Ccircle cx='90' cy='90' r='0.5'/%3E%3Ccircle cx='120' cy='55' r='0.6'/%3E%3Ccircle cx='35' cy='42' r='0.5'/%3E%3Ccircle cx='75' cy='75' r='0.7'/%3E%3Ccircle cx='110' cy='12' r='0.5'/%3E%3Ccircle cx='8' cy='120' r='0.6'/%3E%3Ccircle cx='55' cy='130' r='0.5'/%3E%3Ccircle cx='115' cy='38' r='0.6'/%3E%3Ccircle cx='48' cy='8' r='0.5'/%3E%3Ccircle cx='155' cy='60' r='0.6'/%3E%3Ccircle cx='68' cy='42' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23fff' fill-opacity='0.35'%3E%3Ccircle cx='20' cy='10' r='0.5'/%3E%3Ccircle cx='55' cy='25' r='0.4'/%3E%3Ccircle cx='8' cy='48' r='0.55'/%3E%3Ccircle cx='42' cy='62' r='0.5'/%3E%3Ccircle cx='68' cy='8' r='0.4'/%3E%3Ccircle cx='15' cy='70' r='0.5'/%3E%3Ccircle cx='72' cy='55' r='0.4'/%3E%3Ccircle cx='85' cy='78' r='0.45'/%3E%3Ccircle cx='32' cy='92' r='0.4'/%3E%3Ccircle cx='5' cy='30' r='0.5'/%3E%3Ccircle cx='40' cy='5' r='0.4'/%3E%3Ccircle cx='90' cy='45' r='0.5'/%3E%3Ccircle cx='25' cy='75' r='0.4'/%3E%3Ccircle cx='60' cy='90' r='0.5'/%3E%3Ccircle cx='78' cy='25' r='0.4'/%3E%3Ccircle cx='50' cy='50' r='0.5'/%3E%3Ccircle cx='95' cy='65' r='0.4'/%3E%3Ccircle cx='18' cy='85' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23fff' fill-opacity='0.25'%3E%3Ccircle cx='10' cy='5' r='0.5'/%3E%3Ccircle cx='35' cy='20' r='0.4'/%3E%3Ccircle cx='60' cy='8' r='0.6'/%3E%3Ccircle cx='85' cy='35' r='0.4'/%3E%3Ccircle cx='5' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='60' r='0.4'/%3E%3Ccircle cx='55' cy='75' r='0.5'/%3E%3Ccircle cx='75' cy='50' r='0.4'/%3E%3Ccircle cx='15' cy='85' r='0.5'/%3E%3Ccircle cx='95' cy='15' r='0.4'/%3E%3Ccircle cx='42' cy='32' r='0.3'/%3E%3Ccircle cx='68' cy='55' r='0.5'/%3E%3Ccircle cx='92' cy='72' r='0.4'/%3E%3Ccircle cx='18' cy='95' r='0.4'/%3E%3Ccircle cx='50' cy='5' r='0.3'/%3E%3Ccircle cx='105' cy='45' r='0.5'/%3E%3Ccircle cx='8' cy='68' r='0.4'/%3E%3Ccircle cx='115' cy='90' r='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px, 100px 100px, 120px 120px;
    background-position: 0 0, 50px 35px, 80px 20px;
    animation: stars-drift 100s ease-in-out infinite;
    pointer-events: none;
}

.read-header .back-btn,
.read-header .read-header-right,
.read-header .read-header-surah-name { position: relative; z-index: 1; }

.read-header-surah-name {
    flex: 1;
    text-align: center;
    font-family: var(--arabic-font);
    font-size: 1.4rem;
    font-weight: 700;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
    pointer-events: none;
}

.read-header.show-surah-name .read-header-surah-name {
    opacity: 1;
    visibility: visible;
}

.read-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.read-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.read-header .header-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.read-header .header-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

body.scroll-hide-ui .read-header {
    transform: translateY(-100%);
}

body.scroll-hide-ui .audio-player.visible {
    transform: translateY(100%);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--ui-font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.back-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.read-header-search {
    flex: 1;
    position: relative;
    max-width: 320px;
}

.read-header-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--ui-font);
    outline: none;
    transition: all var(--transition);
}

.read-header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(84,160,255,0.15);
}

.read-header-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.read-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Header buttons */
.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.header-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Settings dropdown */
.settings-dropdown { position: relative; }

.settings-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.settings-panel.show { display: flex; }

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.settings-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.settings-panel-close {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.2rem;
}

.settings-panel-close:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.settings-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px 28px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.settings-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.settings-preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.settings-preview-arabic {
    font-family: var(--arabic-font);
    font-size: var(--arabic-size, 28px);
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 10px;
    direction: rtl;
    text-align: right;
}

.settings-preview-translation {
    font-size: var(--translation-size, 15px);
    line-height: 1.55;
    color: var(--text-light);
}

.settings-group {
    margin-bottom: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.settings-group:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.settings-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-group-toggle > label:first-child { margin-bottom: 0; }

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.settings-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Info view (отдельная страница) */
.info-view {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: calc(var(--player-height) + 20px);
    background: var(--bg);
}

.info-view.visible { display: flex; }

.info-view-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.info-view-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.info-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.read-view.hidden-by-info { display: none !important; }

.info-block {
    margin-bottom: 20px;
}

.info-block:last-child { margin-bottom: 0; }

.info-block h3 {
    font-size: 1.25rem;
    margin: 0 0 8px;
    color: var(--text);
}

.info-block h4 {
    font-size: 1rem;
    margin: 0 0 8px;
    color: var(--text);
}

.info-block p {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.info-block p:last-child { margin-bottom: 0; }

.info-block a {
    color: var(--primary);
    text-decoration: none;
}

.info-block a:hover { text-decoration: underline; }

.info-share-wrap { margin-top: 12px; }
.info-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--ui-font);
    cursor: pointer;
    transition: all var(--transition);
}
.info-share-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}
.info-share-caption {
    margin: 14px 0 0;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.settings-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--ui-font);
    outline: none;
    transition: border-color 0.2s ease;
}

.settings-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(84,160,255,0.12); }

.font-size-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.font-size-control span:first-of-type { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.font-size-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.font-size-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.font-size-control span:last-of-type { font-size: 0.8rem; color: var(--text-light); min-width: 38px; text-align: right; font-weight: 500; }

/* ============ SURAH VIEW ============ */

.surah-view { padding: 0; }

/* Баннер суры — визуально единый блок с read-header (тот же градиент и звёзды) */
.surah-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 36px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Звёздный космос: мелкие звёзды поверх фона, цвет фона сохранён */
.surah-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23fff' fill-opacity='0.55'%3E%3Ccircle cx='12' cy='8' r='1'/%3E%3Ccircle cx='45' cy='23' r='0.6'/%3E%3Ccircle cx='78' cy='5' r='1.2'/%3E%3Ccircle cx='95' cy='40' r='0.7'/%3E%3Ccircle cx='5' cy='55' r='0.6'/%3E%3Ccircle cx='33' cy='72' r='1'/%3E%3Ccircle cx='62' cy='88' r='0.6'/%3E%3Ccircle cx='88' cy='65' r='0.7'/%3E%3Ccircle cx='18' cy='95' r='0.6'/%3E%3Ccircle cx='125' cy='18' r='0.6'/%3E%3Ccircle cx='52' cy='42' r='0.5'/%3E%3Ccircle cx='72' cy='58' r='0.8'/%3E%3Ccircle cx='112' cy='82' r='0.6'/%3E%3Ccircle cx='138' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='128' r='0.7'/%3E%3Ccircle cx='145' cy='115' r='0.5'/%3E%3Ccircle cx='25' cy='15' r='0.6'/%3E%3Ccircle cx='100' cy='30' r='0.5'/%3E%3Ccircle cx='15' cy='80' r='0.7'/%3E%3Ccircle cx='90' cy='90' r='0.5'/%3E%3Ccircle cx='120' cy='55' r='0.6'/%3E%3Ccircle cx='35' cy='42' r='0.5'/%3E%3Ccircle cx='75' cy='75' r='0.7'/%3E%3Ccircle cx='110' cy='12' r='0.5'/%3E%3Ccircle cx='8' cy='120' r='0.6'/%3E%3Ccircle cx='55' cy='130' r='0.5'/%3E%3Ccircle cx='115' cy='38' r='0.6'/%3E%3Ccircle cx='48' cy='8' r='0.5'/%3E%3Ccircle cx='155' cy='60' r='0.6'/%3E%3Ccircle cx='68' cy='42' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23fff' fill-opacity='0.35'%3E%3Ccircle cx='20' cy='10' r='0.5'/%3E%3Ccircle cx='55' cy='25' r='0.4'/%3E%3Ccircle cx='8' cy='48' r='0.55'/%3E%3Ccircle cx='42' cy='62' r='0.5'/%3E%3Ccircle cx='68' cy='8' r='0.4'/%3E%3Ccircle cx='15' cy='70' r='0.5'/%3E%3Ccircle cx='72' cy='55' r='0.4'/%3E%3Ccircle cx='85' cy='78' r='0.45'/%3E%3Ccircle cx='32' cy='92' r='0.4'/%3E%3Ccircle cx='5' cy='30' r='0.5'/%3E%3Ccircle cx='40' cy='5' r='0.4'/%3E%3Ccircle cx='90' cy='45' r='0.5'/%3E%3Ccircle cx='25' cy='75' r='0.4'/%3E%3Ccircle cx='60' cy='90' r='0.5'/%3E%3Ccircle cx='78' cy='25' r='0.4'/%3E%3Ccircle cx='50' cy='50' r='0.5'/%3E%3Ccircle cx='95' cy='65' r='0.4'/%3E%3Ccircle cx='18' cy='85' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23fff' fill-opacity='0.25'%3E%3Ccircle cx='10' cy='5' r='0.5'/%3E%3Ccircle cx='35' cy='20' r='0.4'/%3E%3Ccircle cx='60' cy='8' r='0.6'/%3E%3Ccircle cx='85' cy='35' r='0.4'/%3E%3Ccircle cx='5' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='60' r='0.4'/%3E%3Ccircle cx='55' cy='75' r='0.5'/%3E%3Ccircle cx='75' cy='50' r='0.4'/%3E%3Ccircle cx='15' cy='85' r='0.5'/%3E%3Ccircle cx='95' cy='15' r='0.4'/%3E%3Ccircle cx='42' cy='32' r='0.3'/%3E%3Ccircle cx='68' cy='55' r='0.5'/%3E%3Ccircle cx='92' cy='72' r='0.4'/%3E%3Ccircle cx='18' cy='95' r='0.4'/%3E%3Ccircle cx='50' cy='5' r='0.3'/%3E%3Ccircle cx='105' cy='45' r='0.5'/%3E%3Ccircle cx='8' cy='68' r='0.4'/%3E%3Ccircle cx='115' cy='90' r='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px, 100px 100px, 120px 120px;
    background-position: 0 0, 50px 35px, 80px 20px;
    animation: stars-drift 100s ease-in-out infinite;
    pointer-events: none;
}

.surah-banner-content { position: relative; z-index: 1; }

.surah-banner .surah-name-ar {
    font-family: var(--arabic-font);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    direction: rtl;
}

.surah-banner .surah-name-en { font-size: 1rem; font-weight: 500; opacity: 0.9; margin-bottom: 4px; }
.surah-banner .surah-meaning { font-size: 0.85rem; opacity: 0.7; margin-bottom: 14px; }

.surah-banner .surah-meta-pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.18);
    border-radius: 16px;
    font-size: 0.78rem;
}

.bismillah {
    text-align: center;
    padding: 28px 20px 8px;
    font-family: var(--arabic-font);
    font-size: 1.8rem;
    color: var(--primary);
    direction: rtl;
}

.ayah-list {
    padding: 8px 20px 40px;
    max-width: 860px;
    margin: 0 auto;
}

.ayah-card {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    position: relative;
}

.ayah-card:last-child { border-bottom: none; }

.ayah-card:hover {
    background: var(--primary-light);
    margin: 0 -20px;
    padding: 20px;
    border-radius: var(--radius);
}

.ayah-card.playing {
    background: var(--accent-light);
    margin: 0 -20px;
    padding: 20px;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.ayah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ayah-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ayah-actions { display: flex; gap: 5px; opacity: 0; transition: opacity var(--transition); }
.ayah-card:hover .ayah-actions { opacity: 1; }

.ayah-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.82rem;
}

.ayah-action-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.ayah-action-btn.bookmarked { background: var(--primary); color: #fff; border-color: var(--primary); }

.ayah-arabic {
    font-family: var(--arabic-font);
    font-size: var(--arabic-size, 28px);
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--text);
    margin-bottom: 12px;
    word-spacing: 3px;
}

.ayah-translation {
    font-size: var(--translation-size, 15px);
    line-height: 1.8;
    color: var(--text-light);
    padding-left: 16px;
    border-left: 3px solid var(--primary);
}

/* ============ SEARCH RESULTS ============ */

.search-results { display: none; padding: 20px; max-width: 860px; margin: 0 auto; }
.search-results.active { display: block; }
.search-results-header { margin-bottom: 18px; }
.search-results-header h3 { font-size: 1.05rem; color: var(--text); }
.search-results-header p { font-size: 0.82rem; color: var(--text-muted); }

.search-result-item {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition);
}

.search-result-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.search-result-ref { font-size: 0.78rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.search-result-text { font-size: 0.92rem; color: var(--text); line-height: 1.7; }
.search-result-text[dir="rtl"] { font-family: var(--arabic-font); font-size: 1.2rem; line-height: 2; }

/* ============ BOOKMARKS VIEW ============ */

.bookmarks-view { display: none; padding: 20px; max-width: 860px; margin: 0 auto; }
.bookmarks-view.active { display: block; }
.bookmarks-header { margin-bottom: 18px; }
.bookmarks-header h3 { font-size: 1.1rem; color: var(--text); }

.bookmark-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition);
    gap: 12px;
}

.bookmark-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.bookmark-info { flex: 1; }
.bookmark-info .bk-ref { font-weight: 700; color: var(--primary); font-size: 0.85rem; }

.bookmark-info .bk-text {
    font-family: var(--arabic-font);
    font-size: 1.05rem;
    direction: rtl;
    color: var(--text);
    margin-top: 3px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-remove {
    padding: 5px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: color var(--transition);
}

.bookmark-remove:hover { color: #ef4444; }

/* ============ AUDIO PLAYER ============ */

.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    gap: 32px;
    z-index: 90;
    transform: translateY(100%);
    transition: transform var(--transition);
    overflow: hidden;
    border-radius: 0;
}

.audio-player::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23fff' fill-opacity='0.55'%3E%3Ccircle cx='12' cy='8' r='1'/%3E%3Ccircle cx='45' cy='23' r='0.6'/%3E%3Ccircle cx='78' cy='5' r='1.2'/%3E%3Ccircle cx='95' cy='40' r='0.7'/%3E%3Ccircle cx='5' cy='55' r='0.6'/%3E%3Ccircle cx='33' cy='72' r='1'/%3E%3Ccircle cx='62' cy='88' r='0.6'/%3E%3Ccircle cx='88' cy='65' r='0.7'/%3E%3Ccircle cx='18' cy='95' r='0.6'/%3E%3Ccircle cx='125' cy='18' r='0.6'/%3E%3Ccircle cx='52' cy='42' r='0.5'/%3E%3Ccircle cx='72' cy='58' r='0.8'/%3E%3Ccircle cx='112' cy='82' r='0.6'/%3E%3Ccircle cx='138' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='128' r='0.7'/%3E%3Ccircle cx='145' cy='115' r='0.5'/%3E%3Ccircle cx='25' cy='15' r='0.6'/%3E%3Ccircle cx='100' cy='30' r='0.5'/%3E%3Ccircle cx='15' cy='80' r='0.7'/%3E%3Ccircle cx='90' cy='90' r='0.5'/%3E%3Ccircle cx='120' cy='55' r='0.6'/%3E%3Ccircle cx='35' cy='42' r='0.5'/%3E%3Ccircle cx='75' cy='75' r='0.7'/%3E%3Ccircle cx='110' cy='12' r='0.5'/%3E%3Ccircle cx='8' cy='120' r='0.6'/%3E%3Ccircle cx='55' cy='130' r='0.5'/%3E%3Ccircle cx='115' cy='38' r='0.6'/%3E%3Ccircle cx='48' cy='8' r='0.5'/%3E%3Ccircle cx='155' cy='60' r='0.6'/%3E%3Ccircle cx='68' cy='42' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23fff' fill-opacity='0.35'%3E%3Ccircle cx='20' cy='10' r='0.5'/%3E%3Ccircle cx='55' cy='25' r='0.4'/%3E%3Ccircle cx='8' cy='48' r='0.55'/%3E%3Ccircle cx='42' cy='62' r='0.5'/%3E%3Ccircle cx='68' cy='8' r='0.4'/%3E%3Ccircle cx='15' cy='70' r='0.5'/%3E%3Ccircle cx='72' cy='55' r='0.4'/%3E%3Ccircle cx='85' cy='78' r='0.45'/%3E%3Ccircle cx='32' cy='92' r='0.4'/%3E%3Ccircle cx='5' cy='30' r='0.5'/%3E%3Ccircle cx='40' cy='5' r='0.4'/%3E%3Ccircle cx='90' cy='45' r='0.5'/%3E%3Ccircle cx='25' cy='75' r='0.4'/%3E%3Ccircle cx='60' cy='90' r='0.5'/%3E%3Ccircle cx='78' cy='25' r='0.4'/%3E%3Ccircle cx='50' cy='50' r='0.5'/%3E%3Ccircle cx='95' cy='65' r='0.4'/%3E%3Ccircle cx='18' cy='85' r='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23fff' fill-opacity='0.25'%3E%3Ccircle cx='10' cy='5' r='0.5'/%3E%3Ccircle cx='35' cy='20' r='0.4'/%3E%3Ccircle cx='60' cy='8' r='0.6'/%3E%3Ccircle cx='85' cy='35' r='0.4'/%3E%3Ccircle cx='5' cy='45' r='0.5'/%3E%3Ccircle cx='28' cy='60' r='0.4'/%3E%3Ccircle cx='55' cy='75' r='0.5'/%3E%3Ccircle cx='75' cy='50' r='0.4'/%3E%3Ccircle cx='15' cy='85' r='0.5'/%3E%3Ccircle cx='95' cy='15' r='0.4'/%3E%3Ccircle cx='42' cy='32' r='0.3'/%3E%3Ccircle cx='68' cy='55' r='0.5'/%3E%3Ccircle cx='92' cy='72' r='0.4'/%3E%3Ccircle cx='18' cy='95' r='0.4'/%3E%3Ccircle cx='50' cy='5' r='0.3'/%3E%3Ccircle cx='105' cy='45' r='0.5'/%3E%3Ccircle cx='8' cy='68' r='0.4'/%3E%3Ccircle cx='115' cy='90' r='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 160px 160px, 100px 100px, 120px 120px;
    background-position: 0 0, 50px 35px, 80px 20px;
    animation: stars-drift 100s ease-in-out infinite;
    pointer-events: none;
}

.audio-player .player-controls,
.audio-player .player-volume { position: relative; z-index: 1; }

.audio-player.visible { transform: translateY(0); transition: transform var(--transition); }

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.audio-player .player-btn { color: #fff; }
.audio-player .player-btn:hover { background: rgba(255, 255, 255, 0.25); color: #fff; }

.player-btn:hover { background: var(--primary-light); color: var(--primary); }

.player-btn.play-btn {
    width: 52px;
    height: 52px;
    margin: 0 4px;
    font-size: 1.35rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
}
.player-btn.play-btn:hover { background: #fff; color: var(--primary-dark); transform: scale(1.06); }

.player-btn.repeat-active { background: rgba(255, 255, 255, 0.95); color: var(--primary); }
.player-btn.repeat-active:hover { background: #fff; color: var(--primary-dark); }

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.player-volume .vol-icon {
    font-size: 1.1rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.audio-player .player-volume .vol-icon { color: #fff; }

.player-volume input[type="range"] {
    width: 80px;
    -webkit-appearance: none;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.player-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.audio-player .player-volume input[type="range"] {
    background: rgba(255, 255, 255, 0.3);
}

.audio-player .player-volume input[type="range"]::-webkit-slider-thumb {
    background: #fff;
}

.player-close-btn {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.player-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ============ LOADING ============ */

.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(255,255,255,0.7); z-index: 1000; align-items: center; justify-content: center; }
[data-theme="dark"] .loading-overlay { background: rgba(0,0,0,0.5); }
.loading-overlay.show { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-inline { display: flex; align-items: center; justify-content: center; padding: 50px 20px; color: var(--text-muted); gap: 10px; }
.loading-inline .spinner-sm { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ============ TOAST ============ */

.toast-container { position: fixed; bottom: 90px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 10px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 0.82rem; color: var(--text); animation: toastIn 0.3s ease; display: flex; align-items: center; gap: 6px; }
.toast.success { border-left: 3px solid var(--primary); }
.toast.error { border-left: 3px solid #ef4444; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ LAZY LOAD ============ */

.ayah-sentinel { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 20px; color: var(--text-muted); font-size: 0.85rem; }
.ayah-fade-in { animation: ayahAppear 0.4s ease both; }
@keyframes ayahAppear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============ RESPONSIVE ============ */

@media (max-width: 1023px) {
    .read-view-empty { display: none !important; }
}

@media (max-width: 640px) {
    .list-top-bar { padding: 8px 12px 0; min-height: 44px; }
    .list-top-bar .header-btn { width: 36px; height: 36px; font-size: 1.1rem; }
    .list-hero { padding: 16px 16px 10px; }
    .list-logo { max-width: 140px; width: 44%; }
    .list-toolbar { padding: 6px 12px; }
    .read-header { padding: 8px 12px; gap: 8px; }
    .back-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .surah-banner { padding: 22px 14px; }
    .surah-banner .surah-name-ar { font-size: 2rem; }
    .ayah-list { padding: 8px 14px 40px; }
    .ayah-arabic { font-size: calc(var(--arabic-size, 28px) * 0.85) !important; }
    .audio-player { padding: 0 16px; gap: 20px; }
    .player-controls { gap: 6px; }
    .player-btn { width: 38px; height: 38px; font-size: 0.95rem; }
    .player-btn.play-btn { width: 46px; height: 46px; margin: 0 2px; font-size: 1.15rem; }
    .player-volume { display: none; }
}

.hidden { display: none !important; }
