@font-face {
  font-family: "Poppins";
  src: url("https://fonts.gstatic.com/s/poppins/v24/pxiEyp8kv8JHgFVrJJbecnFHGPezSQ.woff2")
    format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f2ebdc;
  --ink: #2d251e;
  --accent: #810203;
  --paper: #fffdf9;
  --shadow: rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background: #810203;
}

.app {
  width: min(98vw, 1900px);
  margin: 0 auto;
  padding: 10px 10px 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.toolbar button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

.toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#pageInfo {
  min-width: 150px;
  text-align: center;
  font-weight: 600;
  color: #fff;
}

#pageInfo.loading {
  color: #fff;
}

.book-shell {
  width: 100%;
  display: flex;
  justify-content: center;
  perspective: 2200px;
}

.flipbook {
  width: min(97vw, 1800px);
  height: 82vh;
  margin: 0 auto;
  box-shadow: 0 20px 40px var(--shadow);
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}

.page {
  background: transparent;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--paper);
}

.hidden {
  display: none !important;
}

.mobile-hint {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.mobile-hint-card {
  width: min(92vw, 360px);
  background: #fff;
  color: #1b1b1b;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.mobile-hint-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.mobile-hint-card p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
}

.mobile-hint-card button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .flipbook {
    width: 96vw;
    height: 80vh;
  }
}

@media (max-width: 700px) {
  .toolbar {
    gap: 8px;
  }

  #pageInfo {
    min-width: 120px;
    font-size: 14px;
  }

  .toolbar button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .flipbook {
    width: 96vw;
    height: 74vh;
  }
}
