/* ========== 전역 ========== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;              /* 화면 스크롤 방지 */
  overscroll-behavior: none;
}

/* ========== (옵션) unity-viewport 래퍼 ========== */
/* 만약 HTML에 <div id="unity-viewport">로 한 번 더 감싸놨다면 이렇게 두고,
   없다면 이 블록은 있어도 영향 거의 없음 */
#unity-viewport {
  position: fixed;
  inset: 0;                      /* top:0; right:0; bottom:0; left:0; */
  width: 100vw;
  height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* 예전 vvh/vvw, vvTop/vvLeft 기반 transform은 제거 */
  transform: none;
}

/* ========== 유니티 컨테이너/캔버스 ========== */
/* 컨테이너는 “가운데 배치”만 담당, 실제 크기(width/height)는 JS에서 설정 */
#unity-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 데스크톱용 클래스: 예전과 호환 차원에서 유지 */
#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 모바일용 클래스: 크기는 여전히 JS에서만 설정하도록 둔다 */
#unity-container.unity-mobile {
  position: absolute;
}

/* 캔버스는 컨테이너를 100% 채우기만 함 */
#unity-canvas {
  background: #231F20;
  width: 100%;
  height: 100%;
  /* max-width/max-height 제거: 100vw/100vh 해석이 브라우저마다 달라서 문제 유발 */
  max-width: none;
  max-height: none;
  border: 0;
  box-sizing: border-box;
}

/* unity-mobile 컨텍스트에서도 동일하게 컨테이너 100% 채우기 */
.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
}

/* ========== 로딩/배너 등 기존 스타일 ========== */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#unity-logo {
  display: block;
  height: 34vw;
  max-height: 146px;
  aspect-ratio: 4.1714;
  background: url('unity-logo-dark.png') no-repeat center;
  background-size: contain;
  margin: 40px;
}

#unity-progress-bar-empty {
  width: 300px; height: 24px; margin: 0 auto;
  background: url('progress-bar-empty-dark.png') no-repeat center;
  background-size: 100% 100%;
  position: relative; overflow: hidden; box-sizing: border-box;
}
#unity-progress-bar-full {
  position: absolute; left: 0; top: 0;
  width: 0%; height: 100%;
  background: url('progress-bar-full-dark.png') no-repeat left center;
  background-size: 100% 100%;
  transition: width 0.2s;
  box-sizing: border-box;
}

#unity-footer { position: relative; }
.unity-mobile #unity-footer { display: none; }

#unity-webgl-logo {
  float:left; width: 204px; height: 38px;
  background: url('webgl-logo.png') no-repeat center;
}
#unity-build-title {
  float: right; margin-right: 10px;
  line-height: 38px; font-family: arial; font-size: 18px;
}
#unity-fullscreen-button {
  cursor:pointer;
  float: right; width: 38px; height: 38px;
  background: url('fullscreen-button.png') no-repeat center;
}
#unity-warning {
  position: absolute; left: 50%; top: 5%;
  transform: translate(-50%);
  background: white; padding: 10px; display: none;
}

/* 로딩 도트 애니메이션 */
#loading-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 30px;
  margin: 0;
  --bar-duration: 0.7s;
  --wave-duration: 0.5s;
  --end-delay: 0.2s;
}
#loading-dots div {
  background-color: #fff;
  width: 6px;
  height: 24px;
  margin: 0 4.5px;
  border-radius: 3px;
  transform-origin: center;
  animation-name: scale-up-down;
  animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  animation-iteration-count: infinite;
  animation-duration: calc(var(--bar-duration) + var(--wave-duration) + var(--end-delay));
}
#loading-dots div:nth-child(1) { animation-delay: 0s; }
#loading-dots div:nth-child(2) { animation-delay: calc(var(--wave-duration) / 3); }
#loading-dots div:nth-child(3) { animation-delay: calc(var(--wave-duration) / 3 * 2); }
#loading-dots div:nth-child(4) { animation-delay: var(--wave-duration); }

@keyframes scale-up-down {
  0%, 25%, 100% { transform: scaleY(1); }
  12.5% { transform: scaleY(1.5); }
}

/* 스플래시 */
#splash-screen {
  position: fixed; 
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: white;
  display: flex; justify-content: center; align-items: center;
  z-index: 9999;
}
.logo {
  display: flex; justify-content: center; align-items: center;
  width: clamp(200px, 40vh, 350px);
  object-fit: contain; 
}
#myinfo-popup input,
  #login-popup input,
  #signup-popup input {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 1 !important;
    z-index: auto !important;
    pointer-events: auto !important;
  }