/* Общие стили */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg,
            #8ecae6 0%,
            #7cb8d4 25%,
            #6aa6c2 50%,
            #7cb8d4 75%,
            #8ecae6 100%);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: var(--tg-theme-text-color, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Анимация градиента фона */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 320px;
    width: 320px;
    margin: 20px auto 40px;
    padding: 5px;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 24px rgba(18, 103, 130, 0.2);
    margin: 0;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.gift-animation {
    margin-top: -40px;
    /* Поднимаем анимацию выше */
    margin-bottom: -40px;
    /* Уменьшаем отступ до сообщения */
    transform: scale(0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.gift-animation:hover {
    transform: scale(0.65);
}

.gift-animation.animate {
    animation: giftBounce 0.5s ease;
}

@keyframes giftBounce {
    0% {
        transform: scale(0.6) translateY(0);
    }

    50% {
        transform: scale(0.7) translateY(-10px);
    }

    100% {
        transform: scale(0.6) translateY(0);
    }
}

.loading-container {
    color: #000000;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: -10px;
}

.step-text {
    font-size: 16px;
    color: #000000;
}

.message {
    margin: 0;
    /* Убираем стандартные отступы */
    padding: 12px;
    border-radius: 12px;
    text-align: left;
    font-size: 18px;
    line-height: 1.4;
    white-space: pre-line;
    background: rgba(18, 103, 130, 0.4);
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.error {
    background: rgba(51, 144, 236, 0.1);
    color: #3390ec;
    border-left: 4px solid #3390ec;
}

.error b {
    color: #000000;
    font-weight: 600;
}

.success {
    background: rgba(0, 255, 0, 0.1);
    color: #0a0;
    border-left: 4px solid #0a0;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.done {
    opacity: 1;
}

.step-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #0a69da;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.step.done .step-icon {
    background: #0a69da;
    border-color: #0a69da;
}

.step.done .step-icon:after {
    content: '✓';
    color: white;
    font-size: 14px;
}

.step.active .step-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 105, 218, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(10, 105, 218, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(10, 105, 218, 0);
    }
}

.confetti {
    position: fixed;
    top: -20px;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
    border-radius: 0;
    opacity: 0;
}

@keyframes confetti-fall {
    0% {
        top: -20px;
        opacity: 1;
    }

    100% {
        top: 100vh;
        opacity: 1;
    }
}

@keyframes sway-1 {
    0% {
        margin-left: 0;
    }

    25% {
        margin-left: 30px;
    }

    50% {
        margin-left: -15px;
    }

    75% {
        margin-left: 20px;
    }

    100% {
        margin-left: 0;
    }
}

@keyframes sway-2 {
    0% {
        margin-left: 0;
    }

    25% {
        margin-left: -25px;
    }

    50% {
        margin-left: 35px;
    }

    75% {
        margin-left: -20px;
    }

    100% {
        margin-left: 0;
    }
}

@keyframes sway-3 {
    0% {
        margin-left: 0;
    }

    25% {
        margin-left: 20px;
    }

    50% {
        margin-left: -30px;
    }

    75% {
        margin-left: 25px;
    }

    100% {
        margin-left: 0;
    }
}

@keyframes rotate-1 {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-2 {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes confetti-sway-left {
    0% {
        margin-left: 0;
        transform: rotate(0deg);
    }

    33% {
        margin-left: -50px;
        transform: rotate(-180deg);
    }

    66% {
        margin-left: 25px;
        transform: rotate(-90deg);
    }

    100% {
        margin-left: 0;
        transform: rotate(-360deg);
    }
}

@keyframes confetti-sway-right {
    0% {
        margin-left: 0;
        transform: rotate(0deg);
    }

    33% {
        margin-left: 50px;
        transform: rotate(180deg);
    }

    66% {
        margin-left: -25px;
        transform: rotate(90deg);
    }

    100% {
        margin-left: 0;
        transform: rotate(360deg);
    }
}

.bot-invite {
    margin-top: 16px;
    padding: 16px;
    background: rgba(51, 144, 236, 0.1);
    border-radius: 12px;
    border-left: 4px solid #3390ec;
    font-size: 16px;
    text-align: center;
}

.start-bot-button {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 24px;
    background: #3390ec;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.start-bot-button:hover {
    background: #2980d9;
}

.close-button {
    margin-top: 20px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    background: #3390ec;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: none;
    animation: button-appear 0.3s ease forwards;
    flex-shrink: 0;
}

.close-button:hover {
    background: #2980d9;
}

.close-button.visible {
    display: block;
}

.bot-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    margin: 0;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    background: rgba(51, 144, 236, 0.1);
    border-radius: 12px;
    box-sizing: border-box;
    z-index: 100;
}

.bot-info a {
    color: white;
    text-decoration: none;
}

.bot-info a:hover {
    text-decoration: underline;
}

/* Стили для создания розыгрыша */
#createGiveawayContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.giveaway-create-container {
    max-width: 320px;
    width: 320px;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(18, 103, 130, 0.2);
}

.giveaway-step {
    display: none;
}

.giveaway-step.active {
    display: block;
}

.giveaway-step h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.giveaway-form-group {
    margin-bottom: 20px;
}

.giveaway-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.giveaway-form-group input,
.giveaway-form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.giveaway-form-group input:focus,
.giveaway-form-group select:focus {
    border-color: #3390ec;
    outline: none;
}

.giveaway-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-size: 16px;
    box-sizing: border-box;
}

.giveaway-form-group textarea:focus {
    border-color: #3390ec;
    outline: none;
}

.giveaway-type-description {
    white-space: pre-line;
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    line-height: 1.6;
    color: #2c3e50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.giveaway-type-description b {
    display: block;
    margin-bottom: 12px;
    color: #2980b9;
    font-size: 16px;
    font-weight: 600;
}

.giveaway-type-description ul {
    margin: 0;
    padding-left: 0;
    list-style-type: none;
}

.giveaway-type-description li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
}

.giveaway-type-description li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
}

.giveaway-type-description:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.giveaway-channel-list {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--tg-theme-hint-color);
    border-radius: 8px;
    padding: 10px;
}

.channel-item {
    margin-bottom: 10px;
}

.channel-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-checkbox {
    margin: 0;
}

.channel-name {
    font-size: 14px;
    color: #000000;
}

.giveaway-channel-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.giveaway-channel-item:last-child {
    border-bottom: none;
}

.channel-label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.channel-checkbox {
    margin: 0;
    cursor: pointer;
}

.channel-name {
    font-size: 14px;
    color: #000000;
}

.giveaway-channel-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.channel-item {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.channel-item:hover {
    background-color: #d8d7d7;
}

.channel-label {
    display: block;
    cursor: pointer;
    color: var(--tg-theme-text-color);
}

.checkbox-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    width: 100%;
}

.channel-checkbox {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.channel-name {
    flex-grow: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Общие стили для всех чекбоксов */
input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Стили для лейблов с чекбоксами */
label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    width: 100%;
}

.giveaway-channel-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.giveaway-channel-item:last-child {
    border-bottom: none;
}

.giveaway-channel-item input[type="checkbox"] {
    margin-right: 10px;
}

.giveaway-navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.giveaway-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    background-color: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.giveaway-button:hover {
    opacity: 0.9;
}

.giveaway-button-add {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: none;
    border: 1px dashed #2481cc;
    border-radius: 8px;
    color: #2481cc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.giveaway-button-add:hover {
    background-color: rgba(36, 129, 204, 0.1);
    transform: translateY(-2px);
}

.giveaway-button-add:active {
    transform: translateY(1px);
    background-color: rgba(36, 129, 204, 0.2);
}

/* Стиль для кода кнопки розыгрыша */
.giveaway-button-code {
    display: inline-block;
    font-size: 14px;
    font-family: monospace;
    padding: 4px 8px;
    margin: 4px 0;
    border: 2px dashed #3390ec;
    border-radius: 6px;
    background-color: rgba(51, 144, 236, 0.1);
    color: #3390ec;
    word-break: break-all;
    cursor: pointer;
    transition: all 0.2s ease;
}

.giveaway-button-code:hover {
    background-color: rgba(51, 144, 236, 0.2);
}

.button-code code,
.reactions-code code {
    font-size: 0.85em;
    font-family: monospace;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.2s;
}

.button-code code:hover,
.reactions-code code:hover {
    background: #e9e9e9;
}

.button-code code:active,
.reactions-code code:active {
    background: #dadada;
}

.button-code.copied code,
.reactions-code.copied code {
    background: #e8f5e9;
}

/* Стили для мобильных устройств */
@media (max-width: 480px) {
    .giveaway-create-container {
        width: calc(100% - 20px);
        max-width: none;
        margin: 10px;
        padding: 15px;
    }

    .giveaway-step {
        padding: 0;
    }

    .giveaway-step h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .giveaway-form-group {
        margin-bottom: 15px;
    }

    .giveaway-form-group label {
        font-size: 14px;
    }

    .giveaway-form-group input,
    .giveaway-form-group select {
        padding: 10px;
        font-size: 14px;
    }

    .giveaway-type-description {
        font-size: 12px;
        padding: 10px;
    }

    .giveaway-channel-list {
        max-height: 180px;
    }

    .giveaway-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .giveaway-button-add {
        padding: 8px;
        font-size: 14px;
    }
}

/* Индикатор загрузки */
#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--tg-theme-button-color, #50a8eb);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Стили для контейнеров подтверждения и результата */
.giveaway-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

.giveaway-card {
    background-color: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.giveaway-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
}

.giveaway-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.info-label {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
    margin: 0;
    padding: 0;
    margin-bottom: 1px;
}

.info-value {
    text-align: left;
    font-weight: 500;
    margin: 0;
    padding: 0;
    width: 100%;
}

.winners-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.winner-item {
    display: block;
    white-space: nowrap;
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.02);
    padding: 4px 8px;
    border-radius: 4px;
}

.winner-link {
    color: var(--tg-theme-link-color, #2481cc);
    text-decoration: none;
    margin-left: 4px;
}

.winner-link:hover {
    text-decoration: underline;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    gap: 8px;
    padding: 2px 0;
}

.info-label {
    color: var(--tg-theme-hint-color, #999999);
    font-size: 14px;
}

.info-value {
    flex: 1;
    text-align: left;
    font-weight: 500;
    margin: 0;
    padding: 0;
}

.winners-value {
    white-space: pre-line;
}

.winners-value a {
    display: inline;
}

.winner-link {
    color: var(--tg-theme-link-color, #2481cc);
    text-decoration: none;
    display: inline;
}

.winner-link:hover {
    text-decoration: underline;
}

.giveaway-create-card {
    background-color: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 24px rgba(18, 103, 130, 0.2);
}

/* Стили для текста подтверждения и результата */
.confirmation-message,
.result-message {
    color: #000000;
    font-size: 16px;
    padding-left: 10px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.confirmation-message {
    white-space: pre-line;
    line-height: 1.5;
    padding: 15px;
    font-size: 15px;
    color: #000000;
}

.confirmation-message b {
    font-weight: 600;
}

.confirmation-message i {
    font-style: italic;
}

.confirmation-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 10px;
    text-align: center;
}

.giveaway-details {
    margin-top: 10px;
}

.confirmation-title,
.result-title {
    color: #000000;
    font-size: 18px;
    margin-bottom: 10px;
}

.giveaway-navigation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

.giveaway-button {
    padding: 12px 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--tg-theme-button-color, #3390EC);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.giveaway-button:hover {
    opacity: 0.9;
}

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

.giveaway-button-primary {
    background-color: var(--tg-theme-button-color, #3390EC);
    color: var(--tg-theme-button-text-color, #ffffff);
}

/* Стили для индикатора загрузки */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--tg-theme-button-color, #3390EC);
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Адаптивные стили */
@media (max-width: 480px) {
    .giveaway-card {
        padding: 12px;
        margin: 10px;
    }

    .confirmation-title,
    .result-title {
        font-size: 18px;
    }

    .confirmation-message,
    .result-message {
        font-size: 14px;
    }

    .giveaway-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Стили для страницы списка розыгрышей */
.giveaway-list-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
    padding-bottom: 80px;
}

.giveaway-list-wrapper {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.giveaway-list-card {
    all: initial;
    /* Сбрасываем все унаследованные стили */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: block;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.giveaway-list-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.giveaway-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.giveaway-list-title {
    all: initial;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: block;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #000000 !important;
    flex: 1;
    margin-right: 8px;
}

.giveaway-list-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.giveaway-list-status.status-active {
    background-color: rgba(36, 129, 204, 0.1);
    color: #2481cc !important;
}

.giveaway-list-status.status-ended {
    background-color: rgba(102, 102, 102, 0.1);
    color: #666666 !important;
}

.giveaway-list-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.giveaway-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.giveaway-list-label {
    all: initial;
    /* Сбрасываем все унаследованные стили */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: block;
    font-size: 13px;
    color: #666666 !important;
}

.giveaway-list-value {
    all: initial;
    /* Сбрасываем все унаследованные стили */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: block;
    font-size: 14px;
    color: #000000 !important;
    font-weight: 500;
}

.giveaway-list-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.giveaway-list-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.giveaway-list-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #000000 !important;
}

.giveaway-list-stat-value.status-active {
    color: #2481cc !important;
}

.giveaway-list-stat-value.status-ended {
    color: #666666 !important;
}

.giveaway-list-stat-label {
    font-size: 11px;
    color: #666666;
    margin-top: 2px;
}

/* Сообщение об отсутствии розыгрышей */
.giveaway-list-empty {
    all: initial;
    /* Сбрасываем все унаследованные стили */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: block;
    text-align: center;
    padding: 24px;
    color: #666666 !important;
    font-size: 15px;
    width: 100%;
}

/* Кнопка создания розыгрыша */
.create-button {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 600px;
    padding: 12px;
    background: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    z-index: 100;
}

.create-button:hover {
    opacity: 0.9;
}

.create-button:active {
    opacity: 0.8;
}

/* Специфичные секции для разных типов розыгрышей */
.button-section,
.activity-section,
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.giveaway-type-section {
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #f0f2f5;
    border-radius: 8px;
}

.giveaway-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.stat-item {
    flex: 1;
    background: #f0f2f5;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 13px;
    color: #666666;
    margin-bottom: 4px;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: #000000;
}

.giveaway-details-section {
    margin-bottom: 12px;
    width: 100%;
}

.code-section {
    margin-top: 12px;
}

.code-block {
    background: #f0f2f5;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: monospace;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 8px 0;
    color: #000000;
}

.giveaway-type-specific-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Победители */
.winners-section {
    margin-top: 12px;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-winners-message {
    color: #666666;
    font-style: italic;
    text-align: center;
    padding: 8px;
    background: #ffffff;
    border-radius: 6px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.reaction-block,
.post-link,
.button-info {
    margin-bottom: 12px;
    padding: 12px;
    background: #f0f2f5;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.winner-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #f0f2f5;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.winner-number {
    font-size: 13px;
    font-weight: 500;
    color: #2481cc;
    margin-right: 12px;
    min-width: 12px;
    text-align: center;
    padding: 4px;
    background: rgba(36, 129, 204, 0.1);
    border-radius: 4px;
}

.winner-name {
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    flex-grow: 1;
}

.giveaway-details-back {
    display: block;
    width: 100%;
    padding: 12px;
    background: #2481cc;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(36, 129, 204, 0.2);
}

.giveaway-details-back:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(36, 129, 204, 0.3);
}

.giveaway-details-back:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(36, 129, 204, 0.2);
}

/* Анимация для карточек розыгрышей */
@keyframes slideIn {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.giveaway-list-card {
    /* Добавляем только стили анимации */
    opacity: 0;
    transform: translateX(-100%);
    animation: slideIn 0.5s ease forwards;
    animation-play-state: paused;
}

.giveaway-list-card.start-animation {
    animation-play-state: running;
}

/* Стили для деталей розыгрыша */
#giveawayDetailsContainer {
    padding: 12px;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.giveaway-details-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    margin: 12px auto;
    font-size: 14px;
    color: #000;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-weight: 500;
    margin-right: 8px;
    white-space: nowrap;
    font-size: 14px;
}

.detail-value {
    flex: 1;
    text-align: left;
    /* Было right, заменяем на left */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000;
    font-size: 14px;
    font-weight: 500;
}

.detail-section-title {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    text-align: left;
}

.no-winners {
    font-style: italic;
    color: #666;
    text-align: right;
}

.detail-row a {
    color: #2481cc;
    text-decoration: none;
    margin-left: 4px;
}

.detail-row a:hover {
    text-decoration: underline;
}

.detail-block {
    background: #f0f2f5;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #000;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item a {
    color: #2481cc;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 200px;
    /* при необходимости ограничить ширину */
}

.detail-item a:hover {
    text-decoration: underline;
}

.giveaway-details-title {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 12px 0;
    padding: 0;
    word-wrap: break-word;
    width: 100%;
    text-align: center;
}

/* Общая стилизация информации */
.giveaway-details-info {
    background: #f0f2f5;
    border-radius: 8px;
    padding: 8px;
    /* меньше отступов */
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Полноширинные элементы */
.info-full-width {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
}

/* Компактные элементы в ряд */
.info-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Каждый info-item будет выглядеть как строка со значением */
.info-item {
    background: #ffffff;
    border-radius: 6px;
    padding: 8px;
    /* меньше отступов */
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    /* легкая рамка для разделения */
}

.info-label {
    color: #666666;
    font-size: 13px;
    margin: 0;
    padding: 0;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 8px;
}

.info-value {
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    flex-shrink: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.giveaway-details-section {
    margin-top: 12px;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.giveaway-details-section h3 {
    font-size: 14px;
    color: #000000;
    margin: 0 0 4px 0;
    padding-left: 4px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

/* Список каналов */
.channels-list,
.winners-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* меньше расстояние между элементами */
    width: 100%;
}

.channels-list li,
.winners-list li {
    padding: 6px 8px;
    background: #ffffff;
    border-radius: 6px;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Для победителей нам нужно разместить номер, имя и юзернейм в одну строку */
}

.channels-list a,
.winners-list a {
    color: #2481cc;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Оформление элемента победителя: "N. Имя @username" */
.winners-list li {
    justify-content: flex-start;
    gap: 8px;
}

.winners-list li::before {
    content: attr(data-index) ".";
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}

.winners-list li a {
    color: #2481cc;
    text-decoration: none;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.winners-list li a:hover {
    text-decoration: underline;
}

/* Кнопка назад */
.back-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 16px;
    background: #2481cc;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.back-button:hover {
    opacity: 0.9;
}

.back-button:active {
    transform: translateY(1px);
}

.info-value {
    flex: 1;
    text-align: left;
    font-weight: 500;
    white-space: pre-line;
    margin-top: 0;
    line-height: 1.5;
}

.winners-list .info-value {
    margin-top: 0;
    padding-top: 0;
}

.winners-list {
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 8px;
}

.winners-list .info-label {
    padding-left: 4px;
}

.winners-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 4px;
    width: calc(100% - 8px);
    /* Учитываем отступы */
}

.winner-item {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.02);
    padding: 6px 8px;
    border-radius: 6px;
    width: calc(100% - 16px);
    /* Учитываем padding */
    box-sizing: border-box;
}

.winner-link {
    color: var(--tg-theme-link-color, #2481cc);
    text-decoration: none;
    margin-left: 4px;
}

.winner-link:hover {
    text-decoration: underline;
}

.info-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.winners-list {
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    margin: 0 12px 8px 12px;
    width: calc(100% - 24px);
    box-sizing: border-box;
}

.winners-list .info-label {
    padding-left: 4px;
}

.winners-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 4px;
    width: calc(100% - 8px);
}

.winner-item {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.02);
    padding: 6px 8px;
    border-radius: 6px;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.winner-link {
    color: var(--tg-theme-link-color, #2481cc);
    text-decoration: none;
    margin-left: 4px;
}

.winner-link:hover {
    text-decoration: underline;
}

/* Стили для календарей */
.datepicker-group {
    margin: 16px 20px;
}

.datepicker-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.datepicker-input {
    width: calc(100% - 24px);
    /* Учитываем padding */
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    color: #000;
    /* Устанавливаем черный цвет текста */
}

.datepicker-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
}

/* Кастомизация Air Datepicker */
.air-datepicker {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #000;
    /* Устанавливаем черный цвет текста */
}

.air-datepicker-nav {
    border-bottom: 1px solid #e0e0e0;
    padding: 8px;
    color: #000;
    /* Устанавливаем черный цвет текста */
}

.air-datepicker-nav--title {
    font-weight: 500;
    color: #000;
    /* Устанавливаем черный цвет текста */
}

.air-datepicker-body--day-name {
    color: #2196F3 !important;
    font-weight: bold;
}

.air-datepicker-cell {
    color: #000;
    /* Устанавливаем черный цвет текста для всех ячеек */
}

.air-datepicker-cell.-current- {
    color: var(--tg-theme-button-color);
}

.air-datepicker-cell.-selected- {
    background: var(--tg-theme-button-color);
    color: #fff;
    /* Белый цвет только для выбранной даты */
}

.air-datepicker-cell:hover {
    background: rgba(36, 129, 204, 0.1);
}

/* Стили для контейнера графиков */
#chartsContainer {
    padding: 0 20px;
}

#chartsContainer h3 {
    margin: 20px 0;
    padding: 0 20px;
}

#dailyChart,
#hourlyChart {
    margin: 20px 0;
    max-width: 100%;
}

/* Стили для календаря */
.air-datepicker-cell {
    color: var(--tg-theme-text-color) !important;
    font-weight: normal;
}

.air-datepicker-cell.-disabled- {
    color: var(--tg-theme-hint-color) !important;
    font-weight: 300;
}

.air-datepicker-cell.-current- {
    color: var(--tg-theme-button-color) !important;
    font-weight: bold;
}

.air-datepicker-cell.-selected- {
    background: var(--tg-theme-button-color) !important;
    color: #fff !important;
    font-weight: bold;
}

/* Стили для времени */
.air-datepicker-time-row input {
    color: var(--tg-theme-text-color) !important;
}

/* Обновляем стили календаря, делая активные даты с синим фоном */
.air-datepicker-cell {
    background-color: #e6f0ff !important;
    /* Светло-синий фон для всех дат */
    color: #2196F3 !important;
    /* Синий цвет текста */
    font-weight: normal;
    border-radius: 4px;
}

.air-datepicker-cell.-disabled- {
    background-color: transparent !important;
    /* Убираем фон для неактивных дат */
    color: var(--tg-theme-hint-color) !important;
    /* Серый цвет для неактивных дат */
    font-weight: 300;
}

.air-datepicker-cell.-current- {
    border: 2px solid #2196F3 !important;
    /* Обводка для текущей даты */
    font-weight: bold;
}

.air-datepicker-cell.-selected- {
    background-color: #2196F3 !important;
    /* Темно-синий фон для выбранной даты */
    color: #fff !important;
    font-weight: bold;
}

/* Стили для дней недели */
.air-datepicker-body--day-name {
    color: #2196F3 !important;
    font-weight: bold;
}

/* Стили для приветственной карточки */
.welcome-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin: 0 auto;
    width: calc(100% - 12px);
    max-width: 500px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}

.welcome-icon {
    margin: 0 auto;
    max-width: 200px;
    width: 100%;
}

.welcome-icon dotlottie-player {
    width: 100% !important;
    max-width: 200px;
    margin: 0 auto;
}

.welcome-card h2 {
    color: #000000;
    font-size: 24px;
    margin: 16px 0;
    word-wrap: break-word;
}

.welcome-description {
    color: #000000;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 0 10px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.feature-text {
    color: #000000;
    font-size: 14px;
    text-align: left;
    flex-grow: 1;
    min-width: 0;
    word-wrap: break-word;
}

.create-prompt {
    color: #666666;
    font-size: 14px;
    margin-bottom: 0;
    padding: 0 10px;
}