/* Couleurs et tailles : tout est ici, à changer librement. */
:root {
  --pink: #ff4fa3;
  --cyan: #2de2e6;
  --violet: #7b2ff7;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.72);
  --ink-faint: rgba(255, 255, 255, 0.42);
  --card: rgba(18, 8, 38, 0.82);
  --row: rgba(255, 255, 255, 0.06);
  --row-current: rgba(255, 79, 163, 0.16);
  --width: 480px;
  --radius: 18px;
  --scale: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: transparent;
  overflow: hidden;
}

body {
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  padding: 12px;
  -webkit-font-smoothing: antialiased;
}

.sg {
  width: var(--width);
  zoom: var(--scale);
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* liseré dégradé rose -> cyan */
.sg::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(135deg, var(--pink), var(--violet) 55%, var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* --- en-tête ------------------------------------------------------------------------------------------ */
.sg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.sg-head[hidden] { display: none; }

.sg-label {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sg-total {
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255, 79, 163, 0.55);
}
.sg-total small {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 6px;
  text-shadow: none;
}
.sg-total.bump { animation: bump 0.6s ease-out; }

/* --- lignes ------------------------------------------------------------------------------------------- */
.sg-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal {
  display: grid;
  grid-template-columns: 64px 1fr 22px;
  align-items: center;
  column-gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--row);
  transition: background 0.4s, opacity 0.4s;
}

.goal-subs {
  font-weight: 800;
  font-size: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 3px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
}

.goal-title {
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.goal-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
}

/* atteint */
.goal.done { opacity: 0.55; }
.goal.done .goal-title { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.5); }
.goal.done .goal-mark {
  border: none;
  background: var(--cyan) no-repeat center / 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23120826' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* en cours */
.goal.current {
  background: var(--row-current);
  padding-top: 12px;
  padding-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 79, 163, 0.5);
}
.goal.current .goal-subs { background: var(--pink); color: #fff; }
.goal.current .goal-title { font-size: 19px; }
.goal.current .goal-mark { border-color: var(--pink); animation: pulse 1.6s ease-in-out infinite; }

.goal-progress {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: none;
}
.goal.current .goal-progress { display: block; }

.goal-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.goal-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  box-shadow: 0 0 12px rgba(45, 226, 230, 0.6);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.goal-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.goal-meta b { color: var(--ink); }

/* à venir */
.goal.next .goal-title { color: var(--ink-soft); }

/* vient d'être atteint */
.goal.reached-now { animation: reached 2.4s ease-out; }

/* --- pied --------------------------------------------------------------------------------------------- */
.sg-foot {
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
}
.sg-foot.all {
  font-weight: 800;
  font-size: 18px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(45, 226, 230, 0.6);
}

/* --- animations --------------------------------------------------------------------------------------- */
@keyframes bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); color: var(--cyan); }
  100% { transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 163, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(255, 79, 163, 0); }
}
@keyframes reached {
  0% { background: rgba(45, 226, 230, 0.75); transform: scale(1.04); opacity: 1; }
  40% { background: rgba(45, 226, 230, 0.35); transform: scale(1.02); opacity: 1; }
  100% { background: var(--row); transform: scale(1); }
}
