/* ==============================================
   /css/swipe/style.css
   ============================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #0a0a0a;
    color: #fff;
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Viewer Root ─────────────────────────────── */
#viewer {
    position: relative;
    width: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

/* ── Card container / card ───────────────────── */
.card-container {
    position: relative;
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
}

.card-container.fullscreen {
    max-width: 480px;
    width: 100%;
}

.card-container.fullscreen {
        max-width: 620px;
        height: 100dvh;
    }

.card {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #111;
    user-select: none;
    will-change: transform;
}

.card-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.card-image {
    position: absolute;
    top: 0;
    left: 50%;
    width: auto;
    height: 100%;
    transform: translateX(-50%);
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    background: #0a0a0a;
    opacity: 1;
    transition: opacity 0.15s ease;
}

/* Затемнение снизу под текст/кнопки */
.card-image-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* ── Distance badge ──────────────────────────── */
.card-distance {
    position: absolute;
    top: 16px;
    right: 16px;
    display: none; /* город сверху не показываем, он есть внизу под именем */
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10;
}

/* ── Photo dots (свои фото анкеты) ───────────── */
.card-dots {
    display: none;
}

.card-dot {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.35);
    transition: background 0.2s;
}

.card-dot.active {
    background: #fff;
}

/* ── Photo nav arrows ─────────────────────────── */
.card-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.card-nav-arrow:hover { opacity: 1; background: rgba(0,0,0,0.55); }
.card-nav-arrow.prev { left: 12px; }
.card-nav-arrow.next { right: 12px; }
.card-nav-arrow .icon {
    width: 20px; height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Action buttons (undo/nope/like/super) ───── */
.card-actions {
    position: absolute;
    bottom: 90px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 15;
    pointer-events: none; /* контейнер не перехватывает клики (иначе на десктопе перекрывает имя) */
}

.action-btn {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.15s, background 0.15s;
}

.action-btn:hover  { transform: scale(1.1); }
.action-btn:active { transform: scale(0.92); }

.action-btn .icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-undo   { width: 44px; height: 44px; color: #ffc44d; }
.btn-nope   { color: #ff4d6d; border: 2px solid rgba(255,77,109,0.5); }
.btn-like   { width: 62px; height: 62px; color: #4dffb0; border: 2px solid rgba(77,255,176,0.5); }
.btn-super  { width: 44px; height: 44px; color: #4dc4ff; }

/* ── Card info (имя / гор) ────────────────────── */
.card-info {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 16px;
    z-index: 10;
}

.card-name {
    display: inline-block;
    max-width: 100%;
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-name:hover { text-decoration: none; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    opacity: 0.70;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta .icon {
    stroke: currentColor;
    fill: none;
}

/* ── Empty state ──────────────────────────────── */
#viewer-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    text-align: center;
    padding: 40px;
}

#viewer-empty .empty-icon {
    opacity: 0.3;
}

#viewer-empty .empty-icon .icon {
    width: 64px;
    height: 64px;
    fill: currentColor;
    stroke: none;
}

/* ── Top bar ───────────────────────────────────── */
#viewer-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.vt-back {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    width: 36px;
    display: flex;
    align-items: center;
}

.vt-back .icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vt-logo {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 3px;
    opacity: 0.9;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff4d6d, #ff8fa3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vt-avatar-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.vt-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.4);
    transition: border-color 0.2s;
}

.vt-avatar-img:hover { border-color: #ff4d6d; }

.vt-avatar-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    color: #fff;
}

.vt-avatar-guest .icon {
    width: 22px;
    height: 22px;
}

/* ── Top progress dots (между анкетами) ──────── */
#viewer-progress {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 101;
}

.prog-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: background 0.2s, width 0.2s;
}

.prog-dot.active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

/* ── Like effect ──────────────────────────────── */
#like-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    color: #ff4d6d;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
}

#like-effect .icon {
    width: 100%;
    height: 100%;
}

#like-effect.pop { animation: likePop 0.55s ease forwards; }

@keyframes likePop {
    0%   { transform: translate(-50%,-50%) scale(0);   opacity: 1; }
    45%  { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(0.95); opacity: 0; }
}

/* ── Mobile ───────────────────────────────────── */
@media (max-width: 600px) {
    .card-container {
        max-width: none;
        width: 100vw;
    }

    .card-actions {
        gap: 24px;
        bottom: 100px;
    }

    .action-btn { width: 56px; height: 56px; }
    .btn-like   { width: 66px; height: 66px; }

    .card-name { font-size: 20px; }

    #like-effect { display: none; }
}

/* ── Desktop: белая рамка вокруг карточки, фото на всю карточку (cover),
   только 2 кнопки снизу по краям — как на референсе. Мобиль (≤600px)
   не трогаем, там своя тёмная fullscreen-версия. ────────────────── */
@media (min-width: 601px) {
    /* Фон умышленно остаётся чёрным (#0a0a0a у html/body, #000 у #viewer) —
       иначе при вылете карточки в сторону (свайп) на 350мс видна светлая
       вспышка вместо чёрного экрана */

    .card-container.fullscreen {
        max-width: 480px;
        height: min(760px, 86dvh);
    }

    .card {
        border-radius: 32px;
        box-shadow: 0 8px 32px rgba(15,76,129,0.08);
    }

    /* Город теперь показываем внизу (пин + текст), верхний бейдж не нужен */
    .card-distance { display: none; }

    /* На скрине только дизлайк/лайк, без undo и супер-лайка */
    .btn-undo,
    .btn-super { display: none; }

    .card-actions {
        justify-content: space-between;
        padding: 0 33%;
        bottom: 22px;
    }

    .action-btn { width: 68px; height: 68px; }
    .btn-like   { width: 78px; height: 78px; }

    .btn-nope {
        background: #ff4d6d;
        border: none;
        color: #fff;
    }

    .btn-like {
        background: #12a878;
        border: none;
        color: #fff;
    }

    /* Имя/город теперь не над кнопками, а между ними, на одной линии:
       слева — дизлайк, по центру — имя/город, справа — лайк. */
    .card-info {
        bottom: 22px;
        left: 120px;
        right: 120px;
        height: 78px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    /* Топбар и точки-прогресс на десктопе не нужны — перекрывали фото
       сверху. Убираем полностью, фото растягиваем от края до края. */
    #viewer-progress {
        display: none;
    }

    /* Топбар на десктопе: оставляем только кнопку «назад» */
    #viewer-topbar {
        background: none;
        justify-content: flex-start;
        pointer-events: none;
    }
    #viewer-topbar .vt-logo,
    #viewer-topbar .vt-avatar-link {
        display: none;
    }
    #viewer-topbar .vt-back {
        pointer-events: auto;
        height: 36px;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255,255,255,0.18);
        opacity: 1;
    }

    #viewer {
        align-items: stretch;
        justify-content: stretch;
    }

    .card-container.fullscreen {
        max-width: none;
        width: 100vw;
        height: 100dvh;
    }

    .card {
        border-radius: 0;
        box-shadow: none;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .card-actions {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
.vt-spacer {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}