/* screen-pets.css — My Pets grid + Pet Detail. Owned by S2.
   Nothing in here may look like a warning. No red, no countdown, no alert.
   A pet that is not ready yet is drawn as calm and content, in soft teal. */

/* Hiding a control here relies on components.css's global
   `[hidden] { display: none !important; }` — .btn sets display:inline-flex and
   would otherwise beat the UA's low-specificity [hidden] rule. */

/* Shared: the emoji stand-in used when G.pets (S1) has not loaded. */
.care-emoji {
  display: block; text-align: center;
  user-select: none;
}
.care-emoji.is-happy { animation: care-pop var(--dur-slow) var(--ease-pop); }
@keyframes care-pop {
  40% { transform: scale(1.18) rotate(-4deg); }
  70% { transform: scale(.96) rotate(3deg); }
}

/* .speak is var(--tap) in components.css now — no local override needed. */
.pets-screen .speak,
.petdetail-screen .speak { box-shadow: var(--shadow); }

/* ====================================================================== */
/* Screen 1 — My Pets grid                                                */
/* ====================================================================== */

.pets-head {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}
.pets-head__title { margin: 0; flex: 1 1 auto; }

.pets-sub {
  margin: 0 0 var(--sp-4);
  color: var(--c-ink-soft); font-size: var(--fs-body);
}

.petgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--sp-3);
  max-width: 940px; margin: 0 auto;
}
.petgrid--empty { display: block; }

.petcard {
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-1);
  min-height: 190px;
  text-align: center;
  border: 3px solid transparent;
}
.petcard.is-waiting {
  border-color: var(--c-buck);
  box-shadow: var(--shadow-lg);
}

.petcard__art {
  position: relative;
  width: 110px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  max-width: 100%;
}
.petcard__art > svg,
.petcard__art > img { max-width: 100%; height: auto; display: block; }

.petcard__badge { top: -2px; right: -2px; }

.petcard__name {
  font-size: var(--fs-big); font-weight: 700; line-height: 1.1;
  word-break: break-word;
}
.petcard__wants {
  font-size: var(--fs-body); letter-spacing: 2px;
  min-height: 26px; color: var(--c-ink);
}
.petcard__wants.is-content { color: var(--c-ink-soft); letter-spacing: normal; }

.pets-empty {
  max-width: 420px; margin: var(--sp-5) auto 0;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-4);
}
.pets-empty__art { font-size: 72px; line-height: 1; }
.pets-empty__text { margin: 0; font-size: var(--fs-big); }

/* ====================================================================== */
/* Screen 2 — Pet Detail                                                  */
/* ====================================================================== */

.pd__back { font-size: var(--fs-body); padding: var(--sp-2) var(--sp-4); }

.pd__wrap {
  max-width: 900px; margin: var(--sp-4) auto 0;
  display: flex; flex-direction: column; gap: var(--sp-4);
}

.pd__hero {
  background: var(--c-surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: var(--sp-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  text-align: center;
}

.pd__art {
  width: 200px; height: 200px; max-width: 100%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.pd__art > svg,
.pd__art > img { max-width: 100%; height: auto; display: block; }
.pd__art:active { transform: scale(.97); }

.pd__headline {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  width: 100%;
}
.pd__name { margin: 0; line-height: 1.1; word-break: break-word; }

.pd__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
.pd__chip {
  background: var(--c-bg-2); color: var(--c-ink);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-body); font-weight: 700;
}

.pd__favs {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; justify-content: center;
  color: var(--c-ink-soft); font-size: var(--fs-body);
}
.pd__fav { font-size: 34px; line-height: 1; }

/* ---- dress-up --------------------------------------------------------- */
/* Hidden entirely when she owns no cosmetics — never an empty shelf. */

.pd__dressup {
  width: 100%;
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 2px dashed var(--c-line);
}
.pd__dressup__title {
  font-size: var(--fs-body); font-weight: 700;
  color: var(--c-ink-soft);
  margin-bottom: var(--sp-2);
}
.pd__dressup__row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  justify-content: center;
}

.dress {
  min-width: var(--tap); min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  border: 3px solid transparent;
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  color: var(--c-ink);
  font-family: var(--font); font-size: var(--fs-small);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  transition: transform var(--dur-fast) var(--ease-pop);
}
.dress:active { transform: scale(.94); }
.dress__icon { font-size: 30px; line-height: 1; }
.dress__name { max-width: 84px; line-height: 1.05; }

/* worn = chosen, not "correct". A soft teal ring, no tick, no lock. */
.dress.is-on {
  border-color: var(--c-accent);
  background: var(--c-surface);
  box-shadow: var(--shadow);
  font-weight: 700;
}

/* ---- need rows -------------------------------------------------------- */

.pd__panel {
  background: var(--c-surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: var(--sp-3);
}

.pd__needs { display: flex; flex-direction: column; gap: var(--sp-3); }

.need {
  display: grid;
  grid-template-columns: var(--tap) 1fr;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  background: var(--c-bg);
  border-radius: var(--r-md);
  padding: var(--sp-3);
}
.need.is-ready { background: var(--c-bg-2); }

.need__icon {
  width: var(--tap); height: var(--tap);
  min-width: var(--tap); min-height: var(--tap);
  border-radius: 50%;
  background: var(--c-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.need__icon:active { transform: scale(.94); }

.need__body { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.need__label { font-size: var(--fs-body); font-weight: 700; }

.need__ctrl { grid-column: 1 / -1; position: relative; }

.need__btn {
  width: 100%;
  min-height: var(--tap);
  font-size: var(--fs-big);
}

/* NOT a warning state — a contented one. Soft teal, rounded, calm. */
.need__done {
  display: flex; align-items: center; justify-content: center;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  background: #E7F6F6;
  color: #2F6F6F;
  font-size: var(--fs-body); font-weight: 700;
  text-align: center;
}

.pd__note {
  margin: var(--sp-4) var(--sp-2) var(--sp-2);
  text-align: center;
  color: var(--c-ink-soft);
  font-size: var(--fs-body);
}

/* the meter animating up after a care action */
.meter__fill.is-filling { box-shadow: 0 0 0 3px rgba(111, 207, 143, .35) inset; }

/* "+2 🐾" floating up out of the button */
.care-float {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, 0);
  font-size: var(--fs-big); font-weight: 700;
  color: #A9761A;
  pointer-events: none;
  animation: care-float 1.1s ease-out forwards;
  white-space: nowrap;
  z-index: 5;
}
@keyframes care-float {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  25%  { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1); }
}

/* ---- wider screens ---------------------------------------------------- */

@media (min-width: 520px) {
  .need { grid-template-columns: var(--tap) 1fr minmax(200px, 260px); }
  .need__ctrl { grid-column: auto; }
}

@media (min-width: 820px) {
  .pd__wrap { flex-direction: row; align-items: flex-start; }
  .pd__hero { flex: 0 0 320px; position: sticky; top: var(--sp-4); }
  .pd__panel { flex: 1 1 auto; padding: var(--sp-4); }
}
