:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eef2f5;
  --text: #17212b;
  --muted: #5c6773;
  --border: #d7dde3;
  --brand: #0f5d44;
  --brand-dark: #093f30;
  --accent: #f2c14e;
  --focus: #1d70b8;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(20, 35, 50, 0.08);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select { font: inherit; }

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 999;
  background: #fff;
  color: #000;
  padding: .75rem 1rem;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand small { color: var(--muted); margin-top: .18rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.site-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
}
.site-nav a:hover { color: var(--brand); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem .65rem;
}

.hero {
  background:
    linear-gradient(135deg, rgba(15,93,68,.98), rgba(9,63,48,.93)),
    radial-gradient(circle at top right, rgba(242,193,78,.5), transparent 40%);
  color: #fff;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr .8fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  margin: .25rem 0 1.25rem;
}
.hero-copy {
  max-width: 62ch;
  font-size: clamp(1.08rem, 1rem + .4vw, 1.35rem);
  color: rgba(255,255,255,.86);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.eyebrow {
  margin: 0 0 .4rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 800;
}
.card {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.next-game { padding: clamp(1.4rem, 4vw, 2rem); }
.next-game h2 { margin: 0; font-size: 1.45rem; }
.next-game-teams { font-size: 1.08rem; }
.meta-list { margin: 1.25rem 0 0; }
.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
  border-top: 1px solid var(--border);
}
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 700; text-align: right; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .7rem 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.hero .button { background: var(--accent); color: #1f2a2a; }
.button:hover { filter: brightness(.95); }
.button-secondary {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.hero .button-secondary { color: #fff; background: transparent; }
.button-small { min-height: 38px; padding: .45rem .8rem; }

.section { padding: clamp(3.25rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--surface-alt); }
.section-accent { background: #e7f1ed; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section-heading h2, .admin-grid h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 0;
}
.section-note, .status { color: var(--muted); margin: 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
}
.metric-label { display: block; color: var(--muted); font-size: .9rem; font-weight: 700; }
.metric-value { display: block; font-size: 2rem; line-height: 1.15; margin-top: .2rem; }

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20,35,50,.04);
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
}
.data-table caption {
  text-align: left;
  padding: 1rem 1rem .75rem;
  color: var(--muted);
  font-size: .9rem;
}
.data-table th, .data-table td {
  padding: .9rem 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.data-table thead th {
  background: #f3f5f7;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.data-table tbody tr:hover { background: #fafbfc; }
.data-table th button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.team-name { font-weight: 800; }
.positive { color: #0a704f; font-weight: 800; }
.negative { color: #a4342a; font-weight: 800; }

.scores-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}
.score-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 1rem;
}
.score-card header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: var(--muted);
  font-size: .84rem;
  margin-bottom: .8rem;
}
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .55rem 0;
}
.score-row + .score-row { border-top: 1px solid var(--border); }
.score-team { font-weight: 800; }
.score-number { font-size: 1.35rem; font-weight: 900; }
.winner .score-team, .winner .score-number { color: var(--brand-dark); }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.fine-print { color: var(--muted); font-size: .92rem; }
.result-form { padding: 1.4rem; }
.form-field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.form-field label { font-weight: 800; }
.form-field input, .form-field select {
  width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid #aeb8c2;
  border-radius: 10px;
}
.score-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.result-form .button-secondary { color: var(--brand-dark); }
.form-status { min-height: 1.5em; margin: .75rem 0 0; font-weight: 700; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.story-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.story-featured {
  grid-column: 1 / -1;
  grid-template-columns: 1.15fr 1fr;
}
.story-image-link { display: block; min-height: 100%; }
.story-image-link img, .story-image-link picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-content { padding: clamp(1rem, 3vw, 1.6rem); }
.story-content h3 {
  margin: .2rem 0 .65rem;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1.18;
}
.story-content h3 a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story-kicker { color: var(--brand); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; margin: 0; }
.story-meta { color: var(--muted); font-size: .88rem; }
.text-link { font-weight: 800; color: var(--brand-dark); }

.site-footer {
  background: #12221c;
  color: rgba(255,255,255,.88);
  padding: 2.5rem 0;
}
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; }
.site-footer p { color: rgba(255,255,255,.65); margin-bottom: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; align-content: start; }
.site-footer a { color: #fff; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .hero-grid, .admin-grid { grid-template-columns: 1fr; }
  .scores-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .story-card, .story-featured { grid-template-columns: 1fr; }
  .story-image-link { aspect-ratio: 16 / 9; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    inset: 74px 0 auto;
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.is-open { display: flex; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container { width: min(calc(100% - 1.2rem), var(--max-width)); }
  .section-heading { display: block; }
  .section-note, .status, .section-heading .text-link { display: inline-block; margin-top: .7rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .scores-grid { grid-template-columns: 1fr; }
  .score-entry-grid { grid-template-columns: 1fr; }
  .footer-grid { display: block; }
  .site-footer nav { margin-top: 1.25rem; }

  /* Responsive table behavior:
     Keep the real semantic table intact for screen readers.
     Horizontal scrolling avoids breaking table semantics on small screens. */
  .table-wrap {
    margin-inline: -.6rem;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .data-table th, .data-table td { padding: .8rem .75rem; }
}


.playoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.playoff-column {
  display: grid;
  gap: .75rem;
  align-content: start;
}
.playoff-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  min-height: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.playoff-date {
  display: grid;
  place-items: center;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 900;
  font-size: 1.08rem;
}
.playoff-card > div:last-child {
  padding: .8rem 1rem;
}
.playoff-game {
  margin: 0 0 .12rem;
  color: var(--brand);
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.playoff-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}
.elim {
  color: #9a2d25;
  white-space: nowrap;
}
.round-note {
  color: var(--muted);
  font-weight: 700;
}
.playoff-championship {
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(15, 93, 68, .08);
}

@media (max-width: 800px) {
  .playoff-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .playoff-card { grid-template-columns: 66px 1fr; }
}

.playoff-admin{margin-top:1.5rem;padding:1.4rem;display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}.playoff-admin h3{margin:.1rem 0 .5rem;font-size:1.4rem}.final-score{display:block;margin-top:.3rem;font-size:.9rem;color:var(--muted);font-weight:700}@media(max-width:760px){.playoff-admin{grid-template-columns:1fr}}


/* --- Red Hook league visual refresh --- */
:root {
  --brand: #b31217;
  --brand-dark: #7f0d12;
  --accent: #d71920;
  --surface-alt: #f8f1f1;
}

.brand {
  gap: 1rem;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  display: block;
  font-size: clamp(1.25rem, 1.2rem + .7vw, 2rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--brand-dark);
}

.brand-subtitle {
  display: block;
  margin-top: .18rem;
  font-size: clamp(.9rem, .86rem + .25vw, 1.08rem);
  line-height: 1.05;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.header-inner {
  min-height: 92px;
}

.site-header {
  border-bottom: 3px solid var(--brand);
}

.hero {
  background:
    linear-gradient(135deg, rgba(179,18,23,.98), rgba(127,13,18,.95)),
    radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 42%);
}

.button {
  background: var(--brand);
}

.hero .button {
  background: #fff;
  color: var(--brand-dark);
}

.hero .button-secondary {
  color: #fff;
  border-color: #fff;
}

.story-kicker,
.playoff-game,
.text-link {
  color: var(--brand);
}

.positive {
  color: var(--brand-dark);
}

.section-accent {
  background: #f9eaea;
}

.playoff-date {
  background: var(--brand-dark);
}

.site-footer {
  background: var(--brand-dark);
}

@media (max-width: 900px) {
  .site-nav {
    inset: 92px 0 auto;
  }
  .brand-logo {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }
  .header-inner {
    min-height: 78px;
  }
  .site-nav {
    inset: 78px 0 auto;
  }
}


/* --- Teams page --- */
.teams-hero {
  padding: clamp(3rem, 7vw, 5rem) 0 2.5rem;
  background: linear-gradient(135deg, #b31217, #7f0d12);
  color: #fff;
}
.teams-hero h1 {
  margin: .15rem 0 .65rem;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.teams-hero p:last-child {
  max-width: 62ch;
  margin-bottom: 0;
  color: rgba(255,255,255,.88);
}
.teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.team-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(20,35,50,.04);
}
.team-seed {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
}
.team-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}
.team-record {
  margin: .25rem 0 .85rem;
  color: var(--muted);
  font-weight: 700;
}
.team-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin: 0;
}
.team-stats div {
  border-top: 1px solid var(--border);
  padding-top: .55rem;
}
.team-stats dt {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.team-stats dd {
  margin: .15rem 0 0;
  font-weight: 900;
}
.site-nav a[aria-current="page"] {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}
@media (max-width: 900px) {
  .teams-page-nav { position: static; display: flex; flex-wrap: wrap; padding: 0; border: 0; }
}
@media (max-width: 760px) {
  .teams-grid { grid-template-columns: 1fr; }
  .team-stats { grid-template-columns: repeat(2, 1fr); }
}


/* Game notes */
.result-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: .75rem;
  border: 1px solid #aeb8c2;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.optional,.field-help { color: var(--muted); font-weight: 500; }
.field-help { font-size: .82rem; }
.game-note {
  margin: .65rem 0 0;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

/* Chat */
.chat-shell { display:grid; grid-template-columns: minmax(0,1fr) 320px; gap:1.25rem; align-items:start; }
.chat-panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.chat-status { padding:.9rem 1rem; background:#fff4f4; border-bottom:1px solid #efc7c9; color:var(--brand-dark); font-weight:700; }
.chat-messages { min-height:420px; max-height:58vh; overflow-y:auto; padding:1rem; display:grid; gap:.75rem; align-content:start; background:#fbfbfc; }
.chat-message { max-width:82%; padding:.7rem .85rem; border-radius:14px; background:#fff; border:1px solid var(--border); }
.chat-message strong { display:block; color:var(--brand-dark); margin-bottom:.2rem; }
.chat-message time { display:block; color:var(--muted); font-size:.75rem; margin-top:.3rem; }
.chat-compose { padding:1rem; border-top:1px solid var(--border); display:grid; gap:.75rem; }
.chat-compose textarea { width:100%; min-height:90px; resize:vertical; padding:.75rem; border:1px solid #aeb8c2; border-radius:10px; font:inherit; }
.chat-help { padding:1.2rem; }
.chat-help h2 { margin-top:0; }
@media(max-width:800px){.chat-shell{grid-template-columns:1fr}.chat-messages{min-height:340px}}

/* FAQ */
.faq-list{max-width:900px;margin:1.5rem auto 0;display:grid;gap:.75rem}
.faq-item{background:#fff;border:1px solid #e3e6e8;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.faq-item summary{cursor:pointer;list-style:none;padding:1rem 1.2rem;font-weight:800;color:var(--ink);position:relative;padding-right:3rem}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary::after{content:"+";position:absolute;right:1.2rem;top:50%;transform:translateY(-50%);font-size:1.35rem;color:var(--brand)}
.faq-item[open] summary::after{content:"−"}
.faq-answer{padding:0 1.2rem 1.1rem;color:var(--muted);line-height:1.65}
.faq-answer p{margin:0}
