.portrait-preview-trigger {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff8c9;
  background: transparent;
  cursor: pointer;
}

.portrait-preview-trigger::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(235, 255, 255, 0.82);
  border-radius: inherit;
  background: rgba(4, 35, 57, 0.88);
  box-shadow: 0 4px 12px rgba(0, 17, 31, 0.38);
  transition: transform 160ms ease, background-color 160ms ease;
}

.portrait-preview-trigger svg {
  position: relative;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.portrait-preview-trigger:hover::before,
.portrait-preview-trigger:focus-visible::before {
  background: rgba(10, 61, 85, 0.96);
  transform: scale(1.08);
}

.portrait-preview-trigger:focus-visible {
  outline: 2px solid #fff0a3;
  outline-offset: -4px;
}

.hero-training-art > .portrait-preview-trigger::before {
  inset: 9px;
}

.hero-training-art > .portrait-preview-trigger svg {
  width: 14px;
  height: 14px;
}

.skin-card-art > .portrait-preview-trigger {
  top: auto;
  right: 8px;
  bottom: 8px;
}

.hero-outfit-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(150, 226, 223, 0.24);
  border-radius: 12px 4px 12px 4px;
  background: rgba(2, 22, 38, 0.45);
}

.hero-outfit-picker header span,
.hero-outfit-picker.is-empty > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.hero-outfit-picker small {
  color: #90e0dc;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.05em;
}

.hero-outfit-picker header b,
.hero-outfit-picker.is-empty b {
  overflow: hidden;
  color: #d5edef;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-outfit-picker > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.hero-outfit-picker button {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid rgba(213, 242, 242, 0.28);
  border-radius: 10px 3px 10px 3px;
  color: #d8edef;
  background: rgba(9, 48, 70, 0.82);
  text-align: left;
  cursor: pointer;
}

.hero-outfit-picker button[aria-pressed="true"] {
  border-color: #ffe079;
  color: #173349;
  background: linear-gradient(135deg, #fff0a3, #efb153);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.hero-outfit-picker button:disabled:not([aria-pressed="true"]) {
  color: #8ba8af;
  cursor: not-allowed;
  opacity: 0.72;
}

.hero-outfit-picker button img {
  width: 31px;
  height: 34px;
  border-radius: 8px 3px 8px 3px;
  object-fit: cover;
  object-position: 50% 10%;
  background: linear-gradient(145deg, #9adce0, #294c67);
}

.hero-outfit-picker button b {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.portrait-preview-dialog,
.hero-unlock-dialog {
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(221, 249, 255, 0.82);
  color: white;
  background: #041a2c;
  box-shadow: 0 28px 80px rgba(0, 8, 20, 0.75);
}

.portrait-preview-dialog {
  width: min(100vw, 520px);
  height: 100svh;
  max-height: min(100svh, 980px);
  border-radius: 0;
}

.portrait-preview-dialog::backdrop,
.hero-unlock-dialog::backdrop {
  background: rgba(0, 10, 21, 0.8);
  backdrop-filter: blur(7px);
}

.portrait-preview-shell {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 24%, rgba(85, 211, 211, 0.2), transparent 38%),
    linear-gradient(155deg, #062c4b, #031827 72%);
}

.portrait-preview-shell header {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portrait-preview-shell header span {
  min-width: 0;
}

.portrait-preview-shell header small,
.hero-unlock-eyebrow {
  color: #9ff0e9;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.portrait-preview-shell h2 {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portrait-preview-shell header button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(194, 237, 241, 0.36);
  border-radius: 14px;
  color: white;
  background: rgba(0, 0, 0, 0.2);
  font-size: 26px;
  cursor: pointer;
}

.portrait-preview-shell figure {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1;
  margin: 8px 0 0;
  overflow: hidden;
  border: 1px solid rgba(183, 238, 239, 0.22);
  border-radius: 28px 8px 28px 8px;
  background:
    linear-gradient(180deg, rgba(100, 210, 215, 0.13), rgba(2, 18, 31, 0.52)),
    radial-gradient(ellipse at 50% 76%, rgba(255, 211, 93, 0.17), transparent 34%);
}

.portrait-preview-shell figure img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: 50% 50%;
  filter: drop-shadow(0 18px 16px rgba(0, 8, 19, 0.55));
}

.portrait-preview-shell figcaption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff5c2;
  background: rgba(2, 27, 45, 0.78);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(8px);
}

.hero-unlock-dialog {
  width: min(calc(100vw - 28px), 470px);
  max-height: min(calc(100svh - 28px), 760px);
  border-radius: 28px 9px 28px 9px;
}

.hero-unlock-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(240px, 46svh) auto auto;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 25%, rgba(102, 230, 221, 0.22), transparent 38%),
    linear-gradient(155deg, #07516a, #05243e 66%, #031827);
}

.hero-unlock-eyebrow {
  z-index: 2;
  text-align: center;
}

.hero-unlock-art {
  position: relative;
  min-height: 0;
  margin: 8px 0 -34px;
}

.hero-unlock-art::after {
  position: absolute;
  right: 8%;
  bottom: 27px;
  left: 8%;
  height: 42px;
  border-radius: 50%;
  content: "";
  background: radial-gradient(ellipse, rgba(255, 224, 121, 0.42), transparent 70%);
  filter: blur(5px);
}

.hero-unlock-art img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  filter: drop-shadow(0 16px 13px rgba(0, 12, 25, 0.55));
}

.hero-unlock-copy {
  position: relative;
  z-index: 2;
  padding: 16px;
  border: 1px solid rgba(220, 249, 248, 0.38);
  border-radius: 20px 6px 20px 6px;
  background: rgba(2, 27, 47, 0.82);
  text-align: center;
  backdrop-filter: blur(8px);
}

.hero-unlock-copy small {
  color: #9fe8e3;
  font-size: 10px;
  font-weight: 1000;
}

.hero-unlock-copy h2 {
  margin: 2px 0 4px;
  color: white;
  font-size: 24px;
}

.hero-unlock-copy strong {
  color: #ffe07b;
  font-size: 13px;
}

.hero-unlock-copy p {
  margin: 9px 0 0;
  color: #d2e8ea;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.hero-unlock-actions {
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  margin-top: 12px;
}

.hero-unlock-actions button {
  min-height: 52px;
  border: 1px solid rgba(230, 251, 251, 0.45);
  border-radius: 14px 5px 14px 5px;
  color: #e8f8f8;
  background: rgba(19, 66, 88, 0.88);
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}

.hero-unlock-actions button:last-child {
  border-color: #ffe495;
  color: #18354a;
  background: linear-gradient(145deg, #fff2a7, #efad4d);
  box-shadow: 0 4px 0 #8c5732;
}

@media (max-width: 390px), (max-height: 720px) {
  .hero-outfit-picker button {
    grid-template-columns: 26px minmax(0, 1fr);
    padding-inline: 5px;
  }

  .hero-outfit-picker button img {
    width: 27px;
    height: 31px;
  }

  .hero-unlock-shell {
    grid-template-rows: auto minmax(190px, 40svh) auto auto;
    padding: 14px;
  }
}

@media (min-width: 700px) and (min-height: 520px) and (orientation: landscape) {
  .portrait-preview-dialog {
    width: var(--locked-portrait-width);
    height: min(100svh, calc(100vw * 16 / 9), 900px);
    max-height: 900px;
    border-radius: 22px;
  }

  .hero-unlock-dialog {
    width: min(calc(var(--locked-portrait-width) - 26px), 470px);
    max-height: min(calc(100svh - 30px), 760px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait-preview-trigger,
  .hero-unlock-dialog {
    transition: none !important;
  }
}
