
:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #929292;
  --line: rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter,
    "Helvetica Neue",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

body {
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-mark {
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border: 1px solid #dedede;
  border-top-color: #111;
  border-radius: 50%;
  animation: rotate 0.85s linear infinite;
}

.loading p {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.loading span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.error {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  width: min(90%, 500px);
  padding: 14px 18px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.error[hidden] {
  display: none;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  .loading p {
    font-size: 13px;
  }
}
