/* ================================================================
   v175 — 항목 23: 본진 체력·MP·행동력·카드수·턴을
   핸드 카드 바로 위(#allyHqQuickBar)에 더 크고 직관적으로 표시.
   기존 .hq-info-overlay(본진 박스 안의 작은 칩)는 그대로 두고,
   핸드 바로 위에 별도의 확대 표시줄을 추가하는 방식이라
   v173/v174에서 이미 안정화된 본진 박스 레이아웃은 건드리지 않는다.
   game.css 및 이전 모든 패치보다 나중에 로드된다.
   ================================================================ */

.hq-quickbar{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:6px;
  margin:0 0 6px 0;
  padding:6px 8px;
  border-radius:10px;
  background:linear-gradient(180deg,#151b2be6,#0b0f18e6);
  border:1px solid #ffffff26;
  box-shadow:0 2px 10px #000a;
}
.hq-quick-stat{
  flex:1 1 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:0;
}
.hq-quick-icon{font-size:15px;line-height:1;opacity:.9;}
.hq-quick-stat b{
  font-size:16px;
  font-weight:800;
  letter-spacing:.2px;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hq-quick-stat.hp b{color:#ff8a8a;}
.hq-quick-stat.mp b{color:#8ad6ff;}
.hq-quick-stat.ap b{color:#ffe28a;}
.hq-quick-stat.deck b{color:#c9b8ff;}
.hq-quick-stat.turn b{color:#9dffb0;}

@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .hq-quickbar{
    padding:5px 6px;
    margin:0 0 4px 0;
    border-radius:8px;
    gap:3px;
  }
  body.ui-mode-mobile:not(.prebattle) .hq-quick-icon{font-size:13px;}
  body.ui-mode-mobile:not(.prebattle) .hq-quick-stat b{font-size:14px;}
}

/* ================================================================
   v175 — 항목 1: 카드상점 카드 글씨 확대(상단은 이름+등급만, 공방체지매 강조)
   ================================================================ */
.card-shop-grid .collection-card-heading small{display:none!important;} /* 상단엔 이름+등급만 */
.card-shop-grid .collection-card-heading .collection-card-name{font-size:13px!important;font-weight:1000!important;}
.card-shop-grid .collection-card-title em{font-size:12px!important;min-width:24px!important;height:20px!important;}
.card-shop-grid .collection-five-stats{font-size:15px!important;font-weight:950!important;padding:6px 3px!important;}
@media (max-width:850px){
  .card-shop-grid .collection-card-heading .collection-card-name{font-size:11px!important;}
  .card-shop-grid .collection-five-stats{font-size:12px!important;}
}

/* ================================================================
   v175 — 항목 18: 사용 가능 카드 표시를 굵은 테두리 대신
   등급표시(.card-title-grade)와 같은 크기의 "가능" 배지로 변경.
   ================================================================ */
#hand.hand .card.affordable{
  border-color:#f7d77f!important;
  box-shadow:none!important; /* 굵은 강조 테두리 제거 → 일반 테두리 굵기만 유지 */
}
#hand.hand .card.affordable:not(.selected)::after{content:none!important;}
#hand.hand .card-ready-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  height:18px;
  padding:0 5px;
  margin-left:2px;
  border-radius:3px;
  border:1px solid #6fe3a0;
  background:#0d2e1cd9;
  color:#c9ffd9;
  font-size:9px;
  font-weight:950;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 2px #000;
}
@media (max-width:850px){
  #hand.hand .card-ready-badge{min-width:20px;height:14px;font-size:7px;padding:0 3px;}
}

/* ================================================================
   v175 — 항목 10: 카드관리 폼에서 현재 카드 종류와 무관한 입력칸을
   흐리게 비활성화만 하지 않고 아예 숨겨 더 간결하게 정리.
   ================================================================ */
.manager-field.mgr-field-hidden{display:none!important;}

/* 전투 시작 전(준비 화면)에는 본진 요약줄을 숨긴다. */
body.prebattle .hq-quickbar{display:none;}

/* ================================================================
   v175 — 항목 20: 본진 1칸(책사 공간)을 밝은 박스로 표시.
   기존 .hq-advisor-slot(책사 배치칸)에 밝은 강조 배경·테두리를 추가해
   "본진 안의 책사 전용 칸"임을 시각적으로 구분한다.
   ================================================================ */
.battle-hq .hq-advisor-slot{
  background:linear-gradient(180deg,#3a3018e6,#241d0ce6)!important;
  border:1px solid #f3d67f!important;
  box-shadow:0 0 10px #f3d67f4d,inset 0 0 0 1px #ffe9a355!important;
}
.battle-hq .hq-advisor-slot.active{
  background:linear-gradient(180deg,#4a3d1fe6,#2c230ee6)!important;
  box-shadow:0 0 14px #ffe08a66,inset 0 0 0 1px #ffe9a377!important;
}

/* ================================================================
   v175-2 — 카드상점 + 덱편집 공통: 공/방/체·지력/매력·설명·아이콘 확대
   (카드 박스 자체 크기는 그대로 두고 내부 글씨/기호만 키운다)
   ================================================================ */
.card-shop-grid .collection-five-stats,
.deck-builder-visual-card .collection-five-stats{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  font-size:15px!important;
  padding:5px 3px!important;
}
.collection-stat-core{
  font-size:15px!important;
  font-weight:1000!important;
  color:#ffe6ad!important;
  letter-spacing:.02em;
}
.collection-stat-mind{
  font-size:13px!important;
  font-weight:900!important;
  color:#8fe0ff!important; /* 지력·매력은 다른 색(하늘색)으로 구분 */
  letter-spacing:.02em;
}
@media (max-width:850px){
  .card-shop-grid .collection-five-stats,
  .deck-builder-visual-card .collection-five-stats{font-size:12px!important;}
  .collection-stat-core{font-size:12px!important;}
  .collection-stat-mind{font-size:11px!important;}
}

/* 설명(특수능력·텍스트) 글씨 확대. 박스 높이는 기존 제한을 그대로 유지해 카드 크기에는 영향 없음. */
.card-shop-grid .collection-extra,
.deck-builder-visual-card .collection-extra{
  font-size:11px!important;
  line-height:1.3!important;
  font-weight:600!important;
  color:#f0e6d0!important;
}

/* 병력종류(병종/카드유형) 아이콘, 행동력(EN) 아이콘 확대 */
.card-shop-grid .collection-card-icons,
.deck-builder-visual-card .collection-card-icons{
  gap:4px!important;
}
.card-shop-grid .collection-type-icon,
.card-shop-grid .collection-soldier-icon,
.card-shop-grid .collection-en-icon,
.deck-builder-visual-card .collection-type-icon,
.deck-builder-visual-card .collection-soldier-icon,
.deck-builder-visual-card .collection-en-icon{
  font-size:15px!important;
  font-weight:900!important;
  text-shadow:0 1px 3px #000;
}
.collection-soldier-icon{
  padding:0 2px;
}

/* ================================================================
   v178 — 항목 1·2: 본진 진영 카드 표시 오류 수정 + 책사 공간 재배치
   ================================================================ */
/* 본진 병력칸 이름 줄바꿈(세로로 글자가 쌓이는) 버그 방지: 항상 한 줄로, 넘치면 말줄임. */
.hq-field-slot .base-unit-mini,
.hq-field-slot .base-unit-mini b,
.hq-field-slot .base-unit-mini span,
.hq-field-slot .base-unit-name-click{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  writing-mode:horizontal-tb!important;
  min-width:0!important;
}
.hq-field-slot{min-width:0!important;}
.hq-battlefield-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;}

/* 책사 전용 칸(본진 진영의 마지막 칸): 밝은 강조 박스로 표시하고, 옮겨온 책사 배치 요소가
   칸 전체를 채우도록 한다. */
.hq-advisor-field-slot{
  border-style:solid!important;
  border-color:#f3d67f!important;
  background:linear-gradient(180deg,#3a3018e6,#241d0ce6)!important;
  box-shadow:0 0 10px #f3d67f4d,inset 0 0 0 1px #ffe9a355!important;
  padding:0!important;
}
.hq-advisor-field-slot .hq-advisor-slot,
.hq-advisor-field-slot .advisor{
  position:static!important;
  width:100%!important;
  height:100%!important;
  inset:auto!important;
  margin:0!important;
}

/* 항목 2: 핸드 위쪽 본진박스 안의 상태표시(체력·MP·행동력 등 칩)와 책사 배치칸은 더 이상
   여기서 보여주지 않는다(책사 배치는 본진 진영의 마지막 칸으로 이동했고, 상태표시는
   #allyHqQuickBar가 대신한다). */
#allyHq .hq-info-overlay,
#enemyHq .hq-info-overlay,
#allyHq > .hq-advisor-slot,
#enemyHq > .hq-advisor-slot{
  display:none!important;
}

/* ================================================================
   v178 — 항목 5: 핸드 카드 크기를 전투필드 카드 크기와 동일하게.
   syncHandCardSizeToField()가 매 렌더마다 채워주는 --hand-card-width/height를
   모든 반응형 분기(!important 다수)보다 나중에 로드되는 이 파일에서 강제 적용한다.
   ================================================================ */
#hand.hand .card{
  width:var(--hand-card-width,106px)!important;
  min-width:var(--hand-card-width,106px)!important;
  max-width:var(--hand-card-width,106px)!important;
  height:var(--hand-card-height,138px)!important;
  min-height:var(--hand-card-height,138px)!important;
  max-height:var(--hand-card-height,138px)!important;
}
/* 카드 크기가 가변이라 열 수를 고정하지 않고, 실제 카드 폭 기준으로 자동으로 줄바꿈되게 한다.
   → "사이드 공간 폭 조정": 핸드 영역이 카드 실제 크기에 맞춰 넓어지거나 좁아진다. */
#hand.hand{
  display:flex!important;
  flex-wrap:wrap!important;
  grid-template-columns:none!important;
  align-content:flex-start!important;
  justify-content:flex-start!important;
}
.right-hand-section{
  width:auto!important;
  min-width:calc(var(--hand-card-width,106px) * 2 + 30px)!important;
}
@media (max-width:850px){
  .right-hand-section{min-width:0!important;}
}

/* ================================================================
   v179 — 항목4: 아군/적군 3열을 삭제하고 "무점령지" 공유 구역(4칸) 하나로 병합.
   전용 라벨 없이(요청대로 "표시가 없는 구역") 두 진영 사이에 배치한다.
   ================================================================ */
.lane.neutral-lane{
  background:repeating-linear-gradient(135deg,#1c222a 0 10px,#161b21 10px 20px)!important;
  border:1px dashed #6b7688aa!important;
}
.lane.neutral-lane .slots.n4{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
@media (max-width:850px){
  .battlefield-layout .lane.neutral-lane{padding-top:6px!important;}
}

/* ================================================================
   v180 — 무점령지 레인이 아래(아군) 레인과 시각적으로 겹치는 문제 방어 조치.
   정확한 원인을 실제 브라우저로 확인할 수 없어, 겹침이 구조적으로 불가능하도록
   레인 자체를 내용에 맞춰 확실히 감싸고(overflow:hidden), 위아래 여백을 넉넉히
   확보하는 방어적 수정이다.
   ================================================================ */
.battlefield-layout .lane{
  overflow:hidden!important;
  isolation:isolate;
}
.lane.neutral-lane{
  margin:4px 0!important;
  min-height:86px!important;
}
.lane.neutral-lane .slots{
  min-height:78px!important;
}
@media (max-width:850px){
  .battlefield-layout .lane.neutral-lane{min-height:92px!important;margin:5px 0!important;}
  .battlefield-layout .lane.neutral-lane .slots{min-height:84px!important;}
}
