:root {
  --bg: #0b1020;
  --hud: rgba(10, 12, 18, 0.55);
  --text: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.7);
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

#game {
  width: 100vw;
  height: 100vh;
  display: block;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  color: var(--text);
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  opacity: 0.9;
}
#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.9);
}
#crosshair::before {
  width: 16px;
  height: 2px;
  transform: translate(-50%, -50%);
}
#crosshair::after {
  width: 2px;
  height: 16px;
  transform: translate(-50%, -50%);
}

#hint {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--hud);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  max-width: min(560px, calc(100vw - 24px));
}

#hotbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(9, 46px);
  gap: 8px;
  padding: 10px;
  background: var(--hud);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.slot {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  box-sizing: border-box;
}
.slot.selected {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}
.slot .swatch {
  position: absolute;
  inset: 7px;
  border-radius: 7px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  image-rendering: pixelated;
  background-size: cover;
  background-position: center;
}
.slot .num {
  position: absolute;
  left: 6px;
  bottom: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

#debug {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--hud);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  white-space: pre;
}
