/* ==== The instruments of the confrontation (ig-): framed like the close-ups of the kit. Loaded after board.css. ====
   time: the cry rewound, what Mason sees past the door leaf, and the plan of the threshold with her line of sight.
   words: Ferguson's claim with its key words as buttons, and the passages of the notebook they open.
   glass: the shutter drawn across the window; past half way the dark pane turns into a mirror. */
.modal.interaction-modal:has(.instrument){--frame-cut:176;--frame-band:.53;--frame-round:.35;--frame-w:64px;position:relative;isolation:isolate;width:min(1060px,96vw);max-height:none;padding:var(--frame-w);border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;color:var(--kit-ivory);font-family:var(--kit-text)}
.modal.interaction-modal:has(.instrument)::before{content:'';position:absolute;inset:calc(var(--frame-w) * var(--frame-band));z-index:-1;border-radius:calc(var(--frame-w) * var(--frame-round));background:url('../assets/ui/kit/ui-v2-trama-marmo.webp') center/256px repeat,var(--kit-green);box-shadow:0 18px 50px #000c}
.modal.interaction-modal:has(.instrument)::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;border-style:solid;border-width:var(--frame-w);border-image:url('../assets/ui/kit/ui-v2-cornice-grande.webp') 176 / var(--frame-w) / 0 stretch}
.modal.interaction-modal:has(.instrument)>.close-modal{top:calc(var(--frame-w) * .1);right:calc(var(--frame-w) * .1)}

.instrument{display:flex;flex-direction:column;gap:10px;min-width:0}
.ig-head .eyebrow{margin:0;font:italic calc(13px * var(--kit-scale,1))/1.3 var(--kit-text);color:#cdbd97;letter-spacing:.06em}
.ig-head h2{margin:0 0 2px;font:600 calc(clamp(22px,2vw,30px) * var(--kit-scale,1))/1.15 var(--kit-display);color:var(--kit-gold)}
.ig-question{margin:0;font:italic calc(16px * var(--kit-scale,1))/1.35 var(--kit-text);color:#ece2c4}
.ig-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px}
.instrument .ig-act{margin-left:auto}
.instrument .ig-act[aria-disabled="true"]{filter:saturate(.45) brightness(.72)}
/* Holmes's reply to the last try: red ring when it was wrong. */
.ig-reply{display:flex;align-items:center;gap:10px;min-height:48px;padding-top:8px;border-top:1px solid #c5a56c55}
.ig-reply .tb-face{flex:none;width:44px;height:44px;border-radius:50%;object-fit:cover;object-position:50% 18%;border:2px solid var(--kit-gold-mid);box-shadow:0 2px 6px #000a}
.ig-reply p{margin:0;font:italic calc(15px * var(--kit-scale,1))/1.4 var(--kit-text);color:#e6dcbd}
.ig-reply.wrong .tb-face{border-color:#c0453a}
.ig-reply.wrong p{font-style:normal;color:#fff0d6}

/* The cry, rewound. */
.ig-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,24%);gap:12px;align-items:stretch}
.ig-view{position:relative;overflow:hidden;aspect-ratio:16/9;border:1px solid #c5a56c88;box-shadow:0 4px 16px #000a;background:#140c06}
.ig-view .ig-room{display:block;width:100%;height:100%;object-fit:cover;transform-origin:32% 58%;transition:transform .7s ease}
.ig-view.near .ig-room{transform:scale(1.22)}
/* The door leaf: dark oak with two panels, its lit edge toward the room. */
.ig-door{position:absolute;inset:0 auto 0 0;width:var(--cover);transition:width .7s cubic-bezier(.4,0,.2,1);background:url('../assets/ui/kit/ui-v2-battente.webp') right center/auto 100% no-repeat,linear-gradient(transparent 86%,#2a1a0e 86%,#1c1108 89%,#24160b),radial-gradient(ellipse at 40% 35%,#5a4430,#2c2015 70%);box-shadow:10px 0 22px #000d}
.ig-door::after{content:'';position:absolute;top:0;bottom:0;right:0;width:5px;background:linear-gradient(90deg,transparent,#e8b46a66)}
.ig-view.cry::after{content:'';position:absolute;inset:0;background:radial-gradient(circle at 70% 55%,#ffefc455,transparent 60%);animation:ig-cry 1.2s ease-out both;pointer-events:none}
@keyframes ig-cry{0%,20%{opacity:1}100%{opacity:0}}
.ig-beat{position:absolute;left:0;right:0;bottom:0;margin:0;padding:22px 12px 8px;background:linear-gradient(transparent,#0b0603e6 45%);font:calc(15px * var(--kit-scale,1))/1.4 var(--kit-text);color:#f3ead2}
.ig-beat b{color:var(--kit-gold)}
.ig-map{display:flex;flex-direction:column;gap:4px;margin:0;padding:8px;background:url('../assets/ui/kit/ui-v2-carta.webp') center/100% 100% no-repeat,#ecdcb8;box-shadow:0 4px 12px #0009;color:#4a3220}
.ig-plan{flex:1;width:100%;min-height:0}
.ig-plan .floor{fill:#f3e6c6}
.ig-plan .room{fill:none;stroke:#2c1a0c;stroke-width:1.6;stroke-linejoin:round}
.ig-plan .corridor{fill:#dcc79c;stroke:none}
.ig-plan .label{font:italic 4.2px var(--kit-text);fill:#5a3a1c}
.ig-plan .cradle{fill:#b98c4e;stroke:#5a3a1c;stroke-width:.6}
.ig-plan .leaf{stroke:#6b3f14;stroke-width:2.2;stroke-linecap:round}
.ig-plan .hinge{fill:#2c1a0c}
.ig-plan .sight{stroke:#2f6b3d;stroke-width:1.1;stroke-dasharray:2.2 1.4}
.ig-plan .sight.blocked{stroke:#a3281e}
.ig-plan .stop{stroke:#a3281e;stroke-width:1.1}
.ig-plan .mason{fill:#7a1f17;stroke:#fff3d6;stroke-width:.7}
.ig-map figcaption{display:flex;align-items:center;gap:6px;font:italic calc(12px * var(--kit-scale,1))/1.2 var(--kit-text)}
.ig-map .dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#7a1f17}
.ig-jamb{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 0 10px #160c05,inset 0 0 40px 14px #000c}
.ig-steps{display:flex;gap:6px;flex-wrap:wrap}
.instrument .ig-step{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:4px 10px 4px 4px;border:1px solid #c5a56c77;border-radius:22px;background:#00100c99;color:#e6dcbd;font:calc(14px * var(--kit-scale,1))/1.2 var(--kit-text);text-decoration:none}
.instrument .ig-step b{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#82501b;border:2px solid var(--kit-gold-mid);color:#fff3d6;font:700 14px/1 var(--kit-text)}
.instrument .ig-step[aria-pressed="true"]{border-color:var(--kit-gold);background:#3a2a10cc;color:#fff3d6;box-shadow:0 0 10px #f3c56a66}
.instrument .ig-step:hover:not(:disabled){border-color:var(--kit-gold);background:#2a1c0acc;color:#fff3d6}

/* Ferguson's words. */
.ig-claim{display:flex;align-items:center;gap:12px;margin:0;padding:10px 16px;background:url('../assets/ui/kit/ui-v2-carta.webp') center/100% 100% no-repeat,#ecdcb8;color:#2c1a0c;box-shadow:0 4px 12px #000a}
.ig-claim .tb-face{flex:none;width:44px;height:44px;border-radius:50%;object-fit:cover;object-position:50% 18%;border:2px solid #82501b}
.ig-claim p{margin:0;font:italic 600 calc(clamp(18px,1.6vw,24px) * var(--kit-scale,1))/1.45 var(--kit-display)}
.instrument .ig-word{display:inline;min-height:0;margin:0;padding:0 .08em;border:0;border-bottom:2px dotted #a0681f;border-radius:3px;background:#f3c56a33;color:#6b3f14;font:inherit;text-decoration:none;cursor:pointer}
.instrument .ig-word:hover:not(:disabled){background:#f3c56a66;border-color:#a0681f;color:#4a2a08}
.instrument .ig-word{position:relative}
.instrument .ig-word::before{content:'';position:absolute;inset:-10px -3px}
.instrument .ig-word[aria-pressed="true"]{background:#e9a73a;color:#2c1a0c;border-bottom-style:solid;box-shadow:0 0 8px #f3c56a}
.ig-passages{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px;min-height:96px;max-height:40dvh;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--kit-bronze) transparent}
.instrument .ig-passage{display:flex;align-items:flex-start;gap:10px;min-height:44px;padding:8px 10px;border:1px solid #c5a56c55;border-radius:4px;background:#00100cb0;color:#ece2c4;font:calc(14.5px * var(--kit-scale,1))/1.4 var(--kit-text);text-align:left;text-decoration:none}
.instrument .ig-passage i{display:block;margin-bottom:2px;font-size:.92em;color:#c9b78c}
.instrument .ig-passage b{color:var(--kit-gold)}
.ig-who{flex:none;width:36px;height:36px;border-radius:50%;object-fit:cover;object-position:50% 18%;border:1.5px solid var(--kit-gold-mid)}
.instrument .ig-passage:hover:not(:disabled){border-color:var(--kit-gold);background:#1a2a20d0;color:#fff3d6}
.instrument .ig-passage[aria-pressed="true"]{border-color:var(--kit-gold);background:#3a2a10e0;box-shadow:0 0 0 2px #e9a73a,0 0 12px #f3c56a55;color:#fff3d6}
.ig-empty{grid-column:1/-1;align-self:center;margin:0;font:italic calc(15px * var(--kit-scale,1))/1.4 var(--kit-text);color:#c9b78c;text-align:center}

/* The window: the garden picture under the reflection; the right pane goes dark and turns to a mirror as the shutter closes. */
.ig-glass{--mirror:clamp(0,calc((var(--closed) - 34) / 34),1);position:relative;width:min(100%,calc((100dvh - 420px) * 1448 / 1086));aspect-ratio:1448/1086;margin:0 auto;overflow:hidden;border:1px solid #c5a56c88;box-shadow:0 4px 16px #000a}
.ig-pane{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ig-pane.mirror{clip-path:inset(0 19.6% 0 41.6%);opacity:var(--mirror)}
/* The shutter's shadow on the right pane, darkening it before the mirror shows. */
.ig-shutter{position:absolute;top:0;bottom:0;left:41.6%;right:19.6%;background:linear-gradient(90deg,#000000,#00000066 40%,#00000022);opacity:calc(var(--closed) / 100 * .55 * (1 - var(--mirror) * .8));pointer-events:none}
.instrument .ig-target{position:absolute;display:flex;align-items:flex-end;justify-content:center;padding:6px;border:2px dashed transparent;border-radius:6px;background:none;text-decoration:none;cursor:pointer}
.instrument .ig-target.face{left:49%;top:14%;width:28%;height:52%}
.instrument .ig-target.garden{left:3%;top:30%;width:31%;height:52%}
.instrument .ig-target span{white-space:nowrap;padding:3px 10px;border-radius:12px;background:#0b0603cc;color:#f3ead2;font:calc(13px * var(--kit-scale,1))/1.3 var(--kit-text);box-shadow:0 2px 6px #000a}
.instrument .ig-target.face span{opacity:var(--mirror)}
.instrument .ig-target:hover:not(:disabled),.instrument .ig-target:focus-visible{border-color:#f3c56aaa;background:#f3c56a14}
.ig-slider{display:flex;align-items:center;gap:12px;flex:1;min-width:240px;font:italic calc(15px * var(--kit-scale,1))/1.3 var(--kit-text);color:#e6dcbd}
.ig-slider input{flex:1;min-width:0;height:44px;appearance:none;background:url('../assets/ui/kit/ui-v2-guida-cursore.webp') center/100% 12px no-repeat}
.ig-slider input::-webkit-slider-thumb{appearance:none;width:30px;height:38px;border:0;background:url('../assets/ui/kit/ui-v2-manopola.webp') center/contain no-repeat;cursor:grab}
.ig-slider input::-moz-range-thumb{width:30px;height:38px;border:0;background:url('../assets/ui/kit/ui-v2-manopola.webp') center/contain no-repeat;cursor:grab}
.ig-slider input:focus-visible{outline:2px solid var(--kit-ivory);outline-offset:2px}

/* Landscape phone: the frame thins, the heading keeps the question only, the pictures size on the height. */
@media (max-height:560px) and (min-aspect-ratio:1/1){
  .modal.interaction-modal:has(.instrument){--frame-w:26px;width:min(100%,calc(100vw - 2 * max(34px,var(--safe-l,0px))));height:calc(100dvh - 46px);max-height:none;overflow:hidden}
  .instrument{gap:5px;height:100%}
  .ig-head .eyebrow,.ig-head h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .ig-question{font-size:calc(13.5px * var(--kit-scale,1));line-height:1.3}
  .ig-stage{grid-template-columns:minmax(0,1fr) minmax(0,28%);gap:8px;height:calc(100dvh - 206px);min-height:0}
  .ig-view{aspect-ratio:auto;height:100%}
  .ig-map{height:100%;min-height:0;overflow:hidden}
  .ig-plan{height:100%}
  .ig-beat{padding:14px 8px 4px;font-size:12.5px;line-height:1.3}
  .ig-map{padding:4px}
  .ig-map figcaption{display:none}
  .instrument .ig-step{min-height:44px;min-width:44px;justify-content:center;padding:2px 8px 2px 2px;font-size:12px}
  .instrument .ig-step b{width:26px;height:26px;font-size:12px}
  .instrument .ig-step span{white-space:nowrap}
  .instrument .ig-step:not([aria-pressed="true"]){padding-right:2px}
  .instrument .ig-step:not([aria-pressed="true"]) span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .instrument .ig-act{white-space:nowrap;font-size:14px}
  .ig-controls{gap:6px 10px;flex-wrap:nowrap}
  .ig-steps{flex-wrap:nowrap;gap:4px;overflow-x:auto;scrollbar-width:none}
  .ig-reply{min-height:36px;padding-top:4px;gap:8px}
  .ig-reply .tb-face{width:30px;height:30px}
  .ig-reply p{font-size:12.5px;line-height:1.3;max-height:2.7em;overflow:auto;scrollbar-width:none}
  .ig-claim{padding:4px 10px;gap:8px}
  .ig-claim .tb-face{width:30px;height:30px}
  .ig-claim p{font-size:calc(14.5px * var(--kit-scale,1));line-height:1.45}
  .tool-words{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto minmax(0,1fr) auto;gap:5px 10px}
  .tool-words>:is(.ig-head,.ig-claim,.ig-passages){grid-column:1/-1}
  .tool-words .ig-reply{grid-row:4;grid-column:1;border-top:0;padding-top:0}
  .tool-words .ig-controls{grid-row:4;grid-column:2}
  .ig-passages{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;min-height:0;max-height:none;align-content:start;overflow:auto}
  .tool-words .ig-reply p{max-height:3.9em}
  .instrument .ig-passage{padding:4px 8px;font-size:12.5px;line-height:1.3;gap:6px}
  .ig-who{width:26px;height:26px}
  .tool-glass{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr;column-gap:12px;row-gap:6px}
  .tool-glass .ig-head{grid-column:1/-1}
  .ig-glass{grid-row:2/4;width:auto;height:calc(100dvh - 130px);max-width:none;margin:0}
  .tool-glass .ig-reply p{max-height:none}
  .tool-glass .ig-controls{align-self:start}
  .tool-glass .ig-slider{flex-direction:column;align-items:stretch}
  .tool-glass .ig-reply{align-self:start;border-top:0;padding-top:0}
  .ig-slider{min-width:0;font-size:13px;gap:8px}
  .instrument .ig-target{padding:3px}
  .instrument .ig-target span{padding:2px 7px;font-size:11px}
  .instrument .ig-target.face{left:44%;width:36%;top:12%;height:66%}
  .ig-slider input{height:40px}
}
@media (prefers-reduced-motion:reduce){
  .ig-view .ig-room,.ig-door,.ig-plan .leaf{transition:none}
  .ig-view.cry::after{animation:none;opacity:0}
}

