/* ===========================================================
   游戏页外壳：顶栏 / 舞台 / 结算层 / 说明与推荐
   =========================================================== */

body.game-page { background: var(--bg); }

.gbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 247, 241, .9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.gbar-inner {
  display: flex; align-items: center; gap: 12px;
  height: 58px; max-width: var(--maxw); margin: 0 auto; padding: 0 16px;
}
.gbar-back {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px 0 9px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
}
.gbar-back:hover { border-color: var(--gold-2); color: var(--gold-deep); }
.gbar-title {
  font-size: 15.5px; font-weight: 800; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 7px;
}
.gbar-title .em { font-size: 17px; }
.gbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.gbar-hud {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.gbar-hud b { color: var(--ink); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.gbar-hud .best { color: var(--gold-deep); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); font-size: 14px;
}
.icon-btn:hover { border-color: var(--gold-2); color: var(--gold-deep); }

/* ---------------- 舞台 ---------------- */
.stage-wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 22px 16px 0;
  display: flex; justify-content: center;
}
.stage {
  position: relative;
  width: 100%; max-width: 520px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.stage:fullscreen,
.stage:-webkit-full-screen {
  max-width: none; width: 100%; height: 100%;
  border-radius: 0; border: 0; padding: 0;
  justify-content: center; background: #fbf7f1;
}
.stage canvas {
  display: block; height: auto; max-width: 100%; max-height: 74vh;
  border-radius: 12px; background: #fdfaf4;
  touch-action: none;
}
.stage:fullscreen canvas { max-height: none; }

/* 通用分数条（游戏内部使用） */
.hud {
  width: 100%; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); font-weight: 600;
  padding: 0 2px; flex-wrap: wrap;
}
.hud .k { font-variant-numeric: tabular-nums; }
.hud .k b { color: var(--ink); font-size: 16px; margin-left: 4px; }
.hud .spacer { margin-left: auto; }
.hud .tag {
  padding: 2px 8px; border-radius: 6px; background: var(--bg-soft);
  color: var(--gold-deep); font-size: 12px;
}

/* 结算 / 开始遮罩 */
.overlay {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  background: rgba(251, 247, 241, .88);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-radius: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay-card {
  text-align: center; padding: 22px 26px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
  max-width: 86%;
}
.overlay-card h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.4px; }
.overlay-card p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.overlay-card p b { color: var(--gold-deep); font-size: 15px; }
.overlay-card .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.new-record {
  display: inline-block; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .3px;
  color: #fff; background: linear-gradient(145deg, var(--gold-2), var(--gold));
  padding: 2px 9px; border-radius: 999px;
}

/* ---------------- 说明 & 推荐 ---------------- */
.gmain {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px;
}
.ginfo {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px;
  margin: 24px 0 0;
}
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0 0 4px; font-size: 16px; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 8px;
}
.panel h2 .ico { font-size: 14px; }
.panel .lead { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.panel ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.panel ul li { margin-bottom: 7px; }
.panel ul li::marker { color: var(--gold); }
.panel .kv { display: flex; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.panel .kv b { color: var(--ink); font-weight: 700; }

.grelated { margin: 16px 0 6px; }
.grelated h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.3px; }

@media (max-width: 760px) {
  .ginfo { grid-template-columns: 1fr; }
  .gbar-hud .hide-sm { display: none; }
  .stage-wrap { padding: 14px 12px 0; }
  .stage { padding: 12px; border-radius: 16px; }
  .gmain { padding: 0 12px; }
  .gbar-inner { padding: 0 12px; gap: 8px; }
  .gbar-title { font-size: 14px; }
}

/* ---------------- 通用操作按钮组 ---------------- */
.pad { display: grid; gap: 8px; width: 100%; }
.pad.c2 { grid-template-columns: repeat(2, 1fr); }
.pad.c3 { grid-template-columns: repeat(3, 1fr); }
.pad.c4 { grid-template-columns: repeat(4, 1fr); }
.pad button {
  height: 46px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 17px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.pad button:active { background: var(--bg-soft); transform: translateY(1px); }
.pad button small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }

/* 通用输入框 */
.ginput {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 16px; font-weight: 700; text-align: center;
  color: var(--ink); background: #fff; outline: none;
}
.ginput:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(195,146,60,.12); }
