.giveaway-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 20, 0.85);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
}

.giveaway-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.giveaway-modal {
    width: 500px;
    height: 600px;
    max-width: 95vw;
    max-height: 95vh;
    background: #0B0B0F;
    border-radius: 16px;
    transform: scale(.92) translateY(20px);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

.giveaway-modal-overlay.show .giveaway-modal {
    transform: scale(1) translateY(0);
}

.giveaway-modal__header {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 0;
    flex-shrink: 0;
}

.giveaway-modal__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
    color: #fff;
}

.giveaway-modal__title-token {
    position: relative;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.62);
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
    transition: color .2s ease;
}

.giveaway-modal__title-token.is-empty {
    display: none;
}

.giveaway-modal__title-token-text {
    display: block;
    max-width: 220px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.giveaway-modal__title-token:hover,
.giveaway-modal__title-token:focus-visible {
    color: rgba(255,255,255,0.92);
}

.giveaway-modal__title-help {
    display: none;
}

.giveaway-modal__title-help:hover,
.giveaway-modal__title-help:focus-visible {
    background: rgba(255,255,255,0.14);
    color: #FFFFFF;
}

.giveaway-modal__title-token:focus-visible {
    outline: none;
}

.giveaway-modal__title-help:focus-visible {
    outline: none;
}

.giveaway-modal__title-token::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.giveaway-modal__title-token::before {
    content: none;
}

.giveaway-modal__title-token::after {
    content: attr(data-tooltip);
    top: calc(100% + 10px);
    padding: 8px 14px;
    border-radius: 10px;
    background: #FFFFFF;
    color: #0F0F14;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
    z-index: 8;
    transform: translate(-50%, 6px);
}

.giveaway-modal__title-token:hover::after,
.giveaway-modal__title-token:focus-visible::after,
.giveaway-modal__title-token.is-tooltip-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.giveaway-modal__title-help::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    width: 250px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #FFFFFF;
    color: #0F0F14;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 8;
}

.giveaway-modal__title-help:hover::after,
.giveaway-modal__title-help:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.giveaway-modal__close {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 4px;
    transition: color .2s;
    line-height: 1;
    flex-shrink: 0;
}

.giveaway-modal__close:hover {
    color: #fff;
}

.giveaway-modal__content[hidden],
.giveaway-modal__alert[hidden] {
    display: none !important;
}

.giveaway-modal__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.giveaway-modal__hero {
    position: relative;
    flex-shrink: 0;
    margin: 12px 18px 0;
    padding: 18px 0 16px;
    border-radius: 0;
    background: transparent;
    text-align: center;
    overflow: hidden;
}

.giveaway-modal__diamond {
    position: absolute;
    width: 36px;
    height: 36px;
    color: #fff;
    opacity: .1;
    pointer-events: none;
    animation: giveawayDiamondFloat 8.5s ease-in-out infinite;
}

.giveaway-modal__diamond svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.giveaway-modal__diamond--one { top: 28px; left: 32px; animation-delay: -0.3s; }
.giveaway-modal__diamond--two { top: 18px; right: 38px; width: 31px; height: 31px; animation-delay: -1.5s; }
.giveaway-modal__diamond--three { top: 120px; left: 6px; width: 29px; height: 29px; animation-delay: -2.4s; }
.giveaway-modal__diamond--four { top: 156px; right: 76px; width: 23px; height: 23px; animation-delay: -3.1s; }
.giveaway-modal__diamond--five { top: 78px; right: 4px; width: 26px; height: 26px; animation-delay: -4.2s; }

.giveaway-modal__icon {
    position: absolute;
    color: #fff;
    opacity: .1;
    pointer-events: none;
    z-index: 0;
}

.giveaway-modal__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.giveaway-modal__icon--trophy {
    animation: giveawayDecorGlide 9.5s ease-in-out infinite;
}

.giveaway-modal__icon--raccoon {
    animation: giveawayDecorSway 11s ease-in-out infinite;
}

.giveaway-modal__icon--trophy-one {
    top: 54px;
    left: 118px;
    width: 32px;
    height: 32px;
    animation-delay: -1.1s;
}

.giveaway-modal__icon--trophy-two {
    top: 150px;
    right: 146px;
    width: 28px;
    height: 28px;
    animation-delay: -4.8s;
}

.giveaway-modal__icon--raccoon-one {
    top: 18px;
    left: 188px;
    width: 28px;
    height: 28px;
    animation-delay: -2.3s;
}

.giveaway-modal__icon--raccoon-two {
    top: 126px;
    right: 28px;
    width: 26px;
    height: 26px;
    animation-delay: -6.2s;
}

.giveaway-modal__gift-wrap {
    position: relative;
    z-index: 1;
}

.giveaway-modal__gift-box {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    border-radius: 22px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.giveaway-modal__gift-box::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 28px;
    background: rgba(255,255,255,0.1);
    filter: blur(22px);
    opacity: .22;
    z-index: -1;
}

.giveaway-modal__gift-box svg {
    width: 42px;
    height: 42px;
    color: #fff;
}

.giveaway-modal__headline {
    position: relative;
    z-index: 1;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
    color: #fff;
}

.giveaway-modal__subline {
    position: relative;
    z-index: 1;
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: rgba(255,255,255,0.84);
}

.giveaway-modal__countdown-block {
    position: relative;
    z-index: 1;
    margin-top: 14px;
}

.giveaway-modal__countdown-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.42);
}

.giveaway-modal__countdown {
    width: min(304px, 100%);
    margin: 8px auto 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.giveaway-modal__countdown-item,
.giveaway-modal__countdown-fallback {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
}

.giveaway-modal__countdown-item strong,
.giveaway-modal__countdown-fallback strong {
    display: block;
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    color: #fff;
}

.giveaway-modal__countdown-item span,
.giveaway-modal__countdown-fallback span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.36);
    text-transform: none;
}

.giveaway-modal__action {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.giveaway-modal__action-btn,
.giveaway-modal__action-note {
    width: min(304px, 100%);
    min-width: 0;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.giveaway-modal__action-btn {
    border: none;
    background: #85FF83;
    color: #0F0F14;
    cursor: pointer;
    box-shadow: none;
    transition: transform .2s ease;
}

.giveaway-modal__action-btn:hover {
    transform: translateY(-1px);
}

.giveaway-modal__action-btn[disabled] {
    opacity: .7;
    cursor: default;
    transform: none;
}

.giveaway-modal__action-note {
    border: none;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.88);
    gap: 8px;
}

.giveaway-modal__action-note--success {
    border-color: rgba(133,255,131,0.2);
    background: rgba(133,255,131,0.2);
    color: #85FF83;
}

.giveaway-modal__action-note--completed {
    background: rgba(255,255,255,0.14);
    color: #FFFFFF;
}

.giveaway-modal__action-note--info { color: #7db8ff; }
.giveaway-modal__action-note--warn { color: #FFFFFF; }
.giveaway-modal__action-note--error { color: #ff8f8f; }

.giveaway-modal__action-spinner {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    object-fit: contain;
    display: block;
}

.giveaway-modal__winners[hidden] {
    display: none;
}

.giveaway-modal__winners {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.giveaway-modal__winners-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    color: rgba(255,255,255,0.52);
}

.giveaway-modal__winners-list {
    width: min(304px, 100%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
    line-height: 1.35;
}

.giveaway-modal__winner-link {
    padding: 0;
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    transition: opacity .18s ease;
}

.giveaway-modal__winner-link:hover,
.giveaway-modal__winner-link:focus-visible {
    opacity: .72;
    outline: none;
}

.giveaway-modal__winner-separator {
    color: rgba(255,255,255,0.42);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.giveaway-modal__alert {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.giveaway-modal__alert--success {
    color: #85FF83;
    background: rgba(133,255,131,0.08);
}

.giveaway-modal__alert--error {
    color: #ff8f8f;
    background: rgba(255,143,143,0.08);
}

.giveaway-modal__participants-area {
    flex: 1;
    min-height: 0;
    margin: 0 18px 18px;
    padding: 14px 12px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.giveaway-modal__participants-head {
    display: flex;
    align-items: center;
    padding-left: 2px;
    margin-bottom: 10px;
}

.giveaway-modal__participants-head span {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}

.giveaway-modal__participants-count {
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.giveaway-modal__participants {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 4px 0 4px 0;
    align-content: start;
}

.giveaway-modal__participants::-webkit-scrollbar {
    width: 4px;
}

.giveaway-modal__participants::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
}

.giveaway-modal__participant {
    text-align: center;
}

.giveaway-modal__participant-avatar-wrap {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
}

.giveaway-modal__participant-avatar,
.giveaway-modal__participant-fallback {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    background: #161922;
    border: none;
}

.giveaway-modal__participant-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.giveaway-modal__participant-name {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    color: rgba(255,255,255,0.84);
}

.giveaway-modal__participant-time {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.34);
}

.giveaway-modal__empty {
    grid-column: 1 / -1;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
}

@keyframes giveawayDiamondFloat {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    25% { transform: translate3d(8px, -12px, 0) rotate(8deg); }
    50% { transform: translate3d(-6px, -22px, 0) rotate(-6deg); }
    75% { transform: translate3d(10px, -14px, 0) rotate(7deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes giveawayDecorGlide {
    0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    35% { transform: translate3d(10px, -16px, 0) rotate(7deg) scale(1.04); }
    70% { transform: translate3d(-8px, -6px, 0) rotate(-5deg) scale(.98); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

@keyframes giveawayDecorSway {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    30% { transform: translate3d(-7px, -11px, 0) rotate(-6deg); }
    60% { transform: translate3d(9px, -18px, 0) rotate(5deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@media (max-width: 560px) {
    .giveaway-modal-overlay {
        align-items: flex-end;
    }

    .giveaway-modal {
        width: 100%;
        height: min(600px, 95vh);
        border-radius: 16px 16px 0 0;
    }

    .giveaway-modal__participants {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px 6px;
    }

    .giveaway-modal__participant-avatar-wrap {
        width: 70px;
        height: 70px;
    }

    .giveaway-modal__participant-avatar,
    .giveaway-modal__participant-fallback {
        width: 70px;
        height: 70px;
    }
}
