/* data.bola.club, mobile-first, terang/gelap. */

:root {
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #17211b;
  --muted: #5b6b60;
  --line: #dfe7e2;
  --accent: #0f7a3d;
  --accent-soft: #e3f2e9;
  --notice-bg: #fff8e1;
  --notice-line: #e8c547;
  --header-bg: #0e2a1a;
  --header-text: #ffffff;
  --chip-bg: #eef2ef;
  --score-bg: #eef2ef;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --card: #182019;
    --text: #e9efeb;
    --muted: #9fb3a8;
    --line: #2a352e;
    --accent: #4ade80;
    --accent-soft: #173824;
    --notice-bg: #2b250f;
    --notice-line: #8a741f;
    --header-bg: #0a1f13;
    --header-text: #e9efeb;
    --chip-bg: #22302a;
    --score-bg: #22302a;
  }
}

[data-theme="light"] {
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #17211b;
  --muted: #5b6b60;
  --line: #dfe7e2;
  --accent: #0f7a3d;
  --accent-soft: #e3f2e9;
  --notice-bg: #fff8e1;
  --notice-line: #e8c547;
  --header-bg: #0e2a1a;
  --header-text: #ffffff;
  --chip-bg: #eef2ef;
  --score-bg: #eef2ef;
}

[data-theme="dark"] {
  --bg: #0f1512;
  --card: #182019;
  --text: #e9efeb;
  --muted: #9fb3a8;
  --line: #2a352e;
  --accent: #4ade80;
  --accent-soft: #173824;
  --notice-bg: #2b250f;
  --notice-line: #8a741f;
  --header-bg: #0a1f13;
  --header-text: #e9efeb;
  --chip-bg: #22302a;
  --score-bg: #22302a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--header-bg); color: var(--header-text); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { color: var(--header-text); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { color: #4ade80; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 14px; }
.main-nav a { color: var(--header-text); font-weight: 600; }
#theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--header-text);
  border-radius: 999px;
  padding: 4px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.freshness {
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.82rem;
  padding: 8px 0;
}

main { padding-top: 16px; padding-bottom: 32px; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.intro { color: var(--muted); margin: 0 0 12px; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 12px;
  padding: 2px 16px 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  color: var(--muted);
  padding: 10px 12px 8px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.comp {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 16px;
  margin: 0 0 16px;
}
.comp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.comp-head h2 { margin: 0; }
.comp-links { font-size: 0.85rem; white-space: nowrap; }
.fresh-line { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }

.match-list { border-top: 1px solid var(--line); }
.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "home score away"
    "meta meta meta";
  gap: 2px 10px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.match:hover { text-decoration: none; background: var(--accent-soft); }
.match .team { font-weight: 600; font-size: 0.93rem; min-width: 0; }
.match .team.home { grid-area: home; text-align: right; }
.match .team.away { grid-area: away; }
.match .score {
  grid-area: score;
  background: var(--score-bg);
  border-radius: 6px;
  padding: 2px 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.match .meta {
  grid-area: meta;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.match.finished .score { background: var(--accent); color: #fff; }

.notice {
  background: var(--notice-bg);
  border-left: 3px solid var(--notice-line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
  margin: 12px 0;
}
.empty { color: var(--muted); }

.subnav { margin: 0 0 8px; }

details.round {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 10px;
  padding: 0 12px 4px;
}
details.round summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style-position: inside;
}

table.standings {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.standings th, .standings td { padding: 8px 5px; text-align: center; border-bottom: 1px solid var(--line); }
.standings th { font-size: 0.78rem; color: var(--muted); }
.standings .team-col { text-align: left; font-weight: 600; padding-left: 10px; }
.standings .pos { color: var(--muted); width: 28px; }
.standings .pts { font-weight: 800; }

.crumbs { font-size: 0.85rem; color: var(--muted); margin: 8px 0; }
.match-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
}
.match-comp { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.match-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  font-size: 1.05rem;
}
.match-score .team { font-weight: 700; }
.match-score .team.home { text-align: right; }
.match-score .team.away { text-align: left; }
.match-score .score { font-size: 1.6rem; font-weight: 800; white-space: nowrap; }
.match-status { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
dl.info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  text-align: left;
  margin: 18px auto 0;
  max-width: 420px;
  font-size: 0.92rem;
}
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 600; }
.match-detail .notice { text-align: left; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 20px 0 28px;
}
.site-footer p { margin: 0 0 8px; }
.footer-leagues a { margin-right: 10px; white-space: nowrap; }
