/* ==================== GIVEAWAYS ==================== */

#screenGiveaways {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 80px 16px 100px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #08090d;
    min-height: 100vh;
    min-height: 100dvh;
}

#screenGiveaways.active { display: flex !important; }

.giveaways-content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.giveaways-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Табы */
.giveaways-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    width: 100%;
}

.giveaways-tab {
    flex: 1;
    padding: 10px 4px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 11px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #6b7daa;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
}

.giveaways-tab.active {
    background: linear-gradient(135deg, #f0883e, #f5c842);
    color: #0a0f1a;
    box-shadow: 0 0 12px rgba(245, 200, 66, 0.3);
}

/* Карточка розыгрыша */
.giveaway-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Иконка подарка с левитацией */
.giveaway-gift-icon-wrapper {
    width: 80px;
    height: 80px;
    animation: giveaway-float 3s ease-in-out infinite;
    z-index: 2;
}

.giveaway-gift-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

@keyframes giveaway-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.giveaway-gift-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

/* Таймер */
.giveaway-timer {
    text-align: center;
    padding: 8px 0;
}

.giveaway-timer-digits {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.giveaway-timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.giveaway-timer-value {
    color: #ffd700;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.giveaway-timer-label {
    color: #6b7daa;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Список участников */
.giveaway-participants-title {
    color: #6b7daa;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}

.giveaway-participants-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.giveaway-placeholder {
    color: #5a6070;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Строка участника */
.giveaway-participant-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.giveaway-participant-rank {
    color: #6b7daa;
    font-size: 14px;
    font-weight: 700;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.giveaway-participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.giveaway-participant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.giveaway-participant-name {
    flex: 1;
    color: #d0daf0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.giveaway-participant-tickets {
    color: #ffd700;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Кнопка УЧАСТВУЮ */
.giveaway-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.giveaway-join-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f0883e, #f5c842, #ffd700);
    color: #0a0f1a;
    border: 1px solid #f5c84260;
    box-shadow: 0 0 20px rgba(240, 136, 62, 0.3);
    transition: all 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.giveaway-join-btn:active { transform: scale(0.98); }

.giveaway-registered-text {
    color: #6b7daa;
    font-size: 12px;
    text-align: center;
}

/* Нет активных розыгрышей */
.giveaway-no-active {
    padding: 40px 20px;
}

.giveaway-no-active-text {
    color: #6b7daa;
    font-size: 14px;
    text-align: center;
}

/* Модалка покупки билетов */
.giveaway-buy-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 210;
    display: none;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.giveaway-buy-overlay.show {
    display: flex;
    opacity: 1;
}

.giveaway-buy-card {
    width: 100%;
    max-width: 450px;
    background: rgba(10, 12, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: none;
    padding: 28px 24px 36px 24px;
    text-align: center;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    will-change: transform;
}

.giveaway-buy-overlay.show .giveaway-buy-card {
    transform: translateY(0);
}

.giveaway-buy-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

.giveaway-buy-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 4px;
    color: #ffffff;
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.giveaway-buy-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.giveaway-buy-hint {
    color: #6b7daa;
    font-size: 13px;
    margin-top: -8px;
}

.giveaway-buy-confirm {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f0883e, #f5c842, #ffd700);
    color: #0a0f1a;
    border: 1px solid #f5c84260;
    box-shadow: 0 0 25px rgba(240, 136, 62, 0.4);
    transition: all 0.25s;
}

.giveaway-buy-confirm:active {
    transform: scale(0.98);
}

/* Текст успеха в модалке */
.giveaway-buy-success {
    color: #5ff57a;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 20px 0;
    text-shadow: 0 0 10px rgba(95, 245, 122, 0.4);
}

/* Иконка билета в строке участника */
.giveaway-ticket-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 2px;
    filter: brightness(1.2);
}

/* Цвет количества билетов — белый */
.giveaway-participant-tickets {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Лоадер для карточки розыгрыша */
.giveaway-loader {
    width: 40px;
    height: 40px;
    margin: 40px auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FEB021;
    border-radius: 50%;
    animation: giveaway-spin 0.8s linear infinite;
}

@keyframes giveaway-spin {
    to { transform: rotate(360deg); }
}

/* Анимированная галочка */
.giveaway-success-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}

.giveaway-check-svg {
    width: 80px;
    height: 80px;
}

.giveaway-buy-success-text {
    color: #11AC11;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 10px rgba(17, 172, 17, 0.3);
}

/* ==================== КАРТОЧКА РОЗЫГРЫША С РАМКОЙ ==================== */

.giveaway-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 3px;
    position: relative;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Основная рамка */
.giveaway-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(
        150deg,
        rgba(240, 136, 62, 0.6) 0%,
        rgba(245, 200, 66, 0.3) 25%,
        rgba(240, 136, 62, 0.1) 50%,
        rgba(245, 200, 66, 0.3) 75%,
        rgba(240, 136, 62, 0.6) 100%
    );
    background-size: 200% 200%;
    animation: giveaway-border-shift 4s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask-composite: xor;
    z-index: 0;
    pointer-events: none;
}

/* Свечение по углам — слой 1 */
.giveaway-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    border: 2px solid rgba(240, 136, 62, 0.5);
    filter: blur(3px);
    z-index: -1;
    pointer-events: none;
}

/* Дополнительный слой свечения — только по углам */
.giveaway-glow-corners {
    position: absolute;
    inset: -4px;
    border-radius: 16px;
    pointer-events: none;
    z-index: -2;
    background: 
        radial-gradient(ellipse at 0% 0%, rgba(240, 136, 62, 0.6) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 0%, rgba(240, 136, 62, 0.6) 0%, transparent 40%),
        radial-gradient(ellipse at 0% 100%, rgba(240, 136, 62, 0.6) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 100%, rgba(240, 136, 62, 0.6) 0%, transparent 40%);
    filter: blur(8px);
}

@keyframes giveaway-border-shift {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Контент поверх рамки */
.giveaway-card > * {
    position: relative;
    z-index: 1;
}

/* Внутренний фон */
.giveaway-card-inner {
    width: 100%;
    background: rgba(10, 12, 18, 0.95);
    border-radius: 14px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}