/* ==========================================================
   outfit.css – the "What are you planning to wear?" checker
   in the dress code card.
   ========================================================== */

.outfit {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(168, 173, 143, .6);
}

.outfit__prompt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* Row of colour buttons – wraps neatly on phones */
.outfit__swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.7rem .7rem;          /* tall rows leave room for the colour name */
  max-width: 22rem;
  margin: 0 auto;
}

.outfit__swatch {
  position: relative;
  width: 2.6rem;              /* 42px – comfortable to tap */
  height: 2.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: var(--swatch);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(90, 102, 80, .2), 0 4px 10px -4px rgba(0, 0, 0, .25);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s ease, opacity .5s ease;
}
.outfit__swatch:hover { transform: translateY(-3px) scale(1.06); }
.outfit__swatch:focus-visible { outline: 2px solid var(--sage-forest, #5a6650); outline-offset: 6px; }

/* White needs an edge, or it disappears on the white card */
.outfit__swatch--white { box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(90, 102, 80, .35), inset 0 0 0 1px #e6e1d6, 0 4px 10px -4px rgba(0, 0, 0, .2); }

/* Selected colour */
.outfit__swatch[aria-pressed="true"] {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sage-forest, #5a6650), 0 6px 14px -5px rgba(0, 0, 0, .3);
}

/* Colour name – shown under the chosen or hovered swatch */
.outfit__name {
  position: absolute;
  top: calc(100% + .45rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.outfit__swatch[aria-pressed="true"] .outfit__name,
.outfit__swatch:hover .outfit__name { opacity: 1; }

/* The reply line */
.outfit__reply {
  min-height: 3.2em;          /* stops the card jumping as replies change */
  margin: 2rem 0 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.35;
  color: var(--sage-forest, #5a6650);
}
.outfit__reply.is-suspicious { color: #9a7a3c; }
.outfit__reply.is-no { color: #a8485e; font-weight: 600; }
.outfit__reply.is-new { animation: reply-in .45s cubic-bezier(.2, .7, .2, 1); }

@keyframes reply-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- White's reactions ---------- */

/* The whole card shakes its head */
.outfit-card.is-shaking { animation: head-shake .55s ease; }
@keyframes head-shake {
  0%, 100% { transform: none; }
  15% { transform: translateX(-9px) rotate(-1deg); }
  30% { transform: translateX(8px)  rotate(1deg); }
  45% { transform: translateX(-6px) rotate(-.5deg); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Second tap: the white dot dodges */
.outfit__swatch.is-dodging { animation: dodge .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes dodge {
  0%, 100% { transform: none; }
  40%      { transform: translateX(calc(var(--dodge-x))) rotate(-12deg); }
}

/* Fourth tap: it gives up and leaves */
.outfit__swatch.is-fleeing {
  transform: translateY(-14px) scale(0) rotate(90deg);
  opacity: 0;
  cursor: default;
  transition: transform .6s cubic-bezier(.6, -.4, .7, 1), opacity .6s ease;
}

/* …and sneaks back */
.outfit__swatch.is-returning { animation: sneak-back .9s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes sneak-back {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Hearts that float up from a good choice */
.outfit__heart {
  position: absolute;
  left: 50%;
  top: 0;
  font-size: .85rem;
  color: #d98b8b;
  pointer-events: none;
  animation: heart-up 1s ease-out var(--delay) both;
}
@keyframes heart-up {
  from { transform: translate(-50%, 0) scale(.4); opacity: 0; }
  20%  { opacity: 1; }
  to   { transform: translate(calc(-50% + var(--x)), -46px) scale(1); opacity: 0; }
}
