/* Typefaces copied locally from kickbase.com's own webfonts (kickbase.com doesn't send CORS headers,
   so cross-origin @font-face would get silently blocked by the browser) */
@font-face {
  font-family: 'KB Pitch';
  src: url('../assets/fonts/KBPitch-Still.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'KB Pitch';
  src: url('../assets/fonts/KBPitch-Run.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'KB Pitch';
  src: url('../assets/fonts/KBPitch-Sprint.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'KB volksans';
  src: url('../assets/fonts/KB_volksans_Light.woff2') format('woff2');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'KB volksans';
  src: url('../assets/fonts/KB_volksans_Normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'KB volksans';
  src: url('../assets/fonts/KB_volksans_SemiBold.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'KB volksans';
  src: url('../assets/fonts/KB_volksans_Bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'KB volksans';
  src: url('../assets/fonts/KB_volksans_Black.woff2') format('woff2');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  /* Kickbase brand tokens (from kickbase.com production CSS: --kb-*, --success, --destructive) */
  --kb-live-red: #ff4600;
  --kb-rush-purple: #9747ff;
  --kb-rush-dark-purple: #1b0c2f;
  --kb-midnight: #0d1014;
  --kb-charcoal: #181c22;
  --kb-graphite: #191a1e;
  --kb-concrete-grey: #7e8187;
  --kb-dark-grey: #474b4e;
  --kb-white: #dee4ec;
  --kb-black: #131417;
  --kb-success: #22c55e;
  --kb-error: #ef4444;
  /* Exact quality-gradient palette given directly by the user (hex codes,
     not sampled/guessed), positive -> negative: bright green, green,
     orange, red. Used everywhere a score/quality gets graded on a scale
     (matchday points, ⌀-Quote/Gesamt-Quote, PFPA/PFPT) — a distinct scale
     from --kb-success/--kb-error above, which are this app's own simple
     binary positive/negative color (profit/loss, market value diff), not
     part of this 4-step grading language. */
  --kb-grade-excellent: #69d98c;
  --kb-grade-great: #aadb61;
  --kb-grade-average: #df8c40;
  --kb-grade-bad: #eb5628;

  --font-display: 'KB Pitch', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'KB volksans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg: var(--kb-midnight);
  --surface: var(--kb-charcoal);
  --surface-alt: var(--kb-graphite);
  --text: var(--kb-white);
  --text-dim: var(--kb-concrete-grey);
  --border: rgba(126, 129, 135, 0.22);

  --brand: var(--kb-live-red);
  --brand-dim: rgba(255, 70, 0, 0.16);
  --positive: var(--kb-success);
  --positive-dim: rgba(34, 197, 94, 0.16);
  --negative: var(--kb-error);
  --negative-dim: rgba(239, 68, 68, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-alt: #eceef1;
    --text: var(--kb-black);
    --text-dim: var(--kb-dark-grey);
    --border: rgba(71, 75, 78, 0.16);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  padding-top: var(--safe-t);
}

button, input {
  font-family: inherit;
  color: inherit;
}

a { color: var(--brand); }

#app { min-height: 100%; }

.splash {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

.spinner.sm { width: 16px; height: 16px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  gap: 24px;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(151, 71, 255, 0.28), transparent 60%),
    radial-gradient(90% 50% at 90% 110%, rgba(255, 70, 0, 0.22), transparent 60%),
    var(--kb-midnight);
}

.login-screen h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--kb-white);
}

.login-form {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.login-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
}

.login-form input:focus {
  outline: none;
  border-color: var(--brand);
}

.error-text {
  color: var(--negative);
  font-size: 13px;
  margin: 0;
}

/* ---------- Layout ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.icon-button {
  background: none;
  border: none;
  font-size: 20px;
  padding: 8px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}

.icon-button .icon {
  display: flex;
}

.icon-button .icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
}

.rankings-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

/* Embedded FotMob match report, opened by tapping a played matchday on
   PlayerDetailView. Sits above every other overlay (z-index 60 is the
   highest anything else in the app uses). */
.fotmob-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.fotmob-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-t));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.fotmob-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.stat-compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 14px 14px;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}

.stat-box.wide {
  grid-column: span 2;
}

.stat-box-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-box-value {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.delta-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.delta-card.positive .delta-value { color: var(--positive); }
.delta-card.negative .delta-value { color: var(--negative); }
.delta-card.neutral .delta-value { color: var(--text-dim); }

.delta-label {
  font-weight: 700;
  font-size: 13px;
}

.delta-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.shot-list {
  margin: 0 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.shot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 12px;
}

.shot-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.shot-minute {
  width: 30px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.shot-icon {
  width: 18px;
  text-align: center;
}

.shot-xg {
  color: var(--text-dim);
}

.fotmob-external-link {
  display: block;
  margin: 0 14px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
}

.scroll-top-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-b));
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Header + filter/sort toolbars pinned together as one sticky block, so
   scrolling the list never scrolls the filters out of reach — no more
   scrolling back to the very top just to change a sort. */
.rankings-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.rankings-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-t));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.rankings-title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.search-input-header {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
}

.search-input-header:focus {
  outline: none;
  border-color: var(--brand);
}

.scout-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.scout-toggle .scout-icon {
  font-size: 14px;
}

.scout-toggle.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Predicted-lineup status: a colored circle overlaid on the avatar, same
   placement/style Kickbase's own app uses, collapsed to the 3 levels
   lib/lineup-status.js derives (no badge at all = not mentioned). */
.lineup-status-badge {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--surface);
}

.lineup-status-badge.guaranteed { background: #2f6fed; }
.lineup-status-badge.likely { background: var(--positive); }
.lineup-status-badge.suggested { background: var(--kb-grade-average); }
.lineup-status-badge.out { background: var(--kb-dark-grey); }

/* Small inline variant for player-list tiles (Squad/Market/Rankings),
   sitting right next to the position-pill instead of overlaid on an
   avatar — same colors/icons, just not absolutely positioned. */
.lineup-status-badge.inline {
  position: static;
  display: inline-flex;
  transform: none;
  width: 13px;
  height: 13px;
  font-size: 8px;
  border: none;
  margin-left: 3px;
  vertical-align: middle;
}

/* Minimal win-probability bars (FixtureDifficultyBars), same 13px row
   height as .lineup-status-badge.inline so they sit flush next to it. */
.fixture-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
  margin-left: 4px;
  vertical-align: middle;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.fixture-bar-track {
  width: 4px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--surface-alt);
  border-radius: 1px;
  overflow: hidden;
}

.fixture-bar-fill {
  width: 100%;
  border-radius: 1px;
}

.fixture-bar-fill.excellent { background: var(--kb-grade-excellent); }
.fixture-bar-fill.great { background: var(--kb-grade-great); }
.fixture-bar-fill.average { background: var(--kb-grade-average); }
.fixture-bar-fill.bad { background: var(--kb-grade-bad); }

/* Pitch variant (LineupView) — overlaid on the avatar's bottom-left
   corner, mirroring LineupStatusBadge's ".corner" on the bottom-right, so
   both indicators fit on the small 42px pitch avatar without widening the
   slot. */
.fixture-bars.corner-left {
  position: absolute;
  left: -2px;
  bottom: -2px;
  margin-left: 0;
  height: 10px;
  padding: 1px 2px;
  background: var(--bg);
  border-radius: 3px;
}

.fixture-bars.corner-left .fixture-bar-track {
  width: 3px;
}

/* Pitch variant (LineupView): a corner badge overlaid on the small pitch
   avatar's bottom-right edge, like a status/notification dot — sits half
   on/half off the circle rather than fully inside or fully above it. */
.pitch-avatar-wrap {
  position: relative;
}

.lineup-status-badge.corner {
  position: absolute;
  left: auto;
  right: -2px;
  bottom: -2px;
  transform: none;
  width: 15px;
  height: 15px;
  font-size: 9px;
  border: 2px solid #fff;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 14px 0;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 14px 0;
}

.section-label-row .section-label {
  padding: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h2h-btn {
  flex-shrink: 0;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Head-to-head match list: collapsed by default, one row per fixture,
   expands in place (no separate route/overlay) to reveal both teams'
   predicted lineups stacked below via PredictedLineup. */
.h2h-match {
  padding-bottom: 4px;
}

.h2h-match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
}

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

.h2h-team-away {
  justify-content: flex-end;
  text-align: right;
}

.h2h-crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.h2h-team-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h2h-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.h2h-kickoff {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.h2h-caret {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.h2h-caret.open {
  transform: rotate(180deg);
}

/* Predicted-lineup formation (ligainsider.de scrape): rows stacked exactly
   as the source page lays them out (row 1 = goalkeeper, last row = attack)
   — not relabeled by Kickbase position, since a slot's row reflects this
   specific formation's shape, not the player's own position. */
.predicted-lineup {
  padding: 8px 14px 4px;
}

.lineup-formation {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lineup-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lineup-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 74px;
}

.lineup-candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lineup-photo-wrap {
  position: relative;
}

.lineup-candidate img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
  border: 2px solid var(--text-dim);
  display: block;
}

.lineup-rating-bubble {
  position: absolute;
  left: -4px;
  top: -4px;
  min-width: 18px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lineup-candidate .lineup-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.lineup-alternates {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.6;
}

.lineup-alternate {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  line-height: 1;
  color: var(--text-dim);
  white-space: nowrap;
}

.lineup-alternate img {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
  flex-shrink: 0;
}

/* Only candidates PredictedLineup could resolve to a real Kickbase player
   id get a pointer cursor — an unresolved name (rare, but possible) stays
   inert rather than looking clickable and doing nothing. */
.lineup-candidate.clickable,
.lineup-alternate.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.matchday-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 14px 14px;
}

.season-divider {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  align-self: stretch;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}

.season-divider span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}

.matchday-card {
  flex-shrink: 0;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.matchday-card.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.matchday-card.current .matchday-label {
  color: var(--brand);
}

.matchday-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}

.matchday-crests {
  display: flex;
  gap: 2px;
  align-items: center;
}

.matchday-crests img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.matchday-score {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.matchday-bar-track {
  width: 26px;
  height: 120px;
  background: var(--surface-alt);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.matchday-bar-fill {
  position: relative;
  width: 100%;
  border-radius: 6px 6px 0 0;
  overflow: visible;
}

.matchday-bar-fill.excellent { background: var(--kb-grade-excellent); }
.matchday-bar-fill.great { background: var(--kb-grade-great); }
.matchday-bar-fill.average { background: var(--kb-grade-average); }
.matchday-bar-fill.bad { background: var(--kb-grade-bad); }

.matchday-events {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.matchday-event-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.matchday-points {
  font-weight: 700;
  font-size: 15px;
}

.matchday-points.excellent { color: var(--kb-grade-excellent); }
.matchday-points.great { color: var(--kb-grade-great); }
.matchday-points.average { color: var(--kb-grade-average); }
.matchday-points.bad { color: var(--kb-grade-bad); }

/* Fixture difficulty strip (PlayerDetailView) — same 4-tier grade palette
   as matchday points, driven by real bookmaker-odds win probability
   instead of a points score. Condensed to slim inline pills, not cards —
   this is a "quick glance" row, not a section that deserves real estate. */
.fixture-difficulty {
  display: flex;
  gap: 6px;
  padding: 2px 14px 10px;
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.fixture-difficulty-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.fixture-difficulty-crest {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.fixture-difficulty-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixture-difficulty-pct {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.fixture-difficulty-item.excellent .fixture-difficulty-pct { color: var(--kb-grade-excellent); }
.fixture-difficulty-item.great .fixture-difficulty-pct { color: var(--kb-grade-great); }
.fixture-difficulty-item.average .fixture-difficulty-pct { color: var(--kb-grade-average); }
.fixture-difficulty-item.bad .fixture-difficulty-pct { color: var(--kb-grade-bad); }

/* Team-difficulty ranking (TeamDifficultyRankingView) — 18 clubs, one
   compact row each. */
.team-difficulty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.team-difficulty-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.team-difficulty-rank {
  width: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
}

.team-difficulty-crest {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-difficulty-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-difficulty-pcts {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.team-difficulty-pct {
  width: 32px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.team-difficulty-pct.excellent { color: var(--kb-grade-excellent); }
.team-difficulty-pct.great { color: var(--kb-grade-great); }
.team-difficulty-pct.average { color: var(--kb-grade-average); }
.team-difficulty-pct.bad { color: var(--kb-grade-bad); }

.matchday-minutes {
  font-size: 11px;
  color: var(--text-dim);
}

.season-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.season-stats-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.season-stats-values {
  display: flex;
  gap: 20px;
}

.season-stat {
  text-align: right;
}

.season-stat .label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.season-stat .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ---------- Similar players (PlayerDetailView) ---------- */

.similar-players-label {
  margin-bottom: 8px;
}

.similar-players {
  margin: 0 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.similar-row {
  display: grid;
  grid-template-columns: 18px 22px 1fr 32px 40px 56px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.similar-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.similar-row.self {
  background: var(--brand-dim);
  cursor: default;
}

.similar-row.similar-header {
  cursor: default;
  padding: 4px 10px;
  background: var(--surface-alt);
}

.similar-header .similar-col,
.similar-header .similar-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.similar-rank {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

.similar-row .avatar {
  width: 22px;
  height: 22px;
}

.similar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.similar-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.similar-col.mv {
  color: var(--text-dim);
  font-size: 11px;
}

.player-card.highlighted {
  box-shadow: 0 0 0 2px var(--brand) inset;
  border-radius: var(--radius-md);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  height: calc(var(--nav-h) + var(--safe-b));
  z-index: 20;
}

.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}

.bottom-nav button .icon {
  display: flex;
}

.bottom-nav button .icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.bottom-nav button.active {
  color: var(--brand);
}

/* ---------- League switcher ---------- */

.league-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 0;
  cursor: pointer;
}

.league-button .chevron {
  color: var(--text-dim);
  font-size: 12px;
}

/* ---------- Sheets / modals ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
  max-height: 80vh;
  overflow-y: auto;
}

.sheet h3 {
  font-weight: 700;
  margin: 0 0 14px;
  font-size: 17px;
}

.sheet-close {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 15px;
}

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

.league-list button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
}

.league-list button.selected {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

.league-list-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--negative-dim);
  color: var(--negative);
  font-size: 15px;
  font-weight: 600;
}

.league-list-logout .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-list button {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-list button.selected {
  background: var(--brand-dim);
  color: var(--brand);
  font-weight: 600;
}

.action-list button:disabled {
  opacity: 0.4;
}

/* ---------- Buttons ---------- */

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  color: #ffffff;
}

.btn.primary:disabled {
  opacity: 0.5;
}

.btn.secondary {
  background: var(--surface-alt);
  color: var(--text);
}

.btn.block { width: 100%; }

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.sheet-actions .btn { flex: 1; }

/* ---------- Search ---------- */

.search-bar {
  padding: 10px 14px 4px;
}

.search-bar input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--brand);
}

/* ---------- Trading assistant (Market tab) ---------- */

.trading-assistant {
  margin: 6px 14px 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.trading-assistant-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.trading-assistant-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--positive);
}

.trading-assistant-icon svg { width: 100%; height: 100%; }

.trading-assistant-label { flex: 1; }

.trading-assistant-count {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--positive-dim);
  color: var(--positive);
  font-size: 12px;
  font-weight: 700;
}

.trading-assistant-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.trading-assistant-chevron svg { width: 100%; height: 100%; }

.trading-assistant.open .trading-assistant-chevron { transform: rotate(180deg); }

.trading-assistant-body {
  padding: 0 10px 10px;
}

.trading-assistant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trading-assistant-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.trading-assistant-top {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.trading-assistant-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trading-assistant-expiry {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
}

.trading-assistant-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trading-assistant-value {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.trading-assistant-spark {
  flex: 1;
  min-width: 0;
  height: 28px;
}

.trading-assistant-trend {
  margin-top: 0;
  flex-shrink: 0;
}

.trading-assistant-bid {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 999px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.micro-sparkline {
  display: block;
  overflow: visible;
}

.micro-sparkline path {
  stroke: var(--positive);
  stroke-width: 2;
}

.micro-sparkline.negative path {
  stroke: var(--negative);
}

.empty-state.small {
  padding: 20px;
  font-size: 13px;
}

/* ---------- Toolbar (sort chips etc) ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px 2px;
}

.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--brand-dim);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* ---------- Summary bar ---------- */

.summary-bar {
  display: flex;
  padding: 14px;
  gap: 10px;
}

/* Market-value progression sparkline (PlayerDetailView) — plain inline
   SVG, no charting library. */
.mv-chart {
  padding: 4px 14px 12px;
}

.mv-chart-surface {
  position: relative;
  touch-action: none;
}

.mv-chart-svg {
  width: 100%;
  height: 90px;
  display: block;
}

.mv-chart-guide {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.mv-chart-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--positive);
  border: 2px solid var(--bg);
  pointer-events: none;
}

.mv-chart-dot.negative {
  background: var(--negative);
}

.mv-chart-tooltip {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.mv-chart-tooltip-date {
  font-size: 9px;
  color: var(--text-dim);
}

.mv-chart-tooltip-value {
  font-size: 12px;
  font-weight: 700;
}

.mv-chart-area {
  fill: color-mix(in srgb, var(--positive) 18%, transparent);
}

.mv-chart-area.negative {
  fill: color-mix(in srgb, var(--negative) 18%, transparent);
}

.mv-chart-line {
  stroke: var(--positive);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.mv-chart-line.negative {
  stroke: var(--negative);
}

.mv-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.mv-chart-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mv-chart-labels .mv-chart-label:last-child {
  align-items: flex-end;
}

.mv-chart-label-title {
  font-size: 10px;
  color: var(--text-dim);
}

.mv-chart-label-value {
  font-size: 13px;
  font-weight: 700;
}

.summary-card {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.summary-card .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-card .value {
  font-weight: 700;
  font-size: 19px;
  margin-top: 2px;
}

.summary-card .value.positive { color: var(--positive); }
.summary-card .value.negative { color: var(--negative); }

/* ---------- Player list / cards ---------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 14px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}

.player-card {
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card .row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.manager-row {
  cursor: pointer;
}

.player-link {
  cursor: pointer;
}

.manager-rank {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dim);
}

.manager-rank.top {
  color: var(--brand);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-info .name {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info .subline {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.owner-name {
  margin-left: 4px;
}

.position-pill {
  display: inline-block;
  background: color-mix(in srgb, var(--kb-dark-grey) 55%, var(--surface));
  color: var(--kb-white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 2px;
  margin-right: 4px;
}

.analysis-tile {
  padding-bottom: 10px;
}

/* Metric pairs: each "concept" (Punkte, Quote, PM€, PFP) shown as one card
   with its average-based value stacked directly above its total-based
   value, so the two are visually the two sides of the same coin instead of
   living in separate average/total blocks. */
.metric-pairs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}

/* PlayerDetailView isn't wrapped in .player-card (which normally supplies
   horizontal padding), so it needs the same inset the Statistik section's
   .analysis-grid.page-grid already gets. */
.metric-pairs.page-grid {
  margin-top: 0;
  padding: 8px 14px 14px;
}

.metric-pair {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 7px;
  min-width: 0;
}

.metric-pair-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.metric-pair-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}

.metric-pair-row.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.metric-pair-row.positive { color: var(--positive); }
.metric-pair-row.negative { color: var(--negative); }
.metric-pair-row.muted { opacity: 0.55; }

.metric-pair-row .tag {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  opacity: 0.75;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.analysis-grid.page-grid {
  padding: 8px 14px 14px;
}

.analysis-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 6px;
  min-width: 0;
}

.analysis-item.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.analysis-item.clickable:active {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-alt));
  border-color: var(--brand);
}

.analysis-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}

.analysis-value.positive { color: var(--positive); }
.analysis-value.negative { color: var(--negative); }
.analysis-value.muted { color: var(--text-dim); opacity: 0.7; }
.analysis-value.secondary { color: var(--text-dim); font-weight: 600; }

.player-stats {
  text-align: right;
  flex-shrink: 0;
}

.player-stats .mv {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.diff-badge.positive { background: color-mix(in srgb, var(--positive) 25%, var(--surface)); color: var(--positive); }
.diff-badge.negative { background: color-mix(in srgb, var(--negative) 25%, var(--surface)); color: var(--negative); }
.diff-badge.muted { background: var(--surface-alt); color: var(--text-dim); }

/* Clickable variant (PriceTrendBadge): a plain <button> reset onto the same
   pill so today/3-day/7-day cycle without looking like a different control. */
.trend-badge {
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.trend-period {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 1px;
}

.pl-indicator {
  font-size: 10px;
  font-weight: 600;
  margin-top: 7px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.pl-indicator span.positive { color: var(--positive); }
.pl-indicator span.negative { color: var(--negative); }

.offer-row {
  display: flex;
  justify-content: space-between;
  background: var(--brand-dim);
  color: var(--brand);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.offer-list {
  flex-direction: column;
  gap: 3px;
}

.offer-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.offer-user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-amount {
  flex-shrink: 0;
}

.value-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-family: inherit;
  cursor: pointer;
}

.value-amount {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.value-expiry {
  font-size: 12px;
  font-weight: 600;
  color: var(--kb-white);
}

/* ---------- Avatar ---------- */

.avatar {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: visible;
  background: var(--surface-alt);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}

/* ---------- Offer sheet ---------- */

.offer-price {
  font-weight: 700;
  font-size: 26px;
  margin: 4px 0 12px;
}

.offer-percent {
  color: var(--text-dim);
  font-size: 13px;
  margin: 8px 0 0;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  transform: translateX(-50%);
  background: var(--kb-white);
  color: var(--kb-black);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* ---------- Lineup ---------- */

.pitch {
  margin: 12px auto 0;
  max-width: 350px;
  aspect-ratio: 0.92;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #234d2c, #16321d);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 6px 4px;
}

.pitch::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  pointer-events: none;
}

.pitch-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 2px;
}

.pitch-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pitch-formation {
  position: absolute;
  bottom: 8px;
  left: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pitch-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  width: 56px;
}

.pitch-slot .avatar { width: 42px; height: 42px; border: 2px solid #fff; border-radius: 50%; }
.pitch-slot .avatar img { border-radius: 50%; }

.pitch-slot .name-tag {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.squad-groups {
  display: flex;
  gap: 10px;
  padding: 14px;
}

.squad-group {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 120px;
}

.squad-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.squad-group.transfer h4 { color: var(--negative); }

.chip-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 54px;
  cursor: pointer;
  background: none;
  border: none;
}

.chip-player .avatar { width: 40px; height: 40px; border-radius: 50%; }
.chip-player .avatar img { border-radius: 50%; }

.chip-player .name-tag {
  font-size: 9px;
  color: var(--text-dim);
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Activity feed ---------- */

.feed-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0 14px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.feed-avatar {
  flex-shrink: 0;
  cursor: pointer;
}

.feed-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.feed-body {
  flex: 1;
  min-width: 0;
}

/* Text and timestamp share one line — the timestamp sits flush right next
   to whatever text it belongs to instead of on its own indented row below,
   which is what made the list feel sparse/disjointed before. */
.feed-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.feed-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.feed-subtext {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1px;
}

.feed-player-link {
  font-weight: 700;
  cursor: pointer;
}

.feed-highlight {
  font-weight: 700;
  margin-left: 2px;
  color: var(--text);
  white-space: nowrap;
}

.feed-highlight.positive { color: var(--positive); }
.feed-highlight.negative { color: var(--negative); }

.feed-time {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.feed-comments-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 3px 0 0;
}

.feed-comments {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-comment {
  display: flex;
  gap: 8px;
}

.feed-comment-body {
  flex: 1;
  min-width: 0;
}

.feed-comment-name {
  font-size: 12px;
  font-weight: 700;
}

.feed-comment-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: 6px;
}

.feed-comment-text {
  font-size: 12px;
  margin-top: 2px;
}

.feed-load-more {
  display: flex;
  justify-content: center;
  padding: 16px;
}
