/* Gift message root container */
.message.gift {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding-block: 0.5rem;
    overflow-wrap: anywhere;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Gift message bubble styles (contentBox) */
.message.gift .message-bubble {
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    width: 223px;
    height: 258px;
    max-width: 223px;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4);
    color: #fff;
    background-color: rgba(72, 87, 97, 0);
    background-repeat: no-repeat;
    background-position: center;
    box-sizing: border-box;
    margin-bottom: 4px;
    /* Ensure transparency is preserved */
    isolation: isolate;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Gift notification block (above gift bubble) */
.gift-notification {
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 3px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: auto;
    max-width: 100%;
    margin-bottom: 5px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Gift info block */
.gift-info {
    position: relative;
    font-size: 14px;
    width: 100%;
}

/* Gift title */
.gift-title {
    margin-bottom: 0;
    font-size: 13px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    text-align: center;
}

/* Gift subtitle */
.gift-subtitle {
    font-size: 11px;
    text-wrap: balance;
    text-align: center;
    margin-bottom: 6px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Gift details container */
.gift-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    transform: scale(1);
    transform-origin: top left;
}

.gift-detail-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.gift-detail-label {
    font-size: 11px;
    opacity: 0.8;
    text-align: right;
    width: 85px;
    flex-shrink: 0;
}

.gift-detail-value {
    font-size: 11px;
    font-weight: bold;
    text-align: left;
    width: 106px;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Action button with stars */
.gift-action-button {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    border-radius: 1.25rem;
    font-size: 13px;
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.4) !important; /* Always black with 40% opacity */
    transition: opacity 0.15s;
    width: 100px;
    height: 28px;
    text-align: center;
    overflow: visible; /* Allow stars to go outside */
}

.gift-action-button:hover,
.gift-action-button:focus {
    opacity: 0.8;
}

/* Stars animation container */
.gift-stars-container {
    position: absolute;
    inset: -10px; /* Allow stars to go slightly outside button bounds */
    overflow: visible; /* Allow stars to be visible outside */
    border-radius: inherit;
    pointer-events: none;
    transform: scale(1);
    transform-origin: center;
}

.gift-star {
    position: absolute;
    font-size: 8px;
    color: #fff;
    opacity: 0.8;
    animation: starFloat 3s ease-in-out infinite;
    animation-delay: var(--_delay, 0s);
}

@keyframes starFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(var(--_shift-x, 0), var(--_shift-y, 0)) scale(var(--_scale, 1));
        opacity: 0.4;
    }
    100% {
        transform: translate(var(--_shift-x, 0), var(--_shift-y, 0)) scale(var(--_scale, 1));
        opacity: 0;
    }
}

/* Gift lottie animation container */
.gift-lottie-container {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 1px;
    opacity: 1;
    background: transparent !important;
    overflow: visible;
    z-index: 1; /* Ensure it's above background gradient */
    mix-blend-mode: normal; /* Preserve transparency */
    isolation: isolate; /* Create new stacking context */
}

.gift-lottie-container canvas,
.gift-lottie-container svg,
.gift-lottie-container div {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1;
    /* Preserve all effects from Lottie */
    filter: none;
    mix-blend-mode: normal;
}

.gift-lottie-container svg {
    background-color: transparent !important;
    mix-blend-mode: normal;
    /* Enable SVG filters for glow effects */
    enable-background: new;
    /* Don't override any SVG attributes */
    color-interpolation-filters: sRGB;
}

.gift-lottie-container svg * {
    /* Preserve ALL properties from Lottie - don't override */
    /* Let Lottie handle opacity, filters, and effects */
}

/* Ensure filters and effects work correctly */
.gift-lottie-container svg defs,
.gift-lottie-container svg filter {
    /* Preserve filter definitions */
}

.gift-lottie-container canvas {
    /* Force canvas to use alpha channel */
    image-rendering: auto;
    /* Ensure canvas context uses alpha */
    mix-blend-mode: normal;
    /* Don't override canvas rendering */
    will-change: auto;
}

.gift-lottie-container div {
    /* For HTML renderer */
    background: transparent !important;
    opacity: 1 !important;
}

/* Gift icon container */
.AmQSvxpZ {
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 10;
    width: 47px;
    height: 47px;
}

.AmQSvxpZ svg {
    width: 47px;
    height: 47px;
    position: relative;
}

.pQW7dcwr {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translate(6px, -6px) rotate(45deg);
    font-size: 8px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

/* Patterns container */
.gift-patterns-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
    z-index: 1;
}

.gift-pattern {
    position: absolute;
    object-fit: contain;
    pointer-events: none;
}

/* Individual pattern styles */
.gift-pattern[data-pattern-index="0"] {
    width: 20px;
    height: 20px;
    opacity: 0.06;
    transform: scale(1);
    top: -3%;
    left: 33%;
}

.gift-pattern[data-pattern-index="1"] {
    width: 20px;
    height: 20px;
    opacity: 0.06;
    transform: scale(1);
    top: -3%;
    right: 33%;
}

.gift-pattern[data-pattern-index="2"] {
    width: 20px;
    height: 20px;
    opacity: 0.1;
    transform: scale(1);
    top: 7%;
    left: 19%;
}

.gift-pattern[data-pattern-index="3"] {
    width: 20px;
    height: 20px;
    opacity: 0.1;
    transform: scale(1);
    top: 7%;
    right: 19%;
}

.gift-pattern[data-pattern-index="4"] {
    width: 22px;
    height: 22px;
    opacity: 0.1;
    transform: scale(1);
    top: 21%;
    left: 10%;
}

.gift-pattern[data-pattern-index="5"] {
    width: 22px;
    height: 20px;
    opacity: 0.1;
    transform: scale(1);
    top: 21%;
    right: 10%;
}

.gift-pattern[data-pattern-index="6"] {
    width: 20px;
    height: 20px;
    opacity: 0.06;
    transform: scale(1);
    bottom: 57%;
    left: 1%;
}

.gift-pattern[data-pattern-index="7"] {
    width: 20px;
    height: 20px;
    opacity: 0.06;
    transform: scale(1);
    bottom: 57%;
    right: 1%;
}

.gift-pattern[data-pattern-index="8"] {
    width: 20px;
    height: 20px;
    opacity: 0.1;
    transform: scale(1);
    bottom: 50%;
    left: 19%;
}

.gift-pattern[data-pattern-index="9"] {
    width: 20px;
    height: 20px;
    opacity: 0.1;
    transform: scale(1);
    bottom: 50%;
    right: 19%;
}

.gift-pattern[data-pattern-index="10"] {
    width: 22px;
    height: 22px;
    opacity: 0.1;
    transform: translateX(-50%) scale(1);
    top: 58%;
    left: 17%;
}

.gift-pattern[data-pattern-index="11"] {
    width: 22px;
    height: 22px;
    opacity: 0.1;
    transform: translateX(-50%) scale(1);
    top: 58%;
    right: 7%;
}

.gift-pattern[data-pattern-index="12"] {
    width: 22px;
    height: 22px;
    opacity: 0.06;
    transform: scale(1);
    bottom: 12%;
    left: 11%;
}

.gift-pattern[data-pattern-index="13"] {
    width: 22px;
    height: 22px;
    opacity: 0.06;
    transform: scale(1);
    bottom: 12%;
    right: 11%;
}