/* Illustrated popup treatment. The original controls and keyboard controller
   remain unchanged; the supplied blank parchment is used as a nine-slice frame. */
#modal {
  border: 22px solid transparent;
  border-image: url('assets/dock/popup/modal-board.png') 100 105 100 105 fill / 22px / 0 stretch;
  border-radius: 0;
  /* The board itself paints the parchment. An opaque rectangle underneath
     filled its transparent edges and made the supplied artwork look boxed. */
  background: transparent;
  color: #32251f;
  padding: 14px;
  box-shadow: none;
}
#modal::backdrop {background: #061b26d9;}
#modal .modal-head {gap: 10px;}
#modal #modalTag {color: #644425;}
#modal > h2 {color: #32251f;}
#modal #modalBody {color: #32251f;}
#modal #modalBody p {color: #3b2b20;}
#modal #modalBody strong {color: #2c2019;}
#modal #modalBody .details {color: #584532;}
#modal #modalBody .color-warn {color: #863b24 !important;}
#modal #modalBody .color-good {color: #245c3b !important;}
#modal .loot-table th, #modal .loot-table td, #modal .list-cargo li {border-color: #6d482c77;}

/* The live action labels sit on the supplied blank dock placard.  Nine-slice
   scaling keeps its irregular edges and corners intact at varying widths. */
#modal .modal-actions .button,
#modal .cart-stepper button,
#modal .close-modal {
  border: 12px solid transparent;
  border-image: url('assets/dock/derived/utility.png') 30 45 30 45 fill / 12px / 0 stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #30251d;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  text-shadow: none;
  min-height: 44px;
}
#modal .modal-actions .button {min-width: 115px; padding: 4px 10px; line-height: 1.25;}
#modal .modal-actions .button.gold {color: #173d34;}
#modal .modal-actions .button.line {color: #30251d;}
#modal .cart-stepper button {width: 44px; padding: 0; font-size: 22px; line-height: 1;}
#modal .close-modal {width: 44px; min-width: 44px; height: 44px; padding: 0; font-size: 24px; line-height: 1;}
@media (hover:hover) {
  #modal .modal-actions .button:hover:not(:disabled),
  #modal .cart-stepper button:hover:not(:disabled),
  #modal .close-modal:hover:not(:disabled) {filter: brightness(1.1) drop-shadow(0 0 4px #ffe7a0);}
}
#modal .modal-actions .button:active:not(:disabled),
#modal .cart-stepper button:active:not(:disabled),
#modal .close-modal:active:not(:disabled) {filter: brightness(1.05);}
#modal .modal-actions .button:disabled,
#modal .cart-stepper button:disabled {opacity: .45; filter: grayscale(.45); cursor: not-allowed;}
#modal .modal-actions .button:focus-visible,
#modal[data-encounter="true"] .modal-actions .button:focus-visible,
#modal .cart-stepper button:focus-visible,
#modal .close-modal:focus-visible {
  outline: none;
  box-shadow: none;
  filter: brightness(1.12) drop-shadow(0 0 4px #fff) drop-shadow(0 0 7px #6b3814);
}
/* Merchant and harbor rows retain their readable dark interior cards. */
#modal #modalBody .harbor-item,
#modal #modalBody .offer,
#modal #modalBody .cart-summary {color: #f8eacb;}
#modal #modalBody .harbor-item p,
#modal #modalBody .offer p,
#modal #modalBody .cart-summary p {color: #e4d8c2;}
#modal #modalBody .harbor-item strong,
#modal #modalBody .offer strong,
#modal #modalBody .cart-summary strong,
#modal #modalBody .cart-summary b {color: #fff2cc;}
#modal #modalBody .harbor-item small,
#modal #modalBody .offer small,
#modal #modalBody .cart-summary small {color: #c9cfbf;}
#modal #modalBody .harbor-item .cart-line {color: #f5d38b;}
#modal #modalBody .cart-summary .color-warn,
#modal #modalBody .offer .color-warn,
#modal #modalBody .harbor-item .color-warn {color: #ffd1aa !important;}
#modal #modalBody .cart-summary .color-good,
#modal #modalBody .offer .color-good,
#modal #modalBody .harbor-item .color-good {color: #bbe5c9 !important;}
/* The ship illustrations and outcome text sit directly on the parchment;
   keep the status, headings and details readable without a rectangular panel. */
#modal[data-neutral-focus="true"] #modalTitle:focus {outline-color:#54311c;}
#modal[data-encounter="true"] #modalBody:focus-visible {outline: 2px solid #54311c; outline-offset: -3px;}
#modal[data-encounter="true"] .encounter-stage {background: transparent; border: 0; color: #32251f;}
#modal[data-encounter="true"] .encounter-scene {background: transparent; border: 0;}
#modal[data-encounter="true"] .encounter-vessel,
#modal[data-encounter="true"] .encounter-vessel figcaption strong,
#modal[data-encounter="true"] .encounter-vessel figcaption small,
#modal[data-encounter="true"] .encounter-role,
#modal[data-encounter="true"] .encounter-divider {color: #3b2b20;}
#modal[data-encounter="true"] #modalBody .encounter-stage p {color: #3b2b20;}
#modal[data-encounter="true"] #modalBody .encounter-stage strong {color: #2c2019;}
#modal[data-encounter="true"] #modalBody .encounter-stage .details {color: #584532;}
#modal[data-encounter="true"] #modalBody .encounter-stage .color-warn {color: #863b24 !important;}
#modal[data-encounter="true"] #modalBody .encounter-stage .color-good {color: #245c3b !important;}
#modal[data-encounter="true"] #modalBody .encounter-status {color: #50341d; border-left-color: #80592f;}
#modal[data-encounter="true"] .loot-table th, #modal[data-encounter="true"] .loot-table td {border-color: #6d482c77;}
#modal #modalBody .parrot-reply {background:#103542;border-color:#526d67;}
#modal #modalBody .parrot-reply p {color:#f8eacb;}
@media (max-width: 520px) {
  #modal {border-width: 15px; border-image-width: 15px; padding: 10px;}
  #modal[data-encounter="true"] {padding: 10px;}
  #modal .modal-actions .button {min-width: 0;}
}
@media (forced-colors: active) {
  #modal .modal-actions .button:focus-visible,
  #modal[data-encounter="true"] .modal-actions .button:focus-visible,
  #modal .cart-stepper button:focus-visible,
  #modal .close-modal:focus-visible,
  #modal[data-encounter="true"] #modalBody:focus-visible,
  #modal[data-neutral-focus="true"] #modalTitle:focus {outline: 2px solid Highlight; outline-offset: 2px;}
}
