/* Capsule Map — deliberately goofy styles */
html, body, button, input, textarea {
  font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", "Comic Sans", sans-serif;
}
body { -webkit-user-select: none; user-select: none; touch-action: none; }

.hud { z-index: 10; }

.goofy-btn {
  background: #b6ff3b;
  color: #000;
  border: 4px solid #ff4fd8;
  border-radius: 18px 6px 22px 4px;
  padding: 0.5rem 1rem;
  box-shadow: 6px 6px 0 #000;
  font-weight: 900;
  text-shadow: 1px 1px 0 #fff36b;
}
.goofy-btn:active { transform: translate(4px, 4px) rotate(-2deg); box-shadow: 2px 2px 0 #000; }
#bury:active { transform: translate(calc(-50% + 4px), 4px) rotate(-2deg); }

.goofy-chip {
  background: #fff36b;
  border: 3px dashed #7a00ff;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  box-shadow: 4px 4px 0 #000;
  font-weight: 700;
  transform: rotate(2deg);
}

/* joystick */
#stick {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, #9dfcffaa, #ff9de2aa);
  border: 4px solid #000;
  box-shadow: 5px 5px 0 #000;
  touch-action: none;
}
#knob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: #ff4fd8; border: 4px solid #000;
  pointer-events: none;
}

/* capsule labels (MapLibre markers) */
.cap-label {
  background: #fff; border: 3px solid #000; border-radius: 10px;
  padding: 1px 6px; font-weight: 900; font-size: 12px; white-space: nowrap;
  box-shadow: 3px 3px 0 #ff4fd8; pointer-events: none;
}

/* animations */
@keyframes wobble { 0%,100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.wobble { animation: wobble 0.4s ease-in-out infinite; }

@keyframes shake1 { 0%,100% { translate: 0 0; } 25% { translate: -4px 2px; } 75% { translate: 4px -2px; } }
@keyframes shake2 { 0%,100% { translate: 0 0; } 25% { translate: -10px 5px; } 75% { translate: 10px -5px; } }
@keyframes shake3 { 0%,100% { translate: 0 0; } 25% { translate: -20px 10px; } 75% { translate: 20px -10px; } }
.shake-1 { animation: shake1 0.15s linear infinite; }
.shake-2 { animation: shake2 0.1s linear infinite; }
.shake-3 { animation: shake3 0.07s linear infinite; }

@keyframes slam {
  0% { transform: scale(3) rotate(var(--r, -12deg)); opacity: 0; }
  60% { transform: scale(0.9) rotate(var(--r, -12deg)); opacity: 1; }
  100% { transform: scale(1) rotate(var(--r, -12deg)); opacity: 1; }
}
.slam { animation: slam 0.25s ease-out forwards; }

.flip { transform: rotate(180deg); transition: transform 0.6s; }
body.flip { height: 100dvh; } /* children are all fixed, so give body a size to spin around */

/* The thumbstick is supervised by a duck. Its bill follows your thumb. */
#knob {
  background: #ffdb37;
  box-shadow: inset -4px -5px #f2a71b;
}
#knob::before, #knob::after {
  content: "";
  position: absolute;
}
#knob::before {
  top: 10px; left: 10px; width: 6px; height: 9px;
  border-radius: 50%; background: #201622; box-shadow: 18px 1px #201622;
}
#knob::after {
  top: 23px; left: 6px; width: 33px; height: 14px;
  border: 3px solid #201622; border-radius: 50% 35% 55% 48%;
  background: #ff8025; transform: rotate(-6deg);
}
#soil-receipt {
  position: fixed; z-index: 11; top: 18%; left: 50%;
  width: 190px; padding: 14px 12px 21px; pointer-events: none;
  background: #fff9dc; color: #2b221c; text-align: center;
  font: bold 14px/1.3 "Courier New", monospace;
  filter: drop-shadow(3px 5px 0 #33201b);
  transform: translateX(-50%) rotate(-6deg);
  clip-path: polygon(0 0,100% 0,100% 96%,90% 100%,80% 96%,70% 100%,60% 96%,50% 100%,40% 96%,30% 100%,20% 96%,10% 100%,0 96%);
}
#soil-receipt small, #soil-receipt strong, #soil-receipt span { display: block; }
#soil-receipt strong { margin: 4px 0; padding-block: 4px; border-block: 1px dashed; font-size: 18px; }
#soil-receipt b { display: inline-block; margin-top: 8px; padding: 2px 5px; border: 3px double; color: #993524; transform: rotate(4deg); }
@media (prefers-reduced-motion: no-preference) {
  #soil-receipt:not([hidden]) { animation: print-receipt 320ms ease-out; }
  @keyframes print-receipt {
    from { opacity: 0; transform: translate(-50%, -35%) rotate(7deg); }
  }
}

/* capsule party: notes sheet docked right, dancer on the left (Task: party open) */
dialog.cap-side { inset: 0 2vw 0 auto !important; margin: auto 0 !important; width: min(28rem, 50vw) !important; }
dialog.cap-side::backdrop { background: transparent !important; }
@media (max-width: 640px) {
  dialog.cap-side { inset: auto 8px 8px 8px !important; margin: 0 !important; width: auto !important; max-height: 52dvh !important; }
}
@keyframes cap-half-l { to { transform: translate(-38vw, -18vh) rotate(-540deg); opacity: 0; } }
@keyframes cap-half-r { to { transform: translate(38vw, 14vh) rotate(620deg); opacity: 0; } }
@keyframes cap-ring { from { transform: scale(.1); opacity: 1; } to { transform: scale(4); opacity: 0; } }
@keyframes cap-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes cap-boom { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 30% { transform: scale(1.3) rotate(8deg); opacity: 1; } 100% { transform: scale(1.6) rotate(0); opacity: 0; } }
