/* ============================================================
   Page « Concours à thème ».

   Elle s'appuie sur legal.css, qui porte déjà l'en-tête, le pied de page
   et les variables de thème (clair/sombre selon l'appareil). Seul ce qui
   lui est propre vit ici.
   ============================================================ */

.cc-liste { display: flex; flex-direction: column; gap: 16px; margin: 26px 0; }
.cc-attente { color: var(--muted); font-size: 15px; }

.cc-carte {
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); padding: 20px 22px;
}
/* Le concours en cours se distingue des autres : c'est celui sur lequel
   on peut encore agir, et donc le seul qui appelle une décision. */
.cc-carte.cc-en_cours {
  border-color: color-mix(in srgb, var(--violet) 45%, transparent);
  background: color-mix(in srgb, var(--violet) 7%, var(--surface));
}
.cc-carte.cc-termine { opacity: .7; }

.cc-haut { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cc-titre { font-size: 19px; font-weight: 700; letter-spacing: -.3px; margin: 0; }
.cc-etat {
  flex: none; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--violet) 16%, transparent); color: var(--violet-deep);
}
.cc-etat--en_cours { background: rgba(52, 211, 153, .16); color: #0f766e; }
.cc-etat--termine  { background: rgba(120, 120, 140, .16); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .cc-etat--en_cours { color: #34d399; }
}

.cc-dates { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.cc-regle { font-size: 15px; line-height: 1.6; margin: 12px 0 0; }
.cc-recompense { font-size: 14px; margin: 8px 0 0; font-weight: 600; }

/* ---- classement (membres connectés seulement) ---- */
.cc-classement { list-style: none; margin: 14px 0 26px; padding: 0; counter-reset: rang; }
.cc-rang {
  counter-increment: rang;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px; margin-bottom: 7px;
  background: var(--surface); border: 1px solid var(--border);
}
.cc-rang::before {
  content: counter(rang);
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
  background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet-deep);
}
.cc-rang:first-child::before { background: #f0b429; color: #1a1626; }
/* Se reconnaître dans la liste : c'est ce qui donne envie d'y monter. */
.cc-rang--moi {
  border-color: color-mix(in srgb, var(--violet) 55%, transparent);
  background: color-mix(in srgb, var(--violet) 10%, var(--surface));
}
.cc-pseudo { font-weight: 600; }
.cc-score { margin-left: auto; font-size: 13.5px; color: var(--muted); }

/* ---- appel à l'inscription, pour un visiteur ---- */
.cc-cta {
  margin: 26px 0; padding: 18px 20px; border-radius: 16px;
  background: color-mix(in srgb, var(--violet) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent);
}
.cc-cta[hidden] { display: none; }
.cc-cta p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.cc-btn {
  display: inline-block; padding: 11px 20px; border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff; font-weight: 700; text-decoration: none;
}
.cc-btn:hover { filter: brightness(1.08); text-decoration: none; }

.cc-regles { margin: 14px 0 24px; padding-left: 20px; }
.cc-regles li { margin-bottom: 10px; line-height: 1.65; }
.cc-fin { font-size: 14px; color: var(--muted); }

/* ---- ce qui manque pour concourir (membre connecté seulement) ----
   Une exclusion muette serait incompréhensible ; c'est aussi l'occasion
   de compléter son profil, ce que 87 membres sur 119 n'avaient pas fait
   au 09/08/2026. Ambre : il manque quelque chose à aller chercher, ce
   n'est pas une faute. */
.cc-manque {
  margin: 22px 0; padding: 18px 20px; border-radius: 16px;
  background: rgba(240, 180, 41, .10);
  border: 1px solid rgba(240, 180, 41, .35);
}
.cc-manque-titre { font-weight: 700; margin: 0 0 6px; }
.cc-manque p { margin: 0 0 12px; line-height: 1.6; }

/* ---- illustrations d'un concours (membre connecté seulement) ----
   La route publique ne possède aucun champ pour elles : ces règles ne
   servent jamais à un visiteur, et la page reste identique pour Google. */
.cc-photos { display: grid; gap: 8px; margin: 14px 0 4px; }
.cc-photos--multi { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.cc-photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line, rgba(255,255,255,.12));
  cursor: zoom-in; transition: transform .15s, filter .15s;
}
/* Une seule photo ne se recadre pas au format d'une vignette : elle est
   l'affiche, on la montre telle qu'elle a été composée. */
.cc-photos:not(.cc-photos--multi) .cc-photo {
  aspect-ratio: auto; max-height: 420px; object-fit: contain;
  background: rgba(0, 0, 0, .18);
}
.cc-photo:hover { transform: translateY(-2px); filter: brightness(1.06); }
.cc-photo:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }

/* La visionneuse. Trente lignes plutôt que six cents : albums.js et ses
   styles ne sont pas chargés sur cette page, et les y attirer pour
   quatre vignettes coûterait plus que de redire le geste ici. */
.cc-vue {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0, 0, 0, .92);
}
.cc-vue-img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.cc-vue-cpt {
  position: absolute; bottom: 18px; left: 0; right: 0; margin: 0;
  text-align: center; color: rgba(255, 255, 255, .8); font-size: 13px;
}
.cc-vue-cpt[hidden] { display: none; }
.cc-vue-nav, .cc-vue-fermer {
  position: absolute; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px;
  background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer;
}
.cc-vue-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 28px; }
.cc-vue-prec { left: 14px; }
.cc-vue-suiv { right: 14px; }
.cc-vue-fermer { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 18px; }
.cc-vue-nav:hover, .cc-vue-fermer:hover { background: rgba(255, 255, 255, .18); }
.cc-vue-nav:focus-visible, .cc-vue-fermer:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .cc-photo { transition: none; }
  .cc-photo:hover { transform: none; }
}


/* ---- mes invitations, en pastilles (membre connecté) ----
   Verte quand la personne compte, orange quand son profil n'est pas
   encore complet. La couleur ne porte JAMAIS seule : la phrase juste en
   dessous dit la même chose en toutes lettres, et la rangée porte son
   propre libellé pour les lecteurs d'écran. */
.cc-invitations {
  margin: 14px 0 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(240, 180, 41, .10);
  border: 1px solid rgba(240, 180, 41, .30);
}
/* Tout est complet : le bloc cesse d'alerter et vient féliciter. */
.cc-invitations--ok {
  background: rgba(34, 197, 94, .10);
  border-color: rgba(34, 197, 94, .32);
}
.cc-invitations-titre { margin: 0 0 8px; font-weight: 700; font-size: 15px; }
.cc-invitations-dit { margin: 9px 0 0; font-size: 14px; line-height: 1.6; }
.cc-pastilles { display: flex; flex-wrap: wrap; gap: 7px; }
.cc-pastille {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 1px solid rgba(0, 0, 0, .12);
}
.cc-pastille.ok { background: #22c55e; }
.cc-pastille.attente { background: #f0b429; }

/* ---- concours au vote : la galerie (membre connecté seulement) ----
   La route publique ne renvoie aucun candidat : ces règles ne servent
   jamais à un visiteur, et Googlebot n'étant jamais connecté, aucune
   photo de membre ne peut se retrouver dans un index. */
.cc-galerie { margin-top: 26px; }
.cc-candidats {
  display: grid; gap: 14px; margin: 16px 0 4px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.cc-candidat {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border-radius: 14px;
  border: 1px solid var(--line, rgba(124, 58, 237, .18));
  background: rgba(124, 58, 237, .04);
}
/* Le sien se repère du premier coup d'œil : sans repère, on cherche sa
   propre photo dans une grille de vingt. */
.cc-candidat--moi { border-color: rgba(124, 58, 237, .5); background: rgba(124, 58, 237, .10); }
/* Celui pour qui j'ai voté. Ma voix est secrète pour les autres, pas
   pour moi : je dois pouvoir retrouver mon choix. */
.cc-candidat--choisi { border-color: #22c55e; background: rgba(34, 197, 94, .10); }
.cc-candidat-photo {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 10px; cursor: zoom-in;
}
.cc-candidat-photo:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
.cc-candidat-nom { margin: 0; font-weight: 700; font-size: 14.5px; }
.cc-candidat-voix { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.cc-vote {
  margin-top: auto; padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, .45); background: transparent;
  color: inherit; font: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.cc-vote:hover:not(:disabled) { background: rgba(168, 85, 247, .12); }
.cc-vote:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
.cc-vote:disabled { opacity: .55; cursor: default; font-weight: 600; font-size: 12.5px; }
.cc-vote--choisi {
  background: #22c55e; border-color: #22c55e; color: #fff;
}
.cc-vote--choisi:hover:not(:disabled) { background: #16a34a; }

/* Se présenter, ou se retirer. */
.cc-participer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: rgba(124, 58, 237, .06);
  border: 1px solid rgba(124, 58, 237, .20);
}
.cc-participer-note { margin: 0; font-size: 14px; line-height: 1.6; }
.cc-participer-note--fine { flex: 1 1 100%; font-size: 13px; color: var(--muted); }
.cc-btn-ligne {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff; font-weight: 700; font-size: 14px;
  border: 0; cursor: pointer; text-decoration: none;
}
.cc-btn-ligne:hover { filter: brightness(1.08); text-decoration: none; }
.cc-btn-ligne:focus-within, .cc-btn-ligne:focus-visible { outline: 2px solid #a855f7; outline-offset: 2px; }
/* Le champ de fichier est caché DERRIÈRE le libellé, pas supprimé : le
   clavier doit pouvoir l'atteindre, et `display:none` l'en priverait. */
.cc-participer-choix input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.cc-participer-choix { position: relative; }
