/* ═══ book.css — Secret Door storybook (physical two-page-spread book) ═══ */

#scene-secret { overflow: hidden; }
.book-stage { perspective: 2000px; margin: 1vh 0 2.5vh; }

.book {
  position: relative;
  width: min(880px, 92vw);
  aspect-ratio: 10 / 6.3;
  margin: 0 auto;
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.6));
}

/* page-block edge visible when the book is closed */
.book-edge {
  position: absolute; left: 0; top: 1%; bottom: 1%; width: 50%;
  border-radius: 14px 3px 3px 14px;
  background:
    repeating-linear-gradient(90deg, #191017 0 2px, #241a20 2px 4px, #150e14 4px 5px),
    linear-gradient(100deg, #1c121a, #120b10);
  border: 1px solid rgba(236,121,187,.22);
  box-shadow: inset -14px 0 22px rgba(0,0,0,.55);
}

/* each leaf = one physical sheet; front = right-hand page, back = left-hand page */
.leaf {
  position: absolute; top: 0; left: 50%;
  width: 50%; height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform .85s cubic-bezier(.5,.06,.18,1);
  will-change: transform;
}
.leaf.turned { transform: rotateY(-178deg); }
.leaf.turning { z-index: 500 !important; }

.face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.face.front {
  border-radius: 4px 14px 14px 4px;
  /* generous margin near the spine (left edge of a right-hand page) */
  padding: 6% 9% 6% 12%;
  box-shadow: inset 12px 0 20px -12px rgba(0,0,0,.7);
}
.face.back {
  transform: rotateY(180deg);
  border-radius: 14px 4px 4px 14px;
  /* generous margin near the spine (right edge of a left-hand page) */
  padding: 6% 12% 6% 9%;
  box-shadow: inset -12px 0 20px -12px rgba(0,0,0,.7);
}

/* ── interior: elegant near-black with subtle plum undertone ── */
.face.interior {
  background:
    radial-gradient(130% 90% at 50% -10%, rgba(60,32,52,.35), transparent 60%),
    linear-gradient(100deg, #171018 0%, #120c15 55%, #0e0910 100%);
  border: 1px solid rgba(236,121,187,.20);
}
.face.decor {
  background:
    radial-gradient(100% 80% at 50% 50%, rgba(70,36,60,.25), transparent 70%),
    linear-gradient(100deg, #150e16, #100a12);
  border: 1px solid rgba(236,121,187,.16);
}

/* ── cover: keeps the approved richer burgundy direction ── */
.face.cover {
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(236,121,187,.14), transparent 55%),
    linear-gradient(100deg, #33182d 0%, #241020 48%, #180b16 100%);
  border: 1px solid rgba(236,121,187,.45);
  box-shadow: inset 0 0 0 6px rgba(236,121,187,.10), inset 0 0 0 8px rgba(236,121,187,.28),
              inset 12px 0 20px -12px rgba(0,0,0,.6);
}
.face.cover::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px solid rgba(255,182,217,.30); border-radius: 10px;
  pointer-events: none;
}

/* ── page content ── */
.bp-watermark {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.bp-watermark svg { width: 72%; height: 88%; opacity: .08; }
.bp-body {
  position: relative; z-index: 2; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px;
}
.bp-kicker {
  font-family: var(--font-ui); font-size: .62rem; letter-spacing: .3em;
  text-transform: uppercase; color: #c994ae; opacity: .85;
}
.bp-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  color: #f0b9d3;                    /* brighter soft pink for headings */
  text-shadow: 0 0 16px rgba(236,121,187,.25);
  margin: 0; line-height: 1.3;
}
.face.cover .bp-title { font-size: clamp(1.2rem, 3.2vw, 1.9rem); }
.bp-text {
  font-family: var(--font-body);
  font-size: clamp(.74rem, 1.55vw, 1rem);
  line-height: 1.8; color: #ecd3e0;   /* calm dusty pink, gentle on the eyes */
  max-width: 36ch; margin: 0;
}
.bp-rule {
  width: 46px; height: 1px; border: none;
  background: linear-gradient(90deg, transparent, rgba(236,121,187,.55), transparent);
}
.bp-corner {
  position: absolute; right: 8%; bottom: 7%; width: 26px; height: 26px;
  opacity: .4; pointer-events: none; z-index: 2;
}
/* decorative blank pages: centered ornament only, no story text */
.decor-ornament { width: 46%; opacity: .16; }

/* ── controls ── */
.book-controls {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(10px, 2.4vw, 22px); flex-wrap: wrap;
}
.btn-ghost {
  appearance: none;
  background: rgba(36,16,32,.7); color: var(--baby-pink);
  border: 1px solid rgba(236,121,187,.45);
  border-radius: 999px; padding: 10px 22px;
  font-size: .9rem; letter-spacing: .03em;
  transition: box-shadow .2s ease, transform .15s ease, opacity .2s;
}
.btn-ghost:hover:not(:disabled) { box-shadow: 0 0 18px rgba(236,121,187,.5); transform: translateY(-1px); }
.btn-ghost:disabled { opacity: .35; cursor: default; }
#book-open { display: none; }
#book-open.show { display: inline-block; }
.book-progress { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 110px; }
#book-dots { display: flex; gap: 7px; }
#book-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(249,234,243,.22); transition: background .25s ease, box-shadow .25s ease;
}
#book-dots i.active { background: var(--soft-pink); box-shadow: 0 0 10px rgba(236,121,187,.9); }
#book-label {
  font-family: var(--font-ui); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(249,234,243,.6);
}

/* ── responsive: keep the two-page spread on mobile ── */
@media (max-width: 600px) {
  .book { width: 94vw; }
  .face.front { padding: 5% 6% 5% 10%; }
  .face.back  { padding: 5% 10% 5% 6%; }
  .bp-body { gap: 8px; }
  .bp-kicker { font-size: .52rem; letter-spacing: .22em; }
  .bp-text { font-size: clamp(.68rem, 2.6vw, .8rem); line-height: 1.65; max-width: 30ch; }
  .bp-corner { width: 18px; height: 18px; }
  .btn-ghost { padding: 8px 14px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .leaf { transition: none; }
}
