/* ===== Player Jersey Registration ===== */
:root {
  --navy: #0b2a4a;
  --navy-2: #123d68;
  --gold: #f2a900;
  --gold-soft: #fff4d6;
  --ink: #16202b;
  --muted: #5d6b7a;
  --line: #dfe5ec;
  --bg: #f3f5f8;
  --card: #ffffff;
  --green: #138a4a;
  --green-soft: #e3f6ea;
  --red: #c0352b;
  --red-soft: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 42, 74, .06), 0 8px 24px rgba(11, 42, 74, .06);
  --head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--navy-2); }
code { background: var(--gold-soft); padding: 1px 5px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }

/* ----- Header / footer ----- */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 22px; letter-spacing: .5px; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--gold); color: var(--navy); font-weight: 800; }
.header-nav { display: flex; align-items: center; gap: 16px; }
.header-nav a, .link-btn { color: #fff; font-weight: 500; text-decoration: none; opacity: .9; }
.header-nav a:hover, .link-btn:hover { opacity: 1; text-decoration: underline; }
.link-btn { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.site-footer { padding: 20px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* ----- Hero ----- */
.hero { margin-bottom: 24px; }
.hero-tight { text-align: center; max-width: 460px; margin: 0 auto 20px; }
.eyebrow { margin: 0 0 4px; font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); font-size: 14px; }
h1, h2 { font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; line-height: 1.05; color: var(--navy); }
h1 { font-size: clamp(32px, 6vw, 48px); margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 10px; }
.lede { margin: 0; color: var(--muted); font-size: 16px; max-width: 560px; }
.hero-tight .lede { margin: 0 auto; }

/* ----- Cards & layout ----- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.narrow { max-width: 460px; margin: 0 auto; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

/* ----- Forms ----- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label, legend { font-weight: 600; font-size: 14px; color: var(--ink); padding: 0; display: flex; justify-content: space-between; }
.hint { font-weight: 500; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(18, 61, 104, .15); }
input.has-error { border-color: var(--red); }
.uppercase { text-transform: uppercase; letter-spacing: 1px; }
.field-error { margin: 0; color: var(--red); font-size: 13px; }
.fine { margin: 0; font-size: 13px; color: var(--muted); }

.size-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 6px; }
.size-chip { position: relative; display: block; }
.size-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.size-chip span {
  display: grid; place-items: center; height: 46px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--navy);
  cursor: pointer; transition: all .15s; background: #fff;
}
.size-chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--gold); }
.size-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(18, 61, 104, .25); }
.size-chip:hover span { border-color: var(--navy-2); }

.pin-input { text-align: center; font-family: var(--head); font-weight: 700; font-size: 34px !important; letter-spacing: 12px; padding: 10px 0 10px 12px !important; }
.timer { margin: -4px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy-2); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.resend-form { margin-top: 10px; }

/* ----- Alerts ----- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; margin-bottom: 4px; }
.alert-error { background: var(--red-soft); border-color: #f4c3be; color: #8c241c; }
.alert-success { background: var(--green-soft); border-color: #b8e5c8; color: #0e5f34; }

/* ----- Jersey preview ----- */
.preview { position: sticky; top: 20px; text-align: center; }
.jersey { position: relative; width: 100%; max-width: 260px; margin: 0 auto; }
.jersey-svg { width: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(11, 42, 74, .25)); }
.jersey-svg path:first-child { fill: var(--navy); }
.jersey-svg .collar { fill: none; stroke: var(--gold); stroke-width: 6; }
.jersey-svg .stripe { fill: var(--gold); }
.jersey-text { position: absolute; inset: 22% 18% 20%; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.jersey-name { font-family: var(--head); font-weight: 700; color: #fff; font-size: 20px; letter-spacing: 2px; text-transform: uppercase; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jersey-number { font-family: var(--head); font-weight: 800; color: var(--gold); font-size: 76px; line-height: 1; }
.preview-size { margin: 14px 0 0; color: var(--muted); }
.preview-size strong { color: var(--navy); font-family: var(--head); font-size: 20px; }

/* ----- Summary list ----- */
.summary { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 10px; }
.summary dt { color: var(--muted); font-size: 14px; }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.small-link { font-size: 13px; color: var(--muted); }

/* ----- Success ----- */
.success-card { text-align: center; }
.success-card .summary dl { text-align: left; }
.check { width: 72px; height: 72px; margin: 0 auto 14px; }
.check svg { width: 100%; height: 100%; }
.check circle { fill: var(--green-soft); stroke: var(--green); stroke-width: 2; }
.check path { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* ----- Badges ----- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border: 1.5px solid transparent; }
.badge-paid { background: var(--green-soft); color: var(--green); border-color: #b8e5c8; }
.badge-unpaid { background: var(--red-soft); color: var(--red); border-color: #f4c3be; }
.badge-btn { cursor: pointer; font-family: inherit; }
.badge-btn:hover { filter: brightness(.95); box-shadow: 0 0 0 3px rgba(18, 61, 104, .12); }

/* ----- Admin ----- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-left: 5px solid var(--navy); }
.stat-paid { border-left-color: var(--green); }
.stat-unpaid { border-left-color: var(--red); }
.stat-num { display: block; font-family: var(--head); font-weight: 800; font-size: 38px; line-height: 1; color: var(--navy); }
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.size-count { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.size-count.active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.size-tag { display: inline-block; min-width: 46px; text-align: center; padding: 2px 8px; background: var(--navy); color: var(--gold); border-radius: 999px; font-family: var(--head); font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filters input[type=search] { flex: 1 1 240px; }
.filters select { flex: 0 1 150px; }
.result-count { color: var(--muted); font-size: 13px; margin: 14px 2px 8px; }

.table-wrap { padding: 0; overflow-x: auto; }
table.players { width: 100%; border-collapse: collapse; font-size: 14px; }
.players th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
.players td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.players tbody tr:hover { background: #fafbfd; }
.players tbody tr:last-child td { border-bottom: 0; }
.players .empty { text-align: center; color: var(--muted); padding: 32px; }
.mono { font-family: var(--head); font-weight: 700; letter-spacing: 1px; font-size: 16px; }
.nowrap { white-space: nowrap; }
.email-cell { word-break: break-all; }
.inline-form { display: inline; margin: 0; }
.btn-delete { background: none; border: 0; color: var(--red); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.btn-delete:hover { background: var(--red-soft); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.pager a { min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: var(--ink); }
.pager a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ----- Responsive ----- */
@media (max-width: 820px) {
  .grid-form { grid-template-columns: 1fr; }
  .preview { position: static; order: -1; }
  .jersey { max-width: 180px; }
  .jersey-name { font-size: 15px; }
  .jersey-number { font-size: 54px; }
}
@media (max-width: 560px) {
  .card { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat-num { font-size: 28px; }
  .stat-label { font-size: 11px; }

  /* Table becomes stacked cards on phones */
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .players thead { display: none; }
  .players, .players tbody, .players tr, .players td { display: block; width: 100%; }
  .players tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 8px 4px; box-shadow: var(--shadow); }
  .players td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .players td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; text-align: left; }
  .players td.actions { justify-content: flex-end; }
  .players .empty { display: block; text-align: center; }
  .players .empty::before { content: none; }
}

/* ----- Jersey number ----- */
.field-row-jersey { grid-template-columns: 1fr 130px; }
.number-input { font-family: var(--head); font-weight: 700; font-size: 22px !important; text-align: center; letter-spacing: 2px; }
.taken { margin: 2px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.taken span { display: inline-block; min-width: 26px; padding: 1px 6px; text-align: center; border-radius: 6px; background: #eef1f5; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 14px; text-decoration: line-through; text-decoration-color: rgba(192, 53, 43, .6); }
.num-tag { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 8px; background: var(--gold-soft); color: var(--navy); font-family: var(--head); font-weight: 800; font-size: 17px; }
@media (max-width: 560px) { .field-row-jersey { grid-template-columns: 1fr 110px; } }

.jersey-number.three { font-size: 60px; letter-spacing: -1px; }
@media (max-width: 820px) { .jersey-number.three { font-size: 42px; } }
.field-row-jersey { grid-template-columns: 1fr 140px; }

/* ----- Mail test ----- */
.code-box { background: #0f1b2a; color: #e6edf5; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; margin: 8px 0 0; }
.code-box.small { font-size: 11.5px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.reason { max-width: 520px; }
.reason details { margin-top: 6px; }
.reason summary { cursor: pointer; font-size: 13px; color: var(--navy-2); }
@media (max-width: 560px) { .players td.reason { display: block; text-align: left; } .players td.reason::before { display: block; margin-bottom: 4px; } }
.number-input { max-width: 160px; }

/* ----- Captcha ----- */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-img { display: block; border-radius: 10px; border: 1.5px solid var(--line); max-width: 100%; height: auto; background: #fff7e0; }
.captcha-refresh { width: 46px; height: 46px; flex: none; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); font-size: 22px; cursor: pointer; }
.captcha-refresh:hover { border-color: var(--navy-2); }
.captcha-input { max-width: 220px; text-transform: uppercase; letter-spacing: 4px; font-family: var(--head); font-weight: 700; font-size: 22px !important; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.export-btns { display: flex; gap: 8px; flex-wrap: wrap; }
