:root {
  --blush: #FFF0F5;
  --blush-deep: #FFE4EC;
  --paper: #FFF8FA;
  --rose: #F7A8C4;
  --rose-soft: #EC7FA9;
  --rose-strong: #DB5E8C;   /* przyciski z białym tekstem – kontrast > 3:1 przy dużym, pogrubionym tekście */
  --plum: #7A3352;
  --plum-soft: #9A5873;
  --lavender: #E9D5FF;
  --line: #F8CADB;
  --dot: #FFD3E2;
  --empty-step: #F9D3E1;

  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--plum);
  background-color: var(--blush);
  background-image:
    radial-gradient(var(--dot) 1.4px, transparent 1.6px),
    linear-gradient(180deg, var(--blush) 0%, var(--blush-deep) 100%);
  background-size: 22px 22px, 100% 100%;
}

/* ---------- układ ---------- */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.stage > * {
  width: 100%;
  max-width: 520px;
}

.card {
  padding: clamp(28px, 7vw, 48px) clamp(20px, 6vw, 44px);
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 32px;
  box-shadow:
    inset 0 1px 0 #fff,
    0 24px 60px -28px rgba(219, 94, 140, 0.45);
}

/* ---------- pasek postępu ---------- */

.progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress li {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--empty-step);
  transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress .is-done {
  background: var(--rose);
}

.progress .is-current {
  background: var(--rose-strong);
  transform: scale(1.35);
}

/* ---------- ekrany ---------- */

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

/* ---------- typografia ---------- */

.greeting {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: #B4486F;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 1.3rem + 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--plum);
}

.headline-sm {
  font-size: clamp(1.6rem, 1.15rem + 2.2vw, 2.25rem);
  line-height: 1.15;
}

.headline:focus {
  outline: none;
}

.hint {
  margin: 10px 0 0;
  color: var(--plum-soft);
  font-weight: 600;
}

/* ---------- przyciski ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
  padding: 16px 32px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:focus-visible,
.food:focus-visible,
.activity-toggle:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}

.btn-yes {
  color: #fff;
  background: var(--rose-strong);
  box-shadow:
    0 12px 24px -12px rgba(219, 94, 140, 0.8),
    inset 0 -3px 0 rgba(122, 51, 82, 0.12);
}

.btn-yes:active {
  transform: scale(0.96);
}

.btn-yes:disabled {
  background: #F2B9CF;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

@media (hover: hover) {
  .btn-yes:not(:disabled):hover {
    background: #CF5182;
  }
}

.btn-no {
  color: var(--plum);
  background: #fff;
  border: 2px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- ekran 1: Tak / Nie ---------- */

.choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.choices .btn {
  margin-top: 0;
}

#yes {
  transform: scale(var(--grow, 1));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

#yes:active {
  transform: scale(calc(var(--grow, 1) * 0.96));
}

.btn-no.is-loose {
  position: fixed;
  z-index: 50;
  margin: 0;
  transition: left 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), top 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.btn-no.is-flying {
  pointer-events: none;
}

.no-placeholder {
  display: inline-block;
  flex: none;
  transition: width 0.4s ease, margin 0.4s ease;
}

/* zwinięty placeholder znosi też odstęp flexa (gap: 16px), żeby „Tak” stało dokładnie na środku */
.no-placeholder.is-collapsed {
  width: 0 !important;
  margin-left: -16px;
}

/* zdjęcie przy próbach „Nie”: u góry ekranu, żeby nie zasłaniało „Tak”; pod „Nie” (z-index 50) */
.no-image {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  z-index: 40;
  width: min(45vw, 220px);
  aspect-ratio: 3 / 4;
  max-height: 35vh;
  object-fit: cover;
  background: var(--paper);
  border: 6px solid #fff;
  border-radius: 24px;
  box-shadow:
    0 0 0 2px var(--line),
    0 24px 60px -24px rgba(219, 94, 140, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) rotate(var(--tilt, 0deg));
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.no-image.is-shown {
  opacity: 1;
  visibility: visible;
  transition: none;
  animation: no-image-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes no-image-in {
  from {
    opacity: 0;
    transform: translateX(-50%) rotate(calc(var(--tilt, 0deg) * -2)) scale(0.4);
  }
}

/* ---------- ekran 2: godzina przyjazdu ---------- */

.time-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.time-part {
  min-width: 108px;
  padding: 8px 40px 8px 18px;     /* po prawej strzałka */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.25rem;             /* > 16px, więc iOS nie zoomuje przy fokusie */
  line-height: 1.2;
  text-align: center;
  text-align-last: center;
  color: var(--plum);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DB5E8C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat;
  border: 2px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.time-part option {
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.time-part:focus {
  border-color: var(--rose-strong);
  box-shadow: 0 0 0 4px rgba(219, 94, 140, 0.22);
  outline: none;
}

.time-colon {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--plum);
}

/* ---------- ekran 3: jedzenie ---------- */

.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .food-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.food {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 8px 16px;
  color: var(--plum);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.food-emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.food::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.85rem;
  color: #fff;
  background: var(--rose-strong);
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.food[aria-pressed="true"] {
  background: #FFE3EE;
  border-color: var(--rose-strong);
}

.food[aria-pressed="true"]::after {
  transform: scale(1);
}

.food[aria-pressed="true"] .food-emoji {
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  50% {
    transform: scale(1.18);
  }
}

@media (hover: hover) {
  .food[aria-pressed="false"]:hover {
    border-color: var(--rose);
  }
}

/* ---------- ekran 4: plan dnia ---------- */

.plan {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  text-align: left;
}

/* telefon: „Odłożone” pod agendą; szerzej: obok siebie, w szerszej karcie */
@media (min-width: 640px) {
  .stage > .screen-wide {
    max-width: 640px;
  }

  .plan {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-label {
  margin: 0;
  padding-left: 6px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plum-soft);
}

/* min-height: pusta lista musi dalej przyjmować upuszczoną kartę */
.activity-list {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* karta nigdy nie wystaje poza kolumnę */
  align-content: start;
  gap: 8px;
  min-height: 76px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 2px solid transparent;
  border-radius: 24px;
}

#agenda {
  counter-reset: step;
  background: var(--blush);
}

#parked {
  border-color: var(--line);
  border-style: dashed;
}

.activity-list:empty::before {
  content: attr(data-empty);
  padding: 16px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--plum-soft);
}

.activity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 8px 8px 12px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--plum);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#agenda .activity {
  counter-increment: step;
}

#agenda .activity::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--rose-strong);
}

#parked .activity {
  color: var(--plum-soft);
  background: var(--paper);
}

#parked .activity-emoji {
  opacity: 0.7;
}

.activity-emoji {
  flex: none;
  font-size: 1.4rem;
  line-height: 1;
}

.activity-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--plum);
  background: var(--blush-deep);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

#parked .activity-toggle {
  color: #fff;
  background: var(--rose-strong);
}

.activity.is-chosen {
  border-color: var(--rose-strong);
  box-shadow: 0 10px 24px -14px rgba(219, 94, 140, 0.8);
  cursor: grabbing;
}

.activity.is-ghost {
  opacity: 0.4;
}

/* karta pod palcem/kursorem: Sortable daje jej inline opacity 0.8, przez co prześwitywał tekst spod spodu */
.activity.sortable-fallback {
  opacity: 1 !important;
  box-shadow: 0 18px 36px -14px rgba(219, 94, 140, 0.85);
}

@media (hover: hover) {
  .activity:hover {
    border-color: var(--rose);
  }

  #agenda .activity-toggle:hover {
    background: var(--line);
  }

  #parked .activity-toggle:hover {
    background: #CF5182;
  }
}

/* ---------- ekran 5: podsumowanie ---------- */

.summary {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.summary li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
}

.summary-icon {
  flex: none;
  font-size: 1.3rem;
}

.status {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-weight: 700;
}

.status.is-error {
  color: #A8325E;
}

.status.is-sent {
  margin-top: 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  text-wrap: balance;
}

[hidden] {
  display: none !important;
}

/* ---------- mniej ruchu ---------- */

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