/* ============================================================
   PAGE VOTES — votes.php
   ============================================================ */

/* .btn-primary (aussi utilisé sur l'accueil, voir accueil.css) */
.btn-primary {
  background: var(--magic-10);
  border: 1px solid var(--magic-color);
  color: var(--magic-color);
  padding: 15px 40px; font-size: 1.1rem; font-family: var(--font-title);
  border-radius: 50px; cursor: pointer; transition: var(--trans);
  text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary:hover {
  background: var(--magic-color); color: var(--black);
  box-shadow: 0 0 20px var(--magic-glow), inset 0 0 10px var(--white-50);
  transform: translateY(-3px);
}

/* .status-bar / .status-inner (structure aussi utilisée sur l'accueil, voir accueil.css) */
.status-bar {
  background: var(--bg2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border);
  padding: 10px 0; text-align: center;
}
.status-inner { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.9rem; }

/* .feature-card (carte de base, aussi utilisée sur l'accueil, voir accueil.css) —
   sert de socle pour .votes-explain-card / .votes-reward-card / .votes-site-card ci-dessous */
.feature-card {
  flex: 0 0 clamp(220px, 30vw, 320px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s ease;
}
.feature-card h3 { color: var(--magic-color); font-size: 1.3rem; margin-bottom: 1rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }
.feature-card:hover {
  transform: translateY(-8px);
  border-color: var(--magic-color);
  box-shadow: 0 10px 30px var(--black-50), 0 0 15px var(--magic-glow);
}

/* ============================================================
   PAGE VOTES — /votes/
   Réutilise les variables déjà utilisées ailleurs sur le site
   (--magic-color, --muted) avec un repli si elles ne sont pas
   définies dans ce fichier.
   ============================================================ */

/* Réduit les marges par défaut de .section-title dans le contexte des votes,
   pour éviter les grands espaces vides hérités du style global du site. */
.votes-sites-section .section-title,
.votes-rewards-section .section-title,
.votes-explain .section-title {
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 0.5rem;
}

.votes-topbar {
  /* Le fond/bordure viennent du composant .status-bar déjà défini
     dans le style de base du site ; on ajuste juste la mise en page. */
  margin-bottom: 0.75rem;
}

.votes-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.votes-topbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Bloc pseudo — une seule ligne compacte
   ------------------------------------------------------------ */

.votes-pseudo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.votes-pseudo-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.votes-pseudo-entry.votes-hidden,
.votes-pseudo-confirmed.votes-hidden {
  display: none;
}

.votes-pseudo-confirmed {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.votes-pseudo-icon {
  font-size: 1.1rem;
}

.votes-pseudo-input {
  width: 190px;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--white-15);
  background: var(--black-35);
  color: var(--white);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.votes-pseudo-input:focus {
  outline: none;
  border-color: var(--magic-color);
}

.votes-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--white-15);
  background: var(--white-05);
  color: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.votes-edit-btn:hover {
  background: var(--white-12);
  transform: rotate(-8deg);
}

.votes-verify-btn {
  white-space: nowrap;
  padding: 0.5rem 1.05rem;
  font-size: 0.88rem;
}

.votes-pseudo-error {
  color: var(--red-alt);
  font-size: 0.8rem;
  min-height: 0;
  margin: 0;
}

.votes-pseudo-error--topbar {
  text-align: center;
  margin: 0.35rem auto 0;
  padding: 0 1.5rem;
}

.votes-pseudo-error:empty {
  display: none;
}

.votes-pseudo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--green-alt);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--green-alt-12);
  border: 1px solid var(--green-alt-30);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.votes-pseudo-badge::before {
  content: '✓';
}

.spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid var(--white-35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: votes-spin 0.7s linear infinite;
  vertical-align: -0.15em;
  margin-right: 0.4em;
}

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

/* ------------------------------------------------------------
   Popup d'édition du pseudo
   ------------------------------------------------------------ */

.votes-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--black-60);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.votes-modal-overlay.show {
  display: flex;
}

.votes-modal {
  position: relative;
  background: var(--modal-dark);
  border: 1px solid var(--white-10);
  border-radius: 16px;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px var(--black-50);
}

.votes-modal h3 {
  margin-top: 0;
}

.votes-modal .votes-pseudo-input {
  width: 100%;
  margin: 1rem 0 0.25rem;
  box-sizing: border-box;
}

.votes-modal .btn-primary {
  margin-top: 1rem;
  width: 100%;
}

.votes-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.votes-modal-close:hover {
  color: var(--white);
}

/* ------------------------------------------------------------
   Explications
   ------------------------------------------------------------ */

.votes-explain {
  padding: 2rem 1.5rem 3rem;
}

.votes-explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

/* .feature-card fournit déjà fond/bordure/ombre/hover du site ;
   on ajuste seulement la taille et le contenu pour ce contexte. */
.feature-card.votes-explain-card {
  width: auto;
  height: auto;
  padding: 1.25rem 1.1rem;
}

.votes-explain-icon {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}

.votes-explain-card h3 {
  margin: 0 0 0.5rem;
}

.votes-explain-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

/* ------------------------------------------------------------
   Carrousel de récompenses — défilement infini automatique
   ------------------------------------------------------------ */

.votes-rewards-section {
  padding: 1.75rem 0;
  overflow: hidden;
}

.votes-rewards-wrapper {
  position: relative;
  overflow: hidden;
  margin-top: 1.25rem;
}

.votes-rewards-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8rem;
  z-index: 2;
  pointer-events: none;
}

.votes-rewards-fade--left {
  left: 0;
  background: linear-gradient(to right, var(--rewards-fade-bg), transparent);
}

.votes-rewards-fade--right {
  right: 0;
  background: linear-gradient(to left, var(--rewards-fade-bg), transparent);
}

.votes-rewards-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  will-change: transform;
}

.votes-rewards-track.is-playing {
  animation: votes-marquee var(--votes-marquee-duration, 30s) linear infinite;
}

.votes-rewards-wrapper:hover .votes-rewards-track.is-playing {
  animation-play-state: paused;
}

@keyframes votes-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--votes-marquee-distance, -50%)); }
}

@media (prefers-reduced-motion: reduce) {
  .votes-rewards-track.is-playing {
    animation: none;
  }
}

.feature-card.votes-reward-card {
  flex: 0 0 auto;
  width: 200px;
  height: auto;
  padding: 1rem;
}

.votes-reward-card:hover {
  box-shadow: 0 12px 30px var(--magic-15);
}

.votes-reward-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.votes-reward-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.votes-reward-name {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.votes-reward-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

/* ------------------------------------------------------------
   Grille des sites de vote
   ------------------------------------------------------------ */

.votes-sites-section {
  padding: 0 1.5rem 2rem;
}

.votes-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 0;
}

/* .feature-card fournit fond/bordure/ombre/hover du site ;
   on repasse en layout vertical aligné à gauche pour ce contenu. */
.feature-card.votes-site-card {
  width: auto;
  height: auto;
  text-align: left;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.votes-site-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.votes-site-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.votes-site-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.votes-site-reset {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.votes-site-fragments {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.votes-site-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--white-03);
}

.votes-status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.votes-site-status[data-status="ready"] .votes-status-dot {
  background: var(--green-alt);
  box-shadow: 0 0 8px var(--green-alt);
}

.votes-site-status[data-status="ready"] .votes-status-text {
  color: var(--green-alt);
  font-weight: 600;
}

.votes-site-status[data-status="waiting"] .votes-status-dot {
  background: var(--orange);
}

.votes-site-status[data-status="waiting"] .votes-status-text {
  color: var(--orange);
}

.votes-site-status[data-status="idle"] .votes-status-dot,
.votes-site-status[data-status="unknown"] .votes-status-dot {
  background: var(--muted);
}

.votes-site-btn {
  text-align: center;
  text-decoration: none;
  margin-top: auto;
}