* {
  box-sizing: border-box;
}

:root {
  --pink: #dc6c52;
  --pink-dark: #a94e3b;

  --nav: #e88772;
  --nav-dark: #b95f4d;

  --cream: #f3e4cf;
  --cream-light: #fff8ee;

  --green: #9fb58a;
  --green-dark: #76895f;

  --yellow: #f2cf72;
  --yellow-dark: #c49b3f;

  --blue: #384cc5;
  --blue-dark: #26358f;

  --text: #352315;
  --shadow: rgba(52, 35, 21, 0.18);
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top right,
      rgba(242, 207, 114, 0.25) 0,
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #fff8ee,
      #f3e4cf
    );
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 10px;
}

.book-shell {
  width: min(1280px, 100%);
  height: min(720px, calc(100vh - 20px));
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 64px;
  gap: 10px;
  padding: 14px;
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: 30px;
  background: rgba(255, 248, 238, 0.86);
  box-shadow: 0 24px 60px var(--shadow);
}

.book-topbar {
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 22px;
  background: var(--cream);
}

.top-btn,
.logo-pill,
.nav-btn,
.sound-btn {
  border: none;
  outline: none;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.14s ease,
    filter 0.14s ease,
    box-shadow 0.14s ease;
}

.top-btn,
.logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--nav);
  box-shadow: 0 5px 0 var(--nav-dark);
  font-size: 15px;
  text-align: center;
}

.page-status {
  display: grid;
  justify-items: center;
  gap: 7px;
  font-size: 17px;
}

.progress-track {
  width: min(420px, 100%);
  height: 13px;
  overflow: hidden;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #ead9f7;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--blue),
    var(--yellow)
  );
}

.pag1-progress {
  width: 6.25%;
}

.pag2-progress {
  width: 12.5%;
}

.pag3-progress {
  width: 18.75%;
}

.pag4-progress {
  width: 25%;
}

.pag5-progress {
  width: 31.25%;
}

.pag6-progress {
  width: 37.5%;
}

.pag7-progress {
  width: 43.75%;
}

.pag8-progress {
  width: 50%;
}

.pag9-progress {
  width: 56.25%;
}

.pag10-progress {
  width: 62.5%;
}

.pag11-progress {
  width: 68.75%;
}

.pag12-progress {
  width: 75%;
}

.pag13-progress {
  width: 81.25%;
}

.pag14-progress {
  width: 87.5%;
}

.pag15-progress {
  width: 93.75%;
}

.pag16-progress {
  width: 100%;
}

.book-main {
  display: grid;
  grid-template-columns: 65% 35%;
  gap: 14px;
  min-height: 0;
}

.stage-area,
.text-panel {
  min-height: 0;
  overflow: hidden;
  border: 5px solid #ffffff;
  border-radius: 28px;
  box-shadow: 0 14px 35px rgba(97, 44, 89, 0.18);
}
.stage-area {
  position: relative;
  display: grid;
  place-items: center;
  background: #f3e5cf;
}

.scene-box {
  position: relative;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  .scene-box {
  background: #f3e5cf;
}
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.personagem {
  position: absolute;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.morcego-pag1 {
  left: 27%;
  top: 4%;
  z-index: 10;
  width: 25%;
  transform-origin: center;
  animation: morcegoVoa 2.8s ease-in-out infinite;
}

.text-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(
    180deg,
    var(--cream-light),
    #f5e6d0
  );
}

.story-card {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 0;
  padding: 18px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
}

.story-card p {
  margin: 0;
  font-family: "Nunito", Arial, Helvetica, sans-serif;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sound-buttons {
  display: grid;
  gap: 10px;
}

.sound-btn {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 17px;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.story-btn {
  background: var(--pink);
  box-shadow: 0 5px 0 var(--pink-dark);
}

.music-btn {
  color: #5b3b17;
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--yellow-dark);
}

.play-btn {
  background: var(--green);
  box-shadow: 0 5px 0 var(--green-dark);
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 22px;
  background: var(--cream);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 18px;
  color: #ffffff;
  background: var(--nav);
  box-shadow: 0 5px 0 var(--nav-dark);
  font-size: 16px;
}

.sound-btn:hover,
.nav-btn:hover,
.top-btn:hover,
.logo-pill:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.07);
}

.sound-btn:active,
.nav-btn:active,
.top-btn:active,
.logo-pill:active {
  transform: translateY(4px) scale(0.96);
  filter: brightness(0.95);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.sound-btn.is-playing {
  animation: botaoTocando 0.9s ease-in-out infinite;
}

.morcego-pag1.brincando {
  animation: morcegoBrinca 0.9s ease-in-out;
}

@keyframes botaoTocando {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.04);
    filter: brightness(1.12);
  }
}

@keyframes morcegoVoa {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}

@keyframes morcegoBrinca {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  35% {
    transform: translate(35px, -18px) rotate(7deg) scale(1.08);
  }

  70% {
    transform: translate(-15px, 8px) rotate(-5deg) scale(0.98);
  }

  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .book-shell {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto;
    padding: 12px;
    border-radius: 24px;
  }

  .book-topbar {
    grid-template-columns: 1fr;
  }

  .book-main {
    grid-template-columns: 1fr;
  }

  .stage-area {
    aspect-ratio: 1 / 1;
  }

  .scene-box {
    width: 100%;
    height: auto;
  }

  .text-panel {
    min-height: 360px;
  }

  .book-footer {
    flex-direction: column;
  }

  .nav-btn {
    width: 100%;
  }
}
/* Fundo padrão de todas as páginas do livro */
.scene-box {
  background: #f3e5cf !important;
  background-color: #f3e5cf !important;
}