* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #c8d4dc;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #c8d4dc;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top, 0px)) 36px 20px;
  padding-left: max(36px, env(safe-area-inset-left, 0px));
  padding-right: max(36px, env(safe-area-inset-right, 0px));
  pointer-events: none;
  color: #000;
  font-size: clamp(20px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.02em;
  z-index: 10;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hud-left {
  text-align: left;
}

.hud-right {
  text-align: right;
}

.feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(48px, 10vw, 96px);
  font-weight: bold;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.feedback.show {
  opacity: 1;
}

.feedback.correct {
  color: #2ecc71;
  text-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

.feedback.wrong {
  color: #e74c3c;
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
}

.feedback.hidden {
  display: none;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  color: #fff;
  padding: 40px;
  max-width: 480px;
}

.overlay-content h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

.overlay-content p {
  font-size: 16px;
  color: #ccc;
  margin-bottom: 8px;
}

.overlay-content .hint {
  font-size: 13px;
  color: #888;
  margin-bottom: 24px;
}

.overlay-content .status {
  font-size: 14px;
  color: #f39c12;
  margin-bottom: 24px;
}

.overlay-content .status.connected {
  color: #2ecc71;
}

.start-btn {
  padding: 14px 48px;
  font-size: 18px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.start-btn:hover {
  background: #2980b9;
}
