/* ── SkyBlock Mayors & Elections page ─────────────────────────────────────── */

:root {
    --mayors-bg:          #141414;
    --mayors-bg-2:        #0f0f0f;
    --mayors-card:        #1a1a1a;
    --mayors-card-2:      #222222;
    --mayors-edge:        rgba(255, 255, 255, 0.07);
    --mayors-edge-strong: rgba(255, 255, 255, 0.14);
    --mayors-text:        #f0f0f0;
    --mayors-muted:       #aaaaaa;
    --mayors-gold:        #FFAA00;
    --mayors-purple:      #d48bff;
}

/* Neutralise the global section { display:grid } rule from style.css */
.mayors-page section {
    display: block;
    width: auto;
    grid-template-columns: none;
    place-items: initial;
    margin: 0 0 32px;
}

/* ── Page wrapper ─────────────────────────────── */
.mayors-page {
    max-width: 1220px;
    margin: 20px auto 64px;
    padding: 0 16px;
    color: var(--mayors-text);
    font-family: "Lexend Deca", system-ui, sans-serif;
}

/* ── Hero ─────────────────────────────────────── */
.mayors-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    border: 1px solid var(--mayors-edge);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 28px;
    background:
        radial-gradient(800px 280px at 5% -30%, rgba(212, 139, 255, 0.18), transparent 55%),
        radial-gradient(700px 220px at 100% -20%, rgba(255, 170, 0, 0.12), transparent 55%),
        linear-gradient(150deg, #1a1a1a, #111111);
    box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

@media (max-width: 600px) {
    .mayors-hero {
        grid-template-columns: 1fr;
        padding: 20px 18px;
    }
    .mayors-hero-badge { margin: 0; }
}

.mayors-hero-copy { min-width: 0; }

.mayors-kicker {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--mayors-purple);
    font-weight: 700;
    margin: 0 0 8px;
}

.mayors-title {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 4.4vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    background: linear-gradient(90deg, #fff 10%, #d48bff 60%, #ffaa00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mayors-subtitle {
    margin: 0;
    color: #c8c8c8;
    font-size: 0.9rem;
    line-height: 1.55;
    max-width: 680px;
}

/* Year badge (top-right of hero) */
.mayors-hero-badge {
    min-width: 130px;
    text-align: center;
    border: 1px solid var(--mayors-edge-strong);
    border-radius: 18px;
    padding: 18px 22px;
    background: radial-gradient(180px 90px at 50% 0%, rgba(212, 139, 255, 0.14), transparent 70%), rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mayors-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #55ff55;
    box-shadow: 0 0 8px #55ff55;
    animation: mayors-pulse 2s ease-in-out infinite;
    margin-bottom: 6px;
}

@keyframes mayors-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.mayors-hero-badge-label {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mayors-muted);
    font-weight: 700;
    margin: 0;
}

.mayors-hero-badge-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--mayors-gold);
    margin: 0;
    line-height: 1;
}

/* ── Loading & Error ─────────────────────────── */
.mayors-loading {
    text-align: center;
    padding: 64px 20px;
    color: var(--mayors-muted);
}

.mayors-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--mayors-purple);
    border-radius: 50%;
    animation: mayors-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes mayors-spin {
    to { transform: rotate(360deg); }
}

.mayors-error {
    text-align: center;
    padding: 40px 20px;
    color: #ff7a7a;
    background: rgba(255, 100, 100, 0.08);
    border: 1px solid rgba(255, 100, 100, 0.2);
    border-radius: 14px;
    margin-bottom: 24px;
}

.mayors-hidden { display: none !important; }

/* ── Section headers ─────────────────────────── */
.mayors-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mayors-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mayors-text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mayors-section-icon { font-size: 1.1rem; }

.mayors-section-subtitle {
    color: var(--mayors-muted);
    font-size: 0.85rem;
    margin: 0;
}

.mayors-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(85, 255, 85, 0.1);
    color: #55ff55;
    border: 1px solid rgba(85, 255, 85, 0.3);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-top: 2px;
    flex-shrink: 0;
}

.mayors-live-dot-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #55ff55;
    box-shadow: 0 0 5px #55ff55;
    animation: mayors-pulse 2s ease-in-out infinite;
}

/* ── Current Mayor card ─────────────────────── */
.current-mayor-wrap {
    border: 1px solid var(--mayors-edge);
    border-radius: 18px;
    overflow: hidden;
    background: var(--mayors-card);
    position: relative;
}

.current-mayor-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--mayor-color, #d48bff), transparent 55%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
}

.current-mayor-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
}

@media (max-width: 720px) {
    .current-mayor-inner { grid-template-columns: 1fr; }
    .current-mayor-skin-col { display: flex; justify-content: center; padding: 24px 24px 0; }
}

.current-mayor-skin-col {
    padding: 32px 16px 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid var(--mayors-edge);
    min-width: 140px;
}

@media (max-width: 720px) {
    .current-mayor-skin-col {
        border-right: none;
        border-bottom: 1px solid var(--mayors-edge);
        padding: 24px;
    }
}

.current-mayor-skin {
    width: auto;
    height: 200px;
    max-width: 110px;
    image-rendering: pixelated;
    background: transparent;
    object-fit: contain;
}

.current-mayor-name-col {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.current-mayor-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--mayor-color, var(--mayors-purple));
    margin: 0 0 6px;
}

.current-mayor-name {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    margin: 0 0 4px;
    color: #fff;
    line-height: 1;
}

.current-mayor-category {
    font-size: 0.8rem;
    color: var(--mayors-muted);
    margin: 0 0 20px;
}

.current-mayor-perks-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--mayors-muted);
    margin: 0 0 10px;
}

.mayor-perks-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mayor-perk-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--mayors-edge);
    border-radius: 10px;
    padding: 10px 14px;
}

.mayor-perk-item.is-minister-perk {
    border-color: rgba(255, 170, 0, 0.35);
    background: rgba(255, 170, 0, 0.06);
}

.mayor-perk-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mayor-perk-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
}

.perk-minister-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 170, 0, 0.18);
    color: var(--mayors-gold);
    border: 1px solid rgba(255, 170, 0, 0.35);
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.perk-secret-badge {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(85, 255, 255, 0.1);
    color: #55ffff;
    border: 1px solid rgba(85, 255, 255, 0.3);
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mayor-perk-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--mayors-muted);
}

/* Minister info panel */
.current-minister-panel {
    padding: 18px 32px 26px;
    border-top: 1px solid var(--mayors-edge);
}

.minister-label {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--mayors-muted);
    margin: 0 0 10px;
}

.minister-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.minister-skin {
    width: auto;
    height: 72px;
    max-width: 40px;
    image-rendering: pixelated;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
}

.minister-info { flex: 1; min-width: 0; }

.minister-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin: 0 0 3px;
}

.minister-perk-name {
    font-size: 0.82rem;
    color: var(--mayors-muted);
    margin: 0 0 4px;
}

.minister-perk-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--mayors-muted);
}

/* ── Election candidate cards ────────────────── */
.election-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

@media (max-width: 480px) {
    .election-grid { grid-template-columns: 1fr; }
}

.election-card {
    border: 1px solid var(--mayors-edge);
    border-radius: 16px;
    background: var(--mayors-card);
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}

.election-card:hover {
    transform: translateY(-2px);
    border-color: var(--mayors-edge-strong);
}

.election-card.is-leading {
    border-color: rgba(255, 170, 0, 0.4);
}

.election-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 12px;
}

.election-skin {
    width: auto;
    height: 110px;
    max-width: 60px;
    image-rendering: pixelated;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
    align-self: flex-end;
}

.election-card-info { flex: 1; min-width: 0; }

.election-mayor-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.election-mayor-category {
    font-size: 0.75rem;
    color: var(--mayors-muted);
    margin: 0;
}

.election-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.leading-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 170, 0, 0.18);
    color: var(--mayors-gold);
    border: 1px solid rgba(255, 170, 0, 0.4);
    border-radius: 999px;
    padding: 2px 8px;
}

.election-vote-block {
    padding: 0 18px 14px;
}

.election-vote-nums {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.election-vote-count {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--mayors-text);
}

.election-vote-pct {
    font-size: 0.8rem;
    color: var(--mayors-muted);
}

.election-vote-bar-bg {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.election-vote-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--mayor-color, #d48bff);
    transition: width 0.6s ease;
    min-width: 2px;
}

.election-perks-wrap {
    border-top: 1px solid var(--mayors-edge);
    padding: 12px 18px 16px;
}

.election-perks-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--mayors-muted);
    margin: 0 0 8px;
}

/* ── All mayors grid ─────────────────────────── */
.all-mayors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 900px) {
    .all-mayors-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .all-mayors-grid { grid-template-columns: 1fr; }
}

.mayor-ref-card {
    border: 1px solid var(--mayors-edge);
    border-radius: 16px;
    background: var(--mayors-card);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mayor-ref-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--mayor-color, #d48bff) 40%, transparent);
    box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--mayor-color, #d48bff) 30%, transparent);
}

.mayor-ref-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--mayors-edge);
    background: rgba(0, 0, 0, 0.18);
    position: relative;
    overflow: hidden;
}

.mayor-ref-card-top::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--mayor-color, #d48bff);
}

.mayor-ref-skin {
    width: auto;
    height: 90px;
    max-width: 48px;
    image-rendering: pixelated;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
    align-self: flex-end;
}

.mayor-ref-info { flex: 1; min-width: 0; }

.mayor-ref-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin: 0 0 3px;
}

.mayor-ref-subtitle {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--mayors-muted);
    display: block;
    margin-top: 1px;
}

.mayor-ref-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mayor-category-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.08);
    color: var(--mayors-muted);
    border-radius: 999px;
    padding: 2px 8px;
}

.mayor-type-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 2px 8px;
}

.mayor-type-badge.special {
    background: rgba(170, 85, 255, 0.14);
    color: #cc88ff;
    border: 1px solid rgba(170, 85, 255, 0.3);
}

.mayor-type-badge.one-time {
    background: rgba(255, 170, 0, 0.14);
    color: var(--mayors-gold);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.mayor-type-badge.current {
    background: rgba(85, 255, 85, 0.1);
    color: #55ff55;
    border: 1px solid rgba(85, 255, 85, 0.3);
}

.mayor-ref-perks {
    padding: 12px 16px 14px;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mayor-ref-perk {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--mayors-edge);
    border-radius: 8px;
    padding: 8px 12px;
}

.mayor-ref-perk.is-minister-perk {
    border-color: rgba(255, 170, 0, 0.3);
    background: rgba(255, 170, 0, 0.05);
}

.mayor-ref-perk.is-secret-perk {
    border-color: rgba(85, 255, 255, 0.2);
    background: rgba(85, 255, 255, 0.04);
}

.mayor-ref-perk-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.mayor-ref-perk-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff;
}

.mayor-ref-perk-desc {
    font-size: 0.77rem;
    line-height: 1.5;
    color: var(--mayors-muted);
}

/* ── MC color spans (set by JS) ──────────────── */
.mc-text span { /* inherits color from inline style */ }
