:root {
  --ui-bg: rgba(17, 19, 23, 0.76);
  --ui-border: rgba(238, 242, 229, 0.18);
  --ui-text: #eef2e5;
  --ui-muted: #d7dec9;
  --ui-accent: #d1b66d;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #111317;
  color: var(--ui-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
  image-rendering: pixelated;
  touch-action: none;
}

#game:active {
  cursor: grabbing;
}

.hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(238, 242, 229, 0.18);
  border-radius: 8px;
  background: var(--ui-bg);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  pointer-events: none;
}

.hud__title {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hud__stats {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ui-muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.settings {
  position: fixed;
  top: 58px;
  right: 12px;
  z-index: 2;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.settings__toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.settings__toggle:hover,
.settings__toggle:focus-visible {
  border-color: rgba(209, 182, 109, 0.7);
  outline: none;
}

.settings__panel {
  width: min(260px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: rgba(17, 19, 23, 0.86);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings__row--spaced {
  margin-top: 14px;
}

.settings__label {
  font-size: 13px;
  font-weight: 800;
}

.settings__number,
.settings__select {
  width: 76px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: rgba(238, 242, 229, 0.08);
  color: var(--ui-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  box-sizing: border-box;
}

.settings__select {
  width: 104px;
}

.settings__number:focus,
.settings__select:focus {
  border-color: rgba(209, 182, 109, 0.8);
  outline: none;
}

.settings__checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ui-accent);
}

.settings__checkbox:focus-visible {
  outline: 2px solid rgba(209, 182, 109, 0.75);
  outline-offset: 3px;
}

.help {
  position: fixed;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}

.help span {
  padding: 6px 8px;
  border: 1px solid rgba(238, 242, 229, 0.14);
  border-radius: 8px;
  background: rgba(17, 19, 23, 0.7);
  color: #d7dec9;
  font-size: 12px;
}

@media (max-width: 700px) {
  .hud {
    align-items: flex-start;
    flex-direction: column;
  }

  .hud__stats {
    width: 100%;
    white-space: normal;
  }
}
