body {
  margin: 0;
  height: 100vh;

  /* 🎨 Clean table-like background */
  /* background: linear-gradient(135deg, #5a5a5a, #1f1f1f); */
  background: url(images/wooden-bg.jpeg) no-repeat center;
  background-size: cover;
  
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Loader */
/* .loader {
  position: absolute;
  color: #fff;
  font-size: 18px;
  letter-spacing: 1px;
} */
.loader {
  position: fixed;
  inset: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(0,0,0,0.25);

  z-index: 9999;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spinner {
  width: 50px;
  height: 50px;

  border: 4px solid rgba(255,255,255,0.2);
  border-top: 4px solid #ffffff;

  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

.loader-text {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Wrapper */
#book-wrapper {
  display: none;
  perspective: 2500px;

  /* width: 85vw;
  height: 90vh; */

  width: 80%;
  /* height: 100dvh; */
  min-height: 600px;

  padding: 10px 0;
  box-sizing: border-box;

  justify-content: center;
  align-items: center;
}

/* 📖 BOOK */
#flipbook {
  width: 100%;
  height: 100%;

  /* max-width: 1400px;
  max-height: calc(100dvh - 90px); */

  border-radius: 5px;
  border: 0px;

  background: #f5f5f5;

  /* . Clean realistic shadow */
  box-shadow:
    0 25px 70px rgba(0,0,0,0.7),
    0 10px 20px rgba(0,0,0,0.4),
    inset 0 0 8px rgba(0,0,0,0.25);
}
/* .hard {
  background: rgba(255,255,255,0.15);

  box-shadow:
    inset 0 0 15px rgba(255,255,255,0.1);

  border: none;
} */

/* 📄 Pages */
.page {
  background: #ffffff;
  border: 1px solid #e2e2e2;

  box-shadow:
    inset 0 0 6px rgba(0,0,0,0.12);
}

/* 🖼️ Image */
.page img {
  width: 100%;
  height: 100%;

  object-fit: contain;   /* . no crop */
  background: white;
}
.page:first-child {
  background: #ffffff;

  box-shadow:
    inset 0 0 6px rgba(0,0,0,0.12);
}
/* 📚 Spine effect (center fold) */
.page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;

  background: linear-gradient(to right, rgba(0,0,0,0.18), transparent);
  z-index: 2;
}

.book-controls {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;

  display: flex;
  justify-content: center;
  gap: 15px;

  z-index: 999;
}

.book-controls button {
  border: none;
  outline: none;

  padding: 12px 22px;

  font-size: 15px;
  font-weight: 500;

  border-radius: 12px;

  background: rgba(0,0,0,0.75);
  color: white;

  backdrop-filter: blur(6px);

  cursor: pointer;

  transition: 0.25s;
}

.book-controls button:active {
  transform: scale(0.95);
}

.book-controls button:hover {
  background: rgba(0,0,0,0.9);
}

/* @media (orientation: landscape) and (max-height: 500px) {

  #book-wrapper {
    padding-top: 5px;
    padding-bottom: 70px;
  }

  .book-controls {
    bottom: 8px;
  }

  .book-controls button {
    padding: 6px 10px;
    font-size: 14px;
  }
} */

@media screen and (max-width: 767px) {
  #book-wrapper {
    min-height: 500px;
  }
  .book-controls button {
    padding: 6px 10px;
    font-size: 14px;
  }
}
