/* 合成守卫战 — style */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  background: #05070f;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
#wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 700px at 50% -10%, #12203c 0%, transparent 60%),
    radial-gradient(900px 600px at 80% 110%, #1a1030 0%, transparent 55%),
    #05070f;
}
#stage {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(120, 160, 255, .12), 0 24px 80px rgba(0, 0, 0, .6);
  touch-action: none;
}
@media (max-width: 520px) {
  #stage { border-radius: 0; box-shadow: none; }
}
canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0 0 auto 0;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 8, 18, .88) 0%, rgba(4, 8, 18, .55) 65%, transparent 100%);
}
.hud-top { display: flex; align-items: center; gap: 6px; }
.pill {
  font-size: 12px;
  color: #9fb4d8;
  background: rgba(18, 30, 54, .8);
  border: 1px solid rgba(110, 150, 220, .22);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.pill b { color: #eaf2ff; font-size: 13px; margin: 0 1px; }
.combo-pill { color: #ffd166; border-color: rgba(255, 209, 102, .4); animation: combo-pop .18s ease; }
.combo-pill b { color: #ffd166; }
@keyframes combo-pop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; }
.hud-btns button {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(110, 150, 220, .25);
  background: rgba(18, 30, 54, .85);
  color: #cfe0ff;
  font-size: 12px;
  cursor: pointer;
}
.hud-btns button:active { transform: scale(.92); }

.hud-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bar {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: rgba(10, 16, 32, .85);
  border: 1px solid rgba(110, 150, 220, .18);
  overflow: hidden;
}
.bar i {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 6px;
  transition: transform .12s linear;
}
.bar span {
  position: absolute; left: 8px; top: 0;
  font-size: 9px; line-height: 13px;
  color: rgba(234, 242, 255, .85);
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.energy-bar i { background: linear-gradient(90deg, #2f7bd9, #7ee7ff); }
.base-bar i { background: linear-gradient(90deg, #d95a2f, #ffb066); }
.xp-bar i { background: linear-gradient(90deg, #7a3fd9, #c79bff); }

#boss-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 7px;
  padding: 0 2px;
}
#boss-bar span {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: #ff5b8a; text-shadow: 0 0 8px rgba(255, 91, 138, .6);
}
.boss-track {
  flex: 1; height: 8px;
  background: rgba(10, 16, 32, .85);
  border: 1px solid rgba(255, 91, 138, .35);
  border-radius: 5px; overflow: hidden;
}
.boss-track i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #b02050, #ff5b8a);
  transform-origin: left center;
  transition: transform .1s linear;
}

#hint {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: #8fa8d0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  animation: hint-fade 1s ease;
}

/* ---------- 波次横幅 ---------- */
#banner {
  position: absolute;
  left: 0; right: 0; top: 34%;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #eaf2ff;
  text-shadow: 0 0 18px rgba(126, 231, 255, .55), 0 2px 6px rgba(0, 0, 0, .7);
  pointer-events: none;
  animation: banner-in .5s ease both;
  z-index: 5;
}
#banner.danger { color: #ff9db6; text-shadow: 0 0 18px rgba(255, 91, 138, .65), 0 2px 6px rgba(0, 0, 0, .7); }
@keyframes banner-in {
  0% { opacity: 0; transform: translateY(14px) scale(.92); }
  18% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ---------- 覆盖层 ---------- */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 16, .78);
  backdrop-filter: blur(4px);
  z-index: 10;
  padding: 16px;
}
.panel {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, rgba(17, 27, 50, .96), rgba(10, 16, 32, .96));
  border: 1px solid rgba(110, 150, 220, .25);
  border-radius: 16px;
  padding: 22px 20px 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  text-align: center;
  animation: panel-in .25s ease both;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.eyebrow {
  font-size: 10px; letter-spacing: 4px;
  color: #6f87b5; margin-bottom: 6px;
}
#menu h1 {
  font-size: 34px; letter-spacing: 4px;
  color: #eaf2ff;
  text-shadow: 0 0 24px rgba(126, 231, 255, .35);
}
#menu .tagline { font-size: 12px; color: #8fa8d0; margin: 6px 0 16px; }
.howto {
  list-style: none;
  text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.howto li {
  font-size: 12.5px; line-height: 1.5; color: #b7c7e4;
  background: rgba(10, 18, 36, .7);
  border: 1px solid rgba(110, 150, 220, .14);
  border-left: 3px solid #7ee7ff;
  border-radius: 8px;
  padding: 7px 10px;
}
.howto b { color: #7ee7ff; margin-right: 6px; }
.best-row { font-size: 12px; color: #8fa8d0; margin-bottom: 14px; }
.best-row b { color: #ffd166; font-size: 14px; }
.tiny-hint { font-size: 10.5px; color: #5f739c; margin-top: 12px; }

button.primary, button.ghost {
  display: block; width: 100%;
  border-radius: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: 4px;
  padding: 13px 0;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
  font-family: inherit;
}
button.primary {
  border: 1px solid rgba(126, 231, 255, .5);
  background: linear-gradient(180deg, #1d4e7e, #123154);
  color: #eaf6ff;
  box-shadow: 0 0 22px rgba(46, 128, 199, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
button.primary:active { transform: scale(.97); }
button.ghost {
  margin-top: 10px;
  border: 1px solid rgba(110, 150, 220, .3);
  background: transparent;
  color: #9fb4d8;
  font-size: 13px; letter-spacing: 2px; padding: 10px 0;
}
button.ghost:active { transform: scale(.97); }

/* 升级选项 */
#levelup h2 { color: #eaf2ff; font-size: 22px; letter-spacing: 3px; margin-bottom: 14px; }
#levelup h2 b { color: #c79bff; }
#lvup-options { display: flex; flex-direction: column; gap: 9px; }
.lvup-card {
  text-align: left;
  background: rgba(14, 22, 44, .9);
  border: 1px solid rgba(126, 231, 255, .25);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
  font-family: inherit;
}
.lvup-card:hover { border-color: rgba(126, 231, 255, .7); background: rgba(20, 34, 66, .95); }
.lvup-card:active { transform: scale(.98); }
.lvup-card b { display: block; font-size: 15px; color: #7ee7ff; letter-spacing: 1px; }
.lvup-card small { display: block; font-size: 12px; color: #a9bbdc; margin-top: 3px; line-height: 1.45; }
.lvup-card .lv-tag { float: right; font-size: 10px; color: #6f87b5; }

/* 结算 */
#over h2 { color: #ff9db6; font-size: 24px; letter-spacing: 3px; margin-bottom: 14px; }
.result-grid { display: flex; gap: 8px; margin-bottom: 12px; }
.result-grid > div {
  flex: 1;
  background: rgba(10, 18, 36, .7);
  border: 1px solid rgba(110, 150, 220, .16);
  border-radius: 10px;
  padding: 9px 4px;
}
.result-grid small { display: block; font-size: 10px; color: #6f87b5; margin-bottom: 3px; }
.result-grid b { font-size: 18px; color: #eaf2ff; }
.newbest {
  font-size: 13px; color: #ffd166; letter-spacing: 2px;
  margin: -4px 0 12px;
  animation: combo-pop .3s ease;
}

/* 暂停 */
#pause h2 { color: #eaf2ff; font-size: 22px; letter-spacing: 4px; margin-bottom: 16px; }
