/* ============================================================
   DIREITA NAS AMÉRICAS — Design System v2.0
   Paleta: Azul náutico escuro · Ouro · Vermelho · Verde
   ============================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --bg-deep:      #04080f;
    --bg-base:      #07101e;
    --bg-surface:   #0d1b2e;
    --bg-card:      #0f2035;
    --bg-elevated:  #142640;

    /* Azul (direita / brand) */
    --blue-dim:     #1e3a5f;
    --blue-mid:     #1d4ed8;
    --blue-vivid:   #3b82f6;
    --blue-light:   #60a5fa;
    --blue-pale:    #bfdbfe;

    /* Ouro (destaque / CTA) */
    --gold-deep:    #92400e;
    --gold-base:    #d97706;
    --gold-vivid:   #f59e0b;
    --gold-light:   #fcd34d;

    /* Vermelho (esquerda) */
    --red-deep:     #7f1d1d;
    --red-base:     #b91c1c;
    --red-vivid:    #ef4444;
    --red-light:    #fca5a5;

    /* Verde (transicao) */
    --green-deep:   #064e3b;
    --green-base:   #059669;
    --green-vivid:  #10b981;
    --green-light:  #6ee7b7;

    /* Ambar (eleicoes proximas) */
    --amber-base:   #d97706;
    --amber-vivid:  #f59e0b;
    --amber-light:  #fde68a;

    /* Texto */
    --text-primary:   #f0f4ff;
    --text-secondary: rgba(220, 235, 255, 0.7);
    --text-muted:     rgba(160, 190, 230, 0.5);

    /* Bordas / divisores */
    --border-subtle:  rgba(100, 160, 240, 0.12);
    --border-default: rgba(100, 160, 240, 0.22);
    --border-bright:  rgba(100, 160, 240, 0.45);

    /* Glassmorphism */
    --glass-bg:    rgba(7, 16, 30, 0.85);
    --glass-blur:  blur(20px) saturate(180%);

    /* Sombras */
    --shadow-sm:  0 2px 8px rgba(0,0,0,.45);
    --shadow-md:  0 6px 24px rgba(0,0,0,.55);
    --shadow-lg:  0 12px 48px rgba(0,0,0,.65);
    --shadow-blue: 0 0 30px rgba(59, 130, 246, .2);

    /* Raios */
    --r-sm:  8px;
    --r-md:  14px;
    --r-lg:  20px;
    --r-xl:  28px;
    --r-pill: 999px;

    /* Transicoes */
    --t-fast:   0.15s ease;
    --t-mid:    0.25s cubic-bezier(.4,0,.2,1);
    --t-slow:   0.4s cubic-bezier(.4,0,.2,1);
}

html, body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ────────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: clamp(8px, 1.6vw, 14px) clamp(14px, 3vw, 32px);
    background: linear-gradient(180deg,
        rgba(4, 8, 15, 0.96) 0%,
        rgba(7, 16, 30, 0.92) 100%);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-default);
    box-shadow: 0 1px 0 rgba(100,160,240,.08), var(--shadow-sm);
    position: relative;
    z-index: 200000;
}

header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--blue-mid) 20%,
        var(--gold-vivid) 50%,
        var(--blue-mid) 80%,
        transparent 100%);
    opacity: .7;
}

.header-brand {
    flex: 1;
    text-align: center;
    min-width: 0;
}

header h1 {
    font-size: clamp(.95rem, 2.6vw, 1.65rem);
    margin: 0 0 1px;
    background: linear-gradient(135deg,
        #fff 0%,
        var(--blue-pale) 35%,
        var(--gold-light) 65%,
        #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: .5px;
    white-space: nowrap;
    line-height: 1.15;
}

header h5 {
    font-size: clamp(.45rem, 1vw, .6rem);
    color: var(--gold-vivid);
    font-weight: 600;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: .9;
}

header .subtitle {
    font-size: clamp(.48rem, 1.1vw, .64rem);
    color: var(--text-muted);
    font-weight: 400;
    margin: 2px 0 0;
    letter-spacing: .5px;
}

/* ── Nav ───────────────────────────────────────────────────── */
.top-nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    max-width: 58vw;
}

.top-nav a {
    color: var(--blue-light);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(59, 130, 246, .2);
    background: rgba(15, 32, 53, .5);
    transition: all var(--t-mid);
    white-space: nowrap;
    letter-spacing: .2px;
}

.top-nav a:hover {
    background: rgba(59, 130, 246, .18);
    border-color: rgba(59, 130, 246, .55);
    color: #fff;
    box-shadow: 0 4px 18px rgba(59, 130, 246, .2);
    transform: translateY(-1px);
}

.top-nav a:focus-visible {
    outline: 2px solid var(--blue-vivid);
    outline-offset: 2px;
}

.top-nav a.nav-loja {
    color: #fff;
    background: linear-gradient(135deg, rgba(185,28,28,.75), rgba(127,13,13,.6));
    border-color: rgba(239,68,68,.45);
    font-weight: 700;
}

.top-nav a.nav-loja:hover {
    background: linear-gradient(135deg, rgba(220,38,38,.9), rgba(153,27,27,.85));
    border-color: rgba(239,68,68,.8);
    box-shadow: 0 6px 22px rgba(220,38,38,.35);
}

/* ── Seletor de idioma ────────────────────────────────────── */
.lang-selector {
    position: relative;
    flex-shrink: 0;
    z-index: 200;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(13, 27, 46, .75);
    border: 1px solid var(--border-default);
    border-radius: var(--r-pill);
    color: var(--blue-pale);
    font-size: .75rem;
    font-weight: 700;
    padding: 5px 11px;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
    letter-spacing: .5px;
    white-space: nowrap;
    font-family: inherit;
}

.lang-btn:hover {
    background: rgba(59, 130, 246, .16);
    border-color: var(--border-bright);
}

.lang-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(7, 16, 30, .97);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    overflow: hidden;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.lang-dropdown.open { display: flex; }

.lang-option {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: .8rem;
    font-family: inherit;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    transition: background var(--t-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-option:hover {
    background: rgba(59, 130, 246, .13);
    color: #fff;
}

.lang-option.active {
    color: var(--blue-light);
    font-weight: 700;
}

.lang-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Stats Bar ─────────────────────────────────────────────── */
.stats-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(10px, 2vw, 18px);
    padding: clamp(5px, .8vw, 9px) clamp(12px, 5vw, 32px);
    background: linear-gradient(180deg,
        rgba(4, 8, 15, .85) 0%,
        rgba(7, 16, 30, .7) 100%);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.flags-carousel {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    display: flex;
    align-items: center;
}

.flags-track {
    display: flex;
    gap: 32px;
    animation: scroll-flags 70s linear infinite;
    position: absolute;
    white-space: nowrap;
    align-items: center;
}

@keyframes scroll-flags {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.flag-svg {
    height: 32px;
    width: auto;
    opacity: .08;
    display: inline-block;
    border-radius: 3px;
}

.stats-group,
.search-container {
    position: relative;
    z-index: 1;
}

.stats-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 4vw, 36px);
    flex-wrap: wrap;
    grid-column: 2;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(.7rem, 2.2vw, .88rem);
    letter-spacing: .1px;
}

.stat-color {
    width: 13px;
    height: 13px;
    border-radius: 4px;
    flex-shrink: 0;
}

.stat-color.green  { background: linear-gradient(135deg, var(--green-base), var(--green-vivid)); }
.stat-color.red    { background: linear-gradient(135deg, var(--red-base), var(--red-vivid)); }
.stat-color.blue   { background: linear-gradient(135deg, var(--blue-mid), var(--blue-vivid)); }
.stat-color.yellow { background: linear-gradient(135deg, var(--amber-base), var(--amber-vivid)); }

.stat-count {
    font-weight: 800;
    font-size: clamp(.95rem, 2.8vw, 1.25rem);
    color: #fff;
    min-width: 1.6ch;
    line-height: 1;
}

.search-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
    align-items: center;
    grid-column: 3;
    justify-self: end;
    max-width: 380px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px 13px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-default);
    background: rgba(13, 27, 46, .75);
    color: var(--text-primary);
    outline: none;
    font-size: .85rem;
    font-family: inherit;
    transition: border-color var(--t-mid), box-shadow var(--t-mid), background var(--t-mid);
}

.search-input::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(.4);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--blue-vivid);
    background: rgba(13, 27, 46, .95);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.search-btn {
    padding: 8px 18px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(59, 130, 246, .35);
    background: linear-gradient(135deg, rgba(29,78,216,.55), rgba(59,130,246,.4));
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--t-mid);
    letter-spacing: .2px;
    white-space: nowrap;
}

.search-btn:hover {
    background: linear-gradient(135deg, rgba(29,78,216,.8), rgba(59,130,246,.65));
    border-color: rgba(59, 130, 246, .65);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, .25);
}

.search-hint {
    grid-column: 1 / -1;
    font-size: .8rem;
    color: var(--text-muted);
    min-height: 1.1em;
    display: none;
    padding: 0 4px;
}

/* ── Mapa ──────────────────────────────────────────────────── */
#map {
    width: 100%;
    flex: 1;
    background: linear-gradient(180deg, #020912 0%, #04101f 100%);
    position: relative;
}

.leaflet-container {
    background: linear-gradient(180deg, #020912 0%, #04101f 100%);
}

.leaflet-interactive:hover {
    filter: brightness(1.35) saturate(1.2);
    cursor: pointer;
}

.country-tooltip {
    background: rgba(5, 12, 22, .98);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    padding: 10px 16px;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    box-shadow: var(--shadow-lg), var(--shadow-blue);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.country-tooltip::before {
    border-top-color: rgba(5, 12, 22, .98) !important;
}

/* ── Legenda ───────────────────────────────────────────────── */
.bottom-left-stack {
    position: absolute;
    left: 14px;
    bottom: calc(40px + 5px);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.legend {
    background: var(--glass-bg);
    padding: 12px 16px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--border-default);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    min-width: 155px;
    z-index: 100000;
    border: 1px solid var(--border-subtle);
}

.legend h3 {
    margin-bottom: 9px;
    font-size: .7rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 7px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 7px 0;
    font-size: .68rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.legend-color.green  { background: linear-gradient(135deg, var(--green-base), var(--green-vivid)); }
.legend-color.red    { background: linear-gradient(135deg, var(--red-base), var(--red-vivid)); }
.legend-color.blue   { background: linear-gradient(135deg, var(--blue-mid), var(--blue-vivid)); }
.legend-color.yellow { background: linear-gradient(135deg, var(--amber-base), var(--amber-vivid)); }

/* ── Botao reset zoom ──────────────────────────────────────── */
.reset-btn {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 10px 18px;
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all var(--t-mid);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    font-family: inherit;
}

.zoom-reset-btn {
    position: absolute;
    top: 241px;
    left: 9px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 1000;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
}

.reset-btn:hover {
    background: rgba(29, 78, 216, .25);
    border-color: rgba(59, 130, 246, .5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, .2);
}

/* ── Painel de informacoes do pais ─────────────────────────── */
.info-panel {
    position: absolute;
    top: 255px;
    right: 18px;
    width: 390px;
    max-height: calc(100vh - 290px);
    background: var(--glass-bg);
    border-radius: var(--r-xl);
    z-index: 1000;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-default), var(--shadow-blue);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    overflow-y: auto;
    transition: all var(--t-slow);
    border: 1px solid var(--border-subtle);
}

.info-panel::-webkit-scrollbar { width: 5px; }
.info-panel::-webkit-scrollbar-track { background: transparent; }
.info-panel::-webkit-scrollbar-thumb {
    background: rgba(100, 160, 240, .2);
    border-radius: 10px;
}
.info-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 160, 240, .35);
}

.info-panel.hidden {
    transform: translateX(440px);
    opacity: 0;
    pointer-events: none;
}

/* ── Botao fechar ──────────────────────────────────────────── */
.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(127, 29, 29, .6);
    border: 1px solid rgba(239,68,68,.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--t-mid);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(185, 28, 28, .35);
}

.close-btn:hover {
    background: rgba(185, 28, 28, .85);
    border-color: rgba(239, 68, 68, .65);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 5px 18px rgba(185, 28, 28, .5);
}

/* ── Conteudo do painel ────────────────────────────────────── */
#panel-content { padding: 22px; }

.country-header {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 18px;
}

.country-header h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 4px;
    font-weight: 700;
}

.country-flag-large {
    width: 130px;
    height: auto;
    border-radius: var(--r-sm);
    margin: 12px auto;
    display: block;
    box-shadow: 0 6px 24px rgba(0,0,0,.55);
    border: 2px solid var(--border-default);
}

.country-header .flag-emoji {
    font-size: 4.5rem;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}

.orientation-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    border-radius: var(--r-pill);
    font-size: .88rem;
    font-weight: 700;
    color: white;
    margin-top: 10px;
    letter-spacing: .3px;
}

.orientation-badge.right {
    background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue-vivid) 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, .35);
}

.orientation-badge.left {
    background: linear-gradient(135deg, var(--red-base) 0%, var(--red-vivid) 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, .35);
}

.orientation-badge.transition {
    background: linear-gradient(135deg, var(--green-base) 0%, var(--green-vivid) 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, .35);
}

.orientation-badge.election {
    background: linear-gradient(135deg, var(--amber-base) 0%, var(--amber-vivid) 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, .35);
}

.section { margin: 20px 0; }

.section h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: .2px;
}

.section h3 .icon { font-size: 1.2rem; opacity: .85; }

.info-grid { display: grid; gap: 8px; }

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 13px;
    background: rgba(255,255,255,.04);
    border-radius: var(--r-md);
    font-size: .85rem;
    transition: background var(--t-fast);
    border: 1px solid var(--border-subtle);
}

.info-item:hover {
    background: rgba(59, 130, 246, .07);
    border-color: var(--border-default);
}

.info-item .label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: .82rem;
}

.info-item .value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 55%;
    font-size: .85rem;
}

.president-card {
    background: linear-gradient(135deg,
        rgba(29, 78, 216, .12) 0%,
        rgba(13, 27, 46, .6) 100%);
    border-radius: var(--r-lg);
    padding: 22px;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, .18);
    margin-bottom: 14px;
}

.president-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-default);
    margin: 0 auto 12px;
    display: block;
    box-shadow: 0 6px 28px rgba(0,0,0,.5), var(--shadow-blue);
    background: rgba(255,255,255,.06);
}

.photo-placeholder,
.president-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(29, 78, 216, .2), rgba(13, 27, 46, .6));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    margin: 0 auto 12px;
    border: 3px solid var(--border-default);
}

.winner-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 2px solid var(--border-default);
    flex-shrink: 0;
}

.president-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.president-party {
    font-size: .88rem;
    color: var(--text-secondary);
}

/* ── Secao de Eleicoes ─────────────────────────────────────── */
.election-section {
    background: linear-gradient(135deg,
        rgba(29, 78, 216, .15) 0%,
        rgba(13, 27, 46, .55) 100%);
    border-radius: var(--r-lg);
    padding: 16px;
    margin: 16px 0;
    border: 1px solid rgba(59, 130, 246, .22);
}

.election-section.pending {
    background: linear-gradient(135deg,
        rgba(217, 119, 6, .15) 0%,
        rgba(13, 27, 46, .55) 100%);
    border-color: rgba(245, 158, 11, .25);
}

.election-section h3 {
    color: var(--blue-light);
    margin-bottom: 12px;
    font-size: .95rem;
}

.election-section.pending h3 { color: var(--amber-vivid); }

.election-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
}

.clock-icon {
    font-size: 1.3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.12); opacity: .75; }
}

.winner-card {
    background: rgba(255,255,255,.07);
    border-radius: var(--r-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 12px;
    border: 1px solid var(--border-subtle);
}

.winner-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-default);
}

.winner-info { flex: 1; }
.winner-name { font-size: 1rem; font-weight: 700; color: #fff; }
.winner-party { font-size: .8rem; color: var(--text-secondary); margin-top: 3px; }

.winner-orientation {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--r-pill);
    font-size: .75rem;
    font-weight: 700;
    margin-top: 7px;
}

.winner-orientation.right {
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-vivid));
    color: white;
}

.winner-orientation.left {
    background: linear-gradient(135deg, var(--red-base), var(--red-vivid));
    color: white;
}

.ending-soon-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, var(--amber-base), var(--amber-vivid));
    border-radius: var(--r-pill);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    margin-top: 10px;
    animation: glow 2.5s infinite;
    box-shadow: 0 3px 12px rgba(245, 158, 11, .35);
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, .4); }
    50%       { box-shadow: 0 0 22px rgba(245, 158, 11, .75); }
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(2, 5, 12, .88);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--t-mid);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.modal.hidden { opacity: 0; pointer-events: none; }

.modal-content {
    background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-deep) 100%);
    border-radius: var(--r-xl);
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-default);
    border: 1px solid var(--border-subtle);
}

#modal-body { padding: 32px; }

.modal-header { text-align: center; margin-bottom: 28px; }

.modal-header h2 {
    font-size: 2rem;
    color: #fff;
    font-weight: 800;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* ── Loading ───────────────────────────────────────────────── */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: "";
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255,255,255,.06);
    border-top: 3px solid var(--blue-vivid);
    border-right: 3px solid var(--gold-vivid);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    background: rgba(4, 8, 15, .97);
    border-top: 1px solid var(--border-subtle);
    padding: 6px 18px;
    z-index: 999999;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.footer-content {
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0;
    flex: 1;
}

.footer p { margin: 0; font-size: .68rem; color: var(--text-muted); }

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 500;
    transition: color var(--t-fast);
    letter-spacing: .2px;
}

.footer-link:hover { color: var(--blue-light); }

.footer-attribution {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.leaflet-control-attribution {
    background: transparent !important;
    padding: 0 !important;
    font-size: .62rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
}

.leaflet-control-attribution a {
    color: rgba(160, 190, 230, .55);
    text-decoration: none;
    transition: color var(--t-fast);
    font-size: .62rem;
}

.leaflet-control-attribution a:hover { color: var(--blue-vivid); text-decoration: underline; }

.leaflet-attribution-flag {
    width: 10px;
    height: 7px;
    margin-right: 3px;
    vertical-align: middle;
    display: inline;
}

/* ── Acessibilidade ────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.03); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,.25); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,.45); }

/* ============================================================
