/* =====================================================================
   mobile.css — CG5 모바일(≤759px) 전담. 마지막에 로드해서 앞선 파일의 모바일 분기를 정리·덮어써요.
   (데스크톱 규칙은 건드리지 않아요. 분기점은 앱 전체가 쓰는 759/760 을 그대로 따라요.)
   규격: 좌우 gutter 16 · 간격 4/8/12/16/24/32/48 · 글자 14/16/20/28 · 터치 44 · 로고 쌍 가로 28
   ===================================================================== */
@media (max-width:759px){

/* ---- 1. 헤더: 1줄 [이적썰 ····· 돋보기 · 내 팀 · 테마] / 2줄 종목 탭 3등분. 총 96(티커 제외), 고정 안 함 ---- */
.mast{position:static;border-bottom:0;box-shadow:0 1px 0 var(--line)}
.mast-in{padding:var(--s1) var(--s2) 0;row-gap:0;column-gap:var(--s1);--g:var(--s1)}
.mast-in>.sports{height:var(--h-touch);margin:0}

/* 로고 쌍은 어디서나 가로(세로 분기 폐지): 28 + → 12 + 28, 간격 4 */
.pair{flex-direction:row;align-items:center;gap:4px}
.pair .logo-mark,.pair .code{width:28px;height:28px}
.pair .pa{transform:none;font-size:var(--fs-s)}

/* ---- 2. 피드 행: 로고 쌍 가로(28 + → 12 + 28 = 76) · 이름 · 요약 · (계약 조건) · 메타 ---- */
.wire{--pc:clamp(28px,1.75rem,32px);--pw:calc(var(--pc) * 2 + 20px)}
.wire:not(.rank){grid-template-columns:calc(var(--pw) + 8px) minmax(0,1fr) auto auto auto;column-gap:0;row-gap:0;align-items:start;padding:var(--s2) var(--s2) var(--s1)}
.wire:not(.rank) .w-tile{grid-column:1;grid-row:1;align-self:center;margin:0;height:var(--pc)}
.wire .pair,.wire.rank .pair,.wire:not(.rank) .pair{flex-direction:row;align-items:center;gap:4px;width:var(--pw)}
.wire .pair .logo-mark,.wire .pair .code{width:var(--pc);height:var(--pc)}
.wire .pair .pa{display:block;width:12px;font-size:var(--fs-s);line-height:1;text-align:center;transform:none}
.wire .pair .pc{width:var(--pc);height:var(--pc)}
.wire .pair .pc::before{content:"";position:absolute;inset:-8px}
.w-name::before{content:"";position:absolute;inset:-.375rem -.3125rem}
.wire:not(.rank) .w-top{grid-column:2/5;grid-row:1;min-height:2rem;align-items:center}
.wire:not(.rank) .w-text{grid-column:2/-1;grid-row:2;white-space:normal;overflow:visible;line-height:1.5}
.wire:not(.rank) .w-hl{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.wire:not(.rank) .w-dt.w-fx{display:block;margin:0;font-size:var(--fs-s);line-height:1.5;color:var(--ink-2)}
.wire:not(.rank) .w-src{grid-column:2;grid-row:3;min-width:0;justify-content:flex-start;align-self:center;gap:.25rem}
.wire:not(.rank) .w-tw{grid-column:3/-1;grid-row:3;align-self:center;margin-left:var(--s1)}
.wire:not(.rank) .w-stage .pill{grid-column:1;grid-row:2/4;align-self:start;justify-self:start;margin:.25rem 0 0}
.wire:not(.rank) .w-stage .w-unconf{display:none}
.wire:not(.rank) .bellbtn{grid-column:5;grid-row:1;align-self:center;justify-self:end;margin:-.375rem calc(var(--s1) * -1) -.375rem 0}   /* 종 단추는 이름 줄로: 셋째 줄은 출처 이름·등급·날짜에 */
.wire:not(.rank) .rep{margin:-.375rem 0;max-width:100%}

.wire.rank{grid-template-columns:24px calc(var(--pw) + 8px) minmax(0,1fr) auto;column-gap:0;padding:var(--s2) var(--s2) var(--s1)}
.wire.rank .w-tile{align-self:start;height:var(--pc)}
.wire.rank .w-text{white-space:normal;overflow:visible;line-height:1.5}
.wire.rank .w-hl{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.wire.rank .w-dt.w-fx{display:block;margin:0;font-size:var(--fs-s);line-height:1.5;color:var(--ink-2)}
.wire.rank .w-rank{align-self:start;padding-top:0;line-height:var(--pc)}

/* 선수 이적 히스토리 행(.hr): 쌍 가로 76 */
.hr{grid-template-columns:76px minmax(0,1fr) auto;column-gap:var(--s1);align-items:start}
.hr-pair{height:28px;align-items:center}

/* ---- 2b. 오피셜 인라인 모듈: 쌍 가로 76 · 행 56 · 카드 안쪽 16(피드 행과 같은 왼쪽선) · 전체 보기 44 ---- */
.of-inl .hm-card{padding:var(--s1) var(--s2)}
.of-inl .of-r{min-height:56px;grid-template-columns:76px minmax(0,1fr) auto;column-gap:var(--s1)}
.of-inl .of-l .logo-mark,.of-inl .of-l .code,.of-inl .pair .logo-mark,.of-inl .pair .code{width:28px;height:28px}
.of-inl .of-more{display:flex;align-items:center;min-height:var(--h-touch);margin:0;padding:0}

/* ---- 2c. 카드 안쪽 16 통일 · 모아보기 탭/더 보기 히트 44 · 팀 필터 첫 크레스트가 칩과 같은 왼쪽선(32) ---- */
.hm-card:not(.hm-car-card),.hm-pick-card{padding:var(--s2)}
.ms-tabs{flex-wrap:wrap;height:auto;min-height:var(--h-touch);column-gap:var(--s2)}   /* 큰 글꼴: `더 보기 ›` 가 다음 줄 오른쪽으로 내려가요(가로 넘침 방지) */
.ms-tab,.ms-more{position:relative}
.ms-tab::before{content:"";position:absolute;inset:0 -11px}
.ms-more::before{content:"";position:absolute;inset:-4px -8px}
.tf[data-all] .tf-grid:not(.x),.tf-grid{padding-left:0;scroll-padding-left:0}
.tf:not([data-expanded]) .tf-grid{grid-auto-columns:72px}
.tf[data-expanded] .tf-grid{padding:0}

/* ---- 2d. 검색 시트(전체 높이): 좌우 16 · 상단 safe-area · 키보드(--vvh)에 맞춤 ---- */
.sr-r{padding:.25rem 0}
.sr-sheet{--dp:var(--s2);padding-top:env(safe-area-inset-top,0px);height:var(--vvh,100dvh);max-height:var(--vvh,100dvh)}

/* 쪽 이동 아래 간격: 위 32 · 아래 48(푸터 위 여백 + 페이지 하단 여백이 겹쳐 80 이던 것) */
footer{margin-top:var(--s2)}

/* ---- 2e. 터치 44 · 간격 스케일 보정(컨트롤 가로 안쪽 20 → 16 · 시트 본문 하단 96 → 48 · 쪽 번호 44) ---- */
:root{--ctl-px:var(--s2)}
.dt-body{padding-bottom:var(--s5)}
.dr-m .rep-link::before{inset:-.75rem -1rem}
.dr-a::before{inset:-.75rem -.5rem}
.ro-src a{position:relative}
.ro-src a::before{content:"";position:absolute;inset:-.75rem -.5rem}
.pg-b,.pg-n{width:max(44px,2.25rem);min-width:44px}
.pg-gap{width:max(24px,1.25rem)}

/* ---- 3. 맨 위: 우하단 고정(우 16 · 하 24), 시트·모달 아래, 스크롤 뒤에만 ---- */
.to-top{left:auto;right:var(--s2);bottom:var(--s3);transform:none;z-index:30;min-height:var(--ctl-h);min-width:var(--ctl-h);padding:0 var(--s2)}
.to-top:not(.show){display:none}
body:has(#toast:not(:empty)) .to-top,body:has(.rest-note) .to-top{bottom:calc(var(--s3) + var(--h-touch) + var(--s1))}   /* 토스트·안내 띠가 떠 있으면 그 위로 */
.rest-note{left:var(--s2);right:var(--s2);bottom:var(--s3);max-width:none}
}

/* =====================================================================
   2026-12-06 한국어판·일본어판 UI 감사 반영(KO-xx / JA C·H·M 번호는 감사 보고서). 마지막에 읽혀서 앞의 규칙을 덮어써요
   ===================================================================== */
/* 헤더: 모바일은 스크롤하면 로고 줄만 올라가고 종목 탭 줄은 위에 붙어 있어요(KO-06). --mast-top 은 js/app.js 가 로고 줄 높이로 채워요 */
@media (max-width:759px){
  .mast{position:sticky;top:calc(-1 * var(--mast-top,3.25rem));z-index:20;background:var(--bg)}
}
@media (max-width:359px){   /* JA C02: 320 에서 테마 단추만 둘째 줄로 떨어지던 것 */
  .mast-in{column-gap:.25rem}
  .mast-in>.logo{font-size:1.125rem}
  .mast-in .tbtn.ib{min-width:40px;width:40px;padding:0;justify-content:center}
  #myBtn{padding:0 .25rem;min-width:0;font-size:.8125rem}
}
@media (min-width:760px) and (max-width:1023px){   /* JA C01: 태블릿 헤더 두 줄 → 한 줄(내 팀 단추는 짧은 문구, 로고 한 단계 작게, 탭 간격 20) */
  .mast-in{flex-wrap:nowrap;column-gap:var(--s2)}
  .mast-in>.logo{font-size:1.375rem}
  .mast-in>.sports{flex:none;gap:1.125rem}
  .mast-in .lede{display:none}
  #myBtn .mk-f{display:none}
  #myBtn .mk-s{display:inline}
}

/* 홈 모듈 행: 이름이 먼저, 배지·날짜는 자리 없으면 다음 줄로(KO-03, JA C07) */
.hx-h{flex-wrap:wrap;row-gap:2px;column-gap:.375rem}
.hx-h>b:first-child{flex:0 1 auto;max-width:100%;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.35}
.hx-h .hx-d{margin-left:auto}
.hx-s.fee{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
/* 모듈 머리: 제목과 '더 보기'가 겹치지 않게(JA H12) */
.hx-head{flex-wrap:wrap;row-gap:0}
.hx-head h2{flex:0 1 auto;min-width:0;text-wrap:balance}
.hx-head .hx-more{margin-left:auto}

/* 엠블럼 없는 구단 글자 타일: 원 밖으로 넘치거나 두 줄로 쪼개지지 않게(KO-11, JA H01) */
.pair .code,.hx-row .pair .code,.of-l .code,.logo-mark .lm-code{font-size:clamp(.5rem,30cqw,.8125rem);letter-spacing:-.02em;white-space:nowrap;overflow:hidden}

/* 출처 이름이 먼저 잘리지 않게(KO-14, JA H08) */
.rep b{max-width:14em}
@media (max-width:759px){.wire:not(.rank) .rep{max-width:none}}

/* 엠블럼 하나짜리 행: 칸 가운데에(KO-08 · JA M04 — 이름 열은 다른 행과 같은 선을 지켜요) */
.wire .w-tile .pair:has(>.pc:only-of-type),.wire .w-tile .pair.rn1{justify-content:center}

/* 모바일 카드 아래쪽 여백(KO-36) */
@media (max-width:759px){.wire:not(.rank){padding-bottom:.75rem}}

/* 상세 머리(모바일): 로고 쌍은 이름 위 작은 줄로, 이름이 온 폭을 써요(KO-05, JA C08) */
@media (max-width:759px){
  .dx-h .dx-who{grid-template-columns:minmax(0,1fr) auto;row-gap:var(--s1)}
  .dx-h .dx-pair{grid-column:1;grid-row:1;min-height:2rem}
  .dx-h .dx-pair .logo-mark,.dx-h .dx-pair .code,.dx-h .dx-pair>.logo-mark,.dx-h .dx-pair>.code{width:2rem;height:2rem}
  .dx-h .dx-x{grid-column:2;grid-row:1}
  .dx-h .dx-nm{grid-column:1/-1;grid-row:2;padding-top:0}
  .dx-h .dx-nm h2{text-wrap:balance}
  .dx-h .dx-nm .dx-en{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* 히어로: 1024 에서 금액이 두 줄로 꺾이고 줄 간격이 겹치던 것(KO-07, JA M09) */
.hx-hero em,.hx-hero strong.big{line-height:1.22;text-wrap:balance}
@media (min-width:760px) and (max-width:1180px){.hx-hero em,.hx-hero strong.big{font-size:var(--fs-xl)}}

/* 단계 막대 칸 글자가 '메디/컬'·'公式発/表'로 꺾이지 않게(JA H05) */
.strip li{white-space:nowrap;letter-spacing:-.02em}
@media (max-width:430px){.strip li{font-size:.75rem;padding:.25rem 0}}

/* 푸터: 태블릿 5열 → 3열, 링크 글자 한 줄(KO-25, JA H09) */
@media (min-width:760px) and (max-width:1023px){.sf-in{grid-template-columns:repeat(3,minmax(0,1fr))}.sf-in>.sf-brand,.sf-in>:first-child{grid-column:1/-1}}
.sf-col a,.sf-col button{text-wrap:balance}

/* 터치 영역 44(KO-22, JA H10): 겉모습은 그대로, 누르는 영역만 넓혀요 */
.tier{position:relative}
@media (pointer:coarse){.tier::after{content:"";position:absolute;inset:-12px -4px}}
.hx-outs button{min-height:2.75rem}

/* 팀 고르기: 이름이 음절 중간에서 꺾이지 않게, 저장 단추가 잘리지 않게, 종목 줄은 옆으로 넘겨요(KO-16, JA C09) */
.tm-pop .team .tn{overflow-wrap:normal}
.team-grid{grid-template-columns:repeat(auto-fill,minmax(min(9.25rem,46%),1fr))}
@media (max-width:759px){
  .tm-pop .team-grid{grid-template-columns:repeat(auto-fill,minmax(5.5rem,1fr))}
  .tm-seg{flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none}
  .tm-seg::-webkit-scrollbar{display:none}
  .tm-seg button{flex:none;min-width:44px;padding:0 .75rem}
  .modal-f .btn{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* 다크 모드 선수 찾기 입력(KO-21) */
html[data-theme="dark"] .hx-find input,html[data-theme="dark"] .hx-finder .hx-find input{background:rgba(255,255,255,.12);color:#fff;color-scheme:dark}
html[data-theme="dark"] .hx-finder .hx-find input::placeholder{color:rgba(255,255,255,.62)}

/* 제목류 줄바꿈 균형(KO-28 · JA M01) */
.fh-page h1,.dp-head h1,.dp-head h2,.hx-feedh{text-wrap:balance}
/* 2026-12-06 감사: 출처 줄 — 도메인이 하이픈에서 두 줄로 꺾이지 않게(길면 말줄임), 기자 이름은 다음 줄로 */
.dx-src-o{flex-wrap:wrap;row-gap:2px}.dx-src-o b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:100%}

@media (max-width:359px){.hx-card>.hx-head{height:auto;min-height:2.75rem;flex-wrap:wrap;padding-top:.375rem;padding-bottom:.375rem}}   /* 320: 스와이프 카드 머리가 고정 높이라 제목이 잘리던 것 */
@media (max-width:359px){.hx-hero-p .logo-mark,.hx-hero-p .code{width:2.5rem;height:2.5rem}.hx-hero-nav{gap:.25rem}.hx-hero-nav button{width:2.25rem;height:2.25rem}}   /* 320: 히어로 ‹ 단추가 도착 구단 문장을 가리던 것 */

/* 2026-12-06 대만판 감사 M10: 팀 고르기 종목 탭이 5개(일본어판·대만판)면 320 폭에서 마지막 탭이 화면 밖 → 휴대폰에선 같은 폭으로 나눠 한 줄에 */
@media (max-width:759px){.modal .tm-seg{gap:0;overflow:visible}.modal .tm-seg button{flex:1 1 0;min-width:0;padding:0 .25rem;white-space:nowrap}}
@media (max-width:359px){   /* 2026-12-06 모바일 재감사: 320 에서 출처 이름이 한두 글자(「N…」)만 보이던 것 — 출처는 한 줄을 다 쓰고 등급·날짜는 아래 줄로 */
  .wire:not(.rank) .w-src{grid-column:2/-1}
  .wire:not(.rank) .w-tw{grid-column:2/-1;grid-row:4;margin-left:0;justify-content:flex-start}
}
@media (max-width:759px){   /* 2026-12-06 모바일 재감사: 높이 20px 인 신뢰도 칩 — 모양은 그대로 두고 누르는 영역만 44px 로 */
  .wire .w-tw .tier{position:relative}
  .wire .w-tw .tier::after{content:"";position:absolute;inset:-12px -4px}
}
@media (max-width:359px){.wire:not(.rank) .w-hl{-webkit-line-clamp:3}}   /* 320: 글자 칸이 172px 라 두 줄이면 제목 끝이 잘리던 것 */
