.poll-widget-3d {
    --pw3d-blue: #0a2d5c;
    --pw3d-blue-dark: #001f3f;
    --pw3d-green: #22a54c;
    --pw3d-green-dark: #1a8a3f;
    --pw3d-red: #c20000;
    --pw3d-shadow: rgba(0, 31, 63, 0.22);
    --pw3d-shadow-soft: rgba(0, 31, 63, 0.1);
    position: relative;
}

.poll-widget-3d__shell {
    position: relative;
    border-radius: 18px;
    padding: 2px;
    background: linear-gradient(135deg, #22a54c 0%, #1f6fd1 28%, #7c3aed 55%, #ea580c 78%, #c20000 100%);
    box-shadow:
        0 16px 34px rgba(31, 111, 209, 0.18),
        0 8px 18px var(--pw3d-shadow-soft);
    transform: perspective(900px) rotateX(2deg);
    transform-origin: center top;
    overflow: hidden;
}

.poll-widget-3d__shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.45) 45%, transparent 70%);
    transform: translateX(-120%);
    animation: pollWidgetShine 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

.poll-widget-3d__shell::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -9px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(31, 111, 209, 0.22) 0%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.poll-widget-3d__body {
    position: relative;
    z-index: 1;
    padding: 1rem 1rem 1.15rem;
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 165, 76, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 0% 100%, rgba(31, 111, 209, 0.14) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 55%, #f2f7ff 100%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.poll-widget-3d__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(10, 45, 92, 0.08);
}

.poll-widget-3d__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.poll-widget-3d__intro {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.poll-widget-3d__panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(31, 111, 209, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(242, 247, 255, 0.92) 100%);
    border: 1px solid rgba(31, 111, 209, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.poll-widget-3d__panel-head {
    display: flex;
    justify-content: flex-end;
    min-height: 0;
    margin-bottom: 0.55rem;
}

.poll-widget-3d__panel-head:empty,
.poll-widget-3d__panel-head:not(:has(.poll-widget-3d__live-badge)) {
    display: none;
}

.poll-widget-3d__header-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.poll-widget-3d__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #1f6fd1 0%, #0a2d5c 55%, #7c3aed 100%);
    box-shadow:
        0 5px 12px rgba(31, 111, 209, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.poll-widget-3d__header-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    background: linear-gradient(90deg, #001f3f 0%, #1f6fd1 55%, #22a54c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.01em;
}

.poll-widget-3d__live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #c20000 100%);
    box-shadow: 0 3px 10px rgba(194, 0, 0, 0.28);
    flex-shrink: 0;
}

.poll-widget-3d__live-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: #fff;
    animation: pollWidgetPulse 1.4s ease-in-out infinite;
}

.poll-widget-3d__question {
    margin: 0 0 0.45rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.45;
    color: #102a43;
    background: linear-gradient(90deg, rgba(31, 111, 209, 0.1) 0%, rgba(34, 165, 76, 0.08) 100%);
    border-left: 4px solid #1f6fd1;
}

.poll-widget-3d__description {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #5a6d84;
}

.poll-widget-3d__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0;
}

.poll-widget-3d__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1f3550;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 111, 209, 0.18);
}

.poll-widget-3d__form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.poll-widget-3d__option {
    --pw3d-accent: #1f6fd1;
    --pw3d-accent-soft: rgba(31, 111, 209, 0.14);
    --pw3d-accent-glow: rgba(31, 111, 209, 0.28);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.62rem 0.72rem 0.62rem 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--pw3d-accent-soft) 0%, rgba(255, 255, 255, 0.95) 38%);
    border: 1px solid rgba(10, 45, 92, 0.1);
    box-shadow: 0 3px 8px rgba(0, 31, 63, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.poll-widget-3d__option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--pw3d-accent) 0%, color-mix(in srgb, var(--pw3d-accent) 70%, #000) 100%);
}

.poll-widget-3d__option:nth-child(5n + 1) {
    --pw3d-accent: #1f6fd1;
    --pw3d-accent-soft: rgba(31, 111, 209, 0.16);
    --pw3d-accent-glow: rgba(31, 111, 209, 0.32);
}

.poll-widget-3d__option:nth-child(5n + 2) {
    --pw3d-accent: #16a34a;
    --pw3d-accent-soft: rgba(22, 163, 74, 0.16);
    --pw3d-accent-glow: rgba(22, 163, 74, 0.32);
}

.poll-widget-3d__option:nth-child(5n + 3) {
    --pw3d-accent: #ea580c;
    --pw3d-accent-soft: rgba(234, 88, 12, 0.16);
    --pw3d-accent-glow: rgba(234, 88, 12, 0.32);
}

.poll-widget-3d__option:nth-child(5n + 4) {
    --pw3d-accent: #7c3aed;
    --pw3d-accent-soft: rgba(124, 58, 237, 0.16);
    --pw3d-accent-glow: rgba(124, 58, 237, 0.32);
}

.poll-widget-3d__option:nth-child(5n + 5) {
    --pw3d-accent: #db2777;
    --pw3d-accent-soft: rgba(219, 39, 119, 0.16);
    --pw3d-accent-glow: rgba(219, 39, 119, 0.32);
}

.poll-widget-3d__option:hover {
    transform: translateX(3px) translateY(-1px);
    border-color: var(--pw3d-accent-glow);
    box-shadow: 0 8px 18px var(--pw3d-accent-glow);
}

.poll-widget-3d__option:has(input:checked),
.poll-widget-3d__option.is-selected {
    border-color: var(--pw3d-accent);
    background: linear-gradient(90deg, var(--pw3d-accent-soft) 0%, #ffffff 55%);
    box-shadow:
        0 8px 18px var(--pw3d-accent-glow),
        inset 0 0 0 1px color-mix(in srgb, var(--pw3d-accent) 35%, white);
}

.poll-widget-3d__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.poll-widget-3d__option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.12rem;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid color-mix(in srgb, var(--pw3d-accent) 55%, white);
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.poll-widget-3d__option-marker::after {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--pw3d-accent);
    transform: scale(0);
    transition: transform 0.15s ease;
}

.poll-widget-3d__option:has(input:checked) .poll-widget-3d__option-marker,
.poll-widget-3d__option.is-selected .poll-widget-3d__option-marker {
    border-color: var(--pw3d-accent);
    background: color-mix(in srgb, var(--pw3d-accent) 12%, white);
    transform: scale(1.05);
}

.poll-widget-3d__option:has(input:checked) .poll-widget-3d__option-marker::after,
.poll-widget-3d__option.is-selected .poll-widget-3d__option-marker::after {
    transform: scale(1);
}

.poll-widget-3d__option-text {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1f3550;
    font-weight: 600;
}

.poll-widget-3d__submit {
    margin-top: 0.35rem;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 0.74rem 1rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #22a54c 0%, #1f6fd1 52%, #7c3aed 100%);
    background-size: 180% 100%;
    box-shadow:
        0 10px 20px rgba(31, 111, 209, 0.28),
        0 2px 0 rgba(10, 45, 92, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-position 0.35s ease, opacity 0.2s ease;
}

.poll-widget-3d__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow:
        0 14px 26px rgba(31, 111, 209, 0.34),
        0 3px 0 rgba(10, 45, 92, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.poll-widget-3d__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.25);
}

.poll-widget-3d__submit.is-ready {
    animation: pollWidgetBtnPulse 2.2s ease-in-out infinite;
}

.poll-widget-3d__submit:active:not(:disabled) {
    transform: translateY(1px);
}

.poll-widget-3d__results {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.poll-widget-3d__result {
    --pw3d-accent: #1f6fd1;
    margin: 0;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--pw3d-accent) 10%, white) 0%, #fff 70%);
    border: 1px solid color-mix(in srgb, var(--pw3d-accent) 18%, white);
}

.poll-widget-3d__result:nth-child(5n + 1) { --pw3d-accent: #1f6fd1; }
.poll-widget-3d__result:nth-child(5n + 2) { --pw3d-accent: #16a34a; }
.poll-widget-3d__result:nth-child(5n + 3) { --pw3d-accent: #ea580c; }
.poll-widget-3d__result:nth-child(5n + 4) { --pw3d-accent: #7c3aed; }
.poll-widget-3d__result:nth-child(5n + 5) { --pw3d-accent: #db2777; }

.poll-widget-3d__result-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
}

.poll-widget-3d__result-label {
    color: #1f3550;
    font-weight: 700;
}

.poll-widget-3d__result-meta {
    color: var(--pw3d-accent);
    font-weight: 800;
    white-space: nowrap;
}

.poll-widget-3d__result-track {
    height: 0.62rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 2px 4px rgba(0, 31, 63, 0.1);
}

.poll-widget-3d__result-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--pw3d-accent) 80%, white) 0%, var(--pw3d-accent) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-widget-3d__footer {
    margin-top: 0.8rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1f3550;
    text-align: center;
    background: linear-gradient(90deg, rgba(31, 111, 209, 0.1) 0%, rgba(34, 165, 76, 0.1) 100%);
}

.poll-widget-3d__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1f6fd1;
    text-decoration: none;
}

.poll-widget-3d__link:hover {
    color: #22a54c;
    text-decoration: underline;
}

.poll-widget-3d__hint {
    margin: 0.45rem 0 0;
    font-size: 0.74rem;
    color: #6a7f96;
    text-align: center;
}

.sidebar-widget .poll-widget-3d {
    margin-top: 0.15rem;
}

@keyframes pollWidgetShine {
    0%, 78%, 100% { transform: translateX(-120%); }
    40% { transform: translateX(120%); }
}

@keyframes pollWidgetPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

@keyframes pollWidgetBtnPulse {
    0%, 100% { box-shadow: 0 10px 20px rgba(31, 111, 209, 0.28), 0 2px 0 rgba(10, 45, 92, 0.35); }
    50% { box-shadow: 0 12px 24px rgba(34, 165, 76, 0.38), 0 2px 0 rgba(10, 45, 92, 0.35); }
}

@media (max-width: 767.98px) {
    .poll-widget-3d__shell {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .poll-widget-3d__shell::before,
    .poll-widget-3d__live-dot,
    .poll-widget-3d__submit.is-ready {
        animation: none;
    }
}
