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

* { 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% 0%, rgba(240, 200, 106, 0.2), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(255, 120, 210, 0.16), transparent 34%),
    #121317;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

.topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(37,42,49,.94);
}

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

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

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

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

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

.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10,12,16,.62);
  font-size: clamp(34px, 7vw, 70px);
  font-weight: 900;
  text-align: center;
}

.message.hidden { display: none; }

@media (max-width: 680px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; }
  .topbar { grid-template-columns: repeat(2, 1fr); }
  .board-wrap { min-height: 560px; }
}
