/* reaction — Reaction (simple, go/no-go and choice reaction times). The light(s) in the top area and what happened
   under them; the key(s) in the bottom 45% (a tap anywhere on the play area counts; with two lights, the half tapped).
   Stimuli switch instantly: no transitions on the lights, so the timing is never blurred. Heights follow the screen
   (dvh) so everything stays on an iPhone SE. */
.rx { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.rx-stim { flex-direction: column; gap: 12px; min-height: clamp(170px, 32dvh, 280px); }
.rx-lights { display: flex; align-items: center; justify-content: center; gap: 40px; }

.rx-light {
  --d: min(168px, 23dvh);
  width: var(--d); height: var(--d); flex: none; border-radius: 50%; position: relative;
  border: 1.5px solid var(--stage-line); background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.rx-lights.two .rx-light { --d: min(118px, 17dvh); }
/* at rest: an empty ring with a faint dot in it */
.rx-light::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--stage-faint); }
.rx-light.is-go { background: #4FD18B; border-color: #4FD18B; }
.rx-light.is-stop { background: #E5484D; border-color: #E5484D; }
.rx-light.is-lure { background: #F2C94C; border-color: #F2C94C; }
.rx-light.is-go::before, .rx-light.is-stop::before, .rx-light.is-lure::before { display: none; }
.rx-light > i { display: none; }
/* color-safe: red is a barred light, a yellow flash a hollow ring, green a plain disc */
.rx-safe .rx-light.is-stop > i {
  display: block; position: absolute; left: 17%; right: 17%; top: 50%; height: 15%; transform: translateY(-50%);
  border-radius: 3px; background: var(--stage);
}
.rx-safe .rx-light.is-lure { background: transparent; border-width: calc(var(--d) * 0.13); }
.rx-lights.shake { animation: shake 0.15s ease-out; }

/* what happened: the time in big light digits, or a few words */
.rx-say {
  min-height: 54px; display: flex; align-items: baseline; justify-content: center; gap: 2px;
  font-size: 17px; font-weight: 300; color: var(--stage-ink); text-align: center; transition: opacity 220ms ease-out;
}
.rx-say b { font-size: 46px; font-weight: 200; letter-spacing: -0.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.rx-say small { font-size: 15px; color: var(--stage-dim); }
.rx-say.dim { color: var(--stage-dim); }
.rx-say.fade { opacity: 0; }
.rx-caption { margin: 0; min-height: 1.4em; font-size: 13px; color: #6A665F; text-align: center; }

.rx-pad { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; height: clamp(150px, 38dvh, 320px); }
.rx-pad.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rx-key { min-height: 44px; position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; }
.rx-key svg { display: block; color: var(--stage-faint); }
.rx-pad.two .rx-key svg { color: var(--stage-dim); }
.rx-key.rx-pressed { background: #1E1D1B; border-color: #3A3835; }
@media (prefers-reduced-motion: reduce) { .rx-say { transition: none; } .rx-lights.shake { animation: none; } }
