* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 50% -10%, #1b2540 0%, rgba(27,37,64,0) 60%),
    #0a0e18;
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
}
.app {
  width: 100%;
  max-width: 520px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  padding-top: max(14px, env(safe-area-inset-top));
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.hud { display: flex; gap: 8px; align-items: baseline; font-size: 16px; }
.hud b { color: #4ade80; }
.label {
  font-size: 13px;
  color: #94a3b8;
  background: #1b2236;
  padding: 2px 8px;
  border-radius: 10px;
}
button {
  background: #4ade80;
  color: #06120a;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(74, 222, 128, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px) scale(0.98); box-shadow: 0 3px 8px rgba(74, 222, 128, 0.2); }
button.ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  box-shadow: none;
}
button.ghost:hover { color: #e5e7eb; border-color: #4ade80; box-shadow: 0 0 0 0 transparent; }
button.ghost:active { transform: translateY(1px); }
button.nav { padding: 6px 11px; font-size: 18px; line-height: 1; }
.actions { display: flex; gap: 6px; }
button.icon { padding: 6px 9px; font-size: 16px; line-height: 1; }
#level-input {
  width: 3em;
  background: #1b2236;
  color: #4ade80;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 3px 4px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#board {
  border-radius: 14px;
  touch-action: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}
/* 通关覆盖层:毛玻璃 + 卡片缩放进入 */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay-card {
  text-align: center;
  padding: 26px 36px;
  background: linear-gradient(180deg, #1d2942, #141c30);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.32s ease;
}
.overlay.show .overlay-card { transform: scale(1); opacity: 1; }
.overlay-card h2 {
  margin: 0 0 16px;
  font-size: 26px;
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
}
footer { margin-top: 12px; text-align: center; }
.tip { font-size: 12px; color: #64748b; line-height: 1.6; margin: 0 0 10px; }
