html, body { background: #a5d8f0; }

#scene { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: pointer; }
#scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#scene svg.enter { animation: fadein .5s ease-out; }
#scene svg.leave { animation: fadeout .4s ease-in forwards; pointer-events: none; }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }

#slots { position: absolute; z-index: 10; top: 1.5vh; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 34vh);
  display: flex; gap: 1vh; justify-content: center; align-items: center; height: 7vh; padding: 0 2vh; border-radius: 3.5vh;
  background: #ffffff88; pointer-events: none; }
.slot { width: min(7vh, calc(60vw / var(--n, 6))); aspect-ratio: 7 / 5; opacity: .4; filter: grayscale(1) brightness(1.2); transition: all .3s; }
.slot svg { width: 100%; height: 100%; overflow: visible; }
.slot.on { opacity: 1; filter: none; animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.6) rotate(-8deg); } }

.wig { transform-box: fill-box; transform-origin: center; animation: wig 1.4s ease-in-out infinite alternate; }
@keyframes wig { from { transform: rotate(-7deg) scaleX(.97); } to { transform: rotate(7deg) scaleX(1.03); } }
.ring { animation: ring .8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes ring { from { transform: scale(.85); opacity: .6; } to { transform: scale(1.15); opacity: 1; } }
.tap { animation: tapfx .5s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes tapfx { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.spark { position: fixed; z-index: 6; width: 2vh; height: 2vh; border-radius: 50%; pointer-events: none; }

@media (max-aspect-ratio: 1/1) {
  #slots { top: 3vw; left: 21vw; right: 17vw; margin: 0; width: auto; max-width: none; height: 12vw; border-radius: 6vw; gap: 1vw; padding: 0 2vw; }
  .slot { width: min(9vw, calc(50vw / var(--n, 6))); }
}

/* title screen: choose a set */
#sets { display: flex; gap: 4vh; flex-wrap: wrap; justify-content: center; }
button.set { width: 24vh; height: 24vh; border-radius: 4vh; border: none; color: #fff; font-family: inherit; cursor: pointer; background: #1e88e5;
  box-shadow: 0 1.2vh 0 #1565c0, 0 2vh 2vh #0005; display: flex; flex-direction: column; align-items: center; justify-content: center; }
button.set[data-set="frogs"] { background: #43a047; box-shadow: 0 1.2vh 0 #2e7d32, 0 2vh 2vh #0005; }
button.set[data-set="monkeys"] { background: #fb8c00; box-shadow: 0 1.2vh 0 #e65100, 0 2vh 2vh #0005; }
button.set span { font-size: 12vh; line-height: 1.1; }
button.set small { font-size: 3vh; font-weight: 700; }
button.set:active { transform: translateY(1vh); }
@media (max-aspect-ratio: 1/1) {
  #sets { gap: 5vw; }
  button.set { width: 40vw; height: 36vw; border-radius: 6vw; }
  button.set span { font-size: 17vw; } button.set small { font-size: 4.5vw; }
}

/* hiding places */
.prop { cursor: pointer; }
.prop .idle { animation: idle 2.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes idle { from { transform: translateY(0) scale(1); } to { transform: translateY(-4px) scale(1.03); } }
.pupil { transition: transform .25s ease-out; }

/* the "find this" icon */
#target { position: absolute; z-index: 10; top: 1.5vh; left: 2vw; width: 12vh; height: 12vh; border-radius: 50%; background: #fff; pointer-events: none;
  border: .9vh solid #ffeb3b; box-shadow: 0 .8vh 0 #f9a825, 0 1.6vh 2vh #0004; display: flex; align-items: center; justify-content: center; }
#target svg { width: 86%; height: 86%; overflow: visible; }
#target.pop { animation: tpop .7s ease-out; }
@keyframes tpop { 0% { transform: scale(.3) rotate(-15deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1); } }
#target.got { border-color: #66bb6a; box-shadow: 0 .8vh 0 #2e7d32, 0 1.6vh 2vh #0004; }
#target.got::after { content: '✓'; position: absolute; right: -1vh; bottom: -1vh; width: 5.5vh; height: 5.5vh; border-radius: 50%; background: #43a047; color: #fff;
  font: 800 4vh/5.5vh system-ui, sans-serif; text-align: center; animation: tpop .5s ease-out; }
@media (max-aspect-ratio: 1/1) {
  #target { top: 2vw; left: 2vw; width: 17vw; height: 17vw; border-width: 1.2vw; }
  #target.got::after { width: 8vw; height: 8vw; font: 800 6vw/8vw system-ui, sans-serif; right: -1.5vw; bottom: -1.5vw; }
}
