/* Site-wide AGI Pet Mode overlay + slash command hint.
   Loaded by /, /agents/, /pets/. Pet page (/pet/) has its own bigger
   mascot stage and skips the overlay. */

.agi-pet-overlay {
  position: fixed;
  bottom: 16px; right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.agi-pet-overlay.tucked { display: none; }

.agi-pet-bubble {
  pointer-events: auto;
  background: #e9dec7;
  color: #2b2410;
  font-family: 'Caveat', cursive, system-ui, sans-serif;
  font-size: 16px;
  padding: 6px 12px;
  border-radius: 12px 12px 12px 4px;
  border: 1px solid #c9bd9c;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.agi-pet-mascot {
  pointer-events: auto;
  background: rgba(14,15,13,0.85);
  border: 1px solid #5a4a26;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.55));
  transition: transform 0.15s ease;
}
.agi-pet-mascot:hover { transform: translateY(-2px); }
.agi-pet-mascot[data-state="running"]   { animation: agiPetBob 0.9s ease-in-out infinite; }
.agi-pet-mascot[data-state="writing"]   { animation: agiPetBob 0.9s ease-in-out infinite; }
.agi-pet-mascot[data-state="done"]      { filter: drop-shadow(0 6px 14px rgba(106,160,95,0.6)); }
.agi-pet-mascot[data-state="failed"]    { filter: drop-shadow(0 6px 14px rgba(255,80,40,0.6)) grayscale(0.4); }
.agi-pet-mascot[data-state="confessing"]{ animation: agiPetBow 1.2s ease-in-out infinite; }
@keyframes agiPetBob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-4px);} }
@keyframes agiPetBow { 0%,100%{ transform: rotate(0);} 50%{ transform: rotate(-4deg) translateY(2px);} }

.agi-pet-tuck {
  pointer-events: auto;
  background: transparent;
  border: 1px solid #5a4a26;
  color: #f5c352;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  cursor: pointer;
}
.agi-pet-tuck:hover { background: rgba(245,195,82,0.1); }

.agi-pet-wake {
  position: fixed;
  bottom: 16px; right: 16px;
  z-index: 80;
  background: rgba(14,15,13,0.85);
  border: 1px solid #5a4a26;
  color: #f5c352;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.agi-pet-wake:hover { background: rgba(245,195,82,0.12); }

/* Slash command hint toast - appears briefly when /help fires or an
   unknown command is typed. */
.agi-slash-hint {
  position: fixed;
  left: 50%; bottom: 86px;
  transform: translateX(-50%);
  background: rgba(14,15,13,0.95);
  border: 1px solid #5a4a26;
  color: #f5c352;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.agi-slash-hint.show { opacity: 1; }

/* Shared skin renderer wrappers - state animations applied to whatever
   the resolver rendered (SVG silhouette OR static spritesheet). */
.agi-skin-wrap { display: inline-flex; line-height: 0; vertical-align: middle; }
.agi-skin-wrap svg, .agi-skin-wrap .agi-skin-sheet { display: inline-block; }

.agi-skin-state-running svg, .agi-skin-state-tool svg, .agi-skin-state-writing svg,
.agi-skin-state-running .agi-skin-sheet, .agi-skin-state-writing .agi-skin-sheet {
  animation: agiSkinBob 0.9s ease-in-out infinite;
}
.agi-skin-state-confessed svg { animation: agiSkinBow 1.4s ease-in-out infinite; }
.agi-skin-state-completed svg, .agi-skin-state-done svg {
  animation: agiSkinPop 0.6s ease-out 1;
  filter: drop-shadow(0 2px 4px rgba(106,160,95,0.6));
}
.agi-skin-state-failed svg, .agi-skin-state-failed .agi-skin-sheet {
  animation: agiSkinShake 0.4s ease-in-out 3;
  filter: grayscale(0.5) drop-shadow(0 2px 4px rgba(255,80,40,0.5));
}
.agi-skin-state-idle svg, .agi-skin-state-waiting svg {
  animation: agiSkinIdle 3.6s ease-in-out infinite;
}
@keyframes agiSkinIdle  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
@keyframes agiSkinBob   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes agiSkinBow   { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(2px) rotate(-3deg); } }
@keyframes agiSkinPop   { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes agiSkinShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* Spritesheet-as-skin: transparent so pixel art reads cleanly against
   whatever surface (light or dark) the card uses. The card itself can
   provide a backdrop if it needs one. */
.agi-skin-sheet {
  display: inline-block;
  background-color: transparent;
  image-rendering: pixelated;
  vertical-align: middle;
}
.agi-skin-sheet-static { object-fit: contain; }

/* Chat panel: opens when the user clicks the floating goblin. ----- */
.agi-chat-panel {
  position: fixed;
  bottom: 12px;
  right: 92px;       /* sits left of the floating goblin's column */
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #131311;
  border: 1px solid #5a4a26;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #e8e3d2;
  overflow: hidden;
}
.agi-chat-panel[hidden] { display: none; }
.agi-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: #1c1c19;
  border-bottom: 1px solid #2a2a25;
  font-weight: 600;
  font-size: 13px;
}
.agi-chat-head-actions {
  display: inline-flex;
  gap: 4px;
}
.agi-chat-min,
.agi-chat-close {
  background: transparent;
  border: 1px solid #5a4a26;
  color: #f5c352;
  border-radius: 6px;
  cursor: pointer;
  width: 22px; height: 22px;
  font-size: 12px;
  line-height: 0;
  font-family: inherit;
  padding: 0;
}
.agi-chat-min:hover,
.agi-chat-close:hover { background: rgba(245,195,82,0.12); }

/* Minimized state: collapse to just the title bar. The header is
   clickable to restore. */
.agi-chat-panel.is-minimized .agi-chat-body,
.agi-chat-panel.is-minimized .agi-chat-faq,
.agi-chat-panel.is-minimized .agi-chat-input {
  display: none;
}
.agi-chat-panel.is-minimized {
  width: 200px;
  cursor: pointer;
}
.agi-chat-panel.is-minimized .agi-chat-head {
  cursor: pointer;
}
.agi-chat-panel.is-minimized .agi-chat-min {
  display: none;
}
.agi-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 80px;
  max-height: 280px;
}
.agi-chat-msg {
  padding: 7px 10px;
  border-radius: 8px;
  line-height: 1.45;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.agi-chat-bot {
  background: rgba(106,160,95,0.12);
  border: 1px solid rgba(106,160,95,0.3);
  align-self: flex-start;
  max-width: 92%;
}
.agi-chat-user {
  background: rgba(245,195,82,0.10);
  border: 1px solid rgba(245,195,82,0.3);
  align-self: flex-end;
  max-width: 92%;
  color: #f5c352;
}
.agi-chat-faq {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid #2a2a25;
  border-bottom: 1px solid #2a2a25;
  background: rgba(0,0,0,0.18);
}
.agi-chat-faq-btn {
  background: transparent;
  border: 1px solid #3a3a32;
  color: #d8d3c2;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.agi-chat-faq-btn:hover {
  border-color: #f5c352;
  color: #f5c352;
  background: rgba(245,195,82,0.08);
}
.agi-chat-input {
  display: flex; gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #2a2a25;
}
.agi-chat-input input {
  flex: 1 1 auto;
  background: #0e0f0d;
  border: 1px solid #3a3a32;
  color: #e8e3d2;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: inherit;
}
.agi-chat-input input:focus { outline: none; border-color: #f5c352; }
.agi-chat-input button {
  background: #f5c352;
  border: 1px solid #5a4a26;
  color: #0e0f0d;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}
.agi-chat-faq-anything {
  border-color: #5a4a26 !important;
  color: #f5c352 !important;
  background: rgba(245,195,82,0.08) !important;
  font-weight: 600;
}
.agi-chat-faq-anything:hover {
  background: rgba(245,195,82,0.16) !important;
}
@media (max-width: 720px) {
  .agi-chat-panel { right: 8px; bottom: 88px; width: calc(100vw - 16px); }
}

