/* ============================================================
   纸上对决 · 游戏页样式
   ============================================================ */

body.game {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #ded0b0;
  overflow-x: hidden;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(12px, 3vw, 28px);
}

.game-top h1 {
  font-family: var(--font-brush);
  font-size: clamp(20px, 3vw, 30px);
  margin: 0;
  letter-spacing: 0.06em;
}

.game-top .sub {
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.game-top .top-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn--mini { font-size: 13px; padding: 7px 11px; }

.btn.on {
  color: var(--ink);
  background: linear-gradient(170deg, rgba(232, 197, 104, 0.55), rgba(217, 164, 65, 0.35));
  border-color: rgba(179, 129, 42, 0.7);
}

.game-top a.back {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1.6px solid rgba(87, 78, 69, 0.45);
  border-radius: 10px 7px 11px 6px / 7px 10px 6px 9px;
  padding: 7px 13px;
  white-space: nowrap;
  transition: transform 0.2s ease, color 0.2s ease;
}
.game-top a.back:hover { transform: translateY(-2px) rotate(-0.6deg); color: var(--ink); }

.stage-wrap {
  position: relative;
  width: min(1000px, calc(100% - 24px));
  margin: 0 auto;
  aspect-ratio: 960 / 540;
  background: #f7f0de;
  border: 2px solid rgba(87, 78, 69, 0.55);
  border-radius: 14px 10px 16px 9px / 10px 15px 9px 14px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5) inset, 0 22px 44px -26px rgba(90, 70, 40, 0.8);
  overflow: hidden;
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
}

/* 覆盖层：标题 / 暂停 / 结算 */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: rgba(247, 240, 222, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.overlay.show { opacity: 1; pointer-events: auto; }

.overlay h2 {
  font-family: var(--font-brush);
  font-size: clamp(30px, 6vw, 56px);
  margin: 0;
  letter-spacing: 0.08em;
}

.overlay p {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-soft);
}

.ov-stats {
  display: flex;
  gap: clamp(16px, 5vw, 44px);
  margin: 12px 0 4px;
}

.ov-row { display: grid; justify-items: center; }
.ov-row b {
  font-family: var(--font-latin);
  font-size: 30px;
  color: var(--ink);
  line-height: 1;
}
.ov-row span {
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 3px;
}

.ov-btns { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* 操作提示 */
.hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-hand);
  font-size: 12.5px;
  color: var(--ink-soft);
  background: rgba(247, 240, 222, 0.82);
  border-radius: 10px;
  padding: 5px 12px;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 4;
}
.hint.fade { opacity: 0.28; }
.hint kbd {
  font-family: var(--font-latin);
  background: rgba(87, 78, 69, 0.12);
  border: 1px solid rgba(87, 78, 69, 0.3);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 3px;
}

/* 底部说明 */
.game-foot {
  text-align: center;
  padding: 14px 20px 30px;
  font-size: 13px;
  color: var(--ink-faint);
}
.game-foot .note { font-family: var(--font-hand); }

/* 触屏方向键：窄屏才显示 */
.touch {
  position: absolute;
  inset: auto 0 0 0;
  display: none;
  justify-content: space-between;
  padding: 10px 14px 14px;
  pointer-events: none;
  z-index: 3;
}
.touch .pad { display: flex; gap: 10px; pointer-events: auto; }
.touch button {
  width: 58px;
  height: 58px;
  border-radius: 50% 46% 52% 48% / 48% 52% 46% 52%;
  border: 2px solid rgba(87, 78, 69, 0.5);
  background: rgba(247, 240, 222, 0.85);
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--ink);
  touch-action: none;
}
.touch button.on { background: rgba(217, 164, 65, 0.5); }

@media (max-width: 820px), (pointer: coarse) {
  .touch { display: flex; }
  .hint { display: none; }
}

/* 夜间提灯模式也对游戏页生效 */
html.lamp-on body.game { background: #14110e; }
html.lamp-on .stage-wrap {
  border-color: rgba(203, 188, 160, 0.4);
  box-shadow: 0 2px 0 rgba(255, 240, 210, 0.06) inset, 0 22px 44px -26px rgba(0, 0, 0, 0.9);
}
html.lamp-on .overlay { background: rgba(36, 31, 26, 0.92); }
html.lamp-on .hint { background: rgba(36, 31, 26, 0.85); }
html.lamp-on .touch button { background: rgba(46, 39, 32, 0.9); color: var(--ink); }
