/* v364 — card manager 4-column compact form, hand count cleanup, centered stats, live effect sync */

/* 1) 카드관리: 기본 2열 폼을 4열로 압축. full 필드는 전체 폭 유지. */
#cardManagerModal .manager-form{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px 8px!important;
}
#cardManagerModal .manager-field.full,
#cardManagerModal .sss-effect-panel,
#cardManagerModal .manager-name-save-field{
  grid-column:1/-1!important;
}
#cardManagerModal .manager-field.manager-field-wide{
  grid-column:span 2!important;
}
#cardManagerModal .manager-field label{
  font-size:9px!important;
  line-height:1.15!important;
}
#cardManagerModal .manager-field input,
#cardManagerModal .manager-field select{
  min-height:34px!important;
  padding:6px 7px!important;
  font-size:11px!important;
}
#cardManagerModal .manager-field textarea{font-size:11px!important}

/* 좁은 카드관리 창에서도 4열 유지하되 최소 폭만 더 압축 */
@media (max-width:850px){
  #cardManagerModal .manager-form{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
  #cardManagerModal .manager-field input,
  #cardManagerModal .manager-field select{padding:5px 4px!important;font-size:10px!important}
}

/* 2) 핸드 상단의 '카드 n장' 줄은 공간만 차지하므로 숨김. JS용 #handCount는 DOM에 유지. */
.reference-right .formation-card-count,
#leftHandHost .formation-card-count,
.right-hand-section .formation-card-count{
  display:none!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}

/* 카드 영역이 위쪽 빈 줄 없이 바로 시작하도록 정리 */
body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost .handbox,
body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-right .handbox{
  margin-top:0!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #leftHandHost .handhead,
body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-right .handhead{
  min-height:0!important;
}

/* 공/방/체 숫자를 각 칸의 정확한 중앙에 배치 */
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card:not(.utility-card) .cstats{
  display:flex!important;
  align-items:stretch!important;
  justify-content:center!important;
  padding:0!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card:not(.utility-card) .card-stat-grid{
  height:100%!important;
  min-height:100%!important;
  align-items:stretch!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card:not(.utility-card) .card-stat-cell{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  height:100%!important;
  min-height:0!important;
  padding:0 1px!important;
  line-height:1!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card:not(.utility-card) .card-stat-cell::before{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  margin:0!important;
  position:static!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card:not(.utility-card) .card-stat-cell b{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:center!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
  transform:none!important;
  vertical-align:middle!important;
}

/* 3) 본진 상태 위 실전 카드 연출창: 미리보기와 동일한 FX 레이어를 표시 */
.left-card-effect-stage{
  position:relative!important;
  overflow:hidden!important;
  isolation:isolate!important;
}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:hidden!important;
  z-index:2!important;
}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene .scene-entry-motion{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  overflow:hidden!important;
  z-index:1!important;
}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene .scene-entry-motion>img{
  display:block!important;
  visibility:visible!important;
  opacity:1;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene:not(.fx-none) .scene-shade,
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene:not(.fx-none) .scene-energy,
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene:not(.fx-none) .scene-particles{
  display:block!important;
  visibility:visible!important;
}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene .scene-shade{z-index:2!important}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene .scene-energy{z-index:3!important}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene .scene-particles{z-index:4!important}
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene.fx-none .scene-shade,
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene.fx-none .scene-energy,
.left-card-effect-stage .hq-card-scene.v364-live-effect-scene.fx-none .scene-particles{display:none!important}

/* v363의 범용 강제 애니메이션 대신 원래 미리보기 FX 애니메이션을 그대로 복원 */
.left-card-effect-stage .v364-live-effect-scene.fx-beam .scene-energy{animation:v205BeamColumn 1.35s cubic-bezier(.12,.76,.2,1) forwards!important;transform-origin:50% 100%!important}
.left-card-effect-stage .v364-live-effect-scene.fx-flare .scene-energy{animation:v205FlareBurst 1.1s ease-out forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-lightning .scene-energy{animation:v205LightningFlash 1.05s steps(2,end) forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-fire .scene-energy{animation:v205FireLift 1.45s ease-out forwards!important;transform-origin:50% 100%!important}
.left-card-effect-stage .v364-live-effect-scene.fx-ice .scene-energy{animation:v205FreezeSpread 1.45s ease-out forwards!important;transform-origin:50% 50%!important}
.left-card-effect-stage .v364-live-effect-scene.fx-smoke .scene-energy{animation:v205SmokeDrift 1.7s ease-out forwards!important;filter:blur(5px)}
.left-card-effect-stage .v364-live-effect-scene.fx-petals .scene-energy{animation:v205PetalBreeze 1.55s ease-in-out forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-shadow .scene-energy{animation:v205ShadowVortex 1.55s cubic-bezier(.3,.05,.2,1) forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-holy .scene-energy{animation:v205HolyDescend 1.45s ease-out forwards!important;transform-origin:50% 0!important}
.left-card-effect-stage .v364-live-effect-scene.fx-shock .scene-energy{animation:v205ShockImpact 1.05s cubic-bezier(.16,.7,.2,1) forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-runes .scene-energy{animation:v205RuneSpin 1.65s linear forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-blood .scene-energy{animation:v205BloodPulse 1.45s ease-out forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-warcry .scene-energy{animation:v205WarcryWave 1.25s ease-out forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-dragon .scene-energy{animation:v205DragonCoil 1.7s cubic-bezier(.18,.72,.22,1) forwards!important}
.left-card-effect-stage .v364-live-effect-scene.fx-ascend .scene-energy{animation:v205AscendLift 1.65s ease-out forwards!important;transform-origin:50% 100%!important}
.left-card-effect-stage .v364-live-effect-scene.fx-requiem .scene-energy{animation:v205RequiemCollapse 1.75s cubic-bezier(.34,.02,.18,1) forwards!important}

/* 미리보기에서 쓰는 동일한 등장 방식 복구 */
.left-card-effect-stage .v364-live-effect-scene.entry-steady:not(.holding):not(.leaving) .scene-entry-motion{animation:v224EntrySteady .85s ease-out both!important}
.left-card-effect-stage .v364-live-effect-scene.entry-impact:not(.holding):not(.leaving) .scene-entry-motion{animation:v224EntryImpact .78s cubic-bezier(.2,.72,.24,1) both!important}
.left-card-effect-stage .v364-live-effect-scene.entry-unfold:not(.holding):not(.leaving) .scene-entry-motion{animation:v224EntryUnfold .92s cubic-bezier(.2,.76,.2,1) both!important}
.left-card-effect-stage .v364-live-effect-scene.entry-suck:not(.holding):not(.leaving) .scene-entry-motion{animation:v224EntrySuck 1s cubic-bezier(.14,.72,.18,1) both!important}
.left-card-effect-stage .v364-live-effect-scene.entry-emerge:not(.holding):not(.leaving) .scene-entry-motion{animation:v224EntryEmerge .95s cubic-bezier(.18,.78,.2,1) both!important}
