html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* overflow: hidden; */
  background-color: #000;
}

html {
  -ms-touch-action: none;
}

body,
div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}



body {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  top: 0;
  left: 0;
}





#swipe {
  width: 100%;
  height: 200%;
  position: relative;
  z-index: -1;
  display: none;
  /* pointer-events: none; */
}

.swipe {
  height: 100%;
  z-index: 12;
  background-color: #000;
  opacity: 0.5;
  color: #fff;
  position: relative;
  pointer-events: none;
}

.fullscreen-icon {
  position: fixed;
  z-index: 11;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 90px;
  height: 179px;
  background-image: url(./public/swipe-up.png);
  animation: fullscreen-spin 1.6s linear infinite;
  pointer-events: none;
}

@keyframes fullscreen-spin {
  from {
    opacity: 0.4;
    margin-top: 0px;
  }
  50% {
    opacity: 0.9;
    margin-top: 20px;
  }
  to {
    opacity: 0.4;
    margin-top: 0px;
  }
}



#GameDiv {
  position: relative;
  z-index: 10;
  /* height: 100% !important;
  width: 100% !important; */
  /* margin: 0 !important; */
}

/* #GameWrapper.desktop {
  position: fixed;
  z-index: 10;
  box-shadow: 0px 0px 8px #000;
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
}


#GameWrapper.desktopP {
  position: fixed;
  z-index: 10;
  box-shadow: 0px 0px 8px #000;
  overflow: hidden;
  width: auto;
  height: 100%;
  aspect-ratio: 9/16;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
} */


#GameWrapper.mobile {
  position: fixed;
  z-index: 10;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}


#orientation {
  position: fixed;
  z-index: 1002;
  display: none;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}

#orientation .icon {
  position: fixed;
  z-index: 1001;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 50%;
  aspect-ratio: 1/1;
  max-width: 500px;
  background-size: cover;
  background-image: url(./public/landscape.png);
  /* animation: rotateAnimation 2s linear infinite; */
}

#orientation .icon.portrait {
  width: 36%;
  transform: translateX(-50%) translateY(-50%) rotate(-90deg);
}

/* 當 body 帶有 scrolling 類名時，強制允許捲動 */
body.enable-scroll {
    touch-action: pan-y !important;
    overflow-y: auto !important;
    height: 2000px !important;
}

body.enable-scroll #GameWrapper {
    pointer-events: none !important; /* 讓點擊穿透到 body */
}

/* 只有在引導時，確保 body 真的有高度 */
.showing-swipe body {
    height: 200vh !important;
    overflow: auto !important;
}

/* 遊戲容器在引導時建議先隱藏或設為 pointer-events: none */
#GameWrapper.is-guiding {
    pointer-events: none; 
    opacity: 0; /* 或者 display: none */
}