:root {
    --dark-blue: #000428;
    --accent-cyan: #00d2ff;
    --accent-green: #3aef9b;
    --tg-color: #24A1DE;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: 10px;
}

.wrapper {
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Секция Expert */
.card-top {
    background: linear-gradient(135deg, var(--dark-blue) 0%, #001540 100%);
    position: relative;
    padding: 20px 20px 60px 20px;
    color: white;
    overflow: hidden;
}

/* Эффект зеленого угла внизу */
.card-top::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to right, transparent, var(--accent-green));
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
    z-index: 1;
}

/* Ограничиваем ширину текста, чтобы он не уходил под фото */
.header-text {
    width: 65%; /* Текст занимает только часть ширины */
    position: relative;
    z-index: 5;
}

.header-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(20px, 6vw, 30px); /* Размер шрифта подстраивается под экран */
    line-height: 1.1;
    letter-spacing: -0.5px;
    position: relative;
}

/* Фото и рамка */
.image-container {
    position: relative;
    margin-top: -50px;
    display: flex;
    justify-content: flex-end;
    z-index: 3;
    
}

.photo-circle {
    width: 60%;
    aspect-ratio: 1 / 1; /* Сохраняет идеальную форму круга */
    max-width: 290px;
    min-width: 180px;
    max-height: 290px;
    min-height: 180px;
    border-radius: 50%;
    border: 4px solid white;
    overflow: hidden;
    background: #ccc;
}

.photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name-badge {
    position: absolute;
    bottom: 25px;
    right: 40px;
    background: var(--accent-cyan);
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    transform: rotate(-2deg);
}

.instruction-badge {
    position: absolute;
    bottom: 20px;
    left: 0;
    background: var(--accent-green);
    color: var(--dark-blue);
    padding: 10px 20px;
    font-weight: 800;
    font-size: 14px;
    z-index: 4;
}

/* Нижняя часть */
.card-bottom {
    padding: 30px 25px;
    text-align: center;
}

.description {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 20px;
}

/* Стили Таймера */
.timer-container {
    background: #fff5f5;
    border: 1px dashed #ff4d4d;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.timer-container p { font-size: 12px; color: #666; }
#timer { font-weight: 700; font-size: 20px; color: #ff4d4d; letter-spacing: 2px; }

.call-to-action {
    font-weight: 600;
    font-size: 16px;
    margin: auto 15px;
    margin-bottom: 15px;
}

.btn-tg {
    background-color: var(--tg-color);
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(36, 161, 222, 0.4);
    transition: transform 0.2s ease;
}

.btn-tg:hover {
    background-color: #1e88bb;
}

.tg-icon {
    width: 38px;
    margin-right: 10px;
}

/* Анимация пульсации */
.pulse-animation { animation: pulse 1.5s infinite; }
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Фикс для iPhone 5/SE: уменьшение шапки и позиционирование фото */
@media screen and (max-width: 330px) {
    body {
        max-height: none; /* Убираем ограничение высоты, чтобы избежать обрезки контента */
    }

    .card-top {
        padding: 15px 15px 15px 15px; /* Уменьшаем внутренние отступы для сжатия блока по высоте */
        min-height: auto;
    }

    .header-text {
        width: 100%; /* Текст занимает всю ширину, чтобы не накладываться на фото сбоку */
        margin-bottom: 10px;
    }

    .header-text h1 {
        font-size: 19px; /* Делаем заголовок чуть меньше для экономии места */
    }

    .image-container {
        margin-top: -60px; /* Убираем наезд на текст (ранее было -50px) */
        margin-bottom: 20px;
        margin-right: 10px; /* Сдвигаем контейнер ВПРАВО за пределы стандартного поля */
        display: flex;
        justify-content: flex-end; /* Выравниваем по правому краю */
    }

    .photo-circle {
        width: 145px; /* Уменьшаем диаметр круга (был min 180px) */
        height: 145px;
        min-width: 145px;
        min-height: 145px;
        border-width: 3px;
    }

    .name-badge {
        bottom: 15px; /* Опускаем плашку с именем ниже вместе с кругом */
        right: 25px;
        font-size: 10px;
        padding: 3px 10px;
    }

    .instruction-badge {
        bottom: 5px; /* Подтягиваем плашку инструкции выше к нижнему краю hero-блока */
        font-size: 12px;
        padding: 6px 15px;
    }

    /* Дополнительная плотность для нижней части */
    .card-bottom {
        padding: 15px 20px;
    }

    .description {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .timer-container {
        margin-bottom: 10px;
    }

    .btn-tg {
        font-size: 18px;
        padding: 10px;
    }
}