:root {
  --bg: #0b1120;
  --bg-elevated: #121a2e;
  --bg-card: #161f38;
  --border: #26314f;
  --text: #eef1f8;
  --text-dim: #93a0c2;
  --accent: #ffb02e;
  --accent-dim: #7a5a1e;
  --live: #ff4d5e;
  --win: #35d07f;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-accent {
  color: var(--text-dim);
  font-weight: 500;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--bg-card);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent);
  color: #1a1305;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  width: 100%;
  flex: 1;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.empty-state {
  color: var(--text-dim);
  padding: 40px 0;
  text-align: center;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-card.is-live {
  border-color: var(--live);
  box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.25);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.badge {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-preview {
  background: var(--bg-elevated);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.badge-live {
  background: rgba(255, 77, 94, 0.15);
  color: var(--live);
  border: 1px solid rgba(255, 77, 94, 0.4);
  position: relative;
  padding-left: 16px;
}

.badge-live::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.badge-final {
  background: rgba(53, 208, 127, 0.12);
  color: var(--win);
  border: 1px solid rgba(53, 208, 127, 0.35);
}

.badge-postponed {
  background: rgba(255, 176, 46, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 176, 46, 0.35);
}

.game-meta {
  color: var(--text-dim);
}

.matchup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-name {
  font-weight: 600;
  flex: 1;
}

.team-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  min-width: 1.5em;
  text-align: right;
}

.game-decisions,
.game-probable {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.game-venue {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

.division-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.division-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.table-scroll {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}

.standings-table th {
  text-align: right;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.standings-table th:first-child,
.standings-table td:first-child {
  text-align: left;
}

.standings-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(38, 49, 79, 0.5);
  text-align: right;
  font-family: var(--font-mono);
}

.cell-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.leaders-section {
  margin-bottom: 32px;
}

.leaders-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dim);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.leader-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.leader-card-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.leader-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leader-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.88rem;
}

.leader-rank {
  font-family: var(--font-mono);
  color: var(--text-dim);
  width: 1.4em;
  flex-shrink: 0;
}

.leader-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-team {
  color: var(--text-dim);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.leader-value {
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 2.6em;
  text-align: right;
}

.leader-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 4px 0;
}

.updated-at {
  color: #5c6a8f;
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.3rem;
  }
  .header-inner {
    padding: 12px 16px;
  }
}
