:root {
  --bg: #070910;
  --ink: #e8f0ff;
  --mute: #9aa8c7;
  --gold: #ffd36a;
  --glow: #7cf0c2;
  --danger: #ff6b8a;
}

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

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

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

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

#hud {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 22px;
  align-items: center;
}

.label {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--mute);
}

.bar {
  width: 180px;
  height: 8px;
  margin-top: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 0 16px rgba(124, 240, 194, 0.18);
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2ee6a6, var(--gold));
  transform-origin: left center;
  transition: transform 0.12s linear;
}

.score-wrap {
  text-align: right;
}

.score-wrap strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(8, 14, 28, 0.28), rgba(4, 6, 12, 0.72));
  z-index: 3;
}

.panel {
  width: min(520px, calc(100% - 40px));
  padding: 36px 34px 28px;
  border-radius: 28px;
  background: rgba(10, 16, 32, 0.72);
  border: 1px solid rgba(255, 211, 106, 0.18);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  text-align: center;
}

.eyebrow {
  color: var(--gold);
  letter-spacing: 0.42em;
  font-size: 11px;
}

h1 {
  margin: 14px 0 12px;
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 500;
  letter-spacing: 0.18em;
}

.lead {
  color: var(--mute);
  line-height: 1.8;
  font-size: 15px;
}

.tips {
  list-style: none;
  margin: 22px 0 26px;
  color: #c9d4ee;
  font-size: 14px;
  line-height: 2;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 12px 28px;
  border-radius: 999px;
  color: #14110a;
  background: linear-gradient(180deg, #ffe7a3, var(--gold));
  font-size: 16px;
  letter-spacing: 0.18em;
  box-shadow: 0 0 28px rgba(255, 211, 106, 0.35);
}

button:hover {
  filter: brightness(1.06);
}

.best {
  margin-top: 18px;
  color: var(--mute);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.best span,
.lead strong {
  color: var(--gold);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  #hud {
    padding: 16px;
  }

  .bar {
    width: 120px;
  }

  .hud-right {
    gap: 14px;
  }

  .score-wrap strong {
    font-size: 22px;
  }

  .panel {
    padding: 28px 20px 22px;
  }
}
