/* ===================================================================
   INTERACTIVE MAP OBJECTS (js/game/06-interactions.js)
   Nearby portals, NPCs, and vendors show their action and requirements (rank, email, fee).
   Press E or tap the prompt to interact. Colors and fonts follow css/game/07-theme.css.
   =================================================================== */
.interaction-prompt {
  position: absolute;
  z-index: 10;
  /* Just below the character (the camera keeps it in the middle), clear of the chat and the dock. */
  top: 57%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  /* As wide as its text (a box at left: 50% would otherwise fit in half the screen). */
  width: max-content;
  max-width: min(92%, 460px);
  padding: 8px 14px 8px 8px;
  border: 2px solid var(--z-outline, #101419);
  border-radius: 0;
  background: var(--t-hud-bg, #17120ce6);
  color: var(--t-hud-color, #f7efd8);
  box-shadow: inset 0 0 0 1px var(--t-hud-line, #a77b2f), 3px 3px 0 var(--z-shadow, #182327);
  font-family: var(--z-font-text, inherit);
  text-align: left;
  cursor: pointer;
  animation: interaction-prompt-in .18s ease-out;
}
.interaction-prompt[hidden] { display: none; }
.interaction-prompt:hover, .interaction-prompt:focus-visible { border-color: var(--t-hud-color, #f2dfbf); }
.interaction-prompt-key {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 2px solid var(--z-outline, #101419);
  border-radius: 0;
  background: var(--t-field-bg, #fff0d6);
  color: var(--t-field-color, #35272c);
  font: 18px/1 var(--z-font-title, inherit);
  box-shadow: inset 0 -3px 0 #0003;
}
.interaction-prompt-key[hidden] { display: none; }
.interaction-prompt-copy { display: grid; gap: 2px; min-width: 0; }
.interaction-prompt-copy b {
  overflow: hidden;
  color: var(--t-hud-color, #f2dfbf);
  font: 16px/1.2 var(--z-font-title, inherit);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interaction-prompt-copy small { font-size: 13px; line-height: 1.25; opacity: .9; }
.interaction-prompt-needs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.interaction-prompt-needs:empty { display: none; }
.interaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid var(--t-hud-line, #a77b2f);
  border-radius: 0;
  background: color-mix(in srgb, var(--t-hud-bg) 80%, var(--z-shadow));
  font-size: 12px;
  white-space: nowrap;
}
.interaction-badge .icon-image { width: 1em; height: 1em; }
@keyframes interaction-prompt-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .interaction-prompt { animation: none; } }

/* On mobile, use the game width above the joysticks and dock. */
@media (max-width: 760px), (max-height: 520px) {
  .interaction-prompt { top: 56%; max-width: 94%; padding: 6px 10px 6px 6px; gap: 8px; }
  .interaction-prompt-key { width: 28px; height: 28px; font-size: 15px; }
  .interaction-prompt-copy b { font-size: 14px; }
  .interaction-prompt-copy small { font-size: 12px; }
}
