/* Virtual cosmetics — rings, bubbles, tags, ID effects, entry frames, mic */

.ap-cosmetic-avatar-wrap {
  position: relative;
}

.ap-cosmetic-profile-ring {
  position: absolute;
  inset: -6%;
  pointer-events: none;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  z-index: 2;
}

.ap-cosmetic-ring-starlight {
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.85), 0 0 14px rgba(251, 191, 36, 0.45);
  animation: ap-cosmetic-ring-pulse 2s ease-in-out infinite;
}

.ap-cosmetic-ring-default {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.9), 0 0 10px rgba(139, 92, 246, 0.35);
}

@keyframes ap-cosmetic-ring-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

.ap-cosmetic-profile-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.ap-cosmetic-tag-king {
  background: linear-gradient(135deg, #f59e0b, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.ap-cosmetic-tag-default {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
}

.ap-cosmetic-username.has-cosmetic-id-effect {
  position: relative;
}

.ap-cosmetic-id-gold {
  background: linear-gradient(90deg, #fcd34d, #f59e0b, #fcd34d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ap-cosmetic-id-shine 3s linear infinite;
  font-weight: 800;
}

@keyframes ap-cosmetic-id-shine {
  to {
    background-position: 200% center;
  }
}

.ap-cosmetic-chat-bubble.ap-cosmetic-bubble-neon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(236, 72, 153, 0.3));
  border: 1px solid rgba(167, 139, 250, 0.55);
  border-radius: 12px;
  padding: 4px 10px;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.party-chat-text.ap-cosmetic-chat-bubble {
  display: inline-block;
  margin-top: 2px;
}

.ap-cosmetic-mic-effect.ap-cosmetic-mic-pulse {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.65), 0 0 16px rgba(34, 211, 238, 0.35);
  animation: ap-cosmetic-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes ap-cosmetic-mic-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.ap-cosmetic-entry-frame.ap-cosmetic-entry-royal-flame {
  outline: 3px solid rgba(251, 146, 60, 0.85);
  outline-offset: 4px;
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(251, 146, 60, 0.45);
}

/* Entry frame overlay — above video, below chat (z-index 11) */
.live-room > #apEntryFrameOverlay,
.party-room > #apEntryFrameOverlay,
.party-room-ref > #apEntryFrameOverlay,
#apEntryFrameOverlay.ap-entry-frame-overlay {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  background: transparent;
  overflow: hidden;
}

#apEntryFrameOverlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.ap-entry-frame-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ap-entry-frame-anim-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ap-entry-frame-anim {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  pointer-events: none;
  transform: translateZ(0);
}

.ap-entry-frame-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(8, 8, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  color: #fff;
  max-width: min(88vw, 360px);
  animation: ap-entry-frame-pop 0.45s ease;
}

@keyframes ap-entry-frame-pop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ap-entry-frame-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.ap-entry-frame-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.25;
}

.ap-entry-frame-label strong {
  font-size: 15px;
  font-weight: 800;
}

.ap-entry-frame-label span {
  opacity: 0.88;
  font-size: 12px;
}

/* DM chat bubbles */
.message-bubble.ap-cosmetic-chat-bubble.ap-cosmetic-bubble-neon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.42), rgba(236, 72, 153, 0.34));
  border: 1px solid rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.28);
}

.message-bubble.sent.ap-cosmetic-chat-bubble.ap-cosmetic-bubble-neon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(236, 72, 153, 0.42));
}

.ap-cosmetics-store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 16px 100px;
}

.ap-cosmetics-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  display: block;
}

.ap-cosmetics-card-thumb {
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin-bottom: 8px;
  overflow: hidden;
}

.ap-cosmetics-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ap-cosmetics-card h4 {
  font-size: 14px;
  margin: 0 0 4px;
}

.ap-cosmetics-card .price {
  font-size: 12px;
  color: #6b7280;
}

.ap-cosmetics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
}

.ap-cosmetics-tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ap-cosmetics-tab.is-active {
  background: #8b5cf6;
  color: #fff;
  border-color: #8b5cf6;
}

.ap-cosmetics-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  display: none;
  align-items: flex-end;
}

.ap-cosmetics-sheet-overlay.open {
  display: flex;
}

.ap-cosmetics-sheet {
  background: #fff;
  width: 100%;
  max-height: 88vh;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 24px;
}

.ap-cosmetics-variant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.ap-cosmetics-variant-row.is-selected {
  border-color: #8b5cf6;
  background: #f5f3ff;
}

.ap-cosmetics-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ap-cosmetics-btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
}

.ap-cosmetics-btn-muted {
  background: #f3f4f6;
  color: #374151;
  margin-top: 8px;
}

.ap-cosmetics-inventory-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
}

.ap-cosmetics-inventory-item .thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.ap-cosmetics-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.ap-cosmetics-badge.equipped {
  background: #dcfce7;
  color: #15803d;
}

.ap-cosmetics-badge.expired {
  background: #fee2e2;
  color: #b91c1c;
}
