:root {
  /* Blitz palette — deep navy chrome with volt-green accents.
     Teams can override via the theme picker (applyTheme in app.js). */
  --bg: #0e1122;
  --panel: #171c33;
  --panel-2: #202741;
  --border: #323b5e;
  --text: #eceff8;
  --muted: #97a0bd;
  --accent: #c6f21e;
  --accent-dim: #718c14;
  --accent-grad: linear-gradient(135deg, #9dc613, #d4ff2e);
  --accent-text: #0e1122;
  --danger: #e5534b;
  --warn: #d9a03f;
  --blue: #8ea2f0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 550px at 85% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%),
    radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 19px; margin: 0; font-weight: 600; letter-spacing: 0.3px; }
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}
.brand-sub {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}

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

input, select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dim); border-color: var(--accent-dim); }
#search { width: 220px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: var(--accent-text); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.working { cursor: progress; }

/* ---------- Layout ---------- */
main { padding: 18px 22px 60px; max-width: 1250px; margin: 0 auto; }

.summary { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* ---------- Board tabs (Recruiting / Tryouts) ---------- */
.board-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.board-tabs button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.board-tabs button:hover { border-color: var(--accent-dim); color: var(--text); }
.board-tabs button.on {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--text);
}
.board-count {
  background: var(--panel-2);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.board-tabs button.on .board-count { background: var(--accent); color: var(--accent-text); }
.badge.tryout { background: #4a2e10; color: #f0b35c; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }

/* ---------- Segmented view toggle / export menu ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  background: var(--panel-2);
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-grad); color: var(--accent-text); font-weight: 700; }

.export-wrap { position: relative; }
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 30;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}
.export-menu button:hover { background: var(--panel); }

/* ---------- Tryout intake (staff side) ---------- */
.count-badge {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  margin-left: 6px;
}
.intake-top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.intake-qr {
  width: 190px;
  min-height: 190px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.intake-qr svg { width: 100%; height: auto; display: block; }
.intake-link-box { flex: 1; min-width: 260px; }
.intake-link-box label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.intake-url {
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  word-break: break-all;
  margin-bottom: 10px;
}
.intake-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.intake-queue-head {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 18px 0 4px;
}

/* ---------- Film Room ---------- */
.film-main { max-width: 1250px; margin: 0 auto; padding: 18px 22px 60px; }
.film-gate {
  max-width: 420px;
  margin: 60px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  text-align: center;
}
.film-gate h2 { margin: 0 0 6px; }
.film-gate .offer-add { margin-top: 14px; }
#join-code { font-size: 22px; text-align: center; letter-spacing: 6px; }

.film-new { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.film-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.film-head h2 { margin: 0; font-size: 20px; }
.film-head-actions { display: flex; align-items: center; gap: 10px; }
.film-code {
  background: var(--accent-grad);
  color: var(--accent-text);
  font-weight: 800;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  letter-spacing: 1px;
}

.film-stage { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); gap: 16px; }
.film-video { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.film-video iframe, .film-video video, #yt-player { width: 100%; height: 100%; display: block; border: 0; }
/* Viewers can watch but not touch — the coach drives. */
.viewer-shield { position: absolute; inset: 0; cursor: not-allowed; background: transparent; }

.film-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.film-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.film-time { color: var(--muted); font-family: Consolas, monospace; font-size: 13px; margin-left: auto; }
.film-notes { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; flex: 1; min-height: 0; }
.film-notes .intake-queue-head { margin-top: 0; }
#notes-list { max-height: 320px; overflow-y: auto; }
.film-note {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}
.film-note:hover .film-note-t { color: var(--accent); }
.film-note-t { font-family: Consolas, monospace; color: var(--muted); font-size: 12px; min-width: 42px; }
.film-note-text { flex: 1; }
.film-note-x { background: none; border: none; color: var(--muted); cursor: pointer; }
.film-note-x:hover { color: var(--danger); }

@media (max-width: 900px) {
  .film-stage { grid-template-columns: 1fr; }
  .film-main { padding: 12px; }
  #notes-list { max-height: 220px; }
}

/* ---------- Film upload + clip list ---------- */
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.upload-bar {
  height: 8px;
  background: var(--panel-2);
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.upload-bar > div { height: 100%; width: 0%; background: var(--accent-grad); transition: width 0.2s; }
.staged-clips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }

.film-clips { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.film-clips .intake-queue-head { margin-top: 0; }
#clip-list { max-height: 210px; overflow-y: auto; }
.clip-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.clip-row:hover { background: var(--panel-2); }
.clip-row.on { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--text); font-weight: 600; }
.clip-num {
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--panel-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.clip-row.on .clip-num { background: var(--accent); color: var(--accent-text); }
.clip-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Digest ---------- */
.digest-label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.digest-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Public signup page ---------- */
.join-body { padding: 0; }
.join-wrap { max-width: 560px; margin: 0 auto; padding: 26px 18px 70px; }
.join-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.join-brand img { width: 54px; height: 54px; border-radius: 12px; }
.join-brand h1 { margin: 0; font-size: 21px; }
.join-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 13px; }
.join-form input, .join-form select, .join-form textarea { width: 100%; font-size: 16px; min-height: 44px; }
.join-form textarea { min-height: 72px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.join-submit { width: 100%; min-height: 50px; font-size: 16px; margin-top: 6px; }
.join-done { text-align: center; padding: 40px 10px; }
.join-check {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 40px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.join-done h2 { margin: 0 0 6px; }
.join-closed {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Find Recruits ---------- */
.modal-lg {
  width: min(760px, 96vw);
  max-height: 92vh;
}
.find-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.find-head h2 { margin: 0; }
.find-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.find-form input { flex: 1; min-width: 140px; }
.find-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.find-row .avatar { width: 44px; height: 44px; font-size: 15px; border-radius: 8px; flex-shrink: 0; }
.find-rank { color: var(--muted); font-weight: 700; font-size: 13px; min-width: 32px; }
.find-main { flex: 1; min-width: 0; }
.find-name { font-weight: 700; font-size: 15px; }
.find-name .stars { font-size: 12px; }
.find-sub { color: var(--muted); font-size: 12.5px; }
.find-detail { color: var(--text); font-size: 12.5px; margin-top: 2px; opacity: 0.85; }
.find-pos {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-weight: 600;
}
.sleeper-score {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: var(--accent-grad);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sleeper-attn { margin-top: 3px; }
.sleeper-attn b { color: var(--accent); }

.sleeper-intro { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
.info-toggle {
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.info-toggle:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.info-panel {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 12px 0 4px;
  font-size: 13.5px;
  line-height: 1.55;
  max-height: 340px;
  overflow-y: auto;
}
.info-panel h4 {
  margin: 14px 0 5px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--accent);
}
.info-panel h4:first-of-type { margin-top: 0; }
.info-panel p { margin: 0 0 8px; color: var(--text); }
.info-panel ul { margin: 0 0 10px; padding-left: 18px; color: var(--text); }
.info-panel li { margin-bottom: 5px; }
.info-panel b { color: #fff; }
.info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.info-close:hover { color: var(--text); }
.sleeper-footnote { color: var(--muted) !important; font-style: italic; margin-bottom: 0 !important; }
@media (max-width: 700px) {
  .find-form select, .find-form input, .find-form button { width: 100%; }
}

/* ---------- Theme picker ---------- */
.theme-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.theme-swatch:hover { border-color: var(--accent-dim); }
.theme-swatch .sw {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.theme-swatch .sw span { width: 10px; height: 10px; border-radius: 3px; display: block; }
input[type="color"] { padding: 3px; height: 40px; cursor: pointer; }

/* ---------- Staff access ---------- */
.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.staff-row .code {
  font-family: Consolas, monospace;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 1px;
}
.staff-row .name { flex: 1; font-weight: 600; }
.staff-row button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.staff-row button:hover { color: var(--danger); }
.staff-new {
  margin-top: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
}
.staff-new .code { font-size: 20px; font-weight: 800; letter-spacing: 3px; font-family: Consolas, monospace; }

/* ---------- Passcode gate branding ---------- */
.gate-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.gate-brand img { width: 52px; height: 52px; border-radius: 12px; }
.gate-brand h2 { margin: 0; }
.tagline { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 2px; }

/* ---------- Health warning ---------- */
.health-banner {
  background: #3d2220;
  border: 1px solid var(--danger);
  color: #f0b3ae;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* ---------- Duplicate warning ---------- */
.dupe-warning {
  background: #4a2e10;
  color: #f0b35c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.dupe-warning a { color: #ffd28a; font-weight: 700; }

/* ---------- Evaluation stars ---------- */
.eval-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.eval-row { display: flex; align-items: center; justify-content: space-between; max-width: 340px; }
.eval-label { font-size: 13px; color: var(--muted); }
.eval-star {
  background: none;
  border: none;
  color: #3d3151;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 3px;
  line-height: 1;
}
.eval-star.on { color: var(--warn); }
.eval-star:hover { transform: scale(1.15); }
.seen-at { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }

/* ---------- Roster section ---------- */
.roster-grid { display: flex; align-items: end; gap: 18px; flex-wrap: wrap; }
.roster-grid > label:first-child { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.roster-grid .check { font-size: 14px; padding-bottom: 8px; }

.linkbtn.tel { color: #6fdc8c; }
.contact-item .by { color: var(--muted); font-size: 12px; font-style: italic; }

/* ---------- Alerts feed ---------- */
.alerts {
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alerts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.alert-item { padding: 5px 0; border-top: 1px solid var(--border); color: var(--muted); cursor: pointer; }
.alert-item:hover { color: var(--text); }

/* ---------- Pipeline view ---------- */
.roster.view-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.pipe-col { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-width: 0; }
.pipe-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pipe-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.pipe-empty { color: var(--muted); text-align: center; padding: 14px 0; }

.mini-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.mini-card:hover { border-color: var(--accent-dim); }
.mini-name { font-weight: 600; font-size: 13.5px; }
.mini-name .stars { font-size: 11px; }
.mini-sub { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.flag { color: #f0b35c; }

/* ---------- Depth view ---------- */
.roster.view-depth { display: block; }
.depth-section { margin-bottom: 18px; }
.depth-section h3 {
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}
.depth-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.depth-row .mini-card { margin-bottom: 0; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 15px;
}

/* ---------- Player cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: border-color 0.15s, transform 0.1s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-1px); }

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  align-self: flex-start;
}
.card-ext { text-decoration: none; text-align: center; }
.quicklog.promote { border-color: var(--accent-dim); color: var(--accent); font-weight: 700; }

.quicklog {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.quicklog:hover { color: var(--text); border-color: var(--accent-dim); }

.avatar {
  width: 58px; height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--panel-2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; color: var(--muted);
}

.card-main { flex: 1; min-width: 0; }
.card-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 13px; flex-wrap: wrap; }
.card-meta span { color: var(--muted); }
.card-meta b { color: var(--text); font-weight: 600; }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge.not-contacted { background: #362f45; color: var(--muted); }
.badge.contacted { background: #252b52; color: var(--blue); }
.badge.interested { background: #443413; color: var(--warn); }
.badge.committed { background: #16391f; color: #4ade80; }
.badge.passed { background: #3d2220; color: var(--danger); }
.badge.offers { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); color: color-mix(in srgb, var(--accent) 85%, white); }
.badge.attention { background: #4a2e10; color: #f0b35c; }
.badge.eval { background: #1c3a56; color: var(--blue); }
.badge.squad { background: var(--accent-grad); color: var(--accent-text); }

.stars { color: var(--warn); font-size: 12px; letter-spacing: 1px; }

/* ---------- Modal / drawer ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, 0.72);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
.hidden { display: none !important; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: min(480px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

.drawer {
  --drawer-pad: 24px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  width: min(680px, 96vw);
  height: 100%;
  margin-left: auto;
  overflow-y: auto;
  padding: var(--drawer-pad);
  animation: slide-in 0.18s ease-out;
  -webkit-overflow-scrolling: touch;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* Name and close button stay reachable no matter how far you've scrolled. */
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--panel);
  margin: calc(var(--drawer-pad) * -1) calc(var(--drawer-pad) * -1) 0;
  padding: var(--drawer-pad) var(--drawer-pad) 12px;
  border-bottom: 1px solid var(--border);
}
.drawer-head .avatar { width: 84px; height: 84px; font-size: 28px; }

.photo-wrap { position: relative; cursor: pointer; flex-shrink: 0; }
.photo-wrap .avatar { display: block; }
.photo-hint {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  pointer-events: none;
}
.photo-wrap:hover .photo-hint { border-color: var(--accent); }
.drawer-title h2 { margin: 0; font-size: 22px; }
.drawer-title .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.drawer-close { margin-left: auto; }

.linkrow { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.linkbtn:hover { border-color: var(--accent-dim); }
.linkbtn.hudl { color: #ff6300; }
.linkbtn.mp { color: var(--blue); }
.linkbtn.tw { color: #7fbdf0; }
.linkbtn.ig { color: #e17bb5; }
.linkbtn.rv { color: #6f8dff; }
.linkbtn.disabled { opacity: 0.45; pointer-events: none; }

.section { margin-top: 22px; }
.section > h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

.offer-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.offer-chip {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  color: color-mix(in srgb, var(--accent) 85%, white);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.offer-chip.scraped { background: #252b52; color: var(--blue); }
.offer-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.offer-add { display: flex; gap: 8px; }
.offer-add input { flex: 1; }

.contact-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: baseline;
}
.contact-item .date { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 80px; }
.contact-item .method { font-weight: 700; color: var(--blue); font-size: 12px; text-transform: uppercase; min-width: 62px; }
.contact-item .note { flex: 1; }
.contact-item button { background: none; border: none; color: var(--muted); cursor: pointer; }
.contact-item button:hover { color: var(--danger); }
.contact-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.contact-add input[type="text"] { flex: 1; min-width: 160px; }

.stats-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.stats-table-wrap h4 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
table.stats {
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
  width: 100%;
}
table.stats th, table.stats td {
  border: 1px solid var(--border);
  padding: 5px 9px;
  text-align: right;
}
table.stats th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
table.stats td:first-child, table.stats th:first-child { text-align: left; font-weight: 600; }

textarea.notes { width: 100%; min-height: 80px; resize: vertical; }

/* Notes thread — append-only, one entry per coach note */
.note-item { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.note-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.note-by { font-weight: 700; color: var(--blue); font-size: 12px; text-transform: uppercase; }
.note-at { color: var(--muted); font-size: 12px; }
.note-meta button {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.note-meta button:hover { color: var(--danger); }
.note-text { white-space: pre-wrap; word-break: break-word; }
.note-add { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.note-add textarea { flex: 1; min-height: 52px; resize: vertical; }
.note-add button { white-space: nowrap; }

.game-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}
.game-date { color: var(--muted); min-width: 44px; font-size: 12px; }
.game-opp { min-width: 150px; font-weight: 600; }
.game-opp .win { color: #4ade80; }
.game-opp .loss { color: var(--danger); }
.game-line { color: var(--muted); flex: 1; }

#btn-push.push-on { border-color: var(--accent-dim); color: var(--accent); }

/* ---------- Season stat entry ---------- */
.entry-table td { text-align: center; }
.bump-cell { white-space: nowrap; }
.bump {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}
.bump.plus { border-color: var(--accent-dim); color: var(--accent); }
.bump:active { transform: scale(0.92); }
.bump-val { display: inline-block; min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }
.win { color: #4ade80; }
.loss { color: var(--danger); }

.sync-row { display: flex; align-items: center; gap: 12px; }
.sync-note { color: var(--muted); font-size: 12px; }

/* Save is always one tap away, not a scroll to the bottom. */
.drawer-footer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  margin: 26px calc(var(--drawer-pad) * -1) calc(var(--drawer-pad) * -1);
  padding: 10px var(--drawer-pad);
  border-top: 1px solid var(--border);
}
.drawer-actions { display: flex; gap: 10px; }
.drawer-actions #d-save { flex: 1; }
.drawer-actions #d-more { min-width: 48px; }
/* Rare and destructive actions hide behind ⋯ so the bar stays one row. */
.drawer-more { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-more .btn { flex: 1; min-width: 120px; }

/* Details that don't need to follow you down the page. */
.drawer-subhead { padding: 10px 0 2px; }
.drawer-subhead .sub { color: var(--muted); font-size: 13px; margin-bottom: 2px; }

/* Tap a section heading to fold it away. */
.section > h3 {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
}
.section > h3::after {
  content: '⌄';
  position: absolute;
  right: 4px;
  top: -2px;
  font-size: 15px;
  color: var(--muted);
  transition: transform 0.15s;
}
.section.collapsed > h3::after { transform: rotate(-90deg); }
.section.collapsed > *:not(h3) { display: none; }
.section.collapsed > h3 { border-bottom-color: transparent; margin-bottom: 0; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 100;
}
.toast.err { border-color: var(--danger); }

@media (max-width: 700px) {
  .topbar { padding: 10px 12px; gap: 10px; }
  .toolbar { gap: 8px; width: 100%; }
  #search { width: 100%; }
  main { padding: 12px 12px 60px; }
  .roster { grid-template-columns: 1fr; }
  .roster.view-pipeline { display: flex; flex-direction: column; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid label[style] { grid-column: span 2 !important; }
  .drawer { --drawer-pad: 14px; width: 100vw; }
  .drawer-head { gap: 12px; padding-top: 12px; padding-bottom: 10px; align-items: center; }
  .drawer-head .avatar { width: 46px; height: 46px; font-size: 17px; border-radius: 9px; }
  .drawer-head .photo-hint { width: 20px; height: 20px; font-size: 10px; }
  .drawer-title h2 { font-size: 17px; line-height: 1.25; }
  .drawer-title .sub { font-size: 12.5px; }
  .modal { padding: 16px; }
  .btn, .seg button, input, select { min-height: 40px; }
  .quicklog { min-height: 34px; }
  .contact-add { flex-direction: column; align-items: stretch; }
  .contact-add input[type="date"], .contact-add select { width: 100%; }
  .note-add { flex-direction: column; align-items: stretch; }
}
