/* ===== The Tryout Board — vintage-baseball theme ===== */
:root {
  --navy: #0c2340;
  --navy-2: #143157;
  --red: #c8102e;
  --red-dark: #9c0c23;
  --cream: #f7f3e9;
  --cream-2: #efe8d6;
  --ink: #1f2733;
  --muted: #6b7280;
  --line: #e2dcc9;
  --gold: #e8b54a;
  --shadow: 0 6px 18px rgba(12, 35, 64, 0.10);
  --shadow-lg: 0 14px 34px rgba(12, 35, 64, 0.18);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--red); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1040px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: #fff; text-decoration: none;
  font-weight: 800; font-size: 1.3rem; letter-spacing: 0.3px;
}
.brand-ball { font-size: 1.4rem; transition: transform 0.4s ease; }
.brand:hover .brand-ball { transform: rotate(180deg); }
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-nav a { color: var(--cream); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: #fff; }
.nav-cta {
  background: var(--red); color: #fff !important;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(200,16,46,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(200,16,46,0.5); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(900px 360px at 50% -120px, var(--navy-2), transparent),
    linear-gradient(160deg, var(--navy) 0%, #0a1d35 100%);
  color: #fff;
  overflow: hidden;
}
/* Self-hosted baseball-field graphic behind the headline, dimmed and
   topped with a gradient so the text stays crisp. */
.hero-field {
  position: absolute; inset: 0;
  background-size: cover; background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.6; pointer-events: none;
}
.hero-field::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(8,26,48,0.5) 0%, rgba(8,26,48,0.2) 38%, rgba(8,26,48,0.72) 100%);
}
/* baseball stitch lines */
.hero-stitch {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, transparent 0 28px, rgba(200,16,46,0.25) 28px 30px, transparent 30px 34px);
  opacity: 0.18; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 880px; margin: 0 auto;
  padding: 3.4rem 1.25rem 2.6rem; text-align: center;
  animation: heroRise 0.6s ease both;
}
@keyframes heroRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .hero-inner { animation: none; } }
.hero-kicker {
  margin: 0 0 0.5rem; letter-spacing: 2px; text-transform: uppercase;
  font-size: 0.78rem; font-weight: 700; color: var(--gold);
}
.hero-title {
  margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05;
  font-weight: 900; text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.hero-sub { margin: 0.8rem 0 0; color: #d6deeb; font-size: 1.05rem; }

.hero-stats {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.6rem; margin: 1.6rem 0 0; padding: 0;
}
.hero-stats li {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 0.55rem 1rem; min-width: 92px;
  backdrop-filter: blur(2px);
}
.stat-num { display: block; font-size: 1.5rem; font-weight: 900; color: var(--gold); }
.stat-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: #c7d0de; }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  margin: 1.8rem auto 0; max-width: 620px;
  background: rgba(255,255,255,0.96); padding: 0.7rem; border-radius: 999px;
  box-shadow: var(--shadow-lg);
}
.filters select {
  flex: 1 1 130px; min-width: 120px;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--cream); color: var(--ink);
  font-size: 0.95rem; cursor: pointer;
}
.filters select:focus { outline: 2px solid var(--red); border-color: var(--red); }
.filters button {
  background: var(--red); color: #fff; border: 0;
  padding: 0.6rem 1.3rem; border-radius: 999px; font-weight: 700; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.filters button:hover { background: var(--red-dark); transform: translateY(-1px); }
.filters-clear { align-self: center; color: var(--navy); font-weight: 600; text-decoration: none; padding: 0 0.5rem; }

/* ---------- Page / list ---------- */
.page { max-width: 1040px; margin: 2rem auto; padding: 0 1.25rem; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-title { margin: 0; color: var(--navy); font-size: 1.5rem; font-weight: 800; }
.result-count { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

.card-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;   /* one full-width club card per row, spreadsheet-style */
}

/* ---------- Card ---------- */
.card {
  position: relative; background: #fff;
  border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius); padding: 1.1rem 1.2rem 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: cardIn 0.45s ease both;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.badge-new {
  position: absolute; top: -10px; right: 14px;
  background: var(--gold); color: var(--navy);
  font-size: 0.7rem; font-weight: 900; letter-spacing: 1px;
  padding: 0.22rem 0.55rem; border-radius: 999px;
  box-shadow: 0 3px 9px rgba(232,181,74,0.6);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.card-top {
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.2rem;
}
.club-avatar {
  flex: 0 0 auto;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; font-weight: 900; font-size: 0.95rem; letter-spacing: 0.5px;
  border: 2px solid var(--red);
  box-shadow: 0 2px 6px rgba(12, 35, 64, 0.25);
}
.club-id { min-width: 0; }
.card-club {
  margin: 0; font-size: 1.42rem; font-weight: 900; color: var(--navy);
  letter-spacing: -0.2px; line-height: 1.1;
}
.card-home { margin: 0.1rem 0 0; font-size: 0.85rem; color: var(--muted); }
.card-home .ico { margin-right: 0.2rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.badge {
  font-size: 0.72rem; font-weight: 800; padding: 0.2rem 0.5rem;
  border-radius: 6px; letter-spacing: 0.3px;
}
.badge-age { background: var(--navy); color: #fff; }
.badge-level { background: var(--cream-2); color: var(--navy); border: 1px solid var(--line); }
.lvl-majors { background: var(--red); color: #fff; border-color: var(--red); }
.lvl-aaa { background: #1d4e89; color: #fff; }

.card-meta { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.card-meta li { margin: 0.3rem 0; font-size: 0.95rem; }
.card-meta .ico { display: inline-block; width: 1.4rem; }
.muted { color: var(--muted); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--line);
}
.countdown {
  font-size: 0.78rem; font-weight: 800; padding: 0.28rem 0.6rem;
  border-radius: 999px; background: var(--cream-2); color: var(--navy);
}
.countdown.soon { background: #fde7c8; color: #8a5a00; }
.countdown.today { background: var(--red); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
/* Always hug the right edge, even when there are no fees on the left. */
.contact-links { display: flex; gap: 0.4rem; margin-left: auto; }
.btn-mini {
  font-size: 0.82rem; font-weight: 700; text-decoration: none;
  color: var(--navy); background: var(--cream); border: 1px solid var(--line);
  padding: 0.32rem 0.6rem; border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-mini:hover { background: var(--navy); color: #fff; }
.card-notes { margin: 0.8rem 0 0; font-size: 0.9rem; color: var(--muted); font-style: italic; }

/* ---------- Empty state ---------- */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1rem;
  background: #fff; border: 2px dashed var(--line); border-radius: var(--radius);
}
.empty-ball { font-size: 3rem; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty h3 { margin: 0.6rem 0 0.2rem; color: var(--navy); }
.empty p { color: var(--muted); margin: 0 0 1.1rem; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block; background: var(--red); color: #fff; text-decoration: none;
  font-weight: 800; padding: 0.7rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
  box-shadow: 0 5px 14px rgba(200,16,46,0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn-block { width: 100%; font-size: 1.05rem; }

/* ---------- Forms (submit) ---------- */
.form-wrap { max-width: 620px; margin: 0 auto; }
/* Admin edit gets a wider, roomier box so everything is easy to read. */
.admin-edit-wrap { max-width: 880px; }
.admin-edit-wrap .styled-form { padding: 2rem 2.25rem; }
.admin-edit-wrap .styled-form label { margin: 1rem 0; font-size: 1.02rem; }
.admin-edit-wrap .session-block { padding: 1.25rem 1.4rem; }
.admin-edit-wrap textarea { min-height: 4.5rem; }
.form-head { text-align: center; margin-bottom: 1.4rem; }
.form-head h1 { color: var(--navy); margin: 0 0 0.3rem; }
.styled-form {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow);
}
.styled-form label { display: block; margin: 0.85rem 0; font-weight: 600; color: var(--navy); }
.styled-form input, .styled-form select, .styled-form textarea {
  width: 100%; padding: 0.6rem 0.7rem; margin-top: 0.3rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--cream);
  font: inherit; color: var(--ink);
}
.styled-form input:focus, .styled-form select:focus, .styled-form textarea:focus {
  outline: 2px solid var(--red); border-color: var(--red); background: #fff;
}
.form-row { display: flex; gap: 0.8rem; }
.form-row label { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0.9rem 0; padding: 0.8rem; }
legend { font-weight: 700; color: var(--navy); padding: 0 0.4rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { position: relative; margin: 0 !important; font-weight: 700; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--cream-2); border: 1px solid var(--line); color: var(--navy);
  font-size: 0.85rem; transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.chip input:checked + span { background: var(--red); color: #fff; border-color: var(--red); transform: translateY(-1px); }
.chip input:focus-visible + span { outline: 2px solid var(--navy); }
.form-foot { text-align: center; margin: 1rem 0 0; }
.form-foot a { color: var(--navy); font-weight: 600; text-decoration: none; }

.errors {
  background: #fdeaec; border: 1px solid #f3b6bf; color: var(--red-dark);
  border-radius: 10px; padding: 0.8rem 1rem 0.8rem 1.4rem; margin: 0 0 1.2rem; font-weight: 600;
}

/* ---------- Thanks ---------- */
.thanks {
  max-width: 520px; margin: 2rem auto; text-align: center;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius); padding: 2.4rem 1.5rem; box-shadow: var(--shadow);
}
.thanks-ball { font-size: 3.2rem; animation: spin 6s linear infinite; }
.thanks h1 { color: var(--navy); margin: 0.6rem 0 0.5rem; }
.thanks p { color: var(--muted); margin: 0 0 1.4rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: var(--navy); color: #c7d0de;
  text-align: center; padding: 2rem 1.25rem; border-top: 3px solid var(--red);
}
.footer-brand { display: inline-block; color: #fff; font-weight: 800; text-decoration: none; margin-bottom: 0.4rem; }
.site-footer a { color: var(--gold); }

/* ---------- Honeypot: hide from humans, bots still fill it ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .form-row { flex-direction: column; gap: 0; }
  .header-inner { padding: 0.6rem 1rem; }
  .brand-text { font-size: 1.1rem; }
}

/* ---------- Session blocks (forms) ---------- */
.sessions .session-block {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.9rem 1rem; margin-bottom: 0.8rem; background: var(--cream);
}
.chip-label { font-weight: 700; color: var(--navy); margin: 0.6rem 0 0.3rem; }
.date-rows { margin-bottom: 0.4rem; }
.date-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-bottom: 0.6rem;
}
.date-row .field { display: flex; flex-direction: column; }
.date-row .field-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin: 0 0 0.15rem 0.1rem;
}
.date-row .field-date { flex: 1 1 9rem; }
.date-row .field-time { flex: 1 1 8rem; }
.date-row input { width: 100%; min-width: 7rem; margin-top: 0; }
.date-row .remove-date {
  flex: 0 0 auto; align-self: flex-end; cursor: pointer;
  padding: 0.45rem 0.6rem;
}
.add-date { cursor: pointer; }
.block-foot { margin-top: 0.6rem; }
.remove-block { cursor: pointer; }
#add-session { margin-top: 0.25rem; cursor: pointer; }

/* ---------- Session table (public card) ---------- */
.session-table {
  width: 100%; border-collapse: collapse; margin: 0.9rem 0 0;
  font-size: 0.95rem; table-layout: fixed;
}
.session-table thead th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); font-weight: 700;
  padding: 0.45rem 0.75rem; border-bottom: 2px solid var(--navy);
  background: var(--cream);
}
.session-table td {
  padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.session-table tbody tr:hover td { background: var(--cream); }
.session-table tbody tr:last-child td { border-bottom: 0; }
/* Column widths for the spreadsheet look — Dates gets the most room so
   the expanded detail (date · time · countdown) doesn't wrap awkwardly. */
.session-table th:nth-child(1), .col-ages { width: 16%; }
.session-table th:nth-child(2), .col-level { width: 22%; }
.session-table th:nth-child(3), .col-town { width: 20%; }
.session-table th:nth-child(4), .col-dates { width: 42%; }
.col-ages { font-weight: 700; color: var(--navy); white-space: nowrap; }
.col-town { color: var(--ink); }
.col-level .badge { margin: 0 0.2rem 0.2rem 0; }
/* Inline "next tryout" hook so you see what's coming without expanding. */
.next-date {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.45rem;
  margin-bottom: 0.35rem;
}
.next-label {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: #fff; background: var(--navy);
  padding: 0.12rem 0.4rem; border-radius: 4px;
}
.next-when { font-weight: 700; color: var(--navy); }
.col-dates details { margin-top: 0.1rem; }
.col-dates details > summary {
  cursor: pointer; color: var(--red); font-weight: 600; white-space: nowrap;
  list-style: none; font-size: 0.85rem;
}
.col-dates details > summary:hover { text-decoration: underline; }
.col-dates details > summary::-webkit-details-marker { display: none; }
.col-dates details > summary::before { content: "▸ "; }
.col-dates details[open] > summary::before { content: "▾ "; }
.date-detail { margin: 0.4rem 0 0.1rem; }
.date-detail .loc { margin: 0 0 0.3rem; font-size: 0.85rem; }
.date-list { list-style: none; margin: 0; padding: 0; }
.date-line {
  margin: 0.3rem 0; font-size: 0.88rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem;
}
.date-line .countdown { white-space: nowrap; }
.card-foot .fees { font-weight: 700; color: var(--navy); }
