/* =====================================================================
   霓虹消消乐 · NEON MATCH
   风格基准：超限霓虹破块（深紫夜空 + 品红/电青霓虹 + 扫描线）
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  overscroll-behavior: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, #241a4d 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, #0d3b4a 0%, transparent 55%),
    #07060f;
  color: #e8e9ff;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 44px; }

/* ---------- 标题 ---------- */
.head { text-align: center; margin-bottom: 12px; }

.head h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 46px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  text-shadow:
    0 0 6px #fff,
    0 0 18px #ff2d95,
    0 0 42px #ff2d95,
    0 0 80px #b14dff;
}

.head h1 span {
  color: #7af5ff;
  text-shadow:
    0 0 6px #fff,
    0 0 18px #00e6ff,
    0 0 44px #00e6ff;
  margin-left: 10px;
}

.tag {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: 3px;
  color: #9aa3d8;
  text-transform: uppercase;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hud .stat {
  min-width: 110px;
  text-align: center;
  font-size: 12px;
  color: #8f97c8;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 8px 14px 10px;
}

.hud .stat b {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.hud .stat:nth-child(1) b { color: #7af5ff; text-shadow: 0 0 14px rgba(0, 230, 255, .8); }
.hud .stat:nth-child(2) b { color: #ffd23f; text-shadow: 0 0 14px rgba(255, 210, 63, .8); }
.hud .stat:nth-child(3) b { color: #b14dff; text-shadow: 0 0 14px rgba(177, 77, 255, .8); }
.hud .stat.time b { color: #ff7ad9; text-shadow: 0 0 14px rgba(255, 45, 149, .8); }
.hud .stat.time.low b { color: #ff5b5b; animation: blink .5s steps(2) infinite; }

/* ---------- 能量条 ---------- */
.energy {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.energy .elabel {
  font-size: 12px;
  letter-spacing: 2px;
  color: #8f97c8;
}

.energy .etrack {
  flex: 1 1 160px;
  height: 14px;
  border-radius: 8px;
  background: #14142a;
  border: 1px solid #2c2b52;
  overflow: hidden;
}

.energy .ebar {
  width: 0%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #00e6ff 0%, #b14dff 60%, #ff2d95 100%);
  box-shadow: 0 0 14px rgba(177, 77, 255, .6);
  transition: width .12s linear;
}

.energy .mute { font-size: 12px; padding: 7px 12px; }
.energy .mute.ready {
  border-color: #ff2d95;
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 45, 149, .6);
  animation: breathe 1.1s ease-in-out infinite;
}
.energy .mute:disabled { opacity: .45; cursor: default; }

@keyframes breathe { 50% { box-shadow: 0 0 28px rgba(255, 45, 149, .9); } }

@keyframes blink { 50% { opacity: .35; } }

/* ---------- 舞台 ---------- */
.stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #05040c;
  border: 1px solid #2c2b52;
  box-shadow:
    0 0 0 1px rgba(255, 45, 149, .25),
    0 0 34px rgba(255, 45, 149, .22),
    0 0 80px rgba(0, 230, 255, .16),
    0 22px 60px rgba(0, 0, 0, .6);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  touch-action: none;
  cursor: pointer;
}

.scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, .045) 0px,
    rgba(255, 255, 255, .045) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.vig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .62) 100%);
}

/* ---------- 覆盖层 ---------- */
.ov {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 16, .82);
  backdrop-filter: blur(3px);
  padding: 20px;
  z-index: 5;
}

.ov.show { display: flex; }

.panel { width: min(520px, 100%); text-align: center; animation: pop .22s ease-out; }

@keyframes pop {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.panel h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 10px #fff, 0 0 28px #ff2d95, 0 0 60px #b14dff;
}

.panel h2.cyan { text-shadow: 0 0 10px #fff, 0 0 28px #00e6ff, 0 0 60px #0090ff; }
.panel h2.red  { text-shadow: 0 0 10px #fff, 0 0 28px #ff3b3b, 0 0 60px #ff7a00; }

.panel .sub { margin: 0 0 16px; font-size: 14px; color: #a6adda; letter-spacing: 1px; }

.panel .stat {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.panel .stat div { font-size: 12px; color: #8f97c8; letter-spacing: 1px; }

.panel .stat b {
  display: block;
  font-size: 26px;
  color: #7af5ff;
  text-shadow: 0 0 14px rgba(0, 230, 255, .8);
  font-variant-numeric: tabular-nums;
}

.btn {
  appearance: none;
  border: 1px solid #4a4a86;
  background: linear-gradient(180deg, #1b1b36 0%, #14142a 100%);
  color: #dfe3ff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}

.btn:hover { transform: translateY(-2px); border-color: #7af5ff; box-shadow: 0 0 18px rgba(0, 230, 255, .35); }
.btn:active { transform: translateY(0); }

.btn.primary {
  padding: 14px 34px;
  font-size: 16px;
  border-color: #ff2d95;
  background: linear-gradient(180deg, #ff2d95 0%, #b8287f 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
  box-shadow: 0 0 26px rgba(255, 45, 149, .55);
}

.howto {
  margin: 16px 0 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: #8f97c8;
  text-align: left;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 14px 16px;
}

.howto b { color: #ffd23f; }

/* ---------- 底部栏 ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.keys {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #8f97c8;
}

.keys b { color: #7af5ff; font-weight: 700; }

.mute {
  appearance: none;
  border: 1px solid #4a4a86;
  background: #14142a;
  color: #cfd4ff;
  font: inherit;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.mute:hover { border-color: #7af5ff; color: #fff; }

.ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .keys { gap: 10px; font-size: 11px; }
  .keys span { font-size: 11px; }
  .wrap { padding: 14px 10px 32px; }
  .head { margin-bottom: 8px; }
  .hud { gap: 12px; }
  .hud .stat { min-width: 88px; padding: 6px 10px 8px; }
  .hud .stat b { font-size: 20px; }
  .ctrls .mute { padding: 10px 12px; font-size: 13px; }
}

.stage:fullscreen { display: flex; align-items: center; justify-content: center; }
.stage:fullscreen #game { width: auto; height: 100%; }
