/* v193 — 카드 2.8:4.0 비율 / 핸드 카드 무간격 / 전투진영 6장 폭·하단 밀착 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:84px;
    --v193-card-h:120px; /* 2.8 : 4.0 */
    --v193-field-gap:6px;
    --v193-hand-gap:0px;
    --v193-hand-section-h:286px;
    --v193-formation-w:534px; /* 84px × 6 + 6px × 5 */
    --v193-five-card-w:444px;
    --v193-four-card-w:354px;
    --v193-three-card-w:264px;
    --v193-two-card-w:174px;
    --v193-lane-h:124px; /* 카드 120px + 상단 2px + 상·하단 테두리 */
  }

  /* 핸드: 2.8 x 4.0 비율, 가로·세로 카드 사이 여백 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v193-hand-section-h)!important;
    min-height:var(--v193-hand-section-h)!important;
    max-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    grid-template-rows:repeat(2,var(--v193-card-h))!important;
    grid-auto-rows:var(--v193-card-h)!important;
    column-gap:0!important;
    row-gap:0!important;
    gap:0!important;
    justify-content:center!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:2.8 / 4!important;
  }

  /* 전투 카드도 핸드와 동일한 2.8 x 4.0 비율 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:2.8 / 4!important;
  }

  /* 전투진영 박스: 카드 6장 + 카드 사이 간격 5개가 정확히 들어가는 폭 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    align-items:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
    height:var(--v193-lane-h)!important;
    min-height:var(--v193-lane-h)!important;
    max-height:var(--v193-lane-h)!important;
    flex:0 0 var(--v193-lane-h)!important;
    align-self:center!important;
    padding:2px 0 0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* 카드 하단과 전투진영 박스 하단을 밀착 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    padding:0!important;
    gap:var(--v193-field-gap)!important;
    align-items:stretch!important;
    align-content:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    grid-template-columns:repeat(5,var(--v193-card-w))!important;
    width:var(--v193-five-card-w)!important;
    min-width:var(--v193-five-card-w)!important;
    max-width:var(--v193-five-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    display:grid!important;
    grid-template-columns:repeat(4,var(--v193-card-w))!important;
    width:var(--v193-four-card-w)!important;
    min-width:var(--v193-four-card-w)!important;
    max-width:var(--v193-four-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    width:var(--v193-three-card-w)!important;
    min-width:var(--v193-three-card-w)!important;
    max-width:var(--v193-three-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    display:grid!important;
    grid-template-columns:repeat(2,var(--v193-card-w))!important;
    width:var(--v193-two-card-w)!important;
    min-width:var(--v193-two-card-w)!important;
    max-width:var(--v193-two-card-w)!important;
    margin:0 auto!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:80px;
    --v193-card-h:114.2857px; /* 2.8 : 4.0 */
    --v193-field-gap:5px;
    --v193-hand-section-h:274.5714px;
    --v193-formation-w:505px; /* 80px × 6 + 5px × 5 */
    --v193-five-card-w:420px;
    --v193-four-card-w:335px;
    --v193-three-card-w:250px;
    --v193-two-card-w:165px;
    --v193-lane-h:118.2857px;
  }
}
