/* Web 外壳：只负责全屏 Canvas 与平台原生文本输入弹窗，游戏画面全部由 Canvas 2D 绘制。 */
:root {
  --shell-bg: #fdf8f4;
  --shell-ink: #3d3131;
  --shell-muted: #8f7b78;
  --shell-rose: #c76a7b;
  --shell-rose-deep: #a94d61;
  --shell-card: #fffaf7;
  --shell-line: #eadad5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--shell-bg);
  color: var(--shell-ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

noscript {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-size: 15px;
  color: var(--shell-muted);
  text-align: center;
}

.native-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(36, 25, 28, 0.55);
  backdrop-filter: blur(3px);
  animation: shell-fade 0.18s ease-out;
}

.native-modal-card {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: var(--shell-card);
  box-shadow: 0 24px 60px rgba(60, 40, 36, 0.24);
  animation: shell-rise 0.22s ease-out;
}

.native-modal-title {
  margin-bottom: 10px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--shell-ink);
}

.native-modal-text,
.native-modal-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--shell-muted);
}

.native-modal-note {
  margin-top: 8px;
  font-size: 12px;
  color: #b8a5a2;
}

.native-input {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: #fffdfb;
  color: var(--shell-ink);
  font-size: 16px;
  outline: none;
}

.native-input:focus {
  border-color: var(--shell-rose);
  box-shadow: 0 0 0 3px rgba(199, 106, 123, 0.16);
}

.native-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.native-btn {
  flex: 1;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.native-btn:active {
  transform: scale(0.98);
}

.native-btn-primary {
  background: linear-gradient(135deg, #d07a8b, #b4576b);
  color: #fff;
  box-shadow: 0 10px 22px rgba(169, 77, 97, 0.24);
}

.native-btn-ghost {
  border-color: var(--shell-line);
  background: #fffdfb;
  color: var(--shell-muted);
}

@keyframes shell-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shell-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .native-modal,
  .native-modal-card {
    animation: none;
  }
}
