/* Fantasy Manager styles. Plain CSS, no frameworks, system fonts only. */

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --ink: #0f1b2d;
  --muted: #5d6b82;
  --line: #e2e7ef;
  --brand: #0f1b2d;
  --accent: #1f9d55;
  --accent-ink: #ffffff;
  --gold: #e5a50a;
  --danger: #c62828;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 6px 20px rgba(15, 27, 45, 0.06);
  --focus: 0 0 0 3px rgba(31, 157, 85, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--accent); }
h1 { font-size: 1.75rem; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem 1rem; z-index: 10; }

/* ---------- Layout ---------- */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #12c2a0); font-size: 0.85rem;
}
.topnav { display: flex; align-items: center; gap: 1rem; white-space: nowrap; }
.brand span:last-child { white-space: nowrap; }
.topnav a { color: #dfe7f3; text-decoration: none; }
.topnav a:hover { color: #fff; }
.topnav .who { color: #9fb0c8; font-size: 0.9rem; }
.topnav .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.25); background: transparent; }

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 2rem 1rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }

/* ---------- Building blocks ---------- */
.card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem;
}
.card-link { text-decoration: none; color: inherit; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15, 27, 45, 0.12); }
.card-title { display: block; font-size: 1.15rem; font-weight: 700; margin: 0.15rem 0; }
.card-grid, .action-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.action { display: grid; gap: 0.25rem; }
.action-icon {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: #e8f6ee; color: var(--accent); font-size: 1.1rem; margin-bottom: 0.4rem;
}
.eyebrow { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.count {
  display: inline-block; min-width: 1.6rem; padding: 0 0.45rem; border-radius: 999px;
  background: var(--bg); color: var(--muted); font-size: 0.8rem; text-align: center;
}
.week-pill {
  background: var(--ink); color: #fff; border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 600;
}
.tag { display: inline-block; border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.72rem; font-weight: 600; }
.tag-muted { background: #eef1f6; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid transparent; border-radius: 999px; padding: 0.6rem 1.15rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.875rem; min-height: 36px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #188547; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c4cdd9; }
.btn-danger { background: var(--danger); color: #fff; }
.button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

input[type="text"], input[type="password"], input[type="email"], select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; min-height: 44px;
}
.stack { display: grid; gap: 0.5rem; }
.stack label { font-weight: 600; font-size: 0.9rem; margin-top: 0.4rem; }
.stack .btn { margin-top: 0.75rem; }
.form-error { color: var(--danger); font-size: 0.875rem; }
.auth-card { max-width: 420px; margin: 2rem auto; padding: 2rem; }
.confirm-card { max-width: 560px; margin: 2rem auto; padding: 2rem; border-top: 4px solid var(--gold); }

.messages { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.message { border-radius: var(--radius-sm); padding: 0.75rem 1rem; background: #e8f6ee; color: #145c34; }
.message-error { background: #fdecec; color: #8a1c1c; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin: 0 0 0.25rem; }

/* ---------- Members and assets ---------- */
.member-list { display: grid; gap: 0.75rem; }
.member-list li { display: flex; align-items: center; gap: 0.75rem; }
.member-list strong { display: block; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 700;
}
.asset-list { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.asset-list li { padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.asset { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.asset-text { display: grid; min-width: 0; }
.asset-name { font-weight: 600; overflow-wrap: anywhere; }
.asset-meta { font-size: 0.8rem; color: var(--muted); }

/* Position badges: one colour per position family. */
.pos {
  flex: none; display: inline-grid; place-items: center; min-width: 42px; height: 26px;
  padding: 0 0.4rem; border-radius: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; color: #fff;
}
.pos-qb { background: #d9480f; }
.pos-rb { background: #2b8a3e; }
.pos-wr { background: #1c7ed6; }
.pos-te { background: #e67700; }
.pos-ol { background: #495057; }
.pos-dst { background: #0f1b2d; }
.pos-dl, .pos-mlb, .pos-olb { background: #7048e8; }
.pos-cb, .pos-s { background: #ae3ec9; }
.pos-hc { background: #c2255c; }
.pos-stad { background: #0c8599; }

/* ---------- Lineup builder ---------- */
.franchise-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.panel-head h2 { margin: 0; font-size: 1.3rem; }
.progress { font-weight: 700; font-size: 0.9rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0.25rem 0.75rem; }
.progress.is-complete { background: #e8f6ee; color: var(--accent); }

.formation-picker { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 1rem; }
.formation-picker form { margin: 0; }
.formation-card {
  width: 100%; height: 100%; text-align: left; display: grid; gap: 0.3rem; align-content: start;
  font: inherit; color: inherit; cursor: pointer; background: #fafbfd;
  border: 2px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.formation-card:hover { border-color: #b9c4d3; transform: translateY(-1px); }
.formation-card.is-selected { border-color: var(--accent); background: #f1faf5; box-shadow: inset 0 0 0 1px var(--accent); }
.formation-name { font-weight: 800; font-size: 1.05rem; }
.formation-slots { font-size: 0.85rem; color: var(--muted); }
.focus-line { font-size: 0.82rem; font-weight: 700; color: #a06b00; }
.formation-card .tag { justify-self: start; }
.formation-desc { color: var(--muted); margin: 0 0 1rem; }

.slot-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.slot {
  display: grid; gap: 0.6rem; align-content: start; border-radius: var(--radius);
  padding: 0.85rem; border: 1px solid var(--line); background: #fff;
}
.slot.is-empty { border: 2px dashed #cfd7e3; background: #fbfcfe; }
.slot.is-filled { box-shadow: var(--shadow); }
.slot.is-focus { border-color: var(--gold); }
.slot.is-focus.is-filled { box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.slot-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.focus-tag { white-space: nowrap; flex: none; background: #fff4d6; color: #8a5a00; font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 0.1rem 0.5rem; }
.slot-form { display: flex; gap: 0.5rem; }
.slot-form select { flex: 1; min-width: 0; min-height: 36px; padding: 0.35rem 0.5rem; }
.slot form { margin: 0; }

@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .topnav .who { display: none; }
  .topbar-inner { padding: 0.6rem 1rem; }
  .topnav { gap: 0.6rem; }
  .brand { font-size: 0.95rem; }
  .panel { padding: 1rem; }
  .formation-picker, .slot-grid { grid-template-columns: 1fr; }
}
