.profile-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-32);
  min-height: 60vh;
}

.profile-card {
  position: relative;
  isolation: isolate;
  overflow: visible;
  width: 100%;
  max-width: 760px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-32);
  box-shadow: var(--shadow-card);
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--profile-bg-desktop, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.profile-card.has-profile-background::before {
  opacity: 1;
}

/* profile-setting.html은 꾸미기 배경을 보여주지 않고 기본 카드 배경 유지 */
body[data-page='profile-setting'] .profile-card {
  background: var(--color-surface);
}

body[data-page='profile-setting'] .profile-card::before {
  background-image: none;
  opacity: 0;
}

.profile-card > * {
  position: relative;
  z-index: 1;
}

/* =========================
  PROFILE FRAME
  - 장착한 계정에게만 표시
========================= */

body[data-page='profile'] .profile-card.has-profile-frame {
  --profile-frame-top: -6%;
  --profile-frame-right: -8%;
  --profile-frame-bottom: -5.5%;
  --profile-frame-left: -8%;
}

body[data-page='profile'] .profile-card.has-profile-frame::after {
  content: '';
  position: absolute;
  top: var(--profile-frame-top);
  right: var(--profile-frame-right);
  bottom: var(--profile-frame-bottom);
  left: var(--profile-frame-left);
  z-index: 3;
  background-image: var(--profile-frame-desktop);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: inherit;
  pointer-events: none;
}

@keyframes profile-frame-mallin-shiny-breathe {
  0%,
  100% {
    opacity: 0.97;
    filter: brightness(1) drop-shadow(0 0 4px rgba(181, 255, 0, 0.38));
  }

  50% {
    opacity: 1;
    filter: brightness(1.06) drop-shadow(0 0 7px rgba(181, 255, 0, 0.58));
  }
}

@keyframes profile-frame-mallin-shiny-orbit {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }

  5% {
    opacity: 0.92;
  }

  24% {
    opacity: 0.38;
  }

  34% {
    opacity: 0.96;
  }

  53% {
    opacity: 0.52;
  }

  72% {
    opacity: 0.94;
  }

  91% {
    opacity: 0.34;
  }

  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

body[data-page='profile'] .profile-card.has-profile-frame--mallin-shiny,
.inventory-profile-preview.has-profile-frame--mallin-shiny {
  border-radius: calc(var(--radius-card) + var(--space-12));
}

body[data-page='profile']
  .profile-card.has-profile-frame--mallin-shiny::after {
  top: -50px;
  right: -50px;
  bottom: -50px;
  left: -50px;
  background-image: none;
  border: 50px solid transparent;
  border-image-source: var(--profile-frame-desktop);
  border-image-slice: 110 103 109 103;
  border-image-width: 50px;
  border-image-repeat: stretch;
  animation: profile-frame-mallin-shiny-breathe 5.6s ease-in-out infinite;
}

.profile-frame-motion {
  display: none;
  position: absolute;
  inset: -3px;
  z-index: 4;
  overflow: visible;
  border-radius: calc(var(--radius-card) + var(--space-12) + 3px);
  pointer-events: none;
}

.profile-frame-motion__sparkle {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  opacity: 0;
  pointer-events: none;
}

.profile-frame-motion__sparkle::before {
  content: '';
  position: absolute;
  inset: -4px;
  background:
    linear-gradient(90deg, transparent 43%, #ffffff 50%, transparent 57%),
    linear-gradient(0deg, transparent 43%, #ffffff 50%, transparent 57%),
    radial-gradient(
      circle,
      #ffffff 0 12%,
      #efffb2 13% 27%,
      rgba(181, 255, 0, 0.92) 28% 42%,
      transparent 70%
    );
  filter: drop-shadow(0 0 3px rgba(181, 255, 0, 0.82));
}

@supports (offset-position: normal) and (offset-path: inset(1px round 1px)) {
  .has-profile-frame--mallin-shiny > .profile-frame-motion {
    display: block;
  }

  .profile-frame-motion__sparkle {
    offset-path: inset(2px round calc(var(--radius-card) + var(--space-12)));
    offset-rotate: 0deg;
    animation: profile-frame-mallin-shiny-orbit 9.6s linear infinite;
    will-change: offset-distance, opacity;
  }

  .profile-frame-motion__sparkle:nth-child(1) {
    animation-delay: -0.8s;
  }

  .profile-frame-motion__sparkle:nth-child(2) {
    width: 8px;
    height: 8px;
    animation-duration: 10.8s;
    animation-delay: -3.7s;
  }

  .profile-frame-motion__sparkle:nth-child(3) {
    width: 13px;
    height: 13px;
    animation-duration: 11.7s;
    animation-delay: -6.4s;
  }

  .profile-frame-motion__sparkle:nth-child(4) {
    width: 9px;
    height: 9px;
    animation-duration: 8.9s;
    animation-delay: -8.1s;
  }
}

@media (max-width: 700px) {
  body[data-page='profile'] .profile-card.has-profile-frame {
    --profile-frame-top: -7.4%;
    --profile-frame-right: -21.6%;
    --profile-frame-bottom: -6.4%;
    --profile-frame-left: -21.7%;
  }

  body[data-page='profile'] .profile-card.has-profile-frame::after {
    background-image: var(--profile-frame-mobile, var(--profile-frame-desktop));
  }

  body[data-page='profile']
    .profile-card.has-profile-frame--mallin-shiny::after {
    top: -42px;
    right: -42px;
    bottom: -42px;
    left: -42px;
    background-image: none;
    border-width: 42px;
    border-image-source: var(
      --profile-frame-mobile,
      var(--profile-frame-desktop)
    );
    border-image-slice: 111 119 104 117;
    border-image-width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page='profile']
    .profile-card.has-profile-frame--mallin-shiny::after,
  .inventory-profile-preview.has-profile-frame--mallin-shiny::after {
    animation: none;
    opacity: 1;
    filter: brightness(1.03) drop-shadow(0 0 5px rgba(181, 255, 0, 0.46));
  }

  .has-profile-frame--mallin-shiny > .profile-frame-motion {
    display: none;
  }
}

.profile-hero {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-16);
  align-items: center;
  margin-bottom: var(--space-24);

  /* 핵심 수정 */
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.profile-hero__content {
  padding: 4px 0;
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 9999px;
  border: 2px solid var(--color-border);
  background: #f5f5f5;
}

.profile-hero__eyebrow {
  margin: 0 0 6px;
  font-size: var(--text-body);
  color: var(--color-text-sub);
  padding: var(--space-8);
}

.profile-hero__nickname {
  margin: 0;
  font-size: var(--text-h1);
  color: var(--color-text);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

.profile-hero__meta,
.profile-hero__desc {
  margin: 8px 0 0;
  color: var(--color-text-sub);
  font-weight: 800;
  line-height: 1.6;
}

body[data-page='profile']
  .profile-hero__desc.is-on-dark-profile-background {
  color: var(--color-surface);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.profile-form {
  margin-bottom: var(--space-24);
}

.profile-section {
  display: flex;
  flex-direction: column;
}

.profile-section + .profile-section {
  margin-top: var(--space-24);
  padding-top: var(--space-24);
  border-top: 2px solid var(--color-border);
}

.profile-section-title {
  margin: 0;
  font-size: var(--text-h2);
  color: var(--color-text);
  padding-bottom: var(--space-8);
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.profile-field textarea {
  min-height: 120px;
  padding: var(--space-12);
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-border);
  font-size: var(--text-body);
  background: var(--color-surface);
  color: var(--color-text);
  resize: vertical;
  line-height: 1.6;
}

.profile-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.profile-hero__desc:empty {
  display: none;
}

.profile-field label {
  font-size: var(--text-body);
  color: var(--color-text);
}

.profile-field input {
  min-height: 56px;
  padding: var(--space-12);
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-border);
  font-size: var(--text-body);
  background: var(--color-surface);
  color: var(--color-text);
}

/* =========================
  PROFILE FILE INPUT
========================= */
.profile-field input[type='file'] {
  min-height: 56px;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-sub);
  font-size: var(--text-body);
  line-height: 1.4;
  cursor: pointer;
}

.profile-field input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: black;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.profile-field input[type='file']::file-selector-button:hover {
  opacity: 0.92;
}

.profile-field input[type='file']::file-selector-button:active {
  transform: scale(0.98);
}

.profile-field input[type='file']:hover {
  border-color: var(--color-primary);
}

.profile-field input[type='file']:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(170, 208, 94, 0.18);
}

.profile-field input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.profile-field .help-text {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text-sub);
  line-height: 1.5;
  padding-bottom: var(--space-8);
}

.profile-actions {
  display: flex;
  gap: var(--space-12);
}

.profile-actions > * {
  flex: 1;
}

.profile-btn,
.profile-sub-btn {
  padding: var(--space-12);
  border-radius: var(--radius-btn);
  font-size: var(--text-body);
  cursor: pointer;
}

.profile-btn {
  border: none;
  background: var(--color-primary);
  color: var(--color-text);
}

.profile-sub-btn {
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.profile-btn:hover,
.profile-sub-btn:hover {
  opacity: 0.9;
}

.profile-sub-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-msg {
  margin: 0;
  text-align: center;
  font-size: var(--text-small);
  color: var(--color-text-sub);
  line-height: 1.5;
}

.profile-list {
  display: flex;
  flex-direction: column;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-12);
  margin-top: var(--space-16) !important;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
}

.profile-row:hover {
  opacity: 0.9;
}

.profile-row__main {
  min-width: 0;
  flex: 1;
}

.profile-row__title {
  font-size: var(--text-body);
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-word;
}

.profile-row__body {
  font-size: var(--text-small);
  color: var(--color-text-sub);
  line-height: 1.5;
  word-break: break-word;
}

.profile-row__body .inline-emoticon,
.profile-row__body .inline-emoticon--compact {
  display: inline-block;
  width: 24px;
  height: 24px;
  max-width: 24px;
  min-width: 24px;
  max-height: 24px;
  min-height: 24px;
  margin: 0 2px;
  vertical-align: text-bottom;
  object-fit: contain;
}

.profile-row__meta {
  flex: 0 0 auto;
  font-size: var(--text-small);
  color: var(--color-text-sub);
  white-space: nowrap;
}

.profile-history-link-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--space-24);
}

.profile-history-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-body);
  font-weight: 700;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.profile-history-link:hover {
  opacity: 1;
  border-color: var(--color-primary);
  background: rgba(170, 208, 94, 0.12);
}

.empty {
  padding: var(--space-16);
  text-align: center;
  color: var(--color-text-sub);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-surface);
}

@media (max-width: 700px) {
  .profile-main {
    padding: 20px;
  }

  .profile-card {
    padding: var(--space-24);
    margin-top: var(--space-24);
    margin-left: 0;
    margin-right: 0;
  }

  .profile-card::before {
    background-image: var(--profile-bg-mobile, var(--profile-bg-desktop, none));
    background-position: center;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 20px 16px;
  }

  .profile-avatar {
    width: 120px;
    height: 120px;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-row {
    flex-direction: column;
  }

  .profile-row__meta {
    white-space: normal;
  }
}

.profile-hero__pickle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 14px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: rgba(170, 208, 94, 0.16);
  color: var(--color-text);
  font-size: var(--text-small);
  font-weight: 700;
  width: fit-content;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.profile-pickle-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background: rgba(170, 208, 94, 0.16);
  color: var(--color-text);
  font-size: var(--text-small);
  font-weight: 700;
}

.profile-row--pickle {
  align-items: flex-start;
}

.profile-row__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.profile-row__amount {
  color: var(--color-text);
  font-size: var(--text-body);
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .profile-hero__pickle {
    margin-left: auto;
    margin-right: auto;
  }

  .profile-row__side {
    align-items: flex-start;
  }
}

.profile-pickle-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
}

.profile-pickle-status__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-14);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: rgba(170, 208, 94, 0.1);
  align-items: center;
}

.profile-pickle-status__label {
  font-size: var(--text-small);
  color: var(--color-text-sub);
}

.profile-pickle-status__value {
  font-size: var(--text-body);
  color: var(--color-text);
  font-weight: 800;
}

@media (max-width: 700px) {
  .profile-pickle-status {
    grid-template-columns: 1fr;
  }
}

/* =========================
  PROFILE CHARACTER
========================= */
.profile-character-section {
  align-items: center;
  text-align: center;
}

.profile-character-preview {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.profile-character-image {
  width: 180px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: auto;
}

.profile-character-inventory {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.profile-character-inventory__title {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
}

.profile-character-inventory__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.profile-character-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-small);
  cursor: pointer;
  user-select: none;
}

.profile-character-toggle input {
  margin: 0;
  cursor: pointer;
}

.profile-character-card.is-locked {
  opacity: 0.78;
  border-style: dashed;
}

button.profile-character-card.is-locked:hover {
  opacity: 1;
  border-color: var(--color-primary);
  background: rgba(170, 208, 94, 0.08);
}

.profile-character-card__meta.is-locked {
  color: #c36b2c;
  font-weight: 700;
}

@media (max-width: 700px) {
  .profile-character-inventory__head {
    align-items: flex-start;
  }
}

.profile-character-grid {
  display: grid;
  gap: var(--space-12);
}

.profile-character-grid--characters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-character-grid--skins {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: var(--space-12);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-surface);
}

button.profile-character-card {
  width: 100%;
  appearance: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
}

button.profile-character-card:hover {
  opacity: 0.92;
}

.profile-character-card.is-selected,
.profile-character-card.is-equipped {
  border-color: var(--color-primary);
  background: rgba(170, 208, 94, 0.14);
}

.profile-character-card__thumb {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.profile-character-card__name {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  word-break: break-word;
}

.profile-character-card__meta {
  font-size: 12px;
  color: var(--color-text-sub);
  text-align: center;
  line-height: 1.4;
}

.profile-character-empty {
  padding: var(--space-16);
  text-align: center;
  color: var(--color-text-sub);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-surface);
}

@media (max-width: 700px) {
  .profile-character-image {
    width: 140px;
  }

  .profile-character-grid--characters,
  .profile-character-grid--skins {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-character-card__thumb {
    width: 56px;
    height: 56px;
  }
}

.profile-character-grid--bgm {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-bgm-card__thumb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    #f5f2df 0 10px,
    #8caf45 10px 18px,
    #1f1f1f 18px 30px,
    #111 30px 54px,
    #202020 54px 100%
  );
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.12);
}

.profile-bgm-card__thumb::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-bgm-card__thumb::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f3efdc;
  box-shadow: 0 0 0 4px #8caf45;
}

.profile-bgm-card__thumb-image {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* =========================
  PROFILE FEATURED BGM LP
========================= */
.profile-featured-bgm-wrap {
  position: absolute;
  top: var(--space-16);
  right: -148px;
  z-index: 2;
  display: flex;
  width: 112px;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

.profile-featured-bgm-wrap[hidden] {
  display: none;
}

.profile-featured-bgm {
  display: inline-flex;
  width: 112px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-featured-bgm[hidden] {
  display: none;
}

.profile-featured-bgm__lp {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 4px solid #1d1d1d;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.profile-featured-bgm__lp::before {
  content: '';
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.profile-featured-bgm__lp::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 16px;
  height: 16px;
  border: 2px solid #d9d9d9;
  border-radius: 50%;
  background: #111;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.profile-featured-bgm__image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-featured-bgm.is-playing .profile-featured-bgm__lp {
  animation: bgmLpSpin 4s linear infinite;
}

.profile-featured-bgm:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

.profile-featured-bgm__setting-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-8);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.profile-featured-bgm__setting-link[hidden] {
  display: none;
}

.profile-featured-bgm__setting-link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .profile-featured-bgm-wrap {
    top: auto;
    right: var(--space-24);
    bottom: var(--space-16);
  }

  .profile-featured-bgm {
    width: 88px;
  }
}

@media (max-width: 700px) {
  .profile-character-grid--bgm {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-featured-bgm-wrap {
    right: var(--space-8);
    bottom: var(--space-6);
    align-items: flex-end;
    gap: var(--space-6);
  }

  .profile-featured-bgm {
    width: 72px;
  }

  .profile-featured-bgm__lp {
    border-width: 3px;
  }

  .profile-featured-bgm__lp::before {
    inset: 5px;
  }

  .profile-featured-bgm__lp::after {
    width: 12px;
    height: 12px;
  }

  .profile-featured-bgm__setting-link {
    min-height: 26px;
    padding: var(--space-6) 5px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-featured-bgm.is-playing .profile-featured-bgm__lp {
    animation: none;
  }
}

.profile-character-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: var(--space-16);
}

.profile-inventory-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: rgba(170, 208, 94, 0.16);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: 700;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.profile-inventory-link:hover {
  opacity: 1;
  border-color: var(--color-primary);
  background: rgba(170, 208, 94, 0.24);
}

.profile-inventory-link.is-secondary {
  background: var(--color-surface);
}

.profile-hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-16);
}

.profile-hero__text {
  min-width: 0;
  flex: 1;
}

.profile-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-12);
  flex-shrink: 0;
}

.profile-setting-link,
.profile-inventory-link--hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 30px;
  padding: 10px 10px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: 700;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.profile-setting-link {
  background: var(--color-primary);
}

.profile-setting-link:hover,
.profile-inventory-link--hero:hover {
  opacity: 0.92;
}

.profile-setting-link:active,
.profile-inventory-link--hero:active {
  transform: scale(0.98);
}

.profile-setting-link.is-secondary {
  background: var(--color-surface);
}

.profile-inventory-link--hero {
  background: var(--color-primary-sub);
}

.profile-history-shortcut {
  margin-left: 0;
}

@media (max-width: 768px) {
  .profile-hero__top {
    flex-direction: column;
    align-items: center;
  }

  .profile-hero__actions {
    width: 100%;
    align-items: center;
  }

  .profile-setting-link,
  .profile-inventory-link--hero {
    width: auto;
    min-width: 100px;
  }
}

.profile-hero__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  flex-wrap: wrap;
  width: 100%;
}

.profile-history-shortcut {
  min-width: auto;
  padding: 10px 16px;
  font-size: var(--text-small);
  margin-left: auto;
}

@media (max-width: 768px) {
  .profile-hero__summary-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
  }

  .profile-history-shortcut {
    margin-left: 0;
    width: auto;
  }
}
@media (max-width: 768px) {
  .profile-hero__actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .profile-hero__actions .profile-setting-link,
  .profile-hero__actions .profile-inventory-link {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100px;
    min-height: 44px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    line-height: 1.2;
  }
}
