:root {
  color: #102a43;
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  --ink: #102a43;
  --muted: #627d98;
  --line: #d9e2ec;
  --surface: #ffffff;
  --accent: #0b7285;
  --accent-dark: #075985;
  --x: #9b2c2c;
  --shadow: 0 4px 18px rgb(16 42 67 / 8%);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.site-header {
  align-items: center;
  background: var(--ink);
  color: #fff;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  padding: .75rem max(1rem, calc((100vw - 1100px) / 2));
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { color: #fff; font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.main-nav { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.main-nav a { border-radius: .45rem; color: #d9e2ec; padding: .4rem .55rem; text-decoration: none; }
.main-nav a:hover, .main-nav a.active { background: #243b53; color: #fff; }
.page { margin: 0 auto; max-width: 1100px; min-height: calc(100vh - 8rem); padding: 1.5rem 1rem 3rem; }
.site-footer { color: var(--muted); font-size: .8rem; margin: 0 auto; max-width: 1100px; padding: 0 1rem 1.5rem; }

.page-header { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); }
h2 { font-size: 1.2rem; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grid { display: grid; gap: 1rem; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); margin-bottom: 1rem; padding: 1rem; }
.panel > :last-child { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { align-items: center; display: flex; flex-wrap: wrap; gap: .6rem; }
.spread { justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.button, button { background: var(--accent); border: 1px solid var(--accent); border-radius: .45rem; color: #fff; min-height: 2.45rem; padding: .5rem .75rem; }
.button:hover, button:hover { background: var(--accent-dark); }
.button-secondary, button.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.button-danger, button.danger { background: var(--x); border-color: var(--x); }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { color: var(--muted); font-size: .85rem; }
input, select, textarea { background: #fff; border: 1px solid #bcccdc; border-radius: .4rem; color: var(--ink); min-height: 2.45rem; padding: .45rem .6rem; width: 100%; }
textarea { min-height: 7rem; resize: vertical; }
input[type="checkbox"] { min-height: 1rem; width: auto; }
.check-field { align-items: center; flex-direction: row; padding-top: 1.45rem; }
.check-field > span { color: var(--ink); font-size: 1rem; }
.notice { border-radius: .45rem; margin: .75rem 0; padding: .65rem .75rem; }
.notice-info { background: #e6fffa; color: #234e52; }
.notice-error { background: #fff5f5; color: #9b2c2c; }
.notice-success { background: #f0fff4; color: #276749; }

.standings-table, .lineup-table { border-collapse: collapse; width: 100%; }
.standings-table th, .standings-table td, .lineup-table th, .lineup-table td { border-bottom: 1px solid var(--line); padding: .6rem .45rem; text-align: left; vertical-align: middle; }
.standings-table th, .lineup-table th { color: var(--muted); font-size: .8rem; font-weight: 650; text-transform: uppercase; }
.standings-table td:last-child, .standings-table th:last-child, .lineup-table td:nth-last-child(-n+2), .lineup-table th:nth-last-child(-n+2) { text-align: right; }
.rank { color: var(--muted); width: 2.2rem; }
.points { font-weight: 750; white-space: nowrap; }
.delta-up { color: #276749; }
.delta-down { color: var(--x); }

.round-picker { max-width: 18rem; }
.game-list { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.game { background: #f8fafc; border: 1px solid var(--line); border-radius: .5rem; padding: .7rem; }
.game .teams { font-weight: 650; }
.participant-card { border-top: 1px solid var(--line); padding: 1rem 0; }
.participant-card:first-of-type { border-top: 0; padding-top: 0; }
.participant-card:last-child { padding-bottom: 0; }
.lineup-table .player-cell { min-width: 13rem; }
.player-link { align-items: center; display: inline-flex; gap: .55rem; text-decoration: none; }
.player-link.compact { gap: .35rem; }
.player-name { color: var(--ink); }
.profile-mark { color: var(--muted); font-size: .8rem; }
.avatar { align-items: center; background: #d9e2ec; border-radius: 50%; color: #243b53; display: inline-flex; flex: 0 0 2.2rem; height: 2.2rem; justify-content: center; overflow: hidden; width: 2.2rem; }
.avatar-compact { flex-basis: 1.8rem; height: 1.8rem; width: 1.8rem; }
.avatar-photo { height: 100%; object-fit: cover; width: 100%; }
.avatar-fallback { font-size: .72rem; font-weight: 750; }
.role-pill { border-radius: 999px; display: inline-block; font-size: .75rem; font-weight: 750; min-width: 1.6rem; padding: .12rem .4rem; text-align: center; }
.role-x { background: #fed7d7; color: var(--x); }
.role-captain { background: #feebc8; color: #975a16; }
.role-play { background: #edf2f7; color: var(--muted); }

.pick-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: .55rem; grid-template-columns: minmax(0, 1fr) auto auto; padding: .55rem 0; }
.pick-row:last-child { border-bottom: 0; }
.role-button { background: #fff; border-color: var(--line); color: var(--muted); font-size: .8rem; min-width: 2.25rem; padding: .35rem .45rem; }
.role-button.active-x { background: #fed7d7; border-color: #fc8181; color: var(--x); }
.role-button.active-captain { background: #feebc8; border-color: #f6ad55; color: #975a16; }
.pick-summary { color: var(--muted); font-size: .9rem; }

.squad-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.squad-player { align-items: center; border-top: 1px solid var(--line); display: flex; gap: .55rem; padding: .55rem 0; }
.squad-player:first-child { border-top: 0; }
.squad-player .meta { color: var(--muted); font-size: .8rem; margin-left: auto; text-align: right; }

.admin-section { scroll-margin-top: 5rem; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { border-top: 1px solid var(--line); padding: .65rem 0; }
.admin-list li:first-child { border-top: 0; }
.round-admin-row { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; }
.round-admin-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.danger-text { color: var(--x); }

@media (max-width: 680px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .35rem; position: static; }
  .main-nav { justify-content: flex-start; width: 100%; }
  .main-nav a { flex: 1 0 auto; font-size: .88rem; text-align: center; }
  .page-header { flex-direction: column; }
  .grid-two { grid-template-columns: 1fr; }
  .lineup-table { display: block; overflow-x: auto; }
  .lineup-table th, .lineup-table td { white-space: nowrap; }
}
