/* Full figures, a clear name ribbon, and editing controls that stay in place. */
#captain-roster-page .captain-owned-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 25px 21px;
}

#captain-roster-page .captain-gallery-card {
  --ribbon-edge: #987039;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  isolation: auto;
  border: 1px solid #75603d;
  border-top-color: var(--faction-color, #aa8b53);
  border-radius: 9px;
  background: radial-gradient(ellipse at 50% 28%, #a5853720, transparent 65%), linear-gradient(155deg, var(--faction-tint, #41332522), #19171c 85%);
  box-shadow: 0 6px 18px #0003;
  transform-style: preserve-3d;
  transform-origin: center 60%;
}

#captain-roster-page .captain-gallery-card.is-unowned {
  border-color: #4b4540;
  border-top-color: #776d5d;
  background: radial-gradient(ellipse at 50% 28%, #a3977e0d, transparent 65%), #1b191c;
}

#captain-roster-page .captain-gallery-card.is-dirty {
  border-color: #d0aa61;
  box-shadow: 0 0 0 1px #c5a15a26, 0 7px 20px #0004;
}

#captain-roster-page .captain-gallery-card .captain-card-face {
  position: relative;
  z-index: 1;
  min-width: 0;
  transform-style: preserve-3d;
}

#captain-roster-page .captain-gallery-card .captain-card-edit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
  padding: 16px 13px 0;
  overflow: visible;
  border-radius: 8px 8px 0 0;
  background: transparent;
  transform-style: preserve-3d;
}

#captain-roster-page .captain-gallery-card .captain-card-edit:hover {
  background: transparent;
}

#captain-roster-page .captain-gallery-card .captain-card-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 240px;
  aspect-ratio: auto;
  margin: 0 0 6px;
  padding: 8px 5px 12px;
  overflow: visible;
  isolation: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform-style: preserve-3d;
  pointer-events: none;
}

#captain-roster-page .captain-gallery-card .captain-card-art::after {
  position: absolute;
  z-index: -1;
  content: "";
  width: 60%;
  height: 15px;
  left: 20%;
  bottom: 1px;
  border-radius: 50%;
  background: #0006;
  filter: blur(9px);
  transform: rotateX(65deg);
  pointer-events: none;
}

#captain-roster-page .captain-gallery-card .captain-card-portrait {
  position: relative;
  z-index: 1;
  display: block;
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateY(0) translateZ(0) scale(1);
  transform-origin: center bottom;
  filter: drop-shadow(0 7px 5px #0005);
  pointer-events: none;
}

#captain-roster-page .captain-gallery-card.is-unowned .captain-card-art {
  filter: grayscale(1);
  opacity: .55;
}

#captain-roster-page .captain-gallery-card .captain-name-ribbon {
  position: relative;
  z-index: 3;
  display: block;
  width: calc(100% - 14px);
  max-width: 100%;
  min-height: 43px;
  margin: 2px 0 0;
  padding: 10px 9px;
  border: 1px solid #e6c07a;
  border-top-color: #ffe5a8;
  border-bottom-color: #80582b;
  border-radius: 2px;
  background: linear-gradient(112deg, #5b1c1f 0%, #a63835 18%, #be4b42 47%, #9b302f 82%, #5b1c1f 100%);
  color: #fff0d6;
  box-shadow: 0 3px 7px #0005, inset 0 1px 0 #fff1bd80, inset 0 -2px 0 #8b5c2733;
  font: 650 18px/1.25 var(--serif, Georgia, serif);
  letter-spacing: -.02em;
  text-align: center;
  text-shadow: 0 1px 2px #3a0b0b;
  overflow-wrap: normal;
  word-break: normal;
  transform: translateZ(12px);
}

#captain-roster-page .captain-gallery-card .captain-name-ribbon::before,
#captain-roster-page .captain-gallery-card .captain-name-ribbon::after {
  position: absolute;
  z-index: -1;
  top: 5px;
  content: "";
  width: 17px;
  height: calc(100% - 3px);
  border: 1px solid #bd904b;
  background: linear-gradient(#5c1b20, #9c3433 45%, #54171c);
  box-shadow: 0 2px 3px #0004;
  pointer-events: none;
}

#captain-roster-page .captain-gallery-card .captain-name-ribbon::before {
  left: -12px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 24% 50%);
  transform: rotate(-4deg);
}

#captain-roster-page .captain-gallery-card .captain-name-ribbon::after {
  right: -12px;
  clip-path: polygon(0 0, 100% 0, 76% 50%, 100% 100%, 0 100%);
  transform: rotate(4deg);
}

#captain-roster-page .captain-gallery-card.faction-hero .captain-name-ribbon {
  background: linear-gradient(112deg, #9f7137 0%, #d9ad63 13%, #f1d596 46%, #d7ab60 83%, #aa7739 100%);
  color: #32220f;
  text-shadow: 0 1px 0 #fff0c66b;
}

#captain-roster-page .captain-gallery-card.faction-hero .captain-name-ribbon::before,
#captain-roster-page .captain-gallery-card.faction-hero .captain-name-ribbon::after {
  background: linear-gradient(#b78a48, #e0b86e 45%, #9d6a30);
}

#captain-roster-page .captain-gallery-card.is-unowned .captain-name-ribbon {
  border-color: #9c8b6b;
  background: linear-gradient(110deg, #5b5040, #807059 45%, #5e5140);
  color: #e3d6b8;
  text-shadow: 0 1px 1px #0006;
}

#captain-roster-page .captain-gallery-card.is-unowned .captain-name-ribbon::before,
#captain-roster-page .captain-gallery-card.is-unowned .captain-name-ribbon::after {
  border-color: #8e7b59;
  background: linear-gradient(#66543a, #8e7855, #5b4a33);
}

#captain-roster-page .captain-gallery-card .captain-inline-level {
  top: 13px;
  right: 13px;
  z-index: 6;
  transform: translateZ(24px);
}

#captain-roster-page .captain-gallery-card .captain-inline-level input {
  width: 63px;
  height: 38px;
  padding: 4px;
  border: 1px solid #d8b977;
  border-radius: 5px;
  background: linear-gradient(#343127, #211f1a);
  box-shadow: 0 2px 6px #0006, inset 0 0 0 2px #b79b5433;
  color: #fff0c5;
  font-size: 17px;
  font-weight: 650;
}

#captain-roster-page .captain-gallery-card .captain-inline-stars {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  width: min(238px, calc(100% - 24px));
  margin: 15px auto 6px;
}

#captain-roster-page .captain-gallery-card .captain-inline-stars button,
#captain-roster-page .captain-gallery-card .captain-inline-stars button:first-child {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #8b7d60;
  font-size: 23px;
  line-height: 1;
}

#captain-roster-page .captain-gallery-card .captain-inline-stars button.is-filled {
  color: #efc367;
  text-shadow: 0 1px 4px #bf7e263d;
}

#captain-roster-page .captain-gallery-card .captain-inline-stars button[aria-pressed="true"] {
  border-color: #b68e43;
  background: #b68e4314;
}

#captain-roster-page .captain-gallery-card .hero-card-vip {
  position: relative;
  z-index: 3;
  min-height: 35px;
  margin: 16px 10px 6px;
}

#captain-roster-page .captain-gallery-card .hero-vip-pill {
  padding: 4px 12px;
  font-size: 12px;
}

#captain-roster-page .captain-gallery-card .captain-card-completion {
  position: relative;
  z-index: 2;
  min-height: 15px;
  margin: 0 12px 10px;
  font-size: 11px;
  line-height: 1.4;
}

#captain-roster-page .captain-gallery-card.is-unowned .captain-card-completion.is-dirty {
  display: block;
}

#captain-edit-dialog .captain-star-picker {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

#captain-roster-page .captain-gallery-card .captain-inline-actions {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  min-width: 0;
  margin: 0 12px 11px;
}

#captain-roster-page .captain-gallery-card .captain-inline-actions > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 7px 5px;
  border: 1px solid #8c7146;
  border-radius: 4px;
  background: #30271b;
  color: #ebd4a5;
  font: 550 12px/1.35 var(--sans, Arial, sans-serif);
}

#captain-roster-page .captain-gallery-card .captain-inline-actions > .captain-inline-save {
  border-color: #d3ac65;
  background: linear-gradient(#c39a53, #97703b);
  color: #1d170f;
  font-weight: 700;
}

#captain-roster-page .captain-gallery-card .captain-inline-actions > .captain-inline-undo {
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

#captain-roster-page .captain-gallery-card .captain-inline-actions > button:disabled {
  opacity: .45;
  cursor: default;
}

#captain-roster-page .captain-gallery-card .captain-card-footer {
  position: relative;
  z-index: 5;
  min-height: 44px;
  margin-top: auto;
  padding: 5px 12px;
  border-top-color: #6c573633;
  border-radius: 0 0 8px 8px;
  background: #100f1355;
}

#captain-roster-page .captain-gallery-card .captain-card-footer .captain-card-owned {
  min-height: 32px;
}

#captain-roster-page .captain-gallery-card .captain-card-footer .captain-not-owned {
  min-height: 32px;
  font-size: 11px;
}

#captain-roster-page .captain-gallery-card .captain-card-footer .captain-info {
  width: 31px;
  min-height: 32px;
  height: 32px;
  border: 1px solid #826c3e55;
  border-radius: 50%;
  background: #d1a3540b;
  color: #e6c88f;
  font-size: 16px;
}

#captain-roster-page .captain-gallery-card:has(:focus-visible) {
  z-index: 10;
  outline: 2px solid #e7c47e;
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #captain-roster-page .captain-gallery-card {
    transition: transform 260ms cubic-bezier(.2, .7, .2, 1), box-shadow 260ms ease, border-color 180ms ease;
  }

  #captain-roster-page .captain-gallery-card .captain-card-portrait {
    transition: transform 300ms cubic-bezier(.2, .7, .2, 1), filter 260ms ease;
    will-change: transform;
  }

  #captain-roster-page .captain-gallery-card:has(.captain-card-edit:is(:hover, :focus-visible)) {
    z-index: 20;
    transform: perspective(900px) translateY(-4px) rotateX(-2deg) rotateY(3deg);
    border-color: #d7b573;
    box-shadow: -4px 14px 25px #0006, 0 0 0 1px #d2a65320;
  }

  #captain-roster-page .captain-gallery-card:has(.captain-card-edit:is(:hover, :focus-visible)) .captain-card-portrait {
    transform: translateY(-14px) translateZ(40px) scale(1.24);
    filter: drop-shadow(-5px 15px 8px #0008) drop-shadow(0 0 10px #e3bb6030);
  }
}

@media (max-width: 900px) {
  #captain-roster-page .captain-owned-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
  #captain-roster-page .captain-gallery-card .captain-card-art { height: 225px; }
}

@media (max-width: 600px) {
  #captain-roster-page .captain-owned-grid { gap: 18px 12px; }
  #captain-roster-page .captain-gallery-card .captain-card-edit { padding: 12px 9px 0; }
  #captain-roster-page .captain-gallery-card .captain-card-art { height: 195px; }
  #captain-roster-page .captain-gallery-card .captain-name-ribbon { width: calc(100% - 12px); min-height: 40px; padding: 10px 5px; font-size: 16px; }
  #captain-roster-page .captain-gallery-card .captain-inline-level { top: -13px; right: 8px; }
  #captain-roster-page .captain-gallery-card .captain-inline-level input { width: 54px; height: 32px; font-size: 15px; }
  #captain-roster-page .captain-gallery-card .captain-inline-stars { width: calc(100% - 14px); gap: 1px; margin-top: 13px; }
  #captain-roster-page .captain-gallery-card .captain-inline-stars button,
  #captain-roster-page .captain-gallery-card .captain-inline-stars button:first-child { height: 32px; font-size: 20px; }
  #captain-roster-page .captain-gallery-card .captain-inline-actions { gap: 5px; margin: 0 8px 9px; }
  #captain-roster-page .captain-gallery-card .captain-inline-actions > button { min-height: 36px; font-size: 11px; padding: 6px 3px; }
  #captain-roster-page .captain-gallery-card .captain-card-footer { padding: 5px 8px; }
}

@media (max-width: 400px) {
  #captain-roster-page .captain-owned-grid { gap: 17px 10px; }
  #captain-roster-page .captain-gallery-card .captain-card-art { height: 180px; }
  #captain-roster-page .captain-gallery-card .captain-name-ribbon { font-size: 15px; }
  #captain-roster-page .captain-gallery-card .captain-inline-stars button,
  #captain-roster-page .captain-gallery-card .captain-inline-stars button:first-child { font-size: 18px; }
  #captain-roster-page .captain-gallery-card .captain-card-footer .captain-not-owned { font-size: 10px; }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  #captain-roster-page .captain-gallery-card,
  #captain-roster-page .captain-gallery-card .captain-card-portrait,
  #captain-roster-page .captain-gallery-card:is(:hover, :has(:focus-visible)),
  #captain-roster-page .captain-gallery-card:is(:hover, :has(:focus-visible)) .captain-card-portrait {
    transform: none;
    transition: none;
  }
}

/* Ownership is a status on the card; corrections are a deliberate second step. */
#captain-roster-page .captain-gallery-card .captain-acquired-pill,
#captain-roster-page .captain-gallery-card .captain-owned-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #899d624f;
  border-radius: 999px;
  background: #71844a15;
  color: #d0ddb2;
  font: 550 12px/1.35 var(--sans, Arial, sans-serif);
  text-align: center;
  overflow-wrap: normal;
}

#captain-roster-page .captain-gallery-card .captain-correction-button {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 0 8px;
  border: 1px solid #826c3e55;
  border-radius: 5px;
  background: #d1a35408;
  color: #cbb381;
  font: 650 22px/1 var(--sans, Arial, sans-serif);
  cursor: pointer;
}

#captain-roster-page .captain-gallery-card .captain-correction-button:is(:hover, :focus-visible) {
  border-color: #cfb077;
  background: #a47c3824;
  color: #ffe4af;
}

#captain-acquire-dialog,
#captain-correction-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 23px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #9d7e49;
  border-radius: 8px;
  background: #1d191f;
  color: #e9dfcf;
  box-shadow: 0 24px 65px #0009;
}

#captain-acquire-dialog::backdrop,
#captain-correction-dialog::backdrop {
  background: #08070bd1;
  backdrop-filter: blur(5px);
}

#captain-acquire-dialog > h2,
#captain-correction-dialog > h2 {
  margin: 0 0 15px;
  color: #f0d7a4;
  font: 550 21px/1.4 var(--serif, Georgia, serif);
  letter-spacing: -.02em;
}

#captain-correction-dialog > .captain-correction-name {
  display: block;
  margin: 0 0 10px;
  color: #e7c995;
  font: 600 15px/1.5 var(--sans, Arial, sans-serif);
}

#captain-acquire-dialog > .captain-acquire-copy,
#captain-correction-dialog > .captain-correction-copy {
  margin: 0;
  color: #c9bda9;
  font: 400 14px/1.65 var(--sans, Arial, sans-serif);
}

#captain-acquire-dialog .captain-ownership-dialog-actions,
#captain-correction-dialog .captain-ownership-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 23px 0 0;
}

#captain-acquire-dialog .captain-ownership-dialog-actions > .button,
#captain-correction-dialog .captain-ownership-dialog-actions > .button {
  flex: 1 1 120px;
  width: auto;
}

#captain-correction-dialog .captain-ownership-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

#captain-correction-dialog .captain-ownership-dialog-actions > .button {
  width: 100%;
}

#captain-edit-dialog .captain-ownership-controls .captain-acquired-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #899d624f;
  border-radius: 999px;
  background: #71844a15;
  color: #d0ddb2;
  font: 550 13px/1.35 var(--sans, Arial, sans-serif);
}

#captain-edit-dialog .captain-ownership-controls .captain-correction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 0 8px;
  border: 1px solid #826c3e55;
  border-radius: 5px;
  background: #d1a35408;
  color: #cbb381;
  font: 650 22px/1 var(--sans, Arial, sans-serif);
}

#captain-acquire-dialog .button,
#captain-correction-dialog .button {
  min-height: 43px;
  min-width: 0;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
}

#captain-acquire-dialog .button-primary,
#captain-correction-dialog .button-primary {
  border-color: #c7a263;
  background: linear-gradient(#bf9853, #97713c);
  color: #1f180f;
}

#captain-acquire-dialog .button-primary:hover,
#captain-correction-dialog .button-primary:hover {
  background: linear-gradient(#d1ad69, #aa8146);
}

@media (max-width: 480px) {
  #captain-roster-page .captain-gallery-card .captain-acquired-pill,
  #captain-roster-page .captain-gallery-card .captain-owned-status {
    padding: 4px 7px;
    font-size: 11px;
  }
  #captain-acquire-dialog,
  #captain-correction-dialog { padding: 20px 18px; }
}

/* One Hero progression, with the real acquired avatars in a separate gallery. */
#captain-roster-page .hero-manage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #947644;
  border-radius: 5px;
  background: #b18b3b12;
  color: #ebd09a;
  font: 550 12px/1.4 var(--sans, Arial, sans-serif);
}

#captain-roster-page .hero-manage-button:is(:hover, :focus-visible) {
  border-color: #d3b372;
  background: #b18b3b26;
}

#captain-roster-page .hero-manage-button .hero-owned-count {
  color: #bfa779;
  font: 500 11px/1.4 var(--sans, Arial, sans-serif);
}

#hero-collection-dialog {
  box-sizing: border-box;
  width: min(850px, calc(100vw - 28px));
  max-width: none;
  max-height: 88dvh;
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #a3844f;
  border-radius: 8px;
  background: #1c191e;
  color: #e8ddca;
  box-shadow: 0 25px 70px #000a;
}

#hero-collection-dialog::backdrop {
  background: #08070bd1;
  backdrop-filter: blur(5px);
}

#hero-collection-dialog .hero-collection-heading {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  min-width: 0;
  padding: 19px 22px;
  border-bottom: 1px solid #8d70434d;
  background: #272027f7;
  box-shadow: 0 3px 10px #0003;
  backdrop-filter: blur(7px);
}

#hero-collection-dialog h2 {
  min-width: 0;
  margin: 0;
  color: #efd5a2;
  font: 550 23px/1.35 var(--serif, Georgia, serif);
  letter-spacing: -.02em;
}

#hero-collection-dialog [data-hero-collection-close] {
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #9e7f4c66;
  border-radius: 5px;
  background: #b18b3b0b;
  color: #e5c489;
  font: 500 24px/1 var(--sans, Arial, sans-serif);
}

#hero-collection-dialog [data-hero-collection-close]:hover {
  border-color: #d4b170;
  background: #b18b3b24;
}

#hero-collection-dialog .hero-collection-help {
  margin: 17px 22px 0;
  color: #c2b49e;
  font: 400 14px/1.65 var(--sans, Arial, sans-serif);
}

#hero-collection-dialog .hero-collection-count {
  margin: 8px 22px 0;
  color: #d1b785;
  font: 550 12px/1.5 var(--sans, Arial, sans-serif);
}

#hero-collection-dialog .hero-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 17px 15px;
  min-width: 0;
  padding: 18px 22px 23px;
}

#hero-collection-dialog .hero-collection-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  border: 1px solid #80663f;
  border-radius: 7px;
  background: radial-gradient(ellipse at 50% 28%, #b68a3c1f, transparent 68%), #231e22;
  box-shadow: 0 3px 10px #0003;
}

#hero-collection-dialog .hero-collection-tile.is-unowned {
  border-color: #57504a;
  background: radial-gradient(ellipse at 50% 28%, #a3977e0d, transparent 68%), #1b191c;
}

#hero-collection-dialog .hero-collection-tile.is-active {
  border-color: #edcb82;
  box-shadow: 0 0 0 1px #d5ab5a4d, 0 4px 16px #0005;
}

#hero-collection-dialog .hero-collection-art {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 175px;
  min-height: 0;
  margin: 0;
  padding: 11px 8px 7px;
  overflow: visible;
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: inherit;
}

#hero-collection-dialog button.hero-collection-art {
  cursor: pointer;
}

#hero-collection-dialog .hero-collection-portrait {
  display: block;
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
  filter: drop-shadow(0 5px 5px #0005);
  pointer-events: none;
}

#hero-collection-dialog .hero-collection-tile.is-unowned .hero-collection-portrait {
  filter: grayscale(1) drop-shadow(0 5px 5px #0004);
  opacity: .5;
}

#hero-collection-dialog .hero-collection-name {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 0;
  min-height: 37px;
  margin: 0 9px;
  padding: 9px 6px;
  border: 1px solid #e0ba73;
  border-top-color: #f4db9f;
  border-bottom-color: #8f6634;
  border-radius: 2px;
  background: linear-gradient(110deg, #a87939, #e3bf7a 20%, #eed398 48%, #d5aa61 83%, #a87839);
  box-shadow: 0 2px 5px #0004, inset 0 1px #fff0c36b;
  color: #382712;
  font: 650 15px/1.3 var(--serif, Georgia, serif);
  letter-spacing: -.02em;
  text-align: center;
  overflow-wrap: normal;
  word-break: normal;
}

#hero-collection-dialog .hero-collection-tile.is-unowned .hero-collection-name {
  border-color: #8d7b5e;
  background: linear-gradient(110deg, #564938, #8c795b 48%, #5a4c38);
  color: #e3d6b8;
}

#hero-collection-dialog .hero-collection-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 33px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 58px;
  min-width: 0;
  margin-top: auto;
  padding: 10px;
}

#hero-collection-dialog .hero-collection-actions > :only-child {
  grid-column: 1 / -1;
}

#hero-collection-dialog .hero-collection-actions > button {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #a7874f;
  border-radius: 4px;
  background: #ad873b14;
  color: #efd6a2;
  font: 550 12px/1.4 var(--sans, Arial, sans-serif);
  text-align: center;
}

#hero-collection-dialog .hero-collection-actions > button:hover {
  border-color: #deba75;
  background: #ad873b2e;
}

#hero-collection-dialog .hero-collection-actions > .captain-correction-button {
  flex: 0 0 33px;
  width: 33px;
  height: 34px;
  min-height: 34px;
  padding: 0 0 8px;
  border-color: #92774566;
  background: #b18b3b08;
  color: #cbb281;
  font: 650 22px/1 var(--sans, Arial, sans-serif);
}

#hero-collection-dialog .hero-active-badge {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #abc17855;
  border-radius: 999px;
  background: #859b4c15;
  color: #d5e2b3;
  font: 600 12px/1.4 var(--sans, Arial, sans-serif);
  text-align: center;
}

#hero-collection-dialog .hero-collection-tile:has(:focus-visible) {
  z-index: 5;
  outline: 2px solid #edcc86;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #hero-collection-dialog .hero-collection-portrait {
    transition: transform 220ms cubic-bezier(.2, .7, .2, 1), filter 220ms ease;
  }
  #hero-collection-dialog .hero-collection-tile:has(.hero-collection-art:hover) {
    z-index: 4;
    border-color: #d0ad69;
  }
  #hero-collection-dialog .hero-collection-tile:has(.hero-collection-art:hover) .hero-collection-portrait {
    transform: perspective(600px) translateY(-4px) translateZ(12px) scale(1.12);
  }
}

@media (max-width: 600px) {
  #hero-collection-dialog .hero-collection-heading { gap: 12px; padding: 15px 16px; }
  #hero-collection-dialog h2 { font-size: 20px; }
  #hero-collection-dialog .hero-collection-help { margin: 15px 16px 0; font-size: 13px; }
  #hero-collection-dialog .hero-collection-count { margin-left: 16px; margin-right: 16px; }
  #hero-collection-dialog .hero-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 11px; padding: 17px 16px 20px; }
  #hero-collection-dialog .hero-collection-art { height: 158px; padding: 10px 6px 7px; }
  #hero-collection-dialog .hero-collection-name { margin: 0 6px; padding: 8px 4px; font-size: 14px; }
  #hero-collection-dialog .hero-collection-actions { gap: 5px; padding: 9px 7px; }
  #hero-collection-dialog .hero-collection-actions > button { padding: 7px 6px; }
}

@media (max-width: 360px) {
  #hero-collection-dialog .hero-collection-grid { gap: 12px 9px; padding-left: 12px; padding-right: 12px; }
  #hero-collection-dialog .hero-collection-art { height: 148px; }
  #hero-collection-dialog .hero-collection-name { font-size: 13px; }
  #hero-collection-dialog .hero-collection-actions { flex-wrap: wrap; }
}
