/* ——— Сцена ——— */
.where { position: absolute; inset: 0; display: flex; flex-direction: column; padding: .65rem .7rem .7rem; gap: .5rem; touch-action: none; }
.where-bench { position: relative; flex: 0 0 40%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; align-items: end; padding: 0 .3rem .55rem; }
/* Верстак: тёмная полка с фирменной полосой, на ней стоят предметы. */
.where-bench::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: .55rem; border-radius: .3rem; background: linear-gradient(#3a4256, #2B3040 60%); box-shadow: inset 0 .16rem 0 rgba(106,144,255,.55), 0 .3rem .5rem rgba(16,20,28,.12); }
.where-item { position: relative; z-index: 1; display: grid; place-items: end center; height: 100%; min-width: 0; margin: 0; padding: 0 0 .1rem; border: 0; background: none; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; transition: opacity .3s ease; }
.where-item .wa { width: min(100%, 5.4rem); height: auto; aspect-ratio: 1; filter: drop-shadow(0 .2rem .16rem rgba(16,20,28,.14)); transition: filter .25s ease; }
.where-item.is-selected .wa { filter: drop-shadow(0 0 .3rem rgba(106,144,255,.85)) drop-shadow(0 .4rem .3rem rgba(16,20,28,.18)); }
.where-item:is(.is-lifted,.is-gone) .wa { visibility: hidden; }
/* Keep all four shelf slots composited from the start, including hidden sources.
   Promoting siblings only during a drag changes their fractional SVG sampling. */
.where-item { will-change: transform; }
.where-item.is-gone { opacity: 0; pointer-events: none; }
.where-item:focus-visible { outline: none; }
.where-item:focus-visible .wa { filter: drop-shadow(0 0 .3rem rgba(106,144,255,.9)); }
.where-item.is-answer .wa { filter: drop-shadow(0 0 .35rem rgba(47,165,100,.9)); }
.where-item.is-wrong .wa { filter: drop-shadow(0 0 .35rem rgba(226,71,85,.9)); }

/* Места: плитки как платформы Крана; инструмент без подписи — действие нужно понять по рисунку. */
.where-places { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.where-place { position: relative; min-width: 0; min-height: 0; margin: 0; padding: .25rem; border: 0; border-radius: .9rem; background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; isolation: isolate; }
.where-place-art { position: relative; display: block; height: 100%; max-width: 100%; aspect-ratio: 1; margin: 0 auto; }
.where-place-art > .wa { width: 100%; height: 100%; }
.where-place.is-target > .where-place-frame { box-shadow: inset 0 0 0 2.5px var(--accent), 0 .5rem .9rem rgba(104,137,255,.3); }
.where-game.is-armed .where-place > .where-place-frame { box-shadow: inset 0 0 0 1.5px rgba(106,144,255,.55); }
.where-place.is-answer > .where-place-frame { box-shadow: inset 0 0 0 2.5px #2FA564, 0 .4rem .8rem rgba(47,165,100,.25); }
.where-place.is-wrong > .where-place-frame { box-shadow: inset 0 0 0 2.5px var(--danger), 0 .4rem .8rem rgba(189,61,75,.25); }
.where-place:focus-visible > .where-place-frame { outline: none; box-shadow: inset 0 0 0 2.5px var(--accent); }
.where-place:active:not(:disabled) { opacity: 1; }
/* Куда садится предмет: позиция задаётся в единицах рисунка места (dock в where-art.js). */
.where-dock { position: absolute; z-index: 2; pointer-events: none; }
.where-dock .wa { width: 100%; height: auto; aspect-ratio: 1; }

/* Ошибка: место вздрагивает, предмет возвращается. */

/* Перетаскиваемая копия предмета. */
.where-ghost { position: absolute; left: 0; top: 0; z-index: 10; pointer-events: none; will-change: transform; }
.where-ghost .wa { width: 100%; height: 100%; filter: drop-shadow(0 .2rem .16rem rgba(16,20,28,.14)); }
.where-ghost.is-held .wa { filter: drop-shadow(0 .8rem .7rem rgba(17,23,34,.25)); }

/* Как в «Приёме заказа»: голос и повтор, затем письменный разбор. */
.shift-task.where-task {color:#FCFDFF;padding:.78rem .9rem .9rem;min-height:0;}
.where-task .shift-command,.where-task .shift-prompt,.where-task .shift-sense {display:none;}
.where-task .shift-name {font-size:.83rem;text-align:left;}
.shift-task.where-task > .where-voice {position:relative;display:grid;align-items:center;justify-content:stretch;min-height:4rem;margin:.55rem 0 0;padding:.6rem .78rem;border:1.5px solid #fcfdffd9;border-radius:.78rem;background:#fcfdff29;}
.where-voice > * {grid-area:1 / 1;transition:opacity .28s ease,translate .34s cubic-bezier(.2,.8,.2,1),visibility .28s;}
.where-voice-wave {display:flex;align-items:center;justify-content:space-between;gap:3px;width:100%;height:2.6rem;opacity:0;visibility:hidden;translate:0 5px;}
.where-voice-wave i {flex:1 1 0;max-width:4px;height:calc(var(--h) * 100%);border-radius:2px;background:#fcfdffeb;transform:scaleY(.2);}
.where-task.is-speaking .where-voice-wave {opacity:1;visibility:visible;translate:0 0;}
.where-task.is-speaking .where-voice-wave i {animation:wh-voice .62s ease-in-out infinite alternate;animation-delay:var(--d);}
@keyframes wh-voice {from{transform:scaleY(.18)}to{transform:scaleY(1)}}
.where-replay {justify-self:start;display:inline-flex;align-items:center;gap:.55rem;height:2.6rem;margin:0;padding:0 1.05rem 0 .4rem;border:0;border-radius:1.3rem;background:#FCFDFF;color:var(--accent);box-shadow:0 .3rem .7rem #10141c21;font:inherit;font-size:.74rem;font-weight:700;cursor:pointer;}
.where-replay:disabled {opacity:.55;cursor:default;}
.where-replay i {display:grid;place-items:center;width:1.8rem;height:1.8rem;border-radius:50%;background:var(--accent);color:#FCFDFF;}
.where-replay svg {width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.where-replay svg .cone {fill:currentColor;}
.where-replay:focus-visible {outline:2px solid #FCFDFF;outline-offset:3px;}
.where-task.is-speaking .where-replay {opacity:0;visibility:hidden;translate:0 -5px;pointer-events:none;}
.shift-task.where-task.has-answer > .where-voice {display:none;}
.shift-task.where-task .where-said {margin:.55rem 0 0;font-size:1.05rem;font-weight:700;line-height:1.3;overflow-wrap:anywhere;}
.where-said b {font-weight:800;border-radius:.3rem;box-shadow:inset 0 -2px 0 #fcfdfff2;-webkit-box-decoration-break:clone;box-decoration-break:clone;}
.shift-task.where-task .where-verdict {justify-content:flex-start;flex-wrap:wrap;gap:.4rem;margin-top:.5rem;}
.where-chip {display:inline-flex;align-items:center;flex-wrap:wrap;gap:.35rem;padding:.3rem .6rem;border-radius:.65rem;background:#FCFDFF;color:var(--ink);font-size:.7rem;font-weight:700;}
.where-chip.is-ok {color:#1F7A45;}
.where-chip.is-bad {color:var(--danger);}
.where-chip small {color:var(--muted);font-size:.7rem;font-weight:600;}

@media (prefers-reduced-motion: reduce) {
 .where *, .where-task * { animation: none !important; transition: none !important; }
}

.wa {display:block;overflow:visible;pointer-events:none;}
.where-place-art {width:100%;height:auto;aspect-ratio:1;}
.where-place {display:grid;place-items:center;overflow:visible;}
.where-bench {flex:0 0 42%;}
.where-places {align-items:stretch;}
.where {background:radial-gradient(ellipse at 50% 10%,#f8faff,transparent 70%);}
.where-item::before {content:'';position:absolute;bottom:5%;width:60%;height:8%;border-radius:50%;background:#364c7e12;filter:blur(3px);transition:scale .3s,opacity .3s;}
.where-item.is-lifted::before {scale:.7;opacity:.3;}
.where-place.is-working {isolation:isolate;}
.where-fx {position:absolute;inset:0;pointer-events:none;display:grid;place-items:center;z-index:3;}
.where-fx i {position:absolute;width:5px;height:5px;border-radius:2px;background:#6a90ff;animation:where-spark 900ms var(--d) cubic-bezier(.12,.7,.3,1) both;}
@keyframes where-spark {0%{opacity:0;transform:rotate(var(--a)) translateX(4px) scale(.3)}25%{opacity:.9}100%{opacity:0;transform:rotate(var(--a)) translateX(48px) scale(.1)}}
.where.is-listening .where-item {cursor:default;}
.where.is-listening .where-place {opacity:.7;}
.shift-game.is-armed .where-place > .where-place-frame {box-shadow:inset 0 0 0 1.5px #6a90ff80;}
.where-dock {aspect-ratio:1;filter:drop-shadow(0 4px 4px #10141c26);}
@media (prefers-reduced-motion:reduce){.where-fx{display:none}.where *, .where-task *{animation:none!important;transition:none!important;}}

/* Чистое состояние появляется крупно, чтобы результат действия был заметен. */
.where-bench,.where-places {transition:opacity .4s ease;}
.where.is-clean-result .where-bench {opacity:.12;pointer-events:none;}
.where.is-clean-result .where-places {opacity:.22;pointer-events:none;}
.where-clean-result {position:absolute;z-index:4;left:50%;top:50%;width:min(64%,13rem);aspect-ratio:1;translate:-50% -50%;pointer-events:none;filter:drop-shadow(0 .65rem .6rem #334d7926);overflow:hidden;}
.where-clean-result > .where-before,.where-clean-result > .where-after {position:absolute;inset:0;display:block;}
.where-clean-result .wa {width:100%;height:100%;}
/* Results keep their identity; motion belongs to the action. */
.where-action-result {overflow:visible;isolation:isolate;filter:none;}
.where-action-result > .where-before,.where-action-result > .where-after {will-change:opacity;}
/* Add complementary alpha rather than making the object translucent at mid-fade. */
@supports (mix-blend-mode:plus-lighter) {
 .where-action-result > .where-before,.where-action-result > .where-after {mix-blend-mode:plus-lighter;}
}
.where-action-result[data-mode="heat"] {top:55%;}
.where-steam {position:absolute;inset:0;pointer-events:none;}
.where-steam svg {width:100%;height:100%;overflow:visible;}
.where-living-art {display:block;width:100%;height:100%;overflow:visible;}

/* Decorative light stays separate from the registered, undistorted object sprites. */
.where-transition-fx {position:absolute;inset:0;pointer-events:none;overflow:visible;}
.where-transition-glow {position:absolute;inset:-8%;border-radius:50%;opacity:0;z-index:-1;background:radial-gradient(ellipse,#d4e6ff55 12%,#8fbaff55 42%,#b5d9ff22 57%,transparent 72%);}
.where-transition-spark {position:absolute;width:var(--spark-size);height:var(--spark-size);margin:calc(var(--spark-size) / -2);opacity:0;}
.where-transition-spark::before,.where-transition-spark::after {content:"";position:absolute;background:#a6c8ff;border-radius:100%;}
.where-transition-spark::before {left:40%;top:0;width:20%;height:100%;}
.where-transition-spark::after {left:0;top:40%;width:100%;height:20%;}

.where-vapor {position:absolute;display:block;width:25%;height:36%;margin-left:-12.5%;background:radial-gradient(ellipse at 50% 57%,#fff 0%,#edf6fff2 18%,#f4f9ffa0 38%,#c8e0ff40 57%,transparent 73%);will-change:transform,opacity;}
.where.is-loading::after {content:'';position:absolute;z-index:6;left:calc(50% - 13px);top:calc(50% - 13px);width:26px;height:26px;border:3px solid #d9e4ff;border-top-color:#6a90ff;border-radius:50%;animation:where-loading .9s linear infinite;}
.where-load-retry {position:absolute;z-index:6;left:50%;top:50%;transform:translate(-50%,-50%);padding:12px 18px;border:0;border-radius:14px;background:#fff;color:#446fe0;font:inherit;box-shadow:0 4px 20px #334d7926;cursor:pointer;}
@keyframes where-loading {to{transform:rotate(360deg)}}

/* Fixed slots and pointer geometry: only opacity changes as decoded art appears. */
.where.is-loading .where-bench,.where.is-loading .where-places {opacity:0;pointer-events:none;}
.shift-stage.station-where > .where {animation:where-scene-in .28s ease-out backwards;}
.shift-game.is-leaving .station-where > .where {translate:none;}
@keyframes where-scene-in {from{opacity:0}to{opacity:1}}

/* The target frame moves independently; its illustration and hit area stay fixed. */
.where-place-frame {position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:linear-gradient(180deg,#edf2ff,#dfe7ff);box-shadow:inset 0 0 0 1.5px rgba(106,144,255,.28);}
.where-place:focus-visible {outline:none;}
