/* /betscore/matches 거르기 — 날짜 띠·달력·검색·리그 고르기·종목/상태/전략 칩·정렬 (2026-10-21, templates/betscore/matches.html).
   색은 design-system.css(Match clarity) 토큰만 쓴다. 홈 '경기 일정·결과'(home-schedule.css)와 같은 모양. */
.mf {
  min-width: 0; margin-bottom: 20px; padding: 12px 16px 4px;
  border: 1px solid var(--bs-border); border-radius: 12px; background: var(--bs-surface); color: var(--bs-text);
}
.mf button, .mf input, #betscore-matches-list button { font: inherit; }
.mf button, #betscore-matches-list button { cursor: pointer; }
/* 클래스의 display 가 hidden 속성을 이기지 않게 (숨긴 칩·리그·달력·도구) */
.mf [hidden], .mf[hidden], #betscore-matches-list [hidden], [data-strategy-note][hidden] { display: none !important; }
.mf svg, #betscore-matches-list .mf-lg svg, .mf-summary svg, .mf-empty svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.mf :focus-visible, #betscore-matches-list .mf-pill:focus-visible, #betscore-matches-list .mf-lg button:focus-visible { outline: 2px solid var(--bs-blue); outline-offset: 2px; }

/* 날짜 띠 */
.mf-datebar { display: flex; align-items: stretch; gap: 6px; }
.mf-arrow, .mf-cal-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 52px; padding: 0 10px;
  border: 1px solid var(--bs-border); border-radius: 10px; background: var(--bs-surface); color: var(--bs-secondary);
}
.mf-arrow:hover, .mf-cal-btn:hover { border-color: var(--bs-muted); color: var(--bs-text); }
.mf-cal-btn span { font-size: 14px; font-weight: 600; }
.mf-strip { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.mf-strip::-webkit-scrollbar { display: none; }
.mf-day {
  flex: 1 0 62px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--bs-border); border-radius: 10px; background: var(--bs-surface); color: var(--bs-text);
  line-height: 1.25; font-variant-numeric: tabular-nums; text-decoration: none;
}
.mf[data-lang="en"] .mf-day { min-width: 82px; }
.mf-day:hover { border-color: var(--bs-muted); }
.mf-day .dw { font-size: 13px; color: var(--bs-secondary); }
.mf-day.sat .dw { color: var(--bs-blue); }
.mf-day.sun .dw { color: var(--bs-negative); }
.mf-day.today .dw { color: var(--bs-accent); font-weight: 700; }
.mf-day .dd { font-size: 15px; font-weight: 700; }
.mf-day .dn { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--bs-muted); }
.mf-day .dn svg { width: 11px; height: 11px; }
.mf-day.locked { background: transparent; border-style: dashed; }
.mf-day.locked .dd { color: var(--bs-secondary); }
.mf-day[aria-current="date"] { background: var(--bs-accent); border-color: var(--bs-accent); border-style: solid; }
.mf-day[aria-current="date"] :is(.dw, .dd, .dn) { color: var(--bs-on-accent); }

/* 달력 */
.mf-cal-wrap { position: relative; flex: none; display: flex; }
.mf-cal {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 308px; max-width: calc(100vw - 32px);
  padding: 12px; border: 1px solid var(--bs-border); border-radius: 12px; background: var(--bs-surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.mf-cal .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.mf-cal .cal-head button { width: 40px; height: 40px; border-radius: 8px; color: var(--bs-secondary); display: inline-flex; align-items: center; justify-content: center; background: transparent; }
.mf-cal .cal-head button:hover { background: var(--bs-elevated); }
.mf-cal .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-variant-numeric: tabular-nums; }
.mf-cal .wd { font-size: 13px; color: var(--bs-muted); padding: 2px 0 4px; }
.mf-cal .wd.sun { color: var(--bs-negative); }
.mf-cal .wd.sat { color: var(--bs-blue); }
.mf-cal .cal-day { position: relative; display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 8px; color: var(--bs-text); font-size: 14px; text-decoration: none; }
.mf-cal .cal-day:hover { background: var(--bs-elevated); }
.mf-cal .cal-day.locked { color: var(--bs-secondary); }
.mf-cal .cal-day.locked::after { content: ""; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 2px; background: var(--bs-warning); opacity: .8; }
.mf-cal .cal-day.today { box-shadow: inset 0 0 0 1px var(--bs-accent); }
.mf-cal .cal-day[aria-current="date"] { background: var(--bs-accent); color: var(--bs-on-accent); font-weight: 700; }
.mf-cal .cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; color: var(--bs-muted); }
.mf-cal .cal-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--bs-warning); margin-right: 4px; vertical-align: 1px; }

/* 검색·리그 */
.mf-form { margin: 12px 0 0; }
.mf-row { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.mf-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--bs-border); border-radius: 10px; background: var(--bs-bg); color: var(--bs-muted);
}
.mf-search:focus-within { border-color: var(--bs-blue); }
.mf-search input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: transparent; color: var(--bs-text); font-size: 15px; outline: none; }
.mf-search input::placeholder { color: var(--bs-muted); }
.mf .mf-search input:focus-visible, .mf .mf-league-head input:focus-visible { outline: none; }
.mf-league { position: relative; flex: none; }
.mf-league-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 260px; padding: 0 12px;
  border: 1px solid var(--bs-border); border-radius: 10px; background: var(--bs-surface); color: var(--bs-secondary);
  font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap;
}
.mf-league-btn::-webkit-details-marker { display: none; }
.mf-league-btn:hover, .mf-league[open] .mf-league-btn { border-color: var(--bs-muted); color: var(--bs-text); }
.mf-league-btn b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--bs-text); }
.mf-league.on .mf-league-btn { background: var(--bs-accent-surface); border-color: #2f6558; color: var(--bs-accent); }
.mf-league.on .mf-league-btn b { color: var(--bs-accent); }
.mf-league-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 420px; max-width: calc(100vw - 32px);
  border: 1px solid var(--bs-border); border-radius: 12px; background: var(--bs-surface); box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.mf-league-head { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--bs-border); }
.mf-league-head input {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--bs-border); border-radius: 8px; background: var(--bs-bg); color: var(--bs-text); font-size: 15px;
}
.mf-league-head input:focus { border-color: var(--bs-blue); outline: none; }
.mf-league-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-league-actions button {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--bs-border); border-radius: 8px; background: var(--bs-surface);
  color: var(--bs-secondary); font-size: 13px; font-weight: 600;
}
.mf-league-actions button:hover { border-color: var(--bs-muted); color: var(--bs-text); }
.mf-league-list { max-height: min(56vh, 420px); overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; }
.mf-league-item { display: flex; align-items: center; }
.mf-league-item.zero .mf-league-opt { color: var(--bs-muted); }
.mf-league-opt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 12px; cursor: pointer; font-size: 14px; }
.mf-league-opt:hover { background: var(--bs-elevated); }
.mf-league-opt input { flex: none; width: 18px; height: 18px; accent-color: var(--bs-accent); }
.mf-league-ico { flex: none; }
.mf-league-name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.mf-league-name i { margin-left: 6px; font-style: normal; font-size: 12px; color: var(--bs-muted); }
.mf-league-opt b { flex: none; color: var(--bs-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mf-fav {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--bs-muted);
}
.mf-fav[aria-pressed="true"] { color: var(--bs-warning); }
.mf-fav[aria-pressed="true"] svg { fill: currentColor; }
.mf-league-none { margin: 0; padding: 16px; color: var(--bs-muted); font-size: 14px; text-align: center; }

/* 종목·상태·전략 칩 */
.mf-group { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--bs-border); }
.mf[data-lang="en"] .mf-group { grid-template-columns: 64px minmax(0, 1fr); }
.mf-label { color: var(--bs-muted); font-size: 13px; font-weight: 600; }
.mf-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mf-chip { position: relative; flex: none; display: inline-flex; }
.mf-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
label.mf-chip > span, a.mf-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 8px; background: var(--bs-elevated); color: var(--bs-secondary);
  font-size: 13px; white-space: nowrap; text-decoration: none; cursor: pointer;
}
label.mf-chip > span:hover, a.mf-chip:hover { border-color: var(--bs-muted); color: var(--bs-text); }
.mf-chip b { font-weight: 600; color: var(--bs-muted); font-variant-numeric: tabular-nums; }
.mf-chip input:checked + span { background: var(--bs-accent-surface); border-color: #2f6558; color: var(--bs-accent); font-weight: 700; }
.mf-chip input:checked + span b { color: inherit; }
.mf-chip input:focus-visible + span { outline: 2px solid var(--bs-blue); outline-offset: 2px; }
label.mf-chip.zero > span { opacity: .55; }
a.mf-chip.away { background: transparent; border-color: var(--bs-border); border-style: dashed; }
a.mf-chip.away b { color: var(--bs-secondary); }
.mf-date-input { min-height: 44px; padding: 0 10px; border: 1px solid var(--bs-border); border-radius: 8px; background: var(--bs-bg); color: var(--bs-text); color-scheme: dark; }
.mf-apply { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--bs-accent); color: var(--bs-on-accent); font-weight: 700; }

/* 정렬·숨기기 */
.mf-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--bs-border); }
.mf-seg { display: inline-flex; flex: none; border: 1px solid var(--bs-border); border-radius: 10px; overflow: hidden; background: var(--bs-surface); }
.mf-seg button { min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: var(--bs-secondary); font-size: 14px; font-weight: 600; }
.mf-seg button + button { border-left: 1px solid var(--bs-border); }
.mf-seg button[aria-pressed="true"] { background: var(--bs-elevated); color: var(--bs-text); }
.mf-switch {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--bs-secondary);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.mf-switch:hover { color: var(--bs-text); }
.mf-switch .sw { position: relative; flex: none; width: 30px; height: 18px; border-radius: 9px; background: #3a4b5d; transition: background .15s; }
.mf-switch .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bs-text); transition: transform .15s; }
.mf-switch[aria-checked="true"] { color: var(--bs-text); }
.mf-switch[aria-checked="true"] .sw { background: #387b69; }
.mf-switch[aria-checked="true"] .sw::after { transform: translateX(12px); }

/* 목록 위 요약·적용한 거르기 */
.mf-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; color: var(--bs-secondary); font-size: 14px; }
.mf-summary strong { color: var(--bs-text); font-size: 15px; }
.mf-active { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-active:empty { display: none; }
.mf-pill, .mf-clear {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 8px 0 10px;
  border: 1px solid #2f6558; border-radius: 16px; background: var(--bs-accent-surface); color: var(--bs-accent); font-size: 13px; font-weight: 600;
}
.mf-pill svg { width: 14px; height: 14px; }
.mf-clear { border-color: var(--bs-border); background: transparent; color: var(--bs-secondary); padding: 0 10px; }
.mf-clear:hover, .mf-pill:hover { color: var(--bs-text); }
.mf-jump { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border: 1px solid var(--bs-border); border-radius: 8px; background: transparent; color: var(--bs-blue); font-size: 13px; font-weight: 600; }
.mf-jump svg { width: 15px; height: 15px; }
.mf-note { margin: 0 0 8px; color: var(--bs-muted); font-size: 13px; }
.mf-now {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-bottom: 1px solid var(--bs-border); background: var(--bs-elevated); color: var(--bs-secondary);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mf-now::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .45; }
.mf-empty { padding: 36px 20px; border: 1px solid var(--bs-border); border-radius: 12px; text-align: center; color: var(--bs-secondary); }
.mf-empty p { margin: 0 0 12px; }
.mf-reset { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--bs-border); border-radius: 8px; background: transparent; color: var(--bs-text); font-size: 14px; text-decoration: none; }
.mf-reset:hover { border-color: var(--bs-muted); }

/* 리그순 묶음 */
.mf-lg { border-bottom: 1px solid var(--bs-border); }
.mf-lg-head { display: flex; align-items: center; gap: 2px; padding: 0 12px 0 4px; background: var(--bs-elevated); }
.mf-lg-fav { flex: none; width: 40px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--bs-muted); }
.mf-lg-fav[aria-pressed="true"] { color: var(--bs-warning); }
.mf-lg-fav[aria-pressed="true"] svg { fill: currentColor; }
.mf-lg-toggle { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; color: var(--bs-text); }
.mf-lg-toggle .chev { transition: transform .15s; }
.mf-lg-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.mf-lg-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-lg-ctry { flex: none; color: var(--bs-muted); font-size: 13px; }
.mf-lg-count { margin-left: auto; flex: none; color: var(--bs-muted); font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .mf { padding: 10px 12px 2px; }
  .mf-cal-btn span { display: none; }
  .mf-day { flex-basis: 54px; }
  .mf-row { flex-wrap: wrap; }
  .mf-league { flex: 1 1 100%; }
  .mf-league-btn { width: 100%; max-width: none; }
  .mf-league-panel { left: 0; right: 0; width: auto; max-width: none; }
  .mf-group, .mf[data-lang="en"] .mf-group { grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  /* 칩은 한 줄로 두고 가로로 넘긴다 — 세로 자리를 덜 쓴다 */
  .mf-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .mf-chips::-webkit-scrollbar { display: none; }
  .mf-lg-toggle { flex-wrap: wrap; gap: 3px 6px; padding-block: 8px; }
  .mf-lg-name { flex: 1 1 80px; white-space: normal; overflow-wrap: anywhere; }
  .mf-lg-count .ex { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mf-lg-toggle .chev, .mf-switch .sw, .mf-switch .sw::after { transition: none; }
}
