* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #2A1B12; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  user-select: none; -webkit-user-select: none;
}

.stage {
  position: fixed; inset: 0;
  overflow: hidden;
  background: #2A1B12;
}

/* 参考图铺满整屏，从顶端开始 */
.bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}

/* 顶部状态条 */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
.hud-left { display: flex; gap: 8px; }
.hud-right { pointer-events: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #3A2416;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(60, 30, 10, 0.22);
  border: 1px solid rgba(255, 138, 61, 0.35);
}
.pill .mp-icon { font-size: 17px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 138, 61, 0.35);
  background: rgba(255, 255, 255, 0.94);
  color: #FF8A3D;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(60, 30, 10, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.icon-btn .mp-icon { font-size: 20px; }
.icon-btn:active { transform: scale(0.92); background: #FFE7D6; }

/* 差异点点击层 */
.hit-layer {
  position: absolute; inset: 0;
  z-index: 4;
}
.hit {
  position: absolute;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 0; padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.hit:active { transform: scale(0.9); }
.hit.done {
  background: radial-gradient(circle, rgba(255, 138, 61, 0.28) 0%, rgba(255, 138, 61, 0) 70%);
  pointer-events: none;
}
.hit.done::after {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  border: 2.5px solid #FF8A3D;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75), 0 0 14px rgba(255, 138, 61, 0.8);
  animation: pop 0.35s ease-out;
}
.hit.done::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 16px;
  border-right: 3px solid #FF8A3D;
  border-bottom: 3px solid #FF8A3D;
  transform: translate(-50%, -62%) rotate(42deg);
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
  animation: pop 0.35s ease-out;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 提示气泡 */
.toast {
  position: absolute; left: 50%; bottom: 96px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(42, 27, 18, 0.88);
  color: #FFE7D6;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 遮罩面板 */
.mask {
  position: absolute; inset: 0;
  z-index: 8;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(30, 18, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mask[hidden] { display: none; }

.panel {
  width: 100%; max-width: 320px;
  padding: 26px 22px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #FFFCF7 0%, #FFF1E4 100%);
  border: 1px solid rgba(255, 138, 61, 0.4);
  box-shadow: 0 18px 44px rgba(40, 20, 8, 0.42);
  text-align: center;
  animation: rise 0.26s ease-out;
}
@keyframes rise {
  from { transform: translateY(16px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.panel-title {
  font-size: 22px; font-weight: 800; color: #3A2416;
  letter-spacing: 0.01em;
}
.panel-desc {
  margin-top: 8px;
  font-size: 14px; line-height: 1.6; color: #8A6A52;
}
.panel-stats {
  display: flex; gap: 10px; margin: 18px 0 4px;
}
.panel-stats[hidden] { display: none; }
.stat {
  flex: 1;
  padding: 12px 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #F3DCC9;
  box-shadow: 0 2px 8px rgba(120, 70, 30, 0.08);
}
.stat b { display: block; font-size: 19px; color: #FF8A3D; }
.stat span { display: block; margin-top: 3px; font-size: 12px; color: #9A7A62; }

.btn {
  display: block; width: 100%;
  margin-top: 14px;
  height: 48px;
  border: 0; border-radius: 16px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.97); filter: brightness(0.96); }
.btn.primary {
  background: linear-gradient(180deg, #FFA05C 0%, #FF8A3D 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 138, 61, 0.42);
}
.btn.ghost {
  background: #fff;
  color: #B4703F;
  border: 1px solid #F0D3BC;
  box-shadow: none;
}
.btn.ghost[hidden] { display: none; }

/* 底部玩法提示 */
.hint-bar {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.94);
  border: 1px solid rgba(255, 138, 61, 0.35);
  box-shadow: 0 10px 26px rgba(60, 30, 10, 0.24);
  display: flex; align-items: center; gap: 10px;
  z-index: 5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hint-bar.hide { opacity: 0; transform: translateY(14px); pointer-events: none; }
.hint-bar .hint-ico {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFA05C 0%, #FF8A3D 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(255, 138, 61, 0.4);
}
.hint-bar .hint-ico .mp-icon { font-size: 18px; }
.hint-bar .hint-txt {
  font-size: 13px; line-height: 1.5; color: #7A5A42; font-weight: 600;
}
