/* Additions to the campsite (templates/partials/camp.html), on the home page and the planner's footer. */

/* The bear behind the tent of the campsite (bear.js): hidden behind it, it slides out
   past the tent's slope when nothing has happened for a while, and ducks back quickly. */
.camp .bear { transform: translateX(34px); transition: transform .5s ease-in; }
.camp .bear.peek { transform: translateX(0); transition: transform 2.2s ease-out; }
/* After a longer while the bear reaches out with its paw (to the rope's spot, in the bear's own
   units: it is drawn at 1.6×), brings the rope back and goes behind the tent with it. The rope
   stays gone until the page is loaded again. */
.camp .bear.steal { animation: bear-steal 4s ease-in-out forwards; }
.camp .bear.steal .paw { animation: paw-reach 4s ease-in-out forwards; }
.camp .rope.taken { animation: rope-taken 4s ease-in-out forwards; }
@keyframes bear-steal { 0%, 70% { transform: translateX(0); } 100% { transform: translateX(34px); } }
@keyframes paw-reach {
  0% { transform: none; }
  25%, 40% { transform: translate(-8px, 3px); }
  60%, 100% { transform: none; }
}
@keyframes rope-taken {
  0%, 40% { transform: none; }
  60%, 70% { transform: translate(13px, -6px); }
  100% { transform: translate(47px, -6px); }
}
@media (prefers-reduced-motion: reduce) {
  .camp .bear, .camp .bear.peek { transition: none; }
  .camp .bear.steal, .camp .bear.steal .paw { animation: none; }
  .camp .rope.taken { animation: none; visibility: hidden; }
}

/* A very soft glow around the campfire, at night only (body.night is set from the sun), flickering
   gently with the flames */
.camp .fire-glow { opacity: 0; transition: opacity 3s; transform-box: fill-box; transform-origin: 50% 70%; }
body.night .camp .fire-glow { opacity: 1; animation: fire-glow 2.6s ease-in-out infinite alternate; }
@keyframes fire-glow {
  from { transform: scale(.95); }
  to { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  body.night .camp .fire-glow { animation: none; }
}

/* A lamp in the tent, at night only */
.camp .tent-lamp { opacity: 0; transition: opacity 3s; }
body.night .camp .tent-lamp { opacity: 1; }
