/* =========================================================
   TERRA ICON — Public profile
   Отдельные классы ti-* не конфликтуют со старыми стилями.
   ========================================================= */

.ti-profile-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 30px;
    background:
        radial-gradient(circle at 76% 14%, rgba(212, 175, 55, 0.10), transparent 34%),
        linear-gradient(180deg, rgba(13, 12, 10, 0.99), rgba(5, 5, 5, 0.99));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.ti-profile-toolbar {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    min-height: 76px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.20);
}

.ti-profile-back {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--color-gold-light);
    text-decoration: none;
    transition: background 180ms ease, transform 180ms ease;
}

.ti-profile-back:hover,
.ti-profile-back:focus-visible {
    background: rgba(212, 175, 55, 0.10);
    transform: translateX(-2px);
    outline: none;
}

.ti-profile-back svg {
    width: 26px;
    height: 26px;
}

.ti-profile-brand {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    min-width: 0;
    color: var(--color-gold-light);
    font-family: var(--font-display);
    letter-spacing: 0.08em;
}

.ti-profile-brand-mark {
    font-size: 24px;
}

.ti-profile-toolbar-space {
    width: 42px;
}

.ti-profile-hero {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    min-width: 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.ti-profile-main-photo {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 440px;
    overflow: hidden;
    border-right: 1px solid rgba(212, 175, 55, 0.18);
    background:
        radial-gradient(circle at 50% 18%, rgba(212, 175, 55, 0.24), rgba(5, 5, 5, 0.92) 66%);
}

.ti-profile-main-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 60%, rgba(5, 5, 5, 0.45) 100%);
    pointer-events: none;
}

.ti-profile-main-photo img {
    width: 100%;
    height: 100%;
    min-height: 440px;
    object-fit: cover;
    object-position: center top;
}

.ti-profile-initials {
    color: var(--color-gold-light);
    font-family: var(--font-display);
    font-size: clamp(72px, 11vw, 132px);
}

.ti-profile-intro {
    display: grid;
    align-content: center;
    gap: 18px;
    min-width: 0;
    padding: 38px;
}

.ti-profile-intro h1 {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: clamp(44px, 6vw, 72px);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.ti-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.ti-profile-badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 9px;
    color: var(--color-muted);
    background: rgba(255, 255, 255, 0.025);
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ti-profile-badges svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--color-gold-light);
}

.ti-profile-active {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
}

.ti-profile-active > span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #35d676;
    box-shadow: 0 0 14px rgba(53, 214, 118, 0.65);
}

.ti-profile-quote {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 18px 20px;
    border: 1px solid rgba(212, 175, 55, 0.30);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(255, 255, 255, 0.015));
}

.ti-profile-quote > span {
    color: var(--color-gold-light);
    font-family: var(--font-display);
    font-size: 34px;
    line-height: 0.8;
}

.ti-profile-quote p {
    margin: 0;
    color: var(--color-gold-light);
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 30px);
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

.ti-profile-details {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 18px;
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.ti-profile-about-social {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.ti-profile-about h2,
.ti-profile-socials h2,
.ti-profile-media-section h2,
.ti-profile-community h2,
.ti-profile-duel-cta h2 {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-display);
    font-weight: 500;
}

.ti-profile-about h2,
.ti-profile-socials h2,
.ti-profile-media-section h2 {
    font-size: 28px;
}

.ti-profile-about p {
    margin: 10px 0 0;
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.ti-profile-social-list {
    display: grid;
    gap: 9px;
    margin-top: 12px;
}

.ti-profile-social-list a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 14px;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.022);
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.ti-profile-social-list a:hover,
.ti-profile-social-list a:focus-visible {
    border-color: rgba(235, 197, 91, 0.56);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.ti-social-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(212, 175, 55, 0.26);
    border-radius: 12px;
    color: var(--color-gold-light);
    background: rgba(212, 175, 55, 0.06);
}

.ti-social-icon svg {
    width: 23px;
    height: 23px;
}

.ti-profile-social-list a > span:nth-child(2) {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.ti-profile-social-list strong,
.ti-profile-social-list small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ti-profile-social-list small {
    color: var(--color-muted);
}

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

.ti-profile-community {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.18), transparent 44%),
        rgba(255, 255, 255, 0.018);
}

.ti-community-crown {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    margin: 0 auto;
    color: var(--color-gold-light);
}

.ti-community-crown svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.20));
}

.ti-profile-community h2 {
    font-size: 25px;
    text-align: center;
}

.ti-profile-community dl {
    display: grid;
    gap: 14px;
    margin: 0;
}

.ti-profile-community dl > div {
    display: grid;
    gap: 2px;
}

.ti-profile-community dt {
    color: var(--color-muted);
	text-align: center;
    font-size: 12px;
}

.ti-profile-community dd {
    margin: 0;
	text-align: center;
    color: var(--color-gold-light);
    font-family: var(--font-display);
    font-size: 36px;
    line-height: 1;
}

.ti-profile-community > p {
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.55;
}

.ti-profile-support-wrap {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.ti-profile-support-wrap form {
    margin: 0;
}

.ti-profile-support-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 14px 20px;
    border: 1px solid rgba(244, 207, 103, 0.72);
    border-radius: 14px;
    color: #231705;
    background:
        linear-gradient(135deg, #fff0bd, #dfaa51 52%, #a9681e);
    box-shadow: 0 13px 32px rgba(173, 105, 25, 0.18);
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, filter 180ms ease;
}

.ti-profile-support-button:hover,
.ti-profile-support-button:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.06);
    outline: none;
}

.ti-profile-support-button svg {
    width: 27px;
    height: 27px;
}

.ti-profile-support-button.is-supported,
.ti-profile-support-button.is-disabled {
    color: var(--color-gold-light);
    background: rgba(212, 175, 55, 0.08);
    cursor: default;
    box-shadow: none;
}

.ti-profile-support-button.is-supported:hover,
.ti-profile-support-button.is-disabled:hover {
    transform: none;
    filter: none;
}

.ti-profile-media-section {
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.ti-profile-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.ti-media-controls {
    display: flex;
    gap: 8px;
}

.ti-media-controls button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 50%;
    color: var(--color-gold-light);
    background: rgba(0, 0, 0, 0.42);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.ti-media-gallery {
    overflow: hidden;
}

.ti-media-rail {
    display: flex;
    gap: 12px;
    width: 100%;
    padding-bottom: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

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

.ti-media-item {
    position: relative;
    flex: 0 0 auto;
    height: 230px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    scroll-snap-align: start;
    appearance: none;
    transition: border-color 180ms ease, transform 180ms ease;
}

.ti-media-item:hover,
.ti-media-item:focus-visible {
    border-color: rgba(244, 207, 103, 0.68);
    transform: translateY(-2px);
    outline: none;
}

.ti-media-item.is-video {
    width: min(410px, 56vw);
}

.ti-media-item.is-photo {
    width: min(200px, 28vw);
}

.ti-media-item img,
.ti-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.ti-media-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.ti-media-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(255, 244, 213, 0.72);
    border-radius: 50%;
    color: #17110a;
    background: rgba(255, 236, 186, 0.92);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
    font-size: 21px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ti-media-duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    min-width: 47px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.76);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    pointer-events: none;
}

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

.ti-profile-empty-media {
    padding: 22px;
    border: 1px dashed rgba(212, 175, 55, 0.24);
    border-radius: 16px;
    color: var(--color-muted);
    text-align: center;
}

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

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

.ti-media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    gap: 16px;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(14px);
}

.ti-lightbox-center {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.ti-lightbox-stage {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
}

.ti-lightbox-stage img,
.ti-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 25px 90px rgba(0, 0, 0, 0.72);
}

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

.ti-lightbox-close {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: 18px;
    z-index: 10003;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 15, 15, 0.86);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.ti-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.86);
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

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

.ti-lightbox-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--color-muted);
    font-size: 13px;
}

.ti-profile-duel-cta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(212, 175, 55, 0.07), rgba(255, 255, 255, 0.015));
}

.ti-duel-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 18px;
    color: var(--color-gold-light);
    background: rgba(212, 175, 55, 0.05);
}

.ti-duel-icon svg {
    width: 42px;
    height: 42px;
}

.ti-profile-duel-cta h2 {
    font-size: 25px;
}

.ti-profile-duel-cta p {
    margin: 6px 0 0;
    color: var(--color-muted);
    line-height: 1.55;
}

.ti-profile-duel-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid rgba(244, 207, 103, 0.72);
    border-radius: 13px;
    color: #231705;
    background: linear-gradient(135deg, #fff0bd, #dba349 55%, #9e641f);
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 760px) {
    .ti-profile-shell {
        border-radius: 24px;
    }

    .ti-profile-toolbar {
        min-height: 66px;
        padding: 0 14px;
    }

    .ti-profile-brand {
        font-size: 14px;
    }

    .ti-profile-hero {
        grid-template-columns: minmax(128px, 0.82fr) minmax(0, 1.18fr);
    }

    .ti-profile-main-photo {
        min-height: 320px;
    }

    .ti-profile-main-photo img {
        min-height: 320px;
    }

    .ti-profile-intro {
        gap: 12px;
        padding: 20px 14px;
    }

    .ti-profile-intro h1 {
        font-size: clamp(32px, 10vw, 47px);
    }

    .ti-profile-badges {
        gap: 6px;
    }

    .ti-profile-badges span {
        padding: 6px 7px;
        font-size: 10px;
    }

    .ti-profile-badges svg {
        width: 13px;
        height: 13px;
    }

    .ti-profile-active {
        font-size: 11px;
    }

    .ti-profile-quote {
        gap: 6px;
        padding: 12px 10px;
        border-radius: 13px;
    }

    .ti-profile-quote > span {
        font-size: 23px;
    }

    .ti-profile-quote p {
        font-size: 15px;
        line-height: 1.35;
    }

    .ti-profile-details {
        grid-template-columns: minmax(0, 1.22fr) minmax(130px, 0.78fr);
        gap: 12px;
        padding: 18px;
    }

    .ti-profile-about-social {
        gap: 18px;
    }

    .ti-profile-about h2,
    .ti-profile-socials h2,
    .ti-profile-media-section h2 {
        font-size: 23px;
    }

    .ti-profile-about p {
        font-size: 13px;
        line-height: 1.6;
    }

    .ti-profile-social-list a {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 9px;
    }

    .ti-social-icon {
        width: 36px;
        height: 36px;
    }

    .ti-social-icon svg {
        width: 20px;
        height: 20px;
    }

    .ti-profile-social-list strong {
        font-size: 12px;
    }

    .ti-profile-social-list small {
        font-size: 10px;
    }

    .ti-profile-community {
        gap: 11px;
        padding: 14px;
        border-radius: 17px;
    }

    .ti-community-crown {
        width: 52px;
        height: 52px;
    }

    .ti-community-crown svg {
        width: 50px;
        height: 50px;
    }

    .ti-profile-community h2 {
        font-size: 17px;
    }

    .ti-profile-community dd {
        font-size: 29px;
    }

    .ti-profile-community > p {
        font-size: 10px;
    }

    .ti-profile-support-wrap {
        padding: 0 18px 18px;
    }

    .ti-profile-support-button {
        min-height: 53px;
        font-size: 15px;
    }

    .ti-profile-media-section {
        padding: 18px;
    }

    .ti-media-controls {
        display: none;
    }

    .ti-media-item {
        height: 185px;
    }

    .ti-media-item.is-video {
        width: 72vw;
        max-width: 350px;
    }

    .ti-media-item.is-photo {
        width: 42vw;
        max-width: 190px;
    }

    .ti-media-play {
        width: 54px;
        height: 54px;
    }

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

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

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

    .ti-lightbox-nav {
        position: fixed;
        top: 50%;
        z-index: 10002;
        width: 42px;
        height: 42px;
        font-size: 32px;
        transform: translateY(-50%);
    }

    .ti-lightbox-nav.is-prev {
        left: 8px;
    }

    .ti-lightbox-nav.is-next {
        right: 8px;
    }

    .ti-profile-duel-cta {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 12px;
        padding: 18px;
    }

    .ti-duel-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .ti-duel-icon svg {
        width: 34px;
        height: 34px;
    }

    .ti-profile-duel-cta h2 {
        font-size: 20px;
    }

    .ti-profile-duel-cta p {
        font-size: 12px;
    }

    .ti-profile-duel-button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 380px) {
    .ti-profile-hero {
        grid-template-columns: 1fr;
    }

    .ti-profile-main-photo {
        min-height: 420px;
        border-right: 0;
        border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    }

    .ti-profile-main-photo img {
        min-height: 420px;
    }

    .ti-profile-details {
        grid-template-columns: 1fr;
    }
}
