/* The existing HUD keeps its vertical position and moves to the right of the board. */
.gngm-callouts-enabled #game-root .gm-hud {
  left: calc(var(--gm-ax-l, 0px) + var(--gm-ax-w, 100vw) - 16px);
  transform: translateX(-100%);
  max-width: calc(var(--gm-ax-w, 100vw) - 24px);
}
.gngm-callouts {
  position: fixed;
  z-index: 4;
  top: 8px;
  left: calc(var(--gm-ax-l, 0px) + var(--gm-ax-w, 100vw) / 2);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 6px;
  width: min(880px, calc(var(--gm-ax-w, 100vw) - 24px));
  max-height: calc(100dvh - 130px);
  pointer-events: none;
  color: #ededed;
  font: 14px/1.35 var(--font-ax, Inter, system-ui, sans-serif);
}
.gngm-callouts[hidden] { display: none; }
.gngm-callout {
  position: relative;
  min-width: 0;
  border: 1px solid #303034;
  border-radius: 8px;
  background: #17171a;
  box-shadow: 0 6px 24px #0008;
  pointer-events: auto;
}
.gngm-callout-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  box-sizing: border-box;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: inherit;
  color: inherit;
  background: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.gngm-callout-open:hover { background: #ffffff05; }
.gngm-callout-open:focus-visible, .gngm-callout-close:focus-visible {
  outline: 2px solid #69cf8d;
  outline-offset: 2px;
}
.gngm-callout-head { display: flex; align-items: center; height: 20px; gap: 6px; padding-right: 17px; min-width: 0; }
.gngm-callout-avatar, .gngm-callout-token-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #303638;
}
.gngm-callout-fallback { color: #c7decf; font-size: 13px; }
.gngm-callout-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gngm-callout-author { display: flex; flex: 1; min-width: 0; }
.gngm-callout-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.gngm-callout-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gngm-callout-simulated { flex: 0 0 auto; color: #a3a99f; font-size: 10px; white-space: nowrap; }
.gngm-callout-time { flex: 0 0 auto; color: #8b8c93; font-size: 10px; font-variant-numeric: tabular-nums; }
.gngm-callout-content { display: flex; align-items: center; min-width: 0; height: 22px; gap: 7px; }
.gngm-callout-text { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ededed; font-size: 14px; font-weight: 600; }
.gngm-callout-token {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex: 0 1 auto;
  gap: 4px;
  max-width: 42%;
  min-width: 0;
  height: 22px;
  box-sizing: border-box;
  padding: 1px 6px 1px 2px;
  border: 1px solid #333338;
  border-radius: 16px;
  background: #252529;
}
.gngm-callout-token-avatar { width: 17px; height: 17px; }
.gngm-callout-ticker { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gngm-callout-chevron { flex: 0 0 auto; color: #b5b5bc; font-size: 16px; line-height: 1; }
.gngm-callout-close {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #7f818a;
  cursor: pointer;
  font: 18px/1 system-ui, sans-serif;
}
.gngm-callout-close:hover { color: #ededed; background: #ffffff0d; }
/* Narrow layouts put cards below navigation and the HUD, rather than over controls. */
@media (max-width: 1480px) {
  .gngm-callouts { top: calc(var(--gm-ax-top, 72px) + 42px); }
}
@media (max-width: 900px) {
  .gngm-callouts { gap: 5px; }
  .gngm-callout-open { padding: 6px 7px; }
  .gngm-callout-head { gap: 4px; }
  .gngm-callout-time { display: none; }
  .gngm-callouts-enabled #game-root .gm-hud { left: calc(var(--gm-ax-l, 0px) + var(--gm-ax-w, 100vw) - 8px); }
}
/* A wide tweet sidebar and the reward HUD can leave too little room for the
   existing position/sell bar. Keep that bar intact and use a second control row. */
@media (max-width: 1920px) {
  .gngm-callouts-enabled #game-root:has(> .gm-pos:not(.hidden):not(.on-chart)) {
    --gngm-callout-control-top: max(var(--gm-hud-top, calc(var(--gm-ax-top, 72px) + 6px)), calc(var(--gm-card-top, calc(var(--gm-ax-top, 72px) + 5px)) + 54px));
  }
  .gngm-callouts-enabled #game-root:has(> .gm-pos:not(.hidden):not(.on-chart)) .gm-hud {
    top: var(--gngm-callout-control-top);
  }
  .gngm-callouts-enabled #game-root:has(> .gm-pos:not(.hidden):not(.on-chart)) .gngm-callouts {
    top: calc(var(--gngm-callout-control-top) + 36px);
  }
  /* Ao() measures the nav and fixed position bar, not this padding. A fixed
     allowance overrides its inline one-row padding without a measurement loop.
     Divide by app zoom because the HUD is outside the zoomed app container. */
  .gngm-callouts-enabled body:has(#game-root > .gm-pos:not(.hidden):not(.on-chart)) #ax-body {
    padding-top: calc(96px / var(--ui-zoom, 1)) !important;
  }
}
