/* ---------- vir-chat nickname designer (fns/vc/nick_style.php, nick_style.js) ---------- */
.vc_ns,
.vcns_on_light {
    --ns-c1: var(--ns-c1-l);
    --ns-c2: var(--ns-c2-l);
}

body.dark_mode .vc_ns,
body .main .chatbox[group_id="34"] .vc_ns,
body .main .chatbox[group_id="44"] .vc_ns {
    --ns-c1: var(--ns-c1-d);
    --ns-c2: var(--ns-c2-d);
}

.vcns_on_dark {
    --ns-c1: var(--ns-c1-d);
    --ns-c2: var(--ns-c2-d);
}

/*
 * A saved style replaces whatever else paints this nickname: the rules by role colour and by user id in
 * custom_css.css (those stay for anyone with no saved style) and the shimmer of theme.css.
 * The letters are on .vcns_txt, the glow on the .vcns_hold around it, so it stays behind them and never smears over them.
 */
html body .main .chatbox > .contents > .chat_messages > ul > li.vc_vip_nick.vc_ns > div > .right > .header > .send_by,
html body .main .aside .records .list > .site_record_item.vc_vip_nick.vc_ns > div > .center > .title > .text,
.vcns_nick {
    position: relative;
    color: var(--ns-c1) !important;
    background-image: none;
    -webkit-text-fill-color: currentColor;
    text-shadow: none;
    filter: none;
    animation: none;
    overflow: visible;
    letter-spacing: normal;
    font-style: normal;
    transform: none;
}

/* the blink and the diamonds of custom_css.css; the gender icon before a name in lists is a ::before and stays */
html body .main .chatbox > .contents > .chat_messages > ul > li.vc_vip_nick.vc_ns > div > .right > .header > .send_by::before,
html body .main .chatbox > .contents > .chat_messages > ul > li.vc_vip_nick.vc_ns > div > .right > .header > .send_by::after,
html body .main .aside .records .list > .site_record_item.vc_vip_nick.vc_ns > div > .center > .title > .text::after {
    content: none !important;
    display: none !important;
}

.vc_ns .vcns_hold,
.vcns_nick .vcns_hold {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: bottom;
    white-space: nowrap;
    /* room for the glow; a long nick still ends in "..." */
    overflow: hidden;
    overflow: clip;
    overflow-clip-margin: 24px;
    text-overflow: ellipsis;
}

.vc_gender_m .vcns_hold,
.vc_gender_f .vcns_hold,
.vc_gender_t .vcns_hold {
    max-width: calc(100% - 20px);
}

.vcns_txt {
    position: relative;
}

.vc_ns .vcns_txt,
.vcns_nick .vcns_txt {
    background-image: linear-gradient(var(--ns-dir), var(--ns-c1), var(--ns-c2), var(--ns-c1), var(--ns-c2), var(--ns-c1));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: vcns_roll var(--ns-dur) linear infinite;
}

.vc_ns .vcns_hold::before,
.vcns_nick .vcns_hold::before {
    content: attr(data-nick);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    overflow: clip;
    overflow-clip-margin: 24px;
    text-overflow: ellipsis;
    pointer-events: none;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 var(--ns-b1) var(--ns-gc), 0 0 var(--ns-b2) var(--ns-gc);
    opacity: var(--ns-glow);
    animation: vcns_pulse var(--ns-dur) ease-in-out infinite;
}

@keyframes vcns_roll {
    from {
        background-position: 0 0;
    }
    to {
        background-position: var(--ns-x) var(--ns-y);
    }
}

@keyframes vcns_pulse {
    0%, 100% {
        opacity: var(--ns-glow);
    }
    50% {
        opacity: calc(var(--ns-glow) * .35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vc_ns .vcns_txt,
    .vcns_nick .vcns_txt,
    .vc_ns .vcns_hold::before,
    .vcns_nick .vcns_hold::before {
        animation: none;
    }
}

/* ---------- the editor ---------- */
/* class names of its own: gallery.js listens for clicks on its upload dialog's buttons by theirs */
.vcns_box {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 16px 0;
    color: #fff;
    background: rgba(8, 8, 12, .94);
}

.vcns_box.open {
    display: flex;
}

.vcns_title {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.vcns_card {
    width: min(420px, calc(100vw - 32px));
    margin: auto;
    padding: 18px;
    border-radius: 16px;
    color: #222;
    background: #fff;
    font-size: 14px;
}

body.dark_mode .vcns_card {
    color: #F3E9F7;
    background: #1C1222;
}

.vcns_previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.vcns_preview {
    min-width: 0;
    padding: 8px 12px 14px;
    border-radius: 12px;
    overflow: hidden;
}

.vcns_preview small {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    opacity: .7;
}

.vcns_on_light {
    color: #222;
    background: #FFF4F8;
}

.vcns_on_dark {
    color: #eee;
    background: #1D0E22;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.vcns_nick {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.vcns_presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.vcns_preset {
    border: 1px solid rgba(127, 127, 140, .35);
    border-radius: 999px;
    padding: 4px 12px;
    color: inherit;
    background: none;
    font-size: 13px;
    cursor: pointer;
}

.vcns_switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 8px;
    font-weight: 700;
    cursor: pointer;
}

.vcns_switch input {
    width: 18px;
    height: 18px;
    accent-color: #E91E63;
}

.vcns_row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.vcns_color {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.vcns_color input {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(127, 127, 140, .35);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.vcns_label {
    display: block;
    margin-bottom: 4px;
}

.vcns_dir_block {
    margin-top: 10px;
}

.vcns_compass {
    display: grid;
    grid-template-columns: repeat(3, 36px);
    grid-auto-rows: 36px;
    gap: 4px;
}

.vcns_dir {
    border: 1px solid rgba(127, 127, 140, .35);
    border-radius: 8px;
    color: inherit;
    background: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.vcns_dir.active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #FF5C9D, #8E5CFF);
}

.vcns_slider {
    display: block;
    margin-top: 10px;
}

.vcns_slider input {
    width: 100%;
    accent-color: #E91E63;
}

.vcns_for_motion {
    margin-bottom: 10px;
}

.vcns_status {
    min-height: 20px;
    margin: 10px 0;
    font-size: 14px;
}

.vcns_status.error {
    color: #d32f2f;
}

.vcns_buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.vcns_buttons button {
    border: 0;
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
}

.vcns_buttons button:disabled {
    opacity: .5;
}

.vcns_reset,
.vcns_close {
    color: #444;
    background: rgba(127, 127, 140, .16);
}

body.dark_mode .vcns_reset,
body.dark_mode .vcns_close {
    color: #E9D8F0;
}

.vcns_save {
    color: #fff;
    background: linear-gradient(135deg, #FF5C9D, #8E5CFF);
}
