/* NSA Florida Fastpitch — mobile first. Every rule below the base applies
   upward from a phone, because that is where this site is actually read. */

:root {
  --red: #b0121a;
  --red-dark: #8c0e15;
  --navy: #10233f;
  --navy-soft: #273c5c;
  --ink: #16202b;
  --body: #3f4e5e;
  --muted: #6c7c8c;
  --line: #d9e0e7;
  --line-soft: #eaeff3;
  --ground: #f4f6f9;
  --surface: #fff;
  --gold: #9a6b00;
  --gold-bg: #fdf4de;
  --green: #1d6b4c;
  --green-bg: #e6f4ed;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 4px 14px rgba(22, 32, 43, .07);
  --wrap: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--body);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--red); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
main { padding: 24px 0 56px; }
.skip {
  position: absolute; left: -9999px; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
header.site { background: var(--navy); color: #fff; }
.bar {
  max-width: var(--wrap); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.mark {
  background: var(--red); color: #fff; font-weight: 800; letter-spacing: .06em;
  padding: 5px 9px; border-radius: 6px; font-size: .95rem;
}
.word { font-weight: 650; letter-spacing: -.01em; font-size: 1.02rem; }
.menu {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 7px; padding: 9px 14px; font: inherit; font-size: .9rem; cursor: pointer;
  min-height: 44px;
}
.nav { display: none; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .15); }
body.nav-open .nav { display: flex; }
.nav a {
  color: #fff; text-decoration: none; padding: 14px 16px; font-weight: 550;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  max-width: var(--wrap); width: 100%; margin: 0 auto;
}
.nav a[aria-current="page"] { color: #ffd9db; box-shadow: inset 3px 0 0 var(--red); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff; padding: 36px 0 32px;
}
.hero h1 { color: #fff; font-size: 1.9rem; }
.hero .eyebrow {
  text-transform: uppercase; letter-spacing: .13em; font-size: .72rem;
  font-weight: 700; color: #ffb3b7; margin: 0 0 .6em;
}
.hero-body { color: #dde5ef; }
.hero-body a { color: #fff; }
.hero-body ul { padding-left: 1.1em; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.btn {
  display: inline-block; background: var(--red); color: #fff; text-decoration: none;
  font-weight: 650; padding: 13px 20px; border-radius: 8px; min-height: 44px;
  border: 2px solid var(--red);
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .55); }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- sections ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.sec-head h2 { margin: 0; }
.more { font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.lede { font-size: 1.05rem; max-width: 62ch; }
.count { color: var(--muted); font-size: .88rem; margin: -.3em 0 1em; }
.empty {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 20px; color: var(--muted); text-align: center;
}
.crumb { font-size: .9rem; margin-bottom: .6em; }
.crumb a { text-decoration: none; font-weight: 600; }

/* ---------- tournament cards ---------- */
.cards { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-link { display: block; padding: 16px; color: inherit; text-decoration: none; }
.card-link:hover h3 { color: var(--red); }
.card h3 { margin: 0 0 12px; font-size: 1.02rem; }
.card-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.card-head:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; background: var(--line-soft); color: var(--muted);
}
.chip.now { background: #fde9ea; color: var(--red); }
.chip.warn { background: var(--gold-bg); color: var(--gold); }
.chip.done { background: var(--green-bg); color: var(--green); }

.meta, .facts { margin: 0; display: grid; gap: 7px; }
.meta > div, .facts > div { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: baseline; }
.meta dt, .facts dt {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700;
}
.meta dd, .facts dd { margin: 0; font-size: .93rem; color: var(--ink); }
.facts {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; gap: 12px; margin-bottom: 24px;
}
.facts > div { grid-template-columns: 72px 1fr; }
.facts dd { font-size: 1rem; }

/* ---------- results ---------- */
.results { margin: 0 0 28px; }
.division { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.division h3 { margin: 0 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.placings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.placings li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.pos { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.place-1 .pos { color: var(--gold); }
.place-2 .pos { color: var(--navy-soft); }
.team { color: var(--ink); font-weight: 600; }
.place-1 .team { font-size: 1.05rem; }
.note { grid-column: 2; font-size: .82rem; color: var(--muted); }

/* ---------- notes + downloads ---------- */
.notes { margin-bottom: 28px; }
.notes ul { padding-left: 1.15em; }
.notes li { margin-bottom: .4em; }
.downloads { margin-bottom: 24px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.files a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 600;
  min-height: 44px;
}
.files a:hover { border-color: var(--red); color: var(--red); }
.fmeta { font-size: .74rem; color: var(--muted); font-weight: 700; letter-spacing: .05em; white-space: nowrap; }

.prevnext { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .88rem; }
.prevnext a { text-decoration: none; font-weight: 600; }

/* ---------- footer ---------- */
footer.site { background: var(--navy); color: #c3d0e0; padding: 32px 0 20px; margin-top: 40px; }
footer.site .cols { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; display: grid; gap: 22px; }
footer.site h2 { color: #fff; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .7em; }
footer.site p { font-size: .9rem; margin: 0; }
footer.site a { color: #fff; }
.fine { max-width: var(--wrap); margin: 26px auto 0; padding: 16px 16px 0; border-top: 1px solid rgba(255, 255, 255, .13); font-size: .8rem; color: #8ea2bb; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  footer.site .cols { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .menu { display: none; }
  .nav { display: flex; flex-direction: row; border-top: none; justify-content: center; background: rgba(0,0,0,.18); }
  .nav a { width: auto; border-bottom: none; padding: 13px 16px; font-size: .94rem; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); color: #fff; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  footer.site .cols { grid-template-columns: repeat(4, 1fr); }
  main { padding: 32px 0 72px; }
}

/* ---------- admin ---------- */
body.admin { background: #eef1f5; }
.adminbar { background: var(--ink); color: #fff; padding: 10px 16px; font-size: .9rem; }
.adminbar .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.adminbar a { color: #fff; text-decoration: none; font-weight: 600; }
.adminbar .spacer { margin-left: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); min-height: 46px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field .hint { font-size: .8rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.row2 { display: grid; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
button.btn, input[type="submit"] { font: inherit; cursor: pointer; }
.btn.small { padding: 9px 14px; font-size: .88rem; min-height: 40px; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--line); }
.btn.danger:hover { background: #fde9ea; border-color: var(--red); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.bad { background: #fde9ea; color: var(--red); }
.adminlist { display: grid; gap: 8px; }
.adminrow {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; display: grid; gap: 4px;
}
.adminrow .top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.adminrow a { text-decoration: none; font-weight: 650; color: var(--ink); }
.adminrow a:hover { color: var(--red); }
.adminrow .sub { font-size: .84rem; color: var(--muted); }
.divrow { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.divrow .dname { font-weight: 700; font-size: .85rem; color: var(--muted); }
.divrow input { min-height: 44px; }
@media (min-width: 700px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .divrow { grid-template-columns: 76px 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
