.participants-hero,
.profile-hero {
    display: grid;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.participants-hero h1,
.profile-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(38px, 8vw, 72px);
    line-height: .94;
    letter-spacing: -.04em;
}

.participants-hero p,
.profile-hero p {
    max-width: 680px;
    color: var(--color-muted);
    line-height: 1.65;
}

.participants-total-card {
    display: grid;
    place-items: center;
    justify-self: start;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid rgba(212,175,55,.32);
    background: radial-gradient(circle, rgba(212,175,55,.18), rgba(255,255,255,.03));
    box-shadow: 0 0 54px rgba(212,175,55,.16);
}

.participants-total-card span {
    font-family: var(--font-display);
    font-size: 46px;
    line-height: 1;
    color: var(--color-gold-light);
}

.participants-total-card small {
    max-width: 98px;
    text-align: center;
    color: var(--color-muted);
    line-height: 1.25;
}

.empty-participants-state {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.participant-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.participant-card {
    padding: 0;
    overflow: hidden;
}

.participant-card-photo {
    display: grid;
    min-height: 280px;
    place-items: center;
    background: linear-gradient(145deg, rgba(212,175,55,.15), rgba(255,255,255,.025));
    border-bottom: 1px solid rgba(212,175,55,.18);
}

.participant-card-photo img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}

.participant-card-body {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.participant-card-body h2 {
    margin: 0;
    font-size: 24px;
}

.participant-card-body p {
    margin: 0;
}

.participant-location {
    color: var(--color-gold-light) !important;
    font-size: 14px;
}

.participant-initials {
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(212,175,55,.32);
    color: var(--color-gold-light);
    background: radial-gradient(circle, rgba(212,175,55,.18), rgba(255,255,255,.025));
    font-family: var(--font-display);
    letter-spacing: -.05em;
}

.participant-initials-large {
    width: 132px;
    height: 132px;
    font-size: 54px;
}

.profile-photo-frame {
    overflow: hidden;
    min-height: 420px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(212,175,55,.26);
    background: radial-gradient(circle at 50% 10%, rgba(212,175,55,.2), rgba(8,8,9,.72));
}

.profile-photo-frame img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.participant-initials-hero {
    width: 100%;
    min-height: 420px;
    border-radius: 0;
    font-size: clamp(72px, 20vw, 160px);
}

.profile-main-info {
    display: grid;
    gap: 14px;
    align-content: center;
}

.profile-phrase {
    color: var(--color-gold-light) !important;
    font-size: 22px;
}

.profile-meta-row,
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.profile-meta-row span {
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(212,175,55,.18);
    color: var(--color-muted);
    background: rgba(255,255,255,.025);
    font-size: 13px;
}

.profile-safe-note {
    font-size: 13px;
    color: var(--color-muted) !important;
}

.profile-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 18px;
}

.profile-about-card p {
    font-size: 16px;
}

.profile-answers-card,
.profile-gallery-card {
    margin-top: 18px;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.answer-card {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212,175,55,.16);
    background: rgba(255,255,255,.025);
}

.answer-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.answer-card p {
    margin: 0;
}

.profile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.profile-gallery-grid figure {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212,175,55,.16);
    background: rgba(255,255,255,.025);
}

.profile-gallery-grid img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.profile-gallery-grid figcaption,
.profile-video-box small {
    display: block;
    padding: 10px 12px;
    color: var(--color-muted);
    font-size: 13px;
}

.profile-video-box {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.profile-video-box video {
    width: 100%;
    max-height: 520px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212,175,55,.18);
    background: #000;
}

@media (min-width: 820px) {
    .participants-hero { grid-template-columns: minmax(0, 1fr) auto; }
    .profile-hero { grid-template-columns: minmax(300px, .75fr) minmax(0, 1fr); }
}

@media (max-width: 820px) {
    .profile-content-grid { grid-template-columns: 1fr; }
    .profile-photo-frame,
    .profile-photo-frame img,
    .participant-initials-hero { min-height: 340px; }
}

/* Не даем содержимому растягивать карточки шире экрана */
.participant-card,
.participant-card-body,
.profile-hero,
.profile-main-info,
.profile-content-grid,
.profile-about-card,
.profile-side-card {
    min-width: 0;
}

/* Перенос длинного имени, местоположения и текста без пробелов */
.participant-card-body h2,
.participant-card-body h2 a,
.participant-card-body p,
.participant-location,
.profile-main-info h1,
.profile-phrase,
.profile-meta-row span,
.profile-safe-note,
.profile-about-card p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Фото в списке участниц */
.participant-card-photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    min-height: 0;
    overflow: hidden;
}

.participant-card-photo img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center top;
}

/* Главное фото публичного профиля */
.profile-photo-frame {
    width: 100%;
    aspect-ratio: 4 / 5;
    min-height: 0;
}

.profile-photo-frame img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 820px) {
    .participant-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .participant-card {
        width: 100%;
        max-width: 100%;
    }

    .profile-photo-frame,
    .profile-photo-frame img,
    .participant-initials-hero {
        min-height: 0;
    }

    .profile-main-info h1 {
        font-size: clamp(34px, 10vw, 52px);
        line-height: 1;
    }

    .profile-phrase {
        font-size: 19px;
        line-height: 1.5;
    }

    .profile-meta-row {
        align-items: stretch;
    }

    .profile-meta-row span {
        width: fit-content;
        max-width: 100%;
        white-space: normal;
        line-height: 1.4;
    }

    .profile-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .profile-actions .btn,
    .participant-card-body .btn {
        width: 100%;
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
    }
}
/* =========================================================
   Публичный профиль — социальные сети
   ========================================================= */

.social-links-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.social-profile-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;

    width: 100%;
    padding: 12px 14px;

    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 16px;

    color: var(--color-text);
    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.08),
            rgba(255, 255, 255, 0.025)
        );

    text-decoration: none;

    transition:
        border-color 180ms ease,
        transform 180ms ease,
        background 180ms ease;
}

.social-profile-link:hover {
    border-color: rgba(235, 197, 91, 0.62);
    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.15),
            rgba(255, 255, 255, 0.04)
        );
    transform: translateY(-2px);
}

.social-profile-icon {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 50%;

    color: var(--color-gold-light);
    background: rgba(212, 175, 55, 0.08);

    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.social-profile-content {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.social-profile-content strong {
    color: var(--color-text);
}

.social-profile-content small {
    overflow: hidden;

    color: var(--color-muted);

    white-space: nowrap;
    text-overflow: ellipsis;
}

.social-profile-arrow {
    color: var(--color-gold-light);
    font-size: 22px;
}

.profile-public-details {
    margin-top: 20px;
}

.profile-public-details a {
    color: var(--color-gold-light);
    overflow-wrap: anywhere;
}


/* =========================================================
   Публичный профиль — горизонтальная медиалента
   ========================================================= */

.profile-gallery-card {
    position: relative;
    overflow: hidden;
}

.profile-media-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;

    margin-bottom: 18px;
}

.profile-media-heading h2 {
    margin-bottom: 6px;
}

.profile-media-heading p:last-child {
    margin: 0;
    color: var(--color-muted);
}

.profile-media-carousel {
    position: relative;
}

.profile-media-rail {
    display: flex;
    gap: 14px;

    width: 100%;
    padding: 2px 52px 10px;

    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;

    scrollbar-width: none;
}

.profile-media-rail::-webkit-scrollbar {
    display: none;
}

.media-tile {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;

    height: 270px;
    padding: 0;

    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at 50% 0,
            rgba(212, 175, 55, 0.16),
            rgba(5, 5, 5, 0.94)
        );

    cursor: pointer;
    scroll-snap-align: start;

    appearance: none;

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.media-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(244, 207, 103, 0.72);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.media-tile-video {
    width: min(480px, 48vw);
}

.media-tile-photo {
    width: min(230px, 25vw);
}

.media-tile img,
.media-tile video {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    pointer-events: none;
}

.media-tile-video video {
    background: #000;
}

.media-tile-shade {
    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        linear-gradient(
            180deg,
            transparent 52%,
            rgba(0, 0, 0, 0.78) 100%
        );

    pointer-events: none;
}

.media-tile-label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 2;

    overflow: hidden;

    color: #fff;

    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;

    pointer-events: none;
}

.media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;

    display: grid;
    place-items: center;

    width: 66px;
    height: 66px;

    border: 1px solid rgba(255, 239, 191, 0.66);
    border-radius: 50%;

    color: #17130b;
    background: rgba(255, 232, 170, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.44);

    font-size: 23px;

    transform: translate(-50%, -50%);

    pointer-events: none;
}

.media-duration {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;

    min-width: 48px;
    padding: 6px 8px;

    border-radius: 999px;

    color: #fff;
    background: rgba(0, 0, 0, 0.78);

    font-size: 12px;
    font-weight: 800;

    pointer-events: none;
}

.media-duration:empty {
    display: none;
}

.media-rail-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;

    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;
    padding: 0;

    border: 1px solid rgba(238, 200, 97, 0.62);
    border-radius: 50%;

    color: var(--color-gold-light);
    background: rgba(7, 7, 6, 0.94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.44);

    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);
}

.media-rail-arrow:hover {
    background: rgba(212, 175, 55, 0.18);
}

.media-rail-arrow-prev {
    left: 4px;
}

.media-rail-arrow-next {
    right: 4px;
}


/* =========================================================
   Полноэкранный просмотр медиа
   ========================================================= */

body.media-lightbox-open {
    overflow: hidden;
}

.media-lightbox[hidden] {
    display: none !important;
}

.media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 74px;
    gap: 14px;
    align-items: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(14px);
}

.media-lightbox-center {
    display: grid;
    gap: 12px;

    min-width: 0;
    max-height: 94vh;
}

.media-lightbox-stage {
    display: grid;
    place-items: center;

    min-width: 0;
    min-height: 0;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
    display: block;

    max-width: 100%;
    max-height: 82vh;

    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 16px;

    object-fit: contain;
    background: #000;

    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

.media-lightbox-stage video {
    width: min(1200px, 100%);
}

.media-lightbox-close {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: 20px;
    z-index: 10002;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 50%;

    color: #fff;
    background: rgba(15, 15, 15, 0.82);

    font-size: 34px;
    line-height: 1;

    cursor: pointer;
}

.media-lightbox-nav {
    display: grid;
    place-items: center;

    width: 56px;
    height: 56px;
    padding: 0;

    border: 1px solid rgba(212, 175, 55, 0.48);
    border-radius: 50%;

    color: var(--color-gold-light);
    background: rgba(10, 10, 9, 0.82);

    font-size: 42px;
    line-height: 1;

    cursor: pointer;
}

.media-lightbox-nav[hidden] {
    display: none !important;
}

.media-lightbox-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;

    color: var(--color-muted);

    font-size: 13px;
}


/* =========================================================
   Мобильная версия медиаленты
   ========================================================= */

@media (max-width: 760px) {
    .profile-gallery-card {
        padding-right: 0;
        padding-left: 0;
    }

    .profile-media-heading {
        padding-right: 18px;
        padding-left: 18px;
    }

    .profile-media-rail {
        gap: 10px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .media-tile {
        height: 235px;
    }

    .media-tile-video {
        width: 82vw;
        max-width: 430px;
    }

    .media-tile-photo {
        width: 56vw;
        max-width: 255px;
    }

    .media-rail-arrow {
        display: none;
    }

    .media-play-icon {
        width: 58px;
        height: 58px;
    }

    .media-lightbox {
        display: block;
        padding:
            max(72px, calc(env(safe-area-inset-top) + 60px))
            12px
            max(22px, env(safe-area-inset-bottom));
    }

    .media-lightbox-center {
        height: 100%;
        align-content: center;
    }

    .media-lightbox-stage img,
    .media-lightbox-stage video {
        max-height: 74vh;
        border-radius: 12px;
    }

    .media-lightbox-nav {
        position: fixed;
        top: 50%;
        z-index: 10001;

        width: 42px;
        height: 42px;

        font-size: 32px;

        transform: translateY(-50%);
    }

    .media-lightbox-prev {
        left: 8px;
    }

    .media-lightbox-next {
        right: 8px;
    }

    .media-lightbox-footer {
        padding: 0 8px;
    }
}