.uihf-patched .uihf-modal-shell {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  padding: 18px 14px 26px !important;
  z-index: 2147483647 !important;
}

.uihf-patched .editor-modal-layer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
}

.uihf-patched .uihf-fixed-host-reset {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  transform: none !important;
  z-index: auto !important;
  isolation: auto !important;
  contain: none !important;
  clip-path: none !important;
  mask: none !important;
  -webkit-mask: none !important;
  will-change: auto !important;
}

.uihf-patched .uihf-inline-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
  background: rgba(255, 255, 255, 0.62) !important;
  color: #5d7187 !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease !important;
}

.uihf-patched .uihf-inline-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.42) !important;
  background: rgba(240, 249, 255, 0.92) !important;
  color: #0f6ea8 !important;
}

.uihf-patched .uihf-inline-icon-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.uihf-patched .uihf-class-summary-icon {
  width: 42px !important;
  height: 42px !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.uihf-patched .uihf-class-summary-icon:hover {
  border-color: rgba(255, 255, 255, 0.42) !important;
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.uihf-patched .dialog-layer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
}

.uihf-patched .fixed.inset-0,
.uihf-patched [role="dialog"],
.uihf-patched dialog {
  z-index: 2147483647 !important;
  isolation: isolate;
}

.uihf-patched [data-testid="pet-profile-modal"] {
  width: min(1120px, calc(100vw - 24px)) !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
}

.uihf-patched [data-testid="pet-profile-modal"].uihf-pet-profile-slim {
  width: min(1040px, calc(100vw - 28px)) !important;
}

.uihf-patched .uihf-danger-confirm,
.uihf-patched [data-testid$="danger-confirm-modal"] {
  max-height: calc(100vh - 40px) !important;
  overflow-y: auto !important;
}

.uihf-patched [data-testid="pet-profile-modal"]::-webkit-scrollbar {
  width: 8px;
}

.uihf-patched [data-testid="pet-profile-modal"]::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

.uihf-patched [data-uihf-compact-hidden="1"] {
  display: none !important;
}

.uihf-compact-copy {
  line-height: 1.65 !important;
  color: #4b5563 !important;
}

.uihf-short-hint {
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #4b5563 !important;
}

.uihf-stage-hint {
  margin-top: 6px;
  border-radius: 10px;
  background: #eef6ff;
  border: 1px solid #d7e8ff;
  color: #1f4f7d;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
  padding: 6px 8px;
}

.uihf-stage-bubble {
  border-color: rgba(255, 255, 255, 0.82) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #1f4f7d !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.uihf-next-box {
  border-color: #dbeafe !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96)) !important;
}

.uihf-next-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.uihf-next-box-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 900;
  color: #94a3b8;
}

.uihf-next-box-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: #1e3a5f;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.uihf-next-box-title {
  margin-top: 12px;
  color: #16365c;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 900;
}

.uihf-next-box-progress {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.uihf-next-box-progress-bar {
  position: relative;
  flex: 1 1 auto;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.uihf-next-box-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.uihf-next-box-progress-text {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: #1d4f7d;
}

.uihf-next-box-metrics {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uihf-next-metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.uihf-pet-btn {
  position: relative;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16) !important;
  transform-origin: center center;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease !important;
}

.uihf-pet-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2) !important;
  filter: brightness(1.04);
}

.uihf-pet-btn.uihf-pet-feed {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
  color: #fff !important;
}

.uihf-pet-btn.uihf-pet-play {
  background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
  color: #fff !important;
}

.uihf-pet-btn.uihf-pet-clean {
  background: linear-gradient(135deg, #14b8a6, #10b981) !important;
  color: #fff !important;
}

.uihf-pet-btn.uihf-pet-hatch,
.uihf-pet-btn.uihf-pet-evolve {
  background: linear-gradient(135deg, #ef4444, #ec4899) !important;
  color: #fff !important;
}

.uihf-pet-pop {
  animation: uihfPetPop .26s ease;
}

.uihf-action-bubble {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  color: #17466f;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cce5ff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
  animation: uihfBubbleInOut 1.8s ease forwards;
  pointer-events: none;
  z-index: 13200;
}

.uihf-ceremony-layer {
  position: fixed;
  inset: 0;
  z-index: 11800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity .24s ease;
}

.uihf-ceremony-layer.show {
  opacity: 1;
}

.uihf-ceremony-card {
  width: min(560px, calc(100vw - 28px));
  min-height: 232px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 40% 20%, #ffffff, #ecf6ff);
  box-shadow: 0 30px 65px rgba(15, 23, 42, 0.4);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px 18px;
  transform: scale(0.94);
  transition: transform .24s ease;
}

.uihf-ceremony-layer.show .uihf-ceremony-card {
  transform: scale(1);
}

.uihf-ceremony-card.hatch {
  background: radial-gradient(circle at 40% 20%, #ffffff, #fff2d9);
}

.uihf-ceremony-card.claim {
  background: radial-gradient(circle at 40% 20%, #ffffff, #dff5ff);
}

.uihf-ceremony-card.evolve {
  background: radial-gradient(circle at 40% 20%, #ffffff, #ffe6f3);
}

.uihf-ceremony-stage {
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: 1fr 68px 1fr;
  align-items: center;
  gap: 12px;
}

.uihf-ceremony-pet {
  height: 118px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.uihf-ceremony-pet-image {
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.uihf-ceremony-emoji {
  font-size: 52px;
  line-height: 1;
}

.uihf-ceremony-pet.before {
  animation: uihfCeremonyShake .32s ease-in-out infinite;
}

.uihf-ceremony-pet.after {
  transform: scale(0.96);
  opacity: 0.72;
  transition: transform .32s ease, opacity .32s ease;
}

.uihf-ceremony-card.done .uihf-ceremony-pet.before {
  animation: none;
  opacity: 0.46;
  transform: scale(0.9);
}

.uihf-ceremony-card.done .uihf-ceremony-pet.after {
  transform: scale(1.06);
  opacity: 1;
}

.uihf-ceremony-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #285b89;
  font-weight: 900;
  text-shadow: 0 8px 15px rgba(15, 23, 42, 0.16);
  animation: uihfCeremonyPulse 1.1s ease infinite;
}

.uihf-ceremony-title {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  color: #123d66;
  text-align: center;
}

.uihf-legacy-ceremony-muted {
  display: none !important;
}

.uihf-auto-closed-overlay {
  display: none !important;
  pointer-events: none !important;
}

.uihf-rename-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.uihf-rename-card {
  width: min(460px, 96vw);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(244,250,255,0.98) 100%);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.uihf-rename-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.uihf-rename-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 900;
  color: #94a3b8;
  text-transform: uppercase;
}

.uihf-rename-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 900;
  color: #123d66;
}

.uihf-rename-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
}

.uihf-rename-input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #d7e8ff;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}

.uihf-rename-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

.uihf-rename-error {
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 10px 12px;
}

.uihf-rename-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.uihf-rename-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.uihf-rename-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.uihf-rename-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.uihf-rename-btn.ghost {
  background: #e2e8f0;
  color: #475569;
}

.uihf-rename-btn.solid {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
}

@keyframes uihfPetPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes uihfBubbleInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.94);
  }
  15%,
  72% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.96);
  }
}

@keyframes uihfCeremonyPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.66;
  }
  65% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(0.96);
    opacity: 0.66;
  }
}

@keyframes uihfCeremonyShake {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-1px) rotate(-3deg);
  }
  55% {
    transform: translateY(1px) rotate(3deg);
  }
  80% {
    transform: translateY(0) rotate(-2deg);
  }
}

@media (max-width: 900px) {
  .uihf-ceremony-stage {
    grid-template-columns: 1fr 52px 1fr;
  }

  .uihf-ceremony-title {
    font-size: 21px;
  }

  .uihf-ceremony-pet {
    height: 96px;
    font-size: 46px;
  }
}
