/* The rock paper scissors popover: two hands, a chant, three choices. It floats, so it may cast a shadow. */
.rps-panel {
  position: absolute; z-index: 30;
  top: calc(100% + 16px); left: 50%;
  width: min(400px, calc(100vw - 2 * var(--margin)));
  translate: -50% 0;
  padding: 20px;
  border-radius: 28px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  font-size: var(--step-small);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  scroll-margin-block: calc(var(--nav-h) + 16px) 24px;
  transform-origin: 50% 0;
}
.rps-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .rps-panel.is-opening { animation: pop-in .35s var(--ease-out); }
}
@keyframes pop-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } }

.rps-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rps-title { font-family: var(--font-text); font-weight: 500; font-size: var(--step-body); letter-spacing: 0; line-height: 1.3; }
.rps-close {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; background: var(--surface-3);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.rps-close:hover { background: #3a3940; transform: rotate(90deg); }

/* The stage where the hands shake. Both hands are drawn upright; Caleb's is mirrored to face yours. */
.rps-stage {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 140px; padding: 16px 10px 12px;
  border-radius: 20px;
  background: var(--bg);
}
.hand { display: grid; justify-items: center; gap: 8px; }
.hand-ico { width: 68px; height: 68px; fill: var(--ink); transform-origin: 50% 85%; }
.hand--caleb .hand-ico { fill: var(--accent); transform: scaleX(-1); }
.hand-who { color: var(--soft); }
.chant { display: grid; justify-items: center; min-width: 6.5em; font-family: var(--font-display); font-size: var(--step-lead); line-height: 1; }
.chant span { grid-area: 1 / 1; opacity: 0; }
.chant span.is-on { opacity: 1; }

.rps-stage.is-shaking .hand--you .hand-ico { animation: pump .36s var(--ease) 3; }
.rps-stage.is-shaking .hand--caleb .hand-ico { animation: pump-mirror .36s var(--ease) 3; }
@keyframes pump {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  45% { transform: translate3d(0, -16px, 0) rotate(-8deg); }
}
@keyframes pump-mirror {
  0%, 100% { transform: scaleX(-1) translate3d(0, 0, 0) rotate(0); }
  45% { transform: scaleX(-1) translate3d(0, -16px, 0) rotate(-8deg); }
}
.rps-stage.is-revealed .hand-ico { animation: reveal .45s var(--ease-out); }
@keyframes reveal { from { scale: .6; opacity: .3; } }
.rps-stage[data-result="visitor"] .hand--you .hand-ico,
.rps-stage[data-result="site"] .hand--caleb .hand-ico { scale: 1.12; }
.rps-stage[data-result="visitor"] .hand--caleb .hand-ico,
.rps-stage[data-result="site"] .hand--you .hand-ico { opacity: .4; }

.rps-result { margin-top: 14px; min-height: 2.9em; font-size: var(--step-small); line-height: 1.4; }

/* The three choices. The whole circle is the button; the icon and label inside never take the click. */
.rps-moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.bubble {
  aspect-ratio: 1; min-height: 88px;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  border-radius: 22px;
  background: var(--surface-3);
  font-weight: 500;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.bubble .ico { width: 40px; height: 40px; transition: transform .25s var(--ease); }
.bubble:hover { background: #3a3940; }
.bubble:hover .ico { transform: translateY(-3px) rotate(-6deg); }
.bubble:active { box-shadow: inset 0 0 0 2px var(--accent); }
.bubble[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.bubble[aria-disabled="true"] { cursor: progress; }
.bubble[aria-disabled="true"]:not([aria-pressed="true"]) { opacity: .55; }

@media (max-width: 860px) {
  .rps-panel {
    position: fixed; top: auto; bottom: 12px; left: 12px; right: 12px;
    width: auto; translate: none;
    transform-origin: 50% 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rps-stage .hand-ico, .bubble .ico { animation: none !important; transition: none !important; }
}
