.game-reflex-light-tap {
  --reflex-stage-art: none;
  --reflex-charcoal: #172c2b;
  --reflex-ink: #102322;
  --reflex-cream: #fff4d6;
  --reflex-paper: #f5dfae;
  --reflex-mint: #24a77a;
  --reflex-green: #087b5c;
  --reflex-gold: #f3b52f;
  --reflex-coral: #ec4b3f;
  --reflex-red: #bd2632;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.portal-page.is-game-focus .mini-game-card:has(.game-reflex-light-tap) {
  --game-card-play-min-height: 452px;
  --game-card-play-max-height: 780px;
  --game-stage-play-min-height: 322px;
}

.game-reflex-light-tap .game-hud {
  gap: 6px;
  padding: 8px;
  border-bottom: 3px solid #f3b52f;
  background:
    radial-gradient(circle, rgba(255, 244, 214, 0.13) 0 1px, transparent 1.4px) 0 0 / 11px 11px,
    #193d3a;
  box-shadow: inset 0 -3px 0 rgba(5, 24, 23, 0.35);
}

.game-reflex-light-tap .game-hud-item {
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 244, 214, 0.44);
  border-radius: 12px;
  background: #102b2a;
  box-shadow: 0 3px 0 rgba(4, 18, 17, 0.42);
}

.game-reflex-light-tap .game-hud-label {
  color: #f5c957;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.07em;
}

.game-reflex-light-tap .game-hud-value {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.game-reflex-light-tap .game-stage {
  min-height: 322px;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(16, 35, 34, 0.02), rgba(16, 35, 34, 0.12) 70%, rgba(5, 22, 21, 0.2)),
    var(--reflex-stage-art) center / cover no-repeat,
    var(--reflex-charcoal);
  isolation: isolate;
  touch-action: manipulation;
}

.game-reflex-light-tap .game-stage::before {
  z-index: 1;
  inset: 15% 10% 10%;
  height: auto;
  border: 1px dashed rgba(245, 223, 174, 0.15);
  border-radius: 26px;
  background: rgba(10, 37, 35, 0.05);
  box-shadow: inset 0 0 42px rgba(36, 167, 122, 0.035);
  filter: none;
  pointer-events: none;
}

.game-reflex-light-tap .game-stage::after {
  z-index: 7;
  background:
    linear-gradient(90deg, rgba(243, 181, 47, 0.05), transparent 7% 93%, rgba(243, 181, 47, 0.05)),
    linear-gradient(180deg, transparent 76%, rgba(5, 22, 21, 0.12));
  pointer-events: none;
}

.portal-page.is-game-focus .game-reflex-light-tap:not(.is-countdown):not(.is-playing):not(.is-completing):not(.is-finished) .game-stage {
  min-height: clamp(364px, 50svh, 420px);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-reflex-light-tap:not(.is-countdown):not(.is-playing):not(.is-completing):not(.is-finished) .game-stage {
    min-height: clamp(364px, 50dvh, 420px);
  }
}

.portal-page.is-game-focus .game-reflex-light-tap.is-countdown .game-stage,
.portal-page.is-game-focus .game-reflex-light-tap.is-playing .game-stage,
.portal-page.is-game-focus .game-reflex-light-tap.is-completing .game-stage {
  min-height: var(--game-stage-play-min-height);
  height: clamp(340px, calc(100svh - 236px), 566px);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-reflex-light-tap.is-countdown .game-stage,
  .portal-page.is-game-focus .game-reflex-light-tap.is-playing .game-stage,
  .portal-page.is-game-focus .game-reflex-light-tap.is-completing .game-stage {
    height: clamp(340px, calc(100dvh - 236px), 566px);
  }
}

.game-reflex-light-tap.is-finished .game-stage {
  min-height: 0;
  height: auto;
  padding: 0;
  background: #ffffff;
}

.game-reflex-light-tap.is-finished .game-overlay {
  position: static;
  display: block;
  padding: 12px 16px;
  background: #ffffff;
  backdrop-filter: none;
}

.game-reflex-light-tap.is-finished .game-overlay-panel {
  width: 100%;
  padding: 0;
  color: #111827;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.game-reflex-light-tap .signal-command-grid {
  position: absolute;
  z-index: 2;
  inset: 18% 12% 11%;
  border-radius: 24px;
  opacity: 0.52;
  background-image: radial-gradient(circle, rgba(245, 223, 174, 0.2) 0 1px, transparent 1.4px);
  background-size: 18px 18px;
  box-shadow: inset 0 0 30px rgba(36, 167, 122, 0.045);
  pointer-events: none;
}

.game-reflex-light-tap.is-paused .signal-target {
  animation-play-state: paused;
}

.game-reflex-light-tap .signal-command-legend {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 2px solid rgba(16, 35, 34, 0.22);
  border-radius: 14px;
  background: rgba(255, 244, 214, 0.97);
  box-shadow: 0 5px 0 rgba(7, 32, 30, 0.26), 0 10px 18px rgba(4, 18, 17, 0.2);
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.game-reflex-light-tap.is-playing .signal-command-legend,
.game-reflex-light-tap.is-paused .signal-command-legend {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-reflex-light-tap .signal-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 8px 4px 4px;
  border-radius: 9px;
  color: #ffffff;
}

.game-reflex-light-tap .signal-legend--correct {
  background: var(--reflex-green);
}

.game-reflex-light-tap .signal-legend--wrong {
  background: var(--reflex-red);
}

.game-reflex-light-tap .signal-legend__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
}

.game-reflex-light-tap .signal-legend__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(1, 22, 20, 0.24));
}

.game-reflex-light-tap .signal-legend strong {
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.07em;
}

.game-reflex-light-tap .signal-target {
  position: absolute;
  z-index: 5;
  left: var(--signal-x);
  top: var(--signal-y);
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 72px;
  padding: 0;
  border: 0;
  color: var(--reflex-cream);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 9px 8px rgba(1, 18, 17, 0.45));
  animation: reflex-target-arrive 180ms cubic-bezier(0.2, 0.9, 0.28, 1.25) both;
  will-change: transform, opacity, filter;
}

.game-reflex-light-tap .signal-target:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 6px;
  filter: brightness(1.15) drop-shadow(0 0 18px currentColor);
}

.game-reflex-light-tap .signal-target::before,
.game-reflex-light-tap .signal-target::after {
  position: absolute;
  z-index: -2;
  inset: -4px;
  content: "";
  pointer-events: none;
}

.game-reflex-light-tap .signal-target::before {
  border: 2px dashed rgba(255, 244, 214, 0.5);
  border-radius: 50%;
  opacity: 0.72;
}

.game-reflex-light-tap .signal-target__shell {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.game-reflex-light-tap .signal-target__sprite {
  width: 118%;
  height: 118%;
  max-width: none;
  object-fit: contain;
  user-select: none;
}

.game-reflex-light-tap .signal-target strong {
  position: absolute;
  right: -4px;
  bottom: -7px;
  left: -4px;
  width: max-content;
  min-width: 48px;
  margin: auto;
  padding: 4px 7px;
  border: 2px solid rgba(255, 244, 214, 0.94);
  border-radius: 999px;
  color: #ffffff;
  background: var(--reflex-green);
  box-shadow: 0 3px 0 rgba(1, 22, 20, 0.34);
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.game-reflex-light-tap .signal-target__life {
  position: absolute;
  right: 8px;
  bottom: -14px;
  left: 8px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 8px currentColor;
  transform: scaleX(calc(1 - var(--signal-life)));
  transform-origin: left center;
}

.game-reflex-light-tap .signal-target--correct::after {
  border-radius: 50%;
  background: rgba(36, 167, 122, 0.18);
  box-shadow: 0 0 18px rgba(36, 167, 122, 0.48);
}

.game-reflex-light-tap .signal-target--wrong::before {
  border-color: rgba(255, 206, 109, 0.72);
}

.game-reflex-light-tap .signal-target--wrong::after {
  border-radius: 50%;
  background: rgba(236, 75, 63, 0.2);
  box-shadow: 0 0 19px rgba(236, 75, 63, 0.52);
}

.game-reflex-light-tap .signal-target--wrong strong {
  background: var(--reflex-red);
  font-size: 6px;
}

.game-reflex-light-tap .signal-target__impact {
  position: absolute;
  z-index: 8;
  inset: -42%;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.game-reflex-light-tap .signal-target__impact::before,
.game-reflex-light-tap .signal-target__impact::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.game-reflex-light-tap .signal-target__impact i {
  position: absolute;
  top: calc(50% - 5px);
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #ffe15b;
  opacity: 0;
  transform: translate(0, 0) rotate(45deg) scale(0.2);
}

.game-reflex-light-tap .signal-target__impact i:nth-child(1) { --impact-x: -62px; --impact-y: -44px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(2) { --impact-x: -14px; --impact-y: -72px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(3) { --impact-x: 48px; --impact-y: -58px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(4) { --impact-x: 70px; --impact-y: -4px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(5) { --impact-x: 52px; --impact-y: 55px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(6) { --impact-x: 3px; --impact-y: 72px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(7) { --impact-x: -58px; --impact-y: 51px; }
.game-reflex-light-tap .signal-target__impact i:nth-child(8) { --impact-x: -74px; --impact-y: 4px; }

.game-reflex-light-tap .signal-target.is-correct .signal-target__shell {
  animation: reflex-correct-target 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-correct .signal-target__impact,
.game-reflex-light-tap .signal-target.is-wrong .signal-target__impact {
  opacity: 1;
}

.game-reflex-light-tap .signal-target.is-correct .signal-target__impact::before {
  width: 64%;
  height: 64%;
  border: 5px solid #ffe15b;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(45, 221, 198, 0.62);
  animation: reflex-boom-ring 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-correct .signal-target__impact::after {
  width: 62%;
  height: 62%;
  background: repeating-conic-gradient(from 8deg, #ffe15b 0 7deg, transparent 7deg 27deg);
  clip-path: polygon(48% 0, 57% 36%, 82% 8%, 68% 42%, 100% 30%, 72% 53%, 100% 71%, 64% 63%, 73% 100%, 52% 68%, 31% 100%, 40% 63%, 0 74%, 33% 52%, 1% 32%, 39% 42%);
  animation: reflex-boom-burst 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-correct .signal-target__impact i {
  animation: reflex-impact-particle 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-correct .signal-target__impact i:nth-child(even) {
  background: #2dddc6;
}

.game-reflex-light-tap .signal-target.is-wrong .signal-target__shell {
  animation: reflex-wrong-target 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-wrong .signal-target__impact::before {
  width: 56%;
  height: 56%;
  border-radius: 50%;
  background: #31313d;
  box-shadow: -28px -8px 0 -5px #4c3b42, 25px -18px 0 -7px #31313d, 30px 18px 0 -8px #4c3b42, -22px 24px 0 -7px #31313d;
  animation: reflex-explosion-cloud 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-wrong .signal-target__impact::after {
  width: 58%;
  height: 58%;
  background: radial-gradient(circle, #fff5a6 0 18%, #ffca3a 19% 38%, #ff5a22 39% 67%, #b71f2e 68%);
  clip-path: polygon(50% 0, 61% 28%, 88% 9%, 77% 39%, 100% 49%, 75% 59%, 92% 88%, 62% 74%, 49% 100%, 39% 73%, 8% 89%, 24% 59%, 0 46%, 27% 38%, 12% 10%, 40% 28%);
  animation: reflex-explosion-flash 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-wrong .signal-target__impact i {
  border-radius: 1px;
  background: #ff6b28;
  clip-path: polygon(50% 0, 100% 100%, 0 72%);
  animation: reflex-impact-particle 340ms ease-out both;
}

.game-reflex-light-tap .signal-target.is-wrong .signal-target__impact i:nth-child(odd) {
  background: #3d3038;
}

.game-reflex-light-tap .signal-target.is-missed {
  animation: reflex-target-missed 210ms ease-in both;
}

.game-reflex-light-tap .signal-target.is-expired {
  animation: reflex-target-expired 210ms ease-in both;
}

.game-reflex-light-tap .signal-command-feedback {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 13px;
  left: 0;
  width: max-content;
  max-width: calc(100% - 30px);
  min-height: 30px;
  margin: auto;
  padding: 7px 16px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(16, 35, 34, 0.94);
  box-shadow: 0 8px 18px rgba(2, 19, 18, 0.3);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(7px) scale(0.94);
  transition: opacity 90ms ease, transform 90ms ease;
  pointer-events: none;
}

.game-reflex-light-tap.is-correct-feedback .signal-command-feedback,
.game-reflex-light-tap.is-wrong-feedback .signal-command-feedback,
.game-reflex-light-tap.is-miss-feedback .signal-command-feedback {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.game-reflex-light-tap.is-correct-feedback .signal-command-feedback {
  background: linear-gradient(180deg, #24a77a, #087b5c);
}

.game-reflex-light-tap.is-wrong-feedback .signal-command-feedback {
  background: linear-gradient(180deg, #ec4b3f, #bd2632);
}

.game-reflex-light-tap.is-miss-feedback .signal-command-feedback {
  color: #102322;
  background: linear-gradient(180deg, #fff4d6, #f3b52f);
}

.game-reflex-light-tap.is-correct-feedback .game-stage {
  box-shadow: inset 0 0 0 4px rgba(36, 167, 122, 0.62), inset 0 0 42px rgba(36, 167, 122, 0.16);
}

.game-reflex-light-tap.is-wrong-feedback .game-stage {
  box-shadow: inset 0 0 0 5px rgba(236, 75, 63, 0.7), inset 0 0 52px rgba(189, 38, 50, 0.2);
  animation: reflex-stage-shake 300ms ease-out;
}

.game-reflex-light-tap .game-overlay {
  z-index: 10;
  padding: 18px;
  background: rgba(12, 39, 37, 0.5);
  backdrop-filter: none;
}

.game-reflex-light-tap .game-overlay-panel {
  width: min(318px, 100%);
  padding: 18px 18px 19px;
  border: 4px solid var(--reflex-cream);
  border-radius: 24px;
  color: var(--reflex-ink);
  background:
    radial-gradient(circle, rgba(16, 35, 34, 0.07) 0 1px, transparent 1.4px) 0 0 / 11px 11px,
    var(--reflex-cream);
  box-shadow:
    0 0 0 3px var(--reflex-green),
    0 9px 0 rgba(6, 56, 47, 0.48),
    0 22px 38px rgba(1, 22, 20, 0.34);
}

.game-reflex-light-tap .game-overlay-panel h2 {
  margin: 8px 0 6px;
  color: var(--reflex-ink);
  font-size: 26px;
  line-height: 1.05;
  text-shadow: none;
}

.game-reflex-light-tap .game-overlay-panel p {
  margin: 0 auto 14px;
  max-width: 250px;
  color: #35514d;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.game-reflex-light-tap .signal-ready-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 2px solid var(--reflex-ink);
  border-radius: 999px;
  color: var(--reflex-ink);
  background: var(--reflex-gold);
  box-shadow: 0 3px 0 rgba(16, 35, 34, 0.34);
  font-size: 10px;
  font-weight: 950;
}

.game-reflex-light-tap .reflex-ready-art {
  position: relative;
  display: flex;
  width: 248px;
  height: 126px;
  align-items: center;
  justify-content: space-between;
  margin: 5px auto 0;
}

.game-reflex-light-tap .signal-ready-token {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 8px 6px rgba(1, 22, 20, 0.28));
}

.game-reflex-light-tap .signal-ready-token > span {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
}

.game-reflex-light-tap .signal-ready-token img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-reflex-light-tap .signal-ready-token strong {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: max-content;
  min-width: 58px;
  margin: auto;
  padding: 5px 9px;
  border: 2px solid var(--reflex-cream);
  border-radius: 999px;
  color: #ffffff;
  background: var(--reflex-green);
  box-shadow: 0 3px 0 rgba(6, 36, 31, 0.36);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 0 rgba(6, 36, 31, 0.4);
}

.game-reflex-light-tap .signal-ready-token--correct::before {
  position: absolute;
  z-index: -1;
  inset: 13px;
  border: 4px solid rgba(45, 221, 198, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 225, 91, 0.24);
  content: "";
  animation: reflex-ready-boom 1.35s ease-out infinite;
}

.game-reflex-light-tap .signal-ready-token--wrong strong {
  background: var(--reflex-red);
  font-size: 7px;
}

.game-reflex-light-tap .countdown-value {
  color: var(--reflex-gold);
  text-shadow: 0 0 22px rgba(243, 181, 47, 0.62), 0 5px 0 rgba(1, 22, 20, 0.35);
}

.game-reflex-light-tap.is-completing .game-stage {
  min-height: var(--game-stage-play-min-height);
}

@media (max-width: 360px) {
  .game-reflex-light-tap .game-hud-item {
    gap: 3px;
    padding-inline: 5px;
  }

  .game-reflex-light-tap .game-hud-label {
    font-size: 8px;
  }

  .game-reflex-light-tap .signal-command-legend {
    top: 10px;
    gap: 4px;
  }

  .game-reflex-light-tap .signal-legend {
    padding-right: 5px;
  }

  .game-reflex-light-tap .signal-legend__icon {
    width: 27px;
    height: 27px;
  }

  .game-reflex-light-tap .game-overlay {
    padding: 14px;
  }

  .game-reflex-light-tap .game-overlay-panel {
    padding: 16px 13px 17px;
  }

  .game-reflex-light-tap .reflex-ready-art {
    width: 232px;
    transform: scale(0.92);
  }
}

@keyframes reflex-target-arrive {
  from {
    opacity: 0;
    transform: scale(0.62);
    filter: brightness(1.8) drop-shadow(0 0 24px currentColor);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes reflex-correct-target {
  0% { opacity: 1; transform: scale(1); }
  32% { opacity: 1; transform: scale(0.78) rotate(-7deg); }
  100% { opacity: 0; transform: scale(0.24) rotate(18deg); }
}

@keyframes reflex-wrong-target {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  22% { transform: translateX(-7px) scale(1.05); }
  44% { transform: translateX(7px) scale(1.05); }
  100% { opacity: 0; transform: translateX(0) scale(0.25); }
}

@keyframes reflex-boom-ring {
  0% { opacity: 1; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(1.75); }
}

@keyframes reflex-boom-burst {
  0% { opacity: 0; transform: rotate(-16deg) scale(0.2); }
  32% { opacity: 1; }
  100% { opacity: 0; transform: rotate(10deg) scale(1.42); }
}

@keyframes reflex-explosion-cloud {
  0% { opacity: 0; transform: scale(0.18); }
  38% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes reflex-explosion-flash {
  0% { opacity: 0; transform: rotate(-12deg) scale(0.16); }
  28% { opacity: 1; transform: rotate(5deg) scale(1.14); }
  100% { opacity: 0; transform: rotate(12deg) scale(1.48); }
}

@keyframes reflex-impact-particle {
  0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(0.2); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--impact-x), var(--impact-y)) rotate(225deg) scale(1); }
}

@keyframes reflex-target-missed {
  from { opacity: 1; transform: scale(1); filter: saturate(1); }
  to { opacity: 0; transform: scale(0.72); filter: saturate(0) brightness(1.4); }
}

@keyframes reflex-target-expired {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.82); }
}

@keyframes reflex-ready-boom {
  0%, 52%, 100% { opacity: 0; transform: scale(0.72); }
  18% { opacity: 0.9; transform: scale(1); }
  40% { opacity: 0; transform: scale(1.45); }
}

@keyframes reflex-stage-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  82% { transform: translateX(2px); }
}
