/* ==========================================================================
   스카이 스포츠 국가 · 리그 칸 — EXIT (2026-11-17) · js/exit/exit-league-nav.js
   레드 「오늘 한 것 스카이에도 적용」 · 「스카이는 왼쪽 메뉴가 없는데」 → 「해봐」.
   · PC(1024px 이상): 목록 왼쪽 240px 칸, 화면을 내려도 따라 붙는다(sticky)
   · 휴대폰 · 태블릿: 「국가 · 리그」 단추 → 왼쪽에서 밀려 나오는 서랍
   · 색은 스카이 테마 토큰만(--surface · --line · --accent …) — 40개 테마를 따라간다
   ========================================================================== */
.ksn-wrap{ display:grid; grid-template-columns:240px minmax(0, 1fr); gap:20px; align-items:start; }   /* 위 간격은 .sb-page 가 이미 준다(margin 을 더 주면 배너 아래가 혼자 넓었다) */
/* 오른쪽 칸도 스카이 .sb-page 와 같은 14px 간격 — 탭 · 종목 칩을 이 칸으로 옮기자 줄 사이가 0 으로 붙었다(레드 「여기간격 왜이래」) */
.ksn-main{ min-width:0; display:flex; flex-direction:column; gap:var(--ksn-gap, 14px); }
.ksn-main > :first-child{ margin-top:0; }
/* EXIT (2026-11-18) 왼쪽 칸 240px 이 들어오면 1024~1100 폭(스크롤바 있는 창)에서 본문이 633px 까지 준다.
   .sb-row 가운데 칸 최소 600px(sports.css)이 그대로면 「+N」 단추가 화면 밖으로 14px 나갔다(헤스티아 11-18).
   이 칸 안에서만 최소 폭을 풀어 준다 — 배당 단추 글자 잘림 0 확인 · 칸이 없는 화면은 그대로 */
.ksn-main .sb-row{ grid-template-columns:minmax(120px,1fr) minmax(0,660px) 60px; }
/* EXIT (2026-11-17) 칸 안쪽 스크롤 막대를 가늘게 — 굵은 회색 막대가 칸 오른쪽에 붙어 보였다 */
.ksn{ scrollbar-width:thin; scrollbar-color:rgb(var(--fg-rgb, 255 255 255) / .18) transparent; }
.ksn::-webkit-scrollbar{ width:4px; }
.ksn::-webkit-scrollbar-thumb{ border-radius:4px; background:rgb(var(--fg-rgb, 255 255 255) / .18); }
.ksn{ position:sticky; top:calc(var(--header-h, 64px) + 12px); max-height:calc(100vh - var(--header-h, 64px) - 24px); overflow:auto; scrollbar-width:thin;
  padding:12px; border-radius:var(--r-lg, 6px); background:var(--surface); border:1px solid var(--line); }
.ksn[hidden]{ display:none; }
.ksn-wrap:has(.ksn[hidden]){ grid-template-columns:minmax(0, 1fr); }
.ksn-open, .ksn-sheet__head, .ksn-back{ display:none; }

/* 검색 */
.ksn-search{ display:flex; align-items:center; gap:8px; height:36px; padding:0 10px; margin-bottom:10px; border-radius:var(--r, 4px);
  background:var(--bg-deep, var(--bg)); border:1px solid var(--line); color:var(--text-mute); transition:border-color .15s; }
.ksn-search:focus-within{ border-color:var(--accent-line, var(--accent)); }
.ksn-search input{ flex:1; min-width:0; height:100%; background:none; border:0; outline:0; color:var(--text); font:inherit; font-size:13px; }
.ksn-search input::placeholder{ color:var(--text-mute); }

/* 묶음 */
.ksn-sec{ display:flex; flex-direction:column; gap:2px; }
.ksn-sec + .ksn-sec{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.ksn-sec__t{ display:flex; align-items:center; gap:6px; margin:0 2px 6px; font-size:12px; font-weight:800; color:var(--text-sub); letter-spacing:.02em; }
.ksn-sec__t svg{ color:var(--accent-fg); flex:none; }
.ksn-sec__t .ksn-cnt{ margin-left:auto; }
.ksn-sec__t.is-hot svg{ color:#FF8A1F; }        /* 레드 「인기리그 아이콘 … 주황색」 — React 와 같다 */
.ksn-empty{ margin:4px 2px; font-size:12px; color:var(--text-mute); }

/* 경기 수 */
.ksn-cnt{ flex:none; box-sizing:border-box; min-width:22px; height:18px; padding:0 6px; border-radius:99px;
  display:inline-flex; align-items:center; justify-content:center; line-height:18px;
  background:rgb(var(--fg-rgb, 255 255 255) / .08); color:var(--text-sub); font-size:10.5px; font-weight:800; font-variant-numeric:tabular-nums; }

/* 나라 */
.ksn-area{ border-radius:var(--r, 4px); }
.ksn-area.is-open{ background:rgb(var(--fg-rgb, 255 255 255) / .03); }
.ksn-area__head{ display:flex; align-items:center; gap:9px; width:100%; height:36px; padding:0 8px; border:0; background:none; border-radius:var(--r, 4px);
  color:var(--text-sub); font:inherit; font-size:13px; font-weight:700; text-align:left; cursor:pointer; transition:color .15s, background .15s; }
.ksn-area__head:hover{ color:var(--text); background:rgb(var(--fg-rgb, 255 255 255) / .06); }
.ksn-area.is-open > .ksn-area__head{ color:var(--text); }
.ksn-area__name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ksn-caret{ display:grid; color:var(--text-mute); transition:transform .2s; }
.ksn-area.is-open .ksn-caret{ transform:rotate(180deg); color:var(--accent-fg); }
.ksn-area__list{ padding:0 0 6px; }

/* 국기 */
.ksn-flag{ flex:none; width:22px; height:16px; border-radius:3px; overflow:hidden; display:grid; place-items:center;
  background:var(--surface-2, var(--line)); box-shadow:0 0 0 1px rgb(var(--fg-rgb, 255 255 255) / .12); font-style:normal; }
.ksn .ksn-flag img{ width:22px !important; height:16px !important; max-width:none; object-fit:cover; display:block; }
.ksn-flag.is-sm{ width:18px; height:13px; border-radius:2px; }
.ksn .ksn-flag.is-sm img{ width:18px !important; height:13px !important; }
.ksn-flag.is-intl{ background:none; box-shadow:none; color:var(--accent-fg); }
.ksn-flag.is-code{ font-size:8px; font-weight:900; line-height:1; color:var(--text); }

/* 리그 줄 */
.ksn-lg{ position:relative; display:flex; align-items:center; border-radius:var(--r, 4px); transition:background .15s; }
.ksn-area .ksn-lg{ margin-left:16px; }
.ksn-area .ksn-lg::before{ content:''; position:absolute; left:-7px; top:6px; bottom:6px; width:2px; border-radius:2px; background:var(--line); }
.ksn-lg:hover{ background:rgb(var(--fg-rgb, 255 255 255) / .06); }
.ksn-lg__link{ flex:1; min-width:0; display:flex; align-items:center; gap:8px; height:32px; padding:0 4px 0 8px; color:var(--text-sub); font-size:12.5px; font-weight:600; text-decoration:none; }
.ksn-lg:hover .ksn-lg__link{ color:var(--text); }
.ksn-lg__sp{ flex:none; width:14px; height:14px; object-fit:contain; opacity:.75; }
.ksn-lg__name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ksn-lg.is-on{ background:var(--accent-soft, rgb(var(--fg-rgb, 255 255 255) / .08)); }
.ksn-lg.is-on::before{ background:var(--accent); }
.ksn-lg.is-on .ksn-lg__link{ color:var(--text); font-weight:800; }
.ksn-lg.is-on .ksn-cnt{ background:var(--accent); color:var(--accent-ink); }
.ksn-lg__fav{ flex:none; width:26px; height:26px; margin-right:2px; border:0; background:none; border-radius:var(--r, 4px); display:grid; place-items:center;
  color:var(--text-sub); opacity:.75; cursor:pointer;   /* EXIT (2026-11-17) 휴대폰엔 마우스 올림이 없어 흐리면 별이 안 보였다 — 늘 또렷하게 */ transition:opacity .15s, color .15s, transform .15s; }
.ksn-lg:hover .ksn-lg__fav, .ksn-lg__fav:focus-visible{ opacity:1; }
.ksn-lg__fav:hover{ color:var(--text); transform:scale(1.12); }
.ksn-lg__fav.is-on{ opacity:1; color:var(--accent-fg); }
.ksn-lg__fav.is-on svg{ fill:currentColor; }

/* 인기 리그 더보기 */
.ksn-more{ display:flex; align-items:center; justify-content:center; gap:4px; width:100%; height:30px; margin-top:4px; cursor:pointer;
  border-radius:var(--r, 4px); border:1px dashed var(--line-strong, var(--line)); background:none; color:var(--text-sub); font:inherit; font-size:12px; font-weight:700;
  transition:color .15s, border-color .15s; }
.ksn-more:hover{ color:var(--text); border-color:var(--accent-line, var(--accent)); }
.ksn-more[aria-expanded="true"] svg{ transform:rotate(180deg); }

.ksn :is(button, a):focus-visible{ outline:2px solid var(--accent-line, var(--accent)); outline-offset:-2px; }

/* ---- 휴대폰 · 태블릿 — 단추 → 왼쪽 서랍 ---- */
@media (max-width:1023px){
  .ksn-wrap{ grid-template-columns:minmax(0, 1fr); gap:var(--ksn-gap, 14px); }
  /* 탭 · 종목 칩이 오른쪽 칸 안으로 들어갔지만 휴대폰에서는 「국가 · 리그」 단추가 그 <아래>에 와야 한다 — 칸을 풀어 차례를 다시 맞춘다 */
  .ksn-main{ display:contents; }
  .ksn-main > :is(.sb-top, .sb-sports){ order:-1; }
  /* EXIT (2026-11-17) 「국가 · 리그」 단추는 탭(주요 경기 …) <위>로 (레드 「국가리그 위로 올리는게 좋지않을까 주요경기 앞에?」) */
  .ksn{ order:-2; }
  /* 종목 칩 줄 여백은 exit-style.css(모든 스카이 스포츠 화면 공통)에서 맞춘다 */
  .ksn{ position:static; max-height:none; overflow:visible; padding:0; border:0; background:none; margin:0; }
  .ksn-open{ display:flex; align-items:center; gap:8px; width:100%; height:40px; padding:0 12px; cursor:pointer;
    border-radius:var(--r, 4px); border:1px solid var(--line); background:var(--surface); color:var(--text); font:inherit; font-size:13px; font-weight:700; }
  .ksn-open span{ flex:none; }
  .ksn-open__cur{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; font-style:normal; font-weight:600; color:var(--text-sub); }
  .ksn-open svg:first-child{ color:var(--accent-fg); }
  /* EXIT (2026-11-17) 아래에서 올라오던 창 → EXIT 왼쪽 메뉴처럼 <왼쪽에서 밀려 나오는 서랍> (레드 「메뉴 아래서 말고 exit 처럼 왼쪽으로」) */
  .ksn-sheet{ position:fixed; top:0; bottom:0; left:0; z-index:1300; width:min(320px, 86vw); overflow:auto; overscroll-behavior:contain;
    padding:0 14px calc(16px + env(safe-area-inset-bottom)); background:var(--surface); border-right:1px solid var(--line);
    box-shadow:12px 0 32px rgb(0 0 0 / .45);
    transform:translateX(-105%); transition:transform .28s cubic-bezier(.2,.8,.2,1); }
  .ksn-sheet__head{ position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; padding:14px 0 10px; background:var(--surface); }
  .ksn-sheet__head b{ font-size:15px; }
  .ksn-close{ width:32px; height:32px; border:0; border-radius:var(--r, 4px); background:rgb(var(--fg-rgb, 255 255 255) / .06); color:var(--text); cursor:pointer; }
  .ksn-back{ display:block; position:fixed; inset:0; z-index:1299; background:rgb(0 0 0 / .55); opacity:0; pointer-events:none; transition:opacity .2s; }
  .ksn.is-sheet .ksn-sheet{ transform:none; }
  .ksn.is-sheet .ksn-back{ opacity:1; pointer-events:auto; }
  .ksn-lg__link{ height:38px; }
  .ksn-area__head{ height:42px; }
  html.ksn-lock{ overflow:hidden; }
}
@media (prefers-reduced-motion: reduce){ .ksn-sheet, .ksn-back, .ksn-caret{ transition:none; } }

/* EXIT (2026-11-17) 열린 리그가 없을 때 안내 (레드 「진행중인거 없으면 어떻게되?」 → 「해봐」) */
.ksn-none{ display:flex; flex-direction:column; align-items:center; gap:8px; margin:0; padding:18px 12px; text-align:center;
  border-radius:var(--r, 4px); border:1px dashed var(--line-strong, var(--line)); color:var(--text-sub); font-size:12.5px; line-height:1.5; }
.ksn-none svg{ color:var(--accent-fg); }
