.pet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, #c34f91);
  box-shadow: 0 6px 18px rgba(255,107,157,0.2);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s ease;
}

.pet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 23px rgba(255,107,157,0.3);
}

.pet-btn:active {
  transform: translateY(0);
}

.pet-icon {
  font-size: 17px;
  animation: pet-icon-float 3s ease-in-out infinite;
}

@keyframes pet-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.pet-label {
  display: inline;
}

.pet-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(3,5,12,0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: pet-modal-in 0.25s ease;
}

.pet-modal-content {
  position: relative;
  width: min(390px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255,107,157,0.15),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #191a2b 0%,
      #0d0e18 100%
    );
  box-shadow: 0 25px 70px rgba(0,0,0,0.55);
  color: #fff;
  animation: pet-content-in 0.3s ease;
}

.pet-modal-content::-webkit-scrollbar {
  width: 4px;
}

.pet-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.pet-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
}

.pet-close-btn {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 20;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.75);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s ease;
}

.pet-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: rotate(90deg);
}

.pet-image-section {
  position: relative;
  min-height: 0;
  padding: 27px 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

.pet-image-section::before {
  content: "";
  position: absolute;
  top: 25px;
  left: 50%;
  width: 215px;
  height: 215px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255,107,157,0.18) 0%,
      rgba(255,107,157,0.05) 45%,
      transparent 72%
    );
  filter: blur(4px);
  pointer-events: none;
  animation: pet-glow-pulse 4s ease-in-out infinite;
}

@keyframes pet-glow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.pet-image-section::after {
  content: "";
  position: absolute;
  bottom: 43px;
  left: 50%;
  width: 145px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  filter: blur(11px);
  pointer-events: none;
  animation: pet-shadow-breathe 3.4s ease-in-out infinite;
}

@keyframes pet-shadow-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.85; }
  50% { transform: translateX(-50%) scale(0.97); opacity: 0.75; }
}

.pet-image-wrapper {
  position: relative;
  z-index: 2;
  display: block;
  width: min(285px, 76vw);
  height: 215px;
  margin: 0 auto 2px;
}

.pet-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 17px 17px rgba(0,0,0,0.32))
    drop-shadow(0 0 22px rgba(255,107,157,0.07));
  user-select: none;
  -webkit-user-drag: none;
  animation: pet-breathe 3.4s ease-in-out infinite;
  transform-origin: 50% 100%;
  transition: opacity 0.2s ease;
}

@keyframes pet-breathe {
  0%, 100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-1.5px) scale(1.008, 0.992);
  }
}

@keyframes pet-gesture-tilt {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-1.5px) rotate(-1.5deg); }
  50% { transform: translateY(-0.5px) rotate(1deg); }
  75% { transform: translateY(-1px) rotate(-0.5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes pet-gesture-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-6px) scale(0.99, 1.02); }
  50% { transform: translateY(0) scale(1.02, 0.98); }
  70% { transform: translateY(-2px) scale(0.995, 1.01); }
  100% { transform: translateY(0) scale(1, 1); }
}

.pet-bounce {
  animation: pet-feed-bounce 1.4s ease-in-out !important;
}

@keyframes pet-feed-bounce {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  20% {
    transform: translateY(-16px) scale(1.08) rotate(-2deg);
  }
  40% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  60% {
    transform: translateY(-9px) scale(1.04) rotate(2deg);
  }
  80% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.pet-info {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#pet-name {
  margin: 0;
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.pet-subtitle {
  margin-top: 4px;
  color: rgba(255,255,255,0.42);
  font-size: 10px;
}

.pet-stats {
  width: 100%;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.stat-item {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 13px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.3s ease;
}

.stat-item:hover {
  background: rgba(255,107,157,0.08);
  border-color: rgba(255,107,157,0.2);
}

.stat-label {
  color: rgba(255,255,255,0.43);
  font-size: 10px;
  font-weight: 600;
}

.stat-value {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  animation: stat-value-pulse 2.6s ease-in-out infinite;
}

@keyframes stat-value-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.pet-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 12px 15px 15px;
}

.pet-btn-action {
  min-height: 42px;
  padding: 8px 4px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pet-btn-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.pet-btn-action:hover::before {
  left: 100%;
}

.pet-btn-action:hover:not(:disabled) {
  transform: translateY(-2px);
}

.pet-btn-action:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.feed-btn {
  color: #fff;
  background: linear-gradient(
    135deg,
    #ff5f9f,
    #c34d9d
  );
  box-shadow: 0 6px 18px rgba(255,95,159,0.2);
}

.feed-btn.disabled,
.feed-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: #30313b;
  box-shadow: none;
}

.rename-btn,
.clothes-open-btn {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.055);
}

.rename-btn:hover:not(:disabled),
.clothes-open-btn:hover:not(:disabled) {
  background: rgba(255,107,157,0.09);
  border-color: rgba(255,107,157,0.25);
}

.pet-clothes-section {
  display: none;
  margin: 0 15px 15px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
}

.pet-clothes-section.open {
  display: block;
  animation: clothes-open 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pet-clothes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pet-clothes-section h3 {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.pet-clothes-count {
  color: rgba(255,255,255,0.3);
  font-size: 9px;
}

.clothes-inventory {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.clothes-item {
  position: relative;
  min-height: 90px;
  padding: 7px 5px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(0,0,0,0.16);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.clothes-item:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255,107,157,0.35);
  background: rgba(255,107,157,0.07);
}

.clothes-item:active {
  transform: translateY(-1px) scale(0.98);
}

.clothes-item.equipped {
  border-color: rgba(255,107,157,0.75);
  background: rgba(255,107,157,0.1);
  box-shadow: 0 0 0 1px rgba(255,107,157,0.08);
  animation: equipped-pulse 2.6s ease-in-out infinite;
}

@keyframes equipped-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,107,157,0.08); }
  50% { box-shadow: 0 0 12px rgba(255,107,157,0.16); }
}

.clothes-item.equipped::after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff6b9d;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  animation: check-pop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes check-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.clothes-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  display: block;
  margin: 0 auto 3px;
  transition: transform 0.3s ease;
}

.clothes-item:hover .clothes-img {
  transform: scale(1.1) rotate(-5deg);
}

.clothes-none-icon {
  width: 45px;
  height: 45px;
  margin: 0 auto 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 19px;
  transition: transform 0.3s ease;
}

.clothes-item:hover .clothes-none-icon {
  transform: scale(1.2) rotate(180deg);
}

.clothes-name {
  display: block;
  overflow: hidden;
  color: rgba(255,255,255,0.78);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clothes-status {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,0.3);
  font-size: 8px;
}

.pet-notification {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10001;
  max-width: calc(100% - 30px);
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  color: #fff;
  background: rgba(20,21,32,0.95);
  box-shadow: 0 14px 35px rgba(0,0,0,0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pet-notification.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pet-notification-success {
  border-color: rgba(85,220,155,0.25);
  animation: notification-glow 2.6s ease-in-out infinite;
}

.pet-notification-error {
  border-color: rgba(255,90,110,0.3);
  animation: notification-shake 0.5s ease;
}

.pet-notification-info {
  border-color: rgba(80,170,255,0.3);
}

@keyframes notification-glow {
  0%, 100% { box-shadow: 0 14px 35px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 14px 35px rgba(85,220,155,0.18); }
}

@keyframes notification-shake {
  0%, 100% { transform: translate(-50%, 0); }
  25% { transform: translate(-55%, 0); }
  75% { transform: translate(-45%, 0); }
}

@keyframes pet-modal-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pet-content-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes clothes-open {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 380px) {
  .pet-modal {
    padding: 7px;
  }

  .pet-modal-content {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
    border-radius: 22px;
  }

  .pet-image-section {
    padding-top: 23px;
  }

  .pet-image-wrapper {
    width: 250px;
    height: 190px;
  }

  .pet-actions {
    padding-left: 11px;
    padding-right: 11px;
    gap: 5px;
  }

  .pet-btn-action {
    min-height: 39px;
    font-size: 9px;
  }

  .pet-clothes-section {
    margin-left: 11px;
    margin-right: 11px;
  }
}

.clothes-item.locked {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.6);
}

.clothes-item.locked:hover {
  transform: none;
  border-color: rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.16);
}

.clothes-item.locked .clothes-img,
.clothes-item.locked .clothes-none-icon {
  filter: none;
}

.clothes-lock-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
}


.pet-image {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}
