/* ===========================
   style.css (CHUNK 1/3)
   Paste this FIRST
   =========================== */

/* Inter (Flutter: GoogleFonts.inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800;900&display=swap');

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  -webkit-tap-highlight-color: transparent;
}

:root{
  --primary:#7C3AED;
  --secondary:#DB2777;

  --bg-dark:#08090F;
  --bg-card:#12131A;
  --bg-nav:#0A0B12;

  --text-white:#FFFFFF;
  --text-gray:#9CA3AF;
  --text-gray-light:#6B7280;

  --border-soft:rgba(255,255,255,0.08);
  --shadow:rgba(0,0,0,0.55);

  --primary-glow:rgba(124,58,237,0.35);
  --secondary-glow:rgba(219,39,119,0.30);

  --grad-primary:linear-gradient(135deg,var(--primary),var(--secondary));

  /* legacy compatibility */
  --accent: var(--primary);
  --accent-glow: var(--primary-glow);
}

html{ scroll-behavior:smooth; }

body{
  background: var(--bg-dark);
  color: var(--text-white);
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow-x:hidden;
  -webkit-font-smoothing: antialiased;
}

input,select,button{ font-family:inherit; }

/* ===========================
   MAIN LAYOUT
   =========================== */
.main-content{
  padding: 0 0 calc(140px + env(safe-area-inset-bottom)) 0;
  min-height: 100vh;
}

/* ===========================
   LOADING / EMPTY / TOAST
   =========================== */
.loading-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 40px 20px;
}
.loading-spinner{
  width:40px;
  height:40px;
  border:3px solid rgba(124,58,237,0.18);
  border-top-color: var(--primary);
  border-radius:50%;
  animation: spin .8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg);} }

.no-books{
  text-align:center;
  padding: 40px 20px;
  color: var(--text-gray);
}

.toast-notification{
  position:fixed;
  bottom:140px;
  left:50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0,0,0,0.90);
  color:#fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.8rem;
  z-index: 9999;
  opacity:0;
  transition: all .3s;
  border: 1px solid rgba(124,58,237,0.55);
}
.toast-notification.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   PWA INSTALL PROMPT (optional)
   =========================== */
.install-prompt{
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  left: 15px;
  right: 15px;
  background: var(--grad-primary);
  padding: 12px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  gap:10px;
  z-index: 2001;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.install-content{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
}
.install-icon{ font-size: 1.8rem; }
.install-text strong{
  font-size: 0.85rem;
  display:block;
  font-weight: 900;
}
.install-text p{
  font-size: 0.7rem;
  opacity: .9;
}
.btn-install{
  background:#fff;
  color:#111827;
  border:none;
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
}
.btn-dismiss{
  background: rgba(255,255,255,0.20);
  border:none;
  color:#fff;
  width:28px;
  height:28px;
  border-radius: 999px;
  font-size: 1rem;
}

/* ===========================
   BOTTOM NAV (4 TABS)
   =========================== */
.bottom-nav{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  display:flex;
  justify-content: space-around;
  padding: 10px 0 max(15px, env(safe-area-inset-bottom));
  border-top: 0.5px solid rgba(255,255,255,0.10);
  z-index: 1000;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.50);
}

.nav-item{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap:4px;
  color: var(--text-gray-light);
  text-decoration:none;
  font-size: 0.60rem;
  font-weight: 800;
  padding: 5px 10px;
  letter-spacing: .2px;
  transition: color .2s;
}
.nav-item i{
  font-size: 1.25rem;
  transition: all .2s;
}
.nav-item.active{ color: var(--secondary); }
.nav-item.active i{
  color: var(--secondary);
  filter: drop-shadow(0 0 6px rgba(219,39,119,0.45));
}

/* ===========================
   HOME UI v2 (Topbar base)
   =========================== */
.home-page{ padding-bottom: 140px; }

.home-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(8,9,15,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.topbar-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 18px;
}

.brand .brand-icon{
  color: var(--primary);
  font-size: 18px;
}

.topbar-spacer{ flex:1; }

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#D1D5DB;
  background: transparent;
  border: 0;
  cursor:pointer;
}
.icon-btn:active{ transform: scale(.98); }

.profile-chip{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--grad-primary);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 14px;
  color:#fff;
  cursor:pointer;
}

/* Shared sections */
.section{ margin-top: 14px; }

.section-head{
  padding: 14px 16px 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
}

.section-title{
  font-size: 17px;
  font-weight: 900;
}

.section-action{
  display:flex;
  align-items:center;
  gap:2px;
  font-size: 12px;
  color: var(--text-gray-light);
  font-weight: 700;
}
.section-action i{ color: var(--secondary); }

/* Row scroll */
.row-scroll{
  display:flex;
  gap: 12px;
  overflow-x:auto;
  padding: 0 16px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.row-scroll::-webkit-scrollbar{ display:none; }

/* Book cards (base) */
.book-card{
  width:156px;
  flex: 0 0 156px;
  cursor:pointer;
}

.book-cover{
  width:156px;
  height:156px;
  border-radius: 14px;
  overflow:hidden;
  position: relative;
  box-shadow: 0 10px 26px rgba(0,0,0,0.55);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
}

.book-cover img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.book-cover::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 70px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.72));
}

/* ✅ plays-badge scope fix */
.card-image .plays-badge{
  position:absolute;
  top:6px;
  right:6px;
  background: linear-gradient(135deg, #ff4444, #ff6b6b);
  color:#fff;
  padding:3px 8px;
  border-radius:10px;
  font-size:0.65rem;
  font-weight:700;
  box-shadow:0 2px 10px rgba(0,0,0,0.35);
}
.book-cover .plays-badge{
  position:absolute;
  top:10px; right:0;
  padding:4px 10px;
  font-size:9px;
  font-weight:900;
  letter-spacing:.3px;
  color:#fff;
  background: var(--grad-primary);
  border-radius: 8px 0 0 8px;
  box-shadow:none;
}

.cat-tag{
  position:absolute;
  left:10px;
  bottom:10px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 900;
  color:#fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.book-title{
  margin-top: 10px;
  font-size: 13px;
  font-weight: 900;
  color:#F3F4F6;
  line-height: 1.15;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.book-sub{
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gray-light);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

/* ===========================
   (NEXT CHUNK will include Hero + TopCharts + Library + Creators UI)
   =========================== */

   /* ===========================
   style.css (CHUNK 2/3)
   Paste this AFTER CHUNK 1
   =========================== */

/* ===========================
   HERO (Home)
   =========================== */
.hero-wrap{ padding: 16px 16px 0; }

.hero{
  height:224px;
  border-radius:24px;
  overflow:hidden;
  position:relative;
  box-shadow: 0 16px 28px rgba(0,0,0,0.60);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
}

.hero-bg{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  transform: scale(1.03);
}

.hero-overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.0) 0%,
    rgba(0,0,0,0.20) 55%,
    rgba(0,0,0,0.90) 100%
  );
}

.hero-content{
  position:absolute;
  left:16px; right:16px; bottom:16px;
}

.pills{ display:flex; gap:8px; align-items:center; }

.pill{
  padding:4px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  color:#fff;
  letter-spacing:.2px;
}
.pill.trending{ background:#EF4444; }
.pill.genre{ background: rgba(255,255,255,0.20); }

.hero-title{
  margin-top:8px;
  font-size:20px;
  font-weight:900;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hero-subtitle{
  margin-top:2px;
  font-size:12px;
  font-weight:700;
  color:#D1D5DB;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hero-play{
  margin-top:10px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 14px;
  border-radius:999px;
  background:#3B82F6;
  color:#fff;
  font-size:12px;
  font-weight:900;
  border:0;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(59,130,246,0.30);
}

.hero-dots{
  position:absolute;
  right:16px;
  bottom:12px;
  display:flex;
  gap:6px;
}

.hero-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background: rgba(255,255,255,0.30);
  transition: all .2s ease;
  cursor:pointer;
}
.hero-dot.active{
  width:20px;
  background:#fff;
}

/* ===========================
   TOP CHARTS (Home)
   =========================== */
.topcharts-wrap{
  margin: 0 16px;
  background: var(--bg-card);
  border-radius:16px;
  border: 1.5px solid var(--border-soft);
  box-shadow: 0 8px 20px rgba(0,0,0,0.30);
  overflow:hidden;
}

.topcharts-list{ padding:12px; }

.topcharts-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border-radius:12px;
  cursor:pointer;
}

.topcharts-sep{
  height:1px;
  background: rgba(255,255,255,0.05);
  margin: 10px 0;
}

.rankbox{
  width:40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.ranknum{
  font-weight:900;
  font-size:14px;
  color: var(--text-gray-light);
}
.ranknum.top{ font-size:16px; color:#fff; }
.rankicon{ font-size:20px; }

.tc-cover{
  width:55px;
  height:55px;
  border-radius:8px;
  overflow:hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
}
.tc-cover img{ width:100%; height:100%; object-fit:cover; display:block; }

.tc-info{ flex:1; min-width:0; }

.tc-title{
  font-size:14px;
  font-weight:900;
  color:#F3F4F6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.tc-author{
  margin-top:4px;
  font-size:11px;
  font-weight:700;
  color: var(--text-gray-light);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.tc-plays{
  margin-top:4px;
  font-size:10px;
  font-weight:800;
  color: var(--secondary);
  display:flex;
  align-items:center;
  gap:4px;
}

.tc-play{
  width:38px;
  height:38px;
  border-radius:999px;
  background: var(--grad-primary);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 4px 8px rgba(124,58,237,0.30);
  color:#fff;
}

/* ===========================
   LIBRARY PAGE (SPA)
   =========================== */
.library-page{
  padding-bottom: 140px;
  min-height: 100vh;
  background: var(--bg-dark);
}

.library-topbar{
  padding: calc(18px + env(safe-area-inset-top)) 16px 10px;
}

.library-header-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.lib-icon-box{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(219,39,119,0.18));
}

.lib-icon-box i{
  color:#F472B6;
  font-size:16px;
}

.lib-title{
  font-size:20px;
  font-weight:900;
}

/* shared empty state */
.library-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding: 60px 26px;
  text-align:center;
}

.library-empty i{
  font-size:54px;
  color: rgba(255,255,255,0.15);
  margin-bottom: 14px;
}

.library-empty h3{
  font-size:18px;
  font-weight:900;
  margin-bottom:8px;
}

.library-empty p{
  font-size:13px;
  color: var(--text-gray-light);
  line-height:1.5;
  font-weight:700;
  max-width: 280px;
}

/* Library cards */
.lib-book-card{
  width:132px;
  flex: 0 0 132px;
  cursor:pointer;
}

.lib-book-cover{
  width:132px;
  height:156px;
  border-radius:14px;
  overflow:hidden;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
}

.lib-book-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.lib-book-title{
  margin-top:8px;
  font-size:12px;
  font-weight:900;
  color:#F3F4F6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.lib-book-sub{
  margin-top:2px;
  font-size:11px;
  font-weight:700;
  color: var(--text-gray-light);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ===========================
   CREATORS PAGE (SPA)
   =========================== */
.creators-page{
  padding-bottom: 140px;
  min-height: 100vh;
  background: var(--bg-dark);
}

.creators-topbar{
  padding: calc(18px + env(safe-area-inset-top)) 16px 12px;
}

.creators-header-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}

.creators-icon-box{
  width:38px;
  height:38px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(219,39,119,0.18));
}
.creators-icon-box i{ color:#F472B6; font-size:16px; }

.creators-page-title{
  font-size:20px;
  font-weight:900;
}

/* Search */
.creator-search-wrap{
  position:relative;
  padding: 0 16px 14px;
}

.creator-search-input{
  width:100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 999px;
  color:#fff;
  font-size:14px;
  font-weight:700;
  outline:none;
  transition: border-color .2s;
}
.creator-search-input:focus{ border-color: var(--primary); }

.creator-search-icon{
  position:absolute;
  left:30px;
  top:50%;
  transform: translateY(-50%);
  color: var(--text-gray-light);
  font-size:14px;
}

/* Creator list item */
.creator-list-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  background: var(--bg-card);
  border-radius: 18px;
  cursor:pointer;
  margin: 0 16px 12px;
  border: 1px solid rgba(124,58,237,0.08);
  transition: border-color .2s, transform .12s;
}
.creator-list-card:active{
  border-color: var(--primary);
  transform: scale(0.99);
}

.creator-list-avatar{
  width:56px;
  height:56px;
  border-radius:999px;
  object-fit:cover;
  border: 2px solid rgba(124,58,237,0.28);
  background: var(--bg-dark);
  flex-shrink:0;
}

.creator-list-info{ flex:1; min-width:0; }

.creator-list-name{
  font-size:15px;
  font-weight:900;
  color:#F3F4F6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.creator-list-sub{
  margin-top:4px;
  font-size:12px;
  font-weight:700;
  color: var(--text-gray-light);
}

.creator-list-arrow{
  color:#4B5563;
  font-size:16px;
  flex-shrink:0;
}

/* ===========================
   (NEXT CHUNK will include Creator Profile + Store + Player v2 CSS)
   =========================== */

   /* ===========================
   style.css (CHUNK 3/3)
   Paste this AFTER CHUNK 2
   (Creator Profile + Store + Player v2 + responsive + polish)
   =========================== */

/* ===========================
   CREATOR PROFILE (SPA)
   =========================== */
.creator-profile-page{
  padding-bottom: 140px;
  min-height: 100vh;
  background: var(--bg-dark);
}

.cp-topbar{
  display:flex;
  align-items:center;
  gap:10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}

.cp-back-btn{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  cursor:pointer;
  flex-shrink:0;
}

.cp-topbar-title{
  font-size:15px;
  font-weight:900;
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cp-avatar-wrap{
  display:flex;
  justify-content:center;
  padding: 10px 0 0;
}

.cp-avatar{
  width:96px;
  height:96px;
  border-radius:999px;
  object-fit:cover;
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(124,58,237,0.25);
  border: 1px solid rgba(255,255,255,0.08);
}

.cp-name{
  text-align:center;
  font-size:20px;
  font-weight:900;
  margin-top:12px;
  padding: 0 16px;
}

.cp-role{
  text-align:center;
  font-size:12px;
  font-weight:800;
  color: var(--text-gray-light);
  margin-top:4px;
}

.cp-desc{
  text-align:center;
  font-size:13px;
  font-weight:700;
  color: var(--text-gray-light);
  line-height:1.5;
  padding: 12px 24px 0;
}

.cp-stats{
  display:flex;
  gap:10px;
  padding: 16px 16px 0;
}

.cp-stat-card{
  flex:1;
  background: var(--bg-card);
  border-radius:18px;
  padding:14px;
  text-align:center;
  border:1px solid rgba(255,255,255,0.06);
}

.cp-stat-value{
  font-size:18px;
  font-weight:900;
  color:#fff;
}

.cp-stat-label{
  font-size:11px;
  font-weight:800;
  color: var(--text-gray-light);
  margin-top:4px;
}

/* Rating */
.cp-rate-wrap{ padding: 16px 16px 0; }

.cp-rate-label{
  font-size:13px;
  font-weight:900;
  color:#E5E7EB;
  margin-bottom:8px;
}

.cp-stars{ display:flex; gap:4px; }

.cp-star{
  background:none;
  border:none;
  cursor:pointer;
  padding:0;
  font-size:24px;
  color: rgba(255,255,255,0.15);
  transition: color .15s, transform .1s;
}
.cp-star.filled{ color:#F59E0B; }
.cp-star:active{ transform: scale(1.25); }

.cp-my-rating-text{
  margin-top:6px;
  font-size:12px;
  font-weight:700;
  color: var(--text-gray-light);
}

.cp-subscribe-wrap{ padding: 16px 16px 0; }

.cp-subscribe-btn{
  width:100%;
  padding:16px;
  border-radius:18px;
  border:none;
  background: var(--grad-primary);
  color:#fff;
  font-size:14px;
  font-weight:900;
  font-family:inherit;
  cursor:pointer;
  box-shadow: 0 10px 20px rgba(219,39,119,0.28);
  transition: opacity .2s;
}
.cp-subscribe-btn:active{ opacity: .85; }

.cp-subscribed-box{
  width:100%;
  padding:14px;
  border-radius:18px;
  background: rgba(16,185,129,0.12);
  border:1px solid rgba(16,185,129,0.30);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:14px;
  font-weight:900;
  color:#10B981;
}
.cp-subscribed-note{
  margin-top:10px;
  font-size:12px;
  font-weight:700;
  color: var(--text-gray-light);
  line-height:1.4;
  text-align:center;
  padding: 0 8px;
}

.cp-books-title{
  font-size:15px;
  font-weight:900;
  color:#E5E7EB;
  padding: 22px 16px 12px;
}

.cp-books-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  padding: 0 16px;
}

/* ===========================
   STORE PAGE
   =========================== */
.store-page{
  padding-bottom: 140px;
  min-height: 100vh;
  background: var(--bg-dark);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.store-empty{
  text-align:center;
  padding: 60px 26px;
}

.store-empty i{
  font-size:54px;
  color: rgba(255,255,255,0.15);
  margin-bottom:14px;
}
.store-empty h3{
  font-size:18px;
  font-weight:900;
  margin-bottom:8px;
}
.store-empty p{
  font-size:13px;
  color: var(--text-gray-light);
  font-weight:700;
  line-height:1.5;
}

/* ===========================
   PLAYER UI v2 (Flutter match)
   =========================== */

/* Mini Player */
.mini-player{
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, #151620, #111118);
  border-top: 0.5px solid rgba(255,255,255,0.10);
  z-index: 999;
  cursor: pointer;
}

.mini-progress-bar-wrap{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.08);
}

.mini-progress-fill{
  height: 100%;
  background: var(--secondary);
  transition: width 0.3s linear;
  width: 0%;
}

.mini-inner{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 14px;
}

.mini-cover{
  width:48px;
  height:48px;
  border-radius:10px;
  object-fit:cover;
  background: var(--bg-card);
  flex-shrink:0;
}

.mini-text{ flex:1; min-width:0; }

.mini-chapter-label{
  font-size:14px;
  font-weight:900;
  color:#F3F4F6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mini-book-label{
  margin-top:2px;
  font-size:12px;
  font-weight:700;
  color: var(--text-gray-light);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.mini-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

.mini-circle-btn{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#D1D5DB;
  font-size:10px;
  font-weight:900;
  font-family:inherit;
  flex-shrink:0;
}

.mini-play-btn{
  width:42px;
  height:42px;
  border-radius:999px;
  border:none;
  background: var(--grad-primary);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#fff;
  font-size:16px;
  box-shadow: 0 6px 14px rgba(219,39,119,0.35);
  flex-shrink:0;
}

/* Full Player */
.full-player{
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.full-player.open{ display:flex; }

.fp-bg{
  position:absolute;
  inset:0;
  background-size:cover;
  background-position:center;
  filter: blur(24px);
  transform: scale(1.08);
  z-index:0;
}

.fp-bg-overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(
    to bottom,
    rgba(8,9,15,0.85) 0%,
    rgba(8,9,15,0.65) 50%,
    rgba(8,9,15,1.0) 100%
  );
  z-index:1;
}

.fp-body{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  height:100%;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow-y:auto;
}

.fp-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 6px 14px;
}

.fp-circle-btn{
  width:44px;
  height:44px;
  border-radius:999px;
  background: rgba(255,255,255,0.10);
  border:none;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  cursor:pointer;
  font-size:18px;
  flex-shrink:0;
}

.fp-now-playing-label{
  font-size:11px;
  font-weight:900;
  color: var(--text-gray-light);
  letter-spacing: 2px;
}

.fp-topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
}

.fp-art-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  flex:1;
  padding: 0 26px;
  min-height:0;
}

.fp-art-container{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}

.fp-art-ring{
  position:absolute;
  border-radius:999px;
  border: 3.5px solid rgba(255,255,255,0.30);
  box-shadow:
    0 18px 70px rgba(219,39,119,0.35),
    0 28px 110px rgba(124,58,237,0.22);
  pointer-events:none;
  opacity:0;
  transition: opacity .3s;
}
.fp-art-ring.spinning{
  opacity:1;
  animation: ring-rotate 8s linear infinite;
}
@keyframes ring-rotate{ from{transform:rotate(0)} to{transform:rotate(360deg)} }

.fp-cover{
  border-radius:28px;
  object-fit:cover;
  box-shadow: 0 20px 50px rgba(0,0,0,0.60);
  max-width: min(68vw, 270px);
  max-height: min(68vw, 270px);
  width: min(68vw, 270px);
  height: min(68vw, 270px);
  display:block;
}

.fp-info{ padding: 0 18px; text-align:center; }

.fp-book-title{
  font-size:18px;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.fp-book-sub{
  margin-top:4px;
  font-size:12px;
  font-weight:800;
  color: var(--text-gray-light);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Seek */
.fp-seek-wrap{ padding: 12px 18px 0; }

.fp-seek{
  -webkit-appearance:none;
  width:100%;
  height:3px;
  border-radius:999px;
  background: rgba(255,255,255,0.10);
  outline:none;
  cursor:pointer;
  accent-color: var(--secondary);
}
.fp-seek::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:14px;
  height:14px;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
}

.fp-times{
  display:flex;
  justify-content:space-between;
  padding: 6px 6px 0;
  font-size:11px;
  font-weight:800;
  color: var(--text-gray-light);
}

/* Speed pills */
.fp-speed-wrap{
  padding: 10px 18px 0;
  display:flex;
  align-items:center;
  gap:10px;
}

.fp-speed-label{
  font-size:12px;
  font-weight:900;
  color: var(--text-gray-light);
  flex-shrink:0;
}

.fp-speed-pills{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scrollbar-width:none;
  flex:1;
}
.fp-speed-pills::-webkit-scrollbar{ display:none; }

.fp-speed-pill{
  padding: 8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:#1F2937;
  color: var(--text-gray-light);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
  cursor:pointer;
  font-family:inherit;
  flex-shrink:0;
  transition: all .15s;
}
.fp-speed-pill.active{
  background: var(--secondary);
  color:#fff;
  border-color: rgba(219,39,119,0.25);
}

/* Controls */
.fp-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 18px 0;
}

.fp-ctrl-btn{
  position:relative;
  width:44px;
  height:44px;
  border-radius:999px;
  background: rgba(255,255,255,0.10);
  border:none;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#fff;
  font-size:18px;
  flex-shrink:0;
  transition: background .15s;
}
.fp-ctrl-btn:active{ background: rgba(255,255,255,0.18); }

.fp-15{
  position:absolute;
  bottom:6px;
  font-size:9px;
  font-weight:900;
  opacity:0.9;
}

.fp-play-btn{
  width:78px;
  height:78px;
  border-radius:999px;
  border:none;
  background: var(--grad-primary);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#fff;
  font-size:36px;
  box-shadow: 0 12px 30px rgba(219,39,119,0.35);
  flex-shrink:0;
  transition: transform .1s;
}
.fp-play-btn:active{ transform: scale(0.96); }

/* Chapters row */
.fp-chapters-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 14px 18px 10px;
}

.fp-chapter-chips{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scrollbar-width:none;
  flex:1;
}
.fp-chapter-chips::-webkit-scrollbar{ display:none; }

.fp-chapter-chip{
  padding: 10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:#1F2937;
  color: var(--text-gray-light);
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
  font-family:inherit;
  flex-shrink:0;
  transition: all .15s;
}
.fp-chapter-chip.active{
  background: var(--secondary);
  color:#fff;
  border-color: rgba(219,39,119,0.25);
}

.fp-all-btn{
  padding: 10px 16px;
  border-radius:14px;
  background: var(--bg-card);
  border:1px solid rgba(255,255,255,0.10);
  color:#fff;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
  font-family:inherit;
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}

/* Bottom sheet */
.fp-sheet-overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  z-index:3000;
  display:none;
}
.fp-sheet-overlay.open{ display:block; }

.fp-chapters-sheet{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  z-index:3001;
  max-height:70vh;
  display:flex;
  flex-direction:column;
  transform: translateY(100%);
  transition: transform .3s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.fp-chapters-sheet.open{ transform: translateY(0); }

.fp-sheet-handle{
  width:40px;
  height:4px;
  border-radius:2px;
  background: rgba(255,255,255,0.24);
  margin: 10px auto 0;
}
.fp-sheet-title{
  text-align:center;
  font-size:16px;
  font-weight:900;
  padding: 12px 16px 8px;
}
.fp-sheet-list{
  overflow-y:auto;
  flex:1;
  padding: 0 0 8px;
}
.fp-sheet-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding: 14px 18px;
  cursor:pointer;
  transition: background .15s;
}
.fp-sheet-item:active{ background: rgba(255,255,255,0.05); }

.fp-sheet-item-icon{
  font-size:18px;
  width:22px;
  text-align:center;
  flex-shrink:0;
}
.fp-sheet-item-title{
  flex:1;
  font-size:15px;
  font-weight:800;
  color:#fff;
}
.fp-sheet-item-tag{
  font-size:12px;
  font-weight:900;
  flex-shrink:0;
}
.fp-sheet-item.current .fp-sheet-item-title{ color: var(--secondary); }

.fp-liked{ color: var(--secondary) !important; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (min-width: 768px){
  .row-scroll{ padding: 0 40px 6px; }
}

/* ===========================
   LIGHT POLISH (tap/hover)
   =========================== */
@media (hover:hover) and (pointer:fine){
  .book-card:hover .book-cover{
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0,0,0,0.55);
  }
  .creator-list-card:hover{
    border-color: rgba(124,58,237,0.35);
  }
}
.book-cover,
.creator-list-card{
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.book-card:active .book-cover{ transform: scale(.98); }

/* ===================================
   MY STORE PAGE v2 (Flutter match)
   =================================== */

.store-page-v2 {
    padding: 0 0 140px;
    min-height: 100vh;
    background: var(--bg-dark);
}

.store-topbar {
    padding: calc(20px + env(safe-area-inset-top)) 16px 4px;
    text-align: center;
}

.store-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

/* Balance card */
.store-balance-card {
    margin: 16px 16px 0;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #F59E0B, #EAB308, #FBBF24);
    box-shadow: 0 10px 24px rgba(245,158,11,0.25);
    display: flex;
    align-items: center;
    gap: 14px;
}

.store-balance-icon-box {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.store-balance-info { flex: 1; }

.store-balance-num {
    font-size: 28px;
    font-weight: 900;
    color: #3B2F0B;
    line-height: 1;
}

.store-balance-label {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(0,0,0,0.45);
}

/* Section head */
.store-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 16px 10px;
}

.store-section-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.store-secure-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-gray-light);
}

/* Packages */
.store-packages {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pkg-tile {
    position: relative;
    background: var(--bg-card);
    border-radius: 18px;
    overflow: visible;
}

.pkg-tile-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.pkg-badge {
    position: absolute;
    right: 82px;
    top: 0;
    padding: 4px 8px;
    border-radius: 0 0 10px 10px;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.6px;
}

.pkg-badge-orange { background: #F97316; }
.pkg-badge-red { background: #EF4444; }

.pkg-coin-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(245,158,11,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.pkg-info { flex: 1; min-width: 0; }

.pkg-coins-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pkg-coins-text {
    font-size: 14px;
    font-weight: 800;
    color: #F3F4F6;
}

.pkg-bonus {
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(16,185,129,0.12);
    font-size: 10px;
    font-weight: 900;
    color: #10B981;
}

.pkg-price {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 900;
    color: #F59E0B;
}

.pkg-buy-btn {
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary), #6D28D9);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 16px rgba(124,58,237,0.25);
    flex-shrink: 0;
}

/* Subscription tiles */
.sub-tile {
    margin: 0 16px 10px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-tile-info { flex: 1; min-width: 0; }

.sub-creator-name {
    font-size: 15px;
    font-weight: 900;
    color: #F3F4F6;
}

.sub-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-gray-light);
}

.sub-autorenewal {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
}

.sub-autorenewal.on { color: #10B981; }
.sub-autorenewal.off { color: var(--text-gray-light); }

.sub-btn {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.store-empty-sub-card {
    margin: 0 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray-light);
}

.store-empty-subs {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-gray-light);
    font-size: 13px;
    font-weight: 600;
}

/* ===================================
   PROFILE PAGE v2 (Flutter match)
   =================================== */

.profile-page-v2 {
    padding-bottom: 40px;
    min-height: 100vh;
    background: var(--bg-dark);
    font-family: inherit;
}

/* Topbar */
.pv2-topbar {
    display: flex;
    align-items: center;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    gap: 10px;
}

.pv2-back-btn {
    width: 40px; height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.pv2-topbar-title {
    flex: 1;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    text-align: center;
}

/* Avatar section */
.pv2-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px 0;
}

.pv2-avatar {
    width: 88px; height: 88px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 900; color: #fff;
    box-shadow: 0 10px 24px rgba(219,39,119,0.25);
}

.pv2-name {
    margin-top: 12px;
    font-size: 18px; font-weight: 900; color: #fff;
    text-align: center;
}

.pv2-email {
    margin-top: 4px;
    font-size: 12px; font-weight: 600;
    color: var(--text-gray-light);
    text-align: center;
}

/* Coins card */
.pv2-coins-card {
    margin: 18px 16px 0;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 18px;
    display: flex; align-items: center; gap: 12px;
}

.pv2-coins-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: rgba(245,158,11,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}

.pv2-coins-info { flex: 1; min-width: 0; }

.pv2-coins-num {
    font-size: 14px; font-weight: 900;
    color: #F3F4F6;
}

.pv2-coins-hint {
    margin-top: 3px;
    font-size: 11px; font-weight: 600;
    color: var(--text-gray-light);
}

/* Tiles */
.pv2-tiles {
    padding: 14px 16px 0;
    display: flex; flex-direction: column; gap: 10px;
}

.pv2-tile {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.15s;
}

.pv2-tile:active { background: rgba(255,255,255,0.06); }

.pv2-tile-icon {
    width: 40px; height: 40px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center;
    color: #D1D5DB; font-size: 16px; flex-shrink: 0;
}

.pv2-tile-text { flex: 1; min-width: 0; }

.pv2-tile-title {
    font-size: 13px; font-weight: 900;
    color: #F3F4F6;
}

.pv2-tile-sub {
    margin-top: 3px;
    font-size: 11px; font-weight: 600;
    color: var(--text-gray-light);
}

.pv2-tile-arrow {
    color: var(--text-gray-light);
    font-size: 14px; flex-shrink: 0;
}

/* Logout button */
.pv2-logout-btn {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.14);
    color: #EF4444;
    font-size: 14px; font-weight: 900;
    cursor: pointer; font-family: inherit;
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    transition: background 0.15s;
}

.pv2-logout-btn:active { background: rgba(239,68,68,0.22); }

/* Language tiles */
.pv2-lang-tile {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: transparent;
    color: #E5E7EB;
    font-size: 13px; font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
}

.pv2-lang-tile i { display: none; }

.pv2-lang-tile.active {
    background: rgba(219,39,119,0.12);
    border-color: rgba(219,39,119,0.25);
    color: #F472B6;
}

.pv2-lang-tile.active i { display: inline; }

/* ===== Package Badge ===== */
.pkg-coins-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pkg-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 20px;
  color: #fff;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.pkg-badge--best {
  background: linear-gradient(135deg, var(--secondary, #7C3AED), #ff3b30);
}

.pkg-badge--popular {
  background: linear-gradient(135deg, #ff9800, #ff5722);
}

/* ===========================
   LEGAL PAGES (Terms/Privacy/Refund)
   =========================== */
.legal-page{
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
}

.legal-topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(8,9,15,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.legal-back{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.legal-title{
  flex: 1;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.legal-home{
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124,58,237,0.25);
  background: rgba(124,58,237,0.10);
}

.legal-wrap{
  padding: 14px 14px 40px;
  max-width: 920px;
  margin: 0 auto;
}

.legal-card{
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.legal-card h1{
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.legal-card h2{
  margin-top: 16px;
  font-size: 15px;
  font-weight: 900;
  color: #E5E7EB;
}

.legal-card p{
  margin-top: 10px;
  color: #D1D5DB;
  line-height: 1.7;
  font-weight: 600;
  font-size: 13px;
}

.legal-card ul{
  margin-top: 10px;
  padding-left: 18px;
  color: #D1D5DB;
  line-height: 1.8;
  font-weight: 600;
  font-size: 13px;
}

.legal-muted{
  color: var(--text-gray-light) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.legal-link{
  color: #F472B6;
  font-weight: 900;
  text-decoration: none;
}

.legal-hr{
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 16px 0 12px;
}

.legal-footer-links{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items:center;
  justify-content: center;
  color: var(--text-gray-light);
  font-size: 12px;
  font-weight: 800;
}

.legal-dot{ opacity: 0.7; }