html * {
	padding: 0;
	margin: 0;
}
body {
	background-color: #5f1d10;


}
.page {
  display: flex;
  flex-direction: column; /* scene on top, form underneath */
  align-items: center; /* centre everything horizontally */
  gap: 0;
  padding: 0;
}

/* The whole picture is one 1330x1051 canvas, centred on the merchant's face. Everything in it is placed in
   canvas units (--u = 1/1330 of the scene width), so it all scales together. */
.scene {
  position: relative;
  width: min(100%, (100dvh - 10em) * 1330 / 1051);
  aspect-ratio: 1330 / 1051;
  container-type: inline-size;
  --u: calc(100cqw / 1330);
}

.scene img {
  pointer-events: none; /* clicks pass through to the hotspots */
}

/* Deliberately sticks out above the page; only the rope gets cut off */
#sign {
  position: absolute;
  left: calc(400 * var(--u));
  top: calc(-50 * var(--u));
  width: calc(600 * var(--u));
}

/* Trophies hang on the wall left of the booth, two per row */
.shelf {
	position: absolute;
  left: calc(-50 * var(--u));
  top: calc(30 * var(--u));
  width: calc(400 * var(--u));
  display: flex;
  flex-wrap: wrap;
  gap: calc(10 * var(--u));
}

.painting {
  position: relative;
  width: calc(307 * var(--u));
  aspect-ratio: 1473 / 1120; /* frame.webp */
}

/* The frame's opening, measured on frame.webp */
.painting img {
  position: absolute;
  left: 10.3%;
  top: 13.5%;
  width: 79.1%;
  height: 72.8%;
  object-fit: cover; /* crop pictures whose shape differs from the opening */
}

.painting::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(/static/images/frame.webp) 0 0 / 100% 100%;
}


#merchant {
  position: absolute;
  left: calc(290 * var(--u));
  top: calc(350 * var(--u));
  width: calc(750 * var(--u));
  aspect-ratio: 554/457;
}

#merchant img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

#signpost {
  position: absolute;
  left: calc(1050 * var(--u));
  top: calc(430 * var(--u));
  width: calc(300 * var(--u));
}

#signpost img {
  display: block; /* no inline gap under the image, so the box is exactly the post */
  width: 100%;
}

.input-box {
  text-align: center;
}


.hotspot {

  position: absolute;
  z-index: 3; /* above every picture layer */
  width: 12.5%;
  height: 15%;
  /*border: green dotted;*/
}

#swine     { top: 45.4%; left: 15.6%; }
#anki      { top: 30.3%; left: 15.6%; }
#dirtyfrag { top: 30.3%; left: 77%; }

.posttext { left: 11%; width: 85%; height: 7.5%; }
#music     { top: 13%; }
#projects  { top: 21%; }
#something { top: 28.5%; }


#result-link {
  position: absolute;
  z-index: 3;
  top: calc(425 * var(--u)); /* measured from the top of .layers, i.e. the hat headroom */
  left: calc(445 * var(--u));
  font-size: calc(22 * var(--u));
  background: white;
  color: black;
}

.bench {
  z-index: 2;
}

/* Every merchant layer is drawn on the same 554x506 canvas: the booth plus
   49px of headroom for the shrug hat. So they all stack at 0,0, full width. */
#merchant .layers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin-top: -8.85%; /* the headroom; percentage margins follow the width */
}

.searching-arm {
  animation: shake 1s infinite;
  transform-origin: 50% 53.6%; /* centre of the arm, not of the canvas */
}


.shrug-animation {
  animation: shrug 1.5s step-end infinite; /* hard swap, no half-transparent overlap */
}


#shrug1 {
  animation-delay: 0.75s; /* half a cycle out of step, so the two frames alternate */
}

.hidden {
  display: none;
}

@keyframes shrug {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  99% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes shake {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  5% {
    transform: translate(-8px, 6px) rotate(-5deg) scale(1.02);
  }
  10% {
    transform: translate(10px, -8px) rotate(6deg) scale(0.98);
  }
  15% {
    transform: translate(-14px, 10px) rotate(-8deg) scale(1.04);
  }
  20% {
    transform: translate(12px, -12px) rotate(10deg) scale(0.96);
  }
  25% {
    transform: translate(-18px, 6px) rotate(-12deg) scale(1.05);
  }
  30% {
    transform: translate(16px, 14px) rotate(14deg) scale(0.95);
  }
  35% {
    transform: translate(-10px, -16px) rotate(-10deg) scale(1.03);
  }
  40% {
    transform: translate(20px, -6px) rotate(32deg) scale(0.94);
  }
  45% {
    transform: translate(-22px, 18px) rotate(-48deg) scale(1.06);
  }
  50% {
    transform: translate(0, 0) rotate(0deg) scale(1.1);
  }
  55% {
    transform: translate(18px, -14px) rotate(36deg) scale(0.96);
  }
  60% {
    transform: translate(-16px, 12px) rotate(-12deg) scale(1.04);
  }
  65% {
    transform: translate(14px, -18px) rotate(16deg) scale(0.95);
  }
  70% {
    transform: translate(-20px, 10px) rotate(-14deg) scale(1.05);
  }
  75% {
    transform: translate(12px, 16px) rotate(24deg) scale(0.97);
  }
  80% {
    transform: translate(-10px, -14px) rotate(-10deg) scale(1.03);
  }
  85% {
    transform: translate(16px, 8px) rotate(14deg) scale(0.98);
  }
  90% {
    transform: translate(-18px, -10px) rotate(-16deg) scale(1.04);
  }
  95% {
    transform: translate(10px, 12px) rotate(10deg) scale(0.99);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

/* No-JS search pause: searching for 2 s, then the result */
.phase-search {
  animation: hide-after 0s 2s forwards;
}
.phase-result {
  visibility: hidden;
  animation: show-after 0s 2s forwards;
}
@keyframes hide-after {
  to {
    visibility: hidden;
  }
}
@keyframes show-after {
  to {
    visibility: visible;
  }
}

form * {
color: #FAF3DD;
}


input {

	color: black;

}

button {

	color: #FAF3DD;
	background-color: black;

}
