.gift-tray {
  position: fixed;
  z-index: 9;
  bottom: calc(78px + var(--safe));
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 560px);
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  background: #211330f7;
  border-top: 1px solid #a579526e;
}
.gift-tray button { flex: 1; min-width: 0; min-height: 44px; padding-inline: 4px; font-size: 12px; }
.party-view:has(.gift-tray) { padding-bottom: calc(145px + var(--safe)); }
html:has(.gift-sheet) { overflow: hidden; }
.modal-root:has(.gift-sheet) { align-items: end; padding: 8px 10px max(10px,var(--safe)); }
.modal-root .gift-sheet {
  max-height: min(72dvh, 460px);
  padding: 17px 16px 14px;
  border-radius: 17px;
  background: linear-gradient(154deg,#382247,#1c112b 75%);
}
.gift-sheet h2 { margin-bottom: 6px; font-size: 21px; }
.gift-sheet p { margin: 0 0 8px; font-size: 13px; }
.gift-sheet label { display: block; text-align: left; color: #f9dfab; font-size: 12px; margin: 6px 0 4px; }
.gift-sheet input {
  width: 100%;
  height: 44px;
  border: 1px solid #c297ac;
  border-radius: 9px;
  padding: 8px 10px;
  background: #170c24;
  color: #fff1d9;
  font: inherit;
  font-size: 16px;
}
.gift-sheet #gift-share-code,.gift-sheet input[id$="coming"] { font-family: ui-monospace,monospace; }
.gift-sheet .gift-error { color: #ffcf9d; text-align: left; margin: 5px 0; }
.gift-error:empty { display: none; }
.gift-sheet .modal-actions { margin-top: 10px; }
.gift-mark {
  display: inline-block;
  max-width: 100%;
  border: 1px solid #dbb97786;
  border-radius: 99px;
  padding: 2px 7px;
  background: #523657;
  color: #ffe4a8;
  font-size: 11px;
  line-height: 1.4;
}
.gift-origin { margin: 6px 0; color: #ffe4b3; font-size: 12px; text-align: center; }
.bond-form { margin: 9px 0; padding: 9px; border: 1px solid #b994bd6b; border-radius: 10px; }
.bond-form p { margin: 4px 0 0; font-size: 12px; }
.bond-form .creature-art { width: 68px; height: 68px; margin: 0 auto; }
.gift-reveal { position: relative; }
.gift-reveal .creature-art { width: 94px; height: 94px; margin: 0 auto; animation: gift-appear .65s ease-out both; }
.gift-open-art { color: #ffcd72; position: absolute; top: 70px; left: 50%; transform: translateX(-50%); }
.gift-reveal .sheet-cancel { margin-top: 10px; }
@keyframes gift-appear {
  from { opacity: 0; transform: translateY(25px) scale(.6); filter: brightness(1.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .gift-reveal .creature-art { animation: none; } }
.reduce-motion .gift-reveal .creature-art { animation: none; }
.evolution-reveal[data-evolve-stage="1"] .evolution-art-burst .creature-art { opacity: 0; }
.evolution-reveal[data-evolve-stage="2"] .evolution-art-burst .creature-art { filter: brightness(0); }
.gift-open-art { inset: 20px auto auto 50%; animation: gift-box-open .6s ease-out both; }
.gift-open-art svg { width: 54px; height: 54px; }
@keyframes gift-box-open {
  0%,30% { opacity: 1; transform: translate(-50%,18px) scale(.9); }
  100% { opacity: 0; transform: translate(-50%,-9px) scale(1.25); }
}
@media (prefers-reduced-motion: reduce) { .gift-open-art { display: none; } }
.reduce-motion .gift-open-art { display: none; }

#modal:has(.evolution-reveal) { padding: 0; align-items: stretch; }
#modal:has(.evolution-reveal) > .modal-box {
  width: min(100%, 520px);
  max-height: 100dvh;
  height: 100dvh;
  padding: calc(12px + var(--safe-top)) 14px calc(12px + var(--safe));
  border: 0;
  border-radius: 0;
  background: radial-gradient(ellipse at 50% 27%, #68427b, #35213c 55%, #23172e);
}
.evolution-reveal { min-height: 100%; display: flex; flex-direction: column; gap: 9px; }
.evolution-reveal .evolution-art-burst { min-height: clamp(155px, 35dvh, 340px); overflow: clip; }
.evolution-reveal .evolution-art-burst .creature-art { width: min(100%, 360px); height: clamp(155px, 35dvh, 340px); }
.evolution-reveal .evolution-changes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.evolution-changes > div { padding: 8px 4px; border: 1px solid #a87b9b; border-radius: 8px; background: #33203f; }
.evolution-changes :is(dt,dd) { margin: 0; color: #fff0d8; }
.evolution-changes dd { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.evolution-changes b { font-size: 1.25rem; color: #ffd999; }
.evolution-reveal .modal-cancel { min-height: 50px; margin-top: auto; }
.evolution-reveal[data-evolve-stage="3"] .evolution-art-burst { animation: evolve-jolt .36s ease-out both; }
.evolution-reveal[data-evolve-stage="3"] .evolution-art-burst::after {
  content: "";
  position: absolute;
  inset: 16% 12%;
  border: 4px solid #ffe4b6;
  border-radius: 50%;
  box-shadow: 0 0 23px #f5b964, inset 0 0 29px #f5b964;
  pointer-events: none;
  animation: evolve-ring .66s ease-out both;
}
@keyframes evolve-ring { from { opacity: .95; scale: .35; } to { opacity: 0; scale: 1.55; } }
@keyframes evolve-jolt {
  0%,100% { translate: 0 0; filter: none; }
  16% { translate: -5px 1px; filter: brightness(1.65); }
  35% { translate: 4px -2px; }
  56% { translate: -3px 0; }
  75% { translate: 2px 0; }
}
html.reduce-motion .evolution-reveal .evolution-art-burst,
html.reduce-motion .evolution-reveal .evolution-art-burst::after { animation: none; }
html.reduce-motion .evolution-reveal .evolution-art-burst::after { display: none; }
@media(prefers-reduced-motion:reduce) {
  .evolution-reveal .evolution-art-burst,.evolution-reveal .evolution-art-burst::after { animation: none; }
  .evolution-reveal .evolution-art-burst::after { display: none; }
}
.evolution-art-burst :is(.evolution-before,.evolution-after) { grid-area: 1 / 1; }
.evolution-art-burst .evolution-before { display: none; }
.evolution-reveal[data-evolve-stage="1"] .evolution-before { display: block; }
.evolution-reveal[data-evolve-stage="1"] .evolution-before .creature-art { opacity: 1; }
.evolution-reveal[data-evolve-stage="1"] .evolution-after { visibility: hidden; }
.menu-embedded .evolution-reveal .evolution-art-burst,
.menu-embedded .evolution-reveal .evolution-art-burst .creature-art {
  min-height: 0;
  height: clamp(135px, 27dvh, 250px);
}
.evolution-reveal .evolution-art-burst::before {
  background: radial-gradient(ellipse,#edc08166,transparent 68%);
  animation: none;
}
