/* =========================================================
   ALLY — PURRGATORY OS DESKTOP ASSISTANT
   ========================================================= */

.ally-wrap{
  position:absolute;
  right:108px;
  bottom:40px;
  z-index:3600;
  width:92px;
  height:86px;
  pointer-events:none;
}

.ally{
  position:absolute;
  right:0;
  bottom:0;
  width:82px;
  height:70px;
  border:0;
  background:transparent;
  cursor:pointer;
  pointer-events:auto;
  animation:allyBob 3.4s ease-in-out infinite;
  filter:drop-shadow(0 4px 2px rgba(72,22,53,.28));
}

.ally-monitor{
  position:absolute;
  left:4px;
  top:3px;
  width:68px;
  height:53px;
  border:3px solid #7d3a63;
  border-radius:12px 12px 10px 10px;
  background:linear-gradient(145deg,#fff7fc 0%,#ffc3df 46%,#d96ba7 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255,255,255,.9),
    inset -3px -3px 0 rgba(107,35,76,.18);
}

.ally-monitor::before{
  content:"";
  position:absolute;
  left:9px;
  top:8px;
  width:44px;
  height:30px;
  border:3px solid #5e3250;
  border-radius:8px;
  background:linear-gradient(180deg,#d9fff1,#8fd3be);
  box-shadow:
    inset 0 0 9px rgba(31,91,72,.3),
    0 0 5px rgba(207,255,239,.8);
}

.ally-face{
  position:absolute;
  left:17px;
  top:18px;
  z-index:2;
  width:32px;
  color:#244c40;
  text-align:center;
  font:bold 15px/1 "Courier New",monospace;
  letter-spacing:-1px;
}

.ally-light{
  position:absolute;
  right:8px;
  bottom:6px;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#fff5b0;
  box-shadow:0 0 6px #fff5b0;
}

.ally-stand{
  position:absolute;
  left:28px;
  top:55px;
  width:22px;
  height:8px;
  border:2px solid #7d3a63;
  border-top:0;
  background:#f5a8cb;
}

.ally-feet{
  position:absolute;
  left:20px;
  top:63px;
  width:39px;
  height:6px;
  border:2px solid #7d3a63;
  border-radius:7px;
  background:#ffd5e8;
}

.ally:hover{
  transform:translateY(-2px) scale(1.03);
}

.ally:focus-visible{
  outline:2px solid #fff;
  outline-offset:3px;
}

@keyframes allyBob{
  0%,100%{transform:translateY(0) rotate(-1deg)}
  50%{transform:translateY(-4px) rotate(1deg)}
}

.ally.jump{
  animation:allyJump .65s ease;
}

@keyframes allyJump{
  0%,100%{transform:translateY(0)}
  45%{transform:translateY(-20px) scale(1.08)}
  70%{transform:translateY(-5px)}
}

.ally-dialogue{
  position:absolute;
  right:74px;
  bottom:54px;
  width:min(310px,calc(100vw - 28px));
  padding:0;
  overflow:visible;
  border:2px solid #b43c78;
  border-radius:9px;
  background:#fffafd;
  box-shadow:
    0 0 0 2px rgba(255,225,240,.9),
    6px 7px 0 rgba(69,20,49,.23);
  opacity:0;
  transform:translateY(8px) scale(.97);
  transform-origin:bottom right;
  pointer-events:none;
  transition:.18s ease;
}

.ally-dialogue.open{
  opacity:1;
  transform:none;
  pointer-events:auto;
}

.ally-dialogue::after{
  content:"";
  position:absolute;
  right:14px;
  bottom:-10px;
  width:16px;
  height:16px;
  border-right:2px solid #b43c78;
  border-bottom:2px solid #b43c78;
  background:#fffafd;
  transform:rotate(45deg);
}

.ally-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:7px 8px 7px 10px;
  color:#5f173d;
  font-weight:bold;
  background:linear-gradient(#fff,#ffacd1);
  border-bottom:1px solid #bc5a89;
  border-radius:7px 7px 0 0;
}

.ally-close{
  width:22px;
  height:20px;
  padding:0;
  border:1px solid #92325f;
  border-radius:4px;
  color:#6a1c45;
  background:linear-gradient(#fff,#ffc8df);
  cursor:pointer;
}

.ally-message{
  min-height:62px;
  padding:12px 13px 8px;
  color:#563444;
  font-size:12px;
  line-height:1.5;
}

.ally-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:0 10px 11px;
}

.ally-actions button{
  flex:1 1 120px;
  padding:6px 8px;
  border:1px solid #b6678d;
  border-radius:4px;
  color:#672548;
  background:linear-gradient(#fff,#ffd5e7);
  cursor:pointer;
}

.ally-actions button:hover{
  background:linear-gradient(#fff,#ffb7d7);
}

@media(max-width:700px){
  .ally-wrap{
    right:66px;
    bottom:40px;
    transform:scale(.88);
    transform-origin:bottom right;
  }

  .ally-dialogue{
    right:58px;
    bottom:52px;
    width:min(290px,calc(100vw - 18px));
  }
}
