* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #fafafa;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #1a3c34;
  color: white;
}
.topbar a { color: white; margin-right: 1rem; }
.content { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.table-scroll { overflow-x: auto; }
tr.is-current { background: #eef3ec; }
tr.is-current td:first-child { border-left: 3px solid #1a3c34; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
select, textarea {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
  /* labels (font-size: 0.9rem) wrap most inputs, and inputs inherit that;
     iOS Safari auto-zooms on focus for anything under 16px, so pin it. */
  font-size: 16px;
}
.inline-form { display: inline; }
.row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.row > .card { flex: 1; min-width: 260px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.week-nav h1 { margin: 0; text-align: center; }
.week-nav a, .week-nav span { white-space: nowrap; font-size: 0.9rem; }
.day { border: 1px solid #e0e0e0; border-radius: 6px; padding: 0.75rem; margin-top: 0.75rem; background: #fcfcfc; }
.day h3 { margin: 0 0 0.5rem 0; font-size: 0.95rem; color: #444; }
.entry { border-left: 3px solid #1a3c34; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; background: white; }
.badge { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; background: #1a3c34; color: white; border-radius: 3px; padding: 0.1rem 0.4rem; margin-right: 0.5rem; }
.muted { color: #777; font-size: 0.85rem; }
fieldset { border: 1px solid #ddd; border-radius: 6px; margin-bottom: 1rem; }
.actions { margin-top: 1rem; display: flex; gap: 0.5rem; }
.button-link { background: none; border: none; color: #b00020; padding: 0; cursor: pointer; text-decoration: underline; font-size: 0.85rem; }
a.button { display: inline-block; background: #1a3c34; color: white; padding: 0.4rem 0.8rem; border-radius: 4px; text-decoration: none; font-size: 0.85rem; }
.card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}
.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}
form.card { width: 280px; }
label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; }
input {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  /* see the select/textarea rule above for why this is pinned */
  font-size: 16px;
}
button {
  background: #1a3c34;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.error { color: #b00020; }

/* Live match screen */
.clock-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1a3c34;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.clock-time { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.clock-controls button { background: white; color: #1a3c34; }
.clock-controls .set-minute { display: flex; align-items: center; gap: 0.35rem; }
.clock-controls .set-minute input { width: 4rem; margin: 0; padding: 0.35rem; }
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.action-grid button {
  padding: 1.25rem 0.5rem;
  font-size: 1.05rem;
  border-radius: 10px;
  min-height: 4.5rem;
}
.action-grid button.opp { background: #7a2e2e; }
.action-grid button.sub { background: #3a5a8c; }
.action-grid button.card { background: #8a6d1d; }
.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid #1a3c34;
  background: white;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  flex-wrap: wrap;
}
.timeline-item .desc { font-size: 0.9rem; }
.timeline-item .min { font-weight: 700; margin-right: 0.5rem; }
.timeline-item .item-actions { display: flex; gap: 0.5rem; font-size: 0.85rem; }
dialog { border: none; border-radius: 10px; padding: 0; width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog .dialog-body { padding: 1.25rem; }
dialog h2 { margin-top: 0; font-size: 1.1rem; }
.sub-row { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.75rem; }
.sub-row > div { flex: 1; }
.phase-toggle { margin-bottom: 1rem; }
.checkbox-row { display: inline-block; width: auto; margin-right: 1rem; }
.checkbox-row input { display: inline; width: auto; }
