/* ════════════════════════════════════════════════════════════════
   comment_vote — overlay styles (OBS browser source, transparent bg)
   ════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: transparent;
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #fff;
    overflow: hidden;
}

.cv-root {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
}

.cv-card {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: linear-gradient(135deg, rgba(10, 12, 22, 0.6) 0%, rgba(20, 26, 46, 0.45) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 22px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 30px rgba(59, 130, 246, 0.04);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    overflow: hidden;
}

.cv-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 80% at 50% -20%, rgba(255, 255, 255, 0.08), transparent 60%);
}

.cv-card > * { position: relative; }

/* ── Header ── */
.cv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 14px;
}

.cv-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cv-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.cv-desc { font-size: 14px; opacity: 0.7; margin-top: 4px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.cv-meta { text-align: right; flex-shrink: 0; }

.cv-timer {
    font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums;
    color: #2dd4bf; text-shadow: 0 2px 12px rgba(45, 212, 191, 0.3);
}

.cv-timer.cv-warning { color: #f87171; animation: cv-pulse 1s ease-in-out infinite; }
.cv-total { font-size: 13px; opacity: 0.6; margin-top: 2px; }

@keyframes cv-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Body ── */
.cv-body { display: flex; flex-direction: column; gap: 14px; }

/* ── Bar / progress / race rows ── */
.cv-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Pulsing / Bouncy Row transition when vote hits */
.cv-pulse-bounce {
    animation: cv-pulse-bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes cv-pulse-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.025); }
}

body.cv-fx-crown .cv-bar-row.cv-leader-row .cv-bar-label-name::after {
    content: ' 👑';
    display: inline-block;
    animation: cv-crown-bounce 1.4s ease-in-out infinite;
}

@keyframes cv-crown-bounce {
    0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
    50% { transform: translateY(-4px) rotate(6deg) scale(1.25); filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.8)); }
}

.cv-bar-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px;
}

.cv-bar-label-name { font-weight: 700; display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
.cv-bar-emoji { font-size: 18px; }
.cv-bar-value { font-variant-numeric: tabular-nums; opacity: 0.95; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }

.cv-bar-track {
    position: relative;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

/* Leader row styling: glow slightly */
.cv-bar-row.cv-leader-row .cv-bar-track {
    border-color: rgba(250, 204, 21, 0.35);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.15), inset 0 1px 4px rgba(0, 0, 0, 0.45);
}

.cv-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%;
    border-radius: 14px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.12) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.12) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: cv-bar-stripes 1.2s linear infinite;
}

@keyframes cv-bar-stripes {
    from { background-position: 0 0; }
    to { background-position: 30px 0; }
}

/* Gloss highlight on the top half of the fill */
.cv-bar-fill::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 50%);
    pointer-events: none;
}

/* ── Trigger chip ("type this to vote") ── */
.cv-trigger, .cv-bar-trigger:not(:empty) {
    display: inline-flex; align-items: center;
    margin-left: 8px; padding: 2px 10px;
    font-size: 12px; font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: none;
    white-space: nowrap;
}
.cv-bar-trigger:empty { display: none; }

/* ── Gift chips (which gifts help vote) ── */
.cv-bar-gifts:empty, .cv-gifts:empty { display: none; }
.cv-gifts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cv-gift-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px 2px 4px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
}
.cv-gift-chip-img { width: 16px; height: 16px; object-fit: contain; }
.cv-gift-chip-pts { color: #fcd34d; }

/* race-style container reorders rows by rank */
.cv-body.cv-mode-race, .cv-body.cv-mode-bar_chart { gap: 10px; }

/* ── Simple list (percentage / count / percent_count) ── */
.cv-list-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 6px solid #3b82f6;
    border-radius: 14px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cv-list-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cv-list-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.cv-list-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }

/* ── Pie / donut ── */
.cv-chart-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center; }
#cv-canvas { flex-shrink: 0; }
.cv-legend { display: flex; flex-direction: column; gap: 8px; }
.cv-legend-item { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cv-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.cv-legend-name { font-weight: 700; }
.cv-legend-value { opacity: 0.75; font-variant-numeric: tabular-nums; }

/* ── Leader only ── */
.cv-leader-only {
    text-align: center; padding: 26px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cv-leader-crown { font-size: 48px; }
.cv-leader-name { font-size: 36px; font-weight: 900; display: flex; align-items: center; gap: 12px; }
.cv-leader-pct { font-size: 26px; font-weight: 800; opacity: 0.9; }
.cv-empty { text-align: center; opacity: 0.5; padding: 28px; font-size: 15px; }

/* ── Winner banner ── */
.cv-winner {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(10, 12, 22, 0.94);
    animation: cv-winner-fade-in 0.4s ease;
    border-radius: 24px;
    z-index: 100;
}
.cv-winner[hidden] { display: none; }
.cv-winner-inner {
    position: relative;
    text-align: center;
    padding: 35px 50px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.15), rgba(15, 23, 42, 0.95));
    border: 2px solid rgba(250, 204, 21, 0.6);
    border-radius: 24px;
    box-shadow: 0 0 50px rgba(250, 204, 21, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cv-winner-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-width: 90%;
}
.cv-winner-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.25) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: cv-winner-glow-pulse 2s ease-in-out infinite;
}
@keyframes cv-winner-glow-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.85; }
}
.cv-winner-crown {
    font-size: 56px;
    margin-bottom: 8px;
    animation: cv-crown-wobble 2s ease-in-out infinite;
}
.cv-winner-name {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fcd34d;
    text-shadow: 0 0 15px rgba(250, 204, 21, 0.5);
    margin-top: 6px;
}
.cv-winner-pct {
    font-size: 18px;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 6px;
}

@keyframes cv-winner-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cv-winner-pop { from { transform: scale(0.8) rotate(-2deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes cv-crown-wobble {
    0%, 100% { transform: rotate(-5deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.15); }
}

/* ── Gift contribution toast ── */
.cv-gift-layer {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
    pointer-events: none;
    z-index: 50;
}
.cv-gift-toast {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(10, 12, 22, 0.92);
    border: 1.5px solid #3b82f6;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    animation: cv-gift-float 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.cv-gift-toast-pts { font-size: 16px; font-weight: 900; }
.cv-gift-toast-img { width: 20px; height: 20px; object-fit: contain; }
.cv-gift-toast-arrow { opacity: 0.6; }
.cv-gift-toast-opt { font-weight: 800; }

@keyframes cv-gift-float {
    0%   { transform: translateY(20px) scale(0.85); opacity: 0; }
    12%  { transform: translateY(0) scale(1); opacity: 1; }
    78%  { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0.95); opacity: 0; }
}

/* ── In-game Floating Score pops ── */
.cv-game-pop {
    position: absolute;
    pointer-events: none;
    font-size: 22px;
    font-weight: 900;
    z-index: 99;
    transform: translate(-50%, -50%) scale(0.6);
    animation: cv-game-float 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes cv-game-float {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -80%) scale(1.4);
        opacity: 1;
    }
    40% {
        transform: translate(-50%, -100%) scale(1);
    }
    100% {
        transform: translate(calc(-50% + var(--drift-x, 0px)), -200%) scale(0.85);
        opacity: 0;
    }
}

/* ── Floating vote feed (bottom-left) ── */
.cv-feed {
    position: absolute;
    left: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    pointer-events: none;
    z-index: 48;
    max-width: 220px;
}
.cv-feed-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(10, 12, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: cv-feed-in 0.35s ease;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.cv-feed-item.cv-feed-out { opacity: 0; transform: translateX(-12px); }
.cv-feed-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
@keyframes cv-feed-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

/* ── Fire / trending ── */
.cv-fire-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    z-index: 49;
    animation: cv-fire-badge-pulse 1s ease-in-out infinite;
}
@keyframes cv-fire-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
body.cv-trending .cv-card {
    border-color: #f97316;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 35px rgba(249, 115, 22, 0.35), inset 0 0 15px rgba(249, 115, 22, 0.15);
    animation: cv-card-fire 2s ease-in-out infinite;
}
@keyframes cv-card-fire {
    0%, 100% { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 25px rgba(249, 115, 22, 0.25), inset 0 0 10px rgba(249, 115, 22, 0.1); }
    50% { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 45px rgba(249, 115, 22, 0.55), inset 0 0 25px rgba(249, 115, 22, 0.25); }
}

/* ── Leader change ── */
.cv-leader-banner {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 900;
    color: #000;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.3);
    z-index: 90;
    animation: cv-leader-gaming-banner 2.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.cv-leader-banner-crown { font-size: 20px; }
@keyframes cv-leader-gaming-banner {
    0% { transform: translate(-50%, -40px) scale(0.7); opacity: 0; }
    15% { transform: translate(-50%, 0) scale(1.1); opacity: 1; }
    22% { transform: translate(-50%, 0) scale(1); }
    85% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -10px) scale(0.9); opacity: 0; }
}
