* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Malgun Gothic', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  position: relative;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  width: 800px;
  height: 600px;
}

/* 모바일에서는 전체 화면 사용 */
@media (max-width: 1200px) {
  body {
    background: #1a1a2e; /* 단색 배경으로 변경 */
    padding: 0;
    margin: 0;
  }

  #game-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

#gameCanvas {
  display: block;
  background: #1a1a2e;
  cursor: default; /* 키보드 조작이므로 커서 표시 */
  touch-action: none; /* 모바일 터치 제스처 방지 */
  -webkit-touch-callout: none; /* iOS 롱프레스 방지 */
  -webkit-user-select: none; /* 텍스트 선택 방지 */
  user-select: none;
}

#creditVideo {
  display: none;
  background: #000;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  object-fit: contain;
}

#skipButton {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#skipButton:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  transform: scale(1.05);
}

/* 게임 로딩 중 표시 */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  font-weight: bold;
}

/* 세로모드 안내 메시지 (기본 숨김) */
#rotate-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.rotate-content {
  text-align: center;
  color: white;
  padding: 40px;
}

.rotate-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: rotate-animation 2s ease-in-out infinite;
}

@keyframes rotate-animation {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(90deg);
  }
}

.rotate-content h2 {
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: bold;
}

.rotate-content p {
  font-size: 16px;
  opacity: 0.9;
}

/* 모바일 세로모드 - 게임 숨기고 안내 메시지 표시 */
@media (max-width: 850px) and (orientation: portrait) {
  #game-container {
    display: none;
  }

  #rotate-message {
    display: flex;
  }
}

/* 모바일 가로모드 - 게임 표시 */
@media (orientation: landscape) and (max-width: 1200px) {
  body {
    padding: 0;
    align-items: center;
  }

  #game-container {
    max-width: 100vw;
    max-height: 100vh;
  }

  #gameCanvas {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
  }

  #rotate-message {
    display: none;
  }
}

/* PC 환경에서는 가로모드 스타일 적용 안 함 */
@media (orientation: landscape) and (min-width: 1201px) {
  #rotate-message {
    display: none;
  }
}

/* PC 환경 (가로 큰 화면) */
@media (min-width: 851px) {
  #rotate-message {
    display: none;
  }
}
