/* Highlight unread incoming messages without moving the controls. */
.gpc-dm-unread-dot {
  display: inline-block;
  width: .6em;
  height: .6em;
  margin-right: .55em;
  border-radius: 50%;
  background: #ad3664;
  vertical-align: .08em;
  animation: gpc-dm-unread-pulse 1.6s ease-out infinite;
}
@keyframes gpc-dm-unread-pulse {
  from { box-shadow: 0 0 0 0 rgba(173, 54, 100, .55); }
  to { box-shadow: 0 0 0 .4em rgba(173, 54, 100, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .gpc-dm-unread-dot { animation: none; }
}
.view-gc-player-roster .pr-identity .gpc-card-actions a.gpc-has-unread {
  background-color: #f8dce5;
  animation: gpc-message-fill 1s ease-in-out infinite;
}
@keyframes gpc-message-fill {
  0%, 100% { background-color: #fffef9; }
  50% { background-color: #f8dce5; }
}
@media (prefers-reduced-motion: reduce) {
  .view-gc-player-roster .pr-identity .gpc-card-actions a.gpc-has-unread {
    animation: none;
    background-color: #f8dce5;
  }
}

/* Keep Drupal's form, validation feedback and links inside the dialog. */
html.gpc-message-popup body {
  margin: 0 !important;
  padding: 0 !important;
  background: #fffcf5;
}
.gpc-message-popup body :is(#admin-menu, #toolbar, #page-title, .tabs, .breadcrumb,
  .contextual-links-wrapper, .region-page-top, .region-page-bottom) {
  display: none !important;
}
.gpc-message-popup :is(body, body *):has(#block-system-main) >
  :not(:has(#block-system-main, .messages), #block-system-main, .messages, #colorbox, #cboxOverlay) {
  display: none !important;
}
.gpc-message-popup body :has(#block-system-main) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  float: none !important;
}
.gpc-message-popup #block-system-main { padding: 1rem; }

/* Leave a finger-sized close control below the message iframe. */
#colorbox:has(iframe:is([src*="/character-messages/"], [src*="/gohtlan-messages/"], [src*="dm_read="], [src*="character_read="])) #cboxLoadedContent {
  box-sizing: border-box;
  padding-bottom: 24px;
}
#colorbox:has(iframe:is([src*="/character-messages/"], [src*="/gohtlan-messages/"], [src*="dm_read="], [src*="character_read="])) #cboxClose {
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  right: 0;
  bottom: 0;
  overflow: hidden;
  border: 1px solid #756854;
  border-radius: 5px;
  background: #fffaf2;
  color: #392f28;
  text-indent: -9999px;
}
.ui-dialog .ui-dialog-titlebar {
  box-sizing: border-box;
  min-height: 56px;
  padding-right: 58px;
  display: flex;
  align-items: center;
}
.ui-dialog .ui-dialog-titlebar .ui-dialog-title {
  width: auto;
  min-width: 0;
}
.ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close {
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  position: absolute;
  top: 50%;
  right: 3px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #756854;
  border-radius: 5px;
  background: #fffaf2;
  color: #392f28;
}
.ui-dialog .ui-dialog-titlebar-close .ui-icon {
  background: none;
}
.ui-dialog .ui-dialog-titlebar-close:focus-visible, #colorbox #cboxClose:focus-visible {
  outline: 2px solid #754b1c;
  outline-offset: 1px;
}
.ui-dialog .ui-dialog-titlebar-close::before,
.ui-dialog .ui-dialog-titlebar-close::after,
#colorbox:has(iframe:is([src*="/character-messages/"], [src*="/gohtlan-messages/"], [src*="dm_read="], [src*="character_read="])) #cboxClose::before,
#colorbox:has(iframe:is([src*="/character-messages/"], [src*="/gohtlan-messages/"], [src*="dm_read="], [src*="character_read="])) #cboxClose::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.ui-dialog .ui-dialog-titlebar-close::after,
#colorbox:has(iframe:is([src*="/character-messages/"], [src*="/gohtlan-messages/"], [src*="dm_read="], [src*="character_read="])) #cboxClose::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
