.profile-frame-avatar {
  position: relative;
}

.profile-frame-avatar[data-profile-frame='muschelkranz'] {
  --frame-art: url('images/profile-frames/muschelkranz.webp');
  --frame-art-inset: -5%;
  --frame-image-x: 48.9%;
  --frame-image-y: 47.8%;
  --frame-image-width: 76.45%;
  --frame-image-height: 78.1%;
}

.profile-frame-avatar[data-profile-frame='wellenring'] {
  --frame-art: url('images/profile-frames/wellenring.webp');
  --frame-image-x: 49.4%;
  --frame-image-y: 49.8%;
  --frame-image-width: 77.5%;
  --frame-image-height: 78.5%;
}

.profile-frame-avatar[data-profile-frame='leuchtturmlicht'] {
  --frame-art: url('images/profile-frames/leuchtturmlicht.webp');
  --frame-image-x: 48.5%;
  --frame-image-y: 50%;
  --frame-image-width: 77.5%;
  --frame-image-height: 79.5%;
}

.profile-frame-avatar.avatar-card[data-profile-frame] {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.profile-frame-avatar[data-profile-frame]::after {
  position: absolute;
  inset: var(--frame-art-inset, 0);
  z-index: 1;
  background: var(--frame-art) center / 100% 100% no-repeat;
  content: '';
  pointer-events: none;
}

.profile-frame-avatar[data-profile-frame] > :is(.image-preview-wrap, .frame-shop-portrait-image) {
  position: absolute;
  top: calc(var(--frame-image-y) - var(--frame-image-height) / 2);
  left: calc(var(--frame-image-x) - var(--frame-image-width) / 2);
  width: var(--frame-image-width);
  height: var(--frame-image-height);
}

.profile-frame-avatar[data-profile-frame] > .image-preview-wrap {
  border-radius: 50%;
}

.profile-frame-avatar[data-profile-frame] > .image-preview-wrap .profile-ai-badge {
  top: 13%;
  left: 20%;
}

.profile-frame-avatar[data-profile-frame] > .profile-muschel-badge {
  z-index: 2;
}

.frame-profile-controls {
  margin: 16px 0 0;
  padding: 18px;
  scroll-margin: 16px;
}

.frame-profile-controls p {
  margin: 10px 0;
  color: #cbd5e1;
}

.frame-profile-controls p:empty {
  display: none;
}

.frame-profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
}

.frame-profile-actions label {
  display: grid;
  gap: 6px;
}

.frame-profile-actions select {
  min-height: 42px;
  max-width: 100%;
  padding: 6px 30px 6px 10px;
  border: 1px solid #537185;
  border-radius: 10px;
  background: #16233e;
  color: #f8fafc;
  font: inherit;
}

.frame-shop-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.frame-shop-header h2 {
  margin: 0;
}

.frame-shop-balance {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #6e6043;
  border-radius: 10px;
  color: #ffe3a3;
  font-weight: 700;
}

.frame-shop-fieldset {
  min-width: 0;
  margin: 20px 0;
  padding: 0;
  border: 0;
}

.frame-shop-fieldset legend {
  margin-bottom: 10px;
  padding: 0;
  color: #cbd5e1;
}

.frame-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.frame-shop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #365365;
  border-radius: 14px;
  background: #0e1b34;
  cursor: pointer;
}

.frame-shop-card:is(:hover, :focus-within, :has(input:checked)) {
  border-color: #9ceae2;
  background: #16344a;
}

.frame-shop-card:focus-within {
  outline: 2px solid #9ceae2;
  outline-offset: 2px;
}

.frame-shop-card input {
  margin: 0;
  accent-color: #76e3d6;
}

.frame-shop-portrait {
  width: min(100%, 220px);
  aspect-ratio: 1;
  grid-column: 1 / -1;
  justify-self: center;
}

.frame-shop-portrait-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(155deg, #254768, #18243f);
  color: #d2f9f4;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
}

.frame-shop-portrait-image > * {
  grid-area: 1 / 1;
}

.frame-shop-portrait-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-shop-tag {
  grid-column: 2;
  color: #ffe3a3;
  font-size: .9rem;
}

.frame-shop-actions {
  margin-top: 12px;
}

.frame-shop-bundle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #6e6043;
  border-radius: 14px;
  background: #17243a;
}

.frame-shop-bundle h3 {
  margin: 0;
  color: #ffe3a3;
}

.frame-shop-bundle p {
  margin-top: 4px;
}

.frame-shop-bundle button {
  max-width: 100%;
}

:is(.frame-profile-controls, .frame-shop-actions > *, .frame-shop-portrait-image img, .frame-shop-bundle)[hidden] {
  display: none;
}

@media (max-width: 610px) {
  .frame-shop-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .frame-shop-card {
    grid-template-columns: minmax(90px, min(36%, 140px)) auto minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
    column-gap: 10px;
    overflow-wrap: anywhere;
  }

  .frame-shop-portrait {
    grid-area: 1 / 1 / 3 / 2;
  }

  .frame-shop-card :is(input, strong) {
    align-self: end;
  }

  .frame-shop-tag {
    grid-column: 3;
    align-self: start;
  }
}

@media (max-width: 360px) {
  #profileFramesShop .shop-pack-panel {
    padding: 16px;
  }

  .frame-shop-card {
    grid-template-columns: 76px auto minmax(0, 1fr);
    padding: 10px;
    column-gap: 8px;
  }
}
