/* =====================================================================
   游戏页：顶栏 / HUD / 画布 / 触屏按键 / 底部提示
   ===================================================================== */
#play {
  display: none;
}

#play.on {
  display: block;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.icon-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px -2px rgba(40, 60, 120, 0.18);
  transition: transform 0.14s, border-color 0.14s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-btn:hover {
  border-color: #c6d2ea;
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn.off {
  color: #b3bacd;
}

.title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 800;
}

.title .ico {
  font-size: 24px;
  line-height: 1;
}

/* 顶栏图标：小朋友的真实头像（圆形），替代原来的 emoji */
.title .ico .face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(60, 80, 140, 0.22);
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 9px 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px -10px rgba(40, 60, 120, 0.4);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 64px;
}

.hud-item .k {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.hud-item b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- 画布 ---------- */
.stage {
  display: flex;
  justify-content: center;
}

canvas {
  display: block;
  /* --ar 由 js/core/surface.js 按当前游戏宽高比写入 */
  width: min(100%, 840px, calc((100dvh - 340px) * var(--ar, 1.43)));
  height: auto;
  border-radius: 20px;
  touch-action: none;
  box-shadow: 0 16px 40px -20px rgba(40, 60, 120, 0.45);
}

/* ---------- 触屏按键 ---------- */
.pads {
  display: none;
  margin-top: 14px;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pads.on {
  display: flex;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  gap: 9px;
}

.dpad .sp {
  visibility: hidden;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pad {
  font: inherit;
  font-size: 24px;
  font-weight: 800;
  color: #2a3350;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 18px;
  height: 66px;
  min-width: 68px;
  padding: 0 12px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 12px -8px rgba(40, 60, 120, 0.5);
  transition: transform 0.09s, background 0.09s;
}

.pad:active,
.pad.hold {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: #f2f6ff;
}

.pad.wide {
  min-width: 96px;
  font-size: 19px;
}

/* ---------- 底部提示 ---------- */
.footerhint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
}
