/* ═══════════════════════════════════════════════════════
   SUHAD Design System - Web Version
   Matching iOS App Exactly
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables (Dark Theme - Default) ─── */
:root {
    --bg: #0D1117;
    --surface: #161B22;
    --card: #1C2128;
    --card-hover: #2D333B;
    --border: #30363D;

    --text-primary: #F0E6D3;
    --text-secondary: #A8966E;
    --text-muted: #6B6252;
    --text-on-gold: #1A1207;

    --gold: #C9A96E;
    --gold-light: #E8C888;
    --gold-dark: #8B7340;
    --teal: #4ECDC4;
    --rose: #E8837C;
    --purple: #9B8EC4;
    --blue: #58A6FF;
    --green: #7EE787;
    --orange: #F0883E;

    --success: #56D364;
    --warning: #E3B341;
    --error: #F85149;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-xxl: 28px;
    --radius-full: 100px;

    --font-serif: Georgia, 'Times New Roman', serif;
    --font-rounded: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg: #F8F5EE;
    --surface: #F2EBDD;
    --card: #FFFCF6;
    --card-hover: #E9DFC9;
    --border: #D7C8AE;

    --text-primary: #231A0E;
    --text-secondary: #7B5B2E;
    --text-muted: #9D8E75;

    --gold: #A67C3D;
    --gold-light: #C89D5A;
    --gold-dark: #7A5624;
    --teal: #2E9C95;
    --rose: #C96A62;
    --purple: #7B6BB6;
    --blue: #2D79C7;
    --green: #3A9652;
    --orange: #C97224;

    --success: #2D8A48;
    --warning: #AF7C1E;
    --error: #C54B43;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-family: var(--font-rounded);
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    direction: rtl;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}

input, button, textarea { font-family: inherit; border: none; outline: none; background: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 0; height: 0; }

/* ─── Screen Base ─── */
.screen { position: fixed; inset: 0; z-index: 1; }

/* ═══════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════ */
.splash-screen {
    position: fixed; inset: 0; z-index: 100;
    background: #000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.splash-screen.fade-out { opacity: 0; pointer-events: none; }

.splash-rings { position: absolute; }
.splash-ring {
    position: absolute;
    border: 1px solid rgba(201,169,110,0.05);
    border-radius: 50%;
    transform: scale(0.5);
    opacity: 0;
    transition: all 2.5s ease-out;
}
.splash-ring.ring-1 { width: 300px; height: 300px; top: -150px; left: -150px; }
.splash-ring.ring-2 { width: 450px; height: 450px; top: -225px; left: -225px; border-color: rgba(201,169,110,0.03); }
.splash-ring.visible { transform: scale(1); opacity: 1; }

.splash-glow {
    position: absolute;
    width: 400px; height: 250px;
    background: radial-gradient(ellipse, rgba(201,169,110,0.04) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 1s ease;
}
.splash-glow.visible { opacity: 1; animation: glowPulse 2s ease-in-out infinite alternate; }
@keyframes glowPulse { from { opacity: 0.04; } to { opacity: 0.1; } }

.splash-content { position: relative; z-index: 2; text-align: center; }
.splash-title {
    font-family: var(--font-serif);
    font-size: 68px; font-weight: bold;
    background: linear-gradient(to bottom, #F0E0C0, #E8D5A8, #C9A96E);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(201,169,110,0.4)) drop-shadow(0 0 60px rgba(201,169,110,0.15));
    min-height: 90px;
    display: flex; align-items: center; justify-content: center;
}
.splash-subtitle {
    font-family: var(--font-serif);
    font-size: 15px; font-weight: 300;
    color: rgba(255,255,255,0.35);
    margin-top: 16px;
    opacity: 0; transform: translateY(10px);
    transition: all 0.5s ease;
}
.splash-subtitle.visible { opacity: 1; transform: translateY(0); }

.splash-footer {
    position: absolute; bottom: 36px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    opacity: 0; transition: opacity 1s ease 0.5s;
}
.splash-footer.visible { opacity: 1; }
.splash-line {
    width: 0; height: 2px;
    background: linear-gradient(to right, rgba(201,169,110,0.5), rgba(201,169,110,0.2));
    border-radius: 1px;
    transition: width 1.5s ease;
}
.splash-line.visible { width: 80px; }
.splash-dev {
    font-size: 11px; font-weight: 500;
    color: rgba(201,169,110,0.25);
    letter-spacing: 3px;
    font-family: var(--font-rounded);
}

/* ═══════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════ */
.auth-screen { z-index: 5; }
.auth-bg {
    position: absolute; inset: 0;
    background: var(--bg);
    overflow: hidden;
}
.auth-orb {
    position: absolute; border-radius: 50%;
    filter: blur(60px);
}
.auth-orb-1 {
    width: 350px; height: 350px;
    background: rgba(201,169,110,0.05);
    top: -100px; left: -50px;
}
.auth-orb-2 {
    width: 250px; height: 250px;
    background: rgba(155,142,196,0.05);
    bottom: -50px; right: -50px;
}
.auth-dots {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(201,169,110,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.auth-view {
    position: absolute; inset: 0;
    z-index: 2;
}
.auth-scroll {
    height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 40px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.auth-logo { position: relative; margin-bottom: 8px; }
.auth-logo-glow {
    position: absolute; width: 110px; height: 110px;
    background: radial-gradient(circle, rgba(201,169,110,0.1) 0%, transparent 70%);
    top: -15px; left: -15px;
    border-radius: 50%;
}
.auth-logo-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 30px rgba(201,169,110,0.3);
    position: relative;
}
.auth-logo-icon { width: 36px; height: 36px; color: var(--text-on-gold); }

.auth-title {
    font-family: var(--font-serif);
    font-size: 28px; font-weight: bold;
    color: var(--text-primary);
    text-align: center;
}
.auth-subtitle {
    font-family: var(--font-serif);
    font-size: 16px; color: var(--text-secondary);
    text-align: center;
}

.auth-method-picker {
    display: flex; width: 100%;
    padding: 4px;
    background: var(--surface);
    border-radius: var(--radius-md);
}
.auth-method-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}
.auth-method-tab svg { width: 14px; height: 14px; }
.auth-method-tab.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--text-on-gold);
}

.auth-input-section { width: 100%; }
.auth-label {
    display: block; text-align: right; width: 100%;
    font-size: 14px; font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.auth-phone-row { display: flex; gap: 12px; }
.auth-phone-prefix {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 12px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    white-space: nowrap;
}
.flag-emoji { font-size: 22px; }
.prefix-number { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.auth-input {
    flex: 1; width: 100%;
    padding: 14px 16px;
    font-size: 16px; color: var(--text-primary);
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    text-align: right;
    transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--gold); }
.auth-input::placeholder { color: var(--text-muted); }

.auth-field { position: relative; display: flex; align-items: center; }
.auth-field .auth-input { padding-left: 44px; }
.auth-field-icon {
    position: absolute; left: 14px;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold); font-size: 14px; font-weight: 600;
}
.auth-field-icon svg { width: 16px; height: 16px; fill: var(--gold); }

.auth-error {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; width: 100%;
    background: rgba(248,81,73,0.1);
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--error);
}
.auth-error svg { fill: var(--error); flex-shrink: 0; }

/* Gold Button */
.gold-button {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 54px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-lg);
    font-family: var(--font-serif);
    font-size: 17px; font-weight: 600;
    color: var(--text-on-gold);
    box-shadow: 0 4px 20px rgba(201,169,110,0.3);
    transition: all 0.2s; position: relative;
}
.gold-button:disabled { opacity: 0.6; cursor: not-allowed; }
.gold-button:active:not(:disabled) { transform: scale(0.98); }
.gold-button svg { stroke: var(--text-on-gold); }

.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(26,18,7,0.2);
    border-top-color: var(--text-on-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-divider {
    display: flex; align-items: center; gap: 16px; width: 100%;
    color: var(--text-muted); font-size: 13px;
}
.auth-divider-line { flex: 1; height: 0.5px; background: var(--border); }

.social-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 54px;
    border-radius: var(--radius-lg);
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    transition: all 0.2s;
}
.social-btn:active { transform: scale(0.98); }
.apple-btn { background: #fff; color: #1C1C1E; }
[data-theme="light"] .apple-btn { background: #000; color: #fff; }
[data-theme="light"] .apple-btn svg { fill: #fff; }
.google-btn { background: #fff; color: #1C1C1E; margin-top: -4px; }

/* OTP */
.auth-back-btn {
    display: flex; align-items: center; gap: 6px; align-self: flex-end;
    font-size: 14px; color: var(--text-secondary);
}
.auth-back-btn svg { stroke: var(--text-secondary); }
.otp-icon {
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(78,205,196,0.1);
    display: flex; align-items: center; justify-content: center;
}
.otp-phone { font-family: var(--font-mono); font-size: 18px; color: var(--gold); direction: ltr; }
.otp-fields { display: flex; gap: 10px; direction: ltr; }
.otp-digit {
    width: 48px; height: 56px;
    text-align: center; font-family: var(--font-mono);
    font-size: 24px; font-weight: 600;
    color: var(--text-primary);
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.otp-digit:focus { border-color: var(--gold); border-width: 1.5px; transform: scale(1.05); }
.otp-digit.filled { border-color: var(--gold); border-width: 1.5px; transform: scale(1.05); }
.auth-resend-btn { font-size: 14px; color: var(--gold); text-decoration: underline; }

/* Profile Setup */
.profile-setup-avatar { position: relative; }
.setup-avatar-bg {
    position: absolute; width: 110px; height: 110px;
    background: rgba(201,169,110,0.1);
    border-radius: 50%; top: -10px; left: -10px;
}
.setup-avatar-circle {
    width: 90px; height: 90px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
    color: var(--text-on-gold); position: relative;
}

/* ═══════════════════════════════════════
   MAIN APP
   ═══════════════════════════════════════ */
.app-screen { z-index: 1; display: flex; flex-direction: column; }

/* Ambient Particles */
.ambient-particles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.06;
    animation: floatParticle 15s ease-in-out infinite alternate;
}
.particle:nth-child(1) { top: 10%; left: 20%; animation-duration: 12s; }
.particle:nth-child(2) { top: 30%; left: 70%; animation-duration: 18s; animation-delay: 1s; width: 2px; height: 2px; }
.particle:nth-child(3) { top: 60%; left: 15%; animation-duration: 14s; animation-delay: 2s; width: 4px; height: 4px; opacity: 0.04; }
.particle:nth-child(4) { top: 80%; left: 85%; animation-duration: 16s; animation-delay: 0.5s; }
.particle:nth-child(5) { top: 20%; left: 50%; animation-duration: 20s; animation-delay: 3s; width: 2px; height: 2px; }
.particle:nth-child(6) { top: 50%; left: 30%; animation-duration: 13s; animation-delay: 1.5s; width: 4px; height: 4px; opacity: 0.03; }
.particle:nth-child(7) { top: 70%; left: 60%; animation-duration: 17s; animation-delay: 4s; }
.particle:nth-child(8) { top: 40%; left: 90%; animation-duration: 11s; animation-delay: 2.5s; width: 2px; height: 2px; }
@keyframes floatParticle {
    from { transform: translate(0, 0); }
    to { transform: translate(-20px, -80px); }
}

/* Tab Content */
.tab-content {
    flex: 1; position: relative; overflow: hidden;
}
.tab-page {
    position: absolute; inset: 0;
    opacity: 0; transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tab-page.active {
    opacity: 1; transform: translateY(0);
    pointer-events: all;
}
.page-scroll {
    height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-top: env(safe-area-inset-top, 12px);
}
.page-title {
    font-family: var(--font-serif);
    font-size: 34px; font-weight: bold;
    color: var(--text-primary);
    padding: 12px 20px 8px;
}

/* ═══════════════════════════════════════
   TAB BAR
   ═══════════════════════════════════════ */
.tab-bar {
    position: relative;
    display: flex;
    padding: 14px 8px 0;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
    background: var(--bg);
    z-index: 50;
}
.tab-bar::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.tab-bar-line {
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(201,169,110,0.4), rgba(201,169,110,0.15), transparent);
}
.tab-bar-glow {
    position: absolute; top: -5px;
    width: 110px; height: 70px;
    background: radial-gradient(ellipse, rgba(201,169,110,0.18) 0%, rgba(201,169,110,0.05) 50%, transparent 70%);
    transition: left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.tab-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 5px;
    position: relative; z-index: 2;
    padding: 0;
}
.tab-btn-icon-wrap {
    position: relative;
    width: 58px; height: 34px;
    display: flex; align-items: center; justify-content: center;
}
.tab-btn-indicator {
    position: absolute; inset: 0;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--gold), #D4AF37, var(--gold-light));
    box-shadow: 0 3px 12px rgba(201,169,110,0.5);
    opacity: 0; transform: scale(0.8);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-btn.active .tab-btn-indicator { opacity: 1; transform: scale(1); }
.tab-icon {
    position: relative; z-index: 2;
    fill: none; stroke: var(--text-muted); stroke-width: 1.5;
    transition: all 0.3s;
}
.tab-btn.active .tab-icon {
    fill: var(--text-on-gold); stroke: var(--text-on-gold); stroke-width: 0;
    transform: scale(0.85);
}
.tab-label {
    font-size: 10px; font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-rounded);
    position: relative; z-index: 2;
    transition: all 0.3s;
}
.tab-btn.active .tab-label { color: var(--gold); font-weight: 700; }

/* ═══════════════════════════════════════
   HOME TAB
   ═══════════════════════════════════════ */
.home-header { padding: 12px 20px 0; }
.home-header-row { display: flex; align-items: flex-start; justify-content: space-between; }

.notification-btn {
    position: relative;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--surface);
    border: 0.5px solid rgba(48,54,61,0.4);
    display: flex; align-items: center; justify-content: center;
}
.notification-btn svg { stroke: var(--text-secondary); }
.notification-dot {
    position: absolute; top: 5px; right: 5px;
    width: 10px; height: 10px;
    background: var(--rose);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(232,131,124,0.6);
}

.home-greeting { text-align: right; }
.greeting-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.greeting-emoji { font-size: 20px; }
.greeting-text { font-size: 15px; font-weight: 600; color: var(--gold); font-family: var(--font-rounded); }
.home-question {
    font-family: var(--font-serif);
    font-size: 30px; font-weight: 900;
    background: linear-gradient(to right, var(--text-primary), #D4C4A0, var(--text-primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Card */
.glass-card {
    background: var(--card);
    background: rgba(28,33,40,0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    border-radius: var(--radius-lg);
}
[data-theme="light"] .glass-card {
    background: rgba(255,252,246,0.7);
    border-color: rgba(215,200,174,0.3);
}

.gold-border {
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
}
.gold-border::after {
    content: '';
    position: absolute; inset: -1px;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(201,169,110,0.6), rgba(201,169,110,0.1), rgba(201,169,110,0.4)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

/* Quick Stats */
.quick-stats {
    display: flex; align-items: center;
    padding: 14px 0;
    margin-top: 18px;
}
.quick-stat {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.quick-stat-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.quick-stat-value { font-size: 18px; font-weight: 700; color: var(--text-primary); font-family: var(--font-rounded); }
.quick-stat-label { font-size: 10px; font-weight: 500; color: var(--text-muted); }
.quick-stat-icon { flex-shrink: 0; }
.quick-stat-divider { width: 0.5px; height: 30px; background: rgba(48,54,61,0.3); }

/* Section */
.section { padding: 0 0 0; margin-top: 30px; }
.section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 0 20px; margin-bottom: 14px;
}
.section-title {
    font-family: var(--font-serif);
    font-size: 20px; font-weight: bold;
    color: var(--text-primary);
}
.section-header svg { flex-shrink: 0; }
.section-more { font-size: 13px; font-weight: 500; color: var(--gold); }

/* Arabic Divider */
.arabic-divider {
    display: flex; align-items: center; gap: 12px;
    padding: 0 40px;
    margin: 30px 0;
}
.divider-line { flex: 1; height: 0.5px; background: rgba(48,54,61,0.5); }
[data-theme="light"] .divider-line { background: rgba(215,200,174,0.5); }
.divider-diamond { font-size: 6px; color: rgba(201,169,110,0.5); }

/* Featured Carousel */
.featured-section { margin-top: 24px; }
.featured-carousel {
    display: flex; gap: 0;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 20px;
}
.featured-carousel::-webkit-scrollbar { display: none; }
.featured-card {
    flex: 0 0 calc(100% - 0px); scroll-snap-align: center;
    height: 260px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}
.featured-card:active { transform: scale(0.98); }
.featured-card-bg {
    position: absolute; inset: 0;
    border-radius: 24px;
}
.featured-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent, transparent, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}
.featured-card-decor1, .featured-card-decor2 {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.featured-card-decor1 { width: 180px; height: 180px; top: -60px; left: -60px; }
.featured-card-decor2 { width: 100px; height: 100px; top: -20px; right: -20px; background: rgba(255,255,255,0.03); }

.featured-card-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 24px 20px;
}
.featured-book-cover {
    width: 90px; height: 130px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.featured-book-cover svg { width: 40px; height: 40px; fill: rgba(255,255,255,0.8); }
.featured-card-info {
    text-align: right; flex: 1; padding-right: 16px;
}
.featured-badge {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    color: #fff;
    padding: 5px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}
.featured-card-title {
    font-family: var(--font-serif);
    font-size: 24px; font-weight: bold;
    color: #fff; line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.featured-card-author { font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.85); margin-top: 4px; }
.featured-card-meta {
    display: flex; gap: 14px; margin-top: 8px;
    font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75);
}
.featured-card-meta span { display: flex; align-items: center; gap: 4px; }

.featured-dots {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 14px;
}
.featured-dot {
    width: 8px; height: 6px;
    border-radius: 3px;
    background: var(--border);
    transition: all 0.3s;
}
.featured-dot.active {
    width: 24px;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(201,169,110,0.4);
}

/* Continue Reading Card */
.continue-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; margin: 0 20px 10px;
    border-radius: 18px;
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    position: relative; overflow: hidden;
    cursor: pointer; transition: transform 0.2s;
}
.continue-card:active { transform: scale(0.98); }
.continue-card-accent {
    position: absolute; top: 0; bottom: 0; right: 0; width: 4px;
    background: linear-gradient(to bottom, var(--gold), var(--gold-light));
    border-radius: 0 18px 18px 0;
}
.continue-progress-ring {
    width: 58px; height: 58px; flex-shrink: 0;
    position: relative;
}
.continue-progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.continue-progress-ring .track { fill: none; stroke: var(--border); stroke-width: 3.5; }
.continue-progress-ring .fill { fill: none; stroke: url(#goldGrad); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.continue-progress-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--gold);
}
.continue-info { flex: 1; text-align: right; }
.continue-title {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.continue-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
.continue-play { flex-shrink: 0; }
.continue-play svg {
    width: 42px; height: 42px;
    fill: url(#goldGradFill);
    filter: drop-shadow(0 0 8px rgba(201,169,110,0.3));
}

/* Categories */
.categories-section { overflow: visible; }
.categories-scroll {
    display: flex; gap: 10px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 20px;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.category-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 14px; font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
}
.category-chip:active { transform: scale(0.96); }
.category-chip.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--text-on-gold);
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(201,169,110,0.3);
}
.category-chip svg { width: 14px; height: 14px; }

/* Trending Card */
.trending-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; margin: 0 20px 10px;
    border-radius: var(--radius-lg);
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    cursor: pointer; transition: transform 0.2s;
}
.trending-card:active { transform: scale(0.98); }
.trending-card.top-3 { border-color: rgba(201,169,110,0.15); }
.trending-rank {
    font-family: var(--font-serif);
    font-size: 34px; font-weight: 900;
    min-width: 36px; text-align: center;
}
.trending-rank.gold {
    background: linear-gradient(to bottom, var(--gold), var(--gold-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.trending-rank.dim {
    background: linear-gradient(to bottom, rgba(107,98,82,0.4), rgba(107,98,82,0.2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.trending-cover {
    width: 48px; height: 64px;
    border-radius: var(--radius-md);
    overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.trending-cover-bg { position: absolute; inset: 0; border-radius: var(--radius-md); }
.trending-cover svg { position: relative; z-index: 1; width: 20px; height: 20px; fill: rgba(255,255,255,0.8); }
.trending-info { flex: 1; text-align: right; }
.trending-title {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trending-meta {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    font-size: 12px; margin-top: 4px;
}
.trending-rating { display: flex; align-items: center; gap: 3px; color: var(--gold); }
.trending-rating svg { width: 10px; height: 10px; fill: var(--gold); }
.trending-author { color: var(--text-secondary); }
.trending-dot { color: var(--text-muted); }
.trending-chevron { flex-shrink: 0; }
.trending-chevron svg { width: 12px; height: 12px; stroke: var(--text-muted); fill: none; stroke-width: 2; }

/* Latest Update Row */
.latest-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; margin: 0 20px 10px;
    border-radius: 14px;
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    cursor: pointer; transition: transform 0.2s;
}
.latest-card:active { transform: scale(0.98); }
.latest-cover {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.latest-cover-bg { position: absolute; inset: 0; border-radius: var(--radius-md); }
.latest-cover svg { position: relative; z-index: 1; width: 18px; height: 18px; fill: rgba(255,255,255,0.8); }
.latest-info { flex: 1; text-align: right; }
.latest-title {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.latest-meta {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    font-size: 12px; margin-top: 5px;
}
.latest-new { display: flex; align-items: center; gap: 4px; color: var(--gold); }
.latest-time { color: var(--text-muted); }

/* Empty State */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-illustration { position: relative; width: 200px; height: 200px; margin: 0 auto 32px; }
.empty-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(201,169,110,0.1) 0%, rgba(201,169,110,0.03) 40%, transparent 70%);
    border-radius: 50%;
}
.empty-book {
    position: absolute; width: 75px; height: 110px;
    border-radius: 10px;
    top: 50%; left: 50%;
}
.empty-book.tilted-left {
    background: rgba(201,169,110,0.12);
    transform: translate(-70%, -50%) rotate(-12deg);
}
.empty-book.tilted-right {
    background: linear-gradient(135deg, var(--gold), #A87D2E);
    transform: translate(-30%, -50%) rotate(8deg);
    box-shadow: 0 8px 30px rgba(201,169,110,0.25);
}
.book-lines { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 5px; }
.book-line { height: 3px; border-radius: 2px; }
.book-line:nth-child(1) { width: 38px; background: rgba(255,255,255,0.3); }
.book-line:nth-child(2) { width: 30px; background: rgba(255,255,255,0.2); }
.book-line:nth-child(3) { width: 22px; background: rgba(255,255,255,0.15); }
.empty-icon-circle {
    width: 100px; height: 100px;
    background: rgba(201,169,110,0.05);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.empty-icon-circle svg { stroke: rgba(107,98,82,0.5); }
.empty-title {
    font-family: var(--font-serif);
    font-size: 22px; font-weight: bold;
    background: linear-gradient(to right, var(--text-primary), var(--gold));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.empty-subtitle {
    font-size: 15px; color: var(--text-muted);
    line-height: 1.6; margin-top: 12px;
}

/* ═══════════════════════════════════════
   SEARCH TAB
   ═══════════════════════════════════════ */
.search-bar-container { padding: 0 20px 14px; }
.search-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}
.search-bar.focused {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(201,169,110,0.08);
}
.search-input {
    flex: 1; font-size: 16px; color: var(--text-primary);
    background: none; text-align: right; direction: rtl;
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon { flex-shrink: 0; stroke: var(--text-muted); transition: stroke 0.2s; }
.search-bar.focused .search-icon { stroke: var(--gold); }
.search-clear { flex-shrink: 0; color: var(--text-muted); display: flex; }

.search-section-title {
    font-family: var(--font-serif);
    font-size: 20px; font-weight: bold;
    color: var(--text-primary);
    padding: 0 20px 14px; text-align: right;
}
.category-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 0 20px;
}
.category-grid-item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px 8px;
    border-radius: var(--radius-lg);
    color: rgba(255,255,255,0.9);
    cursor: pointer; transition: transform 0.2s;
    position: relative; overflow: hidden;
}
.category-grid-item:active { transform: scale(0.96); }
.category-grid-item::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    border-radius: var(--radius-lg);
}
.category-grid-item svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.category-grid-item span { font-size: 13px; font-weight: 600; position: relative; z-index: 1; }

.results-count {
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    text-align: right; padding: 0 20px 8px;
}

/* Search Result Row */
.search-result-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px; margin: 0 20px 10px;
    border-radius: 14px;
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    cursor: pointer; transition: transform 0.2s;
}
.search-result-row:active { transform: scale(0.98); }
.result-cover {
    width: 50px; height: 70px;
    border-radius: 10px; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.result-cover-bg {
    position: absolute; inset: 0; border-radius: 10px;
}
.result-cover-bg::after {
    content: '';
    position: absolute; inset: 0; border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
}
.result-cover svg { position: relative; z-index: 1; width: 20px; height: 20px; fill: rgba(255,255,255,0.8); }
.result-info { flex: 1; text-align: right; }
.result-title {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--text-primary);
}
.result-author { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.result-meta {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    font-size: 11px; margin-top: 4px;
}

/* ═══════════════════════════════════════
   LIBRARY TAB
   ═══════════════════════════════════════ */
.segment-picker {
    display: flex; padding: 3px;
    background: var(--surface);
    border-radius: var(--radius-full);
    margin: 0 20px 14px;
    position: relative;
}
.segment-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 14px;
    font-size: 13px; font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    z-index: 2; position: relative;
    transition: color 0.3s;
}
.segment-btn.active { color: #fff; font-weight: 700; }
.segment-btn svg { transition: fill 0.3s; }
.segment-btn.active svg { fill: #fff; }
.segment-indicator {
    position: absolute;
    height: calc(100% - 6px); top: 3px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--gold), #A87D2E);
    box-shadow: 0 2px 12px rgba(201,169,110,0.3);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Library Card */
.library-card {
    display: flex; align-items: center; gap: 14px;
    padding: 12px; margin: 0 20px 10px;
    border-radius: 14px;
    background: var(--card);
    border: 0.5px solid rgba(48,54,61,0.3);
    cursor: pointer; transition: transform 0.2s;
}
.library-card:active { transform: scale(0.98); }
.library-cover {
    width: 48px; height: 66px;
    border-radius: 10px; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.library-cover-bg {
    position: absolute; inset: 0; border-radius: 10px;
}
.library-cover-bg::after {
    content: '';
    position: absolute; inset: 0; border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
}
.library-cover svg { position: relative; z-index: 1; width: 18px; height: 18px; fill: rgba(255,255,255,0.8); }
.library-info { flex: 1; text-align: right; }
.library-title {
    font-family: var(--font-serif);
    font-size: 15px; font-weight: 600;
    color: var(--text-primary);
}
.library-meta {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    font-size: 12px; margin-top: 4px;
    color: var(--text-muted);
}
.library-author { color: var(--text-secondary); }

/* ═══════════════════════════════════════
   PROFILE TAB
   ═══════════════════════════════════════ */
.profile-header { text-align: center; padding: 24px 20px; }
.profile-avatar-container { position: relative; width: 115px; height: 115px; margin: 0 auto; }
.profile-avatar-bg {
    position: absolute; inset: 0;
    background: rgba(201,169,110,0.08);
    border-radius: 50%;
}
.profile-avatar {
    position: absolute; top: 12.5px; left: 12.5px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
}
.profile-avatar-letter {
    font-family: var(--font-serif);
    font-size: 38px; font-weight: bold;
    color: var(--text-on-gold);
}
.profile-pulsing-ring {
    position: absolute; top: 10px; left: 10px;
    width: 95px; height: 95px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-image: conic-gradient(var(--gold), rgba(201,169,110,0.3), rgba(201,169,110,0.1), var(--gold)) 1;
    animation: pulseRing 2s ease-in-out infinite alternate;
}
@keyframes pulseRing {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.05); opacity: 0.8; }
}

.profile-name {
    font-family: var(--font-serif);
    font-size: 26px; font-weight: bold;
    color: var(--text-primary);
    margin-top: 16px;
}
.profile-username { font-size: 14px; color: var(--gold); margin-top: 6px; }
.profile-join-date { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Stats Grid */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 0 20px;
}
.stat-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 8px;
}
.stat-card svg { flex-shrink: 0; }
.stat-value {
    font-family: var(--font-mono);
    font-size: 22px; font-weight: 600;
    color: var(--text-primary);
}
.stat-label { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* Streak Card */
.streak-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; margin: 10px 20px;
}
.streak-dots { display: flex; gap: 4px; }
.streak-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s;
}
.streak-dot.active { background: var(--gold); }
.streak-info { text-align: right; }
.streak-number { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.streak-value { font-family: var(--font-mono); font-size: 24px; font-weight: 600; color: var(--gold); }
.streak-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Menu */
.profile-menu {
    border-radius: var(--radius-lg); overflow: hidden;
    margin: 10px 20px;
}
.menu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 14px 16px;
    background: var(--card);
    border-bottom: 0.5px solid rgba(48,54,61,0.2);
    transition: background 0.2s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--card-hover); }
.menu-item svg { flex-shrink: 0; }
.menu-item-title { font-size: 16px; color: var(--text-primary); font-family: var(--font-serif); }

/* Auth Actions */
.auth-actions { padding: 0 20px; margin-top: 16px; }
.signout-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px;
    background: rgba(232,131,124,0.1);
    border: 0.5px solid rgba(232,131,124,0.2);
    border-radius: var(--radius-lg);
    color: var(--rose);
    font-size: 16px; font-family: var(--font-serif);
}
.signout-btn:active { opacity: 0.8; }

.delete-account-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px; margin-top: 8px;
    background: rgba(220,50,50,0.08);
    border: 0.5px solid rgba(220,50,50,0.2);
    border-radius: var(--radius-lg);
    color: #DC3232;
    font-size: 14px; font-family: var(--font-serif);
}
.delete-account-btn:active { opacity: 0.8; }

/* Developer Footer */
.dev-footer { text-align: center; padding: 20px; }
.dev-footer-title {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: bold;
    background: linear-gradient(to right, var(--gold), var(--gold-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-top: 12px;
}
.dev-footer-label { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 6px; }
.dev-footer-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--gold);
    padding: 8px 16px;
    background: rgba(201,169,110,0.08);
    border: 0.5px solid rgba(201,169,110,0.2);
    border-radius: var(--radius-full);
    margin-top: 8px;
    font-family: var(--font-rounded);
}
.dev-footer-link svg { stroke: var(--gold); }
.dev-footer-version { font-size: 10px; color: rgba(107,98,82,0.6); margin-top: 8px; }

/* ═══════════════════════════════════════
   NOVEL DETAIL MODAL
   ═══════════════════════════════════════ */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg);
    animation: slideUp 0.35s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-content { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.novel-hero {
    position: relative;
    min-height: 350px;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 24px;
}
.novel-hero-bg {
    position: absolute; inset: 0;
    border-radius: 0;
}
.novel-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent, transparent, rgba(13,17,23,0.6), var(--bg));
}
.novel-hero-decor { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.04); }
.novel-hero-content { position: relative; z-index: 2; text-align: center; }
.novel-cover-large {
    width: 130px; height: 190px; margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.novel-cover-large svg { width: 40px; height: 40px; fill: rgba(255,255,255,0.8); }
.novel-cover-large span {
    font-size: 11px; color: rgba(255,255,255,0.7);
    padding: 0 8px; text-align: center;
    font-family: var(--font-serif);
}
.novel-detail-title {
    font-family: var(--font-serif);
    font-size: 28px; font-weight: bold;
    color: var(--text-primary);
}
.novel-detail-author { font-size: 16px; color: var(--gold); margin-top: 8px; }
.novel-category-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-full);
    margin-top: 8px;
}

.novel-body { padding: 24px 20px 120px; }

/* Stats Row */
.novel-stats-row {
    display: flex; align-items: center;
    padding: 16px 0;
    border-radius: var(--radius-lg);
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(48,54,61,0.3);
    margin-bottom: 24px;
}
.novel-stat-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.novel-stat-item svg { width: 14px; height: 14px; fill: var(--gold); }
.novel-stat-value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text-primary); }
.novel-stat-label { font-size: 11px; color: var(--text-muted); }
.novel-stat-divider { width: 0.5px; height: 40px; background: rgba(48,54,61,0.5); }

.novel-section-title {
    font-family: var(--font-serif);
    font-size: 18px; font-weight: 600;
    color: var(--text-primary);
    text-align: right; margin-bottom: 10px;
}
.novel-synopsis {
    font-family: var(--font-serif);
    font-size: 15px; color: var(--text-secondary);
    line-height: 1.8; text-align: right;
    margin-bottom: 24px;
}

/* Tags */
.novel-tags {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
    margin-bottom: 24px;
}
.novel-tag {
    font-size: 12px; color: var(--blue);
    padding: 5px 10px;
    background: rgba(88,166,255,0.1);
    border-radius: var(--radius-full);
}

/* Author Section */
.novel-author-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px;
    background: var(--card);
    border: 0.5px solid rgba(48,54,61,0.3);
    border-radius: var(--radius-lg);
    justify-content: flex-end;
    margin-bottom: 24px;
}
.novel-author-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-serif);
    font-size: 20px; font-weight: 600;
    color: var(--text-on-gold);
}
.novel-author-info { text-align: right; }
.novel-author-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.novel-author-role { font-size: 12px; color: var(--text-secondary); }

/* Chapter Row */
.chapter-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 0.5px solid rgba(48,54,61,0.3);
    margin-bottom: 8px;
    cursor: pointer; transition: transform 0.2s;
}
.chapter-row:active { transform: scale(0.98); }
.chapter-number {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 0.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 14px; color: var(--gold);
    flex-shrink: 0;
}
.chapter-info { flex: 1; text-align: right; }
.chapter-title {
    font-family: var(--font-serif);
    font-size: 15px; color: var(--text-primary);
}
.chapter-meta {
    font-size: 11px; color: var(--text-muted);
    margin-top: 4px;
}

/* Novel Bottom Bar */
.novel-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px 30px;
    background: var(--surface);
    border-top: 0.5px solid rgba(48,54,61,0.2);
    backdrop-filter: blur(20px);
    z-index: 210;
}
.follow-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    width: 60px; height: 54px; justify-content: center;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 10px; color: var(--text-secondary);
    transition: all 0.3s;
}
.follow-btn.active { border-color: var(--gold); color: var(--gold); }
.follow-btn svg { width: 20px; height: 20px; }
.start-reading-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 54px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-md);
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--text-on-gold);
    box-shadow: 0 4px 20px rgba(201,169,110,0.3);
}
.start-reading-btn:active { transform: scale(0.98); }

/* ═══════════════════════════════════════
   READER MODAL
   ═══════════════════════════════════════ */
.reader-modal { z-index: 300; }
.reader-content {
    height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 60px 24px 100px;
}
.reader-chapter-header {
    text-align: center; padding: 30px 0;
}
.reader-chapter-decor {
    display: flex; align-items: center; gap: 8px;
    padding: 0 50px; margin-bottom: 16px;
}
.reader-chapter-decor-line { flex: 1; height: 0.5px; }
.reader-chapter-decor-icon { font-size: 12px; opacity: 0.3; }
.reader-chapter-title { font-family: var(--font-serif); font-weight: bold; }
.reader-chapter-meta { margin-top: 8px; }

.reader-paragraph {
    font-family: var(--font-serif);
    line-height: 1.8; text-align: right;
    padding: 8px 0;
}

.reader-chapter-end { text-align: center; padding: 40px 0; }
.reader-end-mark { font-size: 20px; opacity: 0.3; }
.reader-end-text { font-family: var(--font-serif); opacity: 0.6; margin-top: 12px; }
.reader-nav-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.reader-nav-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: var(--radius-full);
    font-size: 14px;
}
.reader-nav-btn.outline { border: 1px solid; opacity: 0.7; }
.reader-nav-btn.gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--text-on-gold);
}

/* Reader Controls */
.reader-controls {
    position: fixed; inset: 0; z-index: 310;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reader-top-bar, .reader-bottom-bar { pointer-events: all; }
.reader-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 50px 24px 12px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}
.reader-ctrl-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.reader-ctrl-btn svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.5; }
.reader-top-info { text-align: center; }
.reader-top-novel { font-size: 12px; color: rgba(255,255,255,0.7); }
.reader-top-chapter { font-size: 14px; color: #fff; font-weight: 500; }

.reader-bottom-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 16px 24px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.reader-progress-bar {
    height: 4px; border-radius: 2px;
    background: rgba(255,255,255,0.2);
    overflow: hidden; margin-bottom: 4px;
}
.reader-progress-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(to right, var(--gold), var(--gold-light));
    transition: width 0.3s;
}
.reader-progress-info {
    display: flex; justify-content: space-between;
    font-size: 11px; margin-bottom: 16px;
}
.reader-progress-text { color: rgba(255,255,255,0.6); }
.reader-progress-percent { color: var(--gold); font-family: var(--font-mono); font-size: 12px; }
.reader-controls-row {
    display: flex; align-items: center; justify-content: space-between;
}

/* Reader Settings Panel */
.reader-settings-panel {
    position: fixed; inset: 0; z-index: 320;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0,0,0,0.4);
    animation: fadeIn 0.2s ease;
}
.reader-settings-content {
    width: 100%; max-width: 430px;
    padding: 24px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    backdrop-filter: blur(20px);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
    max-height: 60vh;
    overflow-y: auto;
}

/* ═══════════════════════════════════════
   CATEGORY GRADIENTS
   ═══════════════════════════════════════ */
.cat-romance { background: linear-gradient(135deg, #E8837C, #FF6B9D); }
.cat-thriller { background: linear-gradient(135deg, #F0883E, #FF4500); }
.cat-fantasy { background: linear-gradient(135deg, #9B8EC4, #6C5CE7); }
.cat-drama { background: linear-gradient(135deg, #C9A96E, #FF8C42); }
.cat-horror { background: linear-gradient(135deg, #2D1B69, #11998E); }
.cat-scifi { background: linear-gradient(135deg, #58A6FF, #4ECDC4); }
.cat-historical { background: linear-gradient(135deg, #8B6914, #C9A96E); }
.cat-mystery { background: linear-gradient(135deg, #2C3E50, #4CA1AF); }
.cat-comedy { background: linear-gradient(135deg, #F7971E, #FFD200); }
.cat-social { background: linear-gradient(135deg, #4ECDC4, #7EE787); }

/* ═══════════════════════════════════════
   SVG GRADIENT DEFS
   ═══════════════════════════════════════ */
/* These are defined inline in HTML */

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
    body {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: 0 0 60px rgba(0,0,0,0.5);
    }
    .tab-bar { max-width: 430px; margin: 0 auto; left: 50%; transform: translateX(-50%); }
    .novel-bottom-bar { max-width: 430px; margin: 0 auto; left: 50%; transform: translateX(-50%); }
    .modal { max-width: 430px; margin: 0 auto; left: 50%; transform: translateX(-50%); }
    .splash-screen { max-width: 430px; margin: 0 auto; }
}

/* ═══════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════ */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease; }

/* ═══════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════ */
.admin-tabs {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 4px; margin-bottom: 16px;
    background: var(--surface); border-radius: var(--radius-lg);
    -webkit-overflow-scrolling: touch;
}
.admin-tab {
    flex-shrink: 0; padding: 10px 16px;
    border-radius: var(--radius-md); border: none;
    background: transparent; color: var(--text-muted);
    font-size: 13px; font-family: var(--font-serif);
    cursor: pointer; transition: all 0.2s;
}
.admin-tab.active {
    background: var(--gold);
    color: #1A1A2E; font-weight: 600;
}
.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-book-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; margin-bottom: 8px;
}
.admin-book-cover {
    width: 44px; height: 62px; border-radius: 6px;
    background: var(--surface); display: flex;
    align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.admin-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.admin-book-info { flex: 1; min-width: 0; }
.admin-book-title {
    font-weight: 600; font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-book-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.admin-book-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.admin-book-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.status-badge {
    font-size: 10px; padding: 3px 8px; border-radius: 6px;
    font-weight: 600;
}
.status-badge.published { background: rgba(78,205,196,0.15); color: #4ECDC4; }
.status-badge.draft { background: rgba(201,169,110,0.15); color: var(--gold); }

.file-badge {
    font-size: 9px; padding: 2px 6px; border-radius: 4px;
    background: rgba(201,169,110,0.15); color: var(--gold);
    font-weight: 700; letter-spacing: 0.5px;
}

.icon-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: none; background: var(--surface);
    color: var(--text-muted); display: flex;
    align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn.danger { background: rgba(232,131,124,0.1); color: var(--rose); }
.icon-btn:active { opacity: 0.7; }

.admin-user-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; margin-bottom: 8px;
}
.admin-user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(201,169,110,0.15); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
    font-family: var(--font-serif);
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
    font-weight: 600; font-size: 14px;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.admin-user-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.admin-user-count { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; text-align: center; }
.super-badge { font-size: 11px; color: var(--gold); }
.admin-label {
    font-size: 9px; padding: 2px 6px; border-radius: 4px;
    background: rgba(88,166,255,0.15); color: #58A6FF;
}
.admin-perms-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.perm-badge {
    font-size: 10px; padding: 3px 8px; border-radius: 6px;
    background: var(--surface); color: var(--text-muted);
}
.perm-check-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; background: var(--surface);
    border-radius: var(--radius-md); margin-bottom: 6px;
    cursor: pointer; font-size: 14px; color: var(--text-primary);
}
.perm-check-item input { width: 18px; height: 18px; accent-color: var(--gold); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* Modal */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg); overflow-y: auto;
}
.modal-content { max-width: 430px; margin: 0 auto; min-height: 100vh; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; position: sticky; top: 0;
    background: var(--bg); z-index: 10;
    border-bottom: 0.5px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 600; color: var(--text-primary); font-family: var(--font-serif); }
.modal-close-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--surface);
    color: var(--text-muted); font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-save-btn {
    padding: 8px 20px; border-radius: var(--radius-md);
    border: none; background: var(--gold);
    color: #1A1A2E; font-weight: 600; font-size: 14px;
    cursor: pointer; font-family: var(--font-serif);
}
.modal-save-btn:disabled { opacity: 0.5; }
.modal-body { padding: 20px; }

/* Forms */
.form-section { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 8px;
    font-family: var(--font-serif);
}
.form-input {
    width: 100%; padding: 12px 16px;
    background: var(--surface); border: 0.5px solid var(--border);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-size: 15px; font-family: var(--font-serif);
    outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gold); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-select {
    padding: 8px 12px; background: var(--surface);
    border: 0.5px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font-size: 13px;
    font-family: var(--font-serif);
}

.cover-upload {
    width: 100%; aspect-ratio: 3/4; max-height: 200px;
    background: var(--surface); border: 2px dashed var(--border);
    border-radius: var(--radius-lg); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; transition: border-color 0.2s;
}
.cover-upload:hover { border-color: var(--gold); }
#cover-placeholder {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px; color: var(--text-muted);
    font-size: 13px;
}

.file-upload {
    padding: 16px; background: var(--surface);
    border: 1px dashed var(--border); border-radius: var(--radius-md);
    cursor: pointer; text-align: center; color: var(--text-muted);
    font-size: 13px; transition: border-color 0.2s;
}
.file-upload:hover { border-color: var(--gold); }

.category-select-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.cat-select-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-primary); font-size: 13px;
    cursor: pointer; transition: all 0.2s;
}
.cat-select-item.selected {
    border-color: var(--gold); background: rgba(201,169,110,0.1);
    color: var(--gold);
}

.tags-input-wrap { display: flex; gap: 8px; }
.tags-input-wrap .form-input { flex: 1; }
.tag-add-btn {
    width: 44px; border-radius: var(--radius-md);
    border: none; background: var(--gold);
    color: #1A1A2E; font-size: 20px; font-weight: 700; cursor: pointer;
}
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-item {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: rgba(201,169,110,0.1);
    border: 0.5px solid rgba(201,169,110,0.2);
    border-radius: var(--radius-full);
    color: var(--gold); font-size: 12px;
}
.tag-item button {
    background: none; border: none; color: var(--gold);
    cursor: pointer; font-size: 12px; padding: 0 2px;
}

.form-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--surface);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-size: 14px;
}
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; border-radius: 12px;
    background: var(--border); cursor: pointer;
    transition: background 0.3s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 18px; height: 18px; border-radius: 50%;
    background: white; top: 3px; right: 3px;
    transition: transform 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(-20px); }

.section-btn {
    padding: 6px 14px; border-radius: var(--radius-md);
    border: 1px solid var(--gold); background: transparent;
    color: var(--gold); font-size: 12px; cursor: pointer;
    font-family: var(--font-serif);
}

.quick-points {
    display: flex; gap: 8px; margin: 12px 0;
}
.quick-points button {
    flex: 1; padding: 10px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--surface);
    color: var(--gold); font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: var(--font-serif);
}
.quick-points button:active { background: rgba(201,169,110,0.1); }

.gold-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px; border-radius: var(--radius-lg);
    border: none; cursor: pointer;
    background: linear-gradient(135deg, #C9A96E, #D4AF37);
    color: #1A1A2E; font-weight: 700; font-size: 15px;
    font-family: var(--font-serif);
    box-shadow: 0 4px 16px rgba(201,169,110,0.3);
}
.gold-btn:active { opacity: 0.9; transform: scale(0.98); }

/* ═══ Rating Stars ═══ */
.rating-star-btn:hover svg { filter: brightness(1.3); }
.novel-rating-section { border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* ═══ Comment Items ═══ */
.comment-item { transition: transform 0.2s; }
.comment-item:hover { transform: translateX(-2px); }
.comment-input-bar .form-input { border-radius: var(--radius-lg); }

/* ═══ Quote Share ═══ */
.quote-style-btn.active {
    background: var(--gold) !important;
    color: #1A1A2E !important;
    border-color: var(--gold) !important;
    font-weight: 600;
}
#quote-share-modal .modal-content { max-width: 430px; }

/* ═══ Loyalty & Challenge Modals ═══ */
#loyalty-modal .modal-body,
#challenge-modal .modal-body { padding-bottom: 40px; }
