/* Matrix execution only: keep the incumbent scene and all shared page modules. */
.memory-matrix.matrix-fx{position:relative;isolation:isolate;overflow:visible}
.matrix-fx .memory-cell{border-radius:13px;background:#f7f8f2;border:2px solid #adb8aa;color:#334939;box-shadow:0 5px 9px #203b2920;transition:background-color 100ms,border-color 100ms,color 100ms;cursor:pointer;transform-origin:center}
.matrix-fx .memory-cell:disabled{cursor:default}
.matrix-fx .memory-cell>span{font-weight:750;font-size:30px;line-height:1;position:relative;z-index:1}
.matrix-fx[data-fx-phase="observe"] .is-lit{background:#246bc4;border-color:#246bc4;color:#fff;box-shadow:0 5px 11px #246bc43d}
.matrix-fx[data-fx-phase="answer"] .is-selected{background:#246bc4;border:2px solid #246bc4;color:#fff;box-shadow:0 4px 8px #246bc43d}
.matrix-fx[data-fx-phase="answer"] .memory-cell:not(:disabled):active{transform:scale(.88);box-shadow:none}
.matrix-fx .memory-cell:focus-visible{outline:3px solid #173d77;outline-offset:4px}
.matrix-fx[data-fx-phase="reveal"] [data-fx-role="hit"]{background:#127047;color:#fff;border:2px solid #127047;box-shadow:0 5px 10px #12704740}
.matrix-fx[data-fx-phase="reveal"] [data-fx-role="wrong"]{background:#bb4a24;color:#fff;border:2px solid #bb4a24;box-shadow:0 5px 10px #bb4a2433}
.matrix-fx[data-fx-phase="reveal"] [data-fx-role="missed"]{background:#e4f0ff;color:#1e558d;border:2px dashed #1e558d;box-shadow:none}
.matrix-fx[data-fx-phase="reveal"] [data-fx-role="neutral"]{background:#f0f2eb;color:#6d796c;border-color:#c6cec2;box-shadow:none}
.matrix-fx .fx-press-selected{animation:matrix-tap 260ms cubic-bezier(.2,.8,.2,1) both}
.matrix-fx .fx-press-removed{animation:matrix-release 200ms ease-out both}
.matrix-fx.fx-reveal [data-fx-role="hit"]{animation:matrix-hit 520ms cubic-bezier(.2,.8,.25,1) both}
.matrix-fx.fx-reveal [data-fx-role="wrong"]{animation:matrix-wrong 420ms ease-out both}
.matrix-fx.fx-reveal [data-fx-role="missed"]{animation:matrix-missed 420ms ease-out both}
.matrix-fx.fx-reveal[data-fx-outcome="perfect"]{animation:matrix-win 620ms cubic-bezier(.2,.8,.2,1) both}
.matrix-fx.fx-reveal[data-fx-outcome="perfect"] [data-fx-role="hit"]::after{content:"";position:absolute;inset:-4px;border:3px solid #127047;border-radius:inherit;pointer-events:none;animation:matrix-ring 620ms ease-out both}
.matrix-fx .fx-press-selected::after{content:"";position:absolute;inset:-3px;border:2px solid #246bc4;border-radius:inherit;pointer-events:none;animation:matrix-ring 260ms ease-out both}
.matrix-sparks{position:absolute;inset:0;pointer-events:none;z-index:3;overflow:visible}
.matrix-sparks i{position:absolute;left:50%;top:50%;width:8px;height:8px;border-radius:2px;background:#e8b741;animation:matrix-spark 650ms cubic-bezier(.1,.65,.25,1) both;animation-delay:var(--delay,0ms)}
.matrix-sparks i:nth-child(3n){background:#127047}.matrix-sparks i:nth-child(3n + 1){background:#246bc4}
.memory-live-root .phone-inner:has(.matrix-fx) .stage-copy{font-weight:650}
@keyframes matrix-tap{0%{transform:scale(.88)}55%{transform:scale(1.11)}100%{transform:scale(1)}}
@keyframes matrix-release{0%{transform:scale(.92)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
@keyframes matrix-hit{0%{transform:scale(.83)}42%{transform:scale(1.13)}70%{transform:scale(.98)}100%{transform:scale(1)}}
@keyframes matrix-wrong{0%,100%{transform:translateX(0)}18%{transform:translateX(-7px) rotate(-3deg)}38%{transform:translateX(6px) rotate(2deg)}58%{transform:translateX(-4px)}78%{transform:translateX(2px)}}
@keyframes matrix-missed{0%{opacity:.35;transform:scale(.94)}100%{opacity:1;transform:scale(1)}}
@keyframes matrix-win{0%,100%{transform:scale(1)}45%{transform:scale(1.045)}}
@keyframes matrix-ring{0%{opacity:.8;transform:scale(.92)}100%{opacity:0;transform:scale(1.42)}}
@keyframes matrix-spark{0%{opacity:0;transform:translate(0,0) scale(.2)}12%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(var(--r)) scale(.4)}}
@media(prefers-reduced-motion:reduce){.memory-matrix.matrix-fx,.matrix-fx .memory-cell,.matrix-fx .memory-cell::after{animation:none!important;transition:none!important;transform:none!important}.matrix-sparks,.matrix-fx .memory-cell::after{display:none}}

/* Developer-only reference controls; the phone layout stays unchanged. */
.matrix-audio-guide audio{display:block;width:100%;max-width:340px;margin:12px 0}.matrix-audio-guide code{overflow-wrap:anywhere}.matrix-feedback-guide td,.matrix-audio-guide td{overflow-wrap:anywhere}
@media(max-width:640px){.matrix-audio-guide table,.matrix-audio-guide tbody,.matrix-audio-guide tr,.matrix-audio-guide th,.matrix-audio-guide td{display:block;width:100%;box-sizing:border-box}.matrix-audio-guide th{padding-bottom:0;border-bottom:0}.matrix-audio-guide audio{max-width:100%}}
