/* NEON STRIKE - style.css : cyberpunk 霓虹样式 + HUD/覆盖层 */
:root {
  --bg: #0a0a12;
  --cyan: #00f0ff;
  --magenta: #ff00e5;
  --yellow: #ffe600;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: var(--mono);
  color: #d8d8e6;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed; inset: 0;
  display: block;
  width: 100%; height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ---- HUD ---- */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 8px 12px; align-items: start;
  padding: calc(10px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(10,10,18,.93), rgba(10,10,18,.68));
  border-bottom: 1px solid rgba(0,240,255,.18);
  pointer-events: none; z-index: 10;
}
.hud-left, .hud-right { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; align-items: center; }
.hud-right { justify-content: flex-end; }
.stat { font-size: clamp(10px, 1.5vw, 13px); line-height: 1.4; letter-spacing: .04em; color: #cfeff2; white-space: nowrap; }
.hud-left .stat { color: var(--cyan); }
#mode-tag { width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; }
#hud-score { font-size: clamp(14px, 2vw, 18px); font-weight: 700; }
#hud-combo { color: var(--magenta); }
#hud-shield { color: var(--yellow); }
.boss-hud { grid-column: 1 / -1; width: 100%; max-width: 640px; justify-self: center; min-width: 0; }
.boss-heading, .boss-detail { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; line-height: 1.5; }
#boss-name { color: #ff80ef; font-weight: bold; }
#boss-phase { color: var(--yellow); white-space: nowrap; }
.boss-health { height: 8px; margin: 4px 0; border: 1px solid rgba(255,0,229,.65); background: #201224; }
#boss-health-fill { height: 100%; width: 100%; background: var(--magenta); box-shadow: 0 0 8px rgba(255,0,229,.5); transform-origin: left; }
.boss-hud.phase-two #boss-health-fill { background: var(--yellow); }
#boss-skill { color: #d8d8e6; }
#boss-music { color: #8c9dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boss-hud.charging #boss-skill { color: #ff667d; }
@media (max-width: 480px) {
  #hud { gap: 6px 8px; padding-left: calc(8px + env(safe-area-inset-left, 0px)); padding-right: calc(8px + env(safe-area-inset-right, 0px)); }
  .hud-left, .hud-right { gap: 2px 8px; }
  #hud-wave { width: 100%; }
  .boss-heading, .boss-detail { font-size: 10px; }
}
@media (max-height: 480px) and (min-width: 481px) {
  #hud { padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; gap: 3px 10px; }
  #mode-tag { width: auto; }
  .stat { font-size: 10px; }
  #hud-score { font-size: 13px; }
  .boss-detail { display: none; }
  .boss-health { margin: 2px 0; height: 6px; }
}

/* v1.2: buff 状态条(狂暴/冰霜剩余时间) */
.hud-buff {
  color: var(--red, #ff3355);
  text-shadow: 0 0 6px rgba(255,51,85,0.7);
  font-weight: 700;
}

/* ---- 覆盖层 ---- */
#overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,12,0.72);
  backdrop-filter: blur(4px);
  z-index: 20;
}
#overlay.hidden { display: none; }

.panel {
  min-width: min(300px, 94vw); max-width: 94vw;
  padding: 36px 32px;
  text-align: center;
  background: linear-gradient(160deg, #10101f, #0a0a14);
  border: 1px solid rgba(0,240,255,0.35);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(0,240,255,0.25), inset 0 0 40px rgba(0,240,255,0.05);
}
.panel h1 {
  font-size: 34px; letter-spacing: 0.1em;
  color: #eafeff;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.panel .sub { color: #9aaac0; font-size: 13px; letter-spacing: 0.1em; margin-bottom: 20px; }
.panel .hint { color: #5a6a80; font-size: 11px; line-height: 1.8; margin-top: 18px; }
.new-record { color: var(--yellow) !important; text-shadow: 0 0 8px rgba(255,230,0,0.7); }

.btn {
  display: inline-block;
  padding: 12px 34px;
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.15em;
  color: var(--cyan);
  background: rgba(0,240,255,0.06);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0,240,255,0.7);
  box-shadow: 0 0 14px rgba(0,240,255,0.25);
  transition: all .15s;
}
.btn:hover {
  background: rgba(0,240,255,0.16);
  box-shadow: 0 0 22px rgba(0,240,255,0.5);
  color: #ffffff;
}

/* 面板按钮组:纵向排列 */
.panel-actions {
  display: flex; flex-direction: column; gap: 10px;
  align-items: center;
}
.panel-actions .btn { width: 200px; }
/* 次要按钮(返回主菜单):更收敛的样式 */
.btn-ghost {
  color: #7f93a8;
  background: transparent;
  border-color: rgba(127,147,168,0.5);
  text-shadow: none;
  box-shadow: none;
  font-size: 13px;
  padding: 10px 34px;
}
.btn-ghost:hover {
  background: rgba(127,147,168,0.14);
  box-shadow: 0 0 14px rgba(127,147,168,0.25);
  color: #dfe8f2;
}

/* ---- glitch 标题故障效果 ---- */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden;
  opacity: 0.75;
}
.glitch::before {
  color: var(--magenta);
  transform: translate(-2px, 0);
  clip-path: inset(0 0 55% 0);
  animation: glitch-a 2.4s infinite steps(1);
}
.glitch::after {
  color: var(--cyan);
  transform: translate(2px, 0);
  clip-path: inset(55% 0 0 0);
  animation: glitch-b 2.8s infinite steps(1);
}
@keyframes glitch-a {
  0%, 91%, 100% { transform: translate(-2px, 0); }
  92% { transform: translate(-5px, -2px); }
  94% { transform: translate(3px, 1px); }
  96% { transform: translate(-2px, 0); }
}
@keyframes glitch-b {
  0%, 86%, 100% { transform: translate(2px, 0); }
  88% { transform: translate(5px, 2px); }
  91% { transform: translate(-3px, -1px); }
  93% { transform: translate(2px, 0); }
}

/* ---- 扫描线叠加层 ---- */
#scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px,
    transparent 1px, transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

.hidden { display: none !important; }

/* ---- 模式标签 ---- */
.mode-tag {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255,230,0,0.75);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---- 难度选择 ---- */
.diff-select {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.diff-label {
  font-size: 11px; letter-spacing: 0.3em; color: #5a6a80; text-transform: uppercase;
}
.diff-btns { display: flex; gap: 8px; }
.diff-btn {
  padding: 7px 16px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em;
  color: #7f93a8;
  background: transparent;
  border: 1px solid rgba(127,147,168,0.4);
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
}
.diff-btn:hover { color: #cfeff2; border-color: rgba(0,240,255,0.6); }
.diff-btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0,240,255,0.10);
  text-shadow: 0 0 8px rgba(0,240,255,0.7);
  box-shadow: 0 0 12px rgba(0,240,255,0.3);
}

/* ---- 模式选择按钮组 ---- */
.mode-select {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 4px;
}
.mode-btn { width: 100%; padding: 11px 20px; }
.mode-btn.roguelike {
  color: var(--magenta);
  border-color: var(--magenta);
  text-shadow: 0 0 8px rgba(255,0,229,0.7);
  box-shadow: 0 0 14px rgba(255,0,229,0.25);
}
.mode-btn.roguelike:hover { background: rgba(255,0,229,0.16); box-shadow: 0 0 22px rgba(255,0,229,0.5); color: #fff; }

/* ---- 肉鸽升级三选一卡片 ---- */
.upgrade-title { color: var(--magenta) !important; text-shadow: 0 0 12px rgba(255,0,229,0.8); }
#upgrade-cards {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 16px;
}
.perk-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  text-align: left;
  font-family: var(--mono);
  background: rgba(255,0,229,0.05);
  border: 1px solid rgba(255,0,229,0.45);
  border-radius: 6px;
  color: #eafeff;
  cursor: pointer;
  transition: all .15s;
}
.perk-card:hover {
  background: rgba(255,0,229,0.16);
  box-shadow: 0 0 20px rgba(255,0,229,0.45);
  transform: translateX(4px);
}
/* ---- HUD 右上角操作按钮组(暂停,流式布局不重叠) ---- */
.hud-actions {
  display: flex; gap: 8px; align-items: center;
  pointer-events: auto;
}

/* ---- 暂停按钮 (右上角 HUD 组内) ---- */
.pause-btn {
  width: 44px; height: 44px; border-radius: 6px;
  appearance: none; -webkit-appearance: none; touch-action: none;
  display: grid; place-items: center; padding: 0;
  background: rgba(10,10,20,0.6);
  border: 1px solid rgba(0,240,255,0.4);
  color: var(--cyan);
  font-size: 15px; cursor: pointer;
  text-shadow: 0 0 6px rgba(0,240,255,0.6);
  transition: all .15s;
}
.pause-btn:hover {
  background: rgba(0,240,255,0.12);
  box-shadow: 0 0 14px rgba(0,240,255,0.4);
}

.pause-icon { display: block; width: 14px; height: 18px; border-left: 5px solid currentColor; border-right: 5px solid currentColor; }
.pause-btn:focus-visible, .emp-btn:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---- EMP 技能按钮(右下角,冷却倒计) ---- */
.emp-btn {
  --emp-charge: 1;
  position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 80px; height: 80px; border-radius: 50%; padding: 0;
  touch-action: none; appearance: none; -webkit-appearance: none;
  background: radial-gradient(circle, #11323a 0%, #0b1924 65%);
  border: 0; color: var(--cyan); font-family: var(--mono); cursor: pointer;
  box-shadow: 0 0 22px rgba(0,240,255,.2); z-index: 10; display: none;
}
.emp-ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform: rotate(-90deg); }
.emp-ring circle { fill: none; stroke-width: 3; }
.emp-ring-track { stroke: #24404c; }
.emp-ring-fill { stroke: var(--cyan); stroke-dasharray: 100; stroke-dashoffset: calc(100 * (1 - var(--emp-charge))); stroke-linecap: round; }
.emp-label { position: absolute; top: 18px; left: 0; right: 0; font-size: 11px; letter-spacing: .18em; font-weight: bold; }
.emp-btn #emp-cd { position: absolute; top: 35px; left: 0; right: 0; font-size: 17px; font-weight: bold; line-height: 22px; color: #edfdff; }
.emp-key { position: absolute; bottom: -7px; left: 29px; width: 22px; height: 17px; line-height: 15px; border: 1px solid #3b6470; border-radius: 4px; background: #101d29; font-size: 10px; }
.emp-btn.cooldown { background: #0d1823; box-shadow: none; cursor: default; }
.emp-btn.cooldown .emp-label { color: #8199a6; }
.emp-btn.cooldown #emp-cd { color: #d1dce3; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .emp-btn:not(.cooldown):hover { box-shadow: 0 0 28px rgba(0,240,255,.45); } }
@media (pointer: coarse), (max-width: 640px) {
  .emp-btn { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(clamp(24px, 12vh, 88px) + env(safe-area-inset-bottom, 0px)); }
  .emp-key { display: none; }
}
.perk-label {
  font-size: 17px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--magenta);
  text-shadow: 0 0 8px rgba(255,0,229,0.7);
}
.perk-desc { font-size: 12px; color: #c9b8d8; letter-spacing: 0.04em; }
@media (max-height: 480px) { .emp-btn { width: 64px; height: 64px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } .panel { padding: 16px; max-height: 94vh; overflow-y: auto; } }

@media (max-height: 480px) { .emp-label { top: 12px; font-size: 10px; } .emp-btn #emp-cd { top: 27px; font-size: 14px; } .emp-key { display: none; } }
