:root {
  color-scheme: light;
  --page: #f4f1e8;
  --panel: #fdfbf6;
  --line: #dbd7c9;
  --text: #252a23;
  --secondary: #5d6358;
  --leaf: #24573f;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
.shell { width: min(54rem, calc(100% - 2rem)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar-inner {
  min-height: 3.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .875rem;
}
.brand { font-weight: 650; letter-spacing: .04em; }
.brand span { color: #839082; }
a { color: var(--leaf); text-underline-offset: .22em; }
a:hover { color: var(--text); }
main { padding-block: 1.6rem 2rem; }
.intro { display: flex; align-items: baseline; gap: .7rem 1.1rem; flex-wrap: wrap; margin-bottom: .95rem; }
h1, p, dl, dd { margin: 0; }
h1 { font: 800 clamp(1.75rem, 4.5vw, 2.6rem)/1.12 "Songti SC", "Noto Serif CJK SC", "SimSun", serif; letter-spacing: .03em; }
.intro p { color: var(--secondary); font-size: .875rem; }
.game {
  --panel: #1d2622;
  --line: #3c4a40;
  --text: #f1eedf;
  --secondary: #b4bfb0;
  --leaf: #b9d39a;
  color-scheme: dark;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--panel);
  box-shadow: 0 .5rem 1.15rem #3730231f;
  overflow: hidden;
}
.game-bar, .game-footer {
  min-height: 2.75rem;
  padding: .52rem .95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem 1.15rem;
  color: var(--secondary);
  font-size: .8rem;
}
.game-bar { border-bottom: 1px solid var(--line); }
.game-footer { border-top: 1px solid var(--line); }
#place { color: var(--leaf); font-weight: 650; white-space: nowrap; }
#place::before {
  content: "";
  display: inline-block;
  width: .4rem;
  height: .4rem;
  margin-right: .5rem;
  vertical-align: .09em;
  background: var(--leaf);
}
dl, dl > div { display: flex; align-items: baseline; }
dl { flex-wrap: wrap; gap: .35rem 1rem; }
dl > div { gap: .4rem; }
dd, code, kbd { font-family: var(--mono); color: var(--text); }
dd { font-variant-numeric: tabular-nums; }
.seed { overflow-wrap: anywhere; }
kbd {
  display: inline-block;
  border: 1px solid #465447;
  border-radius: .22rem;
  background: #29352d;
  padding: .07rem .34rem;
  font-size: .75rem;
  white-space: nowrap;
}
.screen { position: relative; background: #7c9b56; }
canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
canvas:focus-visible { outline: 2px solid var(--leaf); outline-offset: -3px; }
.minimap {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: min(29%, 8.5rem);
  margin: 0;
  padding: .32rem;
  border: 1px solid #a3af93;
  border-radius: .35rem;
  background: #172520;
  box-shadow: 0 2px 8px #15211966;
  pointer-events: none;
}
.minimap figcaption {
  display: flex;
  justify-content: space-between;
  gap: .2rem;
  margin-bottom: .25rem;
  color: #f1eedf;
  font-size: .625rem;
  line-height: 1;
  white-space: nowrap;
}
.minimap figcaption span { color: var(--leaf); }
.minimap-view { position: relative; }
#minimap-player {
  position: absolute;
  width: .43rem;
  height: .43rem;
  border-radius: 50%;
  background: #a1efff;
  box-shadow: 0 0 0 1px #0c1c21;
  transform: translate(-50%, -50%);
}
#play-unavailable {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--text);
}
#play-unavailable[hidden] { display: none; }
.touch-controls { display: none; }
@media (pointer: coarse) {
  .keyboard-help { display: none; }
  .game-footer { flex-wrap: wrap; }
  .touch-controls { display: flex; gap: .4rem; width: 100%; }
  .touch-controls button {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    touch-action: manipulation;
  }
}
@media (max-width: 34rem) {
  main { padding-block: 1.25rem; }
  .intro { display: grid; gap: .4rem; }
  .game-bar, .game-footer { padding-inline: .65rem; }
  .minimap { top: .3rem; right: .3rem; padding: .22rem; }
}
