.profile-studio [hidden] {
    display: none !important;
}

.profile-style-preview,
.friend-profile-hero {
    background-image:
        linear-gradient(90deg, rgba(4, 6, 5, .94), rgba(4, 6, 5, .63) 40%, transparent 76%),
        linear-gradient(0deg, rgba(4, 6, 5, .67), transparent 60%),
        var(--profile-bg) !important;
    background-size: auto, auto, cover !important;
}

.profile-studio .profile-style-preview {
    min-height: clamp(205px, 27vw, 310px);
    margin: 24px 0 18px;
    gap: clamp(18px, 4vw, 38px);
    padding: clamp(20px, 5vw, 54px);
}

.profile-studio .profile-studio-identity {
    min-width: 0;
    justify-items: start;
    gap: 10px;
}

.profile-studio #profile-preview-name {
    font-size: clamp(26px, 6vw, 56px);
    text-transform: none;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 15px #000;
}

.profile-studio .profile-studio-identity small {
    color: #f2dbc0;
    text-shadow: 0 1px 6px #000;
}

.profile-studio .friend-membership-chip {
    background: rgba(10, 10, 10, .82);
}

.profile-studio-toolbar,
.profile-studio-tabs,
.profile-studio-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.profile-studio-toolbar {
    justify-content: space-between;
}

.profile-studio-tabs {
    padding: 4px;
    border: 1px solid #2c2d24;
    border-radius: 13px;
    background: #0b0b0b;
}

.profile-studio :is([data-studio-tab], [data-studio-motion], [data-profile-preset]) {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #d7d5cb;
    font: 700 .82rem/1.2 Inter, sans-serif;
}

.profile-studio [data-studio-tab][aria-selected="true"],
.profile-studio :is([data-studio-motion], [data-profile-preset]):hover {
    border-color: #775a2f;
    color: #ffe6ad;
    background: #292114;
}

.profile-studio :is([data-studio-motion], [data-profile-preset]) {
    border-color: #3a3325;
    background: #191912;
}

.profile-studio button:focus-visible,
.profile-studio .profile-style-option:focus-within {
    outline: 2px solid #ffdc91;
    outline-offset: 2px;
}

.profile-studio-presets {
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #534022;
    border-radius: 13px;
    background: linear-gradient(110deg, #241c10, #14120f);
}

.profile-studio-presets > span {
    padding-inline: 4px;
    color: #f2d19b;
    font-size: .8rem;
    font-weight: 800;
}

.profile-studio [data-profile-preset] {
    min-height: 36px;
}

.profile-studio [data-profile-preset^="cosmic"] {
    border-color: #8d6423;
    color: #f9dfad;
    background: #1f1d1a;
}

.profile-studio .profile-style-fieldset {
    min-width: 0;
    margin-top: 20px;
}

body.page-ajustes .profile-studio .profile-style-options {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
    gap: 12px !important;
}

.profile-studio .profile-style-option {
    gap: 5px;
    padding: 8px;
    background: linear-gradient(160deg, #191a15, #12100d);
}

.profile-studio .profile-style-option:not(.locked):hover {
    border-color: #b58d51;
}

.profile-studio .profile-style-option.locked {
    opacity: 1;
}

.profile-studio .profile-style-option.locked > b {
    top: 13px;
    right: 13px;
    width: auto;
    transform: none;
    padding: 3px 6px;
    border: 1px solid #685633;
    border-radius: 6px;
    background: rgba(12, 13, 11, .91);
    color: #ffdf9e;
}

.profile-studio .profile-style-option.is-selected::after {
    content: "✓";
    position: absolute;
    z-index: 1;
    top: 13px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #20190d;
    background: #f2cf83;
    font-size: 13px;
    font-weight: 900;
}

.profile-studio .profile-style-option > strong {
    padding-inline: 3px;
    font-size: .83rem;
}

.profile-studio .studio-tier {
    justify-self: start;
    margin-inline: 3px;
    color: #b7b8ae;
    font-size: .63rem;
    letter-spacing: .08em;
}

.profile-studio .studio-tier.rank-1 { color: #88debd; }
.profile-studio .studio-tier.rank-2 { color: #c9b2ff; }
.profile-studio .studio-tier.rank-3 { color: #ffd286; }

.profile-studio .profile-style-swatch {
    position: relative;
    isolation: isolate;
    min-height: clamp(84px, 10vw, 116px);
    border: 1px solid rgba(255, 255, 255, .08);
}

.profile-studio .profile-style-swatch.background {
    background-size: cover !important;
    filter: none;
    transform: none;
}

.profile-studio .studio-frame-swatch {
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--swatch-tone) 26%, #0b100d), #10130f 74%);
}

.profile-studio .studio-avatar-sample {
    display: block;
    position: relative;
    width: 53px;
    height: 53px;
}

.profile-studio .studio-avatar-sample img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.social-avatar-frame,
.social-avatar-frame::before,
.social-avatar-frame::after,
.social-avatar-frame > img,
.social-avatar-frame > .presence-avatar {
    border-radius: 50%;
}

.profile-studio .studio-effect-swatch {
    background: radial-gradient(ellipse at center, #211b12, #100e0b 75%);
}

.profile-studio .studio-effect-swatch > i {
    position: absolute;
    inset-inline-start: 8px;
    inset-block-end: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid #e6c17942;
    border-radius: 7px;
    background: #100e0bdd;
    color: #f7deb0;
    font-size: 12px;
}

.profile-studio .studio-effect-swatch .profile-style-particles {
    position: absolute;
    display: block;
    inset: 0;
}

.tdl-profile-fx.profile-effect-storm {
    --tdl-fx-art: url('/img/profile_effects/ancestral-trail.svg');
    --tdl-fx-tint: #f3ca77;
    --tdl-fx-haze: #a87334;
    --tdl-fx-drift: -.9%, -1.8%;
    --tdl-fx-speed: 13s;
}

/* Compact portraits used to render the legacy rain layer. */
.social-avatar-frame.social-effect-storm > .social-avatar-motion {
    display: none;
}

.social-avatar-frame.social-effect-storm:not(.tdl-profile-fx *)::after {
    border-color: #ebbb674f;
    box-shadow: 0 0 14px #c98c394a;
}

.tdl-profile-fx.profile-effect-energy {
    --tdl-fx-art: url('/img/profile_effects/prime.svg');
    --tdl-fx-tint: #83e1ef;
    --tdl-fx-haze: #227d9c;
    --tdl-fx-drift: -1.7%, -.8%;
    --tdl-fx-speed: 12s;
}

.tdl-profile-fx.profile-effect-toxic {
    --tdl-fx-art: url('/img/profile_effects/toxic.svg');
    --tdl-fx-tint: #cbd990;
    --tdl-fx-haze: #728948;
    --tdl-fx-drift: 2.4%, -.7%;
    --tdl-fx-speed: 16s;
}

.tdl-profile-fx.profile-effect-aurora {
    --tdl-fx-art: url('/img/profile_effects/aurora-v2.svg');
    --tdl-fx-tint: #f0d499;
    --tdl-fx-haze: #997243;
    --tdl-fx-drift: -1.1%, .9%;
    --tdl-fx-speed: 21s;
}

.tdl-profile-fx.profile-effect-void {
    --tdl-fx-art: url('/img/profile_effects/void.svg');
    --tdl-fx-tint: #d4b3ff;
    --tdl-fx-haze: #7c42a6;
    --tdl-fx-drift: 2%, -.6%;
    --tdl-fx-speed: 17s;
}

.tdl-profile-fx.profile-background-horizon.profile-effect-void {
    --tdl-fx-art: url('/img/profile_effects/void-horizon.svg');
}

/* One effect treatment for the preview, public profile and catalog sample. */
.tdl-profile-effect-drawing,
.tdl-profile-effect-halo { display: none; }

.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) > .profile-style-particles {
    inset: 0;
    z-index: 1;
    mask-image: linear-gradient(90deg, transparent 31%, #000 65%);
}

.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) .tdl-profile-effect-drawing {
    display: block;
    position: absolute;
    inset: -8% -4% -8% 31%;
    background: var(--tdl-fx-art) center right / cover no-repeat;
    opacity: .84;
    animation: tdlProfileEffectDrift var(--tdl-fx-speed) ease-in-out infinite alternate;
}

.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) > .profile-style-particles::before,
.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) > .profile-style-particles::after {
    content: none;
}

.studio-effect-swatch.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) > .profile-style-particles {
    mask-image: none;
}

.studio-effect-swatch.tdl-profile-fx .tdl-profile-effect-drawing {
    inset: -3%;
    background-position: center;
    opacity: 1;
    animation-play-state: paused;
}

.profile-style-option:is(:hover,:focus-within) .studio-effect-swatch.tdl-profile-fx .tdl-profile-effect-drawing {
    animation-play-state: running;
}

.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) .social-avatar-motion {
    display: none;
}

.tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void) .tdl-profile-effect-halo {
    display: block;
    position: absolute;
    inset: -9px;
    z-index: 0;
    border-radius: inherit;
    border: 1px solid color-mix(in srgb, var(--tdl-fx-tint) 56%, transparent);
    box-shadow: 0 0 17px color-mix(in srgb, var(--tdl-fx-haze) 75%, transparent),
        inset 0 0 11px color-mix(in srgb, var(--tdl-fx-tint) 34%, transparent);
    pointer-events: none;
    opacity: .7;
    animation: tdlProfileEffectHalo var(--tdl-fx-speed) ease-in-out infinite alternate;
}

@keyframes tdlProfileEffectDrift {
    to { transform: translate(var(--tdl-fx-drift)) scale(1.045); opacity: .67; }
}

@keyframes tdlProfileEffectHalo {
    to { transform: scale(1.04); opacity: .42; }
}

@media (max-width: 650px) {
    .tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void):not(.studio-effect-swatch) > .profile-style-particles {
        mask-image: linear-gradient(90deg, transparent 10%, #000 89%);
        opacity: .72;
    }

    .tdl-profile-fx:is(.profile-effect-storm,.profile-effect-energy,.profile-effect-toxic,.profile-effect-aurora,.profile-effect-void):not(.studio-effect-swatch) .tdl-profile-effect-drawing {
        inset-inline-start: 10%;
    }
}

.studio-motion-paused *,
.studio-motion-paused *::before,
.studio-motion-paused *::after {
    animation-play-state: paused !important;
}

@media (max-width: 550px) {
    .profile-studio .profile-studio-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 3px;
    }

    .profile-studio [data-studio-tab] {
        padding-inline: 5px;
    }

    body.page-ajustes .profile-studio .profile-style-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tdl-profile-fx > .profile-style-particles::before,
    .tdl-profile-fx > .profile-style-particles::after,
    .tdl-profile-fx .social-avatar-motion,
    .tdl-profile-effect-drawing,
    .tdl-profile-effect-halo,
    .profile-studio *,
    .profile-studio *::before,
    .profile-studio *::after {
        animation: none !important;
        transition: none !important;
    }
}
.tdl-player-rank {
    --tdl-rank-color: #bfb39a;
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--tdl-rank-color);
    background: none;
    font: 700 10px/1.2 Inter, Arial, sans-serif;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    vertical-align: middle;
}
.tdl-player-rank[data-rank="1"] { --tdl-rank-color: #dfd2ae; }
.tdl-player-rank[data-rank="2"] { --tdl-rank-color: #ddb98a; }
.tdl-player-rank[data-rank="3"] { --tdl-rank-color: #e5c283; }
.tdl-player-rank[data-rank="4"] { --tdl-rank-color: #eed294; }
.tdl-player-rank[data-rank="5"] { --tdl-rank-color: #ffdb81; }
:is(.friends-card-name, .friend-row-main, .friend-request-row, .friends-search-row) .tdl-player-rank {
    display: inline-block;
    margin: 3px 0 0;
    color: var(--tdl-rank-color);
    font: 700 10px/1.2 Inter, Arial, sans-serif;
}
.friend-profile-copy > .tdl-player-rank { margin-inline-start: 8px; font-size: 12px; }
.tdl-player-mini-portrait {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--tdl-portrait-size, 36px);
    height: var(--tdl-portrait-size, 36px);
    border-radius: 50%;
    background: #171510;
}
.tdl-player-mini-portrait > img {
    width: 100%;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    object-fit: cover;
}
.tdl-player-mini-portrait.social-avatar-frame::before { inset: -2px; padding: 2px; animation: none; }
.tdl-player-mini-portrait.social-avatar-frame::after { display: none; }
.tdl-player-list-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}
.tdl-player-list-name { display: grid; justify-items: start; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
:is(.sky-place, .hunt-podium) .tdl-player-mini-portrait { --tdl-portrait-size: 46px; }
:is(.sky-pilot, .sky-rank) .tdl-player-mini-portrait { --tdl-portrait-size: 29px; }
.hh-page #participantes .hh-participants {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #a1803f #151310;
}
.hh-page .hh-player-copy > .tdl-player-rank {
    display: inline-flex;
    margin-top: 3px;
    color: var(--tdl-rank-color);
    font-size: 9px !important;
}
.hh-page .hh-participants .tdl-player-mini-portrait { --tdl-portrait-size: 30px; }
:is(.hunt-rank, .hunt-podium, .sky-place, .sky-pilot, .sky-rank, .ranking-row-player) .tdl-player-rank {
    color: var(--tdl-rank-color);
    font: 750 9px/1.15 Inter, Arial, sans-serif;
}
.sky-place .tdl-player-list-name { justify-items: center; }
