/* LabSaver — auto-played turn on the real board, in the case-study style. */
/* Match the case-study paper sections: same cream fill, dot texture, rules and type. */
.incident-study{box-sizing:border-box;width:min(94%,1380px);margin:0 auto;padding:clamp(26px,4.4vw,65px);background:var(--paper);background-image:radial-gradient(#8c61350c .7px,transparent .9px);background-size:5px 7px;border-top:1px solid var(--rule);color:var(--ink)}
.demo-head .topline{display:flex;justify-content:space-between;border-bottom:1px solid var(--rule);padding-bottom:15px;font-size:10px;font-weight:700;letter-spacing:.1em;color:var(--brick)}
.demo-head h2{font:italic 800 clamp(32px,3.8vw,58px)/1.08 Georgia,serif;letter-spacing:-.035em;margin:20px 0 0;color:var(--ink)}
.demo-board{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr);gap:clamp(16px,2vw,30px);align-items:start;max-width:min(100%,1240px);margin:26px auto 0}
.demo-board .rescue-map{grid-column:1;grid-row:1 / span 2}
.demo-board .hand{grid-column:2;grid-row:1;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-width:none;margin:0}
.demo-board .replay-card{grid-column:2;grid-row:2;margin:14px auto 0}

/* Real board cropped to two active rows (570x317) with the ladder band between them */
.rescue-map{position:relative;width:100%;line-height:0;isolation:isolate}
.board-base{display:block;width:100%;height:auto}
.rescue-map>img:not(.board-base){position:absolute;transform:translate(-50%,-50%);line-height:normal}
.rescue-map .lab-marker{width:19%;height:auto;z-index:2;opacity:.92}
/* Only the upper-row lab marker survives the crop; the others were on deleted rows. */
.rescue-map .lab-marker.m2{left:62.2%;top:28%}
/* Ladders sit on the green divider band between the two remaining rows. */
.rescue-map .ladder{height:34%;width:auto;z-index:3;opacity:.95}
.rescue-map .ladder.l1{left:11.6%;top:50.5%}
.rescue-map .ladder.l2{left:88.1%;top:50.5%}
.rescue-map .location{width:19%;height:auto;left:36.9%;top:73.5%;z-index:2;transition:opacity .55s ease,transform .55s ease}
.rescue-map .emergency{left:62.2%;top:73.5%;visibility:hidden;opacity:0}
.rescue-map .blast{width:20%;height:auto;left:36.9%;top:73.5%;z-index:3;filter:drop-shadow(2px 4px 4px #4a201833);transition:opacity .55s ease,transform .55s ease}
/* Pawns are wrapped so a soft contact shadow can sit under the cutout. */
.rescue-map .pawn{position:absolute;height:20%;width:auto;z-index:4;transform:translate(-50%,-50%);transition:left .45s ease,top .45s ease,transform .25s ease;isolation:isolate}
.rescue-map .pawn img{position:relative;z-index:1;display:block;height:100%;width:auto;filter:drop-shadow(1px 3px 2px #0005);animation:pawn-idle 2.8s ease-in-out infinite}
.rescue-map .pawn::after{content:"";position:absolute;left:50%;bottom:-9%;width:66%;height:18%;transform:translateX(-50%);background:radial-gradient(ellipse at center,#0007 0%,#0004 45%,transparent 75%);z-index:0}
@keyframes pawn-idle{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5%)}}
.rescue-map .pawn.climbing{transition:left .95s linear,top .95s linear,transform .25s ease;transform:translate(-50%,-50%) scaleX(.82)}
.rescue-map .pawn.climbing img{animation:none;transform:rotate(-4deg)}
.rescue-map.climb-l1 .ladder.l1,.rescue-map.climb-l2 .ladder.l2{opacity:1;filter:drop-shadow(0 0 7px #ddb34d) drop-shadow(0 0 2px #ddb34d)}
/* Doctor and Builder start on the upper row; the Fireman starts on the lower row. */
.rescue-map .fireman{left:11.6%;top:73.5%}
.rescue-map .doctor{left:36.9%;top:28%}
.rescue-map .builder{left:88.1%;top:28%}

/* The cell that must be played into lights up */
.target-cell{position:absolute;width:21%;height:38%;left:36.9%;top:73.5%;transform:translate(-50%,-50%);border:3px dashed #c8962f;background:#e4bc4a26;z-index:1;animation:cell-pulse 1.6s ease-in-out infinite;pointer-events:none}
@keyframes cell-pulse{0%,100%{background:#e4bc4a1f}50%{background:#e4bc4a4d}}
.rescue-map[data-step="5"] .blast{visibility:hidden;opacity:0;transform:translate(-50%,-50%) scale(.7)}
.rescue-map:is([data-step="2"],[data-step="3"],[data-step="4"],[data-step="5"]) .emergency{visibility:visible;opacity:1}
.rescue-map[data-step="2"] .target-cell{left:62.2%}
.rescue-map[data-step="3"] .target-cell{left:11.6%;top:50.5%}
.rescue-map[data-step="4"] .target-cell{left:88.1%;top:50.5%}
.rescue-map[data-step="5"] .target-cell{display:none}
.rescue-map .pawn.pop{animation:pawn-pop .55s ease}
@keyframes pawn-pop{0%{filter:drop-shadow(0 0 0 #ddb34d00)}45%{filter:drop-shadow(0 0 9px #ddb34d)}100%{filter:drop-shadow(0 0 0 #ddb34d00)}}

/* Speech bubble on the cell where the action happens */
.action-bubble{position:absolute;left:36.9%;top:35%;transform:translate(-50%,-50%);z-index:6;max-width:170px;padding:9px 11px;background:#fffdf2;box-shadow:0 3px 12px rgba(24,58,42,.15);color:#294f35;font:12px/1.5 'Segoe UI',sans-serif;opacity:0;transition:opacity .4s ease,left .5s ease,top .5s ease;pointer-events:none}
.rescue-map.playing .action-bubble{opacity:1}
.rescue-map[data-step="2"] .action-bubble{left:62.2%;top:8%}
.rescue-map[data-step="3"] .action-bubble{left:24%;top:8%}
.rescue-map[data-step="4"] .action-bubble{left:76%;top:8%}
.rescue-map[data-step="5"] .action-bubble{left:50%;top:8%}

/* The hand shows only the printed cards; replay is a separate site-style button. */
.hand{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 10px;justify-items:center;align-items:center;max-width:none;margin:0}
.play-card{position:relative;box-sizing:border-box;width:100%;max-width:112px;padding:0;background:transparent;border:1px solid transparent;border-radius:2px;transition:transform .25s,box-shadow .25s,background .25s,border-color .25s;cursor:default}
.play-card.active{transform:translateY(-6px);background:transparent;box-shadow:0 0 22px 9px rgba(240,190,60,.45)}
.play-card.active img{outline:3px solid #e0a92b;outline-offset:0;filter:drop-shadow(0 0 11px rgba(240,190,60,.95)) drop-shadow(0 0 4px rgba(255,230,150,.9)) drop-shadow(0 6px 8px rgba(0,0,0,.28))}
.play-card.active::after{content:"NOW";position:absolute;left:50%;bottom:-17px;transform:translateX(-50%);padding:2px 7px;background:#fff6d6;color:#8a5a12;font:700 9px/1.2 'Segoe UI',sans-serif;letter-spacing:.08em;white-space:nowrap;pointer-events:none}
/* Action cards are a different hand type: warm amber rule above the card. */
.play-card.action-card{border-top:3px solid #a83820}
.play-card img{display:block;width:100%;height:auto;object-fit:contain}
.replay-card{display:block;margin:18px auto 0;padding:14px 36px;background:var(--paper);border:1px solid var(--ink);color:var(--ink);font:700 14px/1.2 'Segoe UI',sans-serif;letter-spacing:.14em;cursor:pointer;transition:transform .2s,background .2s,color .2s}
.replay-card:hover{background:var(--ink);color:var(--paper);transform:translateY(-2px)}
.replay-card:focus-visible{outline:2px solid var(--brick);outline-offset:2px}
@media(max-width:900px){
  .demo-board{grid-template-columns:1fr;max-width:min(100%,940px)}
  .demo-board .rescue-map,.demo-board .hand,.demo-board .replay-card{grid-column:1;grid-row:auto}
  .hand{grid-template-columns:repeat(8,minmax(0,1fr));max-width:min(100%,940px);margin:18px auto 0}
  .replay-card{margin:18px auto 0}
}
@media(max-width:700px){.incident-study{padding:22px 18px}.demo-head h2{font-size:30px}.hand{grid-template-columns:repeat(4,minmax(0,1fr))}.play-card{max-width:74px;font-size:8px}}
