/* ---------------------------------------------------------------------------
   Kickbase Rechner - Design im Stil von awwwards.com:
   warmes Hellgrau, fast schwarzer Text, riesige enge Grotesk-Titel (Inter Tight),
   weisse Karten mit feinen Linien, schwarze/weisse Pillen, schwebende Tab-Leiste,
   einziger Akzent: ein zartes Gelb.
   --------------------------------------------------------------------------- */

:root {
  --bg: #f8f8f8;
  --bg-elevated: #ffffff;
  --bg-sunken: #ededed;
  --text: #222222;
  --text-muted: #7a7a7a;
  --border: #e6e6e6;
  --accent: #222222;
  --accent-contrast: #ffffff;
  --highlight: #fff083;
  --on-highlight: #222222;
  --positive: #12984d;
  --negative: #d63b32;
  --warning: #b86e00;
  --disabled: #a8a8a8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.14);
  --font-display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-elevated: #1a1a1a;
  --bg-sunken: #151515;
  --text: #f2f2f2;
  --text-muted: #8d8d8d;
  --border: #2b2b2b;
  --accent: #f2f2f2;
  --accent-contrast: #111111;
  --positive: #3ddc84;
  --negative: #ff6b60;
  --warning: #f0ad3f;
  --disabled: #5d5d5d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--highlight);
  color: var(--on-highlight);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

input[type="checkbox"] {
  accent-color: var(--text);
}

.hidden {
  display: none !important;
}

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

main#app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 28px 130px;
}

#app,
.login-card,
.calc-card,
.lineup-card,
.tab-panel {
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Seitentitel (gross, eng, Versalien) ---------- */

.page-head {
  text-align: center;
  padding: 36px 0 30px;
}

.page-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.page-title {
  margin: 8px 0 0;
  font-size: clamp(36px, 9.5vw, 104px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.page-sub {
  margin: 16px auto 0;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-muted);
}

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

.login-card {
  max-width: 440px;
  margin: 0 auto 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.login-card input {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s;
}

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

.login-card button[type="submit"],
.modal-primary-btn {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.login-card button[type="submit"]:hover,
.modal-primary-btn:hover {
  opacity: 0.85;
}

.login-card button[type="submit"]:active,
.modal-primary-btn:active {
  transform: scale(0.99);
}

.login-card button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: default;
}

.modal-primary-btn {
  width: 100%;
  margin-top: 0;
}

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

.privacy {
  font-size: 11px;
  color: var(--text-muted);
  margin: 18px 0 0;
  line-height: 1.5;
}

/* ---------- Kennzahlen ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-value {
  margin-top: 10px;
  font-size: clamp(17px, 2.1vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.35;
}

/* ---------- Tab-Leiste: schwebende dunkle Pille am unteren Rand ---------- */

.tabs {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 4px;
  padding: 6px;
  max-width: calc(100vw - 20px);
  overflow-x: auto;
  background: rgba(34, 34, 34, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #c9c9c9;
  cursor: pointer;
  border-radius: 11px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.tab-btn.active {
  color: #222222;
}

.tab-btn {
  position: relative;
  z-index: 1;
}

.tab-btn:hover {
  background: transparent;
}

/* ---------- Aufstellung ---------- */

.lineup-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  user-select: none;
  -webkit-user-select: none;
}

.lineup-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.lineup-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: 1;
}

.lineup-subtitle {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  color: var(--text-muted);
  margin-left: 6px;
}

.formation-select {
  font-weight: 600;
}

.pitch {
  position: relative;
  background: repeating-linear-gradient(to bottom, #1a4a31 0, #1a4a31 44px, #174630 44px, #174630 88px);
  border-radius: 12px;
  padding: 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pitch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pitch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

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

.pitch-slot {
  position: relative;
  width: 66px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: none;
  border-radius: 10px;
  padding: 4px 2px;
  transition: transform 0.12s;
  user-select: none;
  -webkit-user-select: none;
}

.pitch-slot * {
  pointer-events: none;
}

.pitch-slot.drag-over {
  transform: scale(1.08);
}

.pitch-slot.drag-over .slot-avatar,
.pitch-slot.drag-over .slot-placeholder {
  box-shadow: 0 0 0 3px var(--highlight);
}

.pitch-slot.filled {
  cursor: grab;
}

.pitch-slot .slot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #ddd;
}

.pitch-slot .slot-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

.pitch-slot .slot-name {
  font-size: 9px;
  font-weight: 600;
  color: #222;
  text-align: center;
  background: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 4px;
  line-height: 1.3;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-slot .slot-value {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 1px;
}

.bench-label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

.bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.bench-list.drag-over {
  border-color: var(--text);
  background: color-mix(in srgb, var(--highlight) 30%, transparent);
}

.bench-player {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: grab;
  font-size: 12px;
  font-weight: 500;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s;
}

.bench-player:hover {
  border-color: var(--text);
}

.bench-player * {
  pointer-events: none;
}

.bench-player img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- Rechner ---------- */

.calc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 16px;
  margin-bottom: 16px;
}

.calc-title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.calc-scope {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0 16px;
}

.calc-section {
  border-top: 1px solid var(--border);
  padding: 14px 0 10px;
}

.calc-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.calc-section-title em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 15px;
}

.calc-row span:first-child {
  display: flex;
  flex-direction: column;
}

.calc-row small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.calc-row span:last-child {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-row.calc-result {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.calc-row.calc-result span:last-child {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.calc-toggle {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.calc-hint {
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

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

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

/* ---------- Werkzeugleiste, Buttons ---------- */

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.link-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.link-btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ---------- Spielerkarten ---------- */

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.position-divider .count {
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 600;
}

.group-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 26px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.player-card:hover {
  transform: translateY(-1px);
  border-color: var(--text);
}

.player-card:active {
  transform: translateY(0);
}

.player-card.positive {
  box-shadow: inset 3px 0 0 var(--positive);
}

.player-card.negative {
  box-shadow: inset 3px 0 0 var(--negative);
}

.player-card.disabled {
  box-shadow: inset 3px 0 0 var(--disabled);
  opacity: 0.6;
}

.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-sunken);
  object-fit: cover;
  flex-shrink: 0;
}

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

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Alle Positionen einfarbig - Farben gehoeren allein den S11-Punkten. */
.pos-badge {
  background: var(--text);
  color: var(--bg);
}

.player-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.player-market-value {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.player-value-change {
  font-size: 12px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.player-value-change.positive {
  color: var(--positive);
}

.player-value-change.negative {
  color: var(--negative);
}

.player-friday-change {
  font-size: 11px;
  margin-top: 1px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.player-friday-change.positive {
  color: var(--positive);
}

.player-friday-change.negative {
  color: var(--negative);
}

.player-24h-change {
  font-size: 11px;
  margin-top: 2px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.player-24h-change.positive {
  color: var(--positive);
}

.player-24h-change.negative {
  color: var(--negative);
}

.player-stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.s11-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.s11-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.s11-blau { background: #2563eb; }
.s11-gruen { background: #16a34a; }
.s11-orange { background: #f97316; }
.s11-rot { background: #dc2626; }
.s11-grau { background: #9ca3af; }

.player-expiry {
  font-size: 11px;
  margin-top: 2px;
}

.keep-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.keep-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ---------- Berater / News ---------- */

.advisor-list,
.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.squad-news-item,
.news-card {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.squad-news-item {
  flex-direction: column;
  gap: 8px;
}

.news-card {
  gap: 14px;
  align-items: center;
}

.squad-news-item:hover,
.news-card:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.squad-news-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.squad-news-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-sunken);
  border-radius: 999px;
  padding: 2px 12px 2px 2px;
  font-size: 13px;
  font-weight: 600;
}

.squad-news-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}

.squad-news-title,
.news-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.squad-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.squad-news-status {
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-muted);
}

.squad-news-status.warn {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.squad-news-status.bad {
  background: color-mix(in srgb, var(--negative) 16%, transparent);
  color: var(--negative);
}

.squad-news-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 8px 4px;
}

.news-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-sunken);
}

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

.news-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

/* ---------- Dialoge ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: var(--bg-elevated);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-sunken);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: var(--text);
  color: var(--bg);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 34px;
}

.modal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-sunken);
}

.modal-header h2 {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}

.detail-item .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item .value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.chart-controls {
  display: flex;
  gap: 6px;
  margin: 4px 0 8px;
}

.range-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.range-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.chart-wrap {
  position: relative;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px 0;
  margin-bottom: 16px;
}

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

.mv-axis-label {
  font-size: 9px;
  fill: var(--text-muted);
}

.mv-tooltip {
  position: absolute;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  white-space: nowrap;
}

.sell-calc {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.sell-calc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sell-calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.sell-calc-field small,
.sell-calc-result small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 2px;
}

.sell-calc-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sell-calc-field input:focus {
  outline: none;
  border-color: var(--text);
}

.sell-calc-reset {
  margin-top: 8px;
}

.sell-calc-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
}

.sell-calc-result strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ai-snapshot-info {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 14px;
  display: inline-block;
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  padding: 11px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
}

.toast.error {
  background: var(--negative);
  color: #fff;
}

/* ---------- Liga ---------- */

.league-heading {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 44px 0 16px;
}

.league-table {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 0 8px;
  overflow-x: auto;
}

.league-row {
  display: grid;
  grid-template-columns: 28px minmax(110px, 1.6fr) 1fr 1fr 1.4fr;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--border);
}

.league-row > span:nth-child(n + 3) {
  text-align: right;
}

.league-head {
  border-top: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.league-row.me {
  background: var(--highlight);
  color: var(--on-highlight);
  font-weight: 600;
}

.league-row.me .league-rank {
  color: inherit;
}

.league-rank {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-muted);
}

.league-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-manager img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-sunken);
}

.league-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.league-transfer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 14px;
}

.league-transfer.me {
  border-color: var(--text);
  box-shadow: inset 3px 0 0 var(--highlight);
}

.league-transfer img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-sunken);
  flex-shrink: 0;
}

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

.league-transfer-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.league-transfer-price {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 700px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-name {
    font-size: 14px;
  }
  main#app {
    padding: 4px 16px 120px;
  }
  .page-head {
    padding: 24px 0 22px;
  }
  .stat-card {
    padding: 14px 14px 12px;
  }
  .stat-value {
    font-size: 17px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .tab-btn {
    padding: 9px 10px;
    font-size: 12px;
  }
  .calc-card {
    padding: 18px 16px 12px;
  }
  .league-row {
    gap: 6px;
    padding: 9px 10px;
    font-size: 13px;
  }
  .player-card {
    padding: 10px 12px;
    gap: 10px;
  }
}

/* ---------- App-Verhalten auf dem Handy ---------- */

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  /* nur senkrecht scrollen, kein Zoomen/Seitwaerts-Wischen wie auf einer normalen Webseite */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* Ziehen per Finger: diese Elemente duerfen nicht gleichzeitig die Seite scrollen. */
.pitch-slot.filled,
.bench-player {
  touch-action: none;
  -webkit-touch-callout: none;
}

.drag-source {
  opacity: 0.3;
}

.drag-ghost {
  position: fixed;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: 0.95;
  transform: scale(1.1);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
}

.bench-player.drag-ghost {
  background: var(--bg-elevated);
}

/* Aussparungen am Bildschirmrand (Notch, Home-Leiste) beruecksichtigen */
.topbar {
  padding-top: max(16px, env(safe-area-inset-top));
}

.tabs {
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
}

.toast {
  bottom: max(90px, calc(env(safe-area-inset-bottom) + 80px));
}

@media (max-width: 600px) {
  /* 16px verhindert, dass iOS beim Antippen eines Feldes automatisch hineinzoomt */
  input,
  select,
  textarea,
  .login-card input,
  .sell-calc-field input {
    font-size: 16px;
  }
}
/* ---------- Manager-Kurzprofil ---------- */

.league-row-link {
  cursor: pointer;
  transition: background 0.15s;
}

.league-row-link:hover:not(.me) {
  background: var(--bg-sunken);
}

.mgr-rank {
  font-size: 13px;
  color: var(--text-muted);
}

.mgr-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 18px 0 8px;
}

.mgr-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 108px;
  padding: 4px 4px 0;
}

.mgr-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.mgr-bar {
  width: 100%;
  height: var(--h);
  border-radius: 6px 6px 3px 3px;
  background: var(--bg-sunken);
  transform-origin: bottom;
  animation: bar-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mgr-bar-col.latest .mgr-bar {
  background: var(--text);
}

.mgr-bar-value {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mgr-bar-label {
  font-size: 10px;
  color: var(--text-muted);
}

.mgr-player,
.mgr-transfer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.mgr-player img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-sunken);
  flex-shrink: 0;
}

.mgr-player-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mgr-player-trend {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mgr-player-value,
.mgr-transfer strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mgr-transfer span {
  flex: 1;
}

.mgr-transfer small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Animationen ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.tab-panel {
  animation: panel-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.page-title {
  animation: title-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-kicker,
.page-sub {
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}

.stat-card {
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.17s; }
.stat-card:nth-child(3) { animation-delay: 0.24s; }
.stat-card:nth-child(4) { animation-delay: 0.31s; }

.anim-in > * {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

.empty-state.loading {
  animation: pulse 1.3s ease-in-out infinite;
}

.modal-overlay {
  animation: fade-in 0.2s ease;
}

.modal {
  animation: modal-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast {
  animation: toast-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Die weisse Pille gleitet unter den aktiven Tab */
.tab-pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 11px;
  background: #ffffff;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.4s cubic-bezier(0.3, 0.9, 0.3, 1),
    opacity 0.2s;
  pointer-events: none;
}

.tab-pill.ready {
  opacity: 1;
}

/* Druecken fuehlt sich nach etwas an */
.link-btn,
.icon-btn,
.tab-btn,
.range-btn {
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}

.link-btn:active,
.icon-btn:active,
.tab-btn:active,
.range-btn:active {
  transform: scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Schmale Bildschirme: nichts darf ueber den Rand ragen ---------- */

@media (max-width: 600px) {
  .topbar-actions {
    width: 100%;
  }
  #leagueSelectWrap {
    flex: 1;
    min-width: 0;
  }
  #leagueSelectWrap select {
    width: 100%;
    min-width: 0;
  }
  .league-row {
    grid-template-columns: 22px minmax(0, 1fr) auto auto auto;
    gap: 8px;
    padding: 9px 12px;
    font-size: 12px;
  }
  .league-rank {
    font-size: 15px;
  }
}
/* Kennzahlen im Dialog bleiben auch auf dem Handy zweispaltig */
.detail-grid.compact {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-grid.compact .detail-item {
  padding: 10px 12px;
  min-width: 0;
}

.detail-grid.compact .value {
  font-size: 16px;
  white-space: nowrap;
}
/* ---------- App-Aufbau: Seite steht fest, nur der Inhalt scrollt ----------
   Handy-Browser blenden beim Scrollen der Seite die Adressleiste ein und aus. Dabei
   springt alles, was "fixed" am Rand klebt (die Tab-Leiste). Scrollt nur der Inhalts-
   bereich, bleibt die Seite stabil, genau wie in einer echten App. */

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  touch-action: pan-y;
}

.topbar {
  position: relative;
  flex: none;
  background: var(--bg);
}

main#app {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

main#app > .view {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 28px 130px;
}

@media (max-width: 600px) {
  main#app > .view {
    padding: 4px 16px 120px;
  }
}
.detail-grid.compact .value {
  overflow: hidden;
  text-overflow: ellipsis;
}
