/* Simos Camp — camp cats: the "Camp Cats" panel and the cat action wheel.  (owner: cats, prefix cat-)
 * Builds on css/base.css primitives (.sc-btn, .sc-chip, .sc-meter, .sc-grow) and the panel / wheel chrome in css/ui.css.
 * Mobile-first (≥ 360 px), 44 px touch targets, light + dark ("night at camp") themes via the base variables.
 */
.cat-panel {
  --cat-card-bg: var(--paper); --cat-card-bd: var(--sand-dark); --cat-soft: rgba(205, 176, 122, .16);
  --cat-tip-bg: #fff6df; --cat-tip-bd: #f1dcaa; --cat-tip-ink: #7a5a2e;
  --cat-green-bg: #e8f8ed; --cat-green-bd: #9fdcb2; --cat-green-ink: #226b3a;
  --cat-red-bg: #ffeceb; --cat-red-bd: #ffb4b0; --cat-red-ink: #9b2424;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-panel {
    --cat-soft: rgba(255, 230, 200, .07);
    --cat-tip-bg: #4d3d2c; --cat-tip-bd: #6d573d; --cat-tip-ink: #f5dfb8;
    --cat-green-bg: #2f4a37; --cat-green-bd: #4f8a60; --cat-green-ink: #cdf3d7;
    --cat-red-bg: #553233; --cat-red-bd: #95504f; --cat-red-ink: #ffd9d6;
  }
}
:root[data-theme="dark"] .cat-panel {
  --cat-soft: rgba(255, 230, 200, .07);
  --cat-tip-bg: #4d3d2c; --cat-tip-bd: #6d573d; --cat-tip-ink: #f5dfb8;
  --cat-green-bg: #2f4a37; --cat-green-bd: #4f8a60; --cat-green-ink: #cdf3d7;
  --cat-red-bg: #553233; --cat-red-bd: #95504f; --cat-red-ink: #ffd9d6;
}

.cat-body { display: flex; flex-direction: column; gap: 12px; font-family: var(--font); color: var(--ink); }
.cat-body > * { flex: none; }   /* the panel body scrolls: never squash the cards (overflow:hidden → min-height 0) */

/* ------------------------------------------------------------------ intro */
.cat-intro {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 12px;
  border-radius: 20px; border: 2px dashed var(--cat-card-bd); background: var(--cat-soft);
}
.cat-intro-title { font-weight: 700; font-size: 17px; line-height: 1.2; }
.cat-intro-line { font-size: 13.5px; line-height: 1.38; color: var(--ink-soft); margin-top: 3px; }
.cat-intro-sum {
  display: inline-block; margin-top: 7px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--cat-tip-bg); border: 1.5px solid var(--cat-tip-bd); color: var(--cat-tip-ink);
}
.cat-faces { display: flex; justify-content: space-between; gap: 6px; }
.cat-face-btn {
  --i: 0; position: relative; flex: 0 1 52px; width: 52px; height: 52px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--wood), 0 4px 0 rgba(122, 81, 50, .28);
  animation: cat-bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.55s);
  transition: transform .15s var(--ease-spring);
}
.cat-face-btn canvas { width: 100% !important; height: 100% !important; display: block; }
.cat-face-btn:active { transform: scale(.92); }
@keyframes cat-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* ------------------------------------------------------------------ cat cards */
.cat-card {
  --cat-accent: #e6fbf8; --i: 0;
  position: relative; display: flex; flex-direction: column; gap: 9px; padding: 14px 13px 12px;
  background: var(--cat-card-bg); border: 2px solid var(--cat-card-bd); border-radius: 22px;
  box-shadow: 0 3px 0 rgba(122, 81, 50, .16); overflow: hidden; scroll-margin-top: 8px;
  animation: cat-card-in .5s var(--ease-spring) backwards; animation-delay: calc(var(--i) * 55ms);
}
.cat-card::before { /* soft accent wash behind the portrait */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 64px; pointer-events: none;
  background: linear-gradient(180deg, var(--cat-accent), rgba(255, 255, 255, 0)); opacity: .55;
}
.cat-card > * { position: relative; }
@keyframes cat-card-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.cat-top { display: flex; align-items: center; gap: 12px; }
.cat-pic {
  position: relative; flex: none; width: 80px; height: 80px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--cat-accent); border: 4px solid #fff; box-shadow: 0 0 0 2.5px var(--wood), 0 5px 0 rgba(122, 81, 50, .25);
  transition: transform .15s var(--ease-spring);
}
.cat-pic canvas { width: 100% !important; height: 100% !important; display: block; border-radius: 50%; }
.cat-pic:active { transform: scale(.94); }
.cat-pic.cat-wiggle { animation: cat-wiggle .7s var(--ease-soft); }
@keyframes cat-wiggle {
  0%, 100% { transform: rotate(0) scale(1); } 15% { transform: rotate(-9deg) scale(1.06); } 35% { transform: rotate(8deg) scale(1.06); }
  55% { transform: rotate(-5deg) scale(1.03); } 75% { transform: rotate(3deg); }
}
.cat-status {
  position: absolute; right: -6px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; line-height: 1; background: #fffaf0; border: 2px solid var(--wood); box-shadow: 0 2px 0 rgba(122, 81, 50, .3);
}
.cat-info { display: flex; flex-direction: column; gap: 5px; }
.cat-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.cat-name { font-weight: 700; font-size: 20px; line-height: 1.1; letter-spacing: .2px; }
.cat-heart { font-size: 15px; line-height: 1; margin-right: 2px; }
.sc-chip.cat-kind { font-size: 11.5px; padding: 1px 8px; border-width: 1.5px; }
.sc-chip.cat-kitten { background: #ffe8f0; border-color: #ffb8cf; color: #9a3a5c; }
.cat-where { display: flex; align-items: flex-start; gap: 4px; font-size: 13px; line-height: 1.3; color: var(--ink-soft); font-weight: 500; }
.cat-where-pin { flex: none; font-size: 12px; line-height: 1.35; }
.cat-where-text { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-desc { font-size: 13.5px; line-height: 1.38; color: var(--ink); }
.cat-fav { display: block; margin-top: 2px; font-size: 12.5px; color: var(--turq-dark); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cat-fav { color: var(--turq-light); } }
:root[data-theme="dark"] .cat-fav { color: var(--turq-light); }

/* ------------------------------------------------------------------ trust meter */
.cat-trust { display: flex; flex-direction: column; gap: 4px; padding: 9px 10px 9px; border-radius: 16px; background: var(--cat-soft); }
.cat-trust-head { display: flex; align-items: center; gap: 7px; min-height: 22px; }
.cat-trust-lbl { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.cat-tier {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1.5px solid transparent; white-space: nowrap;
}
.cat-tier:empty { display: none; }
.cat-tier.t-wary { background: #ffe4e1; border-color: #ffb0a8; color: #a1332b; }
.cat-tier.t-curious { background: #fff2cf; border-color: #f5d17a; color: #85601a; }
.cat-tier.t-friendly { background: #dcf7f1; border-color: #88dccd; color: #1d6c68; }
.cat-tier.t-best { background: #ffe3ee; border-color: #ff9fc0; color: #a42c58; }
.cat-num { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.sc-meter.cat-meter { position: relative; height: 14px; background: rgba(122, 81, 50, .16); box-shadow: inset 0 2px 0 rgba(0, 0, 0, .07); }
.sc-meter.cat-meter > i { position: relative; transition: width .6s var(--ease-soft), background .4s; }
.sc-meter.cat-meter > i::after { /* glossy highlight */
  content: ''; position: absolute; left: 4px; right: 4px; top: 2px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .45);
}
.cat-meter.t-wary > i { background: linear-gradient(90deg, #ff8f86, #ffb070); }
.cat-meter.t-curious > i { background: linear-gradient(90deg, #ffc56b, #ffe07a); }
.cat-meter.t-friendly > i { background: linear-gradient(90deg, var(--turq), #6fdc8e); }
.cat-meter.t-best > i { background: linear-gradient(90deg, #ff9fc0, var(--heart)); }
.cat-meter.t-best > i::before { /* a tiny heart riding the end of a full meter */
  content: '♥'; position: absolute; right: 4px; top: 50%; transform: translateY(-52%); font-size: 10px; line-height: 1; color: #fff;
  text-shadow: 0 1px 0 rgba(164, 44, 88, .5);
}
.cat-meter.t-off { opacity: .5; }
.cat-ticks { position: absolute; inset: 0; pointer-events: none; }
.cat-tick { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(122, 81, 50, .22); }
.cat-scale { position: relative; height: 15px; font-size: 10.5px; font-weight: 600; color: var(--ink-faint); }
.cat-scale > span { position: absolute; top: 1px; transform: translateX(-50%); white-space: nowrap; line-height: 1.2; }
.cat-trust-tip {
  font-size: 12.5px; line-height: 1.35; color: var(--cat-tip-ink); padding: 6px 10px; margin-top: 2px; border-radius: 12px;
  background: var(--cat-tip-bg); border: 1.5px solid var(--cat-tip-bd);
}
.cat-trust-tip::before { content: '💡 '; }
.cat-trust-off .cat-scale { visibility: hidden; height: 4px; }

/* ------------------------------------------------------------------ card footer */
.cat-foot { display: flex; align-items: center; gap: 8px; }
.cat-chips { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.sc-chip.cat-stat { font-size: 11.5px; padding: 2px 8px; border-width: 1.5px; }
.sc-btn.cat-find { flex: none; min-height: 40px; padding: 4px 14px; }

/* focus from the wheel's "About" / face row, and a little celebration when the tier changes */
.cat-card.cat-focus { animation: cat-focus 1.8s var(--ease-soft); }
@keyframes cat-focus {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 94, 0), 0 3px 0 rgba(122, 81, 50, .16); }
  20%, 60% { box-shadow: 0 0 0 5px rgba(255, 215, 94, .85), 0 3px 0 rgba(122, 81, 50, .16); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 94, 0), 0 3px 0 rgba(122, 81, 50, .16); }
}
.cat-card.cat-levelup { animation: cat-levelup 1.1s var(--ease-spring); }
@keyframes cat-levelup {
  0% { transform: scale(1); } 25% { transform: scale(1.025); box-shadow: 0 0 0 5px rgba(255, 127, 168, .55); }
  100% { transform: scale(1); box-shadow: 0 3px 0 rgba(122, 81, 50, .16); }
}

/* ------------------------------------------------------------------ section titles */
.cat-sec-title { font-weight: 700; font-size: 16px; margin: 2px 2px 8px; }
.cat-care-note { font-size: 12.5px; line-height: 1.38; color: var(--ink-soft); margin-top: 9px; }

/* ------------------------------------------------------------------ bowls */
.cat-bowls { padding: 12px 13px; border-radius: 20px; background: var(--cat-card-bg); border: 2px solid var(--cat-card-bd); }
.cat-bowl {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px;
  padding: 9px 10px; border-radius: 16px; background: var(--cat-soft);
}
.cat-bowl + .cat-bowl { margin-top: 8px; }
.cat-bowl-ico {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; line-height: 1;
  background: radial-gradient(circle at 38% 30%, #fff, #e6f3ff 70%); border: 2px solid #9fc7ec;
}
.cat-bowl-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cat-bowl-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bowl-meters { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px; }
.cat-bowl-lbl { font-size: 13px; line-height: 1; }
.sc-meter.cat-food, .sc-meter.cat-water { height: 11px; }
.cat-meter.cat-food > i { background: linear-gradient(90deg, #d08a52, #f0b36c); }
.cat-meter.cat-water > i { background: linear-gradient(90deg, #4fb2e6, #8fdcf5); }
.cat-meter.cat-low > i { animation: cat-low 1.4s ease-in-out infinite; }
@keyframes cat-low { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.cat-bowl-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
.cat-bowl-btns .sc-btn { flex: 1 1 0; min-height: 40px; }
@media (min-width: 520px) {
  .cat-bowl { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cat-bowl-btns { grid-column: auto; }
  .cat-bowl-btns .sc-btn { flex: none; }
}

/* ------------------------------------------------------------------ care guide */
.cat-care { padding: 12px 13px; border-radius: 20px; background: var(--cat-card-bg); border: 2px solid var(--cat-card-bd); }
.cat-care-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-care-col { min-width: 0; }
.cat-care-head { font-weight: 700; font-size: 13.5px; padding: 4px 10px; border-radius: 12px 12px 0 0; border: 1.5px solid; border-bottom: 0; }
.cat-care-head.cat-green { background: var(--cat-green-bg); border-color: var(--cat-green-bd); color: var(--cat-green-ink); }
.cat-care-head.cat-red { background: var(--cat-red-bg); border-color: var(--cat-red-bd); color: var(--cat-red-ink); }
.cat-care-list { list-style: none; margin: 0; padding: 4px 6px 6px; border-radius: 0 0 12px 12px; border: 1.5px solid; }
.cat-care-col:first-child .cat-care-list { border-color: var(--cat-green-bd); }
.cat-care-col:last-child .cat-care-list { border-color: var(--cat-red-bd); }
.cat-care-item { display: flex; align-items: center; gap: 5px; min-height: 30px; font-size: 12.5px; line-height: 1.2; }
.cat-care-item + .cat-care-item { border-top: 1px dashed var(--cat-card-bd); }
.cat-care-ico { flex: none; width: 20px; text-align: center; font-size: 15px; }
.cat-care-lbl { flex: 1 1 auto; min-width: 0; }
.cat-pts { flex: none; padding: 1px 6px; border-radius: 999px; font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cat-pts-green { background: var(--green); color: #fff; }
.cat-pts-red { background: var(--red); color: #fff; }
.cat-today {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 9px; padding: 6px 10px; border-radius: 12px;
  background: var(--cat-green-bg); border: 1.5px solid var(--cat-green-bd); color: var(--cat-green-ink); font-size: 12.5px;
}
.cat-today-lbl { font-weight: 700; }
.cat-today-val { font-variant-numeric: tabular-nums; }
.cat-empty { text-align: center; padding: 26px 12px; color: var(--ink-soft); font-size: 15px; }

@media (max-width: 370px) {
  .cat-pic { width: 68px; height: 68px; }
  .cat-name { font-size: 18px; }
  .cat-face-btn { width: 46px; height: 46px; flex-basis: 46px; }
  .cat-care-cols { grid-template-columns: 1fr; }
}
@media (min-width: 700px) {
  .cat-card { padding: 15px 16px 13px; }
  .cat-pic { width: 88px; height: 88px; }
}

/* ------------------------------------------------------------------ cat action wheel (ui.wheel className 'cat-wheel') */
.cat-wheel .ui-wheel-center .ui-face { background: #fff3dc; }
.cat-wheel .ui-wheel-item.ui-k-green .ui-wheel-lbl { background: #effbf2; color: #226b3a; box-shadow: 0 2px 0 rgba(47, 154, 80, .45); }
/* red (mean) actions are clearly marked: red label + a little warning flag on the button */
.cat-wheel .ui-wheel-item.ui-k-red .ui-wheel-btn {
  background: repeating-linear-gradient(135deg, rgba(255, 90, 90, .1) 0 5px, rgba(255, 90, 90, 0) 5px 10px), radial-gradient(circle at 36% 28%, #fff, #ffe3e3 70%);
}
.cat-wheel .ui-wheel-item.ui-k-red .ui-wheel-lbl { background: var(--red); color: #fff; box-shadow: 0 2px 0 var(--red-dark); }
.cat-wheel .ui-wheel-item.ui-k-red::before {
  content: '🚩'; position: absolute; left: -4px; top: -5px; z-index: 1; font-size: 14px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); pointer-events: none;
}
