/* ============================================================
   CLEARVIEW — Dark Purple Netflix-Style
   ============================================================ */

:root {
  --bg:            #09071A;
  --surface:       #110E28;
  --surface-2:     #1A1740;
  --surface-3:     #231F52;
  --accent:        #8B5CF6;
  --accent-dark:   #6D28D9;
  --accent-light:  #C4B5FD;
  --accent-vivid:  #A855F7;
  --accent-glow:   rgba(139, 92, 246, 0.3);
  --accent-glow-lg:rgba(139, 92, 246, 0.15);
  --gradient-btn:  linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  --gradient-hero: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #A855F7 100%);
  --text:          #F8F5FF;
  --text-dim:      #D8CAFF;
  --text-muted:    #9080C0;
  --border:        #2E2860;
  --border-glow:   rgba(139, 92, 246, 0.35);
  --gold:          #FBBF24;
  --nav-h:         64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient background glow — fixed so it stays behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(109,40,217,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(168,85,247,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139,92,246,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
#authScreen, #appContainer { position: relative; z-index: 1; }

.hidden { display: none !important; }

/* ============================================================
   AUTH SCREEN
   ============================================================ */
#authScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite;
}
.auth-orb-1 { width: 650px; height: 650px; background: radial-gradient(circle, #7C3AED, #4C1D95); top: -200px; left: -150px; animation-delay: 0s; opacity: 0.45; }
.auth-orb-2 { width: 450px; height: 450px; background: radial-gradient(circle, #A855F7, #6D28D9); bottom: -120px; right: -80px; animation-delay: 3s; opacity: 0.35; }
.auth-orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, #C4B5FD, #8B5CF6); top: 40%; left: 45%; animation-delay: 5s; opacity: 0.2; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

.auth-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  background: rgba(17, 14, 40, 0.75);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(109, 40, 217, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin: 20px;
}

.auth-logo {
  font-family: 'Sora', sans-serif;
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.logo-c { color: var(--text); }
.logo-v {
  background: linear-gradient(135deg, var(--accent), var(--accent-vivid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-tagline {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.auth-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-input::placeholder { color: var(--text-muted); }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #f87171;
}

.btn-auth {
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 4px;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.4);
}
.btn-auth:hover { opacity: 0.9; box-shadow: 0 8px 32px rgba(139, 92, 246, 0.55); }
.btn-auth:active { transform: scale(0.98); }

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.auth-link {
  color: var(--accent-light);
  cursor: pointer;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ============================================================
   TOP NAV
   ============================================================ */
#topNav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(9, 7, 26, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.18);
  box-shadow: 0 1px 0 rgba(139, 92, 246, 0.08), 0 4px 24px rgba(0,0,0,0.3);
}

.nav-left { display: flex; align-items: center; gap: 40px; }

.nav-logo {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  cursor: pointer;
}
.nav-logo .logo-v {
  background: linear-gradient(135deg, var(--accent), var(--accent-vivid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(139,92,246,0.1); }
.nav-link.active { color: var(--text); background: rgba(139,92,246,0.12); box-shadow: inset 0 0 0 1px rgba(139,92,246,0.2); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.nav-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.07); }

.nav-profile-wrap { position: relative; cursor: pointer; }

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: white;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 0 0 2px rgba(139,92,246,0.4), 0 4px 12px rgba(139,92,246,0.3);
}
.nav-avatar:hover { box-shadow: 0 0 0 3px rgba(139,92,246,0.6), 0 6px 20px rgba(139,92,246,0.4); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  background: rgba(17, 14, 40, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(109,40,217,0.15);
  z-index: 200;
}
.nd-user { padding: 14px 16px; }
.nd-name { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; color: var(--text); }
.nd-plan { font-size: 12px; color: var(--accent-light); margin-top: 2px; }
.nd-divider { height: 1px; background: var(--border); }
.nd-item {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 11px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: block;
}
.nd-item:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
#searchOverlay {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(11, 10, 18, 0.97);
  backdrop-filter: blur(16px);
  padding: 24px 32px;
  overflow-y: auto;
}

.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 28px;
}
.search-icon-sm { color: var(--text-muted); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}
.search-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  padding: 40px 0;
}
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.search-section-label {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ============================================================
   APP SCREENS
   ============================================================ */
#appContainer { padding-top: var(--nav-h); min-height: 100vh; }

.app-screen { min-height: calc(100vh - var(--nav-h)); display: none; }
.app-screen.active { display: block; }

.screen-inner {
  padding: 40px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.screen-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  height: 620px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed);
  transition: background 0.5s;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(11, 10, 18, 0.95) 0%,
    rgba(11, 10, 18, 0.6) 50%,
    rgba(11, 10, 18, 0.1) 100%
  ), linear-gradient(
    to top,
    rgba(11, 10, 18, 1) 0%,
    transparent 30%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 48px;
  gap: 40px;
}

.hero-left { flex: 1; max-width: 560px; }

.hero-category-badge {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-light);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

.hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 68px;
  font-weight: 800;
  line-height: 1.0;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 40px rgba(0,0,0,0.4);
}

.hero-author {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 400;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 440px;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 4px 10px;
}

.hero-actions { display: flex; gap: 12px; align-items: center; }

.btn-watch-now {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
  letter-spacing: 0.01em;
}
.btn-watch-now:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(139, 92, 246, 0.6);
}
.btn-watch-now:active { transform: scale(0.97); }

.btn-my-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 13px 22px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.btn-my-list:hover { background: rgba(255,255,255,0.18); }
.btn-my-list.in-list { color: var(--accent-light); border-color: var(--accent); background: rgba(139, 92, 246, 0.1); }

.hero-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-cover-card {
  width: 240px;
  height: 340px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.7),
    0 0 60px rgba(139, 92, 246, 0.45),
    0 0 120px rgba(139, 92, 246, 0.2);
  transform: rotate(4deg) translateY(-10px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-cover-card:hover {
  transform: rotate(0deg) scale(1.05) translateY(-16px);
  box-shadow:
    0 60px 120px rgba(0,0,0,0.7),
    0 0 80px rgba(139, 92, 246, 0.6),
    0 0 160px rgba(139, 92, 246, 0.3);
}

.hero-cover-emoji {
  font-size: 96px;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  position: relative;
  z-index: 1;
}

.hero-cover-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.2) 0%, transparent 65%);
}

/* ============================================================
   CONTENT ROWS
   ============================================================ */
.rows-section {
  padding: 20px 0 60px;
  background: linear-gradient(to bottom, transparent, var(--bg) 40px);
}

.content-row { margin-bottom: 40px; }

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  margin-bottom: 14px;
}

.row-title {
  font-family: 'Sora', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 18px;
  background: var(--gradient-btn);
  border-radius: 2px;
  flex-shrink: 0;
}
.row-title:hover { color: var(--accent-light); }

.row-see-all {
  font-size: 13px;
  color: var(--accent-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}
.row-see-all:hover { opacity: 0.7; }

.row-track-wrap { position: relative; padding: 0 40px; }

.row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.row-track::-webkit-scrollbar { display: none; }

/* ============================================================
   BOOK CARD (Portrait)
   ============================================================ */
.book-card {
  flex-shrink: 0;
  width: 162px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.book-card:hover { transform: scale(1.08) translateY(-6px); z-index: 10; }
.book-card:hover .bc-overlay { opacity: 1; }
.book-card:hover .bc-info { opacity: 1; transform: translateY(0); }
.book-card:hover .bc-cover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 30px rgba(139,92,246,0.35);
  border-color: rgba(139,92,246,0.4);
}

.bc-cover {
  width: 162px;
  height: 225px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.05);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.bc-emoji {
  font-size: 52px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.3));
}

.bc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 12px;
}
.bc-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.5);
}

.bc-info {
  margin-top: 10px;
  opacity: 0.85;
}
.bc-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bc-author {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.bc-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  align-items: center;
}
.bc-rating {
  font-size: 11px;
  color: #fbbf24;
}
.bc-eps {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   BROWSE SCREEN
   ============================================================ */
.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cat-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 24px;
  padding: 8px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-pill:hover { border-color: var(--accent); color: var(--text); background: rgba(139,92,246,0.08); }
.cat-pill.active {
  background: var(--gradient-btn);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(139,92,246,0.4);
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 20px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 20px; opacity: 0.5; }
.empty-state h3 {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.empty-state p { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; }
.btn-empty-action {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-empty-action:hover { background: var(--accent-dark); }

/* ============================================================
   BACK BUTTON
   ============================================================ */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: absolute;
  top: 24px;
  left: 32px;
  z-index: 10;
}
.btn-back:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ============================================================
   BOOK DETAIL SCREEN
   ============================================================ */
#screenDetail { padding-top: 0; }

.detail-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1b4b, #7c3aed);
  transition: background 0.4s;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11,10,18,0.3) 0%,
    rgba(11,10,18,0.7) 60%,
    rgba(11,10,18,1) 100%
  ), linear-gradient(
    to right,
    rgba(11,10,18,0.0) 0%,
    rgba(11,10,18,0.3) 100%
  );
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 36px;
  align-items: flex-end;
  padding: 80px 48px 40px;
  width: 100%;
}

.detail-cover {
  width: 180px;
  height: 250px;
  border-radius: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 70px rgba(0,0,0,0.7), 0 0 50px rgba(139,92,246,0.3);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.detail-cover-emoji { font-size: 76px; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5)); }

.detail-info { flex: 1; }
.detail-category {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 8px;
}
.detail-title {
  font-family: 'Sora', sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 6px;
}
.detail-author {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.detail-stats {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}
.detail-stat-val { color: var(--text); font-weight: 500; }
.detail-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 580px;
  margin-bottom: 20px;
}
.detail-actions { display: flex; gap: 12px; align-items: center; }
.btn-list-detail {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 12px 22px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-list-detail:hover { background: rgba(255,255,255,0.18); }
.btn-list-detail.in-list { color: var(--accent-light); border-color: var(--accent); background: rgba(139,92,246,0.1); }

.detail-body {
  padding: 32px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

/* Episode List */
.episodes-section { margin-bottom: 48px; }

.episode-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.episode-item:hover { background: var(--surface-2); border-color: var(--border); }
.episode-item.ep-active { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.3); }

.ep-number {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.episode-item.ep-active .ep-number { background: var(--accent); color: white; }

.ep-thumb {
  width: 90px;
  height: 56px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}

.ep-content { flex: 1; }
.ep-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.ep-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-duration {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ep-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.episode-item:hover .ep-play-btn { opacity: 1; }

.ep-progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 8px;
}
.ep-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s;
}

.more-section { margin-top: 48px; }

/* ============================================================
   PLAYER SCREEN
   ============================================================ */
#screenPlayer { padding-top: 0; background: #050408; }

.player-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: calc(100vh - var(--nav-h));
}

.player-main {
  display: flex;
  flex-direction: column;
  padding: 24px 32px 40px;
  position: relative;
}

.player-canvas {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #0a0810;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.8),
    0 0 0 1px rgba(139,92,246,0.2),
    0 0 60px rgba(139,92,246,0.15);
  max-height: 56vh;
}

/* Cartoon Scene */
.cartoon-scene {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e1b4b, #6d28d9);
  transition: background 0.5s;
}

/* Floating elements */
.float-el {
  position: absolute;
  font-size: 28px;
  opacity: 0.7;
  animation: floatEl 4s ease-in-out infinite;
  pointer-events: none;
}
.float-el-1 { top: 15%; left: 12%; animation-duration: 3.5s; }
.float-el-2 { top: 20%; right: 14%; animation-duration: 4.5s; animation-delay: 1s; }
.float-el-3 { bottom: 28%; right: 10%; animation-duration: 4s; animation-delay: 2s; }

@keyframes floatEl {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* Cartoon Character */
.cartoon-char {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: charBob 2s ease-in-out infinite;
}

.char-head {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFD6A5;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.char-eye {
  width: 10px;
  height: 13px;
  background: #1a1a2e;
  border-radius: 50%;
  position: absolute;
  top: 22px;
  animation: charBlink 4s ease-in-out infinite;
}
.char-eye-l { left: 15px; }
.char-eye-r { right: 15px; }
.char-mouth {
  width: 26px;
  height: 12px;
  border-bottom: 3px solid #c0783c;
  border-radius: 0 0 26px 26px;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  animation: charTalk 0.6s ease-in-out infinite;
}

.char-body {
  width: 48px;
  height: 58px;
  background: var(--accent);
  border-radius: 10px 10px 6px 6px;
  margin-top: 3px;
  position: relative;
  box-shadow: 0 4px 12px rgba(109,40,217,0.4);
}
.char-arm {
  width: 14px;
  height: 42px;
  background: var(--accent);
  border-radius: 7px;
  position: absolute;
  top: 6px;
}
.char-arm-l { left: -16px; transform-origin: top center; animation: armSwingL 2s ease-in-out infinite; }
.char-arm-r { right: -16px; transform-origin: top center; animation: armSwingR 2s ease-in-out infinite; }

.char-legs {
  display: flex;
  gap: 8px;
  margin-top: 3px;
}
.char-leg {
  width: 16px;
  height: 46px;
  background: #3730a3;
  border-radius: 8px;
}
.char-leg-l { animation: legSwingL 1s ease-in-out infinite; }
.char-leg-r { animation: legSwingR 1s ease-in-out infinite 0.5s; }

/* Speech bubble */
.speech-bubble {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: #1a1a2e;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 16px;
  max-width: 60%;
  text-align: center;
  z-index: 8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: bubbleIn 0.4s ease-out;
  line-height: 1.4;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: white;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Character animations */
@keyframes charBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes charTalk {
  0%, 100% { height: 12px; }
  50% { height: 18px; }
}
@keyframes charBlink {
  0%, 88%, 100% { transform: scaleY(1); }
  92% { transform: scaleY(0.1); }
}
@keyframes armSwingL {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(18deg); }
}
@keyframes armSwingR {
  0%, 100% { transform: rotate(12deg); }
  50% { transform: rotate(-18deg); }
}
@keyframes legSwingL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(12deg); }
}
@keyframes legSwingR {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-12deg); }
}

/* Player overlays */
.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  z-index: 10;
}
.player-ep-pill {
  background: var(--accent);
  color: white;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.player-book-name {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

/* Player Controls */
.player-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 18px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 10;
}
.player-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.player-time-stamp {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  min-width: 34px;
}
.player-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}
.player-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s linear;
}
.player-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.player-btn-sm {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  transition: all 0.15s;
}
.player-btn-sm:hover { color: white; background: rgba(255,255,255,0.1); }
.player-btn-main {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 20px rgba(109,40,217,0.5);
}
.player-btn-main:hover { background: var(--accent-dark); transform: scale(1.05); }

.player-ep-info {
  margin-top: 20px;
  padding: 0 4px;
}
.player-ep-num {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 6px;
}
.player-ep-title-main {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.player-ep-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

/* Player Sidebar */
.player-sidebar {
  background: var(--surface);
  border-left: 1px solid rgba(139,92,246,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}

.sidebar-book-info {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-book-cover {
  width: 60px;
  height: 84px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.sidebar-book-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.3;
}
.sidebar-book-author {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-label {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 20px 10px;
}

.sidebar-ep-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-ep-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.sidebar-ep-item:hover { background: var(--surface-2); }
.sidebar-ep-item.active { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.3); }

.sep-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sidebar-ep-item.active .sep-num { background: var(--accent); color: white; }

.sep-content { flex: 1; min-width: 0; }
.sep-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sep-dur {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   PRICING SCREEN
   ============================================================ */
.pricing-hero {
  text-align: center;
  padding: 40px 20px 48px;
}
.pricing-title {
  font-family: 'Sora', sans-serif;
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.pricing-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 20px;
  padding-bottom: 60px;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  position: relative;
  transition: border-color 0.2s;
}
.pricing-card:hover { border-color: var(--accent); }

.pc-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.pc-badge ~ .pc-tier { margin-top: 8px; }

.pricing-card.pc-popular {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface), rgba(109,40,217,0.1));
  box-shadow: 0 0 40px rgba(109,40,217,0.2);
  padding-top: 44px;
}

.pc-tier {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pc-price {
  font-family: 'Sora', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1;
}
.pc-period { font-size: 18px; font-weight: 400; color: var(--text-muted); }

.pc-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
  min-height: 40px;
}

.pc-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 13px;
}
.feat-yes { color: var(--text-dim); }
.feat-yes::before { content: '✓ '; color: var(--accent-light); font-weight: 700; }
.feat-no { color: var(--text-muted); opacity: 0.6; }
.feat-no::before { content: '✗ '; }

.pc-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.pc-btn-current { background: var(--surface-2); color: var(--text-muted); cursor: default; }
.pc-btn-premium { background: var(--accent); color: white; }
.pc-btn-premium:hover { background: var(--accent-dark); }
.pc-btn-student { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pc-btn-student:hover { border-color: var(--accent); color: var(--accent-light); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-el {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 12px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  white-space: nowrap;
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ============================================================
   LOADING SHIMMER
   ============================================================ */
.shimmer {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================================
   STREAK BADGE
   ============================================================ */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: default;
  transition: all 0.3s;
  opacity: 0.45;
}
.streak-badge.streak-active {
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.35);
  opacity: 1;
  box-shadow: 0 0 12px rgba(251,191,36,0.15);
}
.streak-fire { font-size: 14px; line-height: 1; }
.streak-num {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  min-width: 10px;
}

/* ============================================================
   COLLECTION CARDS
   ============================================================ */
/* Collections get their own independent rail — not inside .row-track */
.collections-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 0 40px 10px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.collections-rail::-webkit-scrollbar { display: none; }

.collection-card {
  position: relative;
  min-width: 230px;
  width: 230px;
  height: 136px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  border: 1px solid rgba(255,255,255,0.12);
}
.collection-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.15);
}
/* Dark overlay gradient at bottom */
.collection-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  pointer-events: none;
}
.cc-emoji {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 34px;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.cc-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px 14px;
  z-index: 2;
}
.cc-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.cc-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 4px;
}
.cc-count {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* Collection detail screen header */
.collection-screen-header {
  margin-bottom: 32px;
  padding: 28px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.csh-bg { position: absolute; inset: 0; opacity: 0.5; }
.csh-emoji { font-size: 52px; position: relative; z-index: 1; }
.csh-info { position: relative; z-index: 1; }
.csh-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.csh-desc { font-size: 15px; color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.csh-meta { font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

/* ============================================================
   INSIGHT CARDS OVERLAY
   ============================================================ */
.insight-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5,4,10,0.95);
  backdrop-filter: blur(24px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: fadeIn 0.4s ease;
}
.insight-overlay.hidden { display: none !important; }

.insight-wrap {
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

.insight-top {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.insight-book-cover {
  width: 64px;
  height: 86px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.insight-cover-emoji { font-size: 28px; }

.insight-book-meta { flex: 1; }
.insight-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4ADE80;
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 6px;
}
.insight-book-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 3px;
}
.insight-book-author { font-size: 13px; color: var(--text-muted); }

.insight-label {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: flex-start;
}

.insight-cards-wrap {
  width: 100%;
  position: relative;
  min-height: 200px;
  cursor: pointer;
}

.insight-card {
  display: none;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 28px 28px 24px;
  box-shadow:
    0 0 0 1px var(--border),
    0 20px 60px rgba(0,0,0,0.4),
    0 0 40px var(--accent-glow-lg);
  animation: cardFadeIn 0.35s ease;
}
.insight-card.active { display: flex; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ic-icon { font-size: 36px; line-height: 1; }
.ic-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.ic-body {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.65;
}
.ic-num {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.insight-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.insight-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.insight-dots .dot.active {
  background: var(--accent);
  width: 22px;
  border-radius: 4px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.insight-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.insight-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}
.btn-ask-book {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--gradient-btn);
  border: none;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s;
}
.btn-ask-book:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }

.btn-insight-close {
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-insight-close:hover { background: var(--surface-3); color: var(--text); }

/* ============================================================
   CHAT SCREEN — Ask the Book
   ============================================================ */
#screenChat { display: none; }
#screenChat.active { display: flex; flex-direction: column; height: calc(100vh - var(--nav-h)); }

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-book-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-header-label {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-ai-dot {
  background: var(--gradient-btn);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg { display: flex; max-width: 85%; }
.chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-ai { align-self: flex-start; }

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.chat-msg-user .chat-msg-bubble {
  background: var(--gradient-btn);
  border-bottom-right-radius: 4px;
}
.chat-msg-ai .chat-msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
}
.chat-typing span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
  flex-shrink: 0;
}
.chat-chip {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-glow);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chat-chip:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--text);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow-lg); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-btn);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 6px 24px var(--accent-glow); }

/* ============================================================
   HOME STREAK BANNER
   ============================================================ */
.streak-banner {
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.06));
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 16px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 40px 24px;
}
.sb-fire { font-size: 32px; }
.sb-info { flex: 1; }
.sb-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}
.sb-sub { font-size: 12px; color: var(--text-muted); }
.sb-count {
  font-family: 'Sora', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.sb-days { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
