:root {
  --meadow-height: 63px;
  --meadow-inset: env(safe-area-inset-bottom, 0px);
}

.site-pet {
  position: fixed;
  z-index: 4;
  inset: auto 0 0;
  width: 100%;
  height: calc(var(--meadow-height) + var(--meadow-inset));
  appearance: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: linear-gradient(to bottom, transparent, var(--page) 36%);
  /* Let links, text selection and touch scrolling reach the page below. */
  pointer-events: none;
}

.site-pet canvas {
  display: block;
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: var(--meadow-height);
  image-rendering: pixelated;
}

.site-pet::after {
  content: '';
  position: absolute;
  inset: var(--meadow-height) 0 0;
  background: #ab8d70;
}

[data-theme="dark"] .site-pet::after { background: #665650; }

.site-pet:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

footer:has(.site-pet) {
  padding-bottom: calc(var(--meadow-height) + var(--meadow-inset) + 12px);
}

@media (max-width: 640px) {
  :root { --meadow-height: 50px; }
  footer:has(.site-pet) { padding-right: 0; }
}

@media print {
  .site-pet { display: none; }
  footer:has(.site-pet) { padding-bottom: 0; }
}
