/* Soutenir Mariana — site statique. Aucune dépendance, aucune police distante. */

:root {
  --jar-width: 430px;
  --bg: #f6f4fb;
  --bg-2: #eef3fb;
  --glow-a: #ded7f6;
  --glow-b: #d6e8f4;
  --ink: #4d5670;
  --ink-faint: #a6abbd;
  --card: #ffffff;
  --card-2: #f1f3fa;
  --line: #e2e6f1;
  --accent: #8f86c4;
  --accent-soft: #ece9f9;
  --shadow: 0 3px 0 #ced6e480, 0 18px 44px #3d526522;
}


* { box-sizing: border-box; }

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

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(58vw 46vw at 14% -6%, var(--glow-a) 0%, transparent 62%),
    radial-gradient(52vw 42vw at 92% 8%, var(--glow-b) 0%, transparent 60%),
    linear-gradient(178deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
}

button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 100px; }

#overflow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 24px 20px;
  display: grid;
  place-items: center;
}

.widget { width: min(var(--jar-width), 88vw, 52vh); display: grid; justify-items: center; }

.vessel { position: relative; width: 100%; aspect-ratio: 440 / 510; }

#hearts {
  width: 100%; height: 100%; display: block;
  pointer-events: auto; touch-action: none; cursor: pointer;
}

/* Liseré dégradé aux couleurs des trois emojis — rose du cœur, jaune du chat,
   orange de la crevette — partagé par le bouton Soutenir et la pastille du
   message. Un carré plus large tourne derrière, découpé en pastille par
   overflow: hidden ; sans ça les coins d'un bouton allongé débordent. */
.drop,
.reopen {
  padding: 2px;                 /* épaisseur du liseré */
  border: 0;
  border-radius: 100px;
  background: none;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.drop::before,
.reopen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg,
    #ff77b0, #ffa6cc, #ffd166, #f7b32b, #ff8c66, #f2603c, #ff77b0);
  animation: turn 4.6s linear infinite;
}
.drop span,
.reopen span {
  position: relative;           /* passe au-dessus du dégradé */
  display: block;
  border-radius: 100px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -.01em;
}

@keyframes turn {
  from { transform: translate(-50%, -50%) rotate(0turn); }
  to   { transform: translate(-50%, -50%) rotate(1turn); }
}

.drop {
  position: relative;
  margin-top: 6px;
  transition: transform .16s, box-shadow .16s;
}
.drop span { padding: 12px 26px; font-size: clamp(15px, 4vw, 17px); white-space: nowrap; }
.drop:hover { transform: translateY(-2px); }
.drop:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }

.counter { margin-top: 26px; text-align: center; }
#total {
  display: block;
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.counter small {
  display: block;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: .02em;
}

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

/* — Le mot d'intro — */

.note {
  width: min(420px, calc(100vw - 40px));
  padding: 30px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(165deg, var(--card), var(--card-2));
  color: var(--ink);
  box-shadow: 0 3px 0 var(--line), 0 26px 70px #29334a33;
}
.note::backdrop { background: #1a1a2acc; backdrop-filter: blur(3px); }
.note p { margin: 0 0 14px; font-size: 15px; line-height: 1.62; }
.note-hello {
  font-size: 21px !important;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 18px !important;
}
/* Croix de fermeture, centrée sous le texte. */
.note-close {
  display: block;
  width: 42px;
  height: 42px;
  margin: 24px auto 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  color: var(--ink-faint);
  font-size: 21px;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: transform .16s, color .16s;
}
.note-close:hover { transform: translateY(-2px); color: var(--ink); }
.note-close:active { transform: translateY(2px); }

/* Pastille du mot d'intro : même liseré que Soutenir, plus une respiration
   légère du bouton entier pour attirer l'œil. */
.reopen {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  max-width: calc(100vw - 36px);
  animation: swell 2.8s ease-in-out infinite;
}
.reopen span { padding: 9px 17px; font-size: 13px; line-height: 1.2; transition: transform .18s; }
.reopen:hover span { transform: scale(1.03); }
.reopen:active span { transform: scale(.97); }

@keyframes swell {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.055); }
}

/* — Bouton discret : vide le bocal, jamais le compteur — */

.clear {
  margin-top: 16px;
  padding: 6px 14px;
  border: 0;
  border-radius: 100px;
  background: none;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: .02em;
  transition: color .16s, background .16s;
}
.clear:hover { color: var(--ink); background: var(--accent-soft); }

/* — Le petit mot qui annonce le total, une fois le bocal rempli — */

.toast {
  position: fixed;
  left: 50%;
  top: 26px;
  z-index: 7;
  padding: 14px 26px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  color: var(--ink);
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 700;
  letter-spacing: -.015em;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--line), 0 20px 50px #29334a2e;
  opacity: 0;
  transform: translate(-50%, -18px);
  transition: opacity .45s, transform .45s cubic-bezier(.2, .9, .25, 1);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
