/* ============================================================
   GAFFER — Football Manager front-end
   Design system + components (dark, premium sports UI)
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

:root {
  /* Surfaces */
  --bg-0: #070a0f;
  --bg-1: #0c111a;
  --bg-2: #111927;
  --bg-3: #17212f;
  --bg-4: #1e2a3a;
  --glass: rgba(20, 29, 42, 0.72);

  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);

  /* Text */
  --txt: #e9eff6;
  --txt-2: #9db0c4;
  --txt-3: #667a90;

  /* Brand / accents */
  --accent: #17db8b;
  --accent-2: #10b877;
  --accent-ink: #05130c;
  --accent-glow: rgba(23, 219, 139, 0.35);
  --blue: #4aa3ff;
  --gold: #f4c556;
  --red: #ff5f6d;
  --amber: #f7a83b;
  --purple: #ab8bff;

  /* Rating tiers */
  --rt-elite: #21e08a;
  --rt-great: #8bd94f;
  --rt-good: #f4c556;
  --rt-avg: #f79a3b;
  --rt-low: #ef5f6d;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh: 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  --sh-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --sh-glow: 0 8px 30px -8px var(--accent-glow);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Sora", var(--font);

  --sidebar-w: 244px;
  --topbar-h: 66px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--txt);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden; /* app owns its own scroll regions */
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(23, 219, 139, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(74, 163, 255, 0.08), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }

a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
.tabnum { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* Scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 20px; border: 3px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: #2b3a4f; }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 900px) { .onboarding { grid-template-columns: 1fr; } .onboarding__aside { display: none; } }

.onboarding__aside {
  position: relative;
  overflow: hidden;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(160deg, rgba(23, 219, 139, 0.16), transparent 42%),
    linear-gradient(0deg, rgba(7, 10, 15, 0.9), rgba(7, 10, 15, 0.2)),
    var(--bg-1);
  border-right: 1px solid var(--line);
}
.onboarding__aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 72%);
          mask-image: radial-gradient(circle at 30% 40%, #000, transparent 72%);
  opacity: 0.5;
}
.brand-lockup { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.brand-lockup__mark {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: var(--sh-glow);
  font-size: 24px;
}
.brand-lockup__name { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand-lockup__sub { color: var(--txt-3); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }

.onboarding__pitch { position: relative; z-index: 1; }
.onboarding__headline { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.onboarding__headline em { font-style: normal; color: var(--accent); }
.onboarding__tag { color: var(--txt-2); font-size: 16px; margin-top: 18px; max-width: 30ch; }
.onboarding__stats { display: flex; gap: 30px; margin-top: 34px; position: relative; z-index: 1; }
.onboarding__stat b { font-family: var(--font-display); font-size: 26px; display: block; }
.onboarding__stat span { color: var(--txt-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; }

.onboarding__panel {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 44px;
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card__title { font-size: 26px; font-weight: 800; }
.auth-card__desc { color: var(--txt-2); margin-top: 8px; margin-bottom: 26px; font-size: 14.5px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; }
.sidebar__brand .brand-lockup__mark { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; }
.sidebar__brand b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.sidebar__brand span { font-size: 10px; color: var(--txt-3); letter-spacing: 0.16em; text-transform: uppercase; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { color: var(--txt-3); font-size: 10.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; padding: 16px 10px 7px; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--txt-2); font-weight: 500; font-size: 13.5px;
  position: relative; transition: background .14s, color .14s;
}
.nav__item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav__item:hover { background: var(--bg-2); color: var(--txt); }
.nav__item.active { background: linear-gradient(90deg, rgba(23,219,139,0.16), rgba(23,219,139,0.02)); color: #fff; }
.nav__item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: var(--sh-glow);
}
.nav__item.active svg { opacity: 1; color: var(--accent); }
.nav__badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 20px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.sidebar__foot { margin-top: auto; padding-top: 16px; }

.team-chip {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 11px;
}
.team-chip__meta { min-width: 0; }
.team-chip__meta b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-chip__meta span { display: block; font-size: 11.5px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Main column ---- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar__title { display: flex; flex-direction: column; }
.topbar__title h1 { font-size: 18px; font-weight: 700; }
.topbar__title span { font-size: 12px; color: var(--txt-3); }
.topbar__spacer { flex: 1; }

.hstat { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.hstat__ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-2); }
.hstat__ic svg { width: 17px; height: 17px; }
.hstat__meta { line-height: 1.15; }
.hstat__meta b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hstat__meta span { font-size: 10.5px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 0.06em; display: block; }
.topbar__divider { width: 1px; height: 30px; background: var(--line); }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; color: var(--txt-2);
  background: var(--bg-2); border: 1px solid var(--line); transition: .15s;
}
.icon-btn:hover { color: var(--txt); border-color: var(--line-2); background: var(--bg-3); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--red); color: #fff; border-radius: 20px; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg-0);
}

.view { flex: 1; overflow-y: auto; padding: 26px; scroll-behavior: smooth; }
.view__inner { max-width: 1320px; margin: 0 auto; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--txt-2); font-size: 13.5px; margin-top: 3px; }
.page-head__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  border: 1px solid transparent; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); box-shadow: var(--sh-glow); }
.btn--primary:hover { box-shadow: 0 10px 34px -8px var(--accent-glow); filter: brightness(1.05); }
.btn--ghost { background: var(--bg-2); border-color: var(--line); color: var(--txt); }
.btn--ghost:hover { background: var(--bg-3); border-color: var(--line-2); }
.btn--outline { background: transparent; border-color: var(--line-2); color: var(--txt); }
.btn--outline:hover { background: var(--bg-2); }
.btn--danger { background: rgba(255, 95, 109, 0.12); border-color: rgba(255,95,109,0.3); color: var(--red); }
.btn--danger:hover { background: rgba(255, 95, 109, 0.2); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn--advance {
  height: 44px; padding: 0 20px; font-size: 14.5px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  box-shadow: var(--sh-glow); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--advance:hover { filter: brightness(1.06); box-shadow: 0 12px 40px -8px var(--accent-glow); }
.btn--advance .wk { opacity: .7; font-weight: 600; }
.btn--advance svg { width: 18px; height: 18px; }

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__head h3 { font-size: 15px; font-weight: 700; }
.card__head .sub { color: var(--txt-3); font-size: 12px; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

/* KPI tile */
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px;
}
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi__ic svg { width: 19px; height: 19px; }
.kpi__label { color: var(--txt-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.kpi__val { font-family: var(--font-display); font-size: 27px; font-weight: 800; margin-top: 12px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__val small { font-size: 15px; color: var(--txt-3); font-weight: 600; }
.kpi__foot { margin-top: 6px; font-size: 12px; color: var(--txt-3); display: flex; align-items: center; gap: 6px; }
.kpi__delta { font-weight: 600; }
.kpi__delta.up { color: var(--accent); } .kpi__delta.down { color: var(--red); }
.tint-green .kpi__ic { background: rgba(23,219,139,.14); color: var(--accent); }
.tint-blue .kpi__ic { background: rgba(74,163,255,.14); color: var(--blue); }
.tint-gold .kpi__ic { background: rgba(244,197,86,.14); color: var(--gold); }
.tint-red .kpi__ic { background: rgba(255,95,109,.14); color: var(--red); }
.tint-purple .kpi__ic { background: rgba(171,139,255,.14); color: var(--purple); }

/* ============================================================
   BADGES
   ============================================================ */
.rating {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; color: #06120b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), var(--sh-sm);
}
.rating--sm { min-width: 27px; height: 27px; font-size: 12.5px; border-radius: 7px; }
.rating--lg { min-width: 56px; height: 56px; font-size: 26px; border-radius: 13px; }
.rating.elite { background: linear-gradient(160deg, #2affa0, var(--rt-elite)); }
.rating.great { background: linear-gradient(160deg, #a6e85f, var(--rt-great)); }
.rating.good  { background: linear-gradient(160deg, #ffd76b, var(--rt-good)); }
.rating.avg   { background: linear-gradient(160deg, #ffb256, var(--rt-avg)); }
.rating.low   { background: linear-gradient(160deg, #ff7b86, var(--rt-low)); }
.rating.unknown { background: var(--bg-4); color: var(--txt-2); box-shadow: inset 0 0 0 1px var(--line-2); }

.pos {
  display: inline-grid; place-items: center; min-width: 40px; height: 23px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pos.gk  { background: rgba(244,197,86,.16); color: var(--gold); }
.pos.def { background: rgba(74,163,255,.16); color: var(--blue); }
.pos.mid { background: rgba(23,219,139,.16); color: var(--accent); }
.pos.att { background: rgba(255,107,107,.16); color: #ff8080; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; background: var(--bg-3); color: var(--txt-2); border: 1px solid var(--line);
}
.tag.green { background: rgba(23,219,139,.12); color: var(--accent); border-color: rgba(23,219,139,.25); }
.tag.gold { background: rgba(244,197,86,.12); color: var(--gold); border-color: rgba(244,197,86,.25); }
.tag.red { background: rgba(255,95,109,.12); color: var(--red); border-color: rgba(255,95,109,.25); }
.tag.blue { background: rgba(74,163,255,.12); color: var(--blue); border-color: rgba(74,163,255,.25); }
.tag.purple { background: rgba(171,139,255,.12); color: var(--purple); border-color: rgba(171,139,255,.25); }
.tag--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============================================================
   CREST
   ============================================================ */
.crest { border-radius: 9px; flex: none; overflow: hidden; box-shadow: var(--sh-sm); }

/* ============================================================
   TABLE
   ============================================================ */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-3);
  background: var(--bg-1); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl thead th.num, .tbl td.num { font-variant-numeric: tabular-nums; }
.tbl thead th.ctr, .tbl td.ctr { text-align: center; }
.tbl tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.is-you { background: rgba(23,219,139,.06); }
.tbl tbody tr.is-you:hover { background: rgba(23,219,139,.1); }
.tbl tbody tr.is-you td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.player-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.player-cell__meta { min-width: 0; }
.player-cell__meta b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-cell__meta span { display: block; font-size: 11.5px; color: var(--txt-3); }

.pos-rank { width: 24px; text-align: center; font-weight: 700; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.zone-cl { box-shadow: inset 3px 0 0 var(--accent) !important; }
.zone-eu { box-shadow: inset 3px 0 0 var(--blue) !important; }
.zone-rel { box-shadow: inset 3px 0 0 var(--red) !important; }

/* mini avatar */
.avatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  font-family: var(--font-display);
}

/* form/morale dots + bars */
.meter { display: inline-block; vertical-align: middle; width: 74px; height: 7px; border-radius: 20px; background: var(--bg-4); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 20px; }
.meter.good > i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.meter.mid  > i { background: linear-gradient(90deg, #d59a2e, var(--gold)); }
.meter.bad  > i { background: linear-gradient(90deg, #d0454f, var(--red)); }

.formline { display: inline-flex; gap: 3px; }
.formline i { width: 15px; height: 15px; border-radius: 4px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; color: #06120b; }
.formline i.w { background: var(--accent); }
.formline i.d { background: var(--txt-3); color: #fff; }
.formline i.l { background: var(--red); color: #fff; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--txt-2); }
.input, .select {
  height: 42px; padding: 0 13px; border-radius: 10px;
  background: var(--bg-1); border: 1px solid var(--line-2); color: var(--txt);
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,219,139,.18); }
.input::placeholder { color: var(--txt-3); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667a90' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.field__row { display: flex; gap: 12px; }
.field__row > .field { flex: 1; }
.hint { font-size: 12px; color: var(--txt-3); }

.segmented { display: inline-flex; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented button { padding: 7px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--txt-2); transition: .12s; }
.segmented button:hover { color: var(--txt); }
.segmented button.active { background: var(--bg-3); color: #fff; box-shadow: var(--sh-sm); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  padding: 11px 15px; font-size: 13.5px; font-weight: 600; color: var(--txt-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .12s;
}
.tabs button:hover { color: var(--txt); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button .count { color: var(--txt-3); font-weight: 500; }

/* ============================================================
   PITCH (tactics)
   ============================================================ */
.pitch {
  position: relative; aspect-ratio: 68 / 98; width: 100%; max-width: 452px; margin: 0 auto;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #1a8f57, #117548);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--sh-lg);
}
.pitch__stripes { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255,255,255,.05) 0 9.5%, rgba(0,0,0,.04) 9.5% 19%); }
.pitch__lines { position: absolute; inset: 0; }
.pitch__lines::before, .pitch__lines::after { content: ""; position: absolute; border: 2px solid rgba(255,255,255,.4); }
.pitch__lines::before { left: 50%; top: 50%; width: 96px; height: 96px; border-radius: 50%; transform: translate(-50%,-50%); }
.pitch__lines::after { left: 4%; right: 4%; top: 50%; height: 0; border-width: 1px 0 0; }
.pitch__box { position: absolute; left: 22%; right: 22%; height: 15%; border: 2px solid rgba(255,255,255,.35); border-top: none; }
.pitch__box.top { top: 0; border-top: 2px solid rgba(255,255,255,.35); border-bottom: none; }
.pitch__box.bot { bottom: 0; }
.pitch__spot { position: absolute; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55); }

.token {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px;
  cursor: pointer;
}
.token__shirt {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px; color: #06120b;
  border: 2px solid rgba(255,255,255,.65); box-shadow: 0 6px 16px rgba(0,0,0,.45);
  position: relative;
}
.token__shirt .pnum { position: absolute; top: -7px; right: -7px; width: 19px; height: 19px; border-radius: 50%; background: #0b1220; color: #fff; font-size: 10px; display: grid; place-items: center; border: 1px solid var(--line-2); }
.token__name { font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; max-width: 82px; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.token__pos { font-size: 9.5px; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .05em; }

/* ============================================================
   PLAYER CARD (modal)
   ============================================================ */
.pcard { width: min(560px, 92vw); }
.pcard__hero {
  display: flex; gap: 18px; padding: 22px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(150deg, rgba(23,219,139,.14), transparent 60%), var(--bg-2);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.pcard__hero h3 { font-size: 22px; }
.pcard__hero .sub { color: var(--txt-2); font-size: 13px; margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard__attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; padding: 20px 22px; }
.attr { }
.attr__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.attr__top span { font-size: 12px; color: var(--txt-2); font-weight: 500; }
.attr__top b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.attr__bar { height: 6px; border-radius: 20px; background: var(--bg-4); overflow: hidden; }
.attr__bar > i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.def-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13.5px; }
.def-list dt { color: var(--txt-3); }
.def-list dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 12, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .18s ease;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); max-height: 90vh; overflow: auto; animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-1); z-index: 2; }
.modal__head h3 { font-size: 17px; }
.modal__body { padding: 20px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ============================================================
   TOASTS
   ============================================================ */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 260px; max-width: 380px;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 13px 15px; box-shadow: var(--sh-lg);
  animation: toastIn .28s cubic-bezier(.2,.9,.3,1.2);
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast__ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.toast__ic svg { width: 14px; height: 14px; }
.toast.success .toast__ic { background: rgba(23,219,139,.18); color: var(--accent); }
.toast.error .toast__ic { background: rgba(255,95,109,.18); color: var(--red); }
.toast.info .toast__ic { background: rgba(74,163,255,.18); color: var(--blue); }
.toast__msg { font-size: 13px; line-height: 1.4; }
.toast__msg b { display: block; font-weight: 700; margin-bottom: 1px; }
.toast__msg span { color: var(--txt-2); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ============================================================
   MISC
   ============================================================ */
.empty { text-align: center; padding: 50px 20px; color: var(--txt-3); }
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 14px; }
.empty h4 { color: var(--txt-2); font-size: 15px; margin-bottom: 5px; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bg-4); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.loading { display: grid; place-items: center; padding: 70px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.muted { color: var(--txt-3); }
.strong { font-weight: 700; }
.up { color: var(--accent); } .down { color: var(--red); }
.right { text-align: right; } .center { text-align: center; }
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.w-full { width: 100%; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.big-num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }

/* team selection grid (onboarding) */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.team-opt {
  display: flex; gap: 12px; align-items: center; text-align: left;
  padding: 13px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line);
  transition: .14s; width: 100%;
}
.team-opt:hover { border-color: var(--accent); background: var(--bg-3); transform: translateY(-2px); box-shadow: var(--sh); }
.team-opt__meta { min-width: 0; flex: 1; }
.team-opt__meta b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-opt__meta span { font-size: 11.5px; color: var(--txt-3); }
.team-opt__prestige { display: flex; gap: 1px; }
.team-opt__prestige i { width: 5px; height: 12px; border-radius: 2px; background: var(--bg-4); }
.team-opt__prestige i.on { background: var(--gold); }

/* inbox */
.msg { display: flex; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.msg:hover { background: rgba(255,255,255,.02); }
.msg.unread { background: rgba(74,163,255,.04); }
.msg__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 6px; flex: none; }
.msg.read .msg__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--txt-3); }
.msg__body { flex: 1; min-width: 0; }
.msg__body h4 { font-size: 14px; margin-bottom: 3px; font-family: var(--font); font-weight: 700; }
.msg__body p { color: var(--txt-2); font-size: 13px; line-height: 1.45; }
.msg__time { color: var(--txt-3); font-size: 11.5px; white-space: nowrap; }

/* scout card */
.scout-card { display: flex; align-items: center; gap: 14px; padding: 15px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.scout-card__stars { display: flex; gap: 2px; margin-top: 3px; }
.scout-card__stars svg { width: 13px; height: 13px; }

/* progress ring for youth scouting */
.ring { --p: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: var(--txt-2);
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-4) 0); }
.ring > span { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .hstat { display: none; }
  .topbar__divider { display: none; }
}
