/* 전체 페이지 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  overflow: hidden;
  height: 100vh;
  color: white;
}

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

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* UI 오버레이 */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

#ui-overlay > * {
  pointer-events: auto;
}

/* 게임 정보 */
#game-info {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  min-width: 200px;
}

#game-info div {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: bold;
}

#game-info div:last-child {
  margin-bottom: 0;
}

#instructions {
  margin-top: 15px;
  font-size: 12px !important;
  font-weight: normal !important;
  color: #ccc;
}

#instructions p {
  margin: 4px 0;
}

/* 시작 화면 */
#start-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 40px;
  border-radius: 20px;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

#start-screen h1 {
  font-size: 3em;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#start-screen p {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: #ddd;
}

/* 승리/완료 화면 */
#win-screen,
#game-over-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 20px;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  min-width: 350px;
}

#win-screen h2,
#game-over-screen h2 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

#win-screen h2 {
  color: #4ecdc4;
}

#game-over-screen h2 {
  background: linear-gradient(45deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#win-screen p,
#game-over-screen p {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #ddd;
}

/* 버튼 스타일 */
button {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  margin: 8px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  background: linear-gradient(45deg, #764ba2, #667eea);
}

button:active {
  transform: translateY(0);
}

#start-button {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  font-size: 18px;
  padding: 15px 30px;
}

#start-button:hover {
  background: linear-gradient(45deg, #ee5a24, #ff6b6b);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

#next-level-button {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

#next-level-button:hover {
  background: linear-gradient(45deg, #44a08d, #4ecdc4);
  box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

#restart-button,
#play-again-button {
  background: linear-gradient(45deg, #feca57, #ff9ff3);
}

#restart-button:hover,
#play-again-button:hover {
  background: linear-gradient(45deg, #ff9ff3, #feca57);
  box-shadow: 0 8px 25px rgba(254, 202, 87, 0.4);
}

/* 숨김 클래스 */
.hidden {
  display: none !important;
}

/* 타이머 강조 */
#timer {
  color: #4ecdc4;
}

#level {
  color: #feca57;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  #game-info {
    top: 10px;
    left: 10px;
    padding: 10px;
    min-width: 150px;
  }

  #game-info div {
    font-size: 14px;
  }

  #instructions {
    font-size: 11px !important;
  }

  #start-screen,
  #win-screen,
  #game-over-screen {
    padding: 30px 20px;
    min-width: 300px;
  }

  #start-screen h1 {
    font-size: 2.5em;
  }

  #win-screen h2,
  #game-over-screen h2 {
    font-size: 2em;
  }

  button {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* 로딩 애니메이션 */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.loading {
  animation: pulse 1s infinite;
}
