/* 기본 스타일 */

html, body {
  margin: 0;
  padding: 0;
  background-color: #202021;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  /* iOS Safe Area 지원 */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* 로딩 스크린 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #202021;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #ffffff;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  opacity: 0.8;
}

.video-container {
  position: relative;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;
}

video.bg-video,
img.image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

/* 비디오 네이티브 컨트롤 완전히 숨기기 */
video.bg-video {
  /* 컨트롤 비활성화 */
  -webkit-appearance: none;
  appearance: none;
}

video.bg-video::-webkit-media-controls {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  -webkit-appearance: none !important;
}

video.bg-video::-webkit-media-controls-enclosure {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

video.bg-video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

video.bg-video::-webkit-media-controls-play-button {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

video.bg-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

video.bg-video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

video.bg-video::-webkit-media-controls-overlay-enclosure {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 안드로이드 크롬 전용 */
video.bg-video::-webkit-media-controls-timeline {
  display: none !important;
}

video.bg-video::-webkit-media-controls-current-time-display {
  display: none !important;
}

video.bg-video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

video.bg-video::-webkit-media-controls-mute-button {
  display: none !important;
}

video.bg-video::-webkit-media-controls-volume-slider {
  display: none !important;
}

video.bg-video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* 조각 이미지들도 전체 화면 크기로 오버레이 */
img.image-piece {
  position: absolute;
  width: auto;
  height: 95%;
  object-fit: contain;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

img.overlay-image {
  position: absolute;
  z-index: 2;
  width: auto;
  height: 95%;
  object-fit: contain;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; /* 클릭 이벤트 통과 */
}

/* 버튼 컨테이너를 이미지와 동일하게 95% 크기로 중앙 정렬 */
.buttons-container {
  position: absolute;
  width: 95%;
  height: 95%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.clickable-area {
  position: absolute;
  z-index: 10;
  cursor: pointer;
  pointer-events: auto;
  /* 기본값은 JavaScript가 덮어씀 */
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

/* 반응형 스타일 - JavaScript가 모든 것을 처리하므로 미디어 쿼리 제거됨 */
