/* Clinical Quest v5: animated physical pads, curved device cables, clinical hand gestures.
 * This layer deliberately scopes changes to the simulator; dashboard remains v4.
 * Visual cues are simulated and do not claim to measure compression depth or CPR quality.
 */
.game-v4 .v4-theatre{background:#041a29}
.game-v4 .v4-defib-unit{border-top-color:#d5e8f0;border-left-color:#b1c9d8;box-shadow:inset 0 0 25px #061422,0 10px 0 #102e40,0 25px 38px #000a,0 0 28px #21eeef14}
.game-v4 .v4-defib-unit:before{content:"";position:absolute;left:9px;right:9px;top:41px;height:2px;background:linear-gradient(90deg,transparent,#d8faff6b,transparent);pointer-events:none}
.game-v4 .v4-device-lcd{position:relative;overflow:hidden;transition:box-shadow .3s}
.game-v4 .cq-connectors{position:absolute;right:-17px;top:48%;width:20px;display:flex;flex-direction:column;gap:20px;z-index:2;pointer-events:none}
.game-v4 .cq-connectors span{position:relative;display:flex;align-items:center;justify-content:end;gap:3px;height:21px;font-family:Arial,sans-serif;color:#9ce7ef;font-size:6px;font-weight:900;white-space:nowrap;text-shadow:0 1px 2px #02162e}
.game-v4 .cq-port{display:block;width:14px;height:14px;flex:none;background:radial-gradient(circle,#36ecda 0 15%,#0b3147 17% 54%,#839fac 55% 80%,#183b51 80%);border:2px solid #8be7ee;border-radius:50%;box-shadow:0 0 8px #42ffff64,inset 0 0 6px #001f2b}
.game-v4 .v4-pad-chip.placed{border-color:#46e4c3;background:#12536b;color:#b5fff4;box-shadow:inset 0 0 10px #34f8d21e}
/* Wires trace live screen coordinates from two device ports to pad targets. */
.game-v4 .cq-cable-layer{position:absolute;inset:0;width:100%;height:100%;z-index:7;overflow:visible;pointer-events:none}
.game-v4 .cq-cable path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.game-v4 .cq-wire-shadow{stroke:#000d16;stroke-width:10;opacity:.92;filter:drop-shadow(3px 6px 3px #000b)}
.game-v4 .cq-wire-sheath{stroke:#1a2736;stroke-width:7}
.game-v4 .cq-wire-inner{stroke:#428198;stroke-width:2.1;opacity:.95;filter:drop-shadow(0 0 3px #38dcff55)}
.game-v4 .cq-wire-energy{stroke:#c6fbff;stroke-width:2.6;opacity:.3;stroke-dasharray:8 27;stroke-dashoffset:0;filter:drop-shadow(0 0 5px #40f4ef)}
.game-v4 .cq-wire-ready .cq-wire-energy{stroke:#44ffcf;opacity:.62}
.game-v4 .cq-plug-tip{fill:#2a9faf;stroke:#ccffff;stroke-width:2.4;filter:drop-shadow(0 0 7px #39ffee)}
.game-v4 .cq-plug-base{fill:#152d42;stroke:#9cf4ed;stroke-width:2}
.game-v4 .cq-cable{animation:cqCableDraw .75s ease-out both}
.game-v4 .v4-theatre.cq-is-charging .cq-wire-energy,.cq-shock-event .v4-theatre .cq-wire-energy{opacity:1;stroke-dasharray:15 14;animation:cqCurrent 0.22s linear infinite;stroke-width:3.2}
.game-v4 .v4-theatre.cq-is-charging .cq-cable,.cq-shock-event .v4-theatre .cq-cable{filter:drop-shadow(0 0 4px #42edff)}
@keyframes cqCableDraw{from{opacity:0;filter:brightness(2.5)}to{opacity:1;filter:brightness(1)}}
@keyframes cqCurrent{to{stroke-dashoffset:-87}}
/* The actual contact pad is a white/teal physical electrode, replacing a generic icon. */
.game-v4 .v4-spot.pad-spot.placed{width:68px;height:78px;z-index:9;border:2px solid #d9f9ff;border-radius:12px;transform:translate(-50%,-50%) rotate(-11deg);background:linear-gradient(140deg,#faf7ea,#b3d2d9 52%,#5f8797);box-shadow:0 3px 10px #00161cae,0 0 0 4px #35ffc021,0 0 19px #67ffe5a8;animation:none;color:#066777}
.game-v4 .v4-spot[data-spot="pad2"].placed{transform:translate(-50%,-50%) rotate(14deg)}
.game-v4 .v4-spot.pad-spot.placed>span{height:100%;width:100%}
.game-v4 .cq-electrode{width:100%;height:100%;position:relative;display:flex!important;flex-direction:column;align-items:center;justify-content:space-between;padding:6px 2px;box-sizing:border-box;background:repeating-linear-gradient(0deg,#f9fffe0d 0 2px,#d7e8e91c 2px 4px);border-radius:10px}
.game-v4 .cq-electrode b{font:900 11px Arial,sans-serif;color:#276777}.game-v4 .cq-electrode i{display:grid;place-items:center;width:31px;height:31px;border:2px solid #1dc6c8;border-radius:50%;background:linear-gradient(145deg,#03536a,#13a4ae);box-shadow:0 0 11px #0cf4efba;color:#e4fffb}
.game-v4 .cq-electrode em{font:700 7px Arial,sans-serif;white-space:nowrap;color:#215062;font-style:normal}
.game-v4 .v4-spot.pad-spot.placed.cq-electrode-placed{animation:cqAttachPad 1.1s ease-out both}
@keyframes cqAttachPad{0%{opacity:.6;scale:1.3;filter:brightness(1.8)}30%{opacity:1;scale:.92;filter:brightness(1.8)}65%{scale:1.1}100%{scale:1;filter:brightness(1)}}
/* 2.8-second charge with joule counter, oscillating display and glows. */
.game-v4 .cq-charge-meter{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;align-items:center;padding:4px 9px;background:linear-gradient(135deg,#001827ee,#0b4257f7);color:#d9ffff;direction:ltr}
.game-v4 .cq-charge-meter-head{font-size:8px;font-weight:900;color:#f6ca69;direction:rtl}
.game-v4 .cq-charging-j{font:bold 22px Arial,sans-serif;color:#a0fff0;text-shadow:0 0 16px #29ffe2;grid-row:2;grid-column:1/3;text-align:center}
.game-v4 .cq-charging-pct{font:900 9px Arial,sans-serif;text-align:right;color:#e8e1b0}
.game-v4 .cq-fill-track{height:7px;grid-column:1/3;grid-row:3;border-radius:50px;overflow:hidden;background:#08263b;box-shadow:inset 0 0 5px #000c}
.game-v4 .cq-fill-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#1b8fc4,#42e9e3,#fff3b8);border-radius:50px;box-shadow:0 0 13px #62fff8}
.game-v4 .v4-defib-unit.cq-is-charging{animation:cqDeviceVibrate .16s linear infinite;border-color:#45cadd;box-shadow:0 0 19px #4beffb6b,0 10px 0 #123349,0 20px 34px #000b}
.game-v4 .v4-defib-unit.cq-is-charging .v4-device-lcd{box-shadow:inset 0 0 18px #43e7dd4f,0 0 21px #1ac9c57e}
.game-v4 .v4-defib-unit.cq-is-charging .v4-device-actions button{cursor:wait;opacity:.52}
.game-v4 .v4-theatre.cq-is-charging:before{animation:cqChargingRoom .45s infinite alternate;opacity:.34}
.game-v4 .v4-theatre.cq-is-charging .v4-spot.pad-spot.placed{box-shadow:0 0 0 7px #40ffe923,0 0 27px #48ffffa6}
@keyframes cqDeviceVibrate{0%,100%{translate:0 0}50%{translate:1px 0}}
@keyframes cqChargingRoom{0%{opacity:.2}100%{opacity:.6}}
/* Animated medical glove used for examination, palpation, and CPR on the image. */
.game-v4 .cq-hand-layer{position:absolute;inset:0;z-index:13;pointer-events:none;overflow:hidden}
.game-v4 .cq-hand-fx{position:absolute;width:130px;height:158px;transform:translate(-70%,-50%);pointer-events:none;animation:cqHandMove 2.2s ease-in-out forwards;filter:drop-shadow(6px 13px 7px #001323bf)}
.game-v4 .cq-hand-fx.cq-hand-compress,.game-v4 .cq-hand-fx.cq-hand-start_cpr,.game-v4 .cq-hand-fx.cq-hand-resume{width:154px;height:182px}
.game-v4 .cq-hand-fx.cq-hand-pulse,.game-v4 .cq-hand-fx.cq-hand-final_check{width:109px;height:140px}
.game-v4 .cq-glove-svg{width:100%;height:100%;display:block;transform:rotate(-3deg)}
.game-v4 .cq-touch-label{position:absolute;left:65%;bottom:0;background:#073146e8;box-shadow:0 0 20px #28ffff64;border:1px solid #46e5e4;border-radius:18px;padding:5px 10px;font-size:10px;color:#f7ffff;font-weight:800;white-space:nowrap}
.game-v4 .cq-touch-marker{position:absolute;left:65%;top:32%;width:30px;height:30px;border-radius:50%;background:#56ffee32;border:1px solid #c7fffd;box-shadow:0 0 18px #37dbee;animation:cqTouchRing .8s infinite alternate}
.game-v4 .cq-touch-marker i{position:absolute;inset:6px;border:1px solid #b8fffc;border-radius:50%}
.game-v4 .cq-touch-marker i:nth-child(2){inset:11px}.game-v4 .cq-touch-marker i:nth-child(3){inset:-8px;opacity:.33}
.game-v4 .cq-hand-fx.cq-hand-breath .cq-touch-marker{border-style:dashed;box-shadow:0 0 20px #6afcff90;animation:cqBreathInspect .6s infinite alternate}
.game-v4 .cq-hand-fx.cq-hand-compress .cq-glove-svg,.game-v4 .cq-hand-fx.cq-hand-start_cpr .cq-glove-svg,.game-v4 .cq-hand-fx.cq-hand-resume .cq-glove-svg{animation:cqPress 0.45s ease-in-out 4}
@keyframes cqHandMove{0%{opacity:0;translate:125px 150px;rotate:25deg;scale:1.15}18%{opacity:1;translate:0 0;rotate:0;scale:1}22%,70%{opacity:1;translate:0 0;rotate:0;scale:1}93%,100%{opacity:0;translate:145px 140px;rotate:20deg;scale:1.1}}
@keyframes cqTouchRing{0%{opacity:.5;scale:.86}100%{opacity:1;scale:1.17}}
@keyframes cqBreathInspect{0%{scale:1;opacity:.5}100%{scale:1.3;opacity:1}}
@keyframes cqPress{0%,100%{translate:0 0;scale:1}45%{translate:0 14px;scale:.92}}
/* Electric discharge with clinical transient (NOT a normal-heartbeat transition before CPR). */
.game-v4 .cq-room-fx{position:absolute;inset:0;z-index:12;pointer-events:none;display:grid;place-items:center;overflow:hidden}
.game-v4 .cq-shock-wave{width:170px;height:170px;border-radius:50%;border:3px solid #f6ffff;box-shadow:0 0 25px #d5ffff,0 0 65px #40faff, inset 0 0 25px #baffff;animation:cqShockRing 1.5s ease-out forwards;position:absolute;top:44%;left:50%}
.game-v4 .cq-shock-label,.game-v4 .cq-clear-warning{position:absolute;left:50%;top:27%;transform:translateX(-50%);border-radius:13px;white-space:nowrap;padding:12px 20px;background:#0a4260e8;border:2px solid #ecffff;color:white;font:bold 21px Arial,sans-serif;letter-spacing:1px;box-shadow:0 0 30px #43fcff99;animation:cqShockLabel 1.6s ease-out forwards}
.game-v4 .cq-clear-warning{background:#84223ce8;border-color:#ff8eae;box-shadow:0 0 25px #ff437e99;display:flex;flex-direction:column;gap:3px;align-items:center}
.game-v4 .cq-clear-warning small{font-family:Vazirmatn,sans-serif;font-size:12px;letter-spacing:0}
.cq-shock-event .game-v4 .v4-person-figure{animation:cqPatientReaction 1.25s ease-out!important}
.cq-shock-event .game-v4 .v4-spot.pad-spot.placed{animation:cqPadDischarge .55s ease-out 2}
.cq-shock-event .game-v4 .v4-shock-flash{animation:cqBrightFlash 1.45s ease-out both}
@keyframes cqShockRing{0%{opacity:1;scale:.25;transform:translate(-50%,-50%)}100%{opacity:0;scale:4.5;transform:translate(-50%,-50%)}}
@keyframes cqShockLabel{0%{opacity:0;translate:0 35px}18%,60%{opacity:1;translate:0 0}100%{opacity:0;translate:0 -35px}}
@keyframes cqPatientReaction{0%,8%,100%{transform:translateX(-50%) translateY(0)}15%{transform:translateX(calc(-50% - 5px)) translateY(-14px) rotate(-1deg)}24%{transform:translateX(calc(-50% + 5px)) translateY(4px) rotate(1deg)}33%{transform:translateX(-50%) translateY(-7px)}47%{transform:translateX(-50%) translateY(2px)}}
@keyframes cqPadDischarge{0%{filter:brightness(1)}22%{filter:brightness(3);box-shadow:0 0 30px #fdffff,0 0 60px #21ffd6}100%{filter:brightness(1)}}
@keyframes cqBrightFlash{0%,100%{opacity:0}10%{opacity:.92}19%{opacity:0}33%{opacity:.53}42%{opacity:0}55%{opacity:.23}75%{opacity:0}}
@media(max-width:1250px){.game-v4 .v4-spot.pad-spot.placed{width:56px;height:66px}.game-v4 .cq-electrode em{font-size:6px}.game-v4 .cq-electrode i{width:26px;height:26px}}
@media(max-width:540px){.game-v4 .v4-spot.pad-spot.placed{width:45px;height:54px}.game-v4 .cq-electrode b{font-size:8px}.game-v4 .cq-electrode i{width:22px;height:22px}.game-v4 .cq-electrode em{font-size:5px}.game-v4 .cq-hand-fx{width:82px;height:120px}.game-v4 .cq-hand-fx.cq-hand-compress{width:96px;height:134px}.game-v4 .cq-touch-label{font-size:8px}.game-v4 .cq-shock-label{font-size:14px}}
@media(prefers-reduced-motion:reduce){.game-v4 .cq-hand-fx{animation:none!important;opacity:1!important;translate:0 0!important}.game-v4 .cq-cable,.game-v4 .cq-wire-energy,.game-v4 .cq-charge-meter,.game-v4 .cq-shock-wave,.game-v4 .cq-shock-label{animation:none!important}}
/* Prevent legacy v3 translateX(500%) from hiding the ECG trace for most of each cycle. */
.game-v4 .v4-monitor-bezel .monitor-wave svg{display:block;width:100%!important;height:100%!important;transform:none!important;animation:cqECGLive 2.5s ease-in-out infinite alternate!important;opacity:1}
.game-v4 .v4-monitor-bezel .monitor-wave svg .wavepath{stroke:#48ffe0!important;stroke-width:3!important;filter:drop-shadow(0 0 4px #5fffd9)}
@keyframes cqECGLive{0%,100%{filter:brightness(.85)}50%{filter:brightness(1.4)}}
.game-v4 .v4-spot.pad-spot.placed:hover:after,.game-v4 .v4-spot.pad-spot.placed:focus-visible:after{display:none!important}
/* Align fingertips with the actual pulse, shoulder and CPR hotspot rather than the face. */
.game-v4 .cq-hand-fx{transform:translate(-70%,-15%)}
.game-v4 .cq-hand-fx.cq-hand-pulse,.game-v4 .cq-hand-fx.cq-hand-final_check{transform:translate(-76%,-18%)}
