/*
  "For God so loved the world, that he gave his only begotten Son,
  that whosoever believeth in him should not perish, but have
  everlasting life." — John 3:16 (KJV)
*/

/* ===== Design tokens ===== */
:root {
  --ink-900: #0e1a13;      /* deep pitch-night */
  --ink-800: #142418;
  --ink-700: #1b3020;
  --ink-600: #26402c;
  --line: #3a5940;
  --chalk: #f2efe6;        /* line-marking white */
  --chalk-dim: #b9c2b6;
  --turf: #4f8f5c;         /* mid turf green */
  --turf-bright: #7fd18f;
  --amber: #e3a13d;        /* scout highlighter */
  --amber-dim: #7a5a2c;
  --red: #d9695a;
  --side-b: #7cc4e8;       /* the other bib — scrimmage side B */
  --side-b-dim: #2f5a70;

  /* Tell the browser this is a dark UI so it paints its OWN controls to match.
     Without this, native widgets keep their light-mode styling and their
     glyphs render near-black on our dark panels — the number-input spinner
     arrows beside every rating, and the 1-10 dropdown's chevron, were both
     effectively invisible. This also fixes select popups, scrollbars, and
     date/color pickers in one go, rather than patching each arrow by hand. */
  color-scheme: dark;

  /* Full fallback chains, not just a generic sans-serif/monospace —
     if the Google Fonts CDN is unreachable (offline, blocked, weak
     signal pitch-side), the app still renders in a clean native font
     for whatever OS it's running on, instead of the browser default. */
  --display: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-900);
  color: var(--chalk);
  font-family: var(--body);
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(79,143,92,0.14), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 20%, rgba(227,161,61,0.06), transparent 55%);
}

button { font-family: var(--body); cursor: pointer; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.topbar__mark { display: flex; align-items: baseline; gap: 12px; }

.topbar__num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.04em;
}

.topbar__wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.03em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

/* The wordmark doubles as a "home" link back to the landing page
   (../) from the /coach/ and /player/ tools. */
a.topbar__wordmark:hover { color: var(--turf-bright); }
a.topbar__wordmark:hover .topbar__sub { color: var(--turf-bright); }
a.topbar__wordmark:focus-visible {
  outline: 2px solid var(--turf-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

.topbar__sub {
  font-family: var(--body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}

/* ===== Mode selector (topbar) — Team Coach vs My Player ===== */
.mode-select { display: flex; gap: 6px; flex-wrap: wrap; }

.mode-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}

.mode-btn:hover { border-color: var(--chalk-dim); color: var(--chalk); }

.mode-btn--active {
  background: var(--chalk);
  border-color: var(--chalk);
  color: var(--ink-900);
  font-weight: 600;
}

/* ===== Sport selector (topbar) ===== */
.sport-select { display: flex; gap: 6px; flex-wrap: wrap; }

.sport-btn {
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--chalk-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}

.sport-btn:hover { border-color: var(--amber); color: var(--chalk); }

.sport-btn--active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink-900);
  font-weight: 600;
}

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; }

/* A class selector's `display` beats the plain [hidden] attribute, so these
   flex containers stayed visible even when code set `.hidden = true`
   (e.g. the team tabs on the My Player-only /player/ page). Restore the
   intended hide behavior with an attribute-qualified rule. */
.tabs[hidden],
.mode-select[hidden],
.sport-select[hidden] { display: none; }

.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}

.tab:hover { border-color: var(--turf-bright); color: var(--chalk); }

.tab--active {
  background: var(--turf);
  border-color: var(--turf);
  color: var(--ink-900);
  font-weight: 600;
}

/* ===== Views ===== */
.view { display: none; }
.view--active { display: grid; }

#view-roster.view--active { grid-template-columns: 1fr; }
#view-live.view--active { grid-template-columns: 1fr; }

/* Formation: two columns on wide screens — the setup controls and the
   position-assignment list stack down the left, the pitch holds the right
   and stays put (sticky) while the slot list scrolls. The three panels are
   ordered setup → pitch → slots in the DOM so that when this collapses to a
   single column on a phone, the pitch lands directly under the formation
   controls and above the long slot list, instead of being buried at the
   very bottom. */
#view-formation.view--active {
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-areas:
    "setup pitch"
    "slots pitch";
}
.panel--formation-setup { grid-area: setup; align-self: start; }
.panel--formation-slots { grid-area: slots; align-self: start; }
.panel--pitch          { grid-area: pitch; }

.layout {
  display: block;
  min-height: calc(100vh - 130px);
  background: var(--line);
}

#view-roster.view--active,
#view-formation.view--active,
#view-live.view--active {
  gap: 1px;
}

@media (max-width: 900px) {
  #view-roster.view--active { grid-template-columns: 1fr; }
  #view-formation.view--active {
    grid-template-columns: 1fr;
    grid-template-areas:
      "setup"
      "pitch"
      "slots";
  }
  /* One column now, so pinning the pitch would just crowd the slot list
     below it — let it scroll normally. */
  .pitch-wrap { position: static; }
}

.panel { background: var(--ink-900); padding: clamp(18px, 3vw, 32px); }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.panel__head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  margin: 0;
}

.panel__intro { color: var(--chalk-dim); font-size: 13px; max-width: 56ch; margin: 0 0 18px; }

.count { font-family: var(--mono); font-size: 12px; color: var(--chalk-dim); }

.roster-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn--ghost {
  width: auto;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--chalk-dim);
}

.btn--ghost:hover { color: var(--chalk); border-color: var(--turf-bright); }

.btn--ghost-danger { color: var(--red); }
.btn--ghost-danger:hover { color: var(--red); border-color: var(--red); }

/* ===== Roster list (compact, phone-friendly) ===== */
.roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-800);
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.roster-item:hover,
.roster-item:focus-visible { border-color: var(--turf-bright); outline: none; }

.roster-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.roster-item__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-item__meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--chalk-dim);
}

/* Amber only when the coach has explicitly placed them somewhere (their
   "current" position); a plain best-fit fallback stays dim. */
.roster-item__meta--current { color: var(--amber); }

/* Secondary line under the played position: their natural best fit, so a
   role/skill mismatch is visible without opening the player. */
.roster-item__note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--chalk-dim);
}

.roster-item__scorewrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.roster-item__score {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  color: var(--turf-bright);
  line-height: 1;
}

.roster-item__score small { font-size: 11px; color: var(--chalk-dim); font-weight: 400; }

.roster-item__scorelabel {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chalk-dim);
}

.roster-item__dots {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--chalk);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.roster-item__dots:hover { border-color: var(--turf-bright); color: var(--turf-bright); }

.roster-empty {
  list-style: none;
  padding: 20px;
  text-align: center;
  color: var(--chalk-dim);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* ===== Roster table (spreadsheet-style entry) ===== */
.panel--table { overflow: hidden; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

.roster-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1180px;
  font-size: 13px;
}

.roster-table thead th {
  background: var(--ink-800);
  color: var(--chalk-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10.5px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--ink-700);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.roster-table thead tr.group-row th {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--turf-bright);
  text-align: center;
  top: 0;
}

.roster-table thead tr.cat-row-head th {
  top: 29px;
}

.roster-table th.col-name,
.roster-table td.col-name {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--ink-800);
  text-align: left;
  min-width: 170px;
  border-right: 1px solid var(--line);
}

.roster-table td.col-name { z-index: 1; background: var(--ink-900); }

.roster-table tbody tr:nth-child(even) td.col-name { background: var(--ink-800); }

.roster-table td.col-name {
  display: flex;
  align-items: center;
  gap: 4px;
}

.roster-table .col-name-input {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 6px;
  flex: 1;
  min-width: 0;
}

.roster-table .col-name-input:hover { border-color: var(--line); }

.roster-table .col-name-input:focus-visible {
  outline: none;
  border-color: var(--turf-bright);
  background: var(--ink-800);
}

.roster-table .col-name-detail {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--chalk-dim);
  font-size: 15px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
}

.roster-table .col-name-detail:hover {
  color: var(--turf-bright);
  background: var(--ink-700);
}

.roster-table td {
  border-right: 1px solid var(--ink-700);
  border-bottom: 1px solid var(--ink-700);
  padding: 4px;
  text-align: center;
}

.roster-table td.col-bestfit,
.roster-table td.col-backup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.roster-table td.col-bestfit { color: var(--amber); }
.roster-table td.col-backup { color: var(--turf-bright); }

.roster-table td.col-score {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--chalk-dim);
}

.roster-table td.col-remove button {
  background: none;
  border: none;
  color: var(--chalk-dim);
  cursor: pointer;
  font-size: 13px;
}

.roster-table td.col-remove button:hover { color: var(--red); }

.roster-table input[type="number"] {
  width: 40px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  padding: 5px 2px;
}

.roster-table input[type="number"]:focus-visible {
  outline: 2px solid var(--turf-bright);
  outline-offset: 1px;
  border-color: var(--turf-bright);
}

.roster-table input[type="number"]::-webkit-inner-spin-button,
.roster-table input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.6;
}

.table-empty-row td {
  text-align: left;
  color: var(--chalk-dim);
  padding: 16px 10px;
}

/* ===== Modal (player detail / sliders) ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 8, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px;
  z-index: 50;
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px clamp(18px, 3vw, 32px);
  width: 100%;
  max-width: 640px;
}

.modal--wide { max-width: 760px; }

.modal__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.01em;
  margin: 2px 0 0;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.btn--icon {
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.btn--icon:hover { color: var(--chalk); border-color: var(--turf-bright); }

/* The base .btn rule (below) sets width:100%; because it's declared after
   .btn--icon with equal specificity, it would stretch icon buttons that
   also carry .btn (every modal's ✕ close button) to fill their row. Pin
   them back to a compact square and keep them from flex-growing. */
.btn.btn--icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
}

.btn {
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--chalk);
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13px;
  width: 100%;
}

.btn:hover { border-color: var(--turf-bright); }

.btn--add { color: var(--turf-bright); border-color: var(--turf); }

.btn--danger {
  width: auto;
  color: var(--red);
  border-color: var(--amber-dim);
  font-size: 12px;
  padding: 7px 12px;
}

.btn--danger:hover { border-color: var(--red); }

.btn--primary {
  width: 100%;
  background: var(--turf);
  border-color: var(--turf);
  color: var(--ink-900);
  font-weight: 600;
  margin-bottom: 18px;
}

.btn--primary:hover { background: var(--turf-bright); border-color: var(--turf-bright); }

/* ===== Form header row ===== */
.panel__head--form { justify-content: space-between; }

.field--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chalk-dim);
}

.field--inline input {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 14px;
  min-width: 180px;
}

.field--inline input:focus-visible { outline: 2px solid var(--turf-bright); outline-offset: 1px; }

/* ===== Best fit strip ===== */
/* ===== Player profile fields (handedness, age, parent contact) ===== */
.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-fields .import-field { margin-bottom: 0; }

.best-fit-strip {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.best-fit-strip__pos {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}

.best-fit-strip__score { font-family: var(--mono); font-size: 15px; color: var(--turf-bright); margin-left: auto; }
.best-fit-strip__score small { color: var(--chalk-dim); font-size: 11px; }

.best-fit-strip--backup {
  margin-top: -14px;
  padding: 9px 16px;
  background: transparent;
}

.best-fit-strip--backup .best-fit-strip__pos {
  font-size: 16px;
  color: var(--chalk-dim);
}

.best-fit-strip--backup .best-fit-strip__score {
  font-size: 13px;
  color: var(--chalk-dim);
}

/* Current (played) position — the coach's manual pick. Amber accent sets it
   apart from the green best-fit strip: "where they play" vs "where they fit". */
.pos-current {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 12px;
  background: var(--ink-800);
  border: 1px solid var(--amber-dim);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.pos-current .eyebrow { grid-column: 1; }

.pos-current__select {
  grid-column: 2;
  justify-self: end;
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--chalk);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: var(--body);
  min-width: 160px;
  max-width: 100%;
}

.pos-current__value {
  grid-column: 2;
  justify-self: end;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--amber);
}

.pos-current__hint {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--chalk-dim);
}

/* Suggested training — plain-language "work on X, Y, Z" lines: one for the
   current position, one for the gap to their best fit. */
.training-tips {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.training-tips .eyebrow { display: block; margin-bottom: 6px; }
.training-tips__body { display: flex; flex-direction: column; gap: 6px; }

.training-tips__line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--chalk);
}

.training-tips__line strong { color: var(--amber); font-weight: 600; }
.training-tips__line--best { color: var(--chalk-dim); }
.training-tips__line--best strong { color: var(--turf-bright); }

.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--chalk-dim); }

/* ===== Category groups / sliders ===== */
.cat-group { margin-bottom: 26px; }

.cat-group__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.cat-group__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cat-row {
  display: grid;
  grid-template-columns: 150px 1fr 34px;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.cat-row label { font-size: 13px; color: var(--chalk); }

.cat-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-700);
  outline: none;
}

.cat-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--turf-bright);
  border: 2px solid var(--ink-900);
  cursor: pointer;
  margin-top: -6px;
}

.cat-row input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--turf-bright);
  border: 2px solid var(--ink-900);
  cursor: pointer;
}

.cat-row__value { font-family: var(--mono); font-size: 13px; color: var(--amber); text-align: right; }

/* ===== Formation controls ===== */
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chalk-dim);
  margin: 0 0 8px;
}

.formation-select { display: flex; gap: 8px; margin-bottom: 18px; }

.formation-select--level .formation-btn {
  line-height: 1.5;
}

.formation-btn {
  flex: 1;
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  padding: 10px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 13px;
}

.formation-btn small {
  display: block;
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: inherit;
  opacity: 0.75;
}

.formation-btn:hover { border-color: var(--turf-bright); }

.formation-btn--active {
  border-color: var(--turf-bright);
  color: var(--chalk);
  background: linear-gradient(90deg, rgba(127,209,143,0.14), transparent);
}

.team-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.team-score__val {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--turf-bright);
  margin-left: auto;
}

.warning-note {
  color: var(--red);
  font-size: 12px;
  background: rgba(217,105,90,0.1);
  border: 1px solid rgba(217,105,90,0.4);
  border-radius: 7px;
  padding: 8px 12px;
  margin: 0 0 14px;
}

/* ===== Slot list ===== */
.slot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.slot-list li {
  display: grid;
  grid-template-columns: 62px 1fr 90px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--ink-800);
  border: 1px solid var(--line);
}

.slot-list li.duplicate { border-color: var(--red); }

.slot-tag-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.slot-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  text-align: center;
  border: 1px solid var(--amber-dim);
  border-radius: 5px;
  padding: 3px 6px;
}

.slot-list select {
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--chalk);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--body);
  width: 100%;
}

.slot-score { font-family: var(--mono); font-size: 13px; color: var(--chalk-dim); text-align: right; }

/* ===== Pitch diagram ===== */
.pitch-wrap { position: sticky; top: 18px; }

#pitch { width: 100%; height: auto; display: block; }

.pitch-marker circle { transition: r 0.2s ease, opacity 0.2s ease; }

.pitch-marker text {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--ink-900);
  text-anchor: middle;
  font-weight: 700;
}

.pitch-marker .p-name {
  font-family: var(--body);
  font-size: 11px;
  fill: var(--chalk);
  font-weight: 600;
}

.pitch-marker--empty circle { fill: none; stroke: var(--line); stroke-width: 1.5; }
.pitch-marker--empty text { fill: var(--chalk-dim); }

/* ===== Info icons + popover (category definitions) ===== */
.th-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cat-row__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--chalk-dim);
  color: var(--chalk-dim);
  font-family: var(--body);
  font-size: 9px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: none;
}

.info-icon:hover,
.info-icon:focus-visible {
  color: var(--turf-bright);
  border-color: var(--turf-bright);
  outline: none;
}

.info-popover {
  position: fixed;
  z-index: 200;
  width: 210px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.info-popover[hidden] { display: none; }

.info-popover strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  margin-bottom: 4px;
}

.info-popover p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--chalk-dim);
}

/* ===== Match Log (Live tab) ===== */
.matchlog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

/* Size each action button to its own label and sit them left-aligned,
   rather than letting the base .btn width:100% stretch them into three
   equal columns. (On phones the media query stacks them full-width.) */
.matchlog-actions .btn { width: auto; margin: 0; }

.matchlog-note {
  color: var(--chalk-dim);
  font-size: 12px;
  max-width: 60ch;
  margin: 0 0 20px;
}

.matchlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matchlog-empty {
  color: var(--chalk-dim);
  font-size: 13px;
  padding: 14px 2px;
}

.matchlog-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 9px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.matchlog-card:hover { border-color: var(--turf-bright); }

.matchlog-card__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.matchlog-card__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--chalk-dim);
  margin-top: 2px;
}

.matchlog-card__badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  white-space: nowrap;
}

.matchlog-card__badge--done {
  border-color: var(--turf);
  color: var(--turf-bright);
}

/* ===== Match review modal ===== */
.review-player {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.review-player__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.review-player__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
}

.review-row {
  display: grid;
  grid-template-columns: 20px 130px 60px auto 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--ink-700);
}

.review-row:first-of-type { border-top: none; }

.review-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--turf-bright);
}

.review-row__label { font-size: 13px; }

.review-row__current {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--chalk-dim);
  text-align: center;
}

.review-row__notes {
  font-size: 11px;
  color: var(--chalk-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-row__value {
  width: 56px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  padding: 5px 2px;
}

.review-player__empty {
  color: var(--chalk-dim);
  font-size: 13px;
  padding: 6px 0 12px;
}

/* ===== Import Stats modal ===== */
.import-step-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.import-field {
  margin-bottom: 16px;
}

.import-field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chalk-dim);
  margin-bottom: 6px;
}

.import-field input[type="text"],
.import-field input[type="date"],
.import-field input[type="number"],
.import-field input[type="email"],
.import-field input[type="tel"],
.import-field select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 14px;
}

.import-dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--chalk-dim);
  font-size: 13px;
  margin-bottom: 16px;
  cursor: pointer;
}

.import-dropzone:hover { border-color: var(--turf-bright); color: var(--chalk); }

.import-dropzone strong { color: var(--turf-bright); }

.import-mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 20px;
}

.import-mapping-row label {
  display: block;
  font-size: 12px;
  color: var(--chalk-dim);
  margin-bottom: 4px;
}

.import-mapping-row select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 13px;
}

.import-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.import-actions .btn { width: auto; margin: 0; }

.import-preview-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
}

.import-preview-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 12px;
}

.import-preview-table th {
  background: var(--ink-800);
  color: var(--chalk-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.import-preview-table td {
  padding: 6px;
  border-bottom: 1px solid var(--ink-700);
  white-space: nowrap;
}

.import-preview-table select {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--chalk);
  font-size: 12px;
  padding: 4px 6px;
}

.import-preview-table .val-suggested {
  font-family: var(--mono);
  color: var(--amber);
  text-align: center;
}

.import-note {
  color: var(--chalk-dim);
  font-size: 12px;
  margin: 0 0 16px;
}

/* ===== Modal head with extra actions (e.g. export button) ===== */
.modal__head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Live tagging bar (Formation tab) ===== */
.tag-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag-bar__start {
  width: auto;
  margin: 0;
}

.tag-bar__session {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.tag-bar__name {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 13px;
  min-width: 0;
  flex: 1;
}

.tag-bar__count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  white-space: nowrap;
}

.tag-bar__btn {
  width: auto;
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
}

.pitch-hint {
  text-align: center;
  color: var(--chalk-dim);
  font-size: 11px;
  margin: 10px 0 0;
}

/* Tappable pitch markers get touch affordance */
.pitch-marker--tappable { cursor: pointer; }
.pitch-marker--tappable circle {
  transition: r 0.12s ease, opacity 0.12s ease;
}
.pitch-marker--tappable:active circle,
.pitch-marker--tappable.tapped circle {
  r: 16;
  opacity: 0.85;
}

/* ===== Tag modal (quick evaluation buttons) ===== */
.tag-event-group { margin-bottom: 20px; }

.tag-event-group__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.tag-event-group__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tag-event-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.tag-event-row__label {
  font-size: 12px;
  color: var(--chalk-dim);
}

.tag-event-btn {
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--chalk);
  padding: 9px 8px;
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
  transition: transform 0.08s ease, border-color 0.12s ease;
}

.tag-event-btn:active { transform: scale(0.96); }

.tag-event-btn--pos { border-color: var(--turf); }
.tag-event-btn--pos:hover { background: rgba(79,143,92,0.18); border-color: var(--turf-bright); }

.tag-event-btn--neg { border-color: var(--amber-dim); }
.tag-event-btn--neg:hover { background: rgba(217,105,90,0.12); border-color: var(--red); }

.tag-recent {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 18px;
  max-height: 160px;
  overflow-y: auto;
}

.tag-recent__empty {
  color: var(--chalk-dim);
  font-size: 12px;
}

.tag-recent__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}

.tag-recent__item span:first-child { color: var(--chalk-dim); }

.tag-recent__remove {
  background: none;
  border: none;
  color: var(--chalk-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
}

.tag-recent__remove:hover { color: var(--red); }

/* A stamped recent tag is clickable to jump back to its moment in a clip. */
.tag-recent__seek { cursor: pointer; color: var(--turf-bright); }
.tag-recent__seek:hover { text-decoration: underline; }

/* ===== Video-assisted tagging pane ===== */
.video-pane {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--ink-800);
}

.video-pane__video {
  width: 100%;
  max-height: 40vh;
  border-radius: 6px;
  background: #000;
  display: block;
  margin-bottom: 10px;
}

/* The `hidden` attribute must win — a class rule with display:block otherwise
   overrides it, leaving an empty black <video> box when no clip/camera is on. */
.video-pane__video[hidden],
.review-video[hidden] { display: none; }

.video-pane__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.video-pane__btn { width: auto; margin: 0; padding: 7px 12px; font-size: 12px; }

.video-pane__status {
  font-size: 12px;
  color: var(--chalk-dim);
  flex: 1 1 100%; /* drop to its own full-width line under the buttons */
  min-width: 0;
}

/* Review player + per-suggestion video moments */
.review-video {
  width: 100%;
  max-height: 42vh;
  border-radius: 8px;
  background: #000;
  display: block;
  margin-bottom: 16px;
}

.review-moments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 12px;
  padding-left: 26px; /* line up under the review row's label column */
}

.moment-chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--turf-bright);
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.moment-chip:hover:not(:disabled) { border-color: var(--turf-bright); }
.moment-chip:disabled { color: var(--chalk-dim); cursor: default; opacity: 0.7; }

/* ===== Live tagging: on-field player picker (pitch + chips) ===== */
.tag-picker { margin-bottom: 14px; }
.tag-picker__hint { font-size: 12px; color: var(--chalk-dim); margin: 0 0 8px; }
.tag-picker__pitch { max-width: 240px; margin: 0 auto 10px; }
.tag-picker__svg { width: 100%; height: auto; max-height: 32vh; display: block; }
.pitch-marker--active circle { stroke: var(--amber); stroke-width: 2.5; }

.tag-picker__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tag-picker__chips::-webkit-scrollbar { display: none; }

.tag-picker__chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--chalk);
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 84px;
  cursor: pointer;
}
.tag-picker__chip--active {
  border-color: var(--amber);
  background: linear-gradient(90deg, rgba(227,161,61,0.14), transparent);
}
.tag-picker__chipname { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-picker__chippos { font-family: var(--mono); font-size: 10px; color: var(--amber); }

/* ===== Durable-storage warning ===== */
/* "Lay not up for yourselves treasures upon earth, where moth and rust
    doth corrupt." - Matthew 6:19 (KJV) */

.storage-warn {
  /* Sticky and above the modal layer (z-index 50) on purpose: the person who
     most needs this is a first-time visitor in a private window, and the
     mandatory coach-profile modal opens straight over the top of them. A
     warning they can't see until after they've typed their profile in is no
     warning at all. */
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink-800);
  border-bottom: 1px solid var(--amber-dim);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.storage-warn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(227,161,61,0.18), rgba(227,161,61,0.07));
  pointer-events: none;
}
.storage-warn__inner { position: relative; }
.storage-warn__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px clamp(14px, 3vw, 28px);
}
.storage-warn__icon { color: var(--amber); font-size: 17px; line-height: 1.4; flex: 0 0 auto; }
.storage-warn__body { flex: 1; min-width: 0; }
.storage-warn__body strong {
  display: block;
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.storage-warn__body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--chalk-dim);
  max-width: 78ch;
}
.storage-warn__dismiss {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--chalk-dim);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.storage-warn__dismiss:hover { color: var(--chalk); }
.storage-warn__dismiss:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media print { .storage-warn { display: none !important; } }

/* ===== Activity skill tagging & effort accrual ===== */
/* "Let us not be weary in well doing: for in due season we shall reap, if we
    faint not." - Galatians 6:9 (KJV) */

.mp-skillpick__hint { margin: 0 0 8px; }
.mp-skillpick__hint--warn { color: var(--amber); }

.mp-skillpick__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mp-skillchip {
  background: var(--ink-800);
  border: 1px solid var(--line);
  color: var(--chalk-dim);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-family: var(--body);
  cursor: pointer;
  line-height: 1.2;
}
.mp-skillchip:hover { border-color: var(--turf-bright); color: var(--chalk); }
.mp-skillchip--on {
  background: linear-gradient(90deg, rgba(127,209,143,0.18), transparent);
  border-color: var(--turf-bright);
  color: var(--chalk);
  font-weight: 600;
}
.mp-skillchip:focus-visible { outline: 2px solid var(--turf-bright); outline-offset: 1px; }

/* Work that has been verified but hasn't yet added up to a whole point.
   Four children, not the five an actionable row has (no checkbox, no value
   input), so it needs its own columns — inheriting the actionable grid put the
   meter on top of the label. */
.review-row--building {
  grid-template-columns: 130px minmax(60px, 1fr) 72px auto;
  opacity: 0.9;
}
.review-row--building .review-row__label { color: var(--chalk-dim); }
.review-row--building .review-row__current { text-align: right; white-space: nowrap; }
.review-row--building .review-row__notes { padding-left: 12px; }

@media (max-width: 620px) {
  .review-row--building {
    grid-template-columns: 1fr 72px;
    grid-template-areas: "label amount" "meter meter" "notes notes";
    row-gap: 4px;
  }
  .review-row--building .review-row__label { grid-area: label; }
  .review-row--building .review-row__current { grid-area: amount; }
  .review-row--building .build-meter { grid-area: meter; }
  .review-row--building .review-row__notes { grid-area: notes; }
}

.build-meter {
  display: inline-block;
  height: 8px;
  min-width: 70px;
  flex: 1;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.build-meter__fill {
  display: block;
  height: 100%;
  background: var(--amber);
  border-radius: 0 3px 3px 0;
}
/* Evidence pointing downward reads as a warning, not as progress. */
.build-meter__fill--down { background: var(--red); }

.review-building__head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin: 14px 0 4px;
}

/* ===== Weekly Training ===== */
/* "Write the vision, and make it plain upon tables, that he may run that
    readeth it." - Habakkuk 2:2 (KJV) */

/* Views are grids and .panel carries its own padding, so this header — which
   is not a panel — has to supply its own or it sits flush to the edge. */
#view-training.view--active { grid-template-columns: 1fr; }

.training-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--ink-900);
  padding: clamp(18px, 3vw, 32px);
  padding-bottom: 0;
}
.training-head__title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 26px;
  color: var(--chalk);
  margin: 0;
}
.training-head__sub { color: var(--chalk-dim); font-size: 13px; margin: 4px 0 0; }
.training-print-btn { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; }

.panel--training { margin-bottom: 20px; }

/* Ranked bars: one measure, one hue. Rank carries the meaning; the chip is a
   second, non-colour cue for what this week targets. */
.weakbars { display: flex; flex-direction: column; gap: 9px; }
.weakbar {
  display: grid;
  grid-template-columns: 150px 1fr 34px 78px;
  align-items: center;
  gap: 10px;
}
.weakbar__label { font-size: 13px; color: var(--chalk); }
.weakbar__track {
  height: 10px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.weakbar__fill {
  display: block;
  height: 100%;
  background: var(--turf-bright);
  border-radius: 0 4px 4px 0;
}
.weakbar__val { font-family: var(--mono); font-size: 13px; color: var(--chalk-dim); text-align: right; }
.weakbar__chip {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
  white-space: nowrap;
}

.training-dur { font-family: var(--mono); font-size: 12px; color: var(--chalk-dim); }
.training-focus {
  font-size: 13px;
  color: var(--amber);
  margin: 0 0 16px;
}

.training-timeline { list-style: none; margin: 0; padding: 0; }

.training-block {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.training-block:first-child { border-top: none; padding-top: 0; }

.training-block__time { display: flex; flex-direction: column; gap: 2px; }
.training-block__clock { font-family: var(--mono); font-size: 15px; color: var(--turf-bright); }
.training-block__mins { font-family: var(--mono); font-size: 11px; color: var(--chalk-dim); }

.training-block__title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 15px;
  color: var(--chalk);
  margin: 0 0 8px;
}
.training-block__note { font-size: 12px; color: var(--chalk-dim); line-height: 1.6; margin: 8px 0 0; }

/* Rest blocks are deliberately quiet — they shouldn't compete with the work. */
.training-block--rest .training-block__title,
.training-block--rest2 .training-block__title { color: var(--chalk-dim); font-size: 13px; }

.drill {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.drill__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.drill__name { font-size: 14px; font-weight: 600; color: var(--turf-bright); }
.drill__meta { font-family: var(--mono); font-size: 10px; color: var(--amber); }
.drill__line { font-size: 13px; line-height: 1.65; color: var(--chalk-dim); margin: 0 0 6px; }
.drill__line strong { color: var(--chalk); font-weight: 600; }
.drill__line--constraint { color: var(--chalk); }
.drill__points { margin: 8px 0 0; padding-left: 18px; }
.drill__points li { font-size: 12px; line-height: 1.6; color: var(--chalk-dim); margin-bottom: 3px; }

.training-scrim-btn { width: auto; margin: 10px 0 0; padding: 8px 14px; font-size: 13px; }

@media (max-width: 700px) {
  .weakbar { grid-template-columns: 1fr 34px; grid-template-areas: "label val" "track track" "chip chip"; gap: 4px 10px; }
  .weakbar__label { grid-area: label; }
  .weakbar__val { grid-area: val; }
  .weakbar__track { grid-area: track; }
  .weakbar__chip { grid-area: chip; justify-self: start; margin-top: 2px; }
  .training-block { grid-template-columns: 62px 1fr; gap: 10px; }
}

/* Print: a plan you can carry onto the field. Drop the app chrome, go to ink
   on white, and never split a drill across a page break. */
@media print {
  body { background: #fff; color: #111; }
  .topbar, .tabs, .footer, .training-print-btn, .training-scrim-btn,
  .modal-backdrop, .info-popover { display: none !important; }
  .view { display: none !important; }
  .view--active, #view-training { display: block !important; }
  .panel, .drill {
    background: #fff !important;
    border: 1px solid #bbb !important;
    box-shadow: none !important;
  }
  .training-head__title, .training-block__title, .drill__name,
  .weakbar__label, .drill__line strong { color: #111 !important; }
  .training-block__clock { color: #111 !important; }
  .drill__line, .drill__points li, .training-block__note,
  .weakbar__val, .training-head__sub { color: #333 !important; }
  .training-focus, .drill__meta, .weakbar__chip { color: #444 !important; border-color: #999 !important; }
  .weakbar__fill { background: #666 !important; }
  .weakbar__track { border-color: #999 !important; }
  .drill, .training-block { break-inside: avoid; page-break-inside: avoid; }
  .panel--training { break-inside: auto; }
}

/* ===== Hand-off (share without a server) ===== */
/* "A word fitly spoken is like apples of gold in pictures of silver."
    — Proverbs 25:11 (KJV) */

.handoff__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.handoff__btn { width: 100%; margin: 0; }

.handoff__linkbox {
  width: 100%;
  min-height: 74px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--chalk-dim);
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
  resize: vertical;
}

.handoff__note {
  font-size: 12px;
  color: var(--turf-bright);
  margin: 10px 0 0;
  min-height: 1em;
  line-height: 1.5;
}

.handoff__privacy {
  font-size: 11px;
  color: var(--chalk-dim);
  line-height: 1.6;
  margin: 6px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ===== Scrimmage: two sides, one pitch ===== */
/* "Can two walk together, except they be agreed?" — Amos 3:3 (KJV) */

.tag-picker__halfway {
  stroke: var(--chalk);
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
  opacity: 0.55;
}

.tag-picker__sidehead {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  color: var(--turf-bright);
  margin: 10px 0 6px;
}
.tag-picker__sidehead--b { color: var(--side-b); }
.tag-picker__chip--sideb { border-color: var(--side-b-dim); }
.tag-picker__chip--sideb .tag-picker__chippos { color: var(--side-b); }
.tag-picker__chip--active { border-color: var(--amber); }

.tag-bar__hint {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--chalk-dim);
  margin: 2px 0 0;
  line-height: 1.5;
}

.tag-bar__kind,
.matchlog-card__kind {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--turf-bright);
  border: 1px solid var(--turf);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.tag-bar__kind--scrimmage,
.matchlog-card__kind--scrimmage {
  color: var(--side-b);
  border-color: var(--side-b-dim);
}
.matchlog-card__kind { margin-right: 8px; }

/* --- Scrimmage setup modal --- */
.scrim-names {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.scrim-names__input {
  flex: 1;
  min-width: 0;
  background: var(--ink-800);
  border: 1px solid var(--turf);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 14px;
}
.scrim-names__input--b { border-color: var(--side-b-dim); }
.scrim-names__input:focus-visible { outline: 2px solid var(--turf-bright); outline-offset: 1px; }
.scrim-names__vs {
  font-family: var(--display);
  text-transform: uppercase;
  color: var(--chalk-dim);
  font-size: 14px;
}

.scrim-fit {
  font-size: 12px;
  color: var(--turf-bright);
  line-height: 1.55;
  margin: -6px 0 14px;
}
.scrim-fit--short { color: var(--amber); }

.scrim-pitch-wrap {
  max-width: 260px;
  margin: 16px auto;
}
.scrim-pitch-wrap svg { width: 100%; height: auto; max-height: 42vh; display: block; }

.scrim-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.scrim-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}
.scrim-side--b { border-color: var(--side-b-dim); }

.scrim-side__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.scrim-side__name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 15px;
  color: var(--turf-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scrim-side--b .scrim-side__name { color: var(--side-b); }
.scrim-side__fit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  white-space: nowrap;
}
/* Two of these sit side by side inside the modal — tighten the slot row so the
   name dropdown keeps the room it needs. */
.scrim-side__slots { margin: 0; gap: 6px; }
.scrim-side__slots li {
  grid-template-columns: 44px 1fr 34px;
  gap: 7px;
  padding: 7px 8px;
}
.scrim-side__slots .slot-tag { padding: 2px 4px; font-size: 10px; }
.scrim-side__slots select { padding: 5px 6px; font-size: 12px; }
.scrim-side__slots .slot-score { font-size: 11px; }

@media (max-width: 620px) {
  .scrim-sides { grid-template-columns: 1fr; }
  .scrim-pitch-wrap { max-width: 200px; }
}

/* ===== Player History view ===== */
.history-chapter-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-chapter__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 14px 0 2px;
}
.history-chapter__title:first-child { margin-top: 0; }

.history-entry {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.history-entry__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.history-entry__badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.history-entry__badge--shared { color: var(--turf-bright); border-color: var(--turf); }
.history-entry__badge--coach { color: var(--amber); border-color: var(--amber-dim); }

.history-entry__date { font-family: var(--mono); font-size: 12px; color: var(--chalk-dim); }
.history-entry__meta { margin: 0 0 4px; font-size: 13px; color: var(--chalk); }
.history-entry__stat { margin: 0; font-size: 12px; color: var(--chalk-dim); }
.history-entry__stat strong { color: var(--turf-bright); }

@media (max-width: 600px) {
  .history-chapter-edit { grid-template-columns: 1fr; }
}

/* ===== My Player mode ===== */
.panel--myplayer { max-width: 760px; }

.mp-edit-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.mp-edit-details summary {
  cursor: pointer;
  color: var(--turf-bright);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.mp-edit-details summary:hover { color: var(--chalk); }

/* ===== My Player — sports played (summary + reveal-on-demand editor) ===== */
.mp-sports {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.mp-sports__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mp-sports__summary .eyebrow { display: block; margin-bottom: 2px; }

.mp-sports__list {
  font-family: var(--display);
  font-size: 16px;
  color: var(--chalk);
}

.mp-sports__editor { margin-top: 14px; }

/* ===== My Player — evaluation lifecycle (share / lock) ===== */
.mp-share {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.mp-share--draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.mp-share__avg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: auto;
}

.mp-share__avgval {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: var(--turf-bright);
}

.mp-share__avgval small { font-size: 12px; color: var(--chalk-dim); font-weight: 400; }

.mp-share__avg--over .mp-share__avgval { color: var(--red); }

.mp-share--draft .btn { width: auto; margin: 0; }

.mp-share__note { flex-basis: 100%; margin: 2px 0 0; }

.mp-share--locked {
  border-color: var(--amber-dim);
  background: rgba(227, 161, 61, 0.06);
}

.mp-share__lockedtitle {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--amber);
}

.mp-share__actions { margin-top: 10px; }
.mp-share__actions .btn { width: auto; margin: 0; }

.mp-eval__locked {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--chalk);
  padding-right: 6px;
}

/* ===== My Player — game mini-pitch (scaled-down live tagging) ===== */
.mp-minipitch {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-900);
  padding: 10px;
  margin: 12px auto;
  max-width: 220px;
}

.mp-minipitch__svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.mp-minipitch__panel { margin-top: 10px; }

/* Cross-check flag: parent's suggested direction disagrees with the coach's
   own live tags for that skill. */
.review-row--conflict {
  background: rgba(217, 105, 90, 0.12);
  border-radius: 6px;
}

.sport-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.sport-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--chalk);
  cursor: pointer;
}

.sport-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--turf-bright);
  cursor: pointer;
}

/* ===== My Player — tabular evaluation (phone-friendly) ===== */
.mp-eval {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.mp-eval__group th {
  text-align: left;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  padding: 20px 0 8px;
  border-bottom: 1px solid var(--line);
}

.mp-eval__group:first-child th { padding-top: 4px; }

.mp-eval__row td {
  padding: 6px 0;
  border-bottom: 1px solid rgba(58, 89, 64, 0.35);
  vertical-align: middle;
}

.mp-eval__cat {
  font-size: 14px;
  color: var(--chalk);
  line-height: 1.3;
  padding-right: 12px;
}

.mp-eval__cat label { cursor: pointer; }

.mp-eval__val {
  width: 68px;
  text-align: right;
  white-space: nowrap;
}

.mp-eval__val input[type="number"] {
  width: 56px;
  height: 40px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 16px; /* 16px keeps iOS Safari from auto-zooming the page on focus */
  text-align: center;
  padding: 4px;
}

.mp-eval__val input[type="number"]:focus-visible {
  outline: 2px solid var(--turf-bright);
  outline-offset: 1px;
  border-color: var(--turf-bright);
}

.mp-eval__val input[type="number"]::-webkit-inner-spin-button,
.mp-eval__val input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.6;
}

/* 1–10 range selector (dropdown) — used on phones for both the player eval
   table and the coach's player detail. Sliders take over on wider screens. */
.rating-select {
  width: 62px;
  height: 40px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--chalk);
  font-family: var(--mono);
  font-size: 16px; /* 16px keeps iOS Safari from auto-zooming on focus */
  text-align: center;
  text-align-last: center;
  padding: 4px 6px;
  cursor: pointer;
}

.rating-select:focus-visible {
  outline: 2px solid var(--turf-bright);
  outline-offset: 1px;
  border-color: var(--turf-bright);
}

/* Coach detail (phone): a select sits where the slider would, right-aligned. */
.cat-row--select {
  grid-template-columns: 1fr auto;
  gap: 12px;
}

/* Player eval table (tablet/desktop): the value cell widens to hold a slider. */
.mp-eval__val--slider { width: 55%; }

.mp-eval__slidewrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-eval__slidewrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--ink-700);
  cursor: pointer;
}

.mp-eval__slidewrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--turf-bright);
  border: 2px solid var(--ink-900);
  cursor: pointer;
}

.mp-eval__slidewrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--turf-bright);
  border: 2px solid var(--ink-900);
  cursor: pointer;
}

.mp-eval__slidevalue {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--amber);
  min-width: 18px;
  text-align: right;
}

/* Intake screen — "or load a saved profile" divider */
.mp-intake-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--chalk-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mp-intake-or::before,
.mp-intake-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ===== My Player — activity / progress sub-nav & cards ===== */
.mp-subnav {
  display: flex;
  gap: 6px;
  margin: 4px 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: var(--ink-800);
}

.mp-subnav__btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--chalk-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 6px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mp-subnav__btn--active { background: var(--turf); color: var(--ink-900); font-weight: 600; }

.mp-subnav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-family: var(--mono);
  background: var(--amber);
  color: var(--ink-900);
}

.mp-subnav__btn--active .mp-subnav__badge { background: var(--ink-900); color: var(--amber); }

.mp-activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.mp-activity-actions .btn { width: auto; margin: 0; }
.mp-review-btn { width: auto; margin: 0; }

.mp-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-activity-empty { color: var(--chalk-dim); font-size: 14px; padding: 14px 0; line-height: 1.5; }

.mp-activity-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--ink-800);
}

.mp-activity-card--counted { opacity: 0.72; }
.mp-activity-card__main { flex: 1; min-width: 0; }
.mp-activity-card__title { font-weight: 600; color: var(--chalk); font-size: 14px; }
.mp-activity-card__meta { font-family: var(--mono); font-size: 12px; color: var(--chalk-dim); margin-top: 2px; }
.mp-activity-card__note { font-size: 13px; color: var(--chalk-dim); margin-top: 6px; line-height: 1.4; }

.mp-activity-card__del {
  background: none;
  border: none;
  color: var(--chalk-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
}

.mp-activity-card__del:hover { color: var(--red); }

.mp-verify-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chalk-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.mp-verify-badge--yes { color: var(--turf-bright); border-color: var(--turf); }

.mp-tag-section { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.mp-tag-tally { font-family: var(--mono); font-size: 12px; color: var(--amber); margin: 0 0 12px; }

/* ===== My Player — progress views ===== */
.mp-stat-row { display: flex; gap: 10px; margin-bottom: 20px; }

.mp-stat {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 10px;
  background: var(--ink-800);
  text-align: center;
}

.mp-stat__val { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--chalk); line-height: 1; }
.mp-stat__delta { font-family: var(--mono); font-size: 12px; margin-left: 2px; }
.mp-stat__delta.up { color: var(--turf-bright); }
.mp-stat__delta.down { color: var(--red); }
.mp-stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--chalk-dim); margin-top: 6px; }

.mp-section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--turf-bright);
  margin: 22px 0 10px;
}

.mp-spark-wrap { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--ink-800); }
.mp-spark { display: block; }

.mp-week-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--ink-800);
}

.mp-week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.mp-week-bar__fill { width: 70%; background: var(--turf); border-radius: 4px 4px 2px 2px; min-height: 4px; }
.mp-week-bar__fill--empty { background: var(--line); }
.mp-week-bar__lbl { font-size: 10px; color: var(--chalk-dim); height: 12px; }

.mp-trend-list { display: flex; flex-direction: column; }

.mp-trend-row {
  display: grid;
  grid-template-columns: 1fr 84px 24px 50px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(58, 89, 64, 0.35);
}

.mp-trend-row__name { font-size: 13px; color: var(--chalk); line-height: 1.25; }
.mp-trend-row__spark { display: block; }
.mp-trend-row__val { font-family: var(--mono); font-size: 14px; color: var(--chalk); text-align: right; }
.mp-delta { font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.mp-delta--up { color: var(--turf-bright); }
.mp-delta--down { color: var(--red); }
.mp-delta--flat { color: var(--chalk-dim); }

.mp-milestones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.mp-milestone {
  border: 1px solid var(--turf);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(79, 143, 92, 0.12);
  color: var(--chalk);
  font-size: 13px;
}

/* ===== Coach: verify imported activity ===== */
.mp-verify-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(58, 89, 64, 0.35);
  font-size: 13px;
  color: var(--chalk);
  cursor: pointer;
}

.mp-verify-row input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--turf-bright); flex-shrink: 0; }
.mp-verify-row__txt { line-height: 1.4; }

/* ===== Team theming (colors + logo) ===== */
.topbar__logo {
  height: 34px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  border-radius: 4px;
}

.topbar__theme-btn,
.topbar__coach-btn {
  font-size: 16px;
  width: 36px;
  height: 36px;
}

.topbar__coach-btn[hidden] { display: none; }

/* ===== Coach profile modal — sports & age-range levels ===== */
.coach-sports {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.coach-sport {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.coach-sport__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.coach-sport__levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 2px 24px;
}

.coach-sport__levels[hidden] { display: none; }

.coach-level {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--chalk);
  cursor: pointer;
}

.coach-sport__head input[type="checkbox"],
.coach-level input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--turf-bright);
  cursor: pointer;
}

.theme-color-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-color-field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--chalk-dim);
}

.theme-color-field input[type="color"] {
  width: 64px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink-800);
  padding: 4px;
  cursor: pointer;
}

.theme-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.theme-logo-preview {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink-800);
  padding: 4px;
}

.theme-logo-actions {
  display: flex;
  gap: 8px;
}

.theme-logo-actions .btn { width: auto; margin: 0; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--chalk-dim);
  border-top: 1px solid var(--line);
}

.footer__sep { margin: 0 8px; opacity: 0.5; }

.footer__link {
  color: var(--chalk-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer__link:hover {
  color: var(--turf-bright);
  border-bottom-color: var(--turf-bright);
}

/*
  "To every thing there is a season, and a time to every purpose
   under the heaven." — Ecclesiastes 3:1 (KJV)
  A small screen is its own season; the topbar adapts to it here.
  ===== Small-screen topbar (phones held pitch-side) =====
*/
@media (max-width: 600px) {
  .topbar {
    gap: 12px 16px;
    padding: 14px 16px;
  }
  .topbar__wordmark { font-size: 20px; }
  .topbar__mark { gap: 9px; }
  .topbar__num { font-size: 12px; padding: 2px 6px; }

  /* Keep the pill rows scannable instead of stacking into tall columns:
     let them scroll sideways if they overflow rather than wrap endlessly. */
  .mode-select,
  .sport-select,
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .mode-select::-webkit-scrollbar,
  .sport-select::-webkit-scrollbar,
  .tabs::-webkit-scrollbar { display: none; }

  .mode-btn,
  .sport-btn,
  .tab { padding: 7px 13px; white-space: nowrap; flex: 0 0 auto; }

  /* Match Log actions: side by side they squeeze to unreadable narrow
     columns ("Import stats from file" wrapping to four lines). Stack them
     full-width so each is an easy, legible tap target. */
  .matchlog-actions { flex-direction: column; }
  .matchlog-actions .btn { width: 100%; margin: 0; }

  /* Live tag buttons: give the two event buttons more room by trimming the
     fixed category-label column so their text wraps less. */
  .tag-event-row { grid-template-columns: 84px 1fr 1fr; gap: 6px; }
}
