* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, Arial, sans-serif;
  color: #fff;
  overflow: hidden;

  background-image: url("assets/desk.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hidden { display: none !important; }

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.scene {
  width: min(1200px, 94vw);
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;

  background-image: url("assets/book.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border-radius: 12px;
  outline: 1px solid rgba(255,255,255,0.08);
}

.full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* Inner paper area */
.pageFrame {
  position: absolute;
  inset: 9% 10% 16% 10%;
  overflow: hidden;
}

/* Current GIF */
.page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;

  object-fit: contain;
  object-position: center 40%;
  user-select: none;
  pointer-events: none;

  z-index: 1;
}

/* FX canvas above */
.fxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

/* UI badges */
.hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 14px;
  opacity: 0.9;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  user-select: none;
  pointer-events: none;
}

.hint--page { bottom: 14px; }

.pageNumber {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-weight: 800;
  font-size: 14px;
  opacity: 0.9;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  user-select: none;
  pointer-events: none;
}

.pagePop {
  animation: pagePop 220ms ease-out;
}
@keyframes pagePop {
  from { opacity: 0.7; transform: scale(0.995); }
  to   { opacity: 1; transform: scale(1); }
}
