:root {
  --bg-main: #0b0f19;
  --bg-surface: #141b29;
  --bg-elevated: #1c2536;
  --bg-pill: #1b2333;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(245, 158, 11, 0.55);
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --danger: #ef4444;
  --success: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-16 {
  margin-bottom: 16px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* ================= TOP HEADER ================= */
.top-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1e2638, #121826);
  border: 1.5px solid var(--border-accent);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.18);
}

.brand-logo span {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.brand-title span {
  color: var(--accent);
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 38px;
  width: 250px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-elevated);
}

#searchToggleBtn {
  display: none;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

.notif-dot.hidden {
  display: none;
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar-btn svg {
  width: 100%;
  height: 100%;
}

/* Toast Banner */
.toast-banner {
  position: fixed;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  max-width: 90vw;
  text-align: center;
}

/* Dropdown Notifications */
.dropdown-wrap {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 950;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 700;
}

.text-btn {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.notif-list {
  max-height: 280px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

.notif-item.unread {
  background: rgba(245, 158, 11, 0.06);
}

.notif-item p {
  color: var(--text-primary);
  margin: 4px 0;
}

.notif-item small {
  color: var(--text-muted);
  font-size: 11px;
}

.notif-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.14);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ================= MAIN CONTENT ================= */
.main-content {
  padding-top: 28px;
  padding-bottom: 124px;
}

/* ================= HERO CAROUSEL ================= */
.hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.hero-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  min-height: 360px;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, opacity 0.35s ease;
  cursor: pointer;
  user-select: none;
}

.hero-card.side {
  width: 215px;
  height: 300px;
  opacity: 0.86;
  flex-shrink: 0;
}

.hero-card.side:hover {
  opacity: 1;
  transform: translateY(-4px);
}

.hero-card.center {
  width: 265px;
  height: 365px;
  border: 2px solid var(--accent);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.65), 0 0 28px var(--accent-glow);
  z-index: 2;
  flex-shrink: 0;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 15, 25, 0.35) 0%,
    rgba(11, 15, 25, 0.15) 45%,
    rgba(11, 15, 25, 0.92) 85%,
    rgba(11, 15, 25, 0.98) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
}

.hero-top-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(6px);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.rating-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(15, 23, 42, 0.82);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.hero-bottom {
  text-align: center;
}

.hero-card.side .hero-bottom {
  text-align: left;
}

.featured-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.hero-card.center .hero-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 4px;
}

.hero-card.center .hero-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.hero-card.side .hero-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.carousel-arrow {
  position: absolute;
  top: 46%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(24, 32, 48, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  z-index: 5;
  transition: background 0.2s, border-color 0.2s;
}

.carousel-arrow:hover {
  background: var(--accent);
  color: #0b0f19;
  border-color: var(--accent);
}

.carousel-arrow.prev {
  left: 48px;
}

.carousel-arrow.next {
  right: 48px;
}

.carousel-arrow svg {
  width: 18px;
  height: 18px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: #283347;
  transition: width 0.25s, background 0.25s;
}

.carousel-dot.active {
  width: 24px;
  background: var(--accent);
}

/* ================= FILTER BARS ================= */
.filters-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.16);
}

.pill-btn.active {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #0b0f19;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.28);
}

.pill-btn.danger-btn {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.pill-btn.danger-btn:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #ffffff;
}

.pill-btn.sm {
  padding: 6px 13px;
  font-size: 12px;
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.pill-btn.active .dot-indicator {
  background: #0b0f19;
}

/* ================= NOVEL GRID ================= */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
}

.head-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-pill.warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.result-count {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.novel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.novel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.novel-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.novel-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #101624;
}

.novel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.novel-card:hover .novel-cover img {
  transform: scale(1.04);
}

.cover-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.novel-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.novel-genre {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.novel-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novel-meta {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ================= FLOATING BOTTOM NAVBAR ================= */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(92vw, 480px);
  background: rgba(24, 32, 48, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-indicator {
  width: 18px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: transparent;
  margin-top: 1px;
  transition: background 0.2s ease;
}

.nav-item.active .nav-indicator {
  background: var(--accent);
}

/* ================= SUB-VIEWS & FORMS ================= */
.page-banner {
  margin-bottom: 22px;
}

.page-banner h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-banner p {
  font-size: 14px;
  color: var(--text-secondary);
}

.genre-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.genre-chip {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.genre-chip.active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent);
  border-color: var(--border-accent);
}

.forum-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.forum-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.forum-card h3 {
  font-size: 16px;
  margin: 6px 0;
}

.forum-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.forum-footer {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-card,
.admin-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.admin-form-card {
  margin-bottom: 20px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.profile-identity {
  flex: 1;
}

.profile-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  font-weight: 800;
  font-size: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-rank {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.profile-rank span,
.profile-rank strong {
  color: var(--accent);
  font-weight: 600;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-box strong {
  display: block;
  font-size: 20px;
  color: var(--accent);
}

.stat-box span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Auth & Admin Forms */
.auth-box {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-accent);
}

.checkbox-inline {
  justify-content: center;
}

.checkbox-inline label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.rules-alert {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 13px;
}

.rules-alert strong {
  display: block;
  color: #fca5a5;
  margin-bottom: 4px;
}

.rules-alert code {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.admin-novel-list {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-novel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
}

.admin-novel-row-info strong {
  display: block;
  font-size: 14px;
}

.admin-novel-row-info small {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================= MODAL ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop[hidden],
.dropdown-panel[hidden],
.page-view[hidden],
.toast-banner[hidden],
.rules-alert[hidden],
.admin-form-card[hidden],
.profile-card[hidden],
.auth-box[hidden],
#registerNameGroup[hidden],
#logoutBtn[hidden] {
  display: none !important;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 20px;
  display: grid;
  place-items: center;
}

.modal-hero {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-cover {
  width: 145px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-accent);
}

.modal-details h2 {
  font-size: 20px;
  margin: 6px 0 4px;
}

.modal-details .sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.modal-details p {
  font-size: 13.5px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.chapter-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.reader-box {
  background: #0e1420;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.reader-box h4 {
  color: var(--accent);
  font-size: 15px;
}

.reader-content p {
  line-height: 1.8;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .novel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .carousel-arrow.prev {
    left: 10px;
  }
  .carousel-arrow.next {
    right: 10px;
  }
}

@media (max-width: 680px) {
  .search-box {
    display: none;
  }
  .search-box.open {
    display: flex;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 16px;
    width: auto;
    z-index: 20;
  }
  #searchToggleBtn {
    display: grid;
  }
  .hero-card.side {
    display: none;
  }
  .hero-card.center {
    width: min(84vw, 280px);
    height: 375px;
  }
  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .pill-btn {
    padding: 8px 15px;
    font-size: 12.5px;
  }
  .form-grid,
  .form-grid.three-col {
    grid-template-columns: 1fr;
  }
  .modal-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-actions {
    justify-content: center;
  }
}
