:root {
    --ticker-height: 70px;
    --label-width: 100px;
    --scroll-speed: 50s;
    --bg-color: #0f172a;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --indigo-900: #1e1b4b;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-600: #475569;
    --slate-800: #1e293b;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --emerald-500: #10b981;
    --header-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

body {
    font-family: "Anek Devanagari", sans-serif;
    color: var(--slate-800);
    margin: 0;
    padding: 0;
    background: transparent;
    overflow-x: hidden;
}

* { box-sizing: border-box; }
a { text-decoration: none !important; color: inherit; }

.text-center { text-align: center !important; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.text-slate-400 { color: var(--slate-400); }

.emb-container {
    background: white;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--slate-200);
    border-radius: 0;
    overflow: hidden;
    font-family: 'Anek Devanagari', sans-serif;
    max-width: 100%;
    margin-bottom: 2px;
}

.emb-header, .emb-header-status {
    background: var(--header-gradient);
    padding:12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emb-logo-img {
    height: 22px !important;
    width: auto;
    object-fit: contain;
 }

.emb-header-title, .emb-title-group {
    flex-grow: 1;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    padding: 0 6px;
}

.emb-live-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--red-600);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;

}

.emb-live-indicator .dot {
    width: 5px; height: 5px;
    background: #ffffff;
    border-radius: 50%;
    animation: emb-pulse 1.5s infinite;
}

@keyframes emb-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.emb-body { padding: 0; }
.emb-list { list-style: none; padding: 0; margin: 0; }

.emb-labels-row {
    display: flex;
    align-items: stretch;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    padding: 0 12px;
    min-height: 32px;
}

.emb-label-spacer { flex-grow: 1; }

.emb-col-label {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emb-candidate {
    background: white;
    border-bottom: 1px solid var(--slate-100);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    position: relative;
}

.emb-candidate:last-child { border-bottom: none; }

.emb-candidate.is-elected {
    background: var(--party-color, var(--indigo-600));
    color: #ffffff !important;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.1);
}

.is-elected .emb-name, 
.is-elected .emb-votes, 
.is-elected .emb-party,
.is-elected .emb-num-win,
.is-elected .emb-num-pr { color: #ffffff !important; }

.is-elected .emb-num-lead { color: #fde047 !important; }

.emb-photo-wrap { 
    position: relative; 
    flex-shrink: 0; 
    margin-right: 10px;
    height: 36px;
}

.emb-photo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--slate-200);
}

.emb-elected-badge {
    position: absolute;
    bottom: 0px;
    right: -5px;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.emb-elected-badge svg {
    width: 100%;
    height: 100%;
}

.emb-info { 
    flex-grow: 1; 
    min-width: 0;
}

.emb-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-800);
    display: block;
    line-height: 1.2;
}

.emb-party {
    font-size: 11px;
    font-weight: 500;
    color: var(--slate-600);
    display: block;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emb-stats {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emb-votes {
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-800);
}

.emb-party-logo {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: contain;
    background: #f1f5f9;
    padding: 2px;
    border: 1px solid var(--slate-200);
}

.emb-elected-text {
    font-size: 11px;
    font-weight: bold;
     color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    margin-right: 4px;
    display: inline-block;
}

.emb-data-table {
    display: flex;
    align-items: center;
}

.emb-col-direct {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.emb-col-pr {
    width: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emb-num-win { 
    font-size: 16px; 
    font-weight: 800; 
}

.emb-num-lead { 
    font-size: 11px; 
    font-weight: 700; 
    color: var(--emerald-500); 
}

.emb-num-pr { 
    font-size: 15px; 
    font-weight: 800; 
    color: var(--indigo-600); 
}

.emb-footer-btn {
    display: block;
    background: var(--header-gradient);
    color: white !important;
    text-align: center;
    padding: 6px;  
    margin: 8px 12px 10px 12px;  
    font-size: 12px;  
    font-weight: 700;
    border-radius: 5px;
}

.border-l { border-left: 1px solid var(--slate-200); }
.border-r { border-right: 1px solid var(--slate-200); }

 

.ticker-label-hidden { display: none; }


/* Status Embed Table Styles (Isolated) */
.emb-status-table-wrapper {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
}

.emb-status-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.emb-status-table th, 
.emb-status-table td {
    border: 1px solid #e2e8f0;
    padding: 0;
    vertical-align: middle;
}

.emb-status-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    text-align: center;
}

.emb-th-party {
    width: auto;
    text-align: left;
    border-right: 1px solid #e2e8f0;
}

.emb-th-direct, .emb-th-pr {
    width: 70px;
}

.emb-status-table tr {
    cursor: pointer;
    background: #ffffff;
    transition: background 0.1s ease;
}

.emb-status-table tr:hover {
    background: #f8fafc;
}

.emb-td-party {
    padding: 0;
    border-right: 1px solid #e2e8f0;
}

.emb-td-direct, .emb-td-pr {
    text-align: center;
    border-right: 1px solid #e2e8f0;
    height: 38px;
}

/* Scoped Party Cell Styles */
.emb-status-table-wrapper .emb-party-flex {
    display: flex;
    align-items: center;
    padding: 0 0 0 12px;
    height: 38px;
    width: 100%;
}

.emb-status-table-wrapper .emb-party-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    margin-right: 8px;
    flex-shrink: 0;
}

.emb-status-table-wrapper .emb-party-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.emb-status-table-wrapper .emb-val-direct {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.emb-status-table-wrapper .emb-val-lead {
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    margin-left: 2px;
}

.emb-status-table-wrapper .emb-val-pr {
    font-size: 15px;
    font-weight: 700;
    color: #4f46e5;
    line-height: 1;
}

.ticker-container {
    position: relative;
    width: 100%;
    height: 70px;
    background: #ffffff;
    display: flex;
    overflow: hidden;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    font-family: "Mukta", sans-serif;
}

.ticker-label {
    position: relative;
    z-index: 200;
    background: #1e3a8a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
    padding: 0 24px;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.ticker-label h1 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    text-align: center;
}

.live-status {
    font-size: 10px;
    background: #da291c;
    color: white;
    padding: 2px 8px;
    margin-top: 4px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 2px;
    text-transform: uppercase;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: ticker-pulse 1.2s infinite;
}

.ticker-track-wrapper {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

.ticker-track {
    display: flex;
    height: 100%;
    width: max-content;
    animation: ticker-scroll var(--scroll-speed) linear infinite;
}

.party-item {
    display: flex;
    height: 100%;
    padding: 0 20px;
    color: #334155;
    position: relative;
    background: transparent;
    align-items: center;
    border-right: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.party-item:hover {
    background: #f8fafc;
}

.party-item:hover .party-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.party-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.item-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.party-icon {
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.party-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.data-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 60px;
    gap: 2px;
}

.win-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.win-count {
    font-size: 24px;
    font-weight: 800;
    color: #da291c;
    line-height: 1;
}

.label-win {
    font-size: 13px;
    font-weight: 700;
    color: #16a34a;
    line-height: 1;
}

.lead-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -2px;
}

.lead-val {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}

.label-lead {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    line-height: 1;
}

.party-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1e3a8a;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 2px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.party-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e3a8a;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes ticker-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 480px) {
    .emb-header-title { font-size: 13px; }
    .emb-name { font-size: 13px; }
    .emb-votes { font-size: 16px; }
    .emb-num-win { font-size: 14px; }
    .emb-num-pr { font-size: 13px; }
    .ticker-label { display: none; }
}
