:root {
  /* Kickbase-Markenfarben (https://brand.kickbase.com/color, Stand 2026):
     KB Black #131417, KB Live Red #FF4600, KB White #DEE4EC,
     KB Dark Grey #474B4E, KB Grey #7E8187, KB Light Grey #A8ADB4.
     KB Live Red ist laut Guideline bewusst der EINZIGE Akzent ("sparingly
     and purposefully") - hier als --accent fuer Buttons/aktive Zustaende/
     Marke sowie als --danger fuer Kauf-/Kostenanzeigen wiederverwendet.
     --good (Gruen) ist KEINE Kickbase-Markenfarbe, sondern eine bewusste,
     funktionale Ausnahme fuer Verkauf/Einnahmen-Anzeigen - ohne sie waeren
     Kauf/Verkauf-Betraege farblich nicht mehr unterscheidbar. Warnhinweise
     nutzen KB Dark Grey statt eines erfundenen Gelb/Amber, da die Palette
     keinen dritten Farbton vorsieht. */
  --bg: #eef0f2;
  --surface: #ffffff;
  --border: #dee4ec;
  --text: #131417;
  --text-muted: #7e8187;
  --accent: #ff4600;
  --accent-soft: #ffe2d1;
  --danger: #ff4600;
  --danger-soft: #ffe2d1;
  --good: #16a34a;
  --good-soft: #dcfce7;
  --warning: #474b4e;
  --warning-soft: #f1f2f3;
  --sidebar-from: #131417;
  --sidebar-to: #202226;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html {
  /* Unterbindet iOS Safaris "Rubber-Band"-Ueberzieh-Effekt am oberen/unteren
     Rand - dabei verschiebt WebKit intern kurzzeitig den Viewport, wodurch
     "position: fixed"-Elemente (Fussleiste, FAB-Buttons) sichtbar mitwandern
     statt fixiert zu bleiben (Nutzer-Vorgabe 2026-08-24: "Fussleiste
     scrollt ab und zu mit nach oben"). */
  overscroll-behavior-y: none;
}
body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior-y: none;
}

a { color: inherit; }

.app-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--sidebar-from);
  animation: app-splash-fade 1.1s ease forwards;
}
.app-splash img {
  width: 96px; height: 96px; border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  animation: app-splash-pop 0.6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes app-splash-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes app-splash-fade {
  0%, 60% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-from), var(--sidebar-to));
  color: #cbd5e1;
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  padding: 0.4rem 0.6rem 1.4rem;
}

.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.25);
}

.sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }

.nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0.9rem 0.6rem 0.3rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  color: #cbd5e1;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar a .icon { flex-shrink: 0; opacity: 0.85; }

.sidebar a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.sidebar a.active {
  background: var(--accent);
  color: #fff;
}
.sidebar a.active .icon { opacity: 1; }

/* ---------- Main content ---------- */
/* padding-bottom reserviert Platz fuer die fixen FAB-Buttons (Reload,
   Rotieren, Simulator-Reihenfolge etc.) - ohne das koennen sie am Seitenende
   die letzten Elemente ueberlagern und deren Klicks abfangen (Nutzer-Bug
   2026-08-24: "Visualisierung anzeigen"/"Uebernehmen" reagierten nicht,
   weil sie genau dort lagen). */
main { flex: 1; min-width: 0; padding: 2rem 2.5rem 6rem; max-width: none; }

h1 { font-size: 1.5rem; margin: 0 0 1.1rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 0.8rem; }
h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; color: var(--text-muted); }

.icon { display: inline-block; vertical-align: -4px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.page-header h1 { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.page-header .icon { color: var(--accent); flex-shrink: 0; }
.back-to-dashboard {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; color: var(--text-muted); text-decoration: none;
  white-space: nowrap;
}
.back-to-dashboard:hover { color: var(--text); }

/* ---------- Cards / tiles ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
}

.stat-row { display: flex; gap: 1rem; margin: 0 0 1.5rem; flex-wrap: wrap; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.4rem;
  min-width: 190px;
  flex: 1;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; }

/* ---------- KPI-Kacheln (Transfermarkt) - drei Zeilen, nur der Wert
   traegt Farbe, Kachel selbst bleibt neutral. Beschriftung oben und
   Kennzahl unten jeweils linksbuendig. ---------- */
.kpi-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; margin-bottom: 0.9rem; }
.kpi-tile {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  text-align: left;
  min-width: 170px; flex: 1 0 170px;
}
.kpi-tile .stat-value { font-size: 1.3rem; }
.stat-value.kpi-good { color: var(--good); }
.stat-value.kpi-yellow { color: #ca8a04; }
.stat-value.kpi-orange { color: #ea580c; }
.stat-value.kpi-bad { color: var(--danger); }

.pos-kpi-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pos-kpi {
  flex: 1; min-width: 60px; text-align: center;
  border-radius: 10px; padding: 0.4rem 0.3rem;
  background: var(--bg); border: 1px solid var(--border);
}
.pos-kpi .pos-kpi-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }
.pos-kpi .pos-kpi-value { font-size: 1.15rem; font-weight: 700; }
.pos-kpi .pos-kpi-value.kpi-bad { color: var(--danger); }

/* ---------- Transfers: durchrotierende Kennzahl je Manager/Position ---------- */
.pos-rotate-kpi { display: flex; flex-direction: column; max-width: 100%; }
.pos-rotate-kpi .pos-rotate-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }
.pos-rotate-kpi .pos-rotate-value { font-size: 0.95rem; font-weight: 700; white-space: normal; word-break: break-word; }
.pos-rotate-kpi .pos-rotate-detail {
  display: block; font-size: 0.72rem; font-weight: 400;
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
}
.manager-block-header { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; width: 100%; }
.manager-block-name { font-size: 0.95rem; font-weight: 700; }
.pos-rotate-swap-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 0.25rem; cursor: pointer; color: var(--text-muted); flex-shrink: 0;
}
.pos-rotate-swap-btn:hover { color: var(--accent); border-color: var(--accent); }
.league-wide-card { border: 2px solid var(--accent); }

/* ---------- Positions-Verteilungsbalken (100% gestapelt) ---------- */
.pos-dist-bar {
  display: flex; width: 100%; height: 30px; border-radius: 8px;
  overflow: hidden; background: var(--bg);
}
.pos-dist-seg {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem; font-weight: 700;
  min-width: 2px; transition: filter 0.15s ease, transform 0.15s ease;
  cursor: default;
}
.pos-dist-seg:hover { filter: brightness(1.15); transform: scaleY(1.08); }
.pos-dist-1 { background: #6d28d9; }
.pos-dist-2 { background: #1d4ed8; }
.pos-dist-3 { background: #15803d; }
.pos-dist-4 { background: #b91c1c; }
.pos-dist-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
.pos-dist-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.pos-dist-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Tables ---------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 1.5rem;
}
table { border-collapse: collapse; width: 100%; min-width: max-content; }
th, td { padding: 0.65rem 1rem; text-align: left; vertical-align: middle; font-size: 0.9rem; }
th {
  background: #fafbfd;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #fafcff; }
tr.me { background: var(--accent-soft); }
tr.me:hover { background: var(--accent-soft); }

.budget-list { display: flex; flex-direction: column; gap: 0.8rem; }
.budget-card.me { border: 2px solid var(--accent); }
.budget-card-head {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem;
}
.budget-card-photo {
  width: 34px; height: 34px; border-radius: 50%; background: var(--bg) center/cover no-repeat;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.budget-card-name { font-weight: 700; font-size: 1.02rem; }
.budget-range { display: flex; align-items: stretch; gap: 0.6rem; margin-bottom: 0.8rem; }
.budget-range-single { margin-bottom: 0.8rem; }
.budget-range-tile {
  flex: 1 1 0; border-radius: 10px; padding: 0.5rem 0.8rem;
  background: var(--bg); border: 1px solid var(--border);
}
.budget-range-tile.good { background: var(--good-soft); border-color: var(--good); }
.budget-range-tile.bad { background: var(--danger-soft); border-color: var(--danger); }
.budget-range-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.budget-range-tile.good .budget-range-value { color: var(--good); }
.budget-range-tile.bad .budget-range-value { color: var(--danger); }
.budget-range-value { font-weight: 700; font-size: 1.1rem; }
.budget-range-arrow { display: flex; align-items: center; color: var(--text-muted); font-size: 1.1rem; }
.budget-breakdown-toggle { margin-top: 0.4rem; }
.budget-breakdown-toggle > summary {
  cursor: pointer; font-size: 0.8rem; color: var(--text-muted); list-style: none;
  padding: 0.2rem 0; user-select: none;
}
.budget-breakdown-toggle > summary::-webkit-details-marker { display: none; }
.budget-breakdown-toggle > summary::before { content: "▸ "; }
.budget-breakdown-toggle[open] > summary::before { content: "▾ "; }
.budget-breakdown-toggle[open] > summary { margin-bottom: 0.3rem; }
.budget-breakdown { display: flex; flex-direction: column; gap: 0.15rem; }
.budget-group-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); margin-top: 0.6rem;
}
.budget-group-title:first-child { margin-top: 0; }
.budget-line {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.85rem; padding: 0.15rem 0;
}
.budget-line span:first-child { color: var(--text-muted); }
@media (max-width: 480px) {
  .budget-range { flex-direction: column; }
  .budget-range-arrow { display: none; }
}

.good { color: var(--good); font-weight: 700; }
.bad { color: var(--danger); font-weight: 700; }

.standings-separator td {
  padding: 0.65rem 1rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--danger); background: var(--danger-soft, #fee2e2);
  border-top: 2px dashed var(--danger); border-bottom: none !important;
}
tr.standings-last { background: var(--danger-soft, #fee2e2); }
tr.standings-last:hover { background: var(--danger-soft, #fee2e2); }
.standings-relegation { color: var(--danger); margin-left: 0.3rem; vertical-align: middle; }

.rank-change { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.rank-change-up { color: var(--good); }
.rank-change-down { color: var(--danger); }
.rank-change-flat {
  color: var(--text-muted); width: 10px; height: 10px; background: var(--border);
  border-radius: 2px; display: inline-block;
}

.badge-beta {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent);
  color: #fff;
  padding: 1px 5px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.15rem;
}
.feature-tile { position: relative; }
.feature-tile .badge-beta { position: absolute; top: 0.6rem; right: 0.6rem; margin: 0; }

/* ---------- Favoriten-Stern auf Dashboard-Kacheln (Nutzer-Vorgabe
   2026-09-07): steuert, welche Kacheln zusaetzlich in der mobilen
   Fussleiste (siehe base.html mobile-primary) erscheinen. ---------- */
.feature-tile-wrap { position: relative; }
.feature-tile-fav-form { position: absolute; top: 0.5rem; right: 0.5rem; margin: 0; z-index: 3; }
.feature-tile-fav-btn {
  background: rgba(19,20,23,0.35); border: none; border-radius: 50%;
  width: 26px; height: 26px; font-size: 1rem; line-height: 1;
  color: rgba(255,255,255,0.75); cursor: pointer; display: flex;
  align-items: center; justify-content: center; padding: 0;
}
.feature-tile-fav-btn.feature-tile-fav-active { color: #f5b301; }

/* ---------- Settings / Toggle-Schalter ---------- */
.toggle-row { display: flex; align-items: center; gap: 0.9rem; }
.lineup-toggle-card { margin-bottom: 1.2rem; padding: 0.75rem 1rem; }
.lineup-toggle-card .toggle-row { flex-wrap: wrap; }
.lineup-toggle-card .toggle-row-label { flex: 1 1 auto; font-weight: 600; min-width: 0; }
.lineup-toggle-card select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 0.9rem;
  max-width: 100%; flex-shrink: 1;
}
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 999px; transition: 0.15s;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge.pos-1 { background: #ede9fe; color: #6d28d9; }
.badge.pos-2 { background: #dbeafe; color: #1d4ed8; }
.badge.pos-3 { background: #dcfce7; color: #15803d; }
.badge.pos-4 { background: #fee2e2; color: #b91c1c; }
.badge.buy { background: var(--danger-soft); color: var(--danger); }
.badge.sell { background: var(--good-soft); color: var(--good); }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.offer { background: var(--accent-soft); color: var(--accent); font-weight: 700; gap: 0.25rem; }

/* ---------- Aktive Marktplatz-Gebote ---------- */
tr.has-offer { background: var(--accent-soft); }
tr.has-offer:hover { background: var(--accent-soft); }
tr.has-offer td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.market-divider-row td, .market-mobile-divider {
  display: flex !important;
  align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 0.8rem !important;
  margin: 0.3rem 0;
  color: #fff !important;
  background: var(--accent) !important;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  border: none !important;
  box-shadow: 0 2px 8px rgba(255, 70, 0, 0.35);
}
.market-mobile-divider { margin: 0.6rem 0; }
tr.market-divider-row td span, .market-mobile-divider span { white-space: nowrap; }
/* Simulator: Trennstrich vor Verkaeufen, die erst nach dem naechsten
   Spieltagsbeginn ablaufen (Nutzer-Vorgabe 2026-09-02). */
.sim-divider-row {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 0.8rem; margin: 0.5rem 0;
  color: #fff; background: var(--accent); border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(255, 70, 0, 0.35);
}
.sim-divider-row span { white-space: nowrap; }
tr.auto-offer { background: #dbeafe; }
tr.auto-offer:hover { background: #dbeafe; }
tr.auto-offer td:first-child { box-shadow: inset 3px 0 0 #1d6fe0; }

.bid-cell-wrap { position: relative; display: inline-block; }
.bid-cell {
  width: 130px; padding: 0.4rem 0.6rem; font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.bid-cell::placeholder { color: var(--text-muted); }
.bid-cell.has-bid {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 700;
  padding-right: 2.4rem;
}
.bid-cell:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.bid-clear-x {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.3rem; line-height: 1;
  cursor: pointer; user-select: none;
}
.bid-clear-x:hover, .bid-clear-x:active { background: var(--danger); }

.bid-diff-hint { font-size: 0.72rem; font-weight: 600; }
.bid-diff-hint.hint { font-weight: 400; }
.bid-meta-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; flex-wrap: wrap; }

/* ---------- Popup fuer Gebote (touch-/PWA-freundlich) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(19, 20, 23, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.4rem; width: 100%; max-width: 340px; box-shadow: var(--shadow);
  max-height: 92vh; overflow-y: auto;
}
.modal-title { font-weight: 700; margin-bottom: 0.9rem; font-size: 0.95rem; }
.modal-input {
  width: 100%; padding: 0.75rem 0.8rem; font-size: 1.1rem;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.1rem;
}
.modal-actions { display: flex; gap: 0.6rem; }
.modal-actions button {
  flex: 1; padding: 0.8rem; border-radius: 8px; font-weight: 600;
  font-size: 0.9rem; border: none; cursor: pointer; min-height: 44px;
}
#bid-modal-no { background: var(--bg); color: var(--text); }
#bid-modal-yes { background: var(--accent); color: #fff; }
#bid-modal-yes:focus { outline: 3px solid #131417; outline-offset: 2px; }

.star { color: #f5a623; font-size: 1rem; line-height: 1; flex-shrink: 0; }

.star-toggle {
  background: none; border: none; margin: 0;
  font-size: 1.05rem; line-height: 1; cursor: pointer;
  color: var(--light-star, #c7cbd1); flex-shrink: 0;
  width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
.star-toggle.active { color: #f5a623; }
.star-toggle:hover { color: #f5a623; opacity: 0.8; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.55rem 0.8rem; font-size: 0.82rem; font-weight: 600; color: var(--text);
  cursor: pointer; min-height: 40px;
}
.icon-btn:hover { background: var(--bg); }
.view-toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 640px) {
  .app-shell { flex-direction: column; }
  main { padding: 1.2rem; padding-bottom: 5.5rem; }
  .kpi-tile { min-width: 140px; }

  /* Mobile: Sidebar wird zu einer unten fixierten, horizontal scrollbaren
     Navigationsleiste (Icon + kleines Label je Eintrag) statt der
     hochkant-Liste am oberen Bildschirmrand. */
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; height: auto;
    padding: 0;
    z-index: 20;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  }
  .sidebar .brand { display: none; }
  .sidebar nav {
    flex-direction: row;
    gap: 0;
    width: 100%;
    padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom));
  }
  .sidebar .nav-section { display: none; }
  /* Nur die wichtigsten Bereiche stehen unten - alles andere ist ueber
     die Dashboard-Kacheln erreichbar (Nutzer-Entscheidung, um die Leiste
     nicht mit zu vielen Icons zu ueberladen). */
  .sidebar a { display: none; }
  .sidebar a.mobile-primary {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.3rem;
    font-size: 0.68rem;
    text-align: center;
    border-radius: 8px;
  }
  .sidebar a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .sidebar a .icon { opacity: 0.85; }
  .sidebar a .badge-beta { display: none; }
}

table.sortable-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable-table th[data-sort]:hover { color: var(--text); }
table.sortable-table th[data-sort].sorted-asc::after { content: " \25B2"; font-size: 0.65em; }
table.sortable-table th[data-sort].sorted-desc::after { content: " \25BC"; font-size: 0.65em; }

.market-card-name-row { display: flex; align-items: center; gap: 0.6rem; }
.market-card-name-block { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.market-card-meta { display: flex; align-items: center; gap: 0.3rem; }

/* ---------- Mobile Kartenansicht (PWA/Smartphone) ---------- *
 * Verwandelt Zeilen von table.mobile-cards in Karten: Foto+Name oben,
 * Punkte/Ablaufzeit rechts, Marktwert + Gebotsfeld darunter - angelehnt an
 * die offizielle Kickbase-App-Ansicht auf dem Handy. Sekundaere Spalten
 * (Team, Position, Rabatt, Saisonpunkte, Verkaeufer, Hinzugefuegt am)
 * werden ausgeblendet, um die Karte schlank zu halten. */
@media (max-width: 700px) {
  table.mobile-cards thead, table.mobile-cards tfoot { display: none; }
  table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr, table.mobile-cards td {
    display: block; width: 100%;
  }
  table.mobile-cards { min-width: 0; }
  table.mobile-cards tr {
    display: flex; flex-wrap: wrap; align-items: baseline;
    padding: 0.8rem 0.9rem; gap: 0.15rem 0.6rem;
  }
  table.mobile-cards td { border: none !important; padding: 0 !important; width: auto; }

  table.mobile-cards td[data-col="name"] {
    order: 1; flex: 1 1 100%; margin-bottom: 0.35rem;
  }
  table.mobile-cards td[data-col="name"] a { font-weight: 700; font-size: 0.95rem; }
  table.mobile-cards td[data-col="name"] .timeline-photo { width: 44px; height: 44px; }

  table.mobile-cards td[data-col="avg_points"] {
    order: 2; margin-left: auto; text-align: right; font-size: 0.85rem; color: var(--text-muted);
  }
  table.mobile-cards td[data-col="avg_points"]::before { content: "\00D8 "; }
  table.mobile-cards td[data-col="expires_in_seconds"] {
    order: 3; text-align: right; font-size: 0.8rem;
  }

  table.mobile-cards td[data-col="market_value"] {
    order: 4; flex: 1 1 100%; font-weight: 600; padding-top: 0.3rem !important;
    border-top: 1px solid var(--border) !important; margin-top: 0.3rem;
  }
  table.mobile-cards td[data-col="offer"],
  table.mobile-cards td[data-col="offers"] { order: 5; flex: 1 1 100%; margin-top: 0.5rem; }
  table.mobile-cards td[data-col="offer"] .bid-cell-wrap,
  table.mobile-cards td[data-col="offer"] .bid-cell { width: 100%; }

  table.mobile-cards td[data-col="team"],
  table.mobile-cards td[data-col="pos"],
  table.mobile-cards td[data-col="discount_pct"],
  table.mobile-cards td[data-col="total_points"],
  table.mobile-cards td[data-col="change_24h"],
  table.mobile-cards td[data-col="seller"],
  table.mobile-cards td[data-col="listed_at"],
  table.mobile-cards td[data-col="price"] { display: none; }

  /* Nutzer-konfigurierbare Zusatzfelder (siehe "Mobile-Ansicht"-Button) -
     ueberschreibt die Standard-Sichtbarkeit oben. */
  table.mobile-cards td.mf-show {
    display: block !important; order: 3; flex: 1 1 100%;
    font-size: 0.78rem; color: var(--text-muted); padding: 0.1rem 0 !important;
  }
  table.mobile-cards td.mf-show::before { content: attr(data-mobile-label) ": "; font-weight: 600; }
  table.mobile-cards td.mf-hide { display: none !important; }

  /* Transfermarkt (Kauf/Gebote/Verkauf): auf dem Handy wird die Tabelle durch
     eine eigene Kartenliste ersetzt (.market-mobile-list), die 1:1 die
     Aufstellungs-Bank-Kachel (.bench-card) wiederverwendet - siehe Regeln
     unterhalb dieses @media-Blocks fuer die Kartenoptik selbst. */
  .market-desktop-only { display: none; }

  /* Transfers-Tabelle: eigene Kartenreihenfolge (Spieler, Preis, Datum,
     Marktwert damals, Differenz immer sichtbar; Art/Team/Von/Zu ueber
     "Mobile-Ansicht" zuschaltbar). */
  #transfers-table.mobile-cards td[data-col="amount"] {
    order: 2; margin-left: auto; text-align: right; font-weight: 700;
  }
  #transfers-table.mobile-cards td[data-col="date"] {
    order: 3; flex: 1 1 100%; text-align: right; font-size: 0.8rem; color: var(--text-muted);
  }
  #transfers-table.mobile-cards td[data-col="market_value"] {
    order: 4; flex: 1 1 100%; padding-top: 0.3rem !important;
    border-top: 1px solid var(--border) !important; margin-top: 0.3rem;
  }
  #transfers-table.mobile-cards td[data-col="overpaid"] { order: 5; flex: 1 1 100%; font-size: 0.85rem; }
  #transfers-table.mobile-cards td[data-col="kind"],
  #transfers-table.mobile-cards td[data-col="team"],
  #transfers-table.mobile-cards td[data-col="seller"],
  #transfers-table.mobile-cards td[data-col="buyer"] { display: none; }

  /* Kader-Tabelle: Spieler + Marktwert immer sichtbar, Rest ueber
     "Mobile-Ansicht" zuschaltbar. */
  #squad-table.mobile-cards td[data-col="market_value"] {
    order: 2; flex: 1 1 100%; font-weight: 700; padding-top: 0.3rem !important;
    border-top: 1px solid var(--border) !important; margin-top: 0.3rem;
  }
  #squad-table.mobile-cards td[data-col="team"],
  #squad-table.mobile-cards td[data-col="pos"],
  #squad-table.mobile-cards td[data-col="change_24h"],
  #squad-table.mobile-cards td[data-col="total_points"],
  #squad-table.mobile-cards td[data-col="avg_points"],
  #squad-table.mobile-cards td[data-col="status"] { display: none; }

  /* Scouting-Tabelle: Spieler + Marktwert immer sichtbar, Rest ueber
     "Mobile-Ansicht" zuschaltbar. */
  #scouting-table.mobile-cards td[data-col="market_value"] {
    order: 2; flex: 1 1 100%; font-weight: 700; padding-top: 0.3rem !important;
    border-top: 1px solid var(--border) !important; margin-top: 0.3rem;
  }
  #scouting-table.mobile-cards td[data-col="team"],
  #scouting-table.mobile-cards td[data-col="pos"],
  #scouting-table.mobile-cards td[data-col="change_24h"],
  #scouting-table.mobile-cards td[data-col="avg_points"],
  #scouting-table.mobile-cards td[data-col="total_points"],
  #scouting-table.mobile-cards td[data-col="status"] { display: none; }

  /* Spielersuche-Tabelle: Spieler + Marktwert immer sichtbar, Rest ueber
     "Mobile-Ansicht" zuschaltbar. */
  #search-table.mobile-cards td[data-col="market_value"] {
    order: 2; flex: 1 1 100%; font-weight: 700; padding-top: 0.3rem !important;
    border-top: 1px solid var(--border) !important; margin-top: 0.3rem;
  }
  #search-table.mobile-cards td[data-col="team"],
  #search-table.mobile-cards td[data-col="pos"],
  #search-table.mobile-cards td[data-col="avg_points"],
  #search-table.mobile-cards td[data-col="total_points"] { display: none; }
}

/* ---------- Dashboard Feature-Kacheln ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}
.feature-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.feature-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(16,24,40,0.12); }
.feature-tile .icon { color: var(--accent); }

/* ---------- Player card grid (Kader) ---------- */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}
.player-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #eef1f6 center/cover no-repeat;
  border: 2px solid var(--border);
  position: relative;
}
.risk-badge {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ---------- S11-Wahrscheinlichkeits-Badge (Aufstellung) ---------- */
.s11-badge {
  position: absolute; top: -5px; left: -5px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 2;
}
.s11-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.s11-badge.s11-sicher { background: #1d6fe0; }
.s11-badge.s11-erwartet { background: #16a34a; }
.s11-badge.s11-unsicher { background: #e08a1d; }
.s11-badge.s11-unwahrscheinlich { background: #e04b1d; }
.s11-badge.s11-ausgeschlossen { background: #1f2430; }
.s11-badge.s11-unknown { background: var(--text-muted); font-size: 11px; font-weight: 700; }

/* ---------- Status-Badge (Verletzung/Aufbautraining, Aufstellung) ---------- */
.status-badge {
  position: absolute; top: -5px; right: -5px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 2;
}
.status-badge svg { width: 13px; height: 13px; flex-shrink: 0; }
.status-badge.status-injured { background: var(--danger); }
.status-badge.status-stricken { background: #e08a1d; }
.status-badge.status-rehab { background: #6b7280; }
.status-badge.status-suspended { background: #1f2430; }
.status-badge.status-unknown { background: var(--danger); }

/* ---------- LigaInsider-Mini-Badge (S11-Status, Aufstellung) ---------- */
/* Nutzer-Vorgabe 2026-09-02: 3-farbig UND deutliche Icons statt Logo -
   gruen+Haken = sicher in der S11, orange+Fragezeichen = Wackelkandidat
   (in beide Richtungen tauschbar), rot+Ausrufezeichen = nicht in der S11.
   Icons wiederverwenden das bestehende s11_icon-Macro (lineup.html). */
.li-mini-badge {
  position: absolute; bottom: -5px; left: -5px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  z-index: 2;
}
.li-mini-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.li-mini-badge-starter { background: var(--good); }
.li-mini-badge-alternate { background: #e08a1d; }
.li-mini-badge-bench { background: #d9534f; }
/* Fuer die Kader-Liste im Optimierungs-Reiter (kein Foto-Overlay, sondern
   normaler Zeileninhalt) - analog zu .s11-badge-static. */
.li-mini-badge-static { position: static; margin-left: 0.2rem; box-shadow: none; }
/* Veraltete LigaInsider-Prognose (bezieht sich noch auf den letzten statt
   den naechsten Spieltag) - Icon bleibt erkennbar, aber sichtbar "abgeblasst"
   markiert statt in normaler Signalfarbe (Nutzer-Vorgabe 2026-09-07). */
.li-mini-badge-stale { filter: grayscale(70%); opacity: 0.55; border-style: dashed; }
/* Aktualitaet nicht ermittelbar (z.B. Ligainsider-Seite ohne erkennbares
   Gegner-Wappen) - bewusst optisch von "aktuell" UNTERSCHEIDBAR, aber nicht
   so alarmierend wie "veraltet" (Nutzer-Fund 2026-09-07: manche Vereine
   zeigten trotz tatsaechlich veralteter Aufstellung faelschlich volle Farbe,
   weil die Gegner-Erkennung fehlschlug - lieber ehrlich "unklar" markieren). */
.li-mini-badge-unknown { filter: grayscale(100%); opacity: 0.7; }

/* ---------- Naechster-Gegner-Badge (Aufstellung, optional per Settings) --- */
/* Sitzt als Overlay unterhalb des Spielernamens/der Punkte (nicht mehr am
   Foto), damit sie nicht Name/Foto ueberlappt (siehe pitch-player padding-bottom). */
.opponent-badge {
  position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3px;
  background: #1f2430; border: 2px solid #fff; border-radius: 999px;
  padding: 2px 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 3; white-space: nowrap;
}
/* Nutzer-Vorgabe 2026-08-28: auf dem Spielfeld (Swap-Anzeige "Naechster
   Gegner") ueberdeckt das Badge sonst den Spielernamen - dort etwas weiter
   nach unten versetzt als der Standard-Wert. */
.pitch-opponent-badge { bottom: -16px; }
.opponent-badge-vs {
  color: #fff; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.02em;
}
.opponent-badge img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; border-radius: 50%; }
.opponent-badge img.opponent-badge-own { box-shadow: 0 0 0 2px #ffd23f; }
.opponent-badge-static { position: static; transform: none; display: inline-flex; vertical-align: -6px; margin-left: 0.2rem; }

.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.bench-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.1rem;
}
.bench-card .player-photo {
  flex-shrink: 0;
  width: 84px; height: 84px;
}
.bench-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  text-align: left;
}
.bench-card-body .player-name { font-size: 1.15rem; }
.bench-card-body .player-team { margin-bottom: 0.15rem; }
.bench-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
}

/* ---------- Transfermarkt-Mobilkarten (wiederverwendet .bench-card) ---------- */
.market-mobile-list { display: none; flex-direction: column; gap: 0.9rem; margin-bottom: 1.5rem; }
.market-mobile-card { position: relative; flex-wrap: wrap; }
.market-mobile-card.has-offer { background: var(--accent-soft); }
.market-mobile-card.auto-offer { background: #dbeafe; border-color: #1d6fe0; }
.market-mobile-star {
  position: absolute; top: 0.9rem; right: 0.9rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.market-mobile-star .star-toggle { font-size: 1.4rem; }
.market-card-star-desktop { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.bid-info-btn {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--text-muted); background: var(--surface); color: var(--text-muted);
  font-size: 0.72rem; font-weight: 700; font-style: italic; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bid-info-btn:hover { border-color: var(--accent); color: var(--accent); }
.bid-info-body { max-height: 70vh; overflow-y: auto; text-align: left; }
.bid-info-group { margin-bottom: 0.9rem; }
.bid-info-group:last-child { margin-bottom: 0; }
.bid-info-group-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.3rem; }
.bid-info-group-title.good { color: var(--good); }
.bid-info-group-title.bad { color: var(--danger); }
.bid-info-group ul { margin: 0; padding-left: 1.2rem; font-size: 0.88rem; }
.bid-info-group li { margin-bottom: 0.15rem; }
.market-mobile-actions {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
.market-mobile-value { font-weight: 700; }
/* Untereinander statt nebeneinander - bei langem Marktwert (breites
   Gebotsfeld) UND langer Ablaufzeit passten beide nicht in eine Zeile und
   der Rest der Kachel rutschte unkontrolliert um (siehe Patson Daka). */
.market-mobile-bid-row { display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem; }
.market-mobile-bid-row .bid-cell-group { width: 100%; }
.market-mobile-bid-row .bid-cell-wrap { width: 100%; }
.market-mobile-bid-row .bid-cell { width: 100%; }
.market-mobile-bid-row .countdown { display: block; font-size: 0.8rem; }
.market-mobile-seller-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; vertical-align: -3px; margin-right: 0.3rem; }
.market-mobile-seller-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text-muted);
}
.market-mobile-card.team-limit-blocked { opacity: 0.55; filter: grayscale(0.6); }
.market-mobile-card.team-limit-blocked .bid-cell { cursor: not-allowed; }
.market-mobile-card.team-limit-exclusive { border: 2px solid var(--good); background: var(--good-soft); }

/* ---------- "Spieler"-Bereich: Spieler im Kader eines ANDEREN Managers -
   gelten als nicht verfuegbar und werden ausgegraut (Nutzer-Vorgabe
   2026-08-18: "als waere der Spieler nicht verfuegbar" - gilt auch, wenn
   der Spieler gleichzeitig auf dem Markt angeboten wird). ---------- */
.market-mobile-card.owned-by-other { opacity: 0.55; filter: grayscale(0.7); }
.owned-by-other-badge { background: var(--text-muted); color: #fff; }
.owned-by-other-text { color: var(--text-muted); font-weight: 600; }
.pos-group-title { margin-top: 1.6rem; display: flex; align-items: center; gap: 0.5rem; }
tr.owned-by-other { opacity: 0.55; filter: grayscale(0.7); }
/* ---------- Automatische Gebote (Beta) ---------- */
.autobid-panel { padding: 1.2rem 1.4rem; }
.autobid-main-toggle { margin-bottom: 0.2rem; }
.autobid-rule-box {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--accent-soft); color: #8a2200;
  border-radius: var(--radius); padding: 0.8rem 1rem;
  margin: 0.8rem 0; font-size: 0.85rem;
}
.autobid-rule-numbers {
  display: flex; flex-wrap: wrap; gap: 0.9rem;
  margin-top: 0.5rem; font-size: 0.85rem; color: var(--text);
}
.autobid-rule-numbers .bad { color: var(--danger); }
.autobid-rule-numbers .good { color: var(--good); }
.autobid-status {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--good-soft); color: #0d5c2c;
  border-radius: var(--radius); padding: 0.7rem 1rem;
  margin: 0.8rem 0; font-size: 0.9rem;
}
.autobid-status .icon-btn {
  background: #fff; border-color: var(--good); color: #0d5c2c;
  white-space: nowrap;
}
.autobid-status-danger { background: var(--accent-soft); color: #8a2200; }
.autobid-status-danger .icon-btn { border-color: var(--danger); color: var(--danger); }
.autobid-status-stack { flex-direction: column; align-items: stretch; }
.autobid-status-stack-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }
.autobid-status-stack form { width: 100%; }
.autobid-status-stack .icon-btn { width: 100%; justify-content: center; }
.autobid-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.8rem;
}
.autobid-option {
  display: flex; gap: 0.8rem;
  background: var(--bg, #f7f8fa); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 1rem;
}
.autobid-option-icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.autobid-option-body { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; flex: 1; }
.autobid-option-body label { font-weight: 600; font-size: 0.88rem; }
.autobid-option-body input[type="number"] { width: 100%; max-width: 8rem; }
.autobid-option-inputs { display: flex; align-items: center; gap: 0.4rem; }
.autobid-option-inputs input[type="number"] { width: 5.5rem; max-width: none; }

.bid-cell-wrap-locked .bid-cell { padding-right: 2.1rem; border-color: var(--danger); background: var(--danger-soft, #ffe2d1); }
.bid-kind-badge {
  display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.68rem; font-weight: 700;
  padding: 0.1rem 0.4rem; border-radius: 999px; width: fit-content; flex-shrink: 0;
}
.bid-kind-auto { background: #1d6fe0; color: #fff; }
.bid-kind-manual { background: var(--accent); color: #fff; }

/* ---------- App-Icon-Auswahl (Einstellungen) ---------- */
.icon-picker { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.icon-picker-option {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  width: 100px; padding: 0.6rem; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: center; font-size: 0.72rem; color: var(--text-muted);
}
.icon-picker-option:hover { border-color: var(--accent); }
.icon-picker-option.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.icon-picker-option img { width: 56px; height: 56px; border-radius: 12px; }
.icon-picker-option input[type="radio"] { display: none; }
.bid-cell-lock {
  position: absolute; top: 50%; right: 0.5rem; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 2; pointer-events: none;
}
tr.team-limit-blocked { opacity: 0.55; filter: grayscale(0.6); }
tr.team-limit-exclusive td:first-child { box-shadow: inset 3px 0 0 var(--good); }
@media (max-width: 700px) {
  .market-mobile-list { display: flex; }
}

.lineup-alert {
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--danger-soft, #ffe2d1); border: 2px solid var(--danger);
  color: #8a2200; border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: -0.4rem 0 1.4rem; font-size: 1.05rem;
}
.lineup-alert svg { flex-shrink: 0; color: var(--danger); }

.s11-legend {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.2rem; padding: 0.8rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.s11-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.s11-badge-static { position: static; }
.player-name { font-weight: 700; font-size: 0.95rem; }
.player-team { font-size: 0.78rem; color: var(--text-muted); }
.player-meta { display: flex; gap: 0.6rem; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.player-meta b { color: var(--text); }

/* ---------- Transfers timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.2rem;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.timeline-icon.buy { background: var(--danger-soft); color: var(--danger); }
.timeline-icon.sell { background: var(--good-soft); color: var(--good); }
.timeline-photo {
  width: 34px; height: 34px; border-radius: 50%; background: #eef1f6 center/cover no-repeat;
  flex-shrink: 0;
}
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 0.9rem; font-weight: 600; }
.timeline-sub { font-size: 0.78rem; color: var(--text-muted); }
.timeline-amount { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

/* ---------- Pitch / Aufstellung ---------- */
.pitch-wrap { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.pitch {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(0deg, #1f9d4a 0, #1f9d4a 11.11%, #22ab52 11.11%, #22ab52 22.22%);
  border: 3px solid rgba(255,255,255,0.85);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pitch-team-summary {
  position: absolute; bottom: 22px; left: 22px; z-index: 5;
  display: flex; flex-direction: column; gap: 0.1rem;
  background: rgba(0,0,0,0.4); border-radius: 8px; padding: 0.3rem 0.5rem;
  color: rgba(255,255,255,0.85); font-size: 0.7rem; font-weight: 600; line-height: 1.3;
}
.pitch-legend-btn {
  position: absolute; bottom: 10px; right: 10px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: 2px solid #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pitch-swap-btn {
  /* Nutzer-Vorgabe 2026-08-24: sticky rechts unten statt nur auf der
     Spielfeld-Ecke, damit die Anzeige jederzeit erreichbar ist, auch wenn
     weiter unten (Bank etc.) gescrollt wurde. */
  position: fixed; right: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 15;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); color: var(--text-muted); border: 1.5px solid var(--text-muted);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pitch-swap-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .pitch-swap-btn { bottom: calc(5.5rem + env(safe-area-inset-bottom)); right: 0.8rem; }
}
.pitch-swap-label {
  position: fixed; right: 1rem; bottom: calc(1.2rem + 46px + 0.6rem + env(safe-area-inset-bottom));
  z-index: 15; background: var(--surface); border: 1.5px solid var(--text-muted);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .pitch-swap-label { right: 0.8rem; bottom: calc(5.5rem + 46px + 0.6rem + env(safe-area-inset-bottom)); }
}
.pitch::before {
  content: "";
  position: absolute; inset: 10px;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 6px;
}
.pitch::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 90px; height: 90px; margin: -45px 0 0 -45px;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 50%;
}
.pitch-row {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  justify-content: space-evenly;
  padding: 0 0.5rem;
}
.pitch-player {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  width: 78px;
  padding-bottom: 10px;
}
/* Nutzer-Vorgabe 2026-09-06: Spieler, deren Vereinsspiel im aktuellen
   Spieltag schon angepfiffen wurde, hervorheben - Prognose ist dann nicht
   mehr spekulativ (gespielt oder nicht steht faktisch fest). */
.pitch-player-played .pitch-photo { opacity: 0.55; filter: grayscale(40%); }
.bench-card-played .player-photo { opacity: 0.55; filter: grayscale(40%); }
.played-tag { color: var(--good); font-size: 0.6em; }
.pitch-photo {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff center/cover no-repeat;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  position: relative;
}
.pitch-photo.risk { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 70, 0, 0.45); }
.pitch-name {
  font-size: 0.72rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px;
}
.pitch-points {
  font-size: 0.66rem; color: #eafff0;
  background: rgba(0,0,0,0.35); border-radius: 999px; padding: 0 0.4rem;
}

/* ---------- Spieltags-Balkenchart (Spielerseite) ---------- */
.bar-chart-scroll { overflow-x: auto; overflow-y: hidden; margin-bottom: 0.6rem; }
.bar-chart-plot { position: relative; }
.gridlines { position: absolute; left: 0; right: 0; bottom: 0; top: 0; pointer-events: none; }
.gridline {
  position: absolute; left: 34px; right: 0; height: 1px;
  background: var(--border);
}
.gridline span {
  position: absolute; left: -34px; top: -7px; width: 30px;
  font-size: 0.62rem; color: var(--text-muted); text-align: right;
}
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px;
  min-width: max-content; padding: 0.4rem 0.2rem 0;
  margin-left: 34px; position: relative;
}
.bar-col {
  display: flex; flex-direction: column; align-items: center;
  width: 34px; flex-shrink: 0;
}
.bar-badges {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 36px; justify-content: flex-end; margin-bottom: 3px;
}
.bar-badge {
  font-size: 0.6rem; font-weight: 700; border-radius: 4px;
  padding: 0 4px; color: #fff; white-space: nowrap;
}
.bar-badge.goal { background: var(--accent); }
.bar-badge.assist { background: #2563eb; }
.bar-points {
  font-size: 0.68rem; font-weight: 700; color: var(--text);
  height: 14px; margin-bottom: 2px;
}
.bar-track {
  height: 150px; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.bar {
  width: 100%; background: var(--accent);
  border-radius: 4px 4px 0 0; min-height: 2px;
}
.bar.sub { background: #b8c2cf; }
.bar-footer { height: 32px; display: flex; flex-direction: column; align-items: center; padding-top: 3px; }
.bar-minutes { font-size: 0.62rem; color: var(--text-muted); }
.bar-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }

/* ---------- Drag & Drop Aufstellung ---------- */
.dnd-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1.2rem;
}
.dnd-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 120px;
  padding: 0.6rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dnd-zone.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.dnd-chip {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  cursor: grab;
  font-size: 0.85rem;
}
.dnd-chip:active { cursor: grabbing; opacity: 0.7; }
.dnd-chip.drag-over-chip { outline: 2px solid var(--accent); background: var(--accent-soft); }

/* ---------- Vereins-Wappen-Chips (Spielersuche) ---------- */
.team-crest-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem; font-size: 0.78rem; font-weight: 600;
  color: var(--text); cursor: pointer;
}
.team-crest-chip img { width: 20px; height: 20px; object-fit: contain; }
.team-crest-chip:hover { background: var(--bg); }
.team-crest-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- "Spieler"-Bereich: platzsparende Icon-only-Filterchips ---------- */
.team-crest-chip-icon-only {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  cursor: pointer;
}
.team-crest-chip-icon-only img { width: 20px; height: 20px; object-fit: contain; }
.team-crest-chip-icon-only span { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); }
.team-crest-chip-icon-only:hover { background: var(--bg); }
.team-crest-chip-icon-only.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.pos-filter-chip {
  background: none; border: 2px solid transparent; border-radius: 20px; padding: 0; cursor: pointer;
}
.pos-filter-chip:hover { border-color: var(--border); }
.pos-filter-chip.active { border-color: var(--accent); }
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-grid-compact { gap: 0.3rem; }
.player-filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem;
}
.player-filter-grid label {
  display: block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.3rem;
}
.player-filter-grid input[type="text"], .player-filter-grid input[type="number"] {
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.88rem; width: 100%; box-sizing: border-box;
}
.player-filter-range { display: flex; align-items: center; gap: 0.4rem; }
.player-filter-range input { min-width: 0; flex: 1 1 0; }
.player-filter-range span { color: var(--text-muted); flex-shrink: 0; }

@media (max-width: 640px) {
  .dnd-columns { grid-template-columns: 1fr; }
}

/* ---------- Suggestions ---------- */
.suggestion-card {
  border: 1px solid var(--warning);
  background: var(--warning-soft);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.suggestion-header { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; margin-bottom: 0.3rem; }
.suggestion-reasons { font-size: 0.85rem; color: #3a3d40; margin: 0 0 0.7rem; padding-left: 1.1rem; }
.candidate-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.candidate-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.candidate-chip b { font-size: 0.86rem; }

/* ---------- Misc ---------- */
pre {
  background: #131417; color: #dee4ec; padding: 1rem;
  border-radius: var(--radius); overflow-x: auto; max-height: 500px;
  font-size: 0.82rem;
}
.error {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: var(--danger-soft); color: #8a2200;
  padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1.2rem;
  font-size: 0.9rem;
}
.error-retry-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: auto; background: #8a2200; color: #fff; border: none;
  border-radius: 8px; padding: 0.4rem 0.8rem; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.error-retry-btn:hover { opacity: 0.9; }
.warning-box {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: var(--warning-soft); color: #33363a;
  padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1.2rem;
  font-size: 0.85rem;
}
.hint { color: var(--text-muted); font-size: 0.85rem; }
form input { padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; }
form button {
  padding: 0.5rem 1rem; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
form button:hover { background: #cc3800; }
form button:disabled { background: #a8adb4; cursor: not-allowed; }
form input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Filter form ---------- */
.filter-form {
  display: flex; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.filter-form label {
  display: block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.3rem;
}
.filter-form select, .filter-form input[type="number"] {
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.88rem; min-width: 140px;
}
.filter-form input[type="number"] { min-width: 100px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 0.4rem; margin-bottom: 1.3rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 15; background: var(--bg);
}
.tab-btn {
  border: none; background: none; cursor: pointer;
  padding: 0.6rem 1rem; font-size: 0.92rem; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }

/* ---------- Transfermarkt-Simulator ---------- */
.sim-summary {
  display: flex; gap: 0.6rem; flex-wrap: nowrap;
  position: sticky; top: 46px; z-index: 10;
  margin-bottom: 1.2rem;
}
.sim-summary-item {
  display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 0.6rem 0.8rem; min-width: 0;
}
.sim-summary-label { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-summary-value {
  font-size: clamp(0.85rem, 4vw, 1.15rem); font-weight: 700;
  white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.sim-summary-value.good { color: var(--good); }
.sim-summary-value.bad { color: var(--danger); }
@media (max-width: 480px) {
  .sim-summary-item { padding: 0.5rem 0.6rem; }
  .sim-summary-label { font-size: 0.62rem; }
  .sim-summary-value { font-size: 1rem; }
}
.sim-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.3rem; }
.sim-select-all-btn {
  background: none; border: none; padding: 0; margin-left: 0.6rem;
  text-decoration: underline; cursor: pointer; font-size: 0.8rem;
}
.sim-select-all-btn:hover { color: var(--accent); }
.s11-static-badge { background: #1d6fe0; color: #fff; font-size: 0.65rem; }
.sim-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.8rem; cursor: pointer; font-size: 0.88rem;
  transition: margin-left 0.12s ease, background 0.12s ease;
}
.sim-row-buy { border-left: 4px solid var(--danger); }
.sim-row-indent { margin-left: 1.6rem; opacity: 0.85; }
.sim-h3-with-info { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.sim-sequence-fab {
  position: fixed; right: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom));
  z-index: 15; box-shadow: var(--shadow); border-radius: 999px;
  padding: 0.7rem 1.1rem; background: var(--accent); color: #fff; border: none;
  font-weight: 600; cursor: pointer;
}
@media (max-width: 640px) {
  .sim-sequence-fab { bottom: calc(5.5rem + env(safe-area-inset-bottom)); right: 0.8rem; padding: 0.6rem 0.9rem; font-size: 0.85rem; }
}
.sim-rotate-fab {
  position: fixed; right: 1rem; bottom: calc(1.2rem + 50px + 0.6rem + env(safe-area-inset-bottom));
  z-index: 15; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); color: var(--text-muted); border: 1.5px solid var(--text-muted);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sim-rotate-fab:hover { border-color: var(--accent); color: var(--accent); }
.sim-rotate-label {
  position: fixed; right: 1rem; bottom: calc(1.2rem + 50px + 46px + 1.2rem + env(safe-area-inset-bottom));
  z-index: 15; background: var(--surface); border: 1.5px solid var(--text-muted);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .sim-rotate-fab { bottom: calc(5.5rem + 50px + 0.6rem + env(safe-area-inset-bottom)); right: 0.8rem; }
  .sim-rotate-label { bottom: calc(5.5rem + 50px + 46px + 1.2rem + env(safe-area-inset-bottom)); right: 0.8rem; }
}
.global-refresh-fab {
  position: fixed; left: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom));
  z-index: 15; box-shadow: var(--shadow); border-radius: 50%;
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-muted); border: 1.5px solid var(--border);
  cursor: pointer;
}
.global-refresh-fab:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .global-refresh-fab { bottom: calc(5.5rem + env(safe-area-inset-bottom)); left: 0.8rem; width: 42px; height: 42px; }
}
/* ---------- Vollbild-Ladeanzeige bei Seitenwechsel (Nutzer-Vorgabe 2026-09-01) ---------- */
.nav-loading-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(19, 20, 23, 0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
.nav-loading-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: nav-loading-spin 0.7s linear infinite;
}
.nav-loading-text { color: #fff; font-weight: 600; font-size: 0.9rem; }
@keyframes nav-loading-spin { to { transform: rotate(360deg); } }

/* ---------- Reload-Erfolg/Fehler-Toast (Nutzer-Vorgabe 2026-09-07) ---------- */
.reload-toast {
  position: fixed; top: calc(0.8rem + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%); z-index: 2100;
  padding: 0.6rem 1.1rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem;
  color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  opacity: 1; transition: opacity 0.3s ease;
}
.reload-toast-ok { background: var(--good); }
.reload-toast-error { background: #e04b1d; }
.reload-toast-hide { opacity: 0; }

.sim-row-sell { border-left: 4px solid var(--good); }
.sim-row.selected { margin-left: 0.8rem; background: var(--accent-soft); }
.sim-row-replaced { opacity: 0.6; text-decoration: line-through; background: var(--bg); }
.sim-row-added { background: var(--good-soft); }
.opt-formation-label { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.6rem; }
.opt-status-counts { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.5rem; }
.opt-status-count-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; }
.opt-status-count-item .s11-badge { width: 20px; height: 20px; }
.opt-kpi-delta { font-size: 0.75rem; font-weight: 600; }
.opt-toast {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1rem; border-radius: var(--radius); font-weight: 600;
  margin-bottom: 1rem; box-shadow: var(--shadow);
  transition: opacity 0.4s ease;
}
.opt-toast-good { background: var(--good-soft); color: var(--good); }
.opt-toast-bad { background: var(--danger-soft); color: var(--danger); }
.opt-player-count { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-weight: 700; margin-left: 0.4rem; }
.opt-player-count.good { background: var(--good-soft); color: var(--good); }
.opt-player-count.bad { background: var(--danger-soft); color: var(--danger); }
.opt-rotate-fab {
  position: fixed; right: 1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom));
  z-index: 15; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--text-muted); background: var(--surface); color: var(--text-muted);
  box-shadow: var(--shadow); cursor: pointer;
}
.opt-rotate-fab:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .opt-rotate-fab { bottom: calc(5.5rem + env(safe-area-inset-bottom)); right: 0.8rem; }
}
.opt-apply-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 1rem; border-radius: 999px; border: none;
  background: var(--good); color: #fff; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.opt-apply-btn:hover { opacity: 0.9; }
.opt-apply-btn-full { display: flex; width: 100%; justify-content: center; padding: 0.7rem 1rem; font-size: 0.95rem; }
.opt-toggle-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%;
  padding: 0.6rem 1rem; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.opt-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.sim-row-buy.selected { background: var(--danger-soft, #ffe2d1); }
.sim-row-sell.selected { background: var(--good-soft); }
.sim-row-name { flex: 1 1 auto; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-row-value { font-weight: 700; white-space: nowrap; }
.sim-row-avg { white-space: nowrap; font-size: 0.78rem; }
/* Hoehere Spezifitaet als das allgemeine ".hint" (kommt spaeter im Stylesheet
   und ueberschrieb sonst die gruen/rot-Einfaerbung bei gleicher Spezifitaet -
   Nutzer-Feedback 2026-08-28: "bitte farblich einfaerben"). */
.sim-swap-value.good { color: var(--good); font-weight: 700; }
.sim-swap-value.bad { color: var(--danger); font-weight: 700; }
/* Marktwert-Modus soll wie die alte feste Darstellung wirken (fett,
   normale Textfarbe statt gedaempftem "hint") - Nutzer-Feedback 2026-08-28. */
.sim-swap-value.sim-swap-strong { color: var(--text); font-weight: 700; font-size: 0.85rem; }
.sim-offer-select { max-width: 180px; font-size: 0.82rem; }
.transfer-row:hover { background: var(--bg); }
.transfer-row-flagged {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft, #ffe2d1);
}
.transfer-row-flagged .sim-row-name { color: var(--danger); }

.transfer-player-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.transfer-player-photo {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: #eef1f6 center/cover no-repeat; flex-shrink: 0;
}
.transfer-player-photo img {
  position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; border: 2px solid #fff; object-fit: contain;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.transfer-detail-box { transition: box-shadow 0.15s; }
.transfer-detail-box.transfer-detail-flagged { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
.transfer-parties {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.8rem 0; margin-bottom: 0.6rem;
}
.transfer-party { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 90px; }
.transfer-party-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text-muted); overflow: hidden;
}
.transfer-party-avatar img { width: 100%; height: 100%; object-fit: cover; }
.transfer-party-name { font-weight: 700; font-size: 0.88rem; text-align: center; }
.transfer-detail-flagged .transfer-party-avatar { border-color: var(--danger); }
.transfer-party-arrow { font-size: 1.3rem; color: var(--text-muted); }
.transfer-stat-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.88rem; padding: 0.15rem 0; }
.transfer-stat-row span:first-child { color: var(--text-muted); }
@media (max-width: 640px) {
  .sim-row-avg { display: none; }
  .sim-offer-select { max-width: 130px; }
  /* Aufstellungs-Optimierer braucht die Punkte-Kennzahl auch auf schmalen
     Bildschirmen zwingend (Nutzer-Vorgabe 2026-08-24: "kein Wert wird bei
     irgendeinem Spieler angezeigt" - Ursache war genau diese Regel). */
  .sim-row-avg.opt-stat-value { display: inline-block; }
  /* Gleicher Fall fuer den Simulator-Swap (Nutzer-Vorgabe 2026-08-28): auch
     hier reicht .sim-row-avg als Basis-Klasse, ohne diesen Override wird
     der Wert auf schmalen Bildschirmen komplett ausgeblendet. */
  .sim-row-avg.sim-swap-value { display: inline-block; }
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Nur fuer Tablet-Breiten (Sidebar bleibt seitlich, klappt aber auf reine
   Icons zusammen) - ab 640px und darunter uebernimmt die untere
   Navigationsleiste (siehe @media max-width: 640px), diese Regeln duerfen
   die dort NICHT wieder ueberschreiben. */
@media (max-width: 780px) and (min-width: 641px) {
  .sidebar { width: 68px; }
  .sidebar a span, .brand span, .nav-section { display: none; }
  .brand { justify-content: center; }
  .sidebar a { justify-content: center; }
  main { padding: 1.2rem; }
}
