:root {
  --bg: #0c0810;
  --ink: #f4ead8;
  --muted: #c4b29a;
  --accent: #ff9a43;
  --accent-2: #ff5d4a;
  --glass: rgba(12, 8, 14, 0.55);
  --line: rgba(255, 196, 140, 0.22);
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", "Noto Sans SC", monospace;
}

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

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
}

#vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(8, 4, 8, 0.55) 100%),
    linear-gradient(to bottom, rgba(8, 4, 10, 0.28), transparent 16%, transparent 78%, rgba(8, 4, 10, 0.45));
  z-index: 2;
}

#crosshair {
  pointer-events: none;
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  z-index: 4;
  border: 1.5px solid rgba(255, 232, 200, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 154, 67, 0.35);
}
#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 232, 200, 0.9);
  left: 50%;
  top: 50%;
}
#crosshair::before {
  width: 1.5px;
  height: 8px;
  transform: translate(-50%, -50%);
}
#crosshair::after {
  width: 8px;
  height: 1.5px;
  transform: translate(-50%, -50%);
}

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 28px 0;
  pointer-events: none;
  gap: 20px;
}

.brand .title {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.brand .sub {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--accent);
  font-weight: 500;
  opacity: 0.9;
}

.stats {
  display: flex;
  gap: 22px;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.stat .value {
  font-family: var(--num);
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
  color: #fff6ea;
  text-shadow: 0 0 18px rgba(255, 154, 67, 0.35);
}

.health .bar {
  width: 110px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.health .bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(255, 93, 74, 0.65);
  transform-origin: left center;
  transition: width 0.2s ease;
}

.hint {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(244, 234, 216, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 16, 10, 0.42), rgba(6, 4, 8, 0.72));
  cursor: default;
}

.overlay[hidden] { display: none !important; }

.panel {
  width: min(440px, calc(100vw - 40px));
  padding: 36px 34px 32px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(28, 16, 16, 0.82), rgba(10, 8, 12, 0.88));
  border: 1px solid rgba(255, 186, 120, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 220, 180, 0.1);
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.kicker {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 600;
}

.panel h1 {
  margin: 10px 0 12px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  line-height: 1.15;
}

.desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 16px;
}

.tips {
  list-style: none;
  text-align: left;
  margin: 0 auto 22px;
  color: #e6d8c4;
  font-size: 13px;
  line-height: 1.9;
  width: fit-content;
  max-width: 100%;
}

.tips li::before {
  content: "▸";
  color: var(--accent);
  margin-right: 8px;
}

.final-score {
  font-family: var(--num);
  font-size: 28px;
  font-weight: 700;
  color: #fff6ea;
  margin: 4px 0 22px;
  letter-spacing: 0.08em;
}

#start-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #2a1208;
  background: linear-gradient(180deg, #ffd089, #ff9440);
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 130, 40, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}

#start-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
#start-btn:active { transform: translateY(1px); }

@media (max-width: 640px) {
  .hud-top { padding: 14px 14px 0; }
  .brand .title { font-size: 16px; letter-spacing: 0.12em; }
  .stats { padding: 8px 10px; gap: 12px; border-radius: 12px; }
  .health .bar { width: 72px; }
  .stat .value { font-size: 16px; }
  .hint { bottom: 14px; font-size: 11px; letter-spacing: 0.08em; padding: 0 12px; }
  .panel h1 { font-size: 30px; }
  .panel { padding: 26px 20px 24px; }
}
