/* The map owns Center gestures; drawers retain their native scrolling. */
body.center-mode #world {
  touch-action: none;
}

body.center-mode .center-faint-notice {
  pointer-events: none;
}

/* Center services float over the map, each above its place: the Nurse, the
   Depot locker and the PC. web/app.js anchors them every frame through
   world.centerScreen(). Actions work throughout the Center. E chooses the
   nearest service, while all available actions stay above the HUD panels. */
#center-hud {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
#center-hud .icon-sparkles {
  --ui-icon: url("/_assets/b88d45443fa2dbfe501f/icons/sparkles.svg");
}
.center-service {
  position: absolute;
  top: var(--center-y, -999px);
  left: var(--center-x, -999px);
  transform: translate(-50%, -100%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--ui-color-border) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-color-surface) 82%, transparent);
  color: var(--ui-color-text);
  font: 700 10px/1.2 var(--ui-font-body);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgb(0 0 0 / 40%);
  pointer-events: auto;
  cursor: default;
}
.center-service[data-placed="false"] {
  visibility: hidden;
  pointer-events: none;
}
.center-service .ui-icon {
  font-size: 11px;
  opacity: 0.85;
}
.center-service :is(.center-service-action, kbd) {
  display: none;
}
/* Available service: the plaque becomes an action button. */
.center-service[data-near="true"] {
  padding: 3px 9px;
  border-color: var(--ui-color-primary);
  background: var(--ui-color-action);
  color: var(--ui-color-on-primary);
  font-size: 11px;
  cursor: pointer;
}
.center-service[data-near="true"] .ui-icon {
  opacity: 1;
}
.center-service[data-near="true"] .center-service-name {
  display: none;
}
.center-service[data-near="true"] :is(.center-service-action, kbd) {
  display: inline;
}
.center-service[data-near="true"]:hover:not(:disabled) {
  background: var(--ui-color-action-hover);
}
.center-service:focus-visible {
  outline: var(--ui-focus-width) solid var(--ui-color-focus);
  outline-offset: var(--ui-focus-offset);
}
.center-service .vip-badge {
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 8px;
  line-height: 1.3;
}
.center-service .vip-badge[hidden] {
  display: none;
}
.center-service[data-near="true"] .vip-badge {
  color: inherit;
}
.center-service kbd {
  min-width: 12px;
  padding: 0 3px;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
  border-radius: 999px;
  font: inherit;
  font-size: 9px;
  text-align: center;
}
#center-hud .center-service kbd[hidden] {
  display: none;
}

@media (max-width: 760px), (pointer: coarse) {
  body.center-mode .bottom-tools {
    display: none;
  }

  body.center-mode .center-faint-notice {
    --hud-top-indicator-active: 0;
    top: auto;
    bottom: calc(
      max(
          8px,
          env(safe-area-inset-bottom),
          var(--hud-chat-space-bottom, 64px)
        ) +
        8px
    );
  }
}

@media (pointer: coarse) {
  /* Touch: the pill stays small, an invisible 44 px area takes the tap;
     no key hint. */
  .center-service[data-near="true"] {
    padding: 4px 11px;
    font-size: 12px;
  }
  .center-service[data-near="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -6px;
    left: -6px;
    height: 44px;
    transform: translateY(-50%);
  }
  #center-hud .center-service[data-near="true"] kbd {
    display: none;
  }
}
