/* ===== Duel poll (public poll page): before voting + results. Values follow the approved design. ===== */
.duel-wrap {
    --duel-ink: #0f1536;
    --duel-ink2: #3c4368;
    --duel-line: #dce0f0;
    --duel-line2: #c3c8df;
    --duel-soft: #f7f8fd;
    --duel-brand: #4f46e5;
    --duel-brand2: #6366f1;
    --duel-brand-soft: #eef0ff;
    width: 100%;
    margin: 19px 0 6px;     /* a little air above the pictures */
    font-family: "Noto Sans", "Inter", sans-serif;
    color: var(--duel-ink);
}

.duel-wrap .duel-grid {
    container-type: inline-size;
    position: relative;
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    margin-bottom: 8px;
}

.duel-wrap .duel-opt {
    position: relative;
    min-width: 0;
    cursor: pointer;
    outline: none;
}

.duel-wrap.no-hover .duel-opt,
.duel-wrap.duel-results .duel-opt {
    cursor: default;
}

.duel-wrap .duel-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 12px;
    background: var(--duel-soft);
}

.duel-wrap .duel-img > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.duel-wrap .duel-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(15, 21, 54, .62);
    color: #fff;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.duel-wrap .duel-expand:hover {
    background: rgba(15, 21, 54, .85);
    color: #fff;
}

/* VS badge: centred on the pictures */
.duel-wrap .duel-vs {
    position: absolute;
    left: 50%;
    top: calc(((100cqw - 6px) / 2) * .625);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF5A1F, #4F46E5);
    box-shadow: 0 6px 14px -4px rgba(15, 21, 54, .45);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    transform: translate(-50%, -50%);
}

/* ---- before voting: answer buttons ---- */
.duel-wrap .duel-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    padding: 0 10px;
    border: 1.5px solid var(--duel-line2);
    border-radius: 12px;
    background: #fff;
    color: var(--duel-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    transition: .15s;
}

.duel-wrap .duel-nfm {
    height: auto;
    min-height: 48px;
    margin-top: 8px;
    padding: 10px 14px;
    border-style: dashed;
    color: var(--duel-ink2);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}

.duel-wrap .duel-nfm b {
    font-weight: 700;
}

.duel-wrap.no-hover .duel-nfm {
    cursor: default;
}

.duel-wrap:not(.no-hover) .duel-opt:hover .duel-label,
.duel-wrap:not(.no-hover) .duel-nfm:hover {
    border-color: var(--duel-brand2);
    background: var(--duel-brand-soft);
    color: var(--duel-brand);
}

.duel-wrap .duel-opt.is-picked .duel-label,
.duel-wrap .duel-nfm.is-picked,
.duel-wrap .duel-opt.is-mine .duel-label,
.duel-wrap .duel-nfm.is-mine {
    border-color: var(--duel-brand);
    background: var(--duel-brand-soft);
    color: var(--duel-brand);
    box-shadow: 0 0 0 1px var(--duel-brand);
}

/* ---- results: bar under the picture (desktop) ---- */
.duel-wrap .duel-strip,
.duel-wrap .duel-vbar,
.duel-wrap .duel-cap {
    display: none;
}

.duel-wrap .duel-hbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    margin-top: 6px;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid var(--duel-line);
    border-radius: 12px;
    background: var(--duel-soft);
    text-align: left;
}

.duel-wrap .duel-hbar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--p);
    background: rgba(100, 107, 144, .18);
}

/* winning option: soft indigo tint */
.duel-wrap .duel-hbar.is-lead::before {
    background: rgba(99, 102, 241, .22);
}

.duel-wrap .duel-hbar > * {
    position: relative;
}

.duel-wrap .duel-hbar.is-voted {
    border-color: #7f78ee;
    box-shadow: 0 0 0 1px #7f78ee;
}

.duel-wrap .duel-skip {
    height: auto;
    min-height: 60px;
    margin-top: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.duel-wrap .duel-hbar.duel-skip .rl {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-height: 1.4;
}

.duel-wrap .duel-hbar.duel-skip .rl b {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: 0;
    line-height: inherit;
}

.duel-wrap .duel-hbar .rl {
    flex: 1;
    min-width: 0;
    margin-right: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: #2b3157;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
}

.duel-wrap .duel-hbar.is-voted .rl {
    padding-left: 26px;   /* keep the name clear of the check badge */
}

.duel-wrap .duel-hbar .rn {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.duel-wrap .duel-hbar b {
    color: #2b3157;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
}

.duel-wrap .duel-hbar small {
    margin-top: 4px;
    color: #727899;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.duel-wrap .duel-chk {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6a62e8;
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

.duel-wrap .duel-chk svg {
    width: 12px;
    height: 12px;
}

.duel-wrap .duel-hbar > .duel-chk {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 2;
}

/* ---- results on mobile: vertical bars on the pictures ---- */
@media (max-width: 767px) {
    .duel-wrap.duel-results .duel-opt > .duel-hbar {
        display: none;
    }

    .duel-wrap.duel-results .duel-skip {
        display: flex;
    }

    .duel-wrap.duel-results .duel-strip {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 0;
        height: 36px;
        background: rgba(10, 12, 30, .38);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }

    .duel-wrap.duel-results .duel-vbar {
        display: block;
        position: absolute;
        z-index: 1;
        bottom: 0;
        width: 60px;
        height: calc((100% - 66px) * var(--h));
    }

    .duel-wrap.duel-results .duel-vbar.r {
        right: 0;
    }

    .duel-wrap.duel-results .duel-vbar.l {
        left: 0;
    }

    .duel-wrap.duel-results .duel-vbar::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;          /* same width as the percentage box */
        background: #16A34A;
    }

    .duel-wrap.duel-results .duel-vbar.r::before {
        right: 0;
    }

    .duel-wrap.duel-results .duel-vbar.l::before {
        left: 0;
    }

    .duel-wrap.duel-results .duel-vlab {
        position: absolute;
        bottom: 100%;
        left: 0;
        width: 100%;
        padding: 6px 0;
        background: rgba(10, 12, 30, .78);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        color: #fff;
        line-height: 1;
        text-align: center;
    }

    .duel-wrap.duel-results .duel-vlab b {
        display: block;
        font-size: 22px;
        font-weight: 800;
        letter-spacing: -.02em;
    }

    .duel-wrap.duel-results .duel-vlab b i {
        margin-left: 1px;
        font-size: .6em;
        font-style: normal;
        font-weight: 700;
    }

    .duel-wrap.duel-results .duel-vlab small {
        display: block;
        margin-top: 3px;
        font-size: 9.5px;
        font-weight: 600;
        letter-spacing: -.02em;
        white-space: nowrap;
    }

    .duel-wrap.duel-results .duel-cap {
        display: flex;
        position: absolute;
        z-index: 2;
        left: 0;
        right: 0;
        bottom: 0;
        height: 36px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 8px;
        color: #fff;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.2;
        text-align: center;
        text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
    }

    .duel-wrap.duel-results .duel-cap .t {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
        min-width: 0;
    }

    .duel-wrap.duel-results .duel-cap .duel-chk {
        flex: none;
        width: 20px;
        height: 20px;
    }

    .duel-wrap.duel-results .duel-opt:first-child .duel-expand {
        right: auto;
        left: 8px;
    }
}

/* very small screens: bar and percentage box are both 30px wide (compact numbers so they fit) */
@media (max-width: 640px) {
    .duel-wrap.duel-results .duel-vbar {
        width: 30px;
    }

    .duel-wrap.duel-results .duel-vlab {
        padding: 5px 0;
    }

    .duel-wrap.duel-results .duel-vlab b {
        font-size: 13px;
        letter-spacing: -.04em;
    }

    .duel-wrap.duel-results .duel-vlab b i {
        font-size: 8px;
    }

    .duel-wrap.duel-results .duel-vlab small {
        font-size: 0;
    }

    .duel-wrap.duel-results .duel-vlab small::after {
        content: attr(data-c);
        font-size: 8px;
        letter-spacing: -.03em;
    }
}
