/* ==========================================================================
   VistHub Mascot ("Вистик") — Modern Interactive Mascot & AI Assistant Styles
   ========================================================================== */

:root {
  --mascot-size: 100px;
  --mascot-accent: #8b7bff;
  --mascot-anime: #ff5722;
  --mascot-glow: rgba(139, 123, 255, 0.4);
}

/* Mascot main container */
#vist-mascot {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--mascot-size);
  height: var(--mascot-size);
  z-index: 99990;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  will-change: transform;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
  transition: filter 0.2s ease;
}

#vist-mascot:active {
  cursor: grabbing;
}

#vist-mascot.mascot-hidden {
  display: none !important;
}

/* Mascot shadow on surface */
.mascot-shadow {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 65%;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 75%);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  z-index: 1;
}

#vist-mascot.jumping .mascot-shadow {
  transform: translateX(-50%) scale(0.35);
  opacity: 0.15;
}

/* Character sprite display */
.mascot-sprite-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2;
  transform-origin: bottom center;
}

.mascot-sprite-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
  transform-origin: bottom center;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.1s ease-out;
}

/* Direction flipping */
#vist-mascot.facing-left .mascot-sprite-wrap {
  transform: scaleX(-1);
}
#vist-mascot.facing-right .mascot-sprite-wrap {
  transform: scaleX(1);
}

/* Procedural Squash & Stretch during physics jump phases */
#vist-mascot.jump-windup .mascot-sprite-img {
  transform: scale(1.24, 0.74) translateY(6px) !important;
  transition: transform 0.1s ease-out !important;
}

#vist-mascot.jump-launch .mascot-sprite-img {
  transform: scale(0.86, 1.22) translateY(-6px) !important;
  transition: transform 0.12s ease-out !important;
}

#vist-mascot.jump-apex .mascot-sprite-img {
  transform: scale(1.04, 0.96) translateY(-2px) !important;
  transition: transform 0.14s ease-out !important;
}

#vist-mascot.jump-landing .mascot-sprite-img {
  transform: scale(1.3, 0.65) translateY(10px) !important;
  transition: transform 0.08s ease-out !important;
}

/* Active element physical reaction (button pressed by mascot feet!) */
.mascot-stepped {
  transform: translateY(3px) scale(0.985) !important;
  box-shadow: 0 0 28px rgba(139, 123, 255, 0.5) !important;
  border-color: rgba(139, 123, 255, 0.6) !important;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease !important;
}

/* Idle Breathing / Floating Animation */
#vist-mascot.state-idle .mascot-sprite-img {
  animation: mascotBreathe 3s ease-in-out infinite;
}

@keyframes mascotBreathe {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.02, 0.98) translateY(-3px);
  }
}

/* Running Trot Animation with Footstep Cycles */
#vist-mascot.state-run .mascot-sprite-img {
  animation: mascotRunTrot 0.22s ease-in-out infinite alternate;
}

@keyframes mascotRunTrot {
  0% {
    transform: translateY(0) rotate(-4deg) scale(1.02, 0.98);
  }
  100% {
    transform: translateY(-9px) rotate(5deg) scale(0.98, 1.02);
  }
}

/* Footstep Dust Puffs */
.mascot-foot-dust {
  position: fixed;
  width: 16px;
  height: 7px;
  background: radial-gradient(ellipse, rgba(139, 123, 255, 0.7) 0%, rgba(255, 87, 34, 0.3) 50%, transparent 80%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99989;
  animation: footDustFade 0.35s ease-out forwards;
}

@keyframes footDustFade {
  0% {
    transform: scale(0.5) translateY(0);
    opacity: 0.9;
  }
  100% {
    transform: scale(2) translateY(-6px);
    opacity: 0;
  }
}

/* Sleep Snoozing Animation */
#vist-mascot.state-sleep .mascot-sprite-img {
  animation: mascotSleepHeave 3.6s ease-in-out infinite;
}

@keyframes mascotSleepHeave {
  0%, 100% {
    transform: scale(1) translateY(0);
    filter: brightness(0.92);
  }
  50% {
    transform: scale(1.03, 0.97) translateY(2px);
    filter: brightness(1.06);
  }
}

/* Cheer Celebration */
#vist-mascot.state-cheer .mascot-sprite-img {
  animation: mascotCheerBounce 0.5s ease-in-out infinite alternate;
}

@keyframes mascotCheerBounce {
  0% {
    transform: translateY(0) scale(1, 1);
  }
  100% {
    transform: translateY(-14px) scale(1.06, 0.94);
  }
}

/* Curious / Thinking */
#vist-mascot.state-curious .mascot-sprite-img {
  animation: mascotCuriousTilt 1.8s ease-in-out infinite alternate;
}

@keyframes mascotCuriousTilt {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  100% {
    transform: rotate(6deg) translateY(-2px);
  }
}

/* Dragged State */
#vist-mascot.state-dragged .mascot-sprite-img {
  transform: scale(1.06, 0.94) rotate(8deg) translateY(-6px);
  filter: drop-shadow(0 20px 30px rgba(139, 123, 255, 0.55));
}

/* ==========================================================================
   Particles & Special Effects
   ========================================================================== */

/* Zzz Floating bubbles */
.mascot-zzz-container {
  position: absolute;
  top: -15px;
  right: -5px;
  pointer-events: none;
  z-index: 10;
}

.mascot-zzz-particle {
  position: absolute;
  color: #c4b5fd;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  animation: floatZzz 2.6s linear infinite;
  text-shadow: 0 0 8px rgba(139, 123, 255, 0.8);
}

.mascot-zzz-particle:nth-child(2) {
  animation-delay: 0.8s;
  font-size: 18px;
}
.mascot-zzz-particle:nth-child(3) {
  animation-delay: 1.6s;
  font-size: 22px;
}

@keyframes floatZzz {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translate(25px, -45px) scale(1.2);
    opacity: 0;
  }
}

/* Sparkles / Dust / Hearts */
.mascot-sparkle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.mascot-sparkle {
  position: absolute;
  font-size: 16px;
  animation: sparklePop 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes sparklePop {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(var(--tx, 15px), var(--ty, -25px)) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx, 25px), var(--ty, -40px)) scale(0);
    opacity: 0;
  }
}

/* ==========================================================================
   Cursor Theft Mini-Game Effects
   ========================================================================== */

body.mascot-cursor-stolen,
body.mascot-cursor-stolen * {
  cursor: none !important;
}

/* Stolen cursor held in mascot's paw */
.mascot-stolen-cursor-icon {
  position: absolute;
  top: 36%;
  right: -6px;
  width: 24px;
  height: 24px;
  z-index: 20;
  pointer-events: none;
  animation: stolenCursorWobble 0.3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px #ff5722) drop-shadow(0 0 4px #fff);
}

@keyframes stolenCursorWobble {
  0% {
    transform: rotate(-15deg) scale(1);
  }
  100% {
    transform: rotate(22deg) scale(1.3);
  }
}

.mascot-catch-target {
  position: absolute;
  inset: -14px;
  border: 2px dashed rgba(255, 87, 34, 0.8);
  border-radius: 50%;
  animation: rotateCatchTarget 3s linear infinite;
  pointer-events: none;
}

@keyframes rotateCatchTarget {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Mascot Speech Bubble
   ========================================================================== */

#vist-mascot-bubble {
  position: fixed;
  z-index: 99992;
  max-width: 290px;
  min-width: 150px;
  background: rgba(18, 22, 33, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 123, 255, 0.35);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.75), 0 0 24px rgba(139, 123, 255, 0.22);
  border-radius: 18px;
  padding: 12px 14px;
  color: #f1f5f9;
  font-size: 13.5px;
  line-height: 1.45;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

#vist-mascot-bubble.bubble-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Bubble Tail pointer */
#vist-mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(18, 22, 33, 0.95);
  border-right: 1px solid rgba(139, 123, 255, 0.35);
  border-bottom: 1px solid rgba(139, 123, 255, 0.35);
}

#vist-mascot-bubble.tail-top::after {
  bottom: auto;
  top: -7px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(139, 123, 255, 0.35);
  border-top: 1px solid rgba(139, 123, 255, 0.35);
}

.mascot-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a78bfa;
}

.mascot-bubble-text {
  color: #e2e8f0;
  font-size: 13px;
  margin-bottom: 6px;
  word-break: break-word;
}

.mascot-bubble-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mascot-bubble-chip {
  background: rgba(139, 123, 255, 0.16);
  border: 1px solid rgba(139, 123, 255, 0.28);
  border-radius: 9999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  color: #ddd6fe;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mascot-bubble-chip:hover {
  background: rgba(139, 123, 255, 0.35);
  border-color: #8b7bff;
  color: #fff;
  transform: translateY(-1px);
}

/* ==========================================================================
   AI Assistant Expandable Chat Modal
   ========================================================================== */

#vist-mascot-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 85px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  background: rgba(15, 19, 28, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(139, 123, 255, 0.2);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

#vist-mascot-chat-panel.chat-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mascot-chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(21, 26, 38, 0.9) 0%, rgba(139, 123, 255, 0.14) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mascot-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mascot-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(139, 123, 255, 0.15);
  border: 1px solid rgba(139, 123, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mascot-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mascot-chat-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mascot-chat-badge {
  font-size: 10px;
  padding: 1px 7px;
  background: rgba(139, 123, 255, 0.25);
  border: 1px solid rgba(139, 123, 255, 0.4);
  color: #c4b5fd;
  border-radius: 9999px;
  font-weight: 600;
}

.mascot-chat-status {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mascot-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.mascot-chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mascot-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.05);
}

/* Chat Messages Stream */
.mascot-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.mascot-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.mascot-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.mascot-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
}

.mascot-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.mascot-msg.bot {
  align-self: flex-start;
}

.mascot-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.mascot-msg.user .mascot-msg-bubble {
  background: linear-gradient(135deg, #8b7bff 0%, #705af8 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(139, 123, 255, 0.35);
}

.mascot-msg.bot .mascot-msg-bubble {
  background: rgba(25, 31, 44, 0.88);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

/* Clean Formatted Headings and Bullets (Zero Raw Asterisks) */
.mascot-chat-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
  margin: 8px 0 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mascot-chat-heading::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b7bff;
  box-shadow: 0 0 6px #8b7bff;
}

.mascot-chat-bullet {
  position: relative;
  padding-left: 18px;
  margin: 6px 0;
  line-height: 1.55;
  color: #e2e8f0;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

.mascot-chat-bullet::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: #8b7bff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.55;
}

/* Typing cursor indicator */
.mascot-typing-cursor {
  display: inline-block;
  width: 5px;
  height: 14px;
  background: #8b7bff;
  vertical-align: middle;
  margin-left: 3px;
  border-radius: 1px;
  animation: blinkCursor 0.8s infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Suggested chips container */
.mascot-chat-quickchips {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(12, 15, 22, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mascot-chat-quickchips::-webkit-scrollbar {
  display: none;
}

.mascot-chat-chip-btn {
  background: rgba(139, 123, 255, 0.12);
  border: 1px solid rgba(139, 123, 255, 0.22);
  color: #c4b5fd;
  border-radius: 9999px;
  padding: 4px 11px;
  font-size: 11.5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mascot-chat-chip-btn:hover {
  background: rgba(139, 123, 255, 0.28);
  color: #fff;
  border-color: #8b7bff;
}

/* Chat Input Bar */
.mascot-chat-input-bar {
  padding: 12px 14px;
  background: rgba(12, 15, 22, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

.mascot-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mascot-chat-input:focus {
  border-color: #8b7bff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(139, 123, 255, 0.25);
}

.mascot-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b7bff 0%, #ff5722 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.mascot-chat-send-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.15);
}

.mascot-chat-send-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Quick Mascot HUD Control Bar
   ========================================================================== */

#vist-mascot-hud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 18, 27, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(139, 123, 255, 0.15);
  border-radius: 9999px;
  padding: 6px 10px;
  display: none; /* Hidden by default in release mode */
  align-items: center;
  gap: 6px;
  z-index: 99980;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

body.mascot-debug-hud #vist-mascot-hud {
  display: flex !important;
}

.mascot-hud-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 6px 12px;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.mascot-hud-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.mascot-hud-btn.active {
  background: rgba(139, 123, 255, 0.22);
  border-color: rgba(139, 123, 255, 0.5);
  color: #c4b5fd;
  box-shadow: 0 0 12px rgba(139, 123, 255, 0.25);
}

.mascot-hud-btn.ai-btn {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.25) 0%, rgba(255, 87, 34, 0.2) 100%);
  border-color: rgba(139, 123, 255, 0.4);
  color: #fff;
  font-weight: 600;
}

.mascot-hud-btn.ai-btn:hover {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.4) 0%, rgba(255, 87, 34, 0.35) 100%);
  box-shadow: 0 0 16px rgba(139, 123, 255, 0.4);
}

.mascot-hud-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
}

/* Floating Summon Pill */
#vist-mascot-summon {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: rgba(15, 19, 28, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(139, 123, 255, 0.35);
  border-radius: 9999px;
  padding: 8px 14px 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 99980;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 18px rgba(139, 123, 255, 0.25);
  transition: all 0.25s ease;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

#vist-mascot-summon:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #8b7bff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(139, 123, 255, 0.4);
}

.mascot-summon-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(139, 123, 255, 0.2);
}

/* Responsive queries */
@media (max-width: 768px) {
  :root {
    --mascot-size: 80px;
  }
  #vist-mascot-hud {
    bottom: 12px;
    padding: 4px 6px;
    gap: 4px;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
  }
  .mascot-hud-btn span.label {
    display: none;
  }
  #vist-mascot-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 74px;
    height: 70vh;
  }
  #vist-mascot-chat-trigger {
    right: 14px;
    bottom: 14px;
    padding: 5px 12px 5px 6px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Peek-a-boo (Hiding Behind Elements) & Edge Roaming Styles
   ========================================================================== */

#vist-mascot.mascot-hiding {
  z-index: 5 !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#vist-mascot.mascot-hiding .mascot-sprite-img {
  clip-path: inset(0 0 54% 0);
  transform: translateY(28px) scale(0.95);
  filter: drop-shadow(0 -4px 12px rgba(139, 123, 255, 0.55));
  animation: mascotPeekBob 2.6s ease-in-out infinite alternate !important;
}

@keyframes mascotPeekBob {
  0% {
    transform: translateY(28px) scale(0.95);
  }
  50% {
    transform: translateY(10px) scale(1);
  }
  100% {
    transform: translateY(28px) scale(0.95);
  }
}

/* Screen-edge tab when mascot roams away */
#vist-mascot-edge-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(18, 22, 33, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(139, 123, 255, 0.4);
  border-right: none;
  border-radius: 16px 0 0 16px;
  padding: 10px 14px 10px 12px;
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 99985;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 123, 255, 0.25);
  display: none;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: edgeTabPulse 2.4s ease-in-out infinite;
}

#vist-mascot-edge-tab:hover {
  padding-left: 18px;
  background: rgba(28, 34, 52, 0.98);
  color: #fff;
  box-shadow: -8px 0 25px rgba(139, 123, 255, 0.45);
}

@keyframes edgeTabPulse {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-4px); }
}

/* ==========================================================================
   Bottom-Right Floating "Спросить меня" Launcher Trigger
   ========================================================================== */

#vist-mascot-chat-trigger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: linear-gradient(135deg, rgba(24, 29, 44, 0.95) 0%, rgba(15, 19, 29, 0.96) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 123, 255, 0.38);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.7), 0 0 24px rgba(139, 123, 255, 0.22);
  border-radius: 9999px;
  padding: 6px 16px 6px 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 99990;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
  font-family: 'Inter', sans-serif;
  user-select: none;
}

#vist-mascot-chat-trigger:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(139, 123, 255, 0.65);
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.85), 0 0 32px rgba(139, 123, 255, 0.4);
}

#vist-mascot-chat-trigger.active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.35) 0%, rgba(112, 90, 248, 0.3) 100%);
  border-color: #8b7bff;
}

.mascot-trigger-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(139, 123, 255, 0.18);
  border: 1px solid rgba(139, 123, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.mascot-trigger-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}

.mascot-trigger-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f131c;
  box-shadow: 0 0 6px #10b981;
}

.mascot-trigger-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mascot-trigger-sparkle {
  font-size: 13px;
  opacity: 0.9;
  animation: triggerSparklePulse 2.4s ease-in-out infinite;
}

@keyframes triggerSparklePulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.75; }
  50% { transform: scale(1.22) rotate(16deg); opacity: 1; }
}

/* ==========================================================================
   Micro-Action Keyframe Animations
   ========================================================================== */

/* 360 Acrobatic Flip */
#vist-mascot.action-flip .mascot-sprite-img {
  animation: mascotFlip360 0.85s cubic-bezier(0.2, 0.8, 0.3, 1) !important;
}

@keyframes mascotFlip360 {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(-38px) rotate(180deg) scale(1.1); }
  75% { transform: translateY(-8px) rotate(340deg) scale(0.96); }
  100% { transform: translateY(0) rotate(360deg) scale(1); }
}

/* Balancing on edge */
#vist-mascot.action-balance .mascot-sprite-img {
  animation: mascotBalanceWobble 2.2s ease-in-out !important;
  transform-origin: bottom center;
}

@keyframes mascotBalanceWobble {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg) translateY(-2px); }
  40% { transform: rotate(16deg) translateY(-4px); }
  60% { transform: rotate(-12deg) translateY(-2px); }
  80% { transform: rotate(10deg) translateY(-1px); }
  100% { transform: rotate(0deg); }
}

/* Paw clean / Wash */
#vist-mascot.action-paw-clean .mascot-sprite-img {
  animation: mascotPawClean 1.6s ease-in-out !important;
}

@keyframes mascotPawClean {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  15% { transform: rotate(-10deg) translateY(-3px); }
  35% { transform: rotate(8deg) translateY(-2px); }
  55% { transform: rotate(-8deg) translateY(-3px); }
  75% { transform: rotate(6deg) translateY(-1px); }
}

/* Cat Stretch */
#vist-mascot.action-stretch .mascot-sprite-img {
  animation: mascotStretch 2.0s ease-in-out !important;
  transform-origin: bottom center;
}

@keyframes mascotStretch {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(1.22, 0.82) skewX(-12deg) translateY(6px); }
  65% { transform: scale(0.9, 1.15) skewX(6deg) translateY(-8px); }
}

/* Pounce / Tail Wiggle */
#vist-mascot.action-pounce .mascot-sprite-img {
  animation: mascotPounceWiggle 1.4s ease-in-out !important;
  transform-origin: bottom center;
}

@keyframes mascotPounceWiggle {
  0%, 100% { transform: scale(1.08, 0.88) translateY(4px) rotate(0deg); }
  15% { transform: scale(1.08, 0.88) translateY(4px) rotate(-6deg); }
  30% { transform: scale(1.08, 0.88) translateY(4px) rotate(6deg); }
  45% { transform: scale(1.08, 0.88) translateY(4px) rotate(-5deg); }
  60% { transform: scale(1.08, 0.88) translateY(4px) rotate(5deg); }
  75% { transform: scale(1.08, 0.88) translateY(4px) rotate(-3deg); }
}

/* Musical Humming Rock */
#vist-mascot.action-hum .mascot-sprite-img {
  animation: mascotHumRock 2.2s ease-in-out !important;
}

@keyframes mascotHumRock {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-7deg) translateY(-2px); }
  75% { transform: rotate(7deg) translateY(-2px); }
}

