:root {
  --bg: #0f1226;
  --bg-2: #1b2044;
  --panel: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa3cc;
  --accent: #6ee7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(1200px 800px at 50% -10%, var(--bg-2), var(--bg) 60%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: none;
}

.app {
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 4px;
  background: linear-gradient(90deg, var(--accent), #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats {
  display: flex;
  gap: 8px;
}

.stat {
  min-width: 58px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  text-align: center;
  line-height: 1.2;
}

.stat .label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.stat .value {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.stage {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 12, 30, 0.82);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

.overlay h2 {
  margin: 0;
  font-size: 28px;
}

.overlay p {
  margin: 0;
  color: var(--muted);
}

.overlay button {
  margin-top: 8px;
  padding: 10px 24px;
  font-size: 16px;
  font-family: inherit;
  color: #0b1020;
  background: linear-gradient(90deg, var(--accent), #b388ff);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

.overlay button:hover {
  filter: brightness(1.08);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hint p {
  margin: 0;
}

kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  font-family: inherit;
  font-size: 11px;
}
