* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0a0d11;
  color: #f5f7fa;
}

#gameWrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #2f4f33;
}

.panel {
  position: absolute;
  z-index: 2;
  background: rgba(8, 12, 18, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

#hud {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 190px;
  padding: 12px;
}

#hud .row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
}

#hud .label {
  color: #c7d0db;
}

#typingPanel {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  padding: 12px 16px 14px;
  margin-bottom: 0px;
  border-radius: 14px 14px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.typing-title {
  font-size: 14px;
  color: #c7d0db;
  text-align: center;
}

.target-word {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffe27a;
  word-break: break-word;
  text-align: center;
}

.typed-word {
  margin-top: 4px;
  min-height: 24px;
  font-size: 20px;
  color: #6ed1ff;
  text-align: center;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: #9db0c3;
  text-align: center;
}

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

.hidden {
  display: none;
}

.result-card {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(17, 24, 37, 0.95), rgba(5, 8, 14, 0.95));
  text-align: center;
}

.result-title {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
}

.result-desc {
  margin-top: 12px;
  margin-bottom: 20px;
  line-height: 1.6;
  color: #d7dfeb;
  white-space: pre-line;
}
