/* ===== Socle commun des petits jeux de la campagne =====
 * Fond Nouvelle Énergie, bandeau bénévole, menu entre les jeux, boutons de
 * partage, bouton Adhérer, petit message et bas de page. Chaque jeu ajoute
 * ensuite sa propre feuille de style. */
:root {
  --ne-blue: #1d257a;
  --ne-blue-dark: #0f1752;
  --ne-chamois: #b0ad85;
  --ne-chamois-light: #dedbbd;
  --ne-indigo: #4a36a3;
  --on-bg: #ffffff;
  --on-bg-muted: rgba(255, 255, 255, 0.72);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-line: rgba(255, 255, 255, 0.16);
  --font: "Montserrat", Arial, sans-serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--on-bg);
  background:
    radial-gradient(circle at 85% -10%, rgba(74, 54, 163, 0.55), transparent 55vw),
    linear-gradient(160deg, var(--ne-blue) 0%, var(--ne-blue-dark) 70%);
  background-color: var(--ne-blue-dark);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
}

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

/* Barres diagonales de fond */
.bg-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bar {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.07) 45%, rgba(255, 255, 255, 0));
  transform: rotate(-28deg);
  animation: drift var(--d) ease-in-out infinite alternate;
}

.bar--dark {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.24) 45%, rgba(0, 0, 0, 0));
}

.bar--accent {
  background: linear-gradient(90deg, transparent, rgba(176, 173, 133, 0.5) 50%, transparent);
}

@keyframes drift {
  from {
    translate: -3vw 2vh;
  }
  to {
    translate: 4vw -3vh;
  }
}

/* Bandeau bénévole */
.ribbon {
  position: relative;
  z-index: 2;
  background: var(--ne-chamois);
  color: var(--ne-blue-dark);
  font: 600 0.78rem/1.3 var(--font);
  text-align: center;
  padding: 7px 16px;
}

.ribbon strong {
  font-weight: 800;
}

.tricolore {
  display: inline-block;
  width: 18px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, #002395 33.3%, #ffffff 33.3% 66.6%, #ed2939 66.6%);
  box-shadow: 0 0 0 1px rgba(15, 23, 82, 0.25);
}

@media (max-width: 480px) {
  .ribbon {
    font-size: 0.68rem;
    padding: 6px 10px;
  }
}

/* Menu entre les jeux */
.jeux-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.jeux-nav::-webkit-scrollbar {
  display: none;
}

.jeux-nav a {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--on-bg);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.jeux-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.jeux-nav a[aria-current="page"] {
  background: var(--ne-chamois);
  border-color: var(--ne-chamois);
  color: var(--ne-blue-dark);
}

.jeux-nav .jeux-nav-titre {
  background: none;
  border: 0;
  padding-left: 0;
  color: var(--ne-chamois);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  font: 800 0.95rem var(--font);
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-adherer {
  background: var(--ne-chamois);
  color: var(--ne-blue-dark);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-line);
  color: var(--on-bg);
}

/* Boutons de partage (mêmes couleurs que le simulateur) */
.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  font: 700 0.9rem var(--font);
  text-align: left;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.share-btn svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.share-btn--natif {
  grid-column: 1 / -1;
  justify-content: center;
  background: var(--ne-chamois);
  color: var(--ne-blue-dark);
}

.share-btn--x {
  background: #000000;
}

.share-btn--whatsapp {
  background: #167a43;
}

.share-btn--facebook {
  background: #166fe5;
}

.share-btn--telegram {
  background: #177bb0;
}

.share-btn--linkedin {
  background: #0a66c2;
}

.share-btn--lien {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--panel-line);
}

.share-fallback {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(176, 173, 133, 0.18);
  border: 1px solid rgba(176, 173, 133, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
}

.share-fallback a {
  color: var(--ne-chamois-light);
  font-weight: 800;
}

/* Petit message */
.toast {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ne-blue-dark);
  font-weight: 800;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.55);
  translate: -50% -12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, translate 0.2s ease;
}

.toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

/* Bas de page */
.disclaimer {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  color: var(--on-bg-muted);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
