@import url('/assets/css/fonts.css');

/* ============================================================================
   VoteRoyale — feuille unique, sans chaîne de build.

   Parti pris : la ligne de front. Le rapport de force n'est pas une barre posée
   sous les camps, c'est la FRONTIÈRE entre deux aplats de couleur qui se partagent
   l'écran. Elle se déplace à chaque vote — c'est l'image que l'on screenshote.
   Tout le reste de la page est tenu au calme pour que cette frontière soit la
   seule chose qui bouge.
   ========================================================================= */

:root {
  --paper:      #f1eff9;
  --surface:    #ffffff;
  --ink:        #17133a;
  --ink-soft:   #5f5989;
  --royal:      #5b2ee5;
  --royal-dark: #3f1cb8;
  --gold:       #ffc53d;
  --line:       #dedaf0;

  --radius:     20px;
  --wrap:       980px;
  --front:      28px;          /* décalage de la ligne de front */

  --font-display: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --font-body:    'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }
a  { color: var(--royal); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 680px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 99; }

:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 58px; }

.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.04em;
        text-decoration: none; color: var(--ink); margin-right: auto; }
.logo-royale { color: var(--royal); }

.header-tools { display: flex; align-items: center; gap: 8px; }

.country-btn, .burger {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  height: 36px; min-width: 36px; padding: 0 9px; font-size: 1rem; cursor: pointer; color: inherit;
}
.voices-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 13px;
  border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none;
  font-weight: 800; font-size: .95rem;
}
.voices-icon { font-size: .9rem; }

.site-nav[hidden] { display: none; }
.site-nav { display: flex; flex-direction: column; padding: 6px 18px 14px; gap: 2px; border-top: 1px solid var(--line); }
.site-nav a { padding: 11px 4px; text-decoration: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.site-nav a:last-child { border-bottom: 0; }
@media (min-width: 760px) {
  .site-nav[hidden] { display: flex; }
  .site-nav { flex-direction: row; justify-content: center; gap: 22px; border-top: 1px solid var(--line); padding: 0 18px; }
  .site-nav a { border-bottom: 0; padding: 12px 0; font-size: .95rem; }
  .burger { display: none; }
}

/* ------------------------------------------------- bandeau de la voix du jour */

.daily {
  margin: 16px 0 22px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  border-bottom: 4px solid var(--gold);
}
.daily-title { font-size: 1.05rem; margin: 0 0 4px; color: var(--gold); }
.daily-state { margin: 0; font-weight: 600; }
.daily-streak { margin: 6px 0 0; font-size: .9rem; opacity: .8; }

/* ----------------------------------------------------------------- l'arène */

.hero { margin-bottom: 34px; }
.hero-link { text-decoration: none; color: inherit; }
.hero-title { margin-bottom: 14px; }

.arena {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

/* Duel : deux aplats qui se partagent la surface, séparés par une oblique.
   Le flex-grow porte le score (borné pour qu'un camp écrasé reste cliquable). */
.arena-duel { flex-direction: column; min-height: 540px; }
.arena-duel .camp { flex: var(--share, 50) 1 0; min-height: 190px; }
.arena-duel .camp:first-child {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--front)), 0 100%);
  padding-bottom: calc(var(--front) + 14px);
}
.arena-duel .camp:last-child {
  margin-top: calc(var(--front) * -1);
  clip-path: polygon(0 var(--front), 100% 0, 100% 100%, 0 100%);
  padding-top: calc(var(--front) + 14px);
}
@media (min-width: 760px) {
  .arena-duel { flex-direction: row; min-height: 380px; }
  .arena-duel .camp:first-child {
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--front)) 100%, 0 100%);
    padding: 22px calc(var(--front) + 14px) 22px 22px;
  }
  .arena-duel .camp:last-child {
    margin: 0 0 0 calc(var(--front) * -1);
    clip-path: polygon(var(--front) 0, 100% 0, 100% 100%, 0 100%);
    padding: 22px 22px 22px calc(var(--front) + 14px);
  }
}

.camp {
  position: relative;
  background: var(--camp-color);
  color: #fff;
  padding: 20px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  transition: flex-grow .7s cubic-bezier(.2, .8, .2, 1);
}
.camp-head { display: flex; align-items: baseline; gap: 9px; }
.camp-emoji { font-size: 1.5rem; }
.camp-label { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.camp-score { display: flex; align-items: baseline; gap: 10px; }
.camp-pct {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 10vw, 4rem); line-height: .95;
  font-variant-numeric: tabular-nums; letter-spacing: -.04em;
}
.camp-pct:empty { display: none; }
.camp-count { font-size: .9rem; opacity: .85; font-weight: 600; }
.camps-args { margin: 26px 0 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .camps-args { grid-template-columns: 1fr 1fr; } .camps-args h2 { grid-column: 1 / -1; } }
.camp-arg { border-left: 4px solid var(--camp-color); padding: 2px 0 2px 14px; }
.camp-arg h3 { margin: 0 0 3px; font-size: 1.05rem; }
.camp-arg p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.camp-bar { display: none; }

.vote-btn {
  margin-top: 10px; align-self: flex-start;
  background: #fff; color: var(--ink);
  border: 0; border-radius: 999px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  padding: 13px 26px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.vote-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(0, 0, 0, .22); }
.vote-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.vote-btn[disabled] { opacity: .55; cursor: default; box-shadow: none; transform: none; }

/* Top : un tableau d'affichage, une bande par candidat. */
.arena-top { flex-direction: column; background: transparent; gap: 8px; }
.arena-top .camp {
  border-radius: 14px; padding: 13px 16px;
  flex-direction: row; align-items: center; gap: 12px;
  min-height: 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
}
.arena-top .camp-head { flex: 1 1 auto; min-width: 0; }
.arena-top .camp-label { font-size: 1.05rem; }
.arena-top .camp-score { flex-direction: column; gap: 0; align-items: flex-end; }
.arena-top .camp-pct { font-size: 1.6rem; color: var(--camp-color); }
.arena-top .camp-count { font-size: .78rem; color: var(--ink-soft); }
.arena-top .camp-blurb { display: none; }
.arena-top .camp-bar {
  display: block; position: absolute; inset: auto 0 0 0; height: 4px;
  background: var(--line); border-radius: 0 0 14px 14px; overflow: hidden;
}
.arena-top .camp-bar span { display: block; height: 100%; background: var(--camp-color); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.arena-top .vote-btn {
  margin: 0; padding: 9px 17px; font-size: .9rem;
  background: var(--ink); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18);
}

.arena-meta { margin: 12px 0 0; font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
.badge-new {
  display: inline-block; background: var(--gold); color: var(--ink);
  font-weight: 800; font-size: .78rem; padding: 3px 10px; border-radius: 999px;
}

/* ------------------------------------------------------------------ listes */

.section { margin: 34px 0; }
.section-title { margin-bottom: 14px; }

.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-decoration: none; color: var(--ink);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--royal); }
.card-cat { font-size: 1.2rem; }
.card-title { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; line-height: 1.15; }
.card-tagline { font-size: .9rem; color: var(--ink-soft); }
.card-foot { margin-top: auto; padding-top: 8px; font-size: .82rem; color: var(--ink-soft); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -18px 24px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.chip:hover { border-color: var(--royal); }

.upsets { list-style: none; margin: 0; padding: 0; }
.upsets li { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* -------------------------------------------------------------- page match */

.crumbs { font-size: .85rem; color: var(--ink-soft); margin: 16px 0 10px; }
.crumbs a { color: var(--ink-soft); }
.match-title { margin-bottom: 6px; }
.match-tagline { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 20px; }

.share { margin: 16px 0 0; }
.share-btn {
  background: var(--royal); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 22px; font-family: var(--font-display); font-weight: 800; font-size: .95rem; cursor: pointer;
}
.share-btn:hover { background: var(--royal-dark); }

.numbers, .story, .how, .prose { margin: 30px 0; }
.numbers h2, .story h2 { margin-bottom: 10px; }
.numbers h3 { margin: 18px 0 6px; color: var(--ink-soft); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.story h3 { margin: 22px 0 6px; }
.numbers p, .story p, .how p, .prose p { max-width: 66ch; }
.numbers { border-left: 4px solid var(--gold); padding-left: 16px; }

.match-foot { margin: 34px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-soft); }
.match-foot p { margin: 0 0 4px; }

.lead { font-size: 1.1rem; color: var(--ink-soft); }
.empty { color: var(--ink-soft); }

.btn {
  display: inline-block; background: var(--royal); color: #fff; text-decoration: none;
  border-radius: 999px; padding: 12px 24px; font-family: var(--font-display); font-weight: 800;
}
.btn:hover { background: var(--royal-dark); }

/* --------------------------------------------------- suggestion de pays */

.country-suggest[hidden] { display: none; }
.country-suggest {
  background: var(--gold); color: var(--ink);
  padding: 11px 18px; font-weight: 600; font-size: .92rem;
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.country-suggest button {
  border: 0; background: var(--ink); color: #fff; border-radius: 999px;
  padding: 7px 15px; font-weight: 700; cursor: pointer; font-size: .88rem;
}
.country-suggest button.ghost { background: transparent; color: var(--ink); text-decoration: underline; padding: 7px 4px; }

/* ------------------------------------------------------------------ footer */

.site-footer { margin-top: 56px; background: var(--ink); color: #cfc9ec; padding: 30px 0 36px; }
.footer-claim { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.05rem; max-width: 46ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0; font-size: .9rem; }
.footer-nav a { color: #cfc9ec; text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-copy { font-size: .82rem; opacity: .65; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ------------------------------------------------------- listes de service */

.ranking { list-style: none; counter-reset: rank; margin: 20px 0; padding: 0; }
.ranking li {
  counter-increment: rank;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.ranking li::before {
  content: counter(rank);
  font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  min-width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.ranking li:nth-child(1)::before { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.ranking li:nth-child(2)::before,
.ranking li:nth-child(3)::before { background: var(--ink); border-color: var(--ink); color: #fff; }
.rank-name { flex: 1 1 auto; font-weight: 600; }
.rank-score { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }

.my-votes { list-style: none; margin: 12px 0; padding: 0; }
.my-votes li { padding: 10px 0; border-bottom: 1px solid var(--line); }

.note { font-size: .85rem; color: var(--ink-soft); margin-top: 26px; }

.byline { font-size: .88rem; color: var(--ink-soft); margin: -6px 0 22px; font-weight: 600; }
.prose h2 { margin: 30px 0 8px; }
.prose h3 { margin: 22px 0 6px; }
.prose ul, .prose ol { max-width: 66ch; }
.prose li { margin-bottom: 6px; }
.sources { font-size: .85rem; color: var(--ink-soft); margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Rapport de force sur une carte de listing : qui mène, de combien, en un coup d'œil.
   Rien n'est rendu tant qu'aucune voix n'a été exprimée. */
.card-lead { display: block; margin-top: 10px; }
.card-lead-bar {
  display: block; height: 6px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(to right,
    var(--lead-color) 0 var(--lead-share),
    var(--rest-color) var(--lead-share) 100%);
}
.card-lead-text { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.card-lead-name { font-weight: 600; font-size: .9rem; flex: 1 1 auto; min-width: 0;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-lead-pct {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; color: var(--lead-color);
}
.card-cta { color: var(--royal); font-weight: 700; }
.card-foot { display: flex; align-items: center; gap: 10px; }
.card-lead-of { font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.section-more { margin-top: 14px; font-weight: 700; }
.section-more a { text-decoration: none; }
.section-more a:hover { text-decoration: underline; }

/* Courbe du rapport de force : une colonne par jour, dessinée en SVG dans la page. */
.history { margin: 30px 0; }
.history-note { font-size: .9rem; color: var(--ink-soft); max-width: 66ch; }
.history-svg {
  display: block; width: 100%; height: 120px;
  border-radius: 12px; overflow: hidden; background: var(--surface);
}
.history-axis {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--ink-soft); margin: 6px 0 0;
}

/* Formulaire de connexion : un seul champ, donc rien qui distraie. */
.login-form { display: grid; gap: 10px; max-width: 420px; margin: 22px 0 30px; }
.login-form label { font-weight: 700; font-size: .92rem; }
.login-form input {
  font: inherit; padding: 13px 15px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--ink);
}
.login-form input:focus { border-color: var(--royal); outline: none; }
.login-form .btn { border: 0; cursor: pointer; font-size: 1rem; justify-self: start; }
.form-error {
  background: #fde8e4; border-left: 4px solid #d62f2f; color: #7a1c1c;
  padding: 10px 14px; border-radius: 0 10px 10px 0; font-weight: 600;
}
.form-ok {
  background: #e6f6ee; border-left: 4px solid #1f9d5f; color: #14603a;
  padding: 10px 14px; border-radius: 0 10px 10px 0; font-weight: 600;
}
.account-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 18px 0;
}
.account-box p { margin: 0 0 6px; }
.account-box p:last-child { margin-bottom: 0; }
.propose-form select, .propose-form textarea {
  font: inherit; padding: 13px 15px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--ink); width: 100%;
}
.propose-form select:focus, .propose-form textarea:focus { border-color: var(--royal); outline: none; }
.propose-form textarea { resize: vertical; min-height: 120px; }
.propose-form .note { margin: -4px 0 4px; }

/* Badge de camp : le premier signe, après un vote, que le site vous a reconnu. */
.my-camp {
  display: flex; align-items: center; gap: 9px;
  margin: 14px 0 0; padding: 11px 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--camp-color); border-radius: 0 12px 12px 0;
  font-weight: 700;
}
.my-camp-flag { font-size: 1.2rem; }
.my-camp-count { margin-left: auto; font-weight: 600; font-size: .85rem; color: var(--ink-soft); }
.mvps { margin: 30px 0; }
.mvps .ranking { margin-top: 12px; }

/* Page « débloque ton pays » : la barre affiche un compte réel, jamais arrondi vers le haut. */
.unlock { margin: 22px 0 10px; }
.unlock-bar {
  height: 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); overflow: hidden;
}
.unlock-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--royal), var(--gold));
}
.unlock-count { margin: 8px 0 0; font-size: .95rem; color: var(--ink-soft); }
.unlock-count strong { color: var(--ink); font-family: var(--font-display); font-size: 1.2rem; }
.arena-source { margin: 10px 0 0; font-size: .9rem; color: var(--ink-soft); font-weight: 600; }

/* Packs de voix : la seule page du site où un montant est affiché. */
.packs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 22px 0; }
.pack {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 20px 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
}
.pack:hover { border-color: var(--royal); transform: translateY(-2px); }
.pack-voices { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--royal); }
.pack-label { font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.pack-price { margin-top: 8px; font-weight: 800; }
.arena-more { margin: 8px 0 0; font-weight: 700; }
