/* 像素大陆编年史 - 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Courier New', monospace;
  /* 防止iOS橡皮筋效果 */
  position: fixed;
  top: 0;
  left: 0;
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  /* 居中定位 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 加载界面 */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #ffd700;
  font-size: 24px;
  text-align: center;
}

#loading.hidden {
  display: none;
}

.loading-text {
  margin-top: 20px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 隐藏的音频解锁提示 */
#audioUnlock {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 20px 40px;
  border-radius: 10px;
  z-index: 10000;
  display: none;
  text-align: center;
}

#audioUnlock.show {
  display: block;
}

#audioUnlock button {
  margin-top: 15px;
  padding: 12px 30px;
  font-size: 18px;
  background: #ffd700;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  min-width: 120px;
  min-height: 44px;
}

/* 安全区域适配（刘海屏等） */
@supports (padding: env(safe-area-inset-top)) {
  #loading {
    padding-top: env(safe-area-inset-top);
  }
}
