/* 풋볼보드 스타일 — 바탕·글자 토큰은 Sign PDF·Voice Denoise와 같은 계열, 강조색만 잔디색 초록.
   색은 모두 토큰으로 두고 다크 모드에서 다시 지정한다. */
:root {
  color-scheme: light dark;
  --bg: #f4f6f9; --card: #ffffff; --foreground: #151926; --muted: #5b6273;
  --border: #dde1ea; --line: #edf0f5; --border-strong: #c2c8d5;
  --accent: #0f7a4a; --accent-text: #0b6a40; --accent-soft: #0f7a4a17;
  --live: #d92626;
  --z-ucl: #2563eb; --z-uel: #e8850c; --z-uecl: #0d9488; --z-po: #a855f7; --z-rel: #dc2626;
  --z-r16: #2563eb; --z-kpo: #7cb0ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117; --card: #171b23; --foreground: #e7e9ef; --muted: #9ba2b4;
    --border: #2a303c; --line: #222733; --border-strong: #3b4252;
    --accent: #1f9d63; --accent-text: #4fd28f; --accent-soft: #4fd28f1f;
    --live: #f26b6b;
    --z-ucl: #5b8cff; --z-uel: #f5a524; --z-uecl: #2dd4bf; --z-po: #c084fc; --z-rel: #f26b6b;
    --z-r16: #5b8cff; --z-kpo: #2f5596;
  }
}
* { box-sizing: border-box; }
body { font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif; background: var(--bg); color: var(--foreground); margin: 0; line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 0; }
.wrap.narrow { max-width: 820px; }

/* ---- 헤더·리그 메뉴·푸터 ---- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.18rem; color: var(--foreground); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { padding: 7px 12px; border-radius: 8px; font-size: 0.97rem; font-weight: 500; color: var(--foreground); text-decoration: none; }
.site-nav a:hover { background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent-text); font-weight: 700; }
.league-bar { background: var(--card); border-bottom: 1px solid var(--border); }
.league-bar ul { max-width: 1120px; margin: 0 auto; padding: 0 10px; display: flex; gap: 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.league-bar ul::-webkit-scrollbar { display: none; }
.league-bar a { display: block; padding: 10px 12px 9px; font-size: 0.93rem; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.league-bar a:hover { color: var(--foreground); }
.league-bar a[aria-current="page"] { color: var(--foreground); border-bottom-color: var(--accent); }
@media (max-width: 520px) {
  .site-header .inner { padding: 10px 12px; }
  .brand { font-size: 1.08rem; }
  .brand svg { width: 26px; height: 26px; }
  .site-nav a { padding: 6px 8px; font-size: 0.9rem; }
}
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }
.site-footer .inner { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--foreground); }

/* ---- 페이지 머리 ---- */
.page-h { margin: 4px 0 18px; }
.page-h h1 { font-size: 1.65rem; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.015em; }
.page-h h1 small { font-size: 0.6em; color: var(--muted); font-weight: 600; margin-left: 2px; }
.page-h .lead { margin: 0; color: var(--muted); font-size: 0.98rem; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin: 0 0 4px; }
.crumbs a { color: var(--muted); }
.updated { font-size: 0.78rem; color: var(--muted); margin: 6px 0 0; min-height: 1.2em; }
@media (max-width: 520px) { .page-h h1 { font-size: 1.4rem; } .wrap { padding-top: 16px; } }

/* ---- 카드 ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; min-width: 0; container-type: inline-size; }
.card + .card { margin-top: 16px; }
.tables-grid > .card, .scorers-grid > .card { margin-top: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.card-h h2, .card-h h3 { font-size: 1.08rem; margin: 0; letter-spacing: -0.01em; }
.card-h h2 .date { font-size: 0.88rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.card-h h2 a, .card-h h3 a { color: var(--foreground); text-decoration: none; }
.card-h h2 a:hover, .card-h h3 a:hover { text-decoration: underline; }
.card-h .more { font-size: 0.82rem; white-space: nowrap; text-decoration: none; font-weight: 600; }
.card-h .more::after { content: " ›"; }
.card-h .sub { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 520px) { .card { padding: 14px 12px; border-radius: 12px; } }

.home-grid { display: grid; gap: 16px; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.prev-slot:empty { display: none; }
.cols { display: grid; gap: 16px; align-items: start; }
@media (min-width: 960px) { .cols { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.cols > div { min-width: 0; }
.section-title { font-size: 1.15rem; margin: 30px 0 12px; letter-spacing: -0.01em; }

/* ---- 표 공통 ---- */
table.standings, table.scorers { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.standings th, .scorers th { font-size: 0.74rem; font-weight: 600; color: var(--muted); padding: 6px 6px 7px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.standings td, .scorers td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
.standings tr:last-child td, .scorers tr:last-child td { border-bottom: 0; }
.standings .n, .scorers .n { text-align: right; width: 2.6em; }
abbr[title] { text-decoration: none; }
td.pos, th.pos { width: 2.3em; text-align: center; }
td.pos { font-weight: 600; color: var(--muted); }
td.team { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.crest { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 8px; }
.crest.ph { display: inline-block; border-radius: 50%; background: var(--line); }
td.pts { font-weight: 800; }
td.gd { color: var(--muted); }
/* 구간: 순위 칸 왼쪽 띠 */
tr[class^="z-"] td.pos { box-shadow: inset 3px 0 0 var(--zc); color: var(--foreground); }
.z-ucl { --zc: var(--z-ucl); } .z-uel { --zc: var(--z-uel); } .z-uecl { --zc: var(--z-uecl); }
.z-po { --zc: var(--z-po); } .z-rel { --zc: var(--z-rel); } .z-r16 { --zc: var(--z-r16); } .z-kpo { --zc: var(--z-kpo); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 12px 0 2px; font-size: 0.78rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; background: var(--zc); }
.note { font-size: 0.75rem; color: var(--muted); margin: 4px 0 0; }
.standings.compact td { padding: 6px 5px; }
@media (max-width: 560px) {
  table.standings, table.scorers { font-size: 0.86rem; }
  .standings th, .standings td, .scorers th, .scorers td { padding-left: 3px; padding-right: 3px; }
  .standings .gfa { display: none; }
  .standings .n { width: 2.2em; }
  .crest { margin-right: 6px; }
}
@media (max-width: 360px) { .standings .wdl { display: none; } }

/* ---- 경기 목록 ---- */
.matches { list-style: none; margin: 0; padding: 0; }
.match { display: grid; grid-template-columns: 50px minmax(0, 1fr) 62px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.match:last-child { border-bottom: 0; }
.match .when { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.25; }
.match .when small { display: block; font-size: 0.7rem; }
.side { display: flex; align-items: center; min-width: 0; font-weight: 600; }
.side .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.home { justify-content: flex-end; text-align: right; }
.side.home .crest { margin: 0 0 0 8px; }
.side.away .crest { margin: 0 8px 0 0; }
.mid { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 3px; text-align: center; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.mid .dash { color: var(--muted); font-weight: 600; }
.mid .vs { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.mid .extra { flex-basis: 100%; font-size: 0.66rem; color: var(--muted); font-weight: 600; }
.match.live .mid { color: var(--live); }
.match.off { opacity: 0.6; }
.badge.live { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--live); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .badge.live { animation: none; } }
h3.day { font-size: 0.84rem; color: var(--muted); margin: 16px 0 2px; font-weight: 700; }
h3.day:first-child { margin-top: 2px; }
h4.comp-h { font-size: 0.9rem; margin: 16px 0 2px; display: flex; gap: 8px; align-items: baseline; }
h4.comp-h:first-child { margin-top: 2px; }
h4.comp-h a { color: var(--foreground); text-decoration: none; font-weight: 800; }
h4.comp-h a:hover { text-decoration: underline; }
h4.comp-h span { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
/* 좁은 칸(휴대폰, 리그 페이지 오른쪽 칸)에서는 시각 칸과 간격을 줄인다 */
@container (max-width: 420px) {
  .match { grid-template-columns: 40px minmax(0, 1fr) 52px minmax(0, 1fr); gap: 6px; font-size: 0.88rem; }
  .side.home .crest { margin-left: 6px; }
  .side.away .crest { margin-right: 6px; }
}
.empty { color: var(--muted); text-align: center; padding: 18px 0; margin: 0; font-size: 0.9rem; }
[aria-busy="true"] { opacity: 0.45; transition: opacity 0.15s; }

/* ---- 날짜 고르기(경기 일정) ---- */
.daynav { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.daynav .chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; justify-content: center; }
.daynav .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 5px 8px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--foreground); text-decoration: none; font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.chip small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.chip.today small { color: var(--accent-text); }
.chip:hover { border-color: var(--border-strong); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip[aria-current] small { color: #ffffffd0; }
.arrow { flex: none; width: 34px; height: 46px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 1.5rem; line-height: 1; text-decoration: none; }
span.arrow { visibility: hidden; }
@media (max-width: 520px) { .chip { min-width: 46px; padding: 5px 6px; } .daynav .chips { justify-content: flex-start; } }

/* ---- 득점 순위 ---- */
td.player { width: 100%; max-width: 0; }
td.player b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.player .club { display: block; font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.player .crest { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }
td.goals { font-weight: 800; font-size: 1rem; }
.scorers-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .scorers-grid { grid-template-columns: 1fr 1fr; } }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.jump a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--foreground); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.jump a:hover { border-color: var(--accent); }
.scorers-grid .card { scroll-margin-top: 12px; }
@media (max-width: 400px) { .scorers .gp { display: none; } }

/* ---- 글(가이드·리그 소개·약관) ---- */
.prose { font-size: 1rem; line-height: 1.8; }
.prose h1 { font-size: 1.75rem; line-height: 1.35; margin: 4px 0 12px; letter-spacing: -0.015em; }
.prose h2 { font-size: 1.25rem; margin: 2em 0 0.6em; line-height: 1.4; }
.prose h3 { font-size: 1.05rem; margin: 1.6em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin: 0.25em 0; }
.prose .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.prose .meta a { color: var(--muted); }
.prose .lead { font-size: 1.08rem; color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; margin: 0 0 1em; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--line); font-weight: 700; }
.table-scroll { overflow-x: auto; margin: 0 0 1em; }
.table-scroll table { margin: 0; min-width: 520px; }
.prose .box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 0 0 1.2em; }
.prose .box p:last-child, .prose .box ul:last-child { margin-bottom: 0; }
@media (max-width: 520px) { .prose h1 { font-size: 1.45rem; } .prose { font-size: 0.98rem; } }
.about-block { margin-top: 40px; max-width: 820px; }
.about-block.prose h2 { margin-top: 1.4em; }
.cardlinks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
@media (min-width: 720px) { .cardlinks.two { grid-template-columns: 1fr 1fr; } }
.cardlinks a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--foreground); text-decoration: none; line-height: 1.5; }
.cardlinks a:hover { border-color: var(--accent); }
.cardlinks b { display: block; font-size: 1rem; margin-bottom: 2px; }
.cardlinks span { font-size: 0.86rem; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 4px; color: var(--muted); }

/* ---- 광고 자리 (assets/ads.js) ---- */
.ad-slot { margin: 26px 0; text-align: center; min-height: 0; }
.ad-slot .ad-label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; text-align: left; }
.ad-slot.preview { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 36px 12px; color: var(--muted); font-size: 0.85rem; }

.notfound { text-align: center; padding: 60px 0 20px; }
.notfound h1 { font-size: 1.6rem; margin: 0 0 10px; }
.notfound .lead { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }

/* ---- 홈 화면에 추가 안내 (assets/install.js) ---- */
.install-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); font-size: 0.86rem; line-height: 1.45; }
.install-bar img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-bar .txt { flex: 1; min-width: 0; }
.install-bar .txt > b { display: block; font-size: 0.95rem; }
.install-bar .txt span { color: var(--muted); }
.install-bar svg { vertical-align: -3px; color: var(--accent-text); }
.install-go { flex: none; padding: 8px 14px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.install-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.install-x:hover { background: var(--line); }
