* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #eaf3ea;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

/* 舞台：伪横屏时由 JS 旋转 90°，画布和所有 UI 都相对它定位 */
#app {
  position: fixed;
  left: 50%; top: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  overflow: hidden;
  background: #0c1210;
}

#game {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
}
#bgm { display: none; }

/* ---------- 遮罩层 ---------- */
.overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 12, 10, .78);
  z-index: 20;
  padding: 12px;
}
.overlay.hidden { display: none; }

.panel {
  width: 380px;
  width: min(380px, 88%);
  max-height: 96%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #1d2a24, #141d19);
  border: 1px solid #2f4438;
  border-radius: 18px;
  padding: 18px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 2px;
  color: #8fe08a;
  text-shadow: 0 2px 0 #1b2a20;
}
h1.win { color: #9fe8a0; }
h1.lose { color: #ef7d74; }

.sub { margin: 0 0 12px; color: #8fa89b; font-size: 13px; }

.hint {
  list-style: none; padding: 0; margin: 0 0 14px;
  text-align: left; font-size: 12px; color: #b7c9bd; line-height: 1.75;
}
.hint li::before { content: "· "; color: #6fd06a; }

.info { font-size: 15px; line-height: 1.9; color: #cfe3d4; margin: 10px 0 20px; }

.btn {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  color: #10201a;
  background: linear-gradient(180deg, #9fe89a, #61c463);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); filter: brightness(.95); }

/* ---------- 通用次要按钮（暂停页等） ---------- */
.btn.btn-ghost {
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #b7c9bd;
  background: transparent;
  border: 1px solid #3d5546;
}
.btn.btn-ghost:active { background: #1d2e25; }

/* ---------- 主界面在 menu.css / menu-bg.png / start-btn.webp ---------- */

/* ---------- 角色入口 / 选角界面在自己的一对文件里 ----------
 * chars.js / char-select.js / char-select.css
 * 原来的三张角色卡样式已随开始页改版移除。
 */

/* ---------- 宝箱被动卡 ---------- */
.card.card-passive {
  border-color: #8a6a2f;
  background: linear-gradient(180deg, #33291a, #221b12);
}
.card.card-passive .cname { color: #ffd98a; }

/* ---------- 结算 ---------- */
.newrec { color: #ffd98a; font-weight: 700; }
.dim { color: #8fa89b; font-size: 13px; }

/* ---------- 暂停 / 新手提示 ---------- */
#pause { z-index: 25; }
#hint { z-index: 30; }
.hint-title { font-size: 24px; }
#hint .hint-big {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 18px;
}
#hint .hint-big b { color: #c9f3a8; }
#pause .btn + .btn, #over .btn + .btn { margin-top: 10px; }

/* 伪横屏的舞台高度是竖屏视口宽度，弹窗内容要再紧凑一点 */
body.fake-landscape #hint .hint-big { font-size: 12px; line-height: 1.55; margin-bottom: 10px; }
body.fake-landscape #pause .panel { max-height: 92%; }


/* ---------- 升级三选一 ---------- */
.levelup {
  width: 720px;
  width: min(720px, 96vw);
  text-align: center;
}
.ltitle {
  font-size: 20px;
  color: #ffd98a;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: linear-gradient(180deg, #22332b, #18241e);
  border: 1px solid #37503f;
  border-radius: 14px;
  padding: 18px 12px;
  cursor: pointer;
  min-height: 116px;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.card:active { transform: scale(.98); border-color: #6fd06a; }
.cname { font-size: 17px; font-weight: 700; color: #a8ec9f; }
.cdesc { font-size: 13px; color: #c5d8ca; line-height: 1.5; }
.clv { font-size: 11px; color: #6f8a78; }

/* ---------- 伪横屏（舞台已被 JS 旋转 90°，这里是横屏比例下的排版） ---------- */
body.fake-landscape .panel {
  width: 620px;
  width: min(620px, 86%);
  max-height: 92%;
  padding: 12px 20px 14px;
  border-radius: 14px;
}
body.fake-landscape h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
body.fake-landscape .sub { font-size: 12px; margin-bottom: 8px; }
body.fake-landscape .hint {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 10px;
}
body.fake-landscape .btn { padding: 11px; font-size: 15px; }

/* 旋转后媒体查询仍按竖屏视口宽度判定，必须纠正三选一布局 */
body.fake-landscape .levelup { width: 680px; width: min(680px, 92%); }
body.fake-landscape .cards {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px;
}
body.fake-landscape .card {
  min-height: 0;
  padding: 12px 10px;
  gap: 5px;
}
body.fake-landscape .ltitle { font-size: 16px; margin-bottom: 10px; }
body.fake-landscape .cname { font-size: 15px; }
body.fake-landscape .cdesc { font-size: 12px; }
