* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #f3f5f8;
  color: #111827;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

.deck {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.slide-stage {
  width: min(100%, calc(100vh * 16 / 9 - 56px));
  max-width: calc(100vw - 56px);
  aspect-ratio: 16 / 9;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.slide-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
  user-select: none;
}

.controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.controls button {
  height: 36px;
  min-width: 36px;
  border: 0;
  border-radius: 999px;
  background: #1f4168;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.controls .print-btn {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.page-text {
  min-width: 58px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.print-slides {
  display: none;
}

@media (max-width: 700px) {
  .deck {
    padding: 10px;
  }

  .slide-stage {
    max-width: calc(100vw - 20px);
    width: calc(100vw - 20px);
  }

  .controls {
    bottom: 10px;
  }
}

@media print {
  @page {
    size: 16in 9in landscape;
    margin: 0;
  }

  html,
  body {
    width: 100%;
    height: auto;
    background: #fff;
    overflow: visible;
  }

  .deck,
  .controls {
    display: none !important;
  }

  .print-slides {
    display: block;
  }

  .print-slides img {
    display: block;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    page-break-after: always;
    break-after: page;
  }

  .print-slides img:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}
