html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f2ea;
  user-select: none;
  -webkit-user-select: none;
}

#three-canvas,
#pixi-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#three-canvas {
  z-index: 1;
  pointer-events: none;
}

#menu-status {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 3;
  margin: 0 auto;
  width: fit-content;
  font: 16px/1.5 "Microsoft YaHei", sans-serif;
  color: #3b322a;
  background: #fffdf8;
  padding: .5em 1em;
}

#pixi-canvas {
  z-index: 2;
  touch-action: none;
}

#battle-record {
  --record-paper: #faf6eb;
  --record-ink: #3b3226;
  --record-line: #cabb9d;
  --record-accent: #17765c;
  box-sizing: border-box;
  width: min(44rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--record-line);
  border-radius: 12px;
  background: var(--record-paper);
  color: var(--record-ink);
  box-shadow: 0 6px 24px #38281740;
  font: 16px system-ui, sans-serif;
}

#battle-record::backdrop {
  background: #38281755;
}

.battle-record-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: min(36rem, calc(100dvh - 2.125rem));
  padding: 16px;
  box-sizing: border-box;
}

.battle-record-panel header,
.battle-record-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.battle-record-panel h1 {
  margin: 0;
  font-size: 1.15rem;
}

.battle-record-panel p {
  margin: 0;
  font-size: 0.875rem;
}

.battle-record-panel textarea {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--record-line);
  border-radius: 6px;
  resize: none;
  background: #fffdf5;
  color: inherit;
  font: inherit;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
  overscroll-behavior: contain;
}

.battle-record-panel button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--record-line);
  border-radius: 6px;
  background: #fffdf5;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

#copy-battle-record {
  margin-left: auto;
  background: var(--record-accent);
  color: white;
}

.battle-record-panel button:disabled {
  opacity: 0.55;
  cursor: default;
}

.battle-record-panel button:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px var(--record-line);
}

.battle-record-panel button:focus-visible,
.battle-record-panel textarea:focus-visible {
  outline: 2px solid var(--record-accent);
  outline-offset: 2px;
}
