:root {
  --bg-deep: #0c0812;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 200, 140, 0.12);
  --gold: #e8b86d;
  --gold-light: #f5d9a8;
  --rose: #c45c7a;
  --rose-deep: #8b3a55;
  --text: #f4efe8;
  --text-muted: rgba(244, 239, 232, 0.65);
  --radius: 14px;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-read: "Lora", Georgia, serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.landing-anyclick {
  cursor: default;
}

body.landing-anyclick.landing-engaged {
  cursor: pointer;
}

body.landing-anyclick .legal-footer a,
body.landing-anyclick [data-register],
body.landing-anyclick .cliffhanger-cta,
body.landing-anyclick .top-pick-card {
  cursor: pointer;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196, 92, 122, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 30%, rgba(232, 184, 109, 0.15), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 70%, rgba(139, 58, 85, 0.2), transparent 50%);
}

.header,
.top-picks,
main,
.reader-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 520px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.logo-text {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Top picks bar */
.top-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.top-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.top-pick-card:active {
  transform: scale(0.97);
}

.top-pick-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.top-pick-title {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: var(--gold-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--rose) 0%, #a84862 50%, var(--gold) 120%);
  color: #fff;
  box-shadow: 0 8px 32px rgba(196, 92, 122, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--gold-light);
  border: 1.5px solid var(--border);
  padding: 10px 20px;
  font-size: 0.88rem;
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(232, 184, 109, 0.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-block {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.05rem;
}

.btn-next {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 8px 32px rgba(196, 92, 122, 0.45); }
  50% { box-shadow: 0 8px 48px rgba(232, 184, 109, 0.5); }
}

/* Reader */
.reader {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 22px 0;
  position: relative;
}

.book-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.book-cover-wrap {
  flex-shrink: 0;
  width: 112px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--border);
}

.book-cover {
  display: block;
  width: 112px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--bg-card);
}

.book-cover[hidden] {
  display: none;
}

.reader-meta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.genre-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  background: rgba(232, 184, 109, 0.1);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.book-title {
  font-family: var(--font-read);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.chapter-heading {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.chapter-body {
  font-family: var(--font-read);
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(244, 239, 232, 0.92);
  padding-bottom: 48px;
}

.chapter-body p {
  margin-bottom: 1.15em;
  text-indent: 0;
}

.chapter-body p:last-child {
  margin-bottom: 0;
}

.chapter-subheading {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
  margin: 1.75em 0 0.75em;
  line-height: 1.35;
}

.chapter-block:first-child .chapter-subheading {
  margin-top: 0;
}

.chapter-divider {
  border: none;
  height: 0;
  border-top: 1px solid rgba(232, 184, 109, 0.18);
  margin: 2rem 0;
}

.loading-line {
  color: var(--text-muted);
  font-style: italic;
}

.locked-note {
  margin-top: 1.25em;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(196, 92, 122, 0.12);
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-style: normal;
  line-height: 1.5;
}

.chapter-fade {
  position: relative;
  height: 80px;
  margin-top: -80px;
  background: linear-gradient(180deg, transparent, var(--bg-deep));
  pointer-events: none;
}

.unlock-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0 12px 24px;
}

.cliffhanger-cta {
  margin-top: 2rem;
  padding: 24px 20px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(165deg, rgba(196, 92, 122, 0.18), rgba(232, 184, 109, 0.08));
  border: 1px solid rgba(232, 184, 109, 0.28);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cliffhanger-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 10px;
}

.cliffhanger-title {
  font-family: var(--font-read);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text);
}

.cliffhanger-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.btn-cliffhanger {
  display: inline-flex;
  padding: 14px 28px;
  font-size: 1rem;
  pointer-events: none;
}

.engage-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(12, 8, 18, 0.92);
  border: 1px solid var(--border);
  color: var(--gold-light);
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.engage-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.age-badge {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 16px 0;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.78rem;
}

.legal-footer a {
  color: var(--gold);
  text-decoration: none;
}

.legal-footer a:hover {
  text-decoration: underline;
}

.legal-note {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.reader-footer {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 22px 24px;
  text-align: center;
}

.btn-another {
  width: 100%;
  max-width: 280px;
}

/* Sticky next chapter */
.sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, rgba(12, 8, 18, 0.95) 30%, rgba(12, 8, 18, 0.98));
  backdrop-filter: blur(12px);
}

.sticky-bar .btn-block {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
}

@media (min-width: 521px) {
  body {
    padding-bottom: calc(24px + var(--safe-bottom));
  }

  .sticky-bar {
    position: static;
    background: transparent;
    backdrop-filter: none;
    max-width: 520px;
    margin: 0 auto 32px;
    padding: 0 22px;
  }
}
