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

#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #FFD9A8 0%, #FFB877 38%, #FF8A3D 100%);
}

#game {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute; top: 12px; left: 14px;
  display: flex; gap: 8px; align-items: center;
  z-index: 5;
  pointer-events: none;
}
.hud-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(120, 62, 12, 0.22);
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  color: #7A3D0C;
  backdrop-filter: blur(6px);
}
.hud-chip .mp-icon { font-size: 17px; color: #FF8A3D; }
.hud-best { color: #8A5A1E; }
.hud-best .mp-icon { color: #F2B33D; }

.combo {
  position: absolute; top: 58px; left: 50%;
  transform: translate(-50%, 0) scale(0.8);
  font-size: 20px; font-weight: 800; color: #FFF6E8;
  text-shadow: 0 2px 0 #E06A1E, 0 6px 14px rgba(150, 70, 10, 0.5);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  pointer-events: none; z-index: 6; white-space: nowrap;
}
.combo.show { opacity: 1; transform: translate(-50%, -6px) scale(1); }

/* ---------- 蓄力条 ---------- */
.power {
  position: absolute; left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: 168px; height: 12px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(120, 62, 12, 0.2);
  overflow: hidden; z-index: 5;
}
.power.hidden { display: none; }
.power-fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FFC46B 0%, #FF8A3D 60%, #F2601E 100%);
  transition: width .04s linear;
}

/* ---------- 面板 ---------- */
.panel {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: radial-gradient(120% 90% at 50% 30%, rgba(255, 214, 168, 0.55) 0%, rgba(120, 58, 12, 0.42) 100%);
  backdrop-filter: blur(3px);
  z-index: 10;
}
.panel.hidden { display: none; }

.panel-card {
  width: min(420px, 92vw);
  padding: 20px 22px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF3E2 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(96, 46, 6, 0.34), inset 0 1px 0 #fff;
  text-align: center;
  animation: pop .26s cubic-bezier(.2, 1.3, .5, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-badge {
  width: 54px; height: 54px; margin: -44px auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #FFB067 0%, #FF8A3D 100%);
  box-shadow: 0 8px 18px rgba(226, 106, 30, 0.42), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  color: #fff;
}
.panel-badge .mp-icon { font-size: 28px; }
.badge-fail { background: linear-gradient(160deg, #9FB4D6 0%, #6B82AB 100%); box-shadow: 0 8px 18px rgba(58, 78, 118, 0.4), inset 0 2px 0 rgba(255,255,255,.4); }

.panel-title {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.02em;
  color: #4A2A0C;
}
.panel-sub {
  margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: #8A6A48;
}

.btn-primary {
  margin-top: 16px;
  width: 100%; min-height: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 15px;
  background: linear-gradient(180deg, #FFA45C 0%, #FF8A3D 55%, #F2701F 100%);
  color: #fff; font-size: 17px; font-weight: 800; letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(226, 106, 30, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-primary .mp-icon { font-size: 20px; }
.btn-primary:active {
  transform: translateY(2px) scale(.985);
  box-shadow: 0 3px 10px rgba(226, 106, 30, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  filter: brightness(.97);
}

.panel-tip {
  margin: 12px 0 0; font-size: 12px; color: #A98B6A; letter-spacing: 0.02em;
}

.result-row {
  margin-top: 14px;
  display: flex; gap: 10px;
}
.result-item {
  flex: 1;
  padding: 10px 8px;
  border-radius: 14px;
  background: #FFF7EC;
  border: 1px solid #F3DFC6;
  box-shadow: inset 0 1px 0 #fff;
  display: flex; flex-direction: column; gap: 2px;
}
.result-num { font-size: 22px; font-weight: 800; color: #E06A1E; line-height: 1.1; }
.result-label { font-size: 11px; color: #A98B6A; letter-spacing: 0.04em; }

@media (max-height: 380px) {
  .panel-card { padding: 14px 18px 14px; }
  .panel-badge { width: 44px; height: 44px; margin-top: -36px; }
  .panel-badge .mp-icon { font-size: 22px; }
  .panel-title { font-size: 19px; }
  .panel-sub { font-size: 12px; margin-top: 6px; }
  .btn-primary { min-height: 44px; margin-top: 12px; font-size: 15px; }
  .panel-tip { margin-top: 8px; }
  .result-row { margin-top: 10px; }
  .result-num { font-size: 18px; }
}

/* ---------- 图标尺寸（内置 icons.css 默认 24px，这里按场景缩放） ---------- */
.hud-chip .mp-icon { width: 17px; height: 17px; }
.panel-badge .mp-icon { width: 28px; height: 28px; }
.btn-primary .mp-icon { width: 20px; height: 20px; }

@media (max-height: 380px) {
  .panel-badge .mp-icon { width: 22px; height: 22px; }
  .btn-primary .mp-icon { width: 18px; height: 18px; }
}
