.df-film-mascot {
  --pet-size: 108px;
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 30;
}

.df-film-mascot[hidden],
.df-film-photo[hidden] {
  display: none;
}

.df-film-pet {
  position: relative;
  display: block;
  width: var(--pet-size);
  height: calc(var(--pet-size) * 180 / 168);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#df-film-canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 5px 5px #0008);
}

.df-film-photo {
  position: absolute;
  left: 4px;
  bottom: calc(var(--pet-size) * 180 / 168 + 10px);
  width: min(300px, calc(100vw - 32px));
  padding: 10px 10px 0;
  background: #fffaf3;
  color: #181820;
  border-radius: 5px;
  box-shadow: 0 12px 40px #0008;
}

.df-film-photo a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.df-film-photo a > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
}

.df-film-photo a > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  font-weight: 750;
  font-size: 16px;
}

.df-film-photo a > span > span {
  color: #b8172b;
}

.df-film-close {
  position: absolute;
  right: -6px;
  top: -14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid #fffaf3;
  border-radius: 50%;
  color: #fff;
  background: #1b1b22;
  font-size: 27px;
  cursor: pointer;
}

.df-film-mascot button:focus-visible,
.df-film-mascot a:focus-visible {
  outline: 3px solid #ff9ba5;
  outline-offset: 3px;
}

body:has(input:focus, textarea:focus, select:focus) .df-film-mascot,
body:has(.menu-toggle[aria-expanded="true"]:not([hidden])) .df-film-mascot {
  visibility: hidden;
}

@media (min-width: 861px) {
  .df-film-mascot {
    --pet-size: 132px;
    left: 20px;
    bottom: 18px;
  }
}

@media (max-height: 520px) {
  .df-film-mascot { --pet-size: 76px; }
  .df-film-photo { width: min(220px, calc(100vw - 32px)); }
  .df-film-photo a > img { max-height: 160px; object-fit: contain; }
}

@media (min-width: 360px) {
  .df-film-photo {
    left: calc(var(--pet-size) + 5px);
    bottom: 4px;
    width: min(260px, calc(100vw - var(--pet-size) - 100px));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .df-film-photo:not([hidden]) {
    animation: df-film-print .4s ease-out both;
  }
}

@keyframes df-film-print {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
