:root {
  color-scheme: dark;
  --panel: rgba(30, 25, 20, .9);
  --line: rgba(255, 226, 158, .22);
  --gold: #f4c95a;
  --amber: #d6892c;
  --text: #fff7df;
  --muted: #d8c9aa;
}

* { 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 18% 6%, rgba(244, 201, 90, .22), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(58, 147, 190, .16), transparent 30%),
    linear-gradient(180deg, #18344a 0%, #2a211c 48%, #100d0a 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

.hud,
.footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .32);
}

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

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

.hud strong {
  display: block;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1;
}

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

.arena {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #17110d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .36);
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 9, 7, .68);
  text-align: center;
}

.overlay.hidden { display: none; }

.overlay > div {
  width: min(460px, calc(100% - 32px));
  border: 1px solid rgba(255, 226, 158, .32);
  border-radius: 8px;
  background: rgba(35, 27, 19, .94);
  padding: 24px;
}

.overlay span {
  color: var(--gold);
  font-weight: 900;
}

.overlay h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
}

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

.footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px;
  padding: 10px 12px;
}

.footer b {
  display: block;
  color: var(--gold);
}

.footer strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arena { min-height: 620px; }
  .footer { grid-template-columns: 1fr; }
}
