:root {
  color-scheme: dark;
  --panel: #242a31;
  --line: rgba(255,255,255,.14);
  --text: #f7f1e5;
  --muted: #bdc5cc;
  --gold: #f0c86a;
  --red: #f05d55;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(240,200,106,.18), transparent 30%),
    linear-gradient(135deg, #1b211e, #111317);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.shell {
  width: min(1240px, 100vw);
  height: min(820px, 100dvh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 12px;
}

.hud,
.footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(36,42,49,.94);
  box-shadow: 0 18px 50px rgba(0,0,0,.3);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
}

.hud span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hud strong {
  display: block;
  font-size: clamp(20px, 4vw, 30px);
}

.game-wrap {
  position: relative;
  border: 2px solid rgba(255,255,255,.14);
  border-radius: 8px;
  overflow: hidden;
  background: #1a2429;
  box-shadow: 0 22px 60px rgba(0,0,0,.36);
}

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

.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(10,12,16,.62);
  text-align: center;
}

.message.hidden { display: none; }
.message strong {
  color: var(--gold);
  font-size: clamp(40px, 8vw, 78px);
  line-height: 1;
}
.message span {
  color: var(--muted);
}

.footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--muted);
}

button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #171717;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .game-wrap { min-height: 520px; }
  .footer { display: grid; }
}
