:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f8f6f0;
  background: #222726;
}

body { margin: 0; }
main {
  min-height: 100dvh;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#map { position: fixed; inset: 0; background: #262d2e; }
[hidden] { display: none !important; }

.hud, .stats, .status, button {
  background: #151817;
  border: 1px solid #58625c;
  border-radius: 10px;
}

.hud {
  position: fixed;
  z-index: 500;
  inset: 12px 12px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 430px;
  padding: 10px 12px;
}

h1 { font-size: 1.3rem; margin: 0; }
h1 span { color: #cafd59; }
p { margin: 0; }
.hud p { color: #bcc6be; margin-top: 2px; font-size: .8rem; }

.controls {
  position: fixed;
  z-index: 500;
  inset: auto 12px 32px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.stats { display: grid; gap: 4px; padding: 8px 12px; font-variant-numeric: tabular-nums; }
.stats output:first-child { font-weight: 700; }
.stats output:last-child { color: #c2ccc4; font-size: .8rem; }

button {
  color: inherit;
  padding: 7px 10px;
  min-height: 44px;
  font: inherit;
  cursor: pointer;
}

button:focus-visible { outline: 2px solid #cafd59; outline-offset: 2px; }

.pad {
  display: grid;
  grid-template: repeat(2, 46px) / repeat(3, 46px);
  gap: 4px;
}

.pad button {
  padding: 0;
  font-size: 1.3rem;
  pointer-events: auto;
  touch-action: none;
}

.pad button:active { color: #151817; background: #cafd59; }
[data-direction="up"] { grid-column: 2; }
[data-direction="left"] { grid-row: 2; }
[data-direction="down"] { grid-area: 2 / 2; }
[data-direction="right"] { grid-area: 2 / 3; }

.status {
  position: fixed;
  z-index: 500;
  top: auto;
  bottom: 138px;
  left: 12px;
  right: 12px;
  width: fit-content;
  max-width: calc(100% - 46px);
  padding: 7px 10px;
  font-size: .85rem;
}

.round {
  position: fixed;
  z-index: 500;
  top: 82px;
  left: 12px;
  right: 12px;
  width: fit-content;
  max-width: calc(100% - 46px);
  padding: 8px 12px;
  background: #151817;
  border: 1px solid #58625c;
  border-radius: 10px;
  font-size: .85rem;
}

.round output { margin-right: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.round p { margin-top: 4px; color: #c2ccc4; }
.round progress { width: 100%; accent-color: #cafd59; }
#wanted { color: #f8b75c; }
