html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #88c7e8;
  color: #1b1d22;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud,
.help {
  position: fixed;
  z-index: 2;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.hud {
  top: 16px;
}

.meter {
  min-width: 112px;
  padding: 8px 12px;
  border: 1px solid rgba(20, 24, 32, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(21, 34, 54, 0.12);
  backdrop-filter: blur(8px);
}

.meter span {
  display: block;
  color: #586270;
  font-size: 12px;
  line-height: 1.2;
}

.meter strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.1;
}

.help {
  bottom: 16px;
  flex-wrap: wrap;
  max-width: min(680px, calc(100vw - 32px));
  color: #303845;
  font-size: 13px;
}

kbd {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(22, 26, 34, 0.22);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 12px/1 "Segoe UI", sans-serif;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(25, 31, 42, 0.42);
  box-sizing: border-box;
}

.overlay.is-visible {
  display: grid;
}

.dialog {
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 60px rgba(9, 16, 28, 0.22);
  box-sizing: border-box;
}

.dialog h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
}

.dialog p {
  margin: 0 0 18px;
  color: #505b6a;
  line-height: 1.6;
}

button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #1d7a62;
  color: white;
  cursor: pointer;
  font: 700 16px/1 "Microsoft YaHei", "Segoe UI", sans-serif;
}

button:hover {
  background: #176650;
}

.leaderboard {
  margin: 18px 0 0;
  padding-left: 26px;
  color: #394352;
}

.leaderboard li {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .hud {
    left: 10px;
    right: 10px;
    gap: 6px;
  }

  .meter {
    min-width: 0;
    flex: 1;
    padding: 7px 8px;
  }

  .meter strong {
    font-size: 16px;
  }

  .help {
    left: 10px;
    bottom: 10px;
    gap: 6px;
  }
}
