/* 雷电风暴 · 街机游戏界面 */
:root {
  --bg: #05070d;
  --ink: #eef4ff;
  --gold: #e8d5a3;
  --cyan: #4de1ff;
  --magenta: #ff4d9a;
  --danger: #ff5c6c;
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
#app {
  position: relative; width: 100vw; height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(77, 225, 255, 0.08), transparent 55%),
    radial-gradient(700px 400px at 80% 100%, rgba(232, 213, 163, 0.08), transparent 50%),
    #05070d;
}

/* 舞台 */
#stage {
  position: relative;
  width: min(100vw, calc(100vh * 0.62));
  height: min(100vh, calc(100vw / 0.62));
  max-width: 560px;
  max-height: 900px;
  background: #02040a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(232, 213, 163, 0.18),
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(77, 225, 255, 0.08);
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #02040a;
}

/* CRT 质感 */
.crt {
  pointer-events: none;
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
  opacity: 0.45;
  z-index: 5;
}
.vignette {
  pointer-events: none;
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 6;
}

/* HUD */
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 4, 10, 0.72), transparent);
}
.hud-block { min-width: 88px; }
.hud-label {
  font-size: 10px; letter-spacing: 0.14em; color: rgba(232, 213, 163, 0.75);
  text-transform: uppercase;
}
.hud-value {
  font-size: 20px; font-weight: 800; line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(77, 225, 255, 0.35);
}
.hud-right { text-align: right; }
.lives {
  display: flex; gap: 5px; justify-content: flex-end; margin-top: 4px;
}
.life {
  width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--gold), #b09a6c);
  clip-path: polygon(50% 0%, 100% 80%, 78% 100%, 50% 72%, 22% 100%, 0% 80%);
  box-shadow: 0 0 10px rgba(232, 213, 163, 0.55);
}
.bombs {
  display: flex; gap: 5px; justify-content: flex-end; margin-top: 4px;
}
.bomb {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--magenta) 55%, #7a1038);
  box-shadow: 0 0 10px rgba(255, 77, 154, 0.55);
}
.power-bar {
  width: 88px; height: 5px; margin-top: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.power-bar > i {
  display: block; height: 100%; width: 20%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  box-shadow: 0 0 12px rgba(77, 225, 255, 0.55);
  transition: width 0.2s ease;
}

/* Boss 血条 */
.boss-bar {
  position: absolute; left: 10%; right: 10%; top: 54px;
  z-index: 11; display: none;
  pointer-events: none;
}
.boss-bar.show { display: block; }
.boss-bar .name {
  font-size: 11px; letter-spacing: 0.18em; color: var(--danger);
  text-align: center; margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(255, 92, 108, 0.6);
}
.boss-bar .track {
  height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 92, 108, 0.35);
  overflow: hidden;
}
.boss-bar .fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #ff4d6d, #ff9a4d, #ffd76a);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.55);
  transition: width 0.15s linear;
}

/* 覆盖层 */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.overlay.show { opacity: 1; visibility: visible; }
.panel-box {
  width: min(92%, 380px);
  padding: 28px 24px 24px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(22, 32, 52, 0.95), rgba(10, 14, 26, 0.96));
  border: 1px solid rgba(232, 213, 163, 0.22);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 50px rgba(232, 213, 163, 0.08);
  text-align: center;
}
.panel-box .kicker {
  font-size: 11px; letter-spacing: 0.22em; color: var(--gold);
  margin-bottom: 10px;
}
.panel-box h1 {
  font-size: 34px; line-height: 1.15; margin-bottom: 8px;
  background: linear-gradient(120deg, #fff2c8, var(--gold), #c2b59b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.panel-box h2 {
  font-size: 26px; margin-bottom: 10px;
}
.panel-box p {
  color: rgba(238, 244, 255, 0.72); font-size: 13px; line-height: 1.7;
  margin-bottom: 18px;
}
.panel-box .score-line {
  font-size: 42px; font-weight: 900; letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(232, 213, 163, 0.4);
  margin: 8px 0 4px;
}
.panel-box .best {
  font-size: 12px; color: rgba(238, 244, 255, 0.55); margin-bottom: 18px;
}
.btn-row { display: flex; flex-direction: column; gap: 10px; }
.btn {
  appearance: none; border: none; cursor: pointer;
  padding: 14px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #f7e7b8, var(--gold) 45%, #b09a6c);
  color: #1a1408;
  box-shadow: 0 12px 34px rgba(232, 213, 163, 0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(232, 213, 163, 0.38); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 213, 163, 0.28);
  color: var(--gold);
}
.btn-ghost:hover { background: rgba(232, 213, 163, 0.12); }

/* 控制按钮 */
.controls {
  position: absolute; right: 10px; top: 10px; z-index: 15;
  display: flex; gap: 8px;
}
.ctrl-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(238, 244, 255, 0.85);
  display: grid; place-items: center;
  cursor: pointer;
  pointer-events: auto;
  font-size: 14px;
}
.ctrl-btn:hover { background: rgba(232, 213, 163, 0.16); color: #fff; }

/* 触屏提示 */
.touch-hint {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 11px; color: rgba(238, 244, 255, 0.4);
  z-index: 8; pointer-events: none;
}

/* 侧边装饰 */
.side-deco {
  position: absolute; z-index: 1;
  width: 180px; height: 180px; border-radius: 50%;
  filter: blur(60px); opacity: 0.35; pointer-events: none;
}
.side-deco.a { left: -40px; top: 10%; background: rgba(77, 225, 255, 0.35); }
.side-deco.b { right: -40px; bottom: 12%; background: rgba(232, 213, 163, 0.3); }

@media (max-width: 640px) {
  #stage {
    width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0;
    box-shadow: none;
  }
  .hud-value { font-size: 16px; }
  .panel-box h1 { font-size: 28px; }
  .touch-hint { display: block; }
}
@media (min-width: 641px) {
  .touch-hint { opacity: 0.35; }
}
