/* Exit Code Zero v4: the world's DOM problem tag. Owner: world.
   The problem of the round, as one short tag pinned to the thing in the world (CRITIQUE 6).
   js/world.js sets left and top every frame (the anchor point) and --pc (the tone dot). */
#ptag {
  position: fixed; left: 0; top: 0; z-index: 4;
  transform: translate(-50%, calc(-100% - 10px));
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px 7px 9px;
  background: #ffffff; border-radius: 10px;
  border: 1px solid rgba(15, 15, 15, 0.07);
  box-shadow: 0 2px 4px rgba(16, 60, 40, 0.06), 0 12px 26px -10px rgba(16, 80, 50, 0.3);
  font: 500 12px/1 "Geist Mono", ui-monospace, monospace; color: #1d1d1d;
  white-space: nowrap; pointer-events: none;
  max-width: calc(100vw - 32px);
}
#ptag::after {
  content: ""; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -6px; width: 10px; height: 10px; background: #ffffff;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(15, 15, 15, 0.07); border-bottom: 1px solid rgba(15, 15, 15, 0.07);
  border-bottom-right-radius: 2px;
}
#ptag[data-place="below"] { transform: translate(-50%, 10px); }
#ptag[data-place="below"]::after {
  bottom: auto; top: -6px; transform: translateX(-50%) rotate(225deg);
}
#ptag i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, #f0a400); flex: none; }
#ptag span { overflow: hidden; text-overflow: ellipsis; }
#ptag[data-tone="red"] { border-color: rgba(229, 72, 77, 0.28); }
#ptag[data-tone="red"] span { color: #8f1d22; }
/* with no free spot (the goal line, the bubble and the sheet are never covered) world.js hides the tag */
#ptag[data-off="1"] { visibility: hidden; }
@media (max-width: 759px) {
  #ptag { font-size: 13px; padding: 6px 10px 6px 8px; }
  /* a tag wider than the screen wraps onto a second line (balanced) instead of losing its last words; max-content
     keeps a tag pinned near the right edge from shrinking to the space left of its anchor */
  #ptag { width: max-content; white-space: normal; }
  #ptag span { line-height: 1.3; text-wrap: balance; }
}
@media (prefers-reduced-motion: reduce) {
  #ptag { transition: none; }
}
