/* =====================================================
   RIManhwa — Pink-themed stylesheet
   ===================================================== */

:root {
  --pink-50:  #fff0f7;
  --pink-100: #ffd6ec;
  --pink-200: #ffb3da;
  --pink-400: #ff6eb4;
  --pink-500: #ff3d9a;
  --pink-600: #ff1493;
  --pink-700: #d4006f;
  --pink-900: #7a0040;
  --bg:       #0d0611;
  --bg-card:  #160b1e;
  --bg-nav:   rgba(13,6,17,0.96);
  --text:     #f5e6f0;
  --text-muted: #a078a0;
  --border:   rgba(255,20,147,0.15);
  --radius:   12px;
  --shadow:   0 4px 24px rgba(255,20,147,0.12);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1.75rem; gap: 1rem;
}
.navbar-brand { display: flex; align-items: center; gap: 0.6rem; font-size: 1.4rem; font-weight: 900; letter-spacing: -0.5px; flex-shrink: 0; }
.logo-icon { width: 38px; height: 38px; flex-shrink: 0; }
.brand-text { font-family: 'Cinzel', serif; font-weight: 700; }
.brand-accent { color: var(--pink-600); }
.brand-text.small { font-size: 0.85rem; }

/* Nav menu */
.nav-menu {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center;
}
.nav-menu-link, .nav-menu-btn {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--text-muted); font-weight: 700; font-size: 0.88rem;
  padding: 0.45rem 0.85rem; border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  cursor: pointer; background: none; border: none; font-family: inherit;
  white-space: nowrap;
}
.nav-menu-link:hover, .nav-menu-btn:hover { color: var(--pink-400); background: rgba(255,20,147,0.07); }
.nav-menu-link.active { color: var(--pink-400); background: rgba(255,20,147,0.1); }
.nav-avatar-inline {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--pink-500); object-fit: cover;
}

/* Right actions */
.nav-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.nav-link { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; transition: color var(--transition); }
.nav-link:hover { color: var(--pink-400); }

/* User pill */
.nav-user-pill {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,20,147,0.08); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  transition: background var(--transition);
}
.nav-user-pill:hover { background: rgba(255,20,147,0.15); }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; width: 32px; height: 32px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--pink-400); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-scrape {
  background: transparent; border: 1.5px solid var(--pink-600); color: var(--pink-400);
  padding: 0.45rem 1.1rem; border-radius: 50px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background var(--transition), color var(--transition);
}
.btn-scrape:hover:not(:disabled) { background: var(--pink-600); color: #fff; }
.btn-scrape:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  color: #fff; padding: 0.7rem 1.8rem; border-radius: 50px; font-weight: 700;
  font-size: 0.95rem; border: none; cursor: pointer; font-family: inherit;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(255,20,147,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,20,147,0.45); }

.btn-outline {
  display: inline-block; background: transparent;
  border: 1.5px solid var(--pink-600); color: var(--pink-400);
  padding: 0.6rem 1.4rem; border-radius: 50px; font-weight: 700; font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
  cursor: pointer; font-family: inherit;
}
.btn-outline:hover { background: var(--pink-600); color: #fff; }

.btn-watchlist {
  display: inline-block; background: transparent;
  border: 1.5px solid var(--text-muted); color: var(--text-muted);
  padding: 0.6rem 1.4rem; border-radius: 50px; font-weight: 700; font-size: 0.9rem;
  transition: all var(--transition); cursor: pointer; font-family: inherit;
}
.btn-watchlist:hover, .btn-watchlist.active {
  background: rgba(255,20,147,0.12); border-color: var(--pink-600); color: var(--pink-400);
}

.detail-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ── Main ── */
.main-content { flex: 1; padding-bottom: 3rem; }

/* ── Hero ── */
.hero {
  text-align: center; padding: 4rem 1.5rem 2.5rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,20,147,0.12) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}
.hero-title { font-family: 'Cinzel', serif; font-size: clamp(2.5rem,6vw,4.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -1px; margin-bottom: 0.75rem; }
.hero-sub { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1.5rem; }
.stats-bar { display: inline-flex; align-items: center; gap: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50px; padding: 0.6rem 2rem; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.stat-num { font-size: 1.6rem; font-weight: 900; color: var(--pink-400); line-height: 1; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.stat-sep { color: var(--pink-600); font-size: 1.4rem; font-weight: 900; }

/* ── Continue Reading strip ── */
.continue-section { background: rgba(255,20,147,0.04); border-bottom: 1px solid var(--border); }
.continue-strip { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.75rem; scroll-snap-type: x mandatory; }
.continue-strip::-webkit-scrollbar { height: 4px; }
.continue-strip::-webkit-scrollbar-thumb { background: var(--pink-700); border-radius: 4px; }

.continue-card {
  flex-shrink: 0; scroll-snap-align: start;
  width: 260px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; position: relative;
  transition: border-color var(--transition);
}
.continue-card:hover { border-color: rgba(255,20,147,0.45); }

.continue-inner { display: flex; gap: 0; text-decoration: none; }
.continue-cover {
  width: 72px; flex-shrink: 0;
  background: linear-gradient(90deg, #1a0a24 25%, #2a0d36 50%, #1a0a24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
}
.continue-cover img { width: 72px; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.continue-cover img.img-loaded { opacity: 1; }
.continue-cover .ph { font-size: 1.8rem; color: var(--pink-700); }
.continue-info { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.continue-title { font-size: 0.8rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-ch { font-size: 0.75rem; color: var(--pink-400); font-weight: 700; }
.continue-cta { font-size: 0.72rem; color: var(--text-muted); margin-top: auto; }

.continue-remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(13,6,17,0.7); border: none; color: var(--text-muted);
  width: 20px; height: 20px; border-radius: 50%; font-size: 0.65rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.continue-remove:hover { color: var(--pink-400); background: rgba(13,6,17,0.95); }

/* ── Featured card ── */
.featured-section { padding: 0; }
.featured-card {
  display: flex; gap: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 220px;
}
.featured-card:hover { border-color: rgba(255,20,147,0.5); box-shadow: 0 8px 40px rgba(255,20,147,0.2); }
.featured-cover {
  width: 160px; flex-shrink: 0; position: relative; overflow: hidden;
  background: linear-gradient(90deg, #1a0a24 25%, #2a0d36 50%, #1a0a24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.featured-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, opacity 0.35s ease; opacity: 0; }
.featured-cover img.img-loaded { opacity: 1; }
.featured-card:hover .featured-cover img { transform: scale(1.06); }
.featured-cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 4rem; color: var(--pink-700); }
.featured-overlay { position: absolute; inset: 0; background: linear-gradient(to right, transparent, var(--bg-card)); }

.featured-info {
  flex: 1; padding: 1.75rem 2rem;
  background: var(--bg-card);
  display: flex; flex-direction: column; gap: 0.75rem; justify-content: center;
}
.featured-badge {
  display: inline-block; background: var(--pink-600); color: #fff;
  font-size: 0.65rem; font-weight: 900; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase; width: fit-content;
}
.featured-title { font-size: clamp(1.1rem, 2.5vw, 1.7rem); font-weight: 900; line-height: 1.2; }
.featured-meta { color: var(--text-muted); font-size: 0.88rem; }
.featured-btn { width: fit-content; margin-top: 0.25rem; }

/* ── Search Bar ── */
.search-bar-wrap { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.search-bar {
  flex: 1; max-width: 460px;
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 50px;
  color: var(--text); padding: 0.65rem 1.4rem; font-size: 0.95rem; font-family: inherit;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus { border-color: var(--pink-600); box-shadow: 0 0 0 3px rgba(255,20,147,0.12); }
.search-bar::placeholder { color: var(--text-muted); }
.search-hint { color: var(--text-muted); font-size: 0.72rem; background: var(--bg-card); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; font-family: monospace; }
.no-results { color: var(--text-muted); font-size: 0.95rem; margin-top: 2rem; text-align: center; }
.no-results.hidden { display: none; }

/* ── Grid ── */
.grid-section { max-width: 1400px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section-heading { font-size: 1.3rem; font-weight: 700; color: var(--pink-400); margin-bottom: 1.5rem; letter-spacing: -0.3px; }
.manhwa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; }

.manhwa-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: block;
}
.manhwa-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(255,20,147,0.4); }
.card-cover {
  position: relative; aspect-ratio: 2/3; overflow: hidden;
  background: linear-gradient(90deg, #1a0a24 25%, #2a0d36 50%, #1a0a24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease, opacity 0.35s ease;
  opacity: 0;
}
.card-cover img.img-loaded { opacity: 1; }
.manhwa-card:hover .card-cover img { transform: scale(1.05); }

.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--pink-700); background: linear-gradient(135deg, #1a0a24, #2d0a3d); }
.cover-placeholder.large { aspect-ratio: 2/3; font-size: 5rem; }

.card-badge { position: absolute; bottom: 6px; right: 6px; background: rgba(13,6,17,0.85); color: var(--pink-400); font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--border); backdrop-filter: blur(4px); }
.watchlist-badge { color: var(--pink-500); font-size: 0.75rem; }

.badge-new { position: absolute; top: 7px; left: 7px; background: var(--pink-600); color: #fff; font-size: 0.6rem; font-weight: 900; letter-spacing: 1px; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; }

.card-info { padding: 0.65rem; }
.card-title { font-size: 0.78rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-progress { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.25rem; height: 0; overflow: hidden; transition: height 0.2s; }
.card-progress.has-progress { height: 1rem; color: var(--pink-400); font-weight: 700; }

/* ── Detail Page ── */
.detail-page { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.detail-header { display: flex; gap: 2.5rem; align-items: flex-start; margin-bottom: 2.5rem; }
.detail-cover {
  flex-shrink: 0; width: 220px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(90deg, #1a0a24 25%, #2a0d36 50%, #1a0a24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.detail-cover img { width: 100%; display: block; opacity: 0; transition: opacity 0.35s ease; }
.detail-cover img.img-loaded { opacity: 1; }
.detail-meta { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.back-link { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; transition: color var(--transition); }
.back-link:hover { color: var(--pink-400); }
.detail-title { font-size: clamp(1.4rem,3vw,2rem); font-weight: 900; line-height: 1.2; }
.detail-stats { display: flex; gap: 0.6rem; }
.stat-chip { background: rgba(255,20,147,0.1); border: 1px solid var(--border); color: var(--pink-400); padding: 0.3rem 0.8rem; border-radius: 50px; font-size: 0.8rem; font-weight: 700; }

/* ── Chapter List ── */
.chapter-list-section { margin-top: 1rem; }
.chapter-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 600px; overflow-y: auto; padding-right: 4px; }
.chapter-list::-webkit-scrollbar { width: 4px; }
.chapter-list::-webkit-scrollbar-thumb { background: var(--pink-700); border-radius: 4px; }

.chapter-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.chapter-row:hover { background: rgba(255,20,147,0.08); border-color: rgba(255,20,147,0.35); transform: translateX(4px); }
.chapter-row.ch-read { opacity: 0.55; }
.chapter-row.ch-read:hover { opacity: 0.85; }

.ch-read-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--text-muted); flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.ch-read-dot.active { background: var(--pink-600); border-color: var(--pink-600); }

.ch-num { font-weight: 700; color: var(--pink-400); min-width: 90px; font-size: 0.88rem; }
.ch-title { flex: 1; color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-arrow { color: var(--pink-600); font-weight: 700; }

/* ── Recommendations ── */
.recs-section { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.recs-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.rec-card { }

/* ── Auto-next bar ── */
.autonext-bar {
  display: none; margin: 1.5rem 0;
  background: var(--bg-card); border: 1px solid rgba(255,20,147,0.4);
  border-radius: var(--radius); padding: 1.1rem 1.5rem;
  animation: slideUp 0.35s ease;
}
.autonext-bar.visible { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.autonext-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.autonext-label { font-weight: 700; font-size: 0.95rem; color: var(--pink-400); }
.autonext-controls { display: flex; align-items: center; gap: 0.75rem; }

.autonext-ring { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.ring-svg { width: 40px; height: 40px; transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: rgba(255,20,147,0.15); stroke-width: 3; }
.ring-fill {
  fill: none; stroke: var(--pink-600); stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.autonext-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900; color: var(--pink-400);
}
.autonext-go     { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.autonext-cancel { padding: 0.5rem 1rem; font-size: 0.82rem; }

/* ── Comments ── */
.comments-section { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 2rem; }
.comment-count { color: var(--text-muted); font-size: 0.9rem; font-weight: 400; }
.comment-form { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.comment-form-row { display: flex; gap: 0.75rem; align-items: center; }
.comment-input { flex: 1; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); padding: 0.6rem 1rem; font-size: 0.9rem; font-family: inherit; outline: none; transition: border-color var(--transition); }
.comment-input:focus { border-color: var(--pink-600); }
.comment-textarea { width: 100%; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); padding: 0.75rem 1rem; font-size: 0.9rem; font-family: inherit; outline: none; resize: vertical; min-height: 80px; transition: border-color var(--transition); }
.comment-textarea:focus { border-color: var(--pink-600); }
.comment-submit { padding: 0.6rem 1.4rem; font-size: 0.9rem; }
.comment-list { display: flex; flex-direction: column; gap: 1rem; }
.comment-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; transition: border-color var(--transition); }
.comment-item.new-comment { border-color: rgba(255,20,147,0.4); animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Image shimmer (loading placeholder) ── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.comment-author { font-weight: 700; color: var(--pink-400); font-size: 0.88rem; }
.comment-date   { color: var(--text-muted); font-size: 0.75rem; }
.comment-body   { color: var(--text); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.no-comments    { color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 1.5rem 0; }

/* ── Watchlist Page ── */
.watchlist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.watchlist-title { margin-bottom: 0; }
.btn-clear-watchlist { font-size: 0.82rem; padding: 0.4rem 1rem; }

/* ── Reader ── */
.reader-page { max-width: 800px; margin: 0 auto; padding: 1rem; }
.reader-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1rem; flex-wrap: wrap;
}
.chapter-selector-wrap { flex: 1; min-width: 200px; }
.chapter-selector { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.85rem; font-family: inherit; cursor: pointer; }
.chapter-selector:focus { outline: 2px solid var(--pink-600); }
.reader-nav { display: flex; gap: 0.5rem; }

.nav-btn { display: inline-block; background: var(--bg-card); border: 1px solid var(--border); color: var(--pink-400); padding: 0.45rem 1rem; border-radius: 8px; font-weight: 700; font-size: 0.85rem; transition: background var(--transition), border-color var(--transition); }
.nav-btn:hover:not(.disabled) { background: rgba(255,20,147,0.12); border-color: rgba(255,20,147,0.4); }
.nav-btn.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.nav-btn.large { padding: 0.65rem 1.4rem; font-size: 0.9rem; }

.reader-title { text-align: center; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.reader-title h1 { font-size: 1.1rem; font-weight: 700; }
.ch-label { color: var(--pink-400); font-size: 0.9rem; font-weight: 900; }

.reader-images { display: flex; flex-direction: column; gap: 0; }
.reader-img-wrap { line-height: 0; }
.reader-img { width: 100%; height: auto; display: block; border: 0; }

.reader-bottombar { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

/* ── HQ Translation Badge ── */
.badge-hq {
  display: inline-block;
  font-size: 0.62rem; font-weight: 700;
  background: linear-gradient(135deg, #ff6eb4, #ff1493);
  color: #fff;
  padding: 0.18rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Rating Widget (Reader) ── */
.rating-section {
  max-width: 800px; margin: 2rem auto 0; padding: 1.5rem 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.rating-label { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; }
.stars-row { display: flex; justify-content: center; gap: 0.4rem; margin-bottom: 0.6rem; }
.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 2.2rem; color: var(--border); line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.star-btn:hover, .star-btn.hovered { color: #f59e0b; transform: scale(1.15); }
.star-btn.active { color: #f59e0b; }
.rating-summary { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }
.rating-voted-msg { font-size: 0.85rem; color: var(--pink-400); font-weight: 600; }

/* ── Rating Section (Manhwa Detail) ── */
.rating-section-detail {
  margin: 2rem 0 1.5rem; padding: 1.5rem 1.2rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rating-detail-top { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rating-big-score { font-size: 2.8rem; font-weight: 900; color: var(--pink-400); line-height: 1; }
.rating-big-stars { font-size: 1.5rem; color: #f59e0b; letter-spacing: 2px; }
.rating-big-count { font-size: 0.82rem; color: var(--text-muted); }
.rating-bars { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.2rem; }
.rating-bar-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }
.rating-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rating-bar-fill  { height: 100%; background: #f59e0b; border-radius: 4px; transition: width 0.4s ease; }
.rating-your-vote { display: flex; align-items: center; gap: 0.75rem; border-top: 1px solid var(--border); padding-top: 1rem; flex-wrap: wrap; }
.rating-your-label { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 0; }

/* ── Empty State ── */
.empty-state { max-width: 500px; margin: 4rem auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; }
.empty-state.small { margin: 2rem auto; }
.empty-icon { font-size: 4rem; color: var(--pink-700); line-height: 1; }
.empty-state h2 { font-size: 1.6rem; font-weight: 900; }
.empty-state p { color: var(--text-muted); font-size: 1rem; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 1.25rem 2rem; text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.footer-note { color: var(--text-muted); font-size: 0.78rem; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--pink-600); color: var(--text);
  padding: 0.75rem 1.5rem; border-radius: 50px; font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(255,20,147,0.3); z-index: 9999; white-space: nowrap; transition: opacity 0.3s;
}
.toast.hidden { display: none; }

/* ── Auth / Sign-in ── */
.btn-google-login {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: 8px;
  padding: 0.45rem 0.85rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: box-shadow var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-google-login:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.btn-google-login--large {
  padding: 0.7rem 1.4rem; font-size: 0.95rem; border-radius: 10px;
}

/* Login providers stack */
.login-providers {
  display: flex; flex-direction: column; gap: 0.75rem;
}
.login-provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  padding: 0.75rem 1.25rem; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  transition: filter var(--transition), transform var(--transition);
  border: none; cursor: pointer; width: 100%;
}
.login-provider-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.login-provider-btn--google  { background: #fff;     color: #3c4043; border: 1px solid #dadce0; }
.login-provider-btn--discord { background: #5865F2; color: #fff; }
.login-provider-btn--github  { background: #24292e; color: #fff; }

.nav-user {
  display: flex; align-items: center; gap: 0.55rem;
}
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--pink-500); object-fit: cover; flex-shrink: 0;
}
.nav-username {
  font-size: 0.85rem; font-weight: 700; color: var(--text); max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-signin-nav {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  color: #fff; border: none; border-radius: 8px;
  padding: 0.42rem 1rem; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: opacity var(--transition);
  white-space: nowrap;
}
.btn-signin-nav:hover { opacity: 0.88; }

.btn-logout {
  font-size: 0.78rem; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.25rem 0.55rem; cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn-logout:hover { color: var(--pink-400); border-color: var(--pink-400); }

/* Login Modal */
.login-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.login-modal-overlay.open { display: flex; }
.login-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2.5rem 2rem;
  max-width: 380px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(255,20,147,0.2);
  position: relative; animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.login-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
  transition: color var(--transition);
}
.login-modal-close:hover { color: var(--text); }
.login-modal-logo { margin-bottom: 1rem; }
.login-modal-title {
  font-family: 'Cinzel', serif; font-size: 1.3rem;
  color: var(--pink-400); margin-bottom: 0.5rem;
}
.login-modal-sub {
  font-size: 0.87rem; color: var(--text-muted);
  margin-bottom: 1.5rem; line-height: 1.5;
}

/* Comment form with user identity */
.comment-form-user {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.comment-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--pink-500); object-fit: cover;
}
.comment-user-name {
  font-size: 0.9rem; font-weight: 700; color: var(--pink-400);
}

/* Comment login prompt */
.comment-login-prompt {
  background: rgba(255,20,147,0.05); border: 1px dashed var(--border);
  border-radius: 12px; padding: 1.25rem; text-align: center;
  margin-bottom: 1.25rem;
}
.comment-login-prompt p {
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.85rem;
}

/* Comment avatar */
.comment-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  vertical-align: middle; margin-right: 0.4rem;
  border: 1px solid var(--border); object-fit: cover;
}

/* ── Unified Modals ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2.5rem 2rem;
  max-width: 400px; width: 92%; text-align: center;
  box-shadow: 0 20px 60px rgba(255,20,147,0.2);
  position: relative; animation: modalIn 0.25s ease;
}
.modal-close {
  position: absolute; top: 1rem; left: 1rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }
.report-select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.65rem 0.85rem; font-size: 0.9rem; font-family: inherit;
  margin-bottom: 0.75rem;
}
.report-submit { width: 100%; margin-top: 0.75rem; }

/* ── Browse page ── */
.browse-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.browse-count {
  background: rgba(255,20,147,0.1); color: var(--pink-400);
  border-radius: 50px; padding: 0.25rem 0.85rem;
  font-size: 0.82rem; font-weight: 700;
}
.browse-filters {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.browse-filters .search-input { flex: 1; min-width: 180px; }
.sort-btns { display: flex; gap: 0.4rem; }
.sort-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 6px;
  padding: 0.4rem 0.75rem; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.sort-btn:hover  { color: var(--pink-400); border-color: var(--pink-400); }
.sort-btn.active { color: var(--pink-400); border-color: var(--pink-400); background: rgba(255,20,147,0.08); }
.no-results { text-align: center; color: var(--text-muted); padding: 2rem; }

/* ── Profile page ── */
.profile-section { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }
.profile-card {
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem; margin-bottom: 1.75rem;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  border: 3px solid var(--pink-500); object-fit: cover; flex-shrink: 0;
}
.profile-avatar-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: #fff; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name  { font-size: 1.3rem; font-weight: 900; }
.profile-email { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.btn-logout-profile {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 8px; padding: 0.45rem 1rem; font-size: 0.85rem; cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-logout-profile:hover { color: var(--pink-400); border-color: var(--pink-400); }
.profile-stats {
  display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.45rem 1.1rem;
  font-size: 0.85rem; color: var(--text-muted);
}
.stat-pill strong { color: var(--pink-400); }
.profile-block { margin-bottom: 2.5rem; }
.profile-block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.btn-sm {
  font-size: 0.78rem; padding: 0.3rem 0.7rem; border-radius: 6px;
}
.empty-note { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* History list */
.history-list { display: flex; flex-direction: column; gap: 0.6rem; }
.history-item {
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.7rem; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none; color: inherit;
}
.history-item:hover { border-color: var(--pink-400); background: rgba(255,20,147,0.04); }
.history-cover { width: 40px; height: 56px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.history-cover img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.history-title { font-weight: 700; font-size: 0.9rem; }
.history-ch { font-size: 0.78rem; color: var(--pink-400); }
.history-arrow { color: var(--text-muted); font-size: 1rem; }

/* Login required state */
.login-required-state {
  text-align: center; padding: 4rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.login-required-icon { font-size: 3rem; }
.login-required-state h2 { font-size: 1.4rem; }
.login-required-state p { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-menu {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: var(--bg-nav); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    padding: 0.5rem 1rem 1rem; gap: 0.15rem; z-index: 99;
  }
  .nav-menu.open { display: flex; }
  .nav-menu-link, .nav-menu-btn { justify-content: flex-start; font-size: 1rem; padding: 0.7rem 1rem; }
  .nav-hamburger { display: flex; }
  .navbar { position: relative; }
  .btn-signin-nav { font-size: 0.8rem; padding: 0.38rem 0.75rem; }
}

@media (max-width: 640px) {
  .navbar { padding: 0.6rem 1rem; }
  .detail-header { flex-direction: column; }
  .detail-cover { width: 100%; max-width: 220px; margin: 0 auto; }
  .manhwa-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.85rem; }
  .reader-topbar { gap: 0.5rem; }
  .watchlist-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .featured-card { height: auto; flex-direction: column; }
  .featured-cover { width: 100%; height: 180px; }
  .featured-overlay { background: linear-gradient(to bottom, transparent, var(--bg-card)); }
  .autonext-inner { flex-direction: column; align-items: flex-start; }
  .search-hint { display: none; }
  .profile-card { flex-direction: column; text-align: center; }
  .browse-filters { flex-direction: column; }
  .modal-box { padding: 1.75rem 1.25rem; }
}
