/* ===================================================
   Un An — design system bordeaux & beige
   =================================================== */

:root {
  --bordeaux: #7d2138;
  --bordeaux-fonce: #5e1728;
  --bordeaux-clair: #9e3049;
  --rose: #c98a97;
  --or: #b08a3e;
  --beige: #f4ebdd;
  --beige-2: #ede1cd;
  --creme: #fbf6ec;
  --encre: #3e2a2e;
  --encre-doux: rgba(62, 42, 46, 0.68);
  --ligne: rgba(125, 33, 56, 0.16);
  --ombre: 0 24px 60px -28px rgba(94, 23, 40, 0.35);
  --police-titre: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --police-texte: "Lora", Georgia, serif;
  --police-script: "Great Vibes", "Segoe Script", cursive;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.65;
  color: var(--encre);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 138, 151, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(176, 138, 62, 0.1), transparent 55%),
    var(--beige);
  min-height: 100vh;
}

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Cœurs flottants en fond ---------- */

.hearts-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hearts-bg span {
  position: absolute;
  bottom: -50px;
  color: var(--bordeaux);
  opacity: 0.07;
  animation: monter linear infinite;
}

@keyframes monter {
  to { transform: translateY(-115vh) rotate(14deg); }
}

/* ---------- Structure des pages ---------- */

.page-centre {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 100vh;
}

.carte {
  position: relative;
  z-index: 1;
  background: var(--creme);
  border: 1px solid var(--ligne);
  border-radius: 22px;
  box-shadow: var(--ombre);
  padding: clamp(32px, 6vw, 60px);
  max-width: 640px;
  width: 100%;
}

.carte-large { max-width: 760px; }

.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--or);
  margin: 0 0 14px;
}

h1 {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  line-height: 1.08;
  color: var(--bordeaux);
  margin: 0 0 18px;
}

h2 {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--bordeaux);
  margin: 34px 0 12px;
}

.script {
  font-family: var(--police-script);
  font-weight: 400;
  color: var(--bordeaux-clair);
}

.avant-propos {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--encre-doux);
}

.separateur {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--rose);
  margin: 26px 0;
  font-size: 0.8rem;
}

.separateur::before,
.separateur::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ligne);
}

.petit {
  font-size: 0.85rem;
  color: var(--encre-doux);
}

.signature {
  font-family: var(--police-script);
  font-size: 1.9rem;
  color: var(--bordeaux-clair);
  margin: 26px 0 0;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  background: var(--bordeaux);
  color: var(--creme);
  font-family: var(--police-texte);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  padding: 15px 30px;
  min-height: 48px;
  cursor: pointer;
  box-shadow: 0 14px 30px -14px rgba(94, 23, 40, 0.55);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--bordeaux-fonce);
  box-shadow: 0 18px 34px -14px rgba(94, 23, 40, 0.65);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn.inactif {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.inactif:hover {
  background: var(--bordeaux);
  transform: none;
}

.btn-fantome {
  background: transparent;
  color: var(--bordeaux);
  border: 1.5px solid rgba(125, 33, 56, 0.4);
  box-shadow: none;
}

.btn-fantome:hover {
  background: rgba(125, 33, 56, 0.06);
  box-shadow: none;
}

/* ---------- Page CGU ---------- */

.liste-cgu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.liste-cgu label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.liste-cgu label:hover { background: rgba(125, 33, 56, 0.05); }

.liste-cgu input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 4px;
  accent-color: var(--bordeaux);
  cursor: pointer;
}

.liste-cgu label:has(input:checked) {
  background: rgba(125, 33, 56, 0.06);
  border-color: var(--ligne);
}

.liste-cgu .case-speciale {
  background: rgba(125, 33, 56, 0.07);
  border: 1px solid var(--ligne);
  font-size: 1.08rem;
}

.coeur-battant {
  display: inline-block;
  color: var(--bordeaux-clair);
  font-size: 1.25em;
  vertical-align: middle;
  margin-left: 4px;
  animation: petit-battement 1.2s ease-in-out infinite;
}

@keyframes petit-battement {
  0%, 34%, 100% { transform: scale(1); }
  10% { transform: scale(1.4); }
  22% { transform: scale(1.12); }
}

.pied-cgu {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.compteur-cgu {
  font-size: 0.9rem;
  color: var(--encre-doux);
  margin: 0;
}

.compteur-cgu strong { color: var(--bordeaux); }

/* ---------- Page don ---------- */

.bloc-geo {
  border: 1.5px dashed rgba(125, 33, 56, 0.4);
  border-radius: 16px;
  background: var(--beige-2);
  padding: 20px 22px;
  margin: 28px 0;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.bloc-geo.trouve {
  border-style: solid;
  border-color: var(--bordeaux);
  background: rgba(125, 33, 56, 0.05);
}

.bloc-geo p { margin: 0; }

.attente::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: points 1.2s steps(4) infinite;
}

@keyframes points {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.bloc-don {
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 22px;
  margin: 24px 0;
  background: rgba(251, 246, 236, 0.7);
}

.bloc-don label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.bloc-don select {
  width: 100%;
  font-family: var(--police-texte);
  font-size: 1rem;
  color: var(--encre);
  background: var(--creme);
  border: 1.5px solid rgba(125, 33, 56, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.total-don {
  font-family: var(--police-titre);
  font-size: 1.5rem;
  color: var(--bordeaux);
  margin: 16px 0 0;
}

.note-majoration {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(176, 138, 62, 0.13);
  border: 1px solid rgba(176, 138, 62, 0.35);
}

.actions-don {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  min-height: 56px;
}

#refuser { z-index: 40; }

.secousse { animation: secousse 0.45s ease; }

@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- Page jeu ---------- */

.page-jeu {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 20px 20px;
}

.entete-jeu {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 10px;
}

.entete-jeu h1 { margin-bottom: 4px; }

.layout-jeu {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 26px;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  flex: 1;
}

.panneau-coeur {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.compteur-jeu {
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.1;
  color: var(--bordeaux);
  margin: 0;
}

.cps-jeu {
  font-size: 0.95rem;
  color: var(--encre-doux);
  margin: 0 0 10px;
}

.zone-clic {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: 26px;
}

#gros-coeur {
  background: none;
  border: none;
  padding: 0;
  width: min(300px, 62vw);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}

#gros-coeur svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 32px rgba(110, 27, 46, 0.35));
  animation: battement 2.8s ease-in-out infinite;
}

#gros-coeur:hover svg { filter: drop-shadow(0 24px 38px rgba(110, 27, 46, 0.45)); }

#gros-coeur:active { transform: scale(0.94); }

@keyframes battement {
  0%, 32%, 100% { transform: scale(1); }
  8% { transform: scale(1.05); }
  16% { transform: scale(1); }
  24% { transform: scale(1.04); }
}

.particule {
  position: absolute;
  font-family: var(--police-titre);
  font-style: italic;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--bordeaux);
  pointer-events: none;
  animation: envol 0.9s ease-out forwards;
}

@keyframes envol {
  to {
    transform: translateY(-95px);
    opacity: 0;
  }
}

.astuce {
  max-width: 340px;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--encre-doux);
  margin: 4px 0 0;
}

.boutique {
  background: var(--creme);
  border: 1px solid var(--ligne);
  border-radius: 22px;
  box-shadow: var(--ombre);
  padding: 24px;
  align-self: start;
}

.boutique h2 {
  margin: 0 0 2px;
  font-size: 1.6rem;
}

/* ---------- Pouvoirs ---------- */

.pouvoirs {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ligne);
}

.titre-pouvoirs { font-size: 1.3rem; }

#liste-pouvoirs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.pouvoir {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--police-texte);
  background: rgba(176, 138, 62, 0.1);
  border: 1px solid rgba(176, 138, 62, 0.45);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.pouvoir:hover:not(:disabled) {
  background: rgba(176, 138, 62, 0.18);
  border-color: var(--or);
  box-shadow: 0 10px 22px -14px rgba(176, 138, 62, 0.6);
}

.pouvoir:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pouvoir .p-nom {
  display: block;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
  color: var(--encre);
  margin-top: 2px;
}

.pouvoir .p-icone { font-size: 1.25rem; }

.pouvoir .p-effet {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--creme);
  background: var(--bordeaux-clair);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 6px 8px 0 0;
}

.pouvoir .p-cout {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #8a6a2a;
  margin-top: 6px;
}

/* ---------- Services mystères ---------- */

.rangee.mystere .nom {
  color: var(--encre-doux);
  letter-spacing: 0.2em;
}

.rangee.mystere .icone {
  filter: grayscale(1);
  opacity: 0.65;
}

.sous-titre-boutique {
  font-size: 0.85rem;
  color: var(--encre-doux);
  margin: 0 0 18px;
}

.rangee {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: rgba(244, 235, 221, 0.55);
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-family: var(--police-texte);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.rangee:hover:not(:disabled) {
  border-color: rgba(125, 33, 56, 0.5);
  background: rgba(125, 33, 56, 0.05);
  box-shadow: 0 10px 22px -14px rgba(94, 23, 40, 0.4);
}

.rangee:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rangee .icone {
  font-size: 1.9rem;
  line-height: 1;
}

.rangee .nom {
  display: block;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--encre);
}

.rangee .cout {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--bordeaux);
}

.rangee:disabled .cout { color: var(--encre-doux); }

.rangee .rendement {
  display: block;
  font-size: 0.78rem;
  color: var(--encre-doux);
}

.rangee .possede {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: 2rem;
  color: rgba(125, 33, 56, 0.45);
}

.pied-jeu {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.9rem;
  color: var(--encre-doux);
  margin-top: 22px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .layout-jeu { grid-template-columns: 1fr; }
  .boutique { align-self: stretch; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .carte { padding: 28px 22px; }
  .actions-don { flex-direction: column; align-items: stretch; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  .hearts-bg { display: none; }
  #gros-coeur svg { animation: none; }
  .attente::after { animation: none; content: "..."; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
