/* Основные стили - оптимизированы для одного экрана */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #2d3e52 0%, #34495e 50%, #2c3e50 100%);
    min-height: 100vh;
    color: #333;
}

#app {
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 50px 20px;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Основной контент - компактный */
.content {
    background: transparent;
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Информация о розыгрыше - супер компактная */
.giveaway-info {
    margin-bottom: 10px;
}

.giveaway-info h1 {
    color: white;
    font-size: 16px;
    margin-bottom: 6px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.giveaway-info #giveaway-text {
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 8px;
    color: white;
    max-height: 50px;
    overflow: hidden;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.giveaway-media {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    margin: 15px auto;
    display: block;
}

/* Стили для гифки розыгрыша - компактные */
.giveaway-gif-container {
    text-align: center;
    margin: 8px 0;
}

.giveaway-gif {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.giveaway-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 6px;
    margin-top: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 11px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #666;
}

/* Проверка подписки - компактная */
.subscription-check {
    margin-bottom: 15px;
}

.subscription-check h2 {
    color: white;
    font-size: 16px;
    margin-bottom: 8px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subscription-check p {
    color: white;
    margin-bottom: 10px;
    text-align: center;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.channels-list {
    margin-bottom: 10px;
    max-height: 120px;
    overflow-y: auto;
}

.channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 12px;
}

.channel-item.subscribed {
    background: #d4edda;
    border-color: #c3e6cb;
}

.channel-item.not-subscribed {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.channel-info {
    flex: 1;
}

.channel-name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.channel-status {
    font-size: 14px;
    color: #666;
}

/* Капча - супер компактная */
.captcha-section {
    margin-bottom: 10px;
    text-align: center;
}

.captcha-section h2 {
    color: white;
    font-size: 14px;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.captcha-question {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 6px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Кнопки - супер компактные */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: 100%;
    margin-bottom: 4px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
}

.btn-share {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    margin-bottom: 8px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    margin: 0;
}

/* Поля ввода - супер компактные */
.input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    font-size: 13px;
    margin-bottom: 6px;
    transition: border-color 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Участие */
.participation-section {
    margin-bottom: 10px;
}

/* Результат */
.result-section {
    text-align: center;
}

.result-message {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Ошибка */
.error {
    text-align: center;
    margin-bottom: 10px;
}

.error h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

.error p {
    color: #666;
    margin-bottom: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    animation: fadeIn 0.5s ease-out;
}

/* Адаптивность */
@media (max-width: 480px) {
    #app {
        padding: 10px;
    }
    
    .content {
        padding: 15px;
    }
    
    .giveaway-info h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Темная тема для Telegram */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3e52 0%, #34495e 50%, #2c3e50 100%);
    }
    
    .content {
        background: #2c3e50;
        color: white;
    }
    
    .giveaway-info h1 {
        color: white;
    }
    
    .giveaway-info #giveaway-text {
        color: #ecf0f1;
        text-align: center;
    }
    
    .giveaway-details {
        background: #34495e;
    }
    
    .label {
        color: #bdc3c7;
    }
    
    .input {
        background: #34495e;
        border-color: #4a5568;
        color: white;
    }
    
    .input:focus {
        border-color: #667eea;
    }
}

/* Стили для шторки буста */
.boost-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
}

.boost-overlay {
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3);
    max-height: 28vh;
    overflow-y: auto;
}

.boost-content {
    text-align: center;
    color: white;
}

.boost-content h2 {
    font-size: 1rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.boost-content p {
    font-size: 0.8rem;
    margin-bottom: 8px;
    opacity: 0.9;
    line-height: 1.2;
}

.btn-boost {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    border: none;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 7px 14px;
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1px;
}

.btn-boost:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn-boost:active {
    transform: translateY(0);
}

/* Стили для отображения количества бустов */
.boosts-count {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 5px 10px;
    margin: 5px 0 8px 0;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.boosts-count span {
    font-weight: bold;
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.boosts-count.hidden {
    display: none;
}

.boosts-count.visible {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность для шторки буста */
@media (max-width: 480px) {
    .boost-overlay {
        padding: 15px;
        border-radius: 15px 15px 0 0;
    }
    
    .boost-content h2 {
        font-size: 1.3rem;
    }
    
    .boost-content p {
        font-size: 0.9rem;
    }
    
    .btn-boost {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* Стили для системы билетов */
.tickets-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tickets-info h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: white;
}

.ticket-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.ticket-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ticket-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.tickets-description {
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
}

/* Стили для реферальной секции */
.referral-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.referral-section h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: white;
}

.referral-section p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.referral-link-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    align-items: center;
}

.referral-link {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.referral-link::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.btn-copy {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-copy:active {
    transform: translateY(0);
}

.referral-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    font-style: italic;
}

/* Адаптивность для системы билетов */
@media (max-width: 480px) {
    .tickets-info,
    .referral-section {
        padding: 15px;
        margin: 10px 0;
    }
    
    .ticket-number {
        font-size: 2rem;
    }
    
    .referral-link-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .referral-link {
        width: 100%;
    }
    
    .btn-copy {
        width: 100%;
    }
}