/* The poop (public/poop.js): henry's head rises from the bottom and sprays the screen. The layer runs over every overlay
   (like the troll) and lets taps through; only splats (tap = wipe) and the slip take them. Flat, ink-outlined cartoon
   browns, no gradients. */
.poop-layer { position: fixed; inset: 0; z-index: 6001; pointer-events: none; overflow: hidden; contain: strict; }

.poop-head { position: absolute; left: 50%; bottom: calc(52px + env(safe-area-inset-bottom)); width: 120px; height: 120px;
  transform: translate(-50%, calc(100% + 70px + env(safe-area-inset-bottom))); transition: transform .45s cubic-bezier(.5, 0, .7, .4); }
.poop-head.up { transform: translate(-50%, 0); transition: transform .5s cubic-bezier(.2, .9, .3, 1.25); }
.poop-head .ph-face { width: 100%; height: 100%; transform-origin: 50% 90%; }
.poop-head.strain .ph-face { animation: ph-strain .11s linear infinite alternate; }
.poop-head.kick .ph-face { animation: ph-kick .18s ease-out, ph-strain .11s .18s linear infinite alternate; }
.poop-head.done .ph-face { animation: ph-relief .6s ease-out; }
.poop-head .mface, .poop-head .mface img, .poop-head .mface svg { display: block; width: 100%; height: 100%; }
.poop-head .ph-blank { display: block; width: 100%; height: 100%; border-radius: 50%; background: #e8b48c; border: 3px solid #2a1608; }
@keyframes ph-strain { from { transform: translate(-2px, 1px) rotate(-3deg) scale(1.02, .97); } to { transform: translate(2px, -1px) rotate(3deg) scale(.98, 1.03); } }
@keyframes ph-kick { 0% { transform: scale(1.14, .82); } 100% { transform: none; } }
@keyframes ph-relief { 0% { transform: scale(1.1, .9); } 40% { transform: scale(.94, 1.08); } 100% { transform: none; } }

/* one in flight (poop.js animates its transform) */
.poop-fly { position: absolute; left: 0; top: 0; will-change: transform; }
.poop-fly svg { display: block; width: 100%; height: 100%; overflow: visible; }
.poop-fly path, .poop-splat path, .poop-splat circle { stroke: #2a1608; stroke-linejoin: round; stroke-linecap: round; }
.poop-fly .pp-body { fill: #7a4a24; stroke-width: 3.5; }
.poop-fly .pp-line { fill: none; stroke: #4e2c12; stroke-width: 3; }
.poop-fly .pp-shine { fill: none; stroke: #b07a46 !important; stroke-width: 3; }

/* stuck to the glass */
.poop-splat { position: absolute; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transform: rotate(var(--rot)); animation: ps-hit .26s cubic-bezier(.2, 1.4, .4, 1) both; transition: opacity .4s, translate .8s cubic-bezier(.5, 0, .9, .5); }
.poop-splat svg { display: block; width: 100%; height: 100%; overflow: visible; }
.poop-splat .ps-blob { fill: #6e3f1c; stroke-width: 2.6; }
.poop-splat .ps-lump { fill: #855127; stroke-width: 2; }
.poop-splat .ps-drop { fill: #6e3f1c; stroke-width: 1.6; }
.poop-splat .ps-drip { fill: #6e3f1c; stroke-width: 2; }
.poop-splat .ps-drips { transform-origin: 50% 70%; animation: ps-drip 3.2s .3s cubic-bezier(.3, 0, .6, 1) both; }
.poop-splat .ps-shine { fill: none; stroke: #a8743f !important; stroke-width: 3.5; }
.poop-splat.slide { translate: 0 40vh; opacity: 0; }
.poop-splat.gone { opacity: 0; transition: opacity .35s; animation: ps-wipe .35s ease-in forwards; }
.poop-splat.still { animation: ps-fade .3s ease-out both; }
@keyframes ps-hit { 0% { transform: rotate(var(--rot)) scale(.35); } 100% { transform: rotate(var(--rot)) scale(1); } }
@keyframes ps-drip { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
@keyframes ps-wipe { to { transform: rotate(var(--rot)) scale(1.15, .5); } }
@keyframes ps-fade { from { opacity: 0; } to { opacity: 1; } }

/* who's here: the letterboard slip the fart and the troll drop, with a brown stripe */
.poop-slip { position: fixed; z-index: 6002; left: 50%; top: calc(10px + env(safe-area-inset-top)); width: min(calc(100% - 24px), 380px);
  display: flex; flex-direction: column; gap: 6px; padding: 13px 16px 12px 20px; border: 0; border-radius: 12px; text-align: left;
  box-shadow: 0 0 0 1px #f5f5f21f, 0 3px 0 #0000004d, inset 4px 0 0 #7a4a24; -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, calc(-100% - 20px - env(safe-area-inset-top))); visibility: hidden;
  transition: transform .22s ease-in, visibility 0s .22s; }
.poop-slip.in { transform: translate(-50%, 0); visibility: visible; transition: transform .32s cubic-bezier(.2, .9, .3, 1.2); }
.poop-slip .row1 { font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poop-slip .row2 { text-transform: none; letter-spacing: .04em; font-size: 16px; }
.poop-slip:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .poop-head, .poop-head.up, .poop-slip, .poop-slip.in, .poop-splat { transition: none; }
  .poop-head .ph-face, .poop-splat .ps-drips { animation: none !important; }
  .poop-splat.slide { translate: none; }
}
