* { box-sizing: border-box; }

:root {
  --bg: #050914;
  --panel: #0c1530;
  --line: rgba(100, 170, 255, .22);
  --text: #e6f1ff;
  --dim: #8fa6c8;
  --cyan: #49d3ff;
  --pink: #ff6b9d;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% -20%, #16244d 0, var(--bg) 60%) fixed;
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.shell { width: min(96vw, 960px); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.brand em { font-style: normal; color: var(--cyan); font-size: 13px; margin-left: 8px; letter-spacing: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 12px var(--pink); margin-right: 8px; }
.mute {
  background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 12px;
}
.mute:hover { color: var(--text); border-color: var(--cyan); }

.hud {
  display: flex; gap: 8px; margin-bottom: 10px;
  background: rgba(12, 21, 48, .85); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 14px;
}
.cell { display: flex; flex-direction: column; min-width: 84px; }
.cell.grow { flex: 1; align-items: flex-end; }
.k { font-size: 11px; color: var(--dim); letter-spacing: 1px; }
.v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.v.small { font-size: 15px; }
.v.lives { color: #ff6b81; letter-spacing: 3px; font-size: 17px; }

.stage { position: relative; line-height: 0; }
canvas {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(73, 211, 255, .35);
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(30, 100, 220, .22), inset 0 0 40px rgba(0, 0, 0, .4);
  cursor: none;
  touch-action: none;
}

.overlay {
  position: absolute; inset: 0; line-height: 1.6;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 9, 24, .78);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  transition: opacity .18s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }
.panel {
  width: min(88%, 620px); text-align: center;
  background: linear-gradient(160deg, rgba(20, 34, 72, .95), rgba(9, 16, 38, .95));
  border: 1px solid rgba(73, 211, 255, .4);
  border-radius: 16px; padding: 30px 34px;
  box-shadow: 0 0 50px rgba(40, 130, 255, .2);
}
.panel h1 { margin: 0 0 14px; font-size: 34px; letter-spacing: 2px; }
.accent { color: var(--cyan); font-size: 20px; letter-spacing: 3px; }
.panel p { color: #c3d7f2; font-size: 14px; margin: 0 0 22px; }
.panel p b { color: #ffd166; }
.start {
  background: linear-gradient(90deg, #1f9ddf, #28d6c0);
  color: #04101f; font-weight: 800; font-size: 16px;
  border: 0; border-radius: 10px; padding: 12px 36px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(40, 200, 220, .3);
}
.start:hover { filter: brightness(1.15); }
.hint { margin: 18px 0 0 !important; font-size: 12px !important; color: #8fa6c8 !important; }

.bottombar { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--dim); }
.buff { color: #43e6a0; }
.keys { text-align: right; }

@media (max-width: 640px) {
  .bottombar { flex-direction: column; }
  .keys { text-align: left; }
  .cell { min-width: 64px; }
  .v { font-size: 16px; }
  .panel { padding: 20px; }
  .panel h1 { font-size: 24px; }
}
