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

:root {
    --gold:    #c9a227;
    --gold-lt: #f0d060;
    --gold-dk: #8b6914;
    --dark:    #0a0308;
    --dark2:   #120608;
    --dark3:   #1c0d10;
    --card:    #16080b;
    --text:    #e8d8c0;
    --muted:   #9a8070;
}

html { scroll-behavior: smooth; }

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 42%, rgba(255,255,255,.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 38% 8%,  rgba(255,255,255,.50) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 60%, rgba(255,255,255,.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 22%, rgba(255,255,255,.60) 0%, transparent 100%),
        radial-gradient(1px 1px at 82% 75%, rgba(255,255,255,.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 38%, rgba(255,255,255,.50) 0%, transparent 100%),
        radial-gradient(1px 1px at 5%  88%, rgba(255,255,255,.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 47% 95%, rgba(255,255,255,.45) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 18% 68%, rgba(201,162,39,.5) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 63% 12%, rgba(201,162,39,.4) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 88% 52%, rgba(201,162,39,.5) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── Nav ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: .9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10,3,8,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201,162,39,.2);
    transition: background .3s;
}
.nav-brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.nav-brand img { height: 46px; width: auto; }
.nav-brand-text { line-height: 1.1; }
.nav-brand-text strong { display: block; color: var(--gold); font-family: 'Playfair Display', serif; font-size: .9rem; letter-spacing: 1px; }
.nav-brand-text span  { color: #aaa; font-size: .65rem; text-transform: uppercase; letter-spacing: 1.5px; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; }
.nav-links a { color: #bbb; text-decoration: none; font-size: .82rem; font-weight: 500; letter-spacing: .5px; transition: color .2s; }
.nav-links a:hover { color: var(--gold); }
.btn-nav {
    background: linear-gradient(135deg, var(--gold), var(--gold-dk));
    color: #fff !important; padding: .45rem 1.1rem;
    border-radius: 30px; font-weight: 600 !important; transition: opacity .2s !important;
}
.btn-nav:hover { opacity: .85; }
.hamburger { display: none; background: none; border: none; color: var(--gold); font-size: 1.4rem; cursor: pointer; }

/* ── Hero ── */
.hero {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 7rem 2rem 4rem;
    background: radial-gradient(ellipse at center top, #3a0c1a 0%, #120608 45%, #050205 100%);
}
.hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 120px;
    background: linear-gradient(to bottom, transparent, var(--dark)); pointer-events: none;
}
.hero-logo {
    width: min(320px, 70vw); height: auto; margin-bottom: 2rem;
    filter: drop-shadow(0 0 40px rgba(201,162,39,.4));
    animation: floatLogo 4s ease-in-out infinite;
}
@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.hero-tagline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 4vw, 2.6rem);
    color: var(--gold-lt); text-shadow: 0 0 30px rgba(201,162,39,.5);
    margin-bottom: .8rem; line-height: 1.3;
}
.hero-sub { font-size: clamp(.9rem, 2vw, 1.05rem); color: #b0a090; max-width: 560px; margin: 0 auto 2.2rem; font-weight: 300; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-bottom: 2.5rem; }
.hero-badge {
    background: rgba(201,162,39,.12); border: 1px solid rgba(201,162,39,.3);
    color: var(--gold); padding: .35rem .9rem; border-radius: 30px;
    font-size: .78rem; font-weight: 600; letter-spacing: .5px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.scroll-hint {
    position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%);
    color: rgba(201,162,39,.5); font-size: .75rem; letter-spacing: 2px;
    text-transform: uppercase; animation: scrollBounce 2s ease-in-out infinite; z-index: 1;
}
.scroll-hint i { display: block; text-align: center; font-size: 1.1rem; margin-top: .3rem; }
@keyframes scrollBounce {
    0%, 100% { opacity: .5; transform: translateX(-50%) translateY(0); }
    50%       { opacity: 1;  transform: translateX(-50%) translateY(6px); }
}

/* ── Boutons ── */
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dk)); color: #fff;
    padding: .85rem 2rem; border-radius: 40px; text-decoration: none;
    font-weight: 600; font-size: .9rem; letter-spacing: .5px;
    box-shadow: 0 4px 24px rgba(201,162,39,.35); transition: all .25s;
    display: inline-flex; align-items: center; gap: .5rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(201,162,39,.5); color: #fff; }
.btn-outline {
    border: 2px solid var(--gold); color: var(--gold);
    padding: .8rem 2rem; border-radius: 40px; text-decoration: none;
    font-weight: 600; font-size: .9rem; letter-spacing: .5px;
    transition: all .25s; display: inline-flex; align-items: center; gap: .5rem;
}
.btn-outline:hover { background: var(--gold); color: #fff; transform: translateY(-2px); }

/* ── Sections ── */
section { position: relative; z-index: 1; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--gold-lt); text-align: center; margin-bottom: .5rem; }
.section-divider { width: 80px; height: 2px; background: linear-gradient(to right, transparent, var(--gold), transparent); margin: .5rem auto 2.5rem; }
.section-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-top: -.5rem; margin-bottom: 2rem; }

/* ── À propos ── */
.about { padding: 6rem 2rem; background: var(--dark2); }
.about-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-img { border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); border: 1px solid rgba(201,162,39,.2); }
.about-img img { width: 100%; height: 420px; object-fit: cover; display: block; }
.about-content h2 { font-family: 'Playfair Display', serif; font-size: 1.9rem; color: var(--gold-lt); margin-bottom: 1.2rem; line-height: 1.3; }
.about-content p  { color: #c0a890; margin-bottom: 1rem; font-size: .93rem; }
.about-stat-row { display: flex; gap: 1.5rem; margin-top: 1.8rem; }
.about-stat { text-align: center; flex: 1; background: rgba(201,162,39,.07); border: 1px solid rgba(201,162,39,.2); border-radius: 12px; padding: 1rem; }
.about-stat strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--gold); }
.about-stat span   { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* ── Élections ── */
.elections { padding: 6rem 2rem; background: var(--dark); }
.elections-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.8rem; }
.election-card { background: var(--card); border: 1px solid rgba(201,162,39,.2); border-radius: 16px; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.election-card:hover { transform: translateY(-4px); box-shadow: 0 16px 50px rgba(201,162,39,.15); }
.election-card-header { background: linear-gradient(135deg, #2a0c14, #1a0810); padding: 1.5rem; border-bottom: 1px solid rgba(201,162,39,.15); text-align: center; }
.election-crown { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dk)); display: flex; align-items: center; justify-content: center; margin: 0 auto .8rem; font-size: 1.2rem; color: #fff; box-shadow: 0 4px 20px rgba(201,162,39,.4); }
.election-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--gold-lt); line-height: 1.3; }
.election-title em { color: var(--muted); font-style: normal; font-size: .88rem; font-family: 'Raleway', sans-serif; display: block; margin-top: .2rem; }
.election-card-body { padding: 1.2rem 1.5rem 1.5rem; }
.election-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: .78rem; }
.badge-open   { background: rgba(40,167,69,.15); color: #5dca7a; border: 1px solid rgba(40,167,69,.3); padding: .25rem .7rem; border-radius: 20px; font-weight: 600; }
.badge-closed { background: rgba(255,100,100,.1); color: #ff8080; border: 1px solid rgba(255,100,100,.25); padding: .25rem .7rem; border-radius: 20px; font-weight: 600; }
.election-price { color: var(--gold); font-weight: 600; }
.countdown { font-size: .75rem; color: var(--muted); margin-bottom: 1.2rem; display: flex; align-items: center; gap: .4rem; }
.countdown i { color: var(--gold-dk); }
.btn-vote { display: block; text-align: center; background: linear-gradient(135deg, var(--gold), var(--gold-dk)); color: #fff; padding: .7rem 1.5rem; border-radius: 30px; text-decoration: none; font-weight: 600; font-size: .85rem; transition: opacity .2s, transform .2s; }
.btn-vote:hover { opacity: .85; transform: translateY(-1px); color: #fff; }
.btn-vote-disabled { display: block; text-align: center; background: rgba(255,255,255,.05); color: var(--muted); padding: .7rem 1.5rem; border-radius: 30px; text-decoration: none; font-weight: 500; font-size: .85rem; cursor: not-allowed; }
.no-elections { text-align: center; color: var(--muted); padding: 3rem; grid-column: 1/-1; }

/* ── Top 3 dans les cartes élection ── */
.election-top3 { margin: 0 0 1.2rem; border-top: 1px solid rgba(201,162,39,.12); padding-top: 1rem; }
.election-top3-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); display: flex; align-items: center; margin-bottom: .7rem; }
.top3-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.top3-medal { font-size: 1rem; flex-shrink: 0; width: 1.4rem; text-align: center; }
.top3-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(201,162,39,.3); flex-shrink: 0; }
.top3-avatar-fallback { width: 34px; height: 34px; border-radius: 50%; background: rgba(201,162,39,.08); border: 2px solid rgba(201,162,39,.2); display: none; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; flex-shrink: 0; }
.top3-info { flex: 1; min-width: 0; }
.top3-nom { font-size: .78rem; color: var(--gold-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .18rem; }
.top3-bar-wrap { height: 3px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.top3-bar { height: 100%; background: linear-gradient(to right, var(--gold-dk), var(--gold)); border-radius: 3px; }
.top3-votes { font-size: .72rem; color: var(--gold); font-weight: 700; flex-shrink: 0; min-width: 2.5rem; text-align: right; }
.election-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.election-actions .btn-vote { flex: 1; }
.btn-classement { flex: 1; display: block; text-align: center; border: 1px solid rgba(201,162,39,.4); color: var(--gold); padding: .7rem 1rem; border-radius: 30px; text-decoration: none; font-weight: 600; font-size: .82rem; transition: all .2s; }
.btn-classement:hover { background: rgba(201,162,39,.1); color: var(--gold); transform: translateY(-1px); }

/* ── Candidats ── */
.candidats { padding: 6rem 2rem; background: var(--dark3); }
.candidats-inner { max-width: 1200px; margin: 0 auto; }
.candidats-election-label { text-align: center; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 2.5rem; }
.candidats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 800px; margin: 0 auto; }
.candidat-card {
    background: var(--card);
    border: 1px solid rgba(201,162,39,.15);
    border-radius: 14px; overflow: hidden;
    transition: transform .25s, box-shadow .25s;
    position: relative;
}
.candidat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(201,162,39,.15); }
.candidat-card.top1 { border-color: #ffd700; box-shadow: 0 0 20px rgba(255,215,0,.2); }
.candidat-card.top2 { border-color: #c0c0c0; }
.candidat-card.top3 { border-color: #cd7f32; }
.candidat-rank {
    position: absolute; top: .6rem; left: .6rem;
    background: rgba(0,0,0,.65); border-radius: 20px;
    padding: .15rem .55rem; font-size: .72rem; font-weight: 700; color: #fff;
}
.candidat-rank.r1 { background: #b8860b; }
.candidat-rank.r2 { background: #888; }
.candidat-rank.r3 { background: #8b4513; }
.candidat-photo { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.candidat-photo-placeholder { width: 100%; aspect-ratio: 3/4; background: #1e0d14; display: flex; align-items: center; justify-content: center; color: rgba(201,162,39,.3); font-size: 3rem; }
.candidat-info { padding: .8rem; }
.candidat-nom  { font-family: 'Playfair Display', serif; font-size: .88rem; color: var(--gold-lt); margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidat-titre { font-size: .7rem; color: var(--muted); margin-bottom: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidat-votes-bar { margin-bottom: .3rem; }
.candidat-votes-bar-inner { height: 4px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.candidat-votes-bar-fill { height: 100%; background: linear-gradient(to right, var(--gold-dk), var(--gold)); border-radius: 4px; transition: width .5s ease; }
.candidat-votes-count { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); }
.candidat-votes-count strong { color: var(--gold); font-weight: 700; }
.live-dot { display: inline-block; width: 7px; height: 7px; background: #5dca7a; border-radius: 50%; animation: livePulse 1.5s ease-in-out infinite; margin-right: .4rem; }
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.4); }
}

/* ── Inscription ── */
.inscription { padding: 6rem 2rem; background: var(--dark2); text-align: center; }
.inscription-inner { max-width: 800px; margin: 0 auto; }
.inscription h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--gold-lt); margin-bottom: .8rem; }
.inscription p { color: #b0a090; font-size: .95rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.inscription-steps { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; margin-bottom: 2.5rem; }
.step { background: rgba(201,162,39,.07); border: 1px solid rgba(201,162,39,.2); border-radius: 12px; padding: 1.2rem 1.5rem; text-align: center; width: 180px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto .7rem; font-family: 'Playfair Display', serif; }
.step p { font-size: .78rem; color: #b0a090; margin-bottom: 0; }
.inscription-fee { font-size: .82rem; color: var(--muted); margin-top: -1rem; margin-bottom: 2rem; }
.inscription-fee strong { color: var(--gold); }

/* ── Galerie ── */
.galerie { padding: 6rem 2rem; background: var(--dark); }
.galerie-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.galerie-item { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; border: 1px solid rgba(201,162,39,.15); transition: transform .25s; cursor: pointer; }
.galerie-item:hover { transform: scale(1.03); }
.galerie-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 50%); display: flex; align-items: flex-end; padding: .6rem .8rem; }
.galerie-legende { font-size: .72rem; color: rgba(255,255,255,.85); }
.galerie-vide { text-align: center; color: var(--muted); padding: 3rem; grid-column: 1/-1; font-size: .9rem; }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 9000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s; }
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.8); }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.5rem; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; opacity: .7; transition: opacity .2s; }
.lightbox-close:hover { opacity: 1; }
.lightbox-caption { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: .82rem; text-align: center; }

/* ── Partenaires ── */
.partenaires { padding: 4rem 2rem; background: var(--dark2); }
.partenaires-label { text-align: center; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 2rem; }
.partenaires-grid { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2.5rem; }
.partenaire-item { text-align: center; }
.partenaire-link { display: inline-block; transition: opacity .2s; }
.partenaire-link:hover { opacity: .75; }
.partenaire-item img { max-height: 70px; max-width: 160px; object-fit: contain; filter: grayscale(20%); display: block; }
.partenaire-nom-only { display: block; font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--gold-lt); margin-bottom: .4rem; }
.partenaire-meta { margin-top: .4rem; }
.partenaire-name-label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.partenaire-socials { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.partenaire-socials a { width: 28px; height: 28px; border-radius: 50%; background: rgba(201,162,39,.1); border: 1px solid rgba(201,162,39,.2); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: .7rem; text-decoration: none; transition: all .2s; }
.partenaire-socials a:hover { background: var(--gold); color: #fff; }

/* ── Footer ── */
footer { background: #05020a; border-top: 1px solid rgba(201,162,39,.15); padding: 3rem 2rem 1.5rem; position: relative; z-index: 1; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.footer-brand img { height: 60px; width: auto; margin-bottom: 1rem; }
.footer-brand p { font-size: .8rem; color: var(--muted); max-width: 280px; line-height: 1.6; }
.footer-col h4 { color: var(--gold); font-size: .8rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 1rem; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { color: #888; text-decoration: none; font-size: .82rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--gold); }
.footer-social { display: flex; gap: .8rem; margin-top: 1rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(201,162,39,.1); border: 1px solid rgba(201,162,39,.25); display: flex; align-items: center; justify-content: center; color: var(--gold); text-decoration: none; font-size: .85rem; transition: all .2s; }
.footer-social a:hover { background: var(--gold); color: #fff; }
.footer-bottom { max-width: 1100px; margin: 1.5rem auto 0; display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: #555; flex-wrap: wrap; gap: .5rem; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .candidats-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
    .candidats-grid { grid-template-columns: 1fr; max-width: 280px; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: rgba(10,3,8,.97); padding: 1rem 2rem; border-bottom: 1px solid rgba(201,162,39,.2); gap: .8rem; }
    .hamburger { display: block; }
    .about-inner { grid-template-columns: 1fr; gap: 2rem; }
    .about-img img { height: 280px; }
    .about-stat-row { gap: .8rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .galerie-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
