/* CHA Kickball — Chattanooga League Portal */
/* Mobile-first, outdoor-readable, high-contrast */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #4A4A68;
  --text-muted: #7E7E9A;
  --accent: #E63946;
  --accent-light: #FFF0F1;
  --accent-dark: #C1121F;
  --border: #E2E4E9;
  --highlight-bg: #FFF8E1;
  --highlight-border: #FFB300;
  --radius: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; }

body {
  font-family: -apple-system, system-ui, 'SF Pro Text', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + var(--safe-bottom));
}

/* --- Top bar / Brand --- */
.top-bar {
  background: var(--text);
  color: #FFFFFF;
  padding: 16px 20px 14px;
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #FFFFFF;
}
.brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  font-weight: 500;
}

/* --- Main --- */
main {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Tab bar --- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 12px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.tab.active {
  color: var(--accent);
}

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--surface);
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.filter-select {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  appearance: auto;
}

/* --- Week sections --- */
.week-section {
  margin-bottom: 24px;
}
.week-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 0 2px;
}
.week-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}
.week-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Game cards --- */
.game-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.game-card.highlighted {
  background: var(--highlight-bg);
  border-color: var(--highlight-border);
}
.game-matchup {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}
.vs {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 6px;
}
.team-name-text.my-team {
  color: var(--accent-dark);
  font-weight: 800;
}
.game-score {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin-left: auto;
  white-space: nowrap;
}
.game-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.game-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.game-field {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.game-weather {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.game-weather svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}
.weather-forecast {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* --- Links --- */
.location-link-subtle {
  color: inherit;
  text-decoration: none;
}
.location-link-subtle:hover {
  text-decoration: underline;
}
.brand-link {
  color: inherit;
  text-decoration: none;
}
.brand-link:hover {
  text-decoration: underline;
}

/* --- Standings --- */
.standings-division {
  margin-bottom: 28px;
}
.division-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 2px;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}
.standings-table thead {
  border-bottom: 2px solid var(--text);
}
.standings-table th {
  text-align: left;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.standings-table th:nth-child(n+3) { text-align: center; }
.standings-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.standings-table td:nth-child(n+3) { text-align: center; }
.col-rank { width: 36px; }
.col-team { min-width: 140px; }
.standings-table tr.my-team {
  background: var(--highlight-bg);
  font-weight: 700;
}
.standings-table tr.my-team td {
  border-color: var(--highlight-border);
}

/* --- Rules --- */
.rules-intro {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
}
.rules-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.rules-link:hover { border-color: var(--text-muted); }
.rules-rev {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}
.rules-container { margin-bottom: 16px; }
.rule-section {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.rule-section summary {
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  color: var(--text);
}
.section-num {
  display: inline-block;
  color: var(--accent);
  min-width: 28px;
}
.rule-section summary::-webkit-details-marker { display: none; }
.rule-section summary::before {
  content: '\25B8  ';
  color: var(--accent);
  font-size: 14px;
}
.rule-section[open] summary::before {
  content: '\25BE  ';
}
.rule-section-body {
  padding: 0 16px 14px;
}
.rule-intro {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  font-style: italic;
}
.rule-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.rule-item:last-child { border-bottom: none; }
.rule-sub { padding-left: 12px; }
.rule-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}
.rule-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.rules-note {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  line-height: 1.5;
  font-style: italic;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 16px 16px 8px;
}
.footer-location {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.footer-updated {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
}

/* --- Utility: hidden --- */
[hidden] { display: none !important; }
