/* ==================== BILIMJON CSS ==================== */
/* Dark/Light theme variables */
:root {
  --bg: #0F1117;
  --bg2: #181C27;
  --bg3: #1E2335;
  --card: #242840;
  --gold: #F5A623;
  --gold2: #FFD166;
  --teal: #06D6A0;
  --text: #F0F0F5;
  --text2: #9A9AB0;
  --text3: #5A5A7A;
  --red: #FF4B6E;
  --blue: #4B7BF5;
  --purple: #9B6FE5;
  --green: #06D6A0;
  --radius: 18px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
  --bg: #F5F0E8;
  --bg2: #EDE8DC;
  --bg3: #E0D9CC;
  --card: #FFFFFF;
  --text: #1A1628;
  --text2: #6A5F8A;
  --text3: #9A8FAA;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Nunito', sans-serif;
  background: #000;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.app {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 932px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  border-radius: 0;
  transition: background var(--transition);
}

@media (min-width: 500px) {
  .app {
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(0,0,0,.8);
    height: 92vh;
  }
  body { background: #050508; }
}

/* SCREENS */
.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  scrollbar-width: none;
  transition: background var(--transition);
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: flex; }

/* STATUS BAR */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 0;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

/* ==================== SPLASH ==================== */
.splash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.splash-logo { text-align: center; }
.logo-icon {
  font-size: 70px;
  display: block;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}
.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}
.logo-text span { color: var(--gold); }
.logo-tagline {
  font-size: 14px;
  color: var(--text2);
  margin-top: 8px;
}
.splash-loader { width: 200px; }
.loader-bar {
  width: 100%;
  height: 3px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
}

/* ==================== AUTH ==================== */
.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 40px;
  overflow-y: auto;
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 14px;
  box-shadow: 0 10px 30px rgba(245, 166, 35, 0.4);
}
.auth-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--text);
  font-weight: 700;
}
.auth-logo p { font-size: 13px; color: var(--text2); margin-top: 4px; }

.auth-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text2);
  transition: var(--transition);
}
.auth-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.input-group { margin-bottom: 16px; }
.input-label { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 8px; display: block; letter-spacing: .3px; }

.input-with-icon {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1.5px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  transition: var(--transition);
}
.input-with-icon:focus-within { border-color: var(--gold); background: var(--card); }
.input-prefix {
  padding: 0 12px 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.08);
}

.input-field {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.input-with-icon .input-field {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 14px 16px;
}
.input-field:focus { border-color: var(--gold); background: var(--card); }
.input-field::placeholder { color: var(--text3); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none;
  border-radius: 16px;
  padding: 15px 20px;
  color: #1A1000;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .3px;
  transition: var(--transition);
  box-shadow: 0 6px 24px rgba(245, 166, 35, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 3px 12px rgba(245,166,35,.3); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.08);
}
body.light-mode .divider::before, body.light-mode .divider::after {
  background: rgba(0,0,0,.1);
}

.btn-social {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}
.btn-social:active { background: var(--card); }

.auth-terms {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}
.auth-terms a { color: var(--gold); text-decoration: none; }

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  margin-bottom: 32px;
}

/* OTP */
.otp-header { text-align: center; margin-bottom: 32px; }
.otp-emoji { font-size: 60px; margin-bottom: 16px; }
.otp-header h2 { font-family: 'Playfair Display', serif; font-size: 26px; margin-bottom: 8px; }
.otp-header p { font-size: 14px; color: var(--text2); }

.otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.otp-box {
  width: 48px;
  height: 56px;
  background: var(--bg3);
  border: 2px solid transparent;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  outline: none;
  font-family: 'Nunito', sans-serif;
  transition: var(--transition);
  -moz-appearance: textfield;
}
.otp-box::-webkit-outer-spin-button, .otp-box::-webkit-inner-spin-button { -webkit-appearance: none; }
.otp-box:focus { border-color: var(--gold); background: var(--card); }
.otp-box.filled { border-color: var(--gold); background: rgba(245,166,35,.1); }

.otp-timer { text-align: center; font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.resend-link { text-align: center; font-size: 14px; color: var(--gold); font-weight: 700; cursor: pointer; margin-top: 16px; }

/* ==================== HOME ==================== */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px 0;
  flex-shrink: 0;
}
.home-greeting { font-size: 13px; color: var(--text2); font-weight: 500; }
.home-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.highlight { color: var(--gold); }

.notif-btn {
  position: relative;
  font-size: 24px;
  cursor: pointer;
  margin-top: 4px;
  flex-shrink: 0;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SEARCH */
.search-box {
  margin: 16px 24px 0;
  background: var(--bg3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1.5px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.search-box:focus-within { border-color: rgba(245,166,35,.4); background: var(--card); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  flex: 1;
}
.search-box input::placeholder { color: var(--text3); }
.search-filter { cursor: pointer; padding: 4px; }

.search-results {
  margin: 8px 24px 0;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.06);
  z-index: 10;
  flex-shrink: 0;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:active { background: var(--bg3); }
.search-emoji { font-size: 28px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.search-info .book-name { font-size: 14px; font-weight: 600; }
.search-info .book-author { font-size: 12px; color: var(--text2); }

/* SECTION TITLE */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  flex-shrink: 0;
}
.section-title h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--text); }
.section-title a { font-size: 12px; color: var(--gold); font-weight: 700; cursor: pointer; }

/* RULES CARD */
.rules-card {
  margin: 0 24px;
  background: linear-gradient(135deg, #1B2A5A 0%, #0A1628 100%);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid rgba(245, 166, 35, 0.2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}
body.light-mode .rules-card { background: linear-gradient(135deg,#1B3A8A,#0D2060); }
.rules-card:active { transform: scale(0.98); }
.rules-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(245,166,35,.15);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.rules-card h4 { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.rules-list { list-style: none; }
.rules-list li { font-size: 12px; color: rgba(255,255,255,.65); padding: 3px 0; display: flex; gap: 8px; line-height: 1.4; }
.rules-list li::before { content: '✓'; color: var(--gold); flex-shrink: 0; font-weight: 700; }

/* HORIZONTAL SCROLL BOOKS */
.books-scroll {
  display: flex;
  gap: 14px;
  padding: 0 24px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.books-scroll::-webkit-scrollbar { display: none; }

.book-card-h {
  flex-shrink: 0;
  width: 130px;
  cursor: pointer;
  transition: var(--transition);
}
.book-card-h:active { transform: scale(0.95); }

.book-cover {
  width: 130px;
  height: 175px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.book-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,.7);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  backdrop-filter: blur(6px);
}
.book-info { padding: 8px 0 0; }
.book-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-author { font-size: 11px; color: var(--text2); margin-top: 2px; }
.book-stats { display: flex; gap: 8px; margin-top: 5px; }
.book-stat { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text3); font-weight: 600; }

/* CONTINUE READING */
.continue-card {
  margin: 0 24px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.06);
  transition: var(--transition);
  flex-shrink: 0;
}
.continue-card:active { transform: scale(0.98); }
.continue-cover {
  width: 56px;
  height: 75px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.continue-info { flex: 1 }
.continue-title { font-size: 15px; font-weight: 700; color: var(--text); }
.continue-author { font-size: 12px; color: var(--text2); margin-top: 2px; margin-bottom: 10px; }
.continue-progress { display: flex; align-items: center; gap: 8px; }
.continue-progress span { font-size: 10px; color: var(--teal); font-weight: 700; }
.prog-bar { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--teal); border-radius: 2px; }
.continue-arrow { font-size: 22px; color: var(--text3); }

/* ==================== BOOKS SCREEN ==================== */
.books-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px 12px;
  flex-shrink: 0;
}
.books-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; }
.books-count { font-size: 13px; color: var(--text2); margin-top: 2px; }
.sort-btn { font-size: 24px; cursor: pointer; margin-top: 4px; }

.books-filter {
  display: flex;
  gap: 8px;
  padding: 4px 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.books-filter::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.filter-pill.active { background: var(--gold); color: #1A1000; }
.filter-pill:not(.active) { background: var(--bg3); color: var(--text2); }
.filter-pill:active { transform: scale(0.95); }

.books-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 8px 20px;
  flex-shrink: 0;
}
.book-card-v { cursor: pointer; transition: var(--transition); }
.book-card-v:active { transform: scale(0.96); }
.book-cover-v {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
}
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255,255,255,.2);
}
.progress-fill { height: 100%; background: var(--teal); }
.book-card-v .book-info { padding: 10px 2px 0; }
.book-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  margin-bottom: 5px;
  letter-spacing: .3px;
}
.badge-pdf { background: rgba(255,75,110,.15); color: var(--red); }
.badge-epub { background: rgba(6,214,160,.15); color: var(--teal); }
.badge-audio { background: rgba(245,166,35,.15); color: var(--gold); }

/* ==================== PROFILE SCREEN ==================== */
.profile-header {
  padding: 20px 24px 0;
  flex-shrink: 0;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 14px;
  box-shadow: 0 8px 28px rgba(245, 166, 35, 0.4);
}
.profile-name { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--text); }
.profile-contact { font-size: 13px; color: var(--text2); margin-top: 4px; }
.profile-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  margin-top: 10px;
  padding: 6px 14px;
  background: rgba(245,166,35,.1);
  border-radius: 20px;
}
.profile-stats {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.pstat {
  flex: 1;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.06);
}
.pstat-num { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: var(--gold); }
.pstat-label { font-size: 10px; color: var(--text2); margin-top: 4px; font-weight: 600; }

/* MENU */
.menu-section { padding: 20px 24px 0; flex-shrink: 0; }
.menu-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.menu-group {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
body.light-mode .menu-item { border-bottom-color: rgba(0,0,0,.06); }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg3); }
.menu-item.logout:active { background: rgba(255,75,110,.1); }
.menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.menu-icon.gold { background: rgba(245,166,35,.15); }
.menu-icon.blue { background: rgba(75,123,245,.15); }
.menu-icon.purple { background: rgba(155,111,229,.15); }
.menu-icon.green { background: rgba(6,214,160,.15); }
.menu-icon.red { background: rgba(255,75,110,.15); }
.menu-icon.teal { background: rgba(6,214,160,.15); }
.menu-text { flex: 1; }
.menu-text h5 { font-size: 14px; font-weight: 700; color: var(--text); }
.menu-text p { font-size: 11px; color: var(--text2); margin-top: 2px; }
.menu-right { color: var(--text3); font-size: 16px; font-weight: 600; }
.notif-count {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* TOGGLE SWITCH */
.toggle-switch {
  width: 44px;
  height: 26px;
  background: var(--bg3);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--gold); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 10px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.toggle-switch.on::after { left: 21px; }

/* LANG PILLS */
.lang-pills { display: flex; gap: 4px; }
.lang-pill {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.lang-pill.active { background: var(--gold); color: #1A1000; }
.lang-pill:not(.active) { background: var(--bg3); color: var(--text2); }

.app-version { text-align: center; font-size: 11px; color: var(--text3); padding: 24px; }

/* ==================== BOOK DETAIL ==================== */
#book-detail-screen { z-index: 50; }
.book-detail-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.25) saturate(1.5);
  transform: scale(1.2);
  z-index: 0;
}
.book-detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.6));
  z-index: 1;
}
.book-detail-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.book-detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50px 24px 16px;
  flex-shrink: 0;
}
.back-btn {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  color: #fff;
  transition: var(--transition);
}
.back-btn:active { transform: scale(0.9); }
.detail-nav-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.8); }
.bookmark-btn { font-size: 24px; cursor: pointer; }

.book-detail-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 24px 24px; }
.book-detail-cover {
  width: 160px;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-emoji { font-size: 70px; }
.book-detail-info { text-align: center; width: 100%; }
.book-detail-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
}
.book-detail-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 6px; line-height: 1.2; }
.book-detail-author { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 20px; }
.book-detail-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.bds { text-align: center; flex: 1; }
.bds-icon { font-size: 18px; margin-bottom: 4px; }
.bds-num { font-size: 16px; font-weight: 800; color: #fff; }
.bds-label { font-size: 10px; color: rgba(255,255,255,.5); margin-top: 2px; }
.bds-divider { width: 1px; height: 40px; background: rgba(255,255,255,.15); }

.progress-section { width: 100%; margin-bottom: 20px; }
.prog-label { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.7); margin-bottom: 8px; font-weight: 600; }
.prog-bar.big { height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); }

.book-desc { width: 100%; text-align: left; margin-bottom: 24px; }
.book-desc h4 { font-size: 13px; font-weight: 800; color: rgba(255,255,255,.8); margin-bottom: 8px; letter-spacing: .5px; }
.book-desc p { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.7; }

.read-btns {
  display: flex;
  gap: 10px;
  padding: 0 24px 40px;
  flex-shrink: 0;
}
.btn-read {
  flex: 1;
  padding: 15px;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-read.primary { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1A1000; }
.btn-read.secondary { background: rgba(255,255,255,.15); color: #fff; backdrop-filter: blur(12px); }
.btn-read:active { transform: scale(0.96); }

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 82px;
  background: var(--bg2);
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 16px;
  z-index: 40;
  backdrop-filter: blur(20px);
}
body.light-mode .bottom-nav { border-top-color: rgba(0,0,0,.08); }
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 14px;
  transition: var(--transition);
}
.nav-icon { width: 24px; height: 24px; }
.nav-icon svg { width: 24px; height: 24px; stroke: var(--text3); transition: var(--transition); }
.nav-item span { font-size: 10px; font-weight: 700; color: var(--text3); transition: var(--transition); }
.nav-item.active .nav-icon svg { stroke: var(--gold); }
.nav-item.active span { color: var(--gold); }
.nav-item:active { transform: scale(0.9); }

/* ==================== MODALS ==================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-height: 85%;
  overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.25,.46,.45,.94);
}
.modal.small { max-height: 60%; border-radius: 28px; margin: 24px; width: calc(100% - 48px); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 18px; }
.modal-close { font-size: 20px; cursor: pointer; color: var(--text2); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg3); }
.modal-body { padding: 20px 24px 40px; }

/* Rule items */
.rule-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.rule-item:last-child { border-bottom: none; }
.rule-num {
  width: 28px;
  height: 28px;
  background: rgba(245,166,35,.15);
  color: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.rule-item p { font-size: 13px; color: var(--text2); line-height: 1.6; padding-top: 4px; }

/* Notifications */
.notif-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { position: relative; }
.notif-item.unread::after {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--gold);
}
.notif-icon {
  width: 42px;
  height: 42px;
  background: var(--bg3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.notif-content { flex: 1; }
.notif-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.notif-text { font-size: 12px; color: var(--text2); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text3); margin-top: 5px; font-weight: 600; }

/* Stars */
.star-rating { display: flex; justify-content: center; gap: 8px; font-size: 32px; cursor: pointer; }
.star-rating span { transition: var(--transition); opacity: 0.4; }
.star-rating span.active { opacity: 1; }

/* ==================== TOAST ==================== */
.toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  transition: .35s cubic-bezier(.25,.46,.45,.94);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== ANIMATIONS ==================== */
@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen.active .home-header,
.screen.active .search-box,
.screen.active .rules-card,
.screen.active .book-card-h,
.screen.active .book-card-v,
.screen.active .profile-header,
.screen.active .menu-section {
  animation: fadeInUp 0.4s ease both;
}

/* ==================== CHAT STYLES ==================== */
.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.chat-avatar-wrap { position: relative; }
.chat-avatar { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg,var(--blue),var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.chat-dot { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; background: var(--teal); border-radius: 6px; border: 2px solid var(--bg); }
.chat-name { font-size: 15px; font-weight: 700; }
.chat-status { font-size: 11px; color: var(--teal); font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.chat-messages::-webkit-scrollbar { display: none; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
.chat-msg.bot .msg-bubble { background: var(--card); color: var(--text); border-bottom-left-radius: 6px; border: 1px solid rgba(255,255,255,.06); }
.chat-msg.user .msg-bubble { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1A1000; font-weight: 600; border-bottom-right-radius: 6px; }
.msg-time { font-size: 10px; color: var(--text3); margin-top: 4px; text-align: right; }
.chat-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.chat-quick-btns button { padding: 7px 14px; background: var(--bg3); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; font-family: 'Nunito',sans-serif; transition: var(--transition); }
.chat-quick-btns button:active { background: var(--card); transform: scale(0.95); }
.chat-input-area { display: flex; gap: 10px; padding: 12px 16px; background: var(--bg2); border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.chat-input { flex: 1; background: var(--bg3); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 16px; color: var(--text); font-family: 'Nunito',sans-serif; font-size: 14px; outline: none; transition: var(--transition); }
.chat-input:focus { border-color: var(--gold); }
.chat-send { width: 46px; height: 46px; background: linear-gradient(135deg, var(--gold), var(--gold2)); border: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #1A1000; transition: var(--transition); flex-shrink: 0; }
.chat-send:active { transform: scale(0.92); }
.typing-indicator { display: flex; gap: 4px; padding: 10px 14px; }
.typing-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--text3); animation: typingBounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ==================== INSTALL BANNER ==================== */
.install-banner { display: flex; align-items: center; gap: 14px; margin: 20px 24px; padding: 16px; background: linear-gradient(135deg,#1B3A8A,#0D2060); border-radius: 16px; border: 1px solid rgba(245,166,35,.3); }

/* ==================== REGISTER ADDITIONS ==================== */
.auth-form { animation: fadeInUp .3s ease; }
.back-link { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text2); cursor: pointer; margin-bottom: 24px; }

/* ==================== BOOK COVER WITH IMG ==================== */
.book-cover-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ==================== SEASONS EFFECTS ==================== */
#seasonCanvas{position:fixed;top:0;left:50%;transform:translateX(-50%);width:100%;max-width:430px;height:100%;pointer-events:none;z-index:6;opacity:.7}

/* ==================== CHAT v3 ==================== */
.chat-header{display:flex;align-items:center;gap:14px;padding:16px 20px;background:var(--bg2);border-bottom:1px solid rgba(255,255,255,.06);flex-shrink:0;position:sticky;top:0;z-index:10}
.chat-av-wrap{position:relative}
.chat-av{width:46px;height:46px;background:linear-gradient(135deg,var(--blue),var(--purple));border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:22px}
.chat-dot{position:absolute;bottom:-1px;right:-1px;width:12px;height:12px;background:var(--teal);border-radius:6px;border:2px solid var(--bg);animation:blink 2s infinite}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.5}}
.chat-name{font-size:15px;font-weight:700}.chat-status{font-size:11px;color:var(--teal);font-weight:600}
.chat-messages{flex:1;overflow-y:auto;padding:16px 16px 8px;display:flex;flex-direction:column;gap:10px;scrollbar-width:none}
.chat-messages::-webkit-scrollbar{display:none}
.chat-msg{display:flex;gap:8px;align-items:flex-end}.chat-msg.user{flex-direction:row-reverse}
.msg-av{width:32px;height:32px;border-radius:10px;background:var(--bg3);display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.msg-bubble{max-width:80%;padding:10px 14px;border-radius:18px;font-size:14px;line-height:1.5}
.chat-msg.bot .msg-bubble{background:var(--card);color:var(--text);border-bottom-left-radius:6px;border:1px solid rgba(255,255,255,.06)}
.chat-msg.user .msg-bubble{background:linear-gradient(135deg,var(--gold),var(--gold2));color:#1A1000;font-weight:600;border-bottom-right-radius:6px}
.msg-time{font-size:10px;color:var(--text3);margin-top:4px}
.chat-quick{display:flex;flex-wrap:wrap;gap:8px;padding:4px 0}
.chat-quick button{padding:7px 14px;background:var(--bg3);border:1px solid rgba(255,255,255,.08);border-radius:20px;font-size:12px;font-weight:600;color:var(--text);cursor:pointer;font-family:'Nunito',sans-serif;transition:.2s}
.chat-quick button:active{background:var(--card);transform:scale(.95)}
.chat-input-area{display:flex;gap:10px;padding:12px 16px;background:var(--bg2);border-top:1px solid rgba(255,255,255,.06);flex-shrink:0;padding-bottom:max(12px,env(safe-area-inset-bottom))}
.chat-input{flex:1;background:var(--bg3);border:1.5px solid transparent;border-radius:14px;padding:12px 16px;color:var(--text);font-family:'Nunito',sans-serif;font-size:14px;outline:none;transition:.2s}
.chat-input:focus{border-color:var(--gold)}
.chat-send{width:46px;height:46px;background:linear-gradient(135deg,var(--gold),var(--gold2));border:none;border-radius:14px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#1A1000;transition:.2s;flex-shrink:0}
.chat-send:active{transform:scale(.92)}
.typing-ind{display:flex;gap:4px;padding:10px 14px;background:var(--card);border-radius:18px;border-bottom-left-radius:6px;align-items:center;width:60px}
.typing-dot{width:8px;height:8px;border-radius:4px;background:var(--text3);animation:typeBounce 1.2s infinite}
.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}
@keyframes typeBounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-8px)}}
