:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #1c2321;
  --muted: #6b7671;
  --line: #e2e6e1;
  --green: #16a34a;
  --green-dark: #128040;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #14532d;
  color: #fff;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  text-decoration: none;
}

header nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

header nav a {
  color: #d1fae5;
  text-decoration: none;
  font-weight: 600;
}

header nav a:hover { color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #d1fae5;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.nav-toggle:hover { color: #fff; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }

  header { flex-wrap: wrap; }

  header nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding: 8px 0 4px;
  }

  header.nav-open nav { display: flex; }

  header nav a,
  header nav form {
    padding: 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  header nav form button.link { padding: 0; }
}

.envbar {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  letter-spacing: 0.02em;
}
.envbar-local { background: #1e3a8a; color: #dbeafe; }
.envbar-staging { background: #b45309; color: #fff; }
.envbar-production { background: #166534; color: #bbf7d0; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.narrow { max-width: 440px; margin: 48px auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

tr.inactive td { opacity: 0.5; }

.muted { color: var(--muted); font-size: 13px; }

.hint { border-bottom: 1px dotted var(--muted); cursor: help; }

/* stats page */
.form-blocks { display: inline-flex; gap: 2px; }

.form-blocks span { width: 10px; height: 14px; border-radius: 2px; display: inline-block; }

.form-W { background: var(--green); }
.form-D { background: #d1d5db; }
.form-L { background: var(--red); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 16px; font-size: 13px; }

.legend-item { display: inline-flex; align-items: center; gap: 6px; }

.legend-swatch, .swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  margin: 0 2px 0 6px;
}

.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 16px; }

.split-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }

.split-3 ol { margin: 0; padding-left: 20px; }

.heatmap-scroll { overflow-x: auto; padding-bottom: 8px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-confirmed, .pill-played, .pill-paid { background: #dcfce7; color: var(--green-dark); }
.pill-invited, .pill-planning, .pill-pending, .pill-sent { background: #fef3c7; color: var(--amber); }
.pill-declined, .pill-dropped_out, .pill-cancelled { background: #fee2e2; color: var(--red); }

.tag {
  font-size: 11px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 700;
}

button, .button {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}

button:hover, .button:hover { border-color: var(--muted); }

button.primary { background: var(--green); border-color: var(--green); color: #fff; }
button.primary:hover { background: var(--green-dark); }

button.danger { background: #fff; border-color: var(--red); color: var(--red); }
button.danger:hover { background: #fee2e2; }

button.small, .button.small { padding: 3px 10px; font-size: 12px; }

button.big { padding: 14px 22px; font-size: 17px; }

button.link {
  border: none;
  background: none;
  color: #d1fae5;
  padding: 0;
  font-weight: 600;
}

button.link:hover { color: #fff; }

.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

input, select {
  /* Explicit size/weight so inputs look the same whether or not they sit
     inside a <label> (which is 14px/600). 16px also stops iOS Safari zooming
     the page when an input is focused. */
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

label { display: inline-flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }

.inline-form label { flex-direction: row; align-items: center; gap: 8px; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.actions form { display: inline; }

.flash {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.error { color: var(--red); font-weight: 600; }

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.team-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 500;
}

.teams-summary { display: flex; gap: 48px; margin-top: 16px; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 6px;
  vertical-align: baseline;
}

.dot-red { background: #dc2626; }
.dot-black { background: #1c2321; }

.teams-summary ul { margin: 0; padding-left: 18px; }

.split-form { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }

.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }

details summary { cursor: pointer; }

pre {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
  white-space: pre-wrap;
}

.rsvp { text-align: center; }

.rsvp-date { font-size: 20px; font-weight: 800; margin: 4px 0 16px; }

.rsvp-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}
