:root {
  color-scheme: dark;
  --ink: #f8f2e4;
  --muted: #cec3ae;
  --panel: rgba(18, 22, 20, 0.78);
  --panel-strong: rgba(14, 17, 16, 0.9);
  --line: rgba(255, 255, 255, 0.16);
  --gold: #f4cf69;
  --red: #c84a38;
  --green: #67c65a;
  --blue: #7ec9ff;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #161b18;
}

button,
kbd {
  font: inherit;
}

.game {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 980px;
  min-height: 640px;
  color: var(--ink);
  user-select: none;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #7eb6d8;
}

.hud {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.top-left {
  top: 18px;
  left: 18px;
  padding: 14px 18px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.target-icon {
  width: 42px;
  height: 42px;
  border: 4px solid #f5f0df;
  border-radius: 50%;
  box-shadow: inset 0 0 0 6px rgba(200, 74, 56, 0.9), inset 0 0 0 13px #f5f0df;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.top-left p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.score-panel {
  top: 116px;
  left: 18px;
  width: 178px;
  padding: 18px;
}

.score-panel span,
.wind-panel span,
.ammo-panel span {
  display: block;
  color: #ffe5a1;
  font-size: 17px;
  font-weight: 800;
}

.score-panel strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 52px;
  line-height: 1;
}

.score-panel small,
.ammo-panel small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.wind-panel {
  top: 22px;
  left: 50%;
  min-width: 232px;
  transform: translateX(-50%);
  padding: 14px 24px;
  text-align: center;
}

.wind-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
}

.ammo-panel {
  top: 22px;
  right: 20px;
  width: 166px;
  padding: 18px;
  text-align: center;
}

.ammo-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.controls-panel {
  left: 18px;
  bottom: 18px;
  width: 236px;
  padding: 12px;
}

.controls-panel div {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  color: var(--muted);
}

kbd {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #fff7e5;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.power-panel {
  left: 50%;
  bottom: 26px;
  width: 470px;
  transform: translateX(-50%);
  padding: 16px 20px;
}

.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7ecd4;
  font-size: 16px;
  font-weight: 800;
}

.bar-row + .power-track {
  margin: 11px 0 13px;
}

.power-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

#powerFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #f3e55b, #ef9238, var(--red));
  transition: width 0.04s linear;
}

.hit-toast {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 28%;
  min-width: 210px;
  transform: translate(-50%, -50%);
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(15, 15, 14, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color: #fff;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  pointer-events: none;
}

.hit-toast.hidden {
  display: none;
}

.start-card {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52%;
  width: 360px;
  transform: translate(-50%, -50%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  cursor: pointer;
}

.start-card strong,
.start-card span {
  display: block;
}

.start-card strong {
  font-size: 30px;
}

.start-card span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.start-card.hidden {
  display: none;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .game {
    width: 980px;
    height: 640px;
  }
}
