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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f7f0;
  color: #1a1a1a;
  min-height: 100vh;
}

header {
  background: #1a5c1a;
  color: #fff;
  padding: 1rem;
  text-align: center;
}
header h1 { font-size: 1.4rem; font-weight: 700; }

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.card h2 { font-size: 1rem; font-weight: 600; color: #1a5c1a; margin-bottom: .75rem; }
.card h3 { font-size: .85rem; font-weight: 600; color: #555; margin: 1rem 0 .5rem; }
.hint    { font-weight: 400; font-size: .75rem; color: #888; }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.chip-grid { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; }

.chip {
  padding: .4rem .8rem;
  border: 2px solid #ccc;
  border-radius: 20px;
  background: #f7f7f7;
  font-size: .875rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
  line-height: 1.2;
}
.chip:hover        { border-color: #1a5c1a; }
.chip.selected     { background: #1a5c1a; border-color: #1a5c1a; color: #fff; }
.chip.power-pair   { background: #92400e; border-color: #92400e; color: #fff; }

/* ── Add player ────────────────────────────────────────────────────────── */
.add-player { display: flex; gap: .5rem; }

.add-player input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: .875rem;
  outline: none;
}
.add-player input:focus { border-color: #1a5c1a; }

.add-player button {
  padding: .5rem 1rem;
  background: #1a5c1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Setup ─────────────────────────────────────────────────────────────── */
.setup-row { margin-bottom: 1rem; }

.setup-row > label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: #444;
  margin-bottom: .35rem;
}
.setup-row select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: .875rem;
}

.toggle-group { display: flex; gap: .5rem; }

.toggle-btn {
  flex: 1;
  padding: .5rem .25rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.toggle-btn.active {
  border-color: #1a5c1a;
  background: #e8f5e8;
  color: #1a5c1a;
  font-weight: 700;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.primary-btn {
  width: 100%;
  padding: .75rem;
  background: #1a5c1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .25rem;
}
.primary-btn:disabled { background: #bbb; cursor: not-allowed; }

.secondary-btn {
  width: 100%;
  padding: .65rem;
  background: #fff;
  color: #1a5c1a;
  border: 2px solid #1a5c1a;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .75rem;
}

.copy-feedback {
  text-align: center;
  color: #1a5c1a;
  font-size: .85rem;
  font-weight: 500;
  margin-top: .4rem;
}

/* ── Schedule table ────────────────────────────────────────────────────── */
.schedule-table { width: 100%; border-collapse: collapse; font-size: .85rem; }

.schedule-table thead th {
  background: #f0f7f0;
  padding: .45rem .5rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.schedule-table tbody td {
  padding: .5rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.schedule-table tbody tr:last-child td  { border-bottom: none; }
.schedule-table tr.power-pair-game      { background: #fffbeb; }

.game-label  { font-weight: 700; white-space: nowrap; }
.fence-team  { color: #1d4ed8; font-weight: 500; }
.open-team   { color: #166534; font-weight: 500; }
.sitout-cell { color: #888; font-size: .8rem; }

/* ── Coverage table ────────────────────────────────────────────────────── */
.coverage-table { width: 100%; border-collapse: collapse; font-size: .75rem; }

.coverage-table th,
.coverage-table td {
  padding: .3rem .2rem;
  text-align: center;
  border: 1px solid #e0e0e0;
}
.coverage-table thead th    { background: #f0f7f0; font-weight: 700; }
.coverage-table td.played   { background: #d1fae5; color: #166534; font-weight: 700; }
.coverage-table td.diagonal { background: #f0f0f0; color: #999; }
