/* Speelse laag (DELIGHT). Los van app.css: zonder dit bestand ziet de app er weer rustig uit.
   Alle beweging staat in het blok 'no-preference' onderaan; bij "beweging verminderen" blijft alleen de
   statische eindtoestand over. */

:root {
  --confetti-1: var(--green-600);
  --confetti-2: var(--green-700);
  --confetti-3: var(--green-800);
  --confetti-4: var(--amber-700);
  --confetti-5: var(--blue-700);
}

/* ------------------------------------------------------------ confetti en toast */
.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 60;
}

.toast-region {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
  z-index: 50;
}

.toast {
  background: var(--green-800);
  color: #fff;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 22%);
}

/* ------------------------------------------------------------ opgeslagen-paneel */
.saved-panel__check {
  width: 36px;
  height: 36px;
}

.saved-panel__fun {
  margin: 4px 0 8px;
  font-weight: 600;
  color: var(--green-800);
}

.saved-panel.is-queued .saved-panel__fun {
  color: var(--amber-700);
}

.saved-panel__fun[hidden] {
  display: none;
}

/* ------------------------------------------------------------ Vandaag */
.greeting {
  margin: 0 0 2px;
  color: var(--green-700);
}

.fun-fact {
  margin: -2px 0 14px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--amber-100);
  color: var(--amber-700);
  font-weight: 600;
}

/* ------------------------------------------------------------ groeimeter (teeltdetail) */
.growth {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.growth__plant {
  flex: none;
  width: 96px;
  height: 80px;
}

.growth__label {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-800);
}

.growth__note {
  margin: 2px 0 0;
  color: var(--muted);
}

.gm-soil {
  fill: var(--amber-100);
  stroke: var(--amber-700);
  stroke-width: 1.5;
}

.gm-seed {
  fill: var(--amber-700);
}

.gm-stem {
  fill: none;
  stroke: var(--green-700);
  stroke-width: 3;
  stroke-linecap: round;
}

.gm-leaf {
  fill: var(--green-600);
}

.gm-fruit {
  fill: var(--amber-700);
  stroke: var(--card);
  stroke-width: 1.5;
}

/* ------------------------------------------------------------ beweging */
@media (prefers-reduced-motion: no-preference) {
  @keyframes ogk-pop {
    0% { transform: scale(0.4); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
  }

  @keyframes ogk-draw {
    from { stroke-dashoffset: 26; }
    to { stroke-dashoffset: 0; }
  }

  @keyframes ogk-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }

  @keyframes ogk-flash {
    0% { background-color: var(--green-100); }
    100% { background-color: transparent; }
  }

  @keyframes ogk-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
  }

  @keyframes ogk-grow {
    from { transform: scaleY(0); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
  }

  @keyframes ogk-toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: none; }
  }

  .saved-panel.is-celebrating .saved-panel__icon {
    animation: ogk-pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  }

  .saved-panel.is-celebrating .saved-panel__check path {
    stroke-dasharray: 26;
    stroke-dashoffset: 26;
    animation: ogk-draw 0.4s 0.3s ease-out forwards;
  }

  .saved-panel.is-celebrating .saved-panel__fun {
    animation: ogk-rise 0.45s 0.5s ease-out both;
  }

  .saved-panel.is-queued .saved-panel__icon {
    animation: ogk-pulse 1.8s ease-in-out infinite;
  }

  .is-just-done {
    animation: ogk-flash 1.4s ease-out;
  }

  .is-just-done .badge--done {
    animation: ogk-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  }

  .alert--success {
    animation: ogk-rise 0.4s ease-out both;
  }

  .toast {
    animation: ogk-toast-in 0.35s cubic-bezier(0.2, 1.2, 0.4, 1) both;
    transition: opacity 0.35s, transform 0.35s;
  }

  .toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
  }

  .page-today .actions-grid > *,
  .page-today .stats > *,
  .page-today .fun-fact,
  .page-today .grid > .card {
    animation: ogk-rise 0.5s ease-out both;
  }

  .page-today .actions-grid > :nth-child(2),
  .page-today .stats > :nth-child(1) { animation-delay: 0.06s; }
  .page-today .stats > :nth-child(2),
  .page-today .grid > .card:nth-child(1) { animation-delay: 0.12s; }
  .page-today .stats > :nth-child(3),
  .page-today .grid > .card:nth-child(2) { animation-delay: 0.18s; }
  .page-today .fun-fact,
  .page-today .grid > .card:nth-child(3) { animation-delay: 0.24s; }
  .page-today .grid > .card:nth-child(n + 4) { animation-delay: 0.3s; }

  .btn-big {
    transition: transform 0.15s cubic-bezier(0.2, 1.6, 0.4, 1);
  }

  .btn-big:active {
    transform: scale(0.95);
  }

  .gm-part {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: ogk-grow 0.6s ease-out both;
  }

  .gm-1 { animation-delay: 0.1s; }
  .gm-2 { animation-delay: 0.35s; }
  .gm-3 { animation-delay: 0.6s; }
  .gm-4 { animation-delay: 0.9s; animation-name: ogk-pop; }
}
