/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:  #1a6b2f;
  --cream:  #fdf8f0;
  --tan:    #e8dfc8;
  --brown:  #7a5c2e;
  --gold:   #c8a84b;
  --red:    #b71c1c;
  --text:   #1a1a1a;
  --muted:  #6b6b6b;
  --border: #ccc;
  --radius: 6px;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  background: var(--green);
  color: #fff;
  padding: 0 24px;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: .01em;
}
.site-title:hover { text-decoration: none; opacity: .85; }
nav a {
  color: rgba(255,255,255,.85);
  margin-left: 20px;
  font-size: .95rem;
}
nav a:hover { color: #fff; text-decoration: none; }

/* ── Main ── */
main {
  flex: 1;
  max-width: 900px;
  margin: 32px auto;
  padding: 0 20px;
  width: 100%;
}

h1 { font-size: 2rem; color: var(--green); margin-bottom: 6px; }
h2 { font-size: 1.3rem; color: var(--brown); margin: 24px 0 10px; }

.subtitle { color: var(--muted); margin-bottom: 20px; font-size: .95rem; }
.hint     { color: var(--muted); margin-top: 12px; font-size: .9rem; }
.muted    { color: var(--muted); }

/* ── Leaderboard table ── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.05rem;
}
.leaderboard-table th {
  background: var(--green);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
}
.leaderboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tan);
}
.leaderboard-table tbody tr:hover { background: var(--tan); }

.rank-first  { background: #fffbe6; }
.rank-second { background: #f5f5f5; }
.rank-third  { background: #fff3e0; }
.tied        { font-style: italic; }

.rank-cell  { font-size: 1.2rem; width: 80px; }
.hr-cell    { font-size: 1.3rem; font-weight: bold; color: var(--green); text-align: right; width: 100px; }
.so-cell    { text-align: right; width: 140px; color: var(--muted); }
.muted-col  { color: var(--muted); }
.team-cell a { font-weight: bold; font-size: 1.05rem; }

.tie-badge  { background: var(--gold); color: #fff; font-size: .7rem; border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; }
.tie-note   { font-size: .8rem; font-weight: normal; }

/* ── Team page ── */
.team-header { margin-bottom: 20px; }
.back-link { font-size: .9rem; color: var(--muted); display: block; margin-bottom: 8px; }
.big-stat  { font-size: 2.2rem; font-weight: bold; color: var(--green); }
.big-stat small { font-size: 1rem; font-weight: normal; color: var(--muted); }
.so-stat   { color: var(--muted); font-size: 1.1rem; }
.sep       { margin: 0 12px; color: var(--border); }
.team-totals { margin-top: 8px; }

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin-bottom: 24px;
}
.roster-table th {
  background: var(--green);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
}
.roster-table td { padding: 9px 12px; border-bottom: 1px solid var(--tan); }
.roster-table tbody tr:hover { background: var(--tan); }
.roster-table tfoot .total-row {
  font-weight: bold;
  background: var(--tan);
  font-size: 1.05rem;
}
.pos-cell   { width: 50px; font-weight: bold; color: var(--brown); }
.stat-cell  { text-align: right; font-size: 1.15rem; font-weight: bold; width: 70px; }
.notes-cell { color: var(--muted); font-size: .85rem; }
.sub-note   { font-style: italic; }
.warn-badge { background: var(--red); color: #fff; font-size: .7rem; border-radius: 3px; padding: 1px 5px; }
.unresolved { background: #fff8f8; }

/* ── Admin ── */
.admin-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.warn-section { border-color: #e57373; background: #fff8f8; }
.ok-section   { border-color: #81c784; background: #f1f8f1; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin-top: 12px;
}
.admin-table th { background: var(--tan); padding: 7px 10px; text-align: left; }
.admin-table td { padding: 7px 10px; border-bottom: 1px solid var(--tan); }

.btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  font-family: inherit;
}
.btn:hover { opacity: .85; }
.btn-sm { padding: 4px 12px; font-size: .85rem; }
.btn-danger { background: var(--red); }

input[type="text"], input[type="number"], select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
}
input:focus, select:focus { outline: 2px solid var(--green); border-color: var(--green); }

code { background: var(--tan); padding: 2px 6px; border-radius: 3px; font-size: .9rem; word-break: break-all; }

/* ── Footer ── */
footer {
  background: var(--green);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 14px;
  font-size: .85rem;
}
footer .muted { color: rgba(255,255,255,.5); margin-top: 4px; }

/* ── Login ── */
.login-wrap {
  max-width: 360px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login-form label { font-weight: bold; font-size: .95rem; }
.login-form input[type="password"] { padding: 8px 12px; font-size: 1rem; width: 100%; }
.login-error { color: var(--red); font-size: .9rem; margin: 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .muted-col { display: none; }
  h1 { font-size: 1.5rem; }
  .big-stat { font-size: 1.6rem; }
}
