:root {
  --turf-green: #14532d;
  --turf-green-soft: #dcfce7;
  --ink: #1c2521;
  --ink-muted: #5b6761;
  --surface: #ffffff;
  --background: #f3f6f4;
  --border: #dde4df;
  --bs-primary: #14532d;
  --bs-primary-rgb: 20, 83, 45;
  --bs-body-color: #1c2521;
  --bs-body-bg: #f3f6f4;
}

/* Stays at 16px on phones: iOS zooms the page when a focused input is smaller. */
html {
  font-size: 16px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--background);
  color: var(--ink);
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--turf-green);
}

.btn {
  min-height: 44px;
}

.btn-primary,
.btn-primary:disabled {
  background-color: var(--turf-green);
  border-color: var(--turf-green);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #0f3f22;
  border-color: #0f3f22;
}

.btn-outline-primary {
  border-color: var(--turf-green);
  color: var(--turf-green);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--turf-green);
  border-color: var(--turf-green);
  color: #ffffff;
}

a,
.btn-link {
  color: var(--turf-green);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.5rem + env(safe-area-inset-top)) 1rem 0.5rem;
  background: var(--turf-green);
}

.app-bar-action {
  min-height: 32px;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  color: #ffffff;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.app-brand img {
  flex: none;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.app-footer {
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.app-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

/* The fixed menu is 56px tall; the footer's own padding covers the safe area below it. */
.has-bottom-nav {
  padding-bottom: 56px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1020;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.bottom-nav a.active {
  color: var(--turf-green);
  box-shadow: inset 0 2px 0 var(--turf-green);
}

.app-card-link {
  display: block;
  color: var(--turf-green);
  font-weight: 600;
  text-decoration: none;
}

.page-title {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-intro {
  margin-bottom: 1rem;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.page-links {
  margin: 1rem 0 0;
  text-align: center;
}

.code-input {
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
}

.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin-bottom: 0.75rem;
  padding: 0;
  list-style: none;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
}

.flash-info {
  background: var(--turf-green-soft);
  color: var(--turf-green);
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.player-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-name {
  margin: 0;
  font-weight: 600;
}

.player-meta {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.player-actions form,
.player-actions > .btn {
  flex: 1 1 8rem;
}

.player-actions .btn {
  width: 100%;
}

.player-balance {
  margin: -0.5rem 0 0.75rem;
  font-weight: 600;
}

.is-debit {
  color: #991b1b;
}

.is-credit {
  color: var(--turf-green);
}

.section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.balance-card {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  background: var(--turf-green);
  border-color: var(--turf-green);
  color: #ffffff;
}

.balance-card.is-dues {
  background: #991b1b;
  border-color: #991b1b;
}

.balance-label,
.balance-hint {
  margin: 0;
  font-size: 0.875rem;
}

.balance-amount {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.txn-list {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.txn-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.txn-row + .txn-row,
.txn-list form + .txn-row {
  border-top: 1px solid var(--border);
}

.txn-title {
  margin: 0;
  font-weight: 600;
}

.txn-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.txn-amount {
  flex: none;
  font-weight: 600;
}

.txn-action {
  min-height: 36px;
  margin-bottom: 0.25rem;
  padding: 0;
  font-size: 0.875rem;
}

.match-facts {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0;
}

.match-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.match-facts dt {
  color: var(--ink-muted);
  font-weight: 400;
}

.match-facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.match-share {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
}

legend.form-label {
  font-size: 1rem;
}

.choice-group {
  display: flex;
  gap: 0.5rem;
}

.choice-group .btn {
  flex: 1;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.75;
}

.team-counts {
  margin-bottom: 0.5rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.team-picker {
  display: flex;
  flex: none;
  gap: 0.25rem;
}

.team-picker .btn {
  min-width: 2.75rem;
  padding: 0 0.5rem;
  line-height: 42px;
}

.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
  background-color: var(--turf-green);
  border-color: var(--turf-green);
  color: #ffffff;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-tabs .btn {
  flex: 1;
  min-height: 40px;
  line-height: 1.75;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hero {
  margin-bottom: 1.25rem;
}

.hero-logo {
  display: block;
  max-width: 60%;
  height: auto;
  margin: 0 auto 1rem;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  color: var(--ink-muted);
}

.steps {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.steps h2 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
}

.notice {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--turf-green-soft);
  border-radius: 0.75rem;
  color: var(--turf-green);
  font-weight: 600;
  text-align: center;
}
