.character-browser {
  width: min(1180px, calc(100% - 96px));
  margin: 0 auto;
  font-family: var(--t-round);
}

.character-browser [hidden] { display: none !important; }

.character-picker-hint {
  margin: -20px 0 20px;
  color: var(--t-ink);
  font-size: .9375rem;
  line-height: 1.5;
}

.character-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

.character-ticket { min-width: 0; }

.character-ticket-link {
  display: block;
  padding: 7px 7px 0;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 23px;
  color: var(--t-ink);
  background: var(--t-card);
  box-shadow: 0 0 0 1px var(--t-border), var(--t-shadow);
  text-decoration: none;
  transition: transform .24s ease, box-shadow .24s ease;
}

.character-ticket-art {
  position: relative;
  display: block;
  isolation: isolate;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 53% 41%, #fff 0%, #ffffffa8 28%, transparent 72%),
    linear-gradient(150deg, var(--character-tint), #fff 97%);
}

.character-ticket-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 10% 11% 8%;
  border: 1px solid color-mix(in srgb, var(--character-accent) 41%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 8px #ffffff5c;
  transform: rotate(-13deg);
}

.character-ticket-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  pointer-events: none;
  background: linear-gradient(0deg, var(--character-tint), transparent);
  opacity: .52;
}

.character-ticket-art img {
  position: absolute;
  top: 5%;
  left: 50%;
  display: block;
  width: var(--portrait-width);
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  transform-origin: 50% 22%;
  transition: transform .32s ease;
}

.character-ticket-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 60px;
  padding: 6px 9px 6px 12px;
  line-height: 1.3;
}

.character-ticket-label strong { font-size: clamp(.9375rem, 1.35vw, 1.125rem); font-weight: 800; }
.character-ticket-open {
  display: grid;
  flex: 0 0 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: var(--t-ink);
  background: var(--character-tint);
  font-size: 1rem;
  font-weight: 700;
}

.character-ticket-link:is(:hover, :focus-visible) {
  transform: translateY(-5px);
  box-shadow: 0 0 0 2px var(--character-accent), 0 12px 30px rgba(167, 107, 196, .28);
}
.character-ticket-link:is(:hover, :focus-visible) img { transform: translateX(-50%) scale(1.048); }
.character-browser :is(a, button):focus-visible { outline: 3px solid #924d9d; outline-offset: 4px; }

.character-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.character-control {
  min-height: 44px;
  padding: 8px 19px;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  color: var(--t-ink);
  background: linear-gradient(180deg, #fff, #fff2fa);
  box-shadow: 0 4px 12px #a060ba22;
  font: 700 .9375rem/1.45 var(--t-round);
  cursor: pointer;
  transition: background-color .18s, box-shadow .18s;
}

.character-control:hover { background: #ffe8f5; box-shadow: 0 5px 18px #c760b13b; }

.character-control-next {
  color: #60244d;
  border-color: #f2a3ce;
  background: linear-gradient(180deg, #ffe0f1, #fbb6de);
}

.character-position {
  color: var(--t-ink);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}

.character-profiles { display: grid; gap: 20px; }
.character-browser[data-character-view="detail"] .character-profile:not([hidden]) { animation: character-profile-in .3s ease-out both; }

.character-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 30px;
  background: linear-gradient(148deg, #fff 8%, #fff5fb 70%, var(--character-tint) 128%);
  box-shadow: 0 0 0 1px var(--t-border), var(--t-shadow);
  scroll-margin-top: 118px;
}

.character-profile-art {
  position: relative;
  height: clamp(440px, 37vw, 526px);
  isolation: isolate;
  background:
    radial-gradient(ellipse 56% 55% at 48% 50%, #fff 0%, #ffffff75 64%, transparent 100%),
    linear-gradient(146deg, var(--character-tint), #fff 126%);
}

.character-profile-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 9% 19%;
  border: 1.5px solid color-mix(in srgb, var(--character-accent) 40%, transparent);
  border-radius: 46% 54% 48% 52%;
  box-shadow: 0 0 0 17px #ffffff4f, inset 0 0 46px #ffffff59;
  transform: rotate(-9deg);
}

.character-profile-art::after {
  content: "";
  position: absolute;
  right: 11%;
  top: 17%;
  width: 36px;
  height: 36px;
  z-index: -1;
  background: var(--t-star) center / contain no-repeat;
  filter: drop-shadow(0 2px 3px #8e558d4f);
}

.character-profile-art img {
  position: absolute;
  top: 3.5%;
  left: 6%;
  display: block;
  width: 88%;
  height: 93%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 9px 10px rgba(88, 45, 119, .16));
}

.character-profile-copy { padding: 36px clamp(30px, 4vw, 65px); }
.character-profile-copy h4 {
  color: #624078;
  font-size: clamp(1.75rem, 4.15vw, 3.5rem);
  font-weight: 900;
  letter-spacing: .025em;
  line-height: 1.16;
  overflow-wrap: anywhere;
}
.character-profile-copy p { max-width: 28em; margin: 21px 0 0; color: #614472; font-size: clamp(1rem, 1.7vw, 1.1875rem); line-height: 1.85; }
.character-profile-pulse {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(160px, 80%);
  margin-top: 22px;
}
.character-profile-pulse::before { content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: var(--t-heart-pk) center / contain no-repeat; }
.character-profile-pulse::after { content: ""; height: 2px; flex: 1; border-radius: 99px; background: linear-gradient(90deg, var(--character-accent), var(--character-tint)); }

.character-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  place-items: center;
  gap: 18px;
  margin-top: 20px;
}
.character-step:first-child { justify-self: start; }
.character-step:last-child { justify-self: end; }
.character-selectors { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 6px; border: 1px solid #fff; border-radius: 999px; background: #ffffffa1; box-shadow: 0 4px 14px #af7bc22b; }
.character-select {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--character-tint);
  box-shadow: 0 0 0 1px var(--t-border);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.character-select:is([aria-pressed="true"], :hover) { box-shadow: 0 0 0 2px var(--character-accent); transform: translateY(-2px); }
.character-select img { position: absolute; top: 3px; left: 50%; display: block; width: 119%; max-width: none; height: auto; transform: translateX(-50%); }
.character-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes character-profile-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .character-browser { width: calc(100% - 56px); }
  .character-roster { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .character-ticket { grid-column: span 2; }
  .character-ticket:nth-child(4) { grid-column: 2 / span 2; }
  .character-profile-copy { padding-inline: 25px; }
}

@media (max-width: 600px) {
  .character-browser { width: calc(100% - 40px); }
  .character-picker-hint { margin-top: -9px; font-size: .875rem; }
  .character-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .character-ticket, .character-ticket:nth-child(4) { grid-column: auto; }
  .character-ticket:last-child { grid-column: 1 / -1; width: calc((100% - 13px) / 2); justify-self: center; }
  .character-ticket-link { padding: 5px 5px 0; border-radius: 19px; }
  .character-ticket-art { border-radius: 14px; }
  .character-ticket-label { min-height: 50px; padding: 7px 5px 7px 7px; }
  .character-ticket-open { flex-basis: 22px; height: 22px; font-size: .875rem; }
  .character-profile { grid-template-columns: 1fr; border-radius: 23px; }
  .character-profile-art { height: clamp(258px, 87vw, 390px); }
  .character-profile-copy { padding: 23px 24px 28px; }
  .character-profile-copy h4 { font-size: clamp(1.65rem, 7.4vw, 2.25rem); }
  .character-profile-copy p { margin-top: 13px; }
  .character-profile-pulse { margin-top: 12px; }
  .character-navigation { grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 13px; }
  .character-selectors { grid-row: 1; grid-column: 1 / -1; gap: 8px; }
  .character-select { width: 44px; height: 44px; }
  .character-control { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .character-browser *, .character-browser *::before, .character-browser *::after { animation: none !important; transition: none !important; }
}


/* 粉髮小卡：放大頭部，裁掉下半身 */
.character-ticket.ticket-zoom-head .character-ticket-art img { width: 250%; top: 4%; left: 81%; transform-origin: 37% 33%; }

/* 粉髮全身圖（趴姿橫圖）：依其他角色頭身比例等比縮放，置中 */
#character-02 .character-profile-art img { top: 50%; left: 50%; width: calc(clamp(440px, 37vw, 526px) * .9); height: auto; transform: translate(-50%, -45%); }
@media (max-width: 600px) {
  #character-02 .character-profile-art img { width: calc(clamp(258px, 87vw, 390px) * .9); }
}

/* 粉髮下方小頭像：與上方小卡一樣放大頭部 */
.character-select[data-character-select="02"] img { top: 2%; left: 81%; width: 250%; }
#character-05 .character-profile-art img { transform: scale(.85); transform-origin: 50% 55%; }
