/* 제니스리그 앱 — 휴대폰 우선. 리그 로고(ZIHL) 남색·주황 기준 */
:root {
  --navy: #1f3a93; --navy-d: #15296b; --orange: #f47b20; --orange-l: #fff1e6;
  --bg: #f3f6fb; --card: #ffffff; --line: #e1e6ef; --text: #17202e; --muted: #6b7686; --muted2: #99a3b3;
  --win: #1f8f4e; --loss: #c0392b; --live: #e01e5a; --chip: #e9eef8;
  --top-h: 52px; --nav-h: 60px; --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 46, .06), 0 4px 14px rgba(23, 32, 46, .05);
}
html[data-theme="dark"] {
  --navy: #6f8be8; --navy-d: #2a3e86; --orange: #ff9a4d; --orange-l: #3a2818;
  --bg: #0f1420; --card: #171d2b; --line: #26304a; --text: #e8ecf4; --muted: #9aa5ba; --muted2: #6b7689;
  --chip: #212a3f; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.hidden, [hidden] { display: none !important; }

/* 상단 바 */
.top { position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); background: var(--navy-d); color: #fff; display: flex; align-items: center; gap: 10px; padding-left: 14px; padding-right: 10px; box-shadow: 0 2px 0 var(--orange); }
.top .logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.top .title { font-weight: 800; font-size: 17px; letter-spacing: -.2px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title small { display: block; font-weight: 500; font-size: 11px; opacity: .8; }
.top .btn-icon { background: rgba(255, 255, 255, .12); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; }
.top select.season { width: auto; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 10px; padding: 6px 8px; font-size: 13px; max-width: 42vw; }
.top select.season option { color: #111; }

/* 하단 탭 */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 600; }
.nav a .ic { font-size: 21px; line-height: 1; }
.nav a.on { color: var(--navy); }
.nav a.on .ic { transform: translateY(-1px); }

/* 공통 레이아웃 */
.page { max-width: 720px; margin: 0 auto; padding: 12px 12px 24px; }
.sec { margin: 18px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.sec .more { font-size: 13px; color: var(--navy); font-weight: 600; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.card.tap:active { transform: scale(.995); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.today { border-color: var(--orange); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--navy); }
.tag.or { background: var(--orange-l); color: var(--orange); }
.tag.live { background: var(--live); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.or { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--loss); }
.btn:disabled { opacity: .5; }
.star { background: none; border: 0; font-size: 22px; padding: 4px; color: var(--muted2); }
.star.on { color: var(--orange); }

/* 경기 카드 */
.game { padding: 10px 12px; }
.game .meta { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.game .meta b { color: var(--text); font-weight: 700; }
.game .vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.game .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game .team.away { flex-direction: row-reverse; text-align: right; }
.game .team .nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game .team .lk { font-size: 11px; color: var(--muted); }
.game .team.fav .nm { color: var(--orange); }
.logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--chip); flex: none; border: 1px solid var(--line); }
.logo.lg { width: 64px; height: 64px; }
.logo.txt { display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--navy); }
.score { font-weight: 900; font-size: 24px; letter-spacing: 1px; min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.score.sched { font-size: 14px; color: var(--muted); font-weight: 700; }
.score .ot { display: block; font-size: 10px; color: var(--orange); font-weight: 700; letter-spacing: 0; }
.game .w { color: var(--win); }
.datehead { font-weight: 800; font-size: 15px; margin: 14px 2px 8px; }
.datehead small { color: var(--muted); font-weight: 600; margin-left: 6px; }

/* 표 */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 700; }
.tbl td.l, .tbl th.l { text-align: left; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.b { font-weight: 800; }
.tbl tr.fav td { background: var(--orange-l); }
.tbl .rk { color: var(--muted); width: 26px; }
.tbl .tm { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.tbl .tm .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; }
.tbl th, .tbl td { padding: 8px 5px; }
.tbl .tm .logo { width: 26px; height: 26px; }
.tbl-wrap { overflow-x: auto; }
.card.p0 { padding: 0; overflow: hidden; }
.card.p0 .tbl th:first-child, .card.p0 .tbl td:first-child { padding-left: 12px; }
.card.p0 .tbl th:last-child, .card.p0 .tbl td:last-child { padding-right: 12px; }
.card.p0 .head { padding: 10px 12px 6px; font-weight: 800; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }

/* 목록 */
.list .item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .nm { font-weight: 700; }
.list .item .sub { font-size: 12px; color: var(--muted); }
.list .item .arr { color: var(--muted2); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.notice-body { white-space: pre-wrap; line-height: 1.6; }
.notice-body img, .poster { max-width: 100%; border-radius: 10px; display: block; margin: 8px 0; }
.bracket .m { display: grid; grid-template-columns: 74px 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bracket .m:last-child { border-bottom: 0; }
.bracket .m .r { color: var(--muted); font-size: 12px; font-weight: 700; }
.bracket .m .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bracket .m .t.a { text-align: right; }
.bracket .m .s { font-weight: 900; font-variant-numeric: tabular-nums; }
.bracket .m .t.w { color: var(--win); }
.hero { display: block; background: linear-gradient(135deg, var(--navy-d), var(--navy)); color: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.hero .h { font-size: 13px; opacity: .85; font-weight: 600; }
.hero .big { font-size: 20px; font-weight: 800; margin-top: 2px; }
.hero .sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.hero.or { background: linear-gradient(135deg, #d9641a, var(--orange)); }
.search { display: flex; gap: 8px; margin-bottom: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--navy); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: .95; }

/* 관리자 */
.admin .form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin .form label { font-size: 12px; color: var(--muted); font-weight: 700; display: block; margin-bottom: 3px; }
.admin .form .full { grid-column: 1 / -1; }
.admin .form input, .admin .form select, .admin .form textarea { padding: 8px 10px; }
.admin .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.admin .scorebox { display: grid; grid-template-columns: 1fr 56px 20px 56px 1fr; align-items: center; gap: 6px; }
.admin .scorebox input { text-align: center; font-weight: 800; font-size: 18px; padding: 6px 4px; }
.admin .scorebox .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .scorebox .nm.a { text-align: right; }
.admin .opts { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }
.admin .opts label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.admin .opts select { width: auto; padding: 5px 8px; font-size: 13px; }
.admin .menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin .menu a { display: block; padding: 14px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 700; }
.admin .menu a small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.admin textarea { min-height: 120px; }
.admin .inline { display: flex; gap: 6px; align-items: center; }
.admin .inline input { padding: 6px 8px; }
.admin .inline input.num { width: 64px; text-align: center; }
.admin .inline input.nm { flex: 1; }
.admin .inline input.gr { width: 56px; text-align: center; }

@media (min-width: 720px) {
  .top .title { font-size: 19px; }
  .admin .form { grid-template-columns: 1fr 1fr 1fr; }
}
