* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 80px; /* Высота шапки */
}

/* ============================================
   ШАПКА САЙТА
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Логотип */
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Навигация */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: #f0f0f0;
    color: #667eea;
}

.nav-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.logout-link {
    color: #dc3545 !important;
}

.logout-link:hover {
    background: #ffe5e5 !important;
    color: #dc3545 !important;
}

/* Кнопка меню (мобильная) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Шапка приветственной страницы (для неавторизованных) */
.welcome-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   ОСНОВНОЙ КОНТЕЙНЕР
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============================================
   АВТОРИЗАЦИЯ
   ============================================ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
}

.form-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
}

.form-box h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.switch-form a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* ============================================
   ПРОФИЛЬ
   ============================================ */

.profile-header {
    text-align: center;
    margin-bottom: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.profile-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.profile-header p {
    color: #666;
    font-size: 18px;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

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

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

.info-value {
    color: #333;
    font-weight: 600;
}

/* Статистика */
.stats-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateX(5px);
}

.stat-icon {
    font-size: 36px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    color: #333;
    font-size: 24px;
    font-weight: bold;
}

.profile-actions {
    text-align: center;
}

/* ============================================
   ЗАДАНИЯ
   ============================================ */

.tasks-header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tasks-header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.tasks-header p {
    color: #666;
}

.tasks-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tasks-content {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    min-height: 400px;
}

.tasks-tab-content {
    display: none;
}

.tasks-tab-content.active {
    display: block;
}

/* Компактные строки заданий */
.task-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
}

.task-row:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.task-row-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.task-row-info {
    flex: 1;
    min-width: 0;
}

.task-row-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.task-row-reward {
    color: #28a745;
    font-weight: bold;
}

.task-row-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.task-row-btn:hover {
    transform: scale(1.05);
}

.task-row-status {
    text-align: right;
}

.task-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.task-status.moderation {
    background: #fff3cd;
    color: #856404;
}

.task-status.completed {
    background: #d4edda;
    color: #155724;
}

.task-date {
    font-size: 12px;
    color: #999;
    display: block;
}

.placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
}

/* ============================================
   О ПРОЕКТЕ
   ============================================ */

.about-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.about-content h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

.about-section {
    margin-bottom: 50px;
}

.about-section h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.about-section p {
    color: #666;
    line-height: 1.8;
    font-size: 16px;
}

/* Шаги */
.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.step-content h3 {
    color: #333;
    margin-bottom: 8px;
}

.step-content p {
    color: #666;
}

/* Преимущества */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* Типы заданий */
.task-types {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.task-types li {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 16px;
}

/* FAQ */
.faq {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.faq-item h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.faq-item p {
    color: #666;
}

/* CTA секция */
.cta-section {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.cta-section h2 {
    color: white;
}

.cta-section p {
    color: white;
    margin-bottom: 20px;
}

/* Кнопки на фиолетовом фоне CTA-секции не должны сливаться с фоном */
.cta-section .btn-primary {
    background: white;
    color: #667eea;
}

.cta-section .btn-primary:hover {
    background: #f0f0ff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cta-section .btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-section .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   КНОПКИ
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-large {
    padding: 15px 40px;
    font-size: 18px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 900px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* Детали задания */
.task-detail-header {
    margin-bottom: 20px;
}

.task-detail-title {
    color: #667eea;
    margin-bottom: 10px;
}

.task-detail-reward {
    color: #28a745;
    font-size: 20px;
    font-weight: bold;
}

.task-detail-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.task-detail-section {
    margin-bottom: 30px;
}

.task-detail-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.task-steps {
    list-style: none;
    padding-left: 0;
}

.task-steps li {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.report-requirements {
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Кнопка «🔗 Перейти по ссылке» стоит сразу под кнопкой «Начать выполнение» (только пока задание не начато) */
.task-detail-actions {
    margin-top: 12px;
}

.task-detail-actions:empty {
    display: none;
}

.task-link-btn {
    display: inline-block;
    text-align: center;
}

/* Ссылки внутри описания, шагов и требований */
.task-text-link {
    color: #4a56c6;
    text-decoration: underline;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-text-link:hover {
    color: #2f3a9e;
}

.task-text-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Форма отчета */
.report-form {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.report-form h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.file-upload-label {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 5px;
}

.file-upload-label:hover {
    background: #5568d3;
}

input[type="file"] {
    display: none;
}

.file-name {
    display: block;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.submit-report-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

.submit-report-btn:hover {
    transform: translateY(-2px);
}

/* ============================================
   СООБЩЕНИЯ
   ============================================ */

.message {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.hidden {
    display: none;
}

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

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

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ
   ============================================ */

.hidden {
    display: none !important;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================ */

/* Планшеты и маленькие экраны */
@media (max-width: 992px) {
    .container {
        padding: 30px 15px;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-types {
        grid-template-columns: 1fr;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    /* Общие настройки */
    body {
        padding-top: 60px;
        font-size: 14px;
    }
    
    /* Шапка */
    .header-container {
        height: 60px;
        padding: 0 15px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-icon {
        font-size: 28px;
    }
    
    /* Мобильное меню */
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        max-width: 85%;
        height: calc(100vh - 60px);
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: -5px 0 20px rgba(0,0,0,0.2);
        transition: right 0.3s ease;
        gap: 5px;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        width: 100%;
        padding: 12px 15px;
        font-size: 16px;
    }
    
    /* Контейнер */
    .container {
        padding: 20px 15px;
    }
    
    /* Авторизация */
    .auth-container {
        min-height: calc(100vh - 100px);
        padding: 20px 15px;
    }
    
    .form-box {
        padding: 25px 20px;
        max-width: 100%;
        margin: 0 10px;
    }
    
    .form-box h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    /* Профиль */
    .profile-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .profile-header h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .profile-header p {
        font-size: 16px;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .info-card {
        padding: 20px 15px;
    }
    
    .info-card h3 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 5px;
        padding: 10px 0;
        text-align: left;
    }
    
    .info-label {
        font-size: 13px;
    }
    
    .info-value {
        font-size: 15px;
    }
    
    .stat-item {
        padding: 12px;
        gap: 12px;
    }
    
    .stat-icon {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Задания */
    .tasks-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .tasks-header h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .tasks-header p {
        font-size: 14px;
    }
    
    .tasks-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 6px;
        gap: 4px;
        margin-bottom: 15px;
    }
    
    /* Три вкладки (доступные, на модерации, выполненные) в одну компактную строку */
    .tab-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 9px 4px;
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .tasks-content {
        padding: 15px;
        min-height: 300px;
    }
    
    /* Компактные карточки заданий - такие же как на десктопе */
    .task-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }
    
    .task-row:hover {
        transform: translateX(3px);
    }
    
    .task-row-icon {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 2px; /* Квадратные иконки на мобильных */
        flex-shrink: 0;
    }
    
    .task-row-info {
        flex: 1;
        min-width: 0;
        text-align: left;
    }
    
    .task-row-title {
        font-size: 15px;
        margin-bottom: 3px;
    }
    
    .task-row-reward {
        font-size: 16px;
        font-weight: bold;
    }
    
    .task-row-btn {
        padding: 10px 18px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .task-row-status {
        text-align: right;
    }
    
    .task-status {
        padding: 5px 12px;
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .task-date {
        font-size: 11px;
    }
    
    .placeholder {
        padding: 40px 15px;
        font-size: 16px;
    }
    
    /* О проекте */
    .about-content {
        padding: 20px 15px;
    }
    
    .about-content h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .about-section {
        margin-bottom: 30px;
    }
    
    .about-section h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .about-section p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Шаги */
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .step-content h3 {
        font-size: 16px;
    }
    
    .step-content p {
        font-size: 14px;
    }
    
    /* Преимущества */
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature {
        padding: 20px 15px;
    }
    
    .feature-icon {
        font-size: 40px;
    }
    
    .feature h3 {
        font-size: 16px;
    }
    
    .feature p {
        font-size: 13px;
    }
    
    /* Типы заданий */
    .task-types {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .task-types li {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* FAQ */
    .faq-item {
        padding: 15px;
    }
    
    .faq-item h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .faq-item p {
        font-size: 14px;
    }
    
    /* CTA секция */
    .cta-section {
        padding: 30px 20px;
    }
    
    .cta-section h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .cta-section p {
        font-size: 14px;
    }
    
    /* Кнопки */
    .btn {
        padding: 12px 25px;
        font-size: 15px;
        width: 100%;
        text-align: center;
    }
    
    .btn-large {
        padding: 14px 30px;
        font-size: 16px;
    }
    
    /* Шапка приветственной страницы */
    .welcome-header-actions {
        gap: 6px;
    }
    
    .welcome-header-actions .btn {
        width: auto;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Модальное окно */
    .modal {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .modal-content {
        padding: 20px 15px;
        margin: 10px;
        max-width: 100%;
        width: calc(100% - 20px);
        max-height: none;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
    }
    
    .task-detail-header {
        margin-bottom: 15px;
    }
    
    .task-detail-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .task-detail-reward {
        font-size: 18px;
    }
    
    .task-detail-image {
        margin-bottom: 15px;
    }
    
    .task-detail-section {
        margin-bottom: 20px;
    }
    
    .task-detail-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .task-steps li {
        padding: 10px 12px;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .report-requirements {
        padding: 12px;
        font-size: 14px;
    }
    
    .task-link-btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .report-form {
        padding: 15px;
        margin-top: 20px;
    }
    
    .report-form h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .file-upload-label {
        width: 100%;
        text-align: center;
        display: block;
        padding: 12px 20px;
    }
    
    textarea {
        padding: 10px 12px;
        font-size: 15px;
        min-height: 120px;
    }
    
    .submit-report-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    /* Сообщения */
    .message {
        top: 70px;
        right: 10px;
        left: 10px;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Вывод средств */
    .withdrawal-section {
        margin-top: 15px;
        padding-top: 15px;
    }
    
    .withdrawal-info small {
        font-size: 13px;
        display: block;
        margin-bottom: 8px;
    }
    
    .btn-withdrawal {
        padding: 14px;
        font-size: 15px;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .logo-icon {
        font-size: 24px;
    }
    
    .form-box h2 {
        font-size: 20px;
    }
    
    .profile-header h1,
    .tasks-header h1,
    .about-content h1 {
        font-size: 20px;
    }
    
    .tab-btn {
        min-width: 0;
        padding: 9px 2px;
        font-size: 12px;
    }
    
    .tasks-tabs {
        padding: 5px;
        gap: 3px;
    }
    
    .task-row-icon {
        height: 50px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 15px 10px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 55px;
    }
    
    .header-container {
        height: 55px;
    }
    
    .nav-menu {
        top: 55px;
        height: calc(100vh - 55px);
    }
    
    .task-row-icon {
        height: 50px;
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .tab-btn,
    .task-row-btn,
    .nav-menu a {
        min-height: 44px; /* Рекомендованный минимум Apple */
    }
    
    /* Убираем hover эффекты на touch-устройствах */
    .task-row:hover,
    .stat-item:hover,
    .feature:hover {
        transform: none;
    }
    
    /* Добавляем active состояния для визуальной обратной связи */
    .btn:active,
    .tab-btn:active,
    .task-row-btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
    
    .task-row:active {
        background: #e9ecef;
    }
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ СПЕЦИФИЧНЫХ КОМПОНЕНТОВ
   ============================================ */

/* Ранги на мобильных */
@media (max-width: 768px) {
    #profileRank {
        padding: 15px;
    }
    
    #profileRank h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .rank-display {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .rank-progress {
        margin-bottom: 12px;
    }
    
    .progress-bar {
        height: 8px;
    }
    
    .rank-hint {
        font-size: 13px;
        padding: 10px;
    }
}

/* Реферальная система на мобильных */
@media (max-width: 768px) {
    .referral-section {
        padding: 15px;
    }
    
    .referral-section h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .referral-link-box {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .referral-link-input {
        font-size: 13px;
        padding: 10px;
    }
    
    .copy-referral-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .referral-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .referral-stat-card {
        padding: 15px;
    }
    
    .referral-stat-label {
        font-size: 13px;
    }
    
    .referral-stat-value {
        font-size: 20px;
    }
    
    .referral-list h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .referral-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }
    
    .referral-user {
        font-size: 14px;
    }
    
    .referral-date {
        font-size: 12px;
    }
}

/* Уведомление о реферале на мобильных */
@media (max-width: 768px) {
    #referralNotice {
        padding: 12px;
        font-size: 13px;
        margin-bottom: 15px;
    }
}

/* Вывод средств - улучшенная мобильная версия */
@media (max-width: 768px) {
    .withdrawal-modal-content {
        padding: 20px 15px;
    }
    
    .withdrawal-step {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .withdrawal-step h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .withdrawal-step p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .withdrawal-timer {
        font-size: 18px;
        padding: 10px;
    }
    
    .card-info {
        padding: 12px;
        font-size: 13px;
    }
    
    .card-benefits li {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* Улучшения для форм на мобильных */
@media (max-width: 768px) {
    /* Предотвращаем зум при фокусе на iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Улучшенные чекбоксы и радио-кнопки для touch */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
        margin-right: 10px;
    }
    
    /* Улучшенная загрузка файлов */
    .file-upload-label {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .file-name {
        font-size: 13px;
        margin-top: 8px;
        word-break: break-all;
    }
}

/* Оптимизация анимаций для мобильных */
@media (max-width: 768px) {
    /* Отключаем сложные анимации для производительности */
    * {
        transition-duration: 0.2s !important;
    }
    
    @keyframes slideIn {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* Печать (отключаем для мобильной версии) */
@media print {
    .site-header,
    .nav-menu,
    .menu-toggle,
    .profile-actions,
    .btn,
    .modal {
        display: none !important;
    }
}


/* ============================================
   ВЫВОД СРЕДСТВ
   ============================================ */

.withdrawal-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.withdrawal-info {
    text-align: center;
    margin-bottom: 15px;
}

.withdrawal-info small {
    color: #666;
    font-size: 14px;
}

.btn-withdrawal {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-withdrawal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.withdrawal-status {
    margin-top: 15px;
}

/* ============================================
   ЕЖЕДНЕВНЫЕ НАГРАДЫ
   ============================================ */
.daily-reward-card {
    grid-column: 1 / -1;
}
.daily-reward-subtitle {
    color: #666;
    font-size: 14px;
    margin: -8px 0 16px;
}
.daily-reward-loading {
    text-align: center;
    color: #999;
    padding: 20px;
}
.daily-reward-note {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-top: 10px;
}
.daily-reward-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.daily-reward-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 12px 4px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    background: #f1f3f5;
    color: #868e96;
    text-align: center;
}
.daily-reward-day-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.daily-reward-day-icon {
    font-size: 22px;
    line-height: 1;
}
.daily-reward-day-amount {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.daily-reward-day.is-claimed {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}
.daily-reward-day.is-available {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe08a 100%);
    border-color: #ffc107;
    color: #856404;
    animation: dailyRewardPulse 1.6s ease-in-out infinite;
}
.daily-reward-day.is-locked {
    opacity: 0.7;
}
@keyframes dailyRewardPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.55); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(255, 193, 7, 0); }
}
.daily-reward-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}
.daily-reward-btn:disabled,
.daily-reward-btn:disabled:hover {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
    .daily-reward-day.is-available {
        animation: none;
    }
}
@media (max-width: 768px) {
    .daily-reward-card {
        padding: 20px 15px;
    }
    .daily-reward-days {
        gap: 8px;
    }
}
@media (max-width: 480px) {
    .daily-reward-days {
        gap: 5px;
    }
    .daily-reward-day {
        padding: 8px 2px;
        border-radius: 8px;
        gap: 3px;
    }
    .daily-reward-day-label {
        font-size: 11px;
    }
    .daily-reward-day-icon {
        font-size: 18px;
    }
    .daily-reward-day-amount {
        font-size: 12px;
    }
    .daily-reward-btn {
        font-size: 14px;
        padding: 12px 10px;
    }
}
@media (max-width: 360px) {
    .daily-reward-day-label {
        font-size: 10px;
    }
    .daily-reward-day-amount {
        font-size: 11px;
    }
}

/* ============================================
   РЕКЛАМА (Ads)
   ============================================ */

.ads-intro {
    margin-top: 10px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Компактная статистика: четыре показателя в одной строке */
.ads-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ads-stat {
    text-align: center;
    padding: 8px 6px;
    color: white;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ads-stat:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ads-stat:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00a8e8 100%);
}

.ads-stat:nth-child(4) {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.ads-stat-value {
    font-size: 18px;
    line-height: 1.2;
    font-weight: bold;
    word-break: break-word;
}

.ads-stat-label {
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.9;
    margin-top: 2px;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.ad-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    border-radius: 15px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 0;
}

.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.25);
}

.ad-card.viewed {
    opacity: 0.75;
}

.ad-card-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    word-break: break-word;
}

.ad-card-reward {
    display: inline-block;
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.ad-card-meta {
    color: #666;
    font-size: 14px;
}

.ad-card-host {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-card .btn {
    width: 100%;
    margin-top: auto;
    text-align: center;
}

.ad-card .btn:disabled {
    background: #adb5bd;
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ads-empty {
    text-align: center;
    padding: 60px 20px;
}

.ads-empty-icon {
    font-size: 72px;
    margin-bottom: 20px;
}

.ads-empty h2 {
    color: #666;
    margin-bottom: 10px;
}

.ads-empty p {
    color: #999;
}

.ad-view-card {
    margin-top: 20px;
}

.ad-view-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ad-view-head h2 {
    margin: 0;
    word-break: break-word;
    min-width: 0;
}

.ad-timer {
    text-align: center;
    margin-top: 20px;
    font-size: 20px;
    color: #666;
}

.ad-timer-value {
    font-size: 56px;
    font-weight: bold;
    color: #667eea;
    font-variant-numeric: tabular-nums;
}

.ad-timer-status {
    text-align: center;
    margin: 6px 0 12px;
    color: #666;
    font-size: 15px;
    min-height: 22px;
}

.ad-progress {
    height: 10px;
    border-radius: 5px;
    background: #e0e0e0;
    overflow: hidden;
}

.ad-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.25s linear;
}

.ad-pause-banner {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    text-align: center;
    font-weight: 600;
}

.ad-frame-wrap {
    margin-top: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    overflow: hidden;
}

.ad-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 520px;
    border: 0;
    background: white;
}

.ad-frame-notice {
    margin-top: 10px;
    color: #888;
    font-size: 13px;
    line-height: 1.5;
}

.ad-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.ad-actions .btn:disabled {
    background: #adb5bd;
    color: white;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ad-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.ad-result-title {
    font-size: 22px;
    font-weight: bold;
}

.ad-result-balance {
    margin-top: 6px;
    font-size: 16px;
}

.ad-error {
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.ad-error p {
    color: #666;
    margin-bottom: 20px;
    font-size: 17px;
}

@media (prefers-reduced-motion: reduce) {
    .ad-progress-bar,
    .ad-card {
        transition: none;
    }
}

/* Меню (до 8 пунктов: Профиль, Задания, Призы, Реклама, Лидеры, Пригласить, О проекте, Выход)
   должно помещаться в одну строку на десктопе. Название сайта в логотипе скрывается
   визуально (остаётся для скринридеров) на ширинах, где оно не помещается. */
@media (min-width: 769px) {
    .nav-menu {
        flex-shrink: 0;
    }
    .nav-menu a {
        padding: 10px 10px;
        white-space: nowrap;
    }
    .logo {
        flex-shrink: 0;
    }
}

@media (min-width: 769px) and (max-width: 1239px) {
    .logo-text {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

@media (min-width: 769px) and (max-width: 839px) {
    .nav-menu {
        gap: 0;
    }
    .nav-menu a {
        padding: 8px 5px;
        font-size: 12px;
    }
}

@media (min-width: 840px) and (max-width: 999px) {
    .nav-menu {
        gap: 0;
    }
    .nav-menu a {
        padding: 9px 6px;
        font-size: 13px;
    }
}

@media (min-width: 1000px) and (max-width: 1239px) {
    .nav-menu {
        gap: 2px;
    }
    .nav-menu a {
        padding: 10px 9px;
        font-size: 15px;
    }
}

@media (min-width: 1240px) {
    .nav-menu {
        gap: 3px;
    }
}

@media (max-width: 768px) {
    .ads-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .ad-card {
        padding: 18px;
    }
    .ad-frame-wrap iframe {
        height: 60vh;
        min-height: 320px;
    }
    .ad-actions {
        flex-direction: column;
    }
    .ad-actions .btn {
        width: 100%;
        text-align: center;
    }
    .ad-timer-value {
        font-size: 44px;
    }
}

@media (max-width: 480px) {
    /* Узкий экран: два показателя в ряд, плотные плитки */
    .ads-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .ads-stat {
        padding: 6px 6px;
    }
    .ads-stat-value {
        font-size: 16px;
    }
    .ads-stat-label {
        font-size: 11px;
    }
    .ad-view-card {
        padding: 16px;
    }
    .ad-error {
        padding: 30px 12px;
    }
}

/* ЛИДЕРЫ (Leaders) */
.leaders-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.leaders-tab {
    flex: 1 1 140px;
    padding: 10px 16px;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, transform 0.3s;
}

.leaders-tab:hover {
    transform: translateY(-2px);
}

.leaders-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.leaders-card h3 {
    margin-top: 20px;
    margin-bottom: 6px;
}

.leaders-reset {
    margin-bottom: 18px;
    color: #888;
    font-size: 14px;
}

.leaders-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaders-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f7ff 0%, #ece8f7 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.leaders-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.leaders-row.rank-1,
.leaders-row.rank-2,
.leaders-row.rank-3 {
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 700;
}

.leaders-row.rank-1 {
    background: linear-gradient(135deg, #fff3b0 0%, #ffd34e 100%);
}

.leaders-row.rank-2 {
    background: linear-gradient(135deg, #f1f3f5 0%, #ced4da 100%);
}

.leaders-row.rank-3 {
    background: linear-gradient(135deg, #ffe0c2 0%, #e8a56b 100%);
}

.leaders-row.is-me {
    outline: 3px solid #667eea;
    outline-offset: -3px;
}

.leaders-rank {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.leaders-row.rank-1 .leaders-rank,
.leaders-row.rank-2 .leaders-rank,
.leaders-row.rank-3 .leaders-rank {
    font-size: 28px;
}

.leaders-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.leaders-me-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.leaders-value {
    font-weight: 700;
    color: #28a745;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.leaders-my-place {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    text-align: center;
}

.leaders-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 17px;
}

@media (prefers-reduced-motion: reduce) {
    .leaders-tab,
    .leaders-row {
        transition: none;
    }
    .leaders-tab:hover,
    .leaders-row:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    /* Сортировка в две компактные строки: период (2 кнопки) и категория (3 кнопки) */
    .leaders-tabs {
        flex-wrap: nowrap;
        gap: 6px;
        margin-bottom: 8px;
    }
    .leaders-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 7px 6px;
        border-width: 1.5px;
        border-radius: 20px;
        font-size: 13px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .leaders-card h3 {
        margin-top: 12px;
        margin-bottom: 4px;
        font-size: 17px;
    }
    .leaders-reset {
        margin-bottom: 10px;
        font-size: 12px;
    }
    .leaders-row {
        grid-template-columns: 40px 1fr auto;
        gap: 10px;
        padding: 12px 14px;
    }
    .leaders-row.rank-1,
    .leaders-row.rank-2,
    .leaders-row.rank-3 {
        padding: 14px 16px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .leaders-tab {
        padding: 7px 4px;
        font-size: 12px;
    }
    .leaders-row {
        grid-template-columns: 34px 1fr auto;
        gap: 8px;
        padding: 10px 12px;
    }
    .leaders-rank {
        font-size: 17px;
    }
    .leaders-row.rank-1 .leaders-rank,
    .leaders-row.rank-2 .leaders-rank,
    .leaders-row.rank-3 .leaders-rank {
        font-size: 24px;
    }
    .leaders-me-badge {
        margin-left: 4px;
        padding: 1px 7px;
    }
}

/* Очень узкие экраны: три кнопки категории по-прежнему в одной строке */
@media (max-width: 360px) {
    .leaders-tabs {
        gap: 4px;
    }
    .leaders-tab {
        padding: 7px 2px;
        font-size: 11px;
    }
}

/* ============================================
   Pagination (постраничный вывод заданий)
   ============================================ */

.tasks-tab-content,
#adsContainer,
#prizesContainer {
    scroll-margin-top: 90px; /* не прятать начало списка под фиксированной шапкой */
}

.tasks-pager:empty {
    display: none;
}

/* Панель страниц на фиолетовом фоне (реклама, призы): белая карточка, чтобы подпись читалась */
.tasks-pager.pagination-card {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.pagination-card .pagination {
    margin-top: 0;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 14px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f0f0ff;
}

.pagination-btn:focus-visible {
    outline: 3px solid rgba(118, 75, 162, 0.5);
    outline-offset: 2px;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    cursor: default;
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-ellipsis {
    min-width: 24px;
    color: #888;
    font-weight: 600;
    user-select: none;
}

.pagination-caption {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

@media (max-width: 480px) {
    .pagination-buttons {
        gap: 6px;
    }
    .pagination-btn {
        min-width: 40px;
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* ============================================
   ПОЧТА: подтверждение, подписка
   ============================================ */

.email-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    color: #856404;
}

.email-banner.hidden {
    display: none;
}

.checkbox-group label {
    display: inline;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.status-note {
    margin-top: 8px;
    font-size: 13px;
    color: #777;
}

/* Очень узкие экраны: вкладки заданий остаются в одну строку */
@media (max-width: 360px) {
    .tab-btn {
        font-size: 11px;
        padding: 9px 1px;
    }
}

/* ===== Страницы «Моя статистика» и «Мой баланс» (.stats-*, .balance-*, .history-*) ===== */

.stats-page,
.balance-page {
    max-width: 720px;
    margin: 0 auto;
}

/* Моя статистика: ранг с прогрессом */
.stats-rank-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 8px;
}

.stats-rank-name {
    font-size: 18px;
    font-weight: 600;
}

.stats-rank-count {
    color: #666;
    font-size: 14px;
}

.stats-rank-max {
    color: #28a745;
    font-weight: 600;
}

.stats-progress {
    position: relative;
    height: 20px;
    overflow: hidden;
    background: #e0e0e0;
    border-radius: 10px;
}

.stats-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.stats-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 0 3px #fff;
}

.stats-rank-next {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Мой баланс: крупная сумма, итоги, минимум вывода */
.balance-card {
    text-align: center;
}

.balance-label {
    color: #666;
    font-size: 14px;
}

.balance-amount {
    margin: 6px 0;
    font-size: 40px;
    font-weight: 700;
    color: #28a745;
    overflow-wrap: anywhere;
}

.balance-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    color: #666;
    font-size: 14px;
}

.balance-total-plus {
    color: #28a745;
}

.balance-total-minus {
    color: #dc3545;
}

.balance-min {
    margin-top: 20px;
    padding: 12px;
    text-align: left;
    background: #f8f9fa;
    border-radius: 8px;
}

.balance-min-label {
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
}

.balance-min-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
}

.balance-min-rank {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.balance-min-sum {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
}

.balance-rank-hint {
    margin-top: 12px;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.7;
    color: #0c5460;
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    border-radius: 8px;
}

.balance-hint-good {
    color: #28a745;
}

.balance-page .withdrawal-section {
    text-align: left;
}

/* История операций */
.history-card {
    margin-top: 20px;
    scroll-margin-top: 90px;
}

.history-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.history-tab {
    flex: 1;
    min-width: 90px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.history-tab:hover {
    background: #f0f0ff;
}

.history-tab:focus-visible {
    outline: 3px solid rgba(118, 75, 162, 0.5);
    outline-offset: 2px;
}

.history-tab.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.history-loading,
.history-empty {
    padding: 30px 10px;
    text-align: center;
    color: #999;
}

.history-error {
    padding: 20px 10px;
    text-align: center;
    color: #721c24;
}

.history-error p {
    margin-bottom: 12px;
}

.history-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.history-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid #f0f0f0;
}

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

.history-icon {
    width: 32px;
    font-size: 24px;
    text-align: center;
}

.history-body {
    min-width: 0;
}

.history-title {
    font-weight: 600;
    color: #333;
    overflow-wrap: anywhere;
}

.history-date,
.history-after {
    margin-top: 2px;
    font-size: 12px;
    color: #888;
}

.history-amount {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.history-plus {
    color: #28a745;
}

.history-minus {
    color: #dc3545;
}

@media (max-width: 480px) {
    .balance-card,
    .history-card {
        padding: 20px 15px;
    }

    .balance-amount {
        font-size: 32px;
    }

    .history-tab {
        min-width: 0;
        padding: 9px 6px;
        font-size: 13px;
    }

    .history-row {
        gap: 8px;
        padding: 10px 0;
    }

    .history-icon {
        width: 24px;
        font-size: 20px;
    }

    .history-title {
        font-size: 14px;
    }

    .history-amount {
        font-size: 14px;
    }
}

/* ===== Пункт меню «Поддержка» (.menu-support-*) ===== */
/* Один новый пункт меню. Правила остальных пунктов не меняются: всё, что нужно этому пункту, задаётся только здесь.
   На десктопе пункт показывает только иконку (подпись для скринридеров скрыта, подсказка - title),
   на мобильной панели (<= 768px) видны иконка, подпись и значки. Единственное правило вне пункта -
   расширение контейнера шапки на 40px при ширине от 1240px: без него восьмой пункт не помещается в одну строку. */

.menu-support {
    position: relative;
}

.nav-menu a.menu-support-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-support-icon {
    flex: 0 0 auto;
    line-height: 1;
}

.menu-support-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.menu-support-badges:empty {
    display: none;
}

.menu-support-badge {
    box-sizing: border-box;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.menu-support-badge.is-red {
    background: #c82333;
}

.menu-support-badge.is-green {
    background: #1e7e34;
}

.nav-menu a.menu-support-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (min-width: 769px) {
    .menu-support-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .menu-support-badges {
        position: absolute;
        top: -2px;
        right: -6px;
        margin-left: 0;
        pointer-events: none;
    }

    .menu-support-badge {
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        font-size: 10px;
        line-height: 16px;
    }
}

@media (min-width: 769px) and (max-width: 839px) {
    .nav-menu a.menu-support-link {
        padding-left: 4px;
        padding-right: 4px;
    }
}

@media (min-width: 840px) and (max-width: 999px) {
    .nav-menu a.menu-support-link {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (min-width: 1000px) and (max-width: 1239px) {
    .nav-menu a.menu-support-link {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (min-width: 1240px) {
    .nav-menu a.menu-support-link {
        padding-left: 6px;
        padding-right: 6px;
    }

    .site-header .header-container {
        max-width: 1240px;
    }
}

/* ===== Карточка профиля в меню (.menu-profile-*) ===== */
/* Заменяет пункт «Профиль» (первый <li> меню). Остальные пункты меню и их правила не затрагиваются:
   всё, что нужно карточке (в том числе сжатие на узких экранах), задаётся только здесь. */

.menu-profile {
    position: relative;
}

/* До загрузки профиля место под карточку занято, чтобы шапка не прыгала */
.menu-profile:empty {
    min-width: 130px;
    min-height: 44px;
}

.menu-profile-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    width: auto;
    margin: 0;
    padding: 3px 6px 3px 7px;
    /* Рамка, лёгкий фон и тень: карточка выглядит как кнопка, а не как обычный текст */
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.22);
    color: #333;
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.menu-profile-trigger:hover,
.menu-profile.is-open .menu-profile-trigger {
    background: rgba(102, 126, 234, 0.18);
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.35);
    color: #667eea;
}

.menu-profile-trigger.is-current {
    background: rgba(102, 126, 234, 0.12);
}

.menu-profile-trigger:focus-visible,
.menu-profile .menu-profile-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.menu-profile-avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.menu-profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.menu-profile-name {
    display: block;
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.menu-profile-balance {
    display: block;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #28a745;
    font-size: 12px;
    font-weight: 700;
}

/* Стрелка раскрытия в цветном кружке: видно, что карточку можно нажать */
.menu-profile-caret {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 11px;
    line-height: 1;
    transition: transform 0.2s, background 0.2s;
}

.menu-profile-trigger:hover .menu-profile-caret,
.menu-profile.is-open .menu-profile-caret {
    background: #764ba2;
}

.menu-profile.is-open .menu-profile-caret {
    transform: rotate(180deg);
}

/* Выпадающий список скрыт, пока карточка не открыта */
.menu-profile-dropdown {
    display: none;
}

.menu-profile.is-open .menu-profile-dropdown {
    display: block;
}

/* Ссылки списка берут вид от .nav-menu a и .nav-menu a.active; здесь только размеры */
.menu-profile .menu-profile-link {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
}

/* Десктоп: список под карточкой */
@media (min-width: 769px) {
    .menu-profile-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 20;
        min-width: 210px;
        padding: 6px;
        border-radius: 10px;
        background: white;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
}

@media (min-width: 1000px) and (max-width: 1239px) {
    .menu-profile-name {
        max-width: 60px;
    }
    .menu-profile-balance {
        max-width: 72px;
    }
}

@media (min-width: 840px) and (max-width: 999px) {
    .menu-profile:empty {
        min-width: 110px;
    }
    .menu-profile-trigger {
        gap: 4px;
        padding: 3px 5px;
    }
    .menu-profile-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    .menu-profile-name {
        max-width: 52px;
        font-size: 12px;
    }
    .menu-profile-balance {
        max-width: 60px;
        font-size: 11px;
    }
    .menu-profile-caret {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}

@media (min-width: 769px) and (max-width: 839px) {
    .menu-profile:empty {
        min-width: 96px;
    }
    .menu-profile-trigger {
        gap: 3px;
        padding: 3px 4px;
    }
    .menu-profile-avatar {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    .menu-profile-name {
        max-width: 36px;
        font-size: 12px;
    }
    .menu-profile-balance {
        max-width: 54px;
        font-size: 11px;
    }
    .menu-profile-caret {
        width: 13px;
        height: 13px;
        font-size: 9px;
    }
}

/* Мобильное меню: карточка на всю ширину панели, список раскрывается под ней в потоке */
@media (max-width: 768px) {
    .menu-profile:empty {
        min-width: 0;
        min-height: 48px;
    }
    .menu-profile-trigger {
        width: 100%;
        gap: 10px;
        padding: 10px 15px;
    }
    .menu-profile-avatar {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .menu-profile-text {
        flex: 1;
    }
    .menu-profile-name {
        max-width: none;
        font-size: 15px;
    }
    .menu-profile-balance {
        max-width: none;
        font-size: 14px;
    }
    .menu-profile-caret {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    .menu-profile-dropdown {
        position: static;
        min-width: 0;
        margin-top: 4px;
        padding: 0 0 0 12px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .menu-profile .menu-profile-link {
        padding: 12px 15px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .menu-profile-trigger,
    .menu-profile-caret {
        transition: none;
    }
}
