@font-face {
  font-family: 'CookieRun-Regular';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/CookieRun-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* 접근성을 위한 숨김 스타일 */
.a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  padding: 0;
  margin: -1px;
}

/* 디버그 패널 스타일 */
#debug-panel {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 300px;
  background: rgba(0, 0, 0, 0.9);
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 10px;
  border: 1px solid #0f0;
  border-radius: 5px;
  z-index: 10000;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

#debug-panel h3 {
  margin: 0 0 10px 0;
  color: #0f0;
  font-size: 14px;
  border-bottom: 1px solid #0f0;
  padding-bottom: 5px;
  text-align: center;
}

#debug-panel .debug-item {
  margin: 5px 0;
  display: flex;
  justify-content: space-between;
}

#debug-panel .debug-label {
  color: #0a0;
  font-weight: bold;
}

#debug-panel .debug-value {
  color: #0f0;
}

#debug-panel .debug-value.warning {
  color: #ff0;
}

#debug-panel .debug-value.danger {
  color: #f00;
}

#debug-panel .debug-value.success {
  color: #0f0;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  background: #fff;
  font-family: 'CookieRun-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: 20px;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
    height: 100vh;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0;
  }
}

.gameWrapper {
  max-width: 600px;
  margin: 0 auto;
}

.gameArea {
  display: none;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.gameArea.show {
  display: flex;
}

@media (max-width: 768px) {
  .gameArea {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
}

.gameCanvas {
  background: #ffffff;
  cursor: pointer;
  max-width: 600px;
  width: auto;
  height: auto;
  aspect-ratio: 600 / 850;
  object-fit: contain;
  display: block;
  font-family: 'CookieRun-Regular', -apple-system, BlinkMacSystemFont, sans-serif;
  max-height: calc(100vh - 40px);
}

@media (max-width: 768px) {
  .gameCanvas {
    max-height: calc(100vh - 20px);
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* 스플래시 화면 스타일 */
.splashScreen {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  cursor: pointer;
  z-index: 10;
  padding-top: 80px;
}

@media (max-width: 768px) {
  .splashScreen {
    padding-top: 20px;
  }
}

.splashContent {
  text-align: center;
}

.splashLogo {
  max-width: 520px;
  width: 104%;
  height: auto;
  margin-bottom: 30px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .splashLogo {
    width: 90%;
    max-width: none;
  }
}

.splashText {
  color: #333333;
  font-size: 24px;
  font-weight: 500;
  pointer-events: none;
}

.closeButton {
  position: fixed;
  z-index: 200;
  bottom: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: auto;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.closeButton:hover,
.closeButton:active {
  background: rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
  .closeButton.show {
    display: flex;
  }
}

/* 화면 상태별 표시/숨김 */
.splashScreen.hidden {
  display: none;
}