/* v362 — latest update only: hand -3%, left card scene effects/entry restore, card-manager controls 4 columns */

/* 1) PC hand area: additional 3% reduction from v361. Mobile/mobile-preview unchanged. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost .right-hand-section{
    height:393.94125px!important;
    min-height:393.94125px!important;
    max-height:393.94125px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost .handbox{
    height:350.765289px!important;
    min-height:350.765289px!important;
    max-height:350.765289px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost #hand.hand{
    grid-template-rows:repeat(2,174.9729456px)!important;
    grid-auto-rows:174.9729456px!important;
    height:350.7337737px!important;
    min-height:350.7337737px!important;
    max-height:350.7337737px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost #hand.hand .card{
    height:174.9729456px!important;
    min-height:174.9729456px!important;
    max-height:174.9729456px!important;
    grid-template-rows:19.25935px minmax(0,1fr) 25.387325px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost #hand.hand .card.utility-card{
    grid-template-rows:19.25935px minmax(0,1fr) 33.26615px!important;
  }
}

/* 2) HQ status box upper card-action window: restore both entry motion and configured FX. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage>.hq-card-scene.left-effect-preview-scene{
    isolation:isolate!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{
    display:block!important;
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    overflow:hidden!important;
    transform-origin:center!important;
    will-change:transform,opacity,filter,clip-path!important;
    z-index:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion>img{
    display:block!important;
    animation:inherit;
  }

  /* v232/runtime had transform/filter/clip-path locked to none. Re-apply entry animations here. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.entry-steady:not(.holding):not(.leaving) .scene-entry-motion{
    animation:v362EntrySteady .85s ease-out both!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.entry-impact:not(.holding):not(.leaving) .scene-entry-motion{
    animation:v362EntryImpact .78s cubic-bezier(.2,.72,.24,1) both!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.entry-unfold:not(.holding):not(.leaving) .scene-entry-motion{
    animation:v362EntryUnfold .92s cubic-bezier(.2,.76,.2,1) both!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.entry-suck:not(.holding):not(.leaving) .scene-entry-motion{
    animation:v362EntrySuck 1s cubic-bezier(.14,.72,.18,1) both!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.entry-emerge:not(.holding):not(.leaving) .scene-entry-motion{
    animation:v362EntryEmerge .95s cubic-bezier(.18,.78,.2,1) both!important;
  }

  /* Effect layers are real content of the left action window, not decorative placeholders. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-shade,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-energy,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-particles{
    display:block!important;
    visibility:visible!important;
    pointer-events:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-shade{z-index:2!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-energy{z-index:3!important;opacity:.96!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) .scene-particles{z-index:4!important;opacity:1!important;overflow:hidden!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none):not(.fx-fire) .scene-particles i{
    display:block!important;
    visibility:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-fire .scene-particles{display:none!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none .scene-shade,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none .scene-energy,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none .scene-particles{display:none!important}
}

@keyframes v362EntrySteady{
  0%{opacity:0;filter:brightness(.75) blur(2px);transform:translate3d(0,8px,0)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0)}
}
@keyframes v362EntryImpact{
  0%{opacity:0;filter:brightness(.65);transform:translate3d(0,0,0)}
  22%{opacity:1;filter:brightness(1.35);transform:translate3d(-8px,1px,0) rotate(-.7deg)}
  37%{transform:translate3d(7px,-1px,0) rotate(.6deg)}
  52%{transform:translate3d(-5px,0,0) rotate(-.4deg)}
  68%{transform:translate3d(3px,0,0) rotate(.2deg)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0) rotate(0)}
}
@keyframes v362EntryUnfold{
  0%{opacity:.15;clip-path:inset(0 49% 0 49%);filter:brightness(1.7) blur(2px);transform:none}
  55%{opacity:1;clip-path:inset(0 8% 0 8%);filter:brightness(1.15);transform:none}
  100%{opacity:1;clip-path:inset(0 0 0 0);filter:none;transform:none}
}
@keyframes v362EntrySuck{
  0%{opacity:0;filter:blur(18px) brightness(2.2);transform:translate3d(34px,-20px,0) skewX(-8deg)}
  38%{opacity:.8;filter:blur(7px) brightness(1.55);transform:translate3d(-10px,7px,0) skewX(3deg)}
  68%{opacity:1;filter:blur(2px) brightness(1.18);transform:translate3d(3px,-2px,0) skewX(0)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0)}
}
@keyframes v362EntryEmerge{
  0%{opacity:0;clip-path:circle(0 at 50% 50%);filter:brightness(2) blur(4px);transform:none}
  52%{opacity:1;clip-path:circle(48% at 50% 50%);filter:brightness(1.25) blur(1px);transform:none}
  100%{opacity:1;clip-path:circle(75% at 50% 50%);filter:none;transform:none}
}

/* 3) Card manager preview controls: compact 4 controls per row even on narrow manager layouts. */
#cardManagerModal .manager-preview-quick-controls{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:4px!important;
  width:100%!important;
  margin:5px 0!important;
}
#cardManagerModal .manager-preview-quick-controls>.btn,
#cardManagerModal .manager-preview-quick-controls>.manager-direct-image-drop-zone,
#cardManagerModal .manager-preview-quick-controls>.manager-scene-lock{
  width:100%!important;
  min-width:0!important;
  min-height:28px!important;
  height:28px!important;
  padding:2px 3px!important;
  font-size:8.5px!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  box-sizing:border-box!important;
}
@media(max-width:760px){
  #cardManagerModal .manager-preview-quick-controls{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
