/* =========================================================
   styles.css
   ========================================================= */

:root {
    --bg-1: #070b16;
    --screen-1: #0d1226;
    --screen-2: #131b36;
    --border: rgba(139, 92, 246, 0.25);
    --accent-1: #8b5cf6;
    --accent-2: #22d3ee;
    --accent-3: #10b981;
    --warn: #fbbf24;
    --text: #f1f5f9;
    --text-dim: rgba(241, 245, 249, 0.62);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(1200px 800px at 50% -10%, #141c38 0%, var(--bg-1) 55%);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===== Фоновые пятна ===== */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    z-index: 0;
    animation: float 16s ease-in-out infinite alternate;
    pointer-events: none;
    will-change: transform;
}
.bg-blob.b1 { width: 440px; height: 440px; background: #6d28d9; top: -140px; left: -120px; }
.bg-blob.b2 { width: 400px; height: 400px; background: #0284c7; bottom: -160px; right: -120px; animation-delay: -7s; }
.bg-blob.b3 { width: 240px; height: 240px; background: #10b981; bottom: 25%; left: -110px; animation-delay: -3s; opacity: 0.15; }

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, -50px) scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
    .bg-blob { animation: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Смартфон ===== */
.phone {
    position: relative;
    z-index: 1;
    width: 392px;
    max-width: 100%;
    height: min(830px, 94vh);
    height: min(830px, 94dvh);
    background: linear-gradient(160deg, #232a3d, #0a0d18);
    border-radius: 56px;
    padding: 11px;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 60px 120px rgba(0, 0, 0, 0.75),
        0 25px 50px rgba(0, 0, 0, 0.5);
    animation: phoneIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes phoneIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Боковые кнопки */
.side-btn {
    position: absolute;
    background: linear-gradient(90deg, #2a3145, #171c2c);
    box-shadow: inset 0 0 2px rgba(255,255,255,0.15);
}
.side-btn.mute      { left: -2.5px; top: 128px; width: 3px; height: 26px; border-radius: 3px 0 0 3px; }
.side-btn.vol-up    { left: -2.5px; top: 176px; width: 3px; height: 52px; border-radius: 3px 0 0 3px; }
.side-btn.vol-down  { left: -2.5px; top: 240px; width: 3px; height: 52px; border-radius: 3px 0 0 3px; }
.side-btn.power     { right: -2.5px; top: 190px; width: 3px; height: 78px; border-radius: 0 3px 3px 0; }

/* Экран */
.screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 46px;
    overflow: hidden;
    background:
        radial-gradient(600px 300px at 50% -80px, rgba(139, 92, 246, 0.28), transparent 60%),
        radial-gradient(500px 300px at 80% 110%, rgba(14, 165, 233, 0.18), transparent 60%),
        linear-gradient(180deg, var(--screen-1), var(--screen-2));
    display: flex;
    flex-direction: column;
}

.screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0) 28%);
    pointer-events: none;
    z-index: 5;
}

/* Dynamic Island */
.island {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 112px;
    height: 30px;
    background: #000;
    border-radius: 22px;
    z-index: 10;
    box-shadow: inset 0 0 6px rgba(255,255,255,0.06);
}
.island::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #1e2a4a, #05070d 70%);
    box-shadow: inset 0 0 2px rgba(90, 130, 255, 0.6);
}

/* Статус-бар */
.statusbar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px 6px;
    font-size: 0.86rem;
    font-weight: 600;
    z-index: 6;
}
.statusbar .time { letter-spacing: 0.3px; }
.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icons svg { display: block; }

/* Контент экрана */
.screen-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 22px 18px;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
}
.screen-content::-webkit-scrollbar { display: none; }

.app-icon {
    flex: none;
    width: 74px;
    height: 74px;
    margin: 10px auto 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #2a9df4, #1f7ad6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    box-shadow:
        0 14px 30px rgba(31, 122, 214, 0.45),
        inset 0 1px 0 rgba(255,255,255,0.35);
    animation: bob 3.4s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

h1 {
    flex: none;
    font-size: 1.45rem;
    text-align: center;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    flex: none;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-bottom: 18px;
}

/* ===== Главная CTA-кнопка ===== */
.cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none; /* 🔥 ФИКС: запрещаем кнопке сжиматься во flex-контейнере */
    width: 100%;
    min-height: 64px;
    padding: 16px 14px 18px;
    margin: 8px 0;
    text-align: center;
    text-decoration: none;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(120deg, #2ea6ff, #0088ff 40%, #22d3ee 70%, #0088ff);
    background-size: 300% 100%;
    animation: ctaGradient 5s ease infinite, ctaGlow 2.4s ease-in-out infinite;
    box-shadow: 0 14px 34px rgba(0, 136, 255, 0.45);
    transition: transform 0.22s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}
.cta:hover  { transform: translateY(-2px) scale(1.008); }
.cta:active { transform: scale(0.975); }

@keyframes ctaGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 14px 34px rgba(0, 136, 255, 0.4); }
    50%      { box-shadow: 0 18px 48px rgba(0, 136, 255, 0.8); }
}

.cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: none;
    width: 100%;
}
.cta-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cta-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.cta-title {
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.2px;
}
.cta-arrow {
    display: inline-block;
    margin-left: 6px;
    animation: arrowMove 1.2s ease-in-out infinite;
}
@keyframes arrowMove {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(5px); }
}
.cta-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px 6px;
    flex-wrap: wrap;
    margin-top: 9px;
    padding: 0 2px;
    font-size: 0.75rem;
    line-height: 1.45;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    width: 100%;
}
.cta-sub-text {
    white-space: nowrap;
}
.cta-timer {
    display: inline-block;
    min-width: 2.8em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
}
.cta-timer.warning {
    color: #ffe08a;
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ===== Кнопки ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: none;
    width: 100%;
    min-height: 52px;
    padding: 15px 18px;
    margin: 8px 0;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.96rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(139, 92, 246, 0.35);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(139, 92, 246, 0.5);
    filter: brightness(1.08);
}
.btn:active { transform: translateY(0) scale(0.985); }

.btn-secondary {
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid var(--accent-3);
    color: #6ee7b7;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.2);
}
.btn-secondary:hover { box-shadow: 0 12px 28px rgba(16, 185, 129, 0.38); }

.btn-web {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 10px 26px rgba(14, 165, 233, 0.35);
}
.btn-web:hover { box-shadow: 0 14px 32px rgba(14, 165, 233, 0.5); }

.btn-note {
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-dim);
    margin: -2px 0 4px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    margin: 16px 0;
    color: rgba(241, 245, 249, 0.32);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.35), transparent);
}

/* ===== Копирование юзернейма ===== */
.copy-box {
    background: rgba(0, 0, 0, 0.35);
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    cursor: pointer;
    flex: none;
    transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.copy-box:hover  { border-color: var(--accent-1); transform: scale(1.015); }
.copy-box:active { transform: scale(0.985); }
.copy-box.copied {
    border-color: var(--accent-3);
    background: rgba(16, 185, 129, 0.12);
}
.username {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--accent-2);
    font-family: 'SF Mono', ui-monospace, Consolas, monospace;
    word-break: break-all;
}
.hint {
    color: var(--text-dim);
    margin-top: 4px;
    font-size: 0.78rem;
    transition: color 0.2s ease;
}
.copy-box.copied .hint {
    color: var(--accent-3);
}

/* ===== Блок прокси ===== */
.proxy-block {
    background: linear-gradient(160deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.04));
    border: 1px solid rgba(245, 158, 11, 0.28);
    padding: 18px 16px;
    border-radius: 18px;
    margin-top: 18px;
    flex: none;
}
.proxy-block h3 {
    color: var(--warn);
    font-size: 0.98rem;
    text-align: center;
    margin-bottom: 4px;
}
.proxy-block .proxy-desc {
    color: var(--text-dim);
    font-size: 0.78rem;
    text-align: center;
    margin-bottom: 6px;
}

/* ===== Блок сайта ===== */
.site-link-block {
    margin-top: 18px;
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.15), rgba(123, 97, 255, 0.1));
    border: 1px solid rgba(0, 136, 255, 0.3);
    border-radius: 18px;
    padding: 20px 16px;
    text-align: center;
    flex: none;
}
.site-link-icon { font-size: 2rem; margin-bottom: 6px; }
.site-link-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.site-link-desc {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 14px;
    line-height: 1.5;
}
.btn-site-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: none;
    width: 100%;
    min-height: 50px;
    padding: 14px;
    background: linear-gradient(135deg, #0088ff, #00d4ff);
    color: white;
    text-decoration: none;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.94rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: 0 8px 24px rgba(0, 136, 255, 0.35);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}
.btn-site-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 136, 255, 0.5);
}
.btn-site-link:active { transform: translateY(0) scale(0.985); }

.back-link {
    display: block;
    text-align: center;
    flex: none;
    margin: 16px 0 4px;
    padding: 10px;
    color: #a78bfa;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.back-link:hover { color: #c4b5fd; text-decoration: underline; }

/* Домашний индикатор */
.home-indicator {
    flex: none;
    width: 126px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
    margin: 6px auto 9px;
    z-index: 6;
}

/* ===== Адаптация под мобильные ===== */
@media (max-width: 560px) {
    body { padding: 10px 8px; }
    .phone {
        width: 100%;
        height: calc(100dvh - 20px);
        border-radius: 46px;
        padding: 9px;
    }
    .screen { border-radius: 38px; }
    .screen-content { padding: 12px 18px 16px; }
}

@media (max-width: 380px) {
    .phone { border-radius: 40px; }
    .screen { border-radius: 32px; }
    .btn { font-size: 0.9rem; padding: 14px 14px; }
    .cta { padding: 14px 12px 16px; }
    .cta-title { font-size: 1.05rem; }
    .cta-sub { font-size: 0.7rem; gap: 2px 4px; }
    h1 { font-size: 1.25rem; }
}

@media (max-width: 340px) {
    .cta-icon { width: 34px; height: 34px; }
    .cta-icon svg { width: 17px; height: 17px; }
    .username { font-size: 1.05rem; }
}