body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
  box-sizing: border-box;
  background: radial-gradient(circle at center, #1a1a1a 0%, #665c5c 70%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scene {
  width: min(90vw, 1100px);
  aspect-ratio: 7 / 5;
  height: auto;
  position: relative;
}

.scene.landscape {
  width: min(90vw, 1100px);
  aspect-ratio: 7 / 5;
}

.scene.portrait {
  width: min(90vw, 562px);
  aspect-ratio: 5 / 7;
}

.book {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 15px;
  box-shadow: 0 16px 14px -5px rgba(0, 0, 0, 0.65);
}

.page {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  overflow: hidden;
  background: #000;
  transition: opacity 0.6s ease;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  color: #ff0000;
  text-align: center;
}

.page.error {
  visibility: hidden;
}

.open-controls {
  position: relative;
  margin-top: 20px;
  width: 100%;
  display: none;  /* Initial state remains none until pages load */
  justify-content: center;
  z-index: 9999;
}

.controls {
  position: relative;
  margin-top: 20px;      
  width: 100%;
  display: none; /* Initial state remains none until card opens */
  justify-content: space-between; /* Pushes groups to the far left and right */
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

@media (min-width: 768px) {
  .controls {
    flex-direction: row;
  }
}    

.button-group {
  display: flex;
  margin-bottom: 20px;
  gap: 14px;  
}

button {
  padding: 10px 22px;
  font-size: 0.875rem; /* 14px */
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #111;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.75);
  transition: background 0.25s ease, transform 0.15s ease;
  white-space: nowrap;
}

button:hover {
  background: rgba(255,255,255,1);
  transform: translateY(-1px);
}

select {
  padding: 10px 15px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  backdrop-filter: blur(6px);
  font-family: inherit;
}