:root {
  --tel-blue: #00a9e2;
  --tel-blue-dark: #0077a8;
  --tel-green: #77bf1f;
  --tel-gray: #bcbcbc;
  --tel-text: #4a4a4a;
  --tel-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --hit: 0 0 0 0 rgba(119, 191, 31, 0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0b0b;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang TC", "Noto Sans TC",
    sans-serif;
  user-select: none;
  touch-action: manipulation;
  color: var(--tel-text);
}

img,
video {
  -webkit-user-drag: none;
}

#app {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.stage {
  position: relative;
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.page {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 280ms ease, transform 280ms ease;
}

.page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.page-portal {
  background-image: url("../assets/bg/portal.jpg");
  background-size: 100% 97%;
  background-position: center top;
  background-color: #bcbcbc;
}

.page-menu {
  background-image: url("../assets/bg/menu.jpg");
}

.page-products {
  background-image: url("../assets/bg/products.jpg");
}

.page-join {
  background-image: url("../assets/bg/join.jpg");
}

.page-about {
  background-image: url("../assets/bg/about.jpg");
}

.hotspot {
  position: absolute;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  border-radius: 18%;
}

.hotspot:active {
  transform: scale(0.96);
}

.hotspot-round {
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.info-dot {
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--tel-green);
  color: #fff;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 2.4vw, 32px);
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.debug .hotspot {
  outline: 2px solid rgba(255, 40, 40, 0.75);
  background: rgba(255, 40, 40, 0.18);
}

/* Portal: animated finger over entry art (no static finger in the JPG) */
.finger-cta {
  position: absolute;
  left: 50%;
  top: 68.4%;
  width: 10%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.finger-img {
  width: 100%;
  height: auto;
  display: block;
  animation: finger-tap 1.35s ease-in-out infinite;
  transform-origin: 50% 18%;
}

@keyframes finger-tap {
  0%,
  100% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(8%);
  }
  55% {
    transform: translateY(0);
  }
}

/* Modals */
.modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 20, 28, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 20;
  padding: 6% 5%;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-height: 100%;
  animation: pop-in 280ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes pop-in {
  from {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.pdf-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #061018;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--tel-shadow);
  display: grid;
  place-items: center;
}

.pdf-frame img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  touch-action: none;
  pointer-events: none;
}

.pdf-placeholder,
.pdf-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6%;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, #04344a 0%, #0a1c28 100%);
}

.pdf-placeholder[hidden],
.pdf-loading[hidden] {
  display: none;
}

.pdf-placeholder h2 {
  margin: 0;
}

.pdf-placeholder p {
  margin: 12px 0 0;
  opacity: 0.8;
  font-size: 15px;
  line-height: 1.5;
}

.pdf-loading {
  background: rgba(6, 16, 24, 0.72);
  font-size: 18px;
  letter-spacing: 0.06em;
}

.pdf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #222;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}

.pdf-nav:active {
  transform: translateY(-50%) scale(0.94);
}

.pdf-nav[hidden] {
  display: none;
}

.pdf-prev {
  left: 8px;
}

.pdf-next {
  right: 8px;
}

.pdf-nav svg {
  width: 16px;
  height: 16px;
}

.pdf-title,
.pdf-page {
  position: absolute;
  margin: 0;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.pdf-title {
  left: 12px;
  bottom: 10px;
  font-size: 14px;
}

.pdf-page {
  right: 12px;
  bottom: 10px;
  font-size: 14px;
}

.close-btn {
  position: absolute;
  top: -28px;
  right: -26px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #333;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
}

.close-btn:active {
  transform: scale(0.94);
}

.close-btn svg {
  width: 22px;
  height: 22px;
}
