/* 
 * Contest Popup Styles
 * Styling for the contest popup component
 */

/* Main Contest Popup Container */
.contest-popup {
    max-width: 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.contest-popup-body {
    padding: 0;
    background: linear-gradient(180deg, #010402 0%, #020F08 100%);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--tg-top-inset));
    overflow: hidden;
    width: -webkit-fill-available;
    position: relative;
}

/* Loader */
.contest-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 2, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.contest-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(36, 221, 138, 0.2);
    border-top: 4px solid #24DD8A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Content */
.contest-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 24px;
    width: 100%;
    min-height: 56px;
    background: linear-gradient(180deg, #010402 0%, #020F08 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.contest-title {
    color: #24DD8A;
    font-size: 32px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 35px;
}

.contest-invite-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(36, 221, 138, 0.1);
    border: 1px solid rgba(36, 221, 138, 0.4);
    border-radius: 4px;
    height: 35px;
    cursor: pointer;
    transition: transform var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                background-color var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                border-color var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                filter var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                box-shadow var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease);
}

.contest-invite-section:hover {
    transform: translateY(-2px);
    background: rgba(36, 221, 138, 0.17);
    border-color: rgba(83, 239, 171, 0.72);
    box-shadow: 0 10px 24px rgba(36, 221, 138, 0.12);
    filter: brightness(1.12);
}

.contest-invite-text {
    color: #24DD8A;
    font-size: 17px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 19px;
}

.contest-icon {
    color: #24DD8A;
    font-size: 10px;
}

/* Main Content (Image) */
.contest-main-content {
    width: 100%;
    min-height: 156px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.contest-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Tabs Section */
.contest-tabs {
    display: flex;
    width: 100%;
    min-height: 56px;
    background: linear-gradient(180deg, rgba(1, 4, 2, 0.9) 0%, rgba(2, 15, 8, 0.9) 100%);
    position: sticky;
    top: 56px;
    z-index: 10;
}

.contest-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: auto;
    position: relative;
    cursor: pointer;
    transition: transform var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                background-color var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                filter var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease);
}

.contest-tab:hover {
    transform: translateY(-2px);
    background: rgba(36, 221, 138, 0.1);
    filter: brightness(1.12);
}

.contest-tab.active:hover {
    background: rgba(36, 221, 138, 0.18);
}

.contest-tab.active {
    background: rgba(36, 221, 138, 0.1);
}

.tab-title {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    color: #24DD8A;
    font-size: 20px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 22px;
}

.contest-tab.active .tab-title {
    color: white;
}

.contest-tab.active .tab-members-count {
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.tab-members-count {
    padding: 2px 4px;
    background: black;
    box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.1);
    border: 1px solid rgba(36, 221, 138, 0.4);
    border-radius: 2px;
    color: #BEECD7;
    font-size: 10px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 11px;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

.tab-divider {
    width: 100%;
    height: 4px;
    background: transparent;
}

.tab-divider.active {
    background: #24DD8A;
    box-shadow: 0px 2px 8px rgba(36, 221, 138, 0.3);
}

/* Content Container */
.contest-content-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
}

/* Details Tab Content */
.contest-details-content,
.contest-members-content {
    display: none;
    flex-direction: column;
    padding-bottom: 90px;
}

.contest-details-content.active,
.contest-members-content.active {
    display: flex;
}

/* Timer Section */
.contest-timer-section {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.contest-timer-container {
    flex: 1;
    padding: 6px 12px;
    background: linear-gradient(180deg, #041A10 0%, #092E1C 100%);
    border: 1px solid rgba(48, 180, 88, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-info i {
    color: #24DD8A;
    font-size: 16px;
}

.timer-label {
    color: #24DD8A;
    font-size: 12px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 14px;
}

.timer-value {
    color: #24DD8A;
    font-size: 14px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 15px;
}

/* Prizes Section */
.contest-prizes-section {
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    gap: 32px;
}

/* First Place Prize */
.prize-section {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
}

.prize-section.first-place {
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.prize-icon-section {
    display: flex;
    align-items: flex-start;
    height: 70px;
    position: relative;
}

.prize-icon-section .prize-image {
    width: 125px;
    height: 125px;
    object-fit: contain;
}

.prize-info {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.prize-place {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.place-number {
    color: #27E791;
    font-size: 46px;
    font-family: 'Pixel Sans Serif', 'Jura', sans-serif;
    font-weight: 400;
    line-height: 51px;
}

.place-text {
    color: #24DD8A;
    font-size: 24px;
    font-family: 'Pixel Sans Serif', 'Jura', sans-serif;
    font-weight: 400;
    line-height: 26px;
}

.prize-reward {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 12px;
    background: rgba(36, 221, 138, 0.01);
    box-shadow: 0px 7px 52px 3px rgba(36, 221, 138, 0.4);
    border: 1px solid #24DD8A;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 19px;
    font-family: 'Silkscreen', 'Pixel Sans Serif', 'Jura', sans-serif;
    font-weight: 700;
    line-height: 21px;
    white-space: nowrap;
}

.reward-item i {
    color: #24DD8A;
    font-size: 16px;
}

img.our-star {
    width: 16px;
}

img.tg-star {
    width: 16px;
}

/* Prize Row for 2-3 and 4-6 places */
.prize-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.prize-section.second-place,
.prize-section.third-place {
    flex-direction: column;
    align-items: flex-start;
    width: calc(50% - 20px);
}

.prize-section.second-place .prize-row,
.prize-section.third-place .prize-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
}

.prize-section.second-place .prize-reward,
.prize-section.third-place .prize-reward {
    padding: 4px 7px;
    width: 100%;
}

.prize-section.second-place .place-number,
.prize-section.third-place .place-number {
    font-size: 50px;
    line-height: 56px;
}

.prize-section.second-place .place-text,
.prize-section.third-place .place-text {
    font-size: 18px;
    line-height: 20px;
}

.prize-section.second-place .reward-item,
.prize-section.third-place .reward-item {
    font-size: 18px;
    line-height: 20px;
}

.prize-icon {
    margin: 0;
}

.prize-icon .prize-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Small Prizes (4-6 places) */
.prize-section.small-prize .place-number {
    font-size: 36px;
    line-height: 40px;
}

.prize-section.small-prize .place-text {
    font-size: 18px;
    line-height: 20px;
}

.prize-section.small-prize .prize-reward {
    padding: 4px 7px;
    margin-top: 7px;
}

.prize-section.small-prize .reward-item {
    font-size: 18px;
    line-height: 20px;
}

/* Mini Prizes (7-10 places) */
.prize-section.mini-prize .place-number {
    font-size: 24px;
    line-height: 27px;
}

.prize-section.mini-prize .place-text {
    font-size: 12px;
    line-height: 13px;
}

.prize-section.mini-prize .prize-reward {
    padding: 2px 5px;
    margin-top: 5px;
}

.prize-section.mini-prize .reward-item {
    font-size: 12px;
    line-height: 13px;
}

.prize-section.mini-prize .reward-item i {
    font-size: 10px;
}

/* Micro Prizes (11-100 places) */
.prize-section.micro-prize {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(36, 221, 138, 0.05);
    border: 1px solid rgba(36, 221, 138, 0.2);
    border-radius: 4px;
}

.prize-section.micro-prize .prize-place {
    display: flex;
    align-items: center;
    gap: 4px;
}

.prize-section.micro-prize .place-number {
    font-size: 20px;
    line-height: 22px;
    color: #24DD8A;
}

.prize-section.micro-prize .place-text {
    font-size: 12px;
    line-height: 13px;
    color: #24DD8A;
}

.prize-section.micro-prize .prize-reward {
    display: flex;
    gap: 12px;
    padding: 4px 8px;
    background: rgba(36, 221, 138, 0.1);
    border: 1px solid rgba(36, 221, 138, 0.3);
    border-radius: 4px;
}

.prize-section.micro-prize .reward-item {
    font-size: 14px;
    line-height: 15px;
    color: #24DD8A;
    display: flex;
    align-items: center;
    gap: 4px;
}

.prize-section.micro-prize .reward-item img {
    width: 14px;
    height: 14px;
}

/* Members Tab Content */
.members-table-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    opacity: 0.5;
}

.member-position {
    width: 20px;
    color: #BEECD7;
    font-size: 16px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* Збільшуємо ширину для позицій після 99 місця */
.contest-member-row:nth-child(n+100) .member-position {
    width: 30px;
}

/* Збільшуємо ширину для позицій після 99 місця */
.contest-member-row:nth-child(n+1000) .member-position {
    width: 35px;
}

/* Збільшуємо ширину для позицій після 99 місця */
.contest-member-row:nth-child(n+2000) .member-position {
    width: 40px;
}

.member-name {
    color: #24DD8A;
    font-size: 16px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 18px;
}

.member-line {
    flex: 1;
    height: 0;
    border-top: 1px solid rgba(15, 90, 56, 0);
}

.member-blocks,
.member-friends {
    width: 18px;
    height: 18px;
    color: #24DD8A;
    font-size: 10px;
    text-align: center;
}

.member-taps {
    width: 84px;
    color: #BEECD7;
    font-size: 24px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 26px;
    text-align: right;
}

/* Member Row */
.contest-member-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.contest-member-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(36, 221, 138, 0.3);
    pointer-events: none;
    opacity: 0;
    z-index: 0;
}

.contest-member-row.highlight::before {
    animation: highlightRow 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.contest-member-row > * {
    position: relative;
    z-index: 1;
}

.contest-member-row .member-position {
    color: #BEECD7;
}

.contest-member-row .member-name {
    color: #24DD8A;
}

.contest-member-row .member-line {
    border-top: 1px solid #0F5A38;
}

.contest-member-row .member-blocks,
.contest-member-row .member-friends {
    color: #24DD8A;
    font-size: 16px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 18px;
}

.contest-member-row .member-taps {
    font-size: 24px;
}

/* Active (Current User) Row */
.contest-member-row.active {
    background: rgba(36, 221, 138, 0.1);
}
/* Active (Current User) Row */
.contest-member-row:hover {
    background: rgba(36, 221, 138, 0.02);
}
/* Active (Current User) Row */
.contest-member-row.active:hover {
    background: rgba(36, 221, 138, 0.12);
}

.contest-member-row.active::before {
    background: rgba(36, 221, 138, 0.4);
}

.contest-member-row.active .member-position,
.contest-member-row.active .member-name,
.contest-member-row.active .member-blocks,
.contest-member-row.active .member-friends,
.contest-member-row.active .member-taps {
    color: white;
}

/* Footer */
.contest-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(180deg, #041A10 0%, #092E1C 100%);
    display: flex;
    flex-direction: row;
    gap: 16px;
    z-index: 1000;
}

.contest-footer-info {
    color: #BEECD7;
    font-size: 14px;
    font-family: 'Jura', sans-serif;
    font-weight: 500;
    line-height: 15px;
    max-height: 70px;
    overflow-y: auto;
    padding: 0 5px 5px 0;
}

.contest-footer-info strong {
    color: white;
    font-family: 'Pixel Sans Serif', 'Jura', sans-serif;
    margin-bottom: 8px;
    display: inline-block;
}

/* Стилі для імен користувачів та різниці тапів */
.contest-footer-info .user-name {
    color: white;
}

.contest-footer-info .user-name[data-user-id] {
    display: inline-block;
    cursor: pointer;
    transition: transform var(--ui-motion-fast, 140ms) var(--ui-motion-ease, ease),
                color var(--ui-motion-fast, 140ms) var(--ui-motion-ease, ease),
                filter var(--ui-motion-fast, 140ms) var(--ui-motion-ease, ease),
                opacity var(--ui-motion-fast, 140ms) var(--ui-motion-ease, ease);
}

.contest-footer-info .user-name[data-user-id]:hover {
    opacity: 1;
    color: #86FFC9;
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.contest-footer-info .score-diff {
    color: white;
}

/* Анімація підсвічування рядка */
@keyframes highlightRow {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

.contest-member-row.highlight::before {
    animation: highlightRow 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.contest-member-row > * {
    position: relative;
    z-index: 1;
}

/* Стилі для скролбара в footer-info */
.contest-footer-info::-webkit-scrollbar {
    width: 4px;
}

.contest-footer-info::-webkit-scrollbar-track {
    background: rgba(15, 90, 56, 0.1);
    border-radius: 2px;
}

.contest-footer-info::-webkit-scrollbar-thumb {
    background: rgba(36, 221, 138, 0.3);
    border-radius: 2px;
}

.contest-footer-info::-webkit-scrollbar-thumb:hover {
    background: rgba(36, 221, 138, 0.5);
}

.contest-footer-buttons {
    display: flex;
    width: 100%;
}

.contest-join-button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(36, 221, 138, 0.4);
    box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.1), 0 0 15px rgba(36, 221, 138, 0.2);
    border: 1px solid rgba(36, 221, 138, 0.4);
    cursor: pointer;
    transition: transform var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                background-color var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                border-color var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                box-shadow var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease),
                filter var(--ui-motion-popup, 210ms) var(--ui-motion-ease, ease);
    position: relative;
    overflow: hidden;
    animation: subtlePulse 4s infinite;
}

@keyframes subtlePulse {
    0% {
        box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.1), 0 0 15px rgba(36, 221, 138, 0.2);
    }
    50% {
        box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.2), 0 0 20px rgba(36, 221, 138, 0.4);
    }
    100% {
        box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.1), 0 0 15px rgba(36, 221, 138, 0.2);
    }
}

.join-text {
    color: #86FFC9;
    font-size: 17px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 19px;
    text-shadow: 0 0 5px rgba(134, 255, 201, 0.3);
    position: relative;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    animation: pulseText 3s infinite;
}

/* Анімація пульсації тексту, синхронізована з лініями та стрілкою */
@keyframes pulseText {
    0% { 
        color: #86FFC9;
        text-shadow: 0 0 5px rgba(134, 255, 201, 0.3);
    }
    15% { 
        color: white;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(134, 255, 201, 0.5);
    }
    20% { 
        color: white;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(134, 255, 201, 0.5);
    }
    25% { 
        color: white;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 20px rgba(134, 255, 201, 0.5);
    }
    33% { 
        color: #86FFC9;
        text-shadow: 0 0 5px rgba(134, 255, 201, 0.3);
    }
    100% { 
        color: #86FFC9;
        text-shadow: 0 0 5px rgba(134, 255, 201, 0.3);
    }
}

/* Пришвидшуємо пульсацію тексту при наведенні */
.contest-join-button:hover .join-text {
    animation: pulseTextHover 1.5s infinite;
}

/* Оновлена анімація для тексту при наведенні */
@keyframes pulseTextHover {
    0% { 
        color: #86FFC9;
        text-shadow: 0 0 8px rgba(134, 255, 201, 0.5);
    }
    15% { 
        color: white;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 25px rgba(134, 255, 201, 0.7);
    }
    20% { 
        color: #BFFFDE;
        text-shadow: 0 0 10px rgba(134, 255, 201, 0.6);
    }
    25% { 
        color: white;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 25px rgba(134, 255, 201, 0.7);
    }
    33% { 
        color: #BFFFDE;
        text-shadow: 0 0 10px rgba(134, 255, 201, 0.8), 0 0 20px rgba(134, 255, 201, 0.5);
    }
    100% { 
        color: #86FFC9;
        text-shadow: 0 0 8px rgba(134, 255, 201, 0.5);
    }
}

/* Додаємо стилі для стану участі */
.contest-join-button.participating .join-text {
    color: white;
    animation: none;
    text-shadow: none;
}

/* Додаємо стилі для стану участі */
.contest-join-button.participating::before,
.contest-join-button.participating::after {
    animation: none;
    opacity: 0;
}

.contest-join-button.participating {
    animation: none;
}

.contest-join-button i {
    color: #86FFC9;
    font-size: 14px;
    margin-left: auto;
    animation: pulseArrow 3s infinite;
    transform-origin: center;
}

/* Анімація пульсації стрілки як ритм серця, синхронізована з лініями */
@keyframes pulseArrow {
    0% { 
        transform: scale(1);
        opacity: 0.8;
        color: #86FFC9;
    }
    15% { 
        transform: scale(1.4);
        opacity: 1;
        color: white;
    }
    20% { 
        transform: scale(1.1);
        opacity: 0.9;
        color: #BFFFDE;
    }
    25% { 
        transform: scale(1.2);
        opacity: 1;
        color: white;
    }
    33% { 
        transform: scale(1);
        opacity: 0.8;
        color: #86FFC9;
    }
    100% { 
        transform: scale(1);
        opacity: 0.8;
        color: #86FFC9;
    }
}

/* Додаємо анімацію пульсації стрілки при наведенні */
@keyframes pulseArrowHover {
    0% { 
        transform: scale(1);
        opacity: 0.8;
        color: #86FFC9;
    }
    15% { 
        transform: scale(1.6);
        opacity: 1;
        color: white;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 25px rgba(134, 255, 201, 0.7);
    }
    20% { 
        transform: scale(1.3);
        opacity: 0.9;
        color: #BFFFDE;
    }
    25% { 
        transform: scale(1.4);
        opacity: 1;
        color: white;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.8), 0 0 25px rgba(134, 255, 201, 0.7);
    }
    33% { 
        transform: scale(1);
        opacity: 0.8;
        color: #BFFFDE;
    }
    100% { 
        transform: scale(1);
        opacity: 0.8;
        color: #86FFC9;
    }
}

.contest-join-button.participating i {
    color: white;
    animation: none;
}

/* Додаємо ефект ліній, що пробігають по кнопці з акцентом під час удару */
@keyframes slidingLine {
    0% {
        left: -100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
    15% {
        height: 3px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    }
    25% {
        height: 3px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    }
    33% {
        left: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
    100% {
        left: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
}

@keyframes slidingLineReverse {
    0% {
        right: -100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
    15% {
        height: 3px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    }
    25% {
        height: 3px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    }
    33% {
        right: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
    100% {
        right: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    }
}

.contest-join-button:hover::before {
    animation: slidingLine 1.5s infinite;
}

.contest-join-button:hover::after {
    animation: slidingLineReverse 1.5s infinite, glowButton 2s ease-in-out infinite;
}

.contest-join-button:hover {
    transform: translateY(-2px);
    background: rgba(36, 221, 138, 0.5);
    border-color: rgba(83, 239, 171, 0.82);
    box-shadow: 0px 14px 44px rgba(36, 221, 138, 0.3), 0 0 25px rgba(36, 221, 138, 0.5);
    filter: brightness(1.1);
}

@keyframes glowButton {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Contest Button Styles */
.contest-button {
    position: fixed;
    top: calc(58px + var(--tg-top-inset));
    left: 16px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background:var(--grad-balance);
    border: 1px solid rgba(36, 221, 138, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 0;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contest-button:hover {
    background: rgba(36, 221, 138, 0.2);
}

.contest-icon {
    color: #24DD8A;
    font-size: 12px;
}

.contest-label {
    color: #24DD8A;
    font-size: 12px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 19px;
}

/* Referral Star Button Styles */
.referral-star-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--grad-balance);
    border: 1px solid rgba(255, 193, 7, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 0px;
    height: 35px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.referral-star-button:hover {
    background: rgba(255, 193, 7, 0.2);
}

.referral-star-icon {
    color: #FFC107;
    font-size: 16px;
}

.referral-star-label {
    color: #FFC107;
    font-size: 17px;
    font-family: 'Jura', sans-serif;
    font-weight: 700;
    line-height: 19px;
}

.contest-popup { isolation: isolate; z-index: 10000; pointer-events: auto; touch-action: none; overscroll-behavior: none; }

.members-list-container {
    padding-bottom: 51px;
}

.prize-info .line {
    margin: 50px 16px 0 16px;
}

/* Terms Section */
.contest-terms-section {
    padding: 20px 24px 32px 24px;
}

.terms-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: rgba(190, 236, 215, 0.5);
    font-size: 10px;
    font-family: 'Jura', sans-serif;
    font-weight: 500;
    line-height: 13px;
}

.terms-icon {
    color: currentColor;
    margin-top: 2px;
    flex-shrink: 0;
}

.terms-text span {
    flex: 1;
}

/* Спеціальні стилі для місць 11-100 та 101-1000 */
.prize-section.second-place[data-range="11-100"] .place-number,
.prize-section.third-place[data-range="101-1000"] .place-number {
    font-size: 18px;
    line-height: 18px;
}

.prize-section.second-place[data-range="11-100"] .place-text,
.prize-section.third-place[data-range="101-1000"] .place-text {
    font-size: 12px;
    line-height: 13px;
}

.prize-section.second-place[data-range="11-100"],
.prize-section.third-place[data-range="101-1000"]{
    flex-direction: row;
    align-items: center;
}

/* Пришвидшуємо пульсацію стрілки при наведенні */
.contest-join-button:hover i {
    animation: pulseArrowHover 1.5s infinite;
}

/* Посилюємо анімацію кнопки */
.contest-join-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    animation: slidingLine 3s infinite;
    pointer-events: none;
}

/* Додаємо ефект лінії, що пробігає по нижній частині кнопки у зворотному напрямку */
.contest-join-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(134, 255, 201, 0.8), transparent);
    animation: slidingLineReverse 3s infinite;
    pointer-events: none;
    /* Додаємо також сяйво */
    box-shadow: 0 0 15px rgba(134, 255, 201, 0.4);
}
