:root {
  --bg: #303030;
  --sidebar: #181818;
  --column: #212121;
  --border: #3a3a3a;
  --text: #e0e0e0;
  --muted: #a0a0a0;
  --accent: #2f81f7;
  --gold: #f2c94c;
  --green: #27ae60;
  --blue: #2980b9;
  --red: #e74c3c;
}

/* === Grundlayout === */
html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.draftboard-locked {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* === Header === */
header {
  background-color: var(--sidebar);
  border-bottom: 1px solid var(--border);
  height: 60px;
  min-height: 60px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 50;
  position: sticky;
  top: 0;
}

.top-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left a {
  color: var(--muted);
  margin-right: 24px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-left a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}

.nav-left a:hover {
  color: var(--text);
}

/* === Einstellungsmenü / Profile Dropdown === */
.profile-menu-container {
  position: relative;
  z-index: 200;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 50px;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  min-width: 130px;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
  background: #2a2a2a;
  color: #fff;
}

.dropdown-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 0;
}

.hidden {
  display: none;
}

.dropdown form {
  display: flex;
  flex-direction: column;
}

.dropdown label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.dropdown input {
  background: #2a2a2a;
  border: 1px solid #444;
  color: var(--text);
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.dropdown button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px;
  cursor: pointer;
}

.dropdown button:hover {
  background: #3b92ff;
}

/* === Layout === */
.container {
  display: flex;
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
}

aside {
  width: 340px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 10px;
  padding-bottom: 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  z-index: 10;
  transition: outline 0.2s ease, background 0.2s ease;
}

#playerList {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  margin-bottom: 10px;
}

.pagination-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pagination-link:hover:not(:disabled) {
  color: var(--text);
  text-decoration-color: var(--text);
}

.pagination-link:disabled {
  color: #555;
  cursor: not-allowed;
}

.page-link {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.2s;
}

.page-link:hover:not(:disabled) {
  color: var(--accent-light);
}

.page-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.pagination-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: 'Inter', sans-serif;
  margin: 0 1px;
  padding: 1px 0;
}

.pagination-input:focus {
  outline: none;
  border-bottom-color: var(--accent-color);
}

/* Hide spin buttons */
.pagination-input::-webkit-outer-spin-button,
.pagination-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pagination-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 2px 0;
}

.page-info-style {
    color: var(--muted);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
}

aside.drag-hover {
  outline: 2px solid var(--green);
  outline-offset: -3px;
  background: rgba(39, 174, 96, 0.08);
}

#playerList::-webkit-scrollbar {
  width: 8px;
}

#playerList::-webkit-scrollbar-track {
  background: transparent;
}

#playerList::-webkit-scrollbar-thumb {
  background-color: #666;
  border-radius: 4px;
}

#playerList::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}

/* === Suchfeld === */
#search {
  width: calc(100% - 8px);
  padding: 10px 12px;
  margin: 8px auto 14px;
  background: #242424;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  box-sizing: border-box;
  display: block;
  outline: none;
}

#search:focus {
  border-color: var(--accent);
  background: #2a2a2a;
}

/* === Board === */
main {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: var(--bg);
  overflow: hidden;
}

/* === Spalten === */
.column {
  background: var(--column);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 0 12px 12px;
  max-width: calc((100% - 30px) / 3);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); border-color: rgba(46, 204, 113, 0.8); }
  70% { box-shadow: 0 0 0 15px rgba(46, 204, 113, 0); border-color: rgba(46, 204, 113, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); border-color: var(--border); }
}

@keyframes pulse-text-green {
  0% { text-shadow: 0 0 5px rgba(46, 204, 113, 0.4); color: var(--green); }
  50% { text-shadow: 0 0 15px rgba(46, 204, 113, 1), 0 0 20px rgba(46, 204, 113, 0.8), 0 0 30px rgba(46, 204, 113, 0.6); color: #a4ffc0; }
  100% { text-shadow: 0 0 5px rgba(46, 204, 113, 0.4); color: var(--green); }
}

.column.active-turn .column-title {
  animation: pulse-text-green 1.5s infinite ease-in-out;
  color: var(--green);
}

.column-body {
  flex: 1;
  padding: 10px 8px 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.column-body.drag-over {
  outline: 2px dashed var(--accent);
  background: rgba(47, 129, 247, 0.08);
}

/* === Scrollbar === */
.column-body::-webkit-scrollbar {
  width: 8px;
}

.column-body::-webkit-scrollbar-track {
  background: #1b1b1b;
  border-left: 1px solid var(--border);
}

.column-body::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}

.column-body::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* === Blocked Player Spalte === */
.column.blocked {
  width: 270px;
  flex: 0 0 270px;
}

/* === Column Header === */
.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.column-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.score-label {
  font-size: 0.9rem;
  color: var(--gold);
}

.avg-budget-container {
  text-align: right;
  color: #fff;
}

.avg-budget-good {
  color: var(--green);
}

.avg-budget-bad {
  color: var(--red);
}

.market-coins {
  color: var(--gold);
}

/* === Spaltensteuerung === */
.column-title-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: space-between;
  padding-right: 20px;
}

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

.column-controls,
.column-controls-secondary {
  display: flex;
  align-items: center;
  gap: 4px;
}

.col-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.column-stats {
  text-align: center;
  padding: 5px 0;
}

.column-stats .stats-row {
  justify-content: center;
  margin-left: 0;
}

.stats-row.pos-stats {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

.stats-row.pos-stats span {
  color: #ddd;
}

.col-btn:hover {
  color: var(--accent);
  background: rgba(47, 129, 247, 0.12);
  transform: scale(1.15);
}

.col-btn:active {
  transform: scale(0.95);
}

/* === Spielerkarte === */
.player-card {
  background: #303030;
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 98px; /* Strict uniform height */
  box-sizing: border-box;
  gap: 0;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.5s ease;
  cursor: grab;
  position: relative;
}

.player-card.last-added {
  box-shadow: 0 0 12px 2px rgba(76, 175, 80, 0.8);
  border-color: #4caf50;
}

.player-card .remove-btn {
  display: none;
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #f44336;
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.player-card:hover .remove-btn {
  display: block;
}

.player-card:hover {
  background: #383838;
  transform: translateY(-2px);
}

.player-card.gold {
  border-left-color: var(--gold);
}

.player-card.green {
  border-left-color: var(--green);
}

.player-card.blue {
  border-left-color: var(--blue);
}

.player-card.red {
  border-left-color: var(--red);
}

.card-top,
.card-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.2;
  width: 100%;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.2;
  width: 100%;
  position: relative;
}

/* === FLAGGEN & NAMEN === */
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  margin-right: 6px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.player-info-left {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

/* === EINHEITLICHE SCHRIFTGRÖßE FÜR ALLE ELEMENTE === */
.player-age,
.player-age-edited,
.edit-age-btn,
.assigned-to,
.capabilities,
.assigned-badge,
.player-club,
.player-position,
.feet,
.foot-left,
.foot-right,
.ca-pa,
.player-score,
.stats-row span,
.stats-row {
  font-size: 13px !important;
}

.player-name {
  font-size: 15px !important;
}

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

.player-age {
  color: #ccc;
  flex-shrink: 0;
}

.player-age-edited {
  color: #ff4d4d;
  flex-shrink: 0;
}

.player-score {
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
  white-space: nowrap;
}

.player-info-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.assigned-badge {
    background-color: rgba(255,255,255,0.1);
    color: #ccc;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
}

/* === Alter-Button === */
.edit-age-btn {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}

.edit-age-btn:hover {
  color: #fff;
}

.player-club {
  text-align: left;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0; /* Protect club names! */
}

/* === Position rechts oben unter Score === */
.player-position {
  text-align: right;
  font-style: italic;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1; /* Position accepts all truncation */
  max-width: 140px; /* Sensible max width */
}

/* === Zuweisung & Fähigkeitswerte === */

/* === CA/PA + Füße nebeneinander === */
.capabilities {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: #ddd;
  white-space: nowrap;
}

.ca-pa {
  white-space: nowrap;
  text-align: right;
}

/* === Füße mit Icons === */
.feet {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  white-space: nowrap;
}

.foot-left,
.foot-right {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  color: #ccc;
}

.foot-separator {
  color: #aaa;
  margin: 0 4px;
}

.strong-foot {
  color: var(--green) !important;
  font-weight: bold;
}

.foot-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: none;
  opacity: 1;
}

/* === Farb-Logik: Grün = stärkerer Fuß === */
.foot-icon.strong {
  filter: brightness(0) saturate(100%) invert(57%) sepia(95%) saturate(459%) hue-rotate(85deg) brightness(95%) contrast(90%);
}

.foot-icon.normal {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(105%) contrast(101%);
}

/* === Tier-Statistik unter Spalten === */
.column-stats {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  padding: 6px 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-stats span {
  font-weight: 500;
}

.column-stats .gold {
  color: var(--gold);
}

.column-stats .green {
  color: var(--green);
}

.column-stats .blue {
  color: var(--blue);
}

.column-stats .red {
  color: var(--red);
}

/* === Responsive === */
@media (max-width: 1100px) {
  main {
    flex-direction: column;
    align-items: center;
  }

  .column {
    width: 90%;
    max-width: 100%;
    height: auto;
  }

  .column-body {
    max-height: none;
    overflow-y: visible;
  }
}

/* === Übersicht-Seite === */
.overview-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background-color: #303030;
  flex-grow: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.overview-container .column {
  background-color: #212121;
  border: 1px solid var(--border);
  border-radius: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.overview-container .column-header {
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  font-weight: 600;
  text-align: center;
}

.overview-container .column-body {
  padding: 10px;
  overflow-y: auto;
}

.overview-container .player-card {
  background: #303030;
  border-color: var(--border);
}

.overview-container .player-card:hover {
  background: #383838;
}

/* === Ende Übersicht-Seite === */
/* === Übersicht-Seite (Search + Layout + Zählung) === */

.overview-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background-color: #303030;
  flex-grow: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* 🔍 Suchfeld */
.overview-search {
  text-align: center;
  margin: 25px 0 10px;
}

#overviewSearch {
  width: 40%;
  max-width: 400px;
  padding: 10px 12px;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  color: #e0e0e0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#overviewSearch:focus {
  border-color: #2f81f7;
  background: #2a2a2a;
}

.overview-container .column {
  background: #212121;
  border: 1px solid var(--border);
  border-radius: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header mit Anzahl */
.overview-container .column-header {
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  font-weight: 600;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.overview-container .column-header .count {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Inhalt */
.overview-container .column-body {
  padding: 10px;
  overflow-y: auto;
}

/* Karten */
.overview-container .player-card {
  background: #303030;
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.overview-container .player-card:hover {
  background: #383838;
}

/* Farbmarkierungen wie Draftboard */
.player-card.weltklasse {
  border-left-color: var(--gold);
}

.player-card.elite {
  border-left-color: var(--green);
}

.player-card.top {
  border-left-color: var(--blue);
}

.player-card.solide {
  border-left-color: var(--red);
}

.player-card.assigned {
  opacity: 0.6;
  filter: grayscale(40%);
}

/* === Ende Übersicht-Seite === */

/* === Filter-Menü === */
.filter-btn {
  margin-left: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.filter-btn:hover {
  background: #3b92ff;
}

.filter-popup {
  position: absolute;
  left: 50%;
  top: 120px;
  transform: translateX(-50%);
  background: #212121;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  padding: 15px 20px;
  width: 500px; /* Widened for 2 columns */
  z-index: 200;
}

.filter-popup form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.filter-col-left {
  display: flex;
  flex-direction: column;
}

.filter-col-right {
  display: flex;
  flex-direction: column;
}

.filter-nation-search {
  width: 100%;
  padding: 6px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: var(--text);
  border-radius: 4px;
  margin-bottom: 5px;
  box-sizing: border-box;
}

.filter-nation-search:focus {
  outline: none;
  border-color: var(--blue);
}

.filter-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.apply-filters-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.apply-filters-btn:hover {
  background: #3b92ff;
}

.hidden {
  display: none;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}

.range-group {
  display: flex;
  gap: 8px;
}

.range-group input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  color: var(--text);
  border-radius: 5px;
  padding: 6px;
}

.radio-group label {
  margin-right: 10px;
  font-size: 0.85rem;
  color: var(--text);
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.apply-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
}

.apply-btn:hover {
  background: #2ecc71;
}

.reset-btn {
  background: #444;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
}

.reset-btn:hover {
  background: #666;
}

/* === Custom Modal === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #212121;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  width: 90%;
  max-width: 400px;
  color: #fff;
}

.modal-content .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}

.modal-content .btn-danger {
  background: #ff5252;
  color: #fff;
}

.modal-content .btn-danger:hover {
  background: #ff7675;
}

.modal-content .btn-secondary {
  background: #444;
  color: #fff;
}

.modal-content .btn-secondary:hover {
  background: #555;
}

/* === Ende Filter-Menü === */
/* === NEU hinzugefügt: Layout für Suchfeld + Filterbutton === */
.overview-search {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 25px 0 10px;
  position: relative;
  z-index: 100;
}

/* === Darkmode-Fix für Filter-Popup === */
.filter-popup select,
.filter-popup input[type="number"],
.filter-popup input[type="text"] {
  width: 100%;
  background: #2a2a2a;
  border: 1px solid #444;
  color: var(--text);
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 0.9rem;
  outline: none;
  appearance: none;
}

.filter-popup select:focus,
.filter-popup input:focus {
  border-color: var(--accent);
  background: #2d2d2d;
}

.filter-popup option {
  background: #2a2a2a;
  color: #e0e0e0;
}

.filter-popup select[multiple] {
  height: auto;
  max-height: 150px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: var(--text);
  border-radius: 6px;
  padding: 6px;
}

.filter-popup option {
  padding: 4px 6px;
}

/* === Dezenter, integrierter Filter-Button neben Suchfeld === */
.overview-search {
  text-align: center;
  margin: 25px 0 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

#overviewSearch {
  width: 40%;
  max-width: 400px;
  padding: 10px 12px;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-right: none;
  /* bündig mit Filter-Button */
  border-radius: 10px 0 0 10px;
  color: #e0e0e0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#overviewSearch:focus {
  border-color: #2f81f7;
  background: #2a2a2a;
}

.filter-btn {
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #3a3a3a;
  border-left: none;
  border-radius: 0 10px 10px 0;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
  background: #353535;
  color: #fff;
}

.filter-btn:active {
  background: #404040;
}

/* === Bonus-Tipp: optische Vereinheitlichung für Search + Filter === */
.overview-search input[type="text"],
.overview-search .filter-btn {
  border: 1px solid #444;
  background: #1e1e1e;
  color: #ddd;
  height: 38px;
  box-sizing: border-box;
  margin: 0;
  /* Entfernt Restabstand */
}

#overviewSearch {
  border-right: none;
}

.filter-btn {
  border-left: none;
}

/* === Profil Header === */
.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 0;
  border: none;
}

.user-profile:hover {
  opacity: 0.8;
}

.profile-icon {
  font-size: 1.1rem;
}

.profile-name {
  font-weight: 600;
  color: #fff;
}

.logout-link:hover {
  background: rgba(255, 82, 82, 0.1);
  border-radius: 0 0 10px 10px;
}

/* === Overview Tabs === */
.tabs-header {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.tab-btn {
  background: #212121;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #2a2a2a;
  color: #fff;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-btn.weltklasse.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.tab-btn.elite.active {
  background: var(--green);
  border-color: var(--green);
}

.tab-btn.top.active {
  background: var(--blue);
  border-color: var(--blue);
}

.tab-btn.solide.active {
  background: var(--red);
  border-color: var(--red);
}

.tab-content {
  display: none;
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
}

.tab-content.active {
  display: block; /* Restored to vanilla block to avoid breaking the tier wrappers */
}

/* === Inline Extracted Classes === */
.player-club-position {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.assigned-to {
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex-shrink: 0;
  max-width: 100px;
  padding-right: 0;
}

/* === Header Profile Icon === */
.user-profile img {
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.user-profile:hover img {
  transform: scale(1.05);
}

/* === Draftboard Budget Header === */
.draftboard-budget-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--muted);
}

.draftboard-budget-header .market-coins {
  color: var(--gold);
}

.draftboard-budget-header .age-coins {
  color: #fff;
}

.budget-separator {
  margin: 0 4px;
}

.draftboard-avg-row {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
  width: 100%;
}

/* === Team Badge === */
.team-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1c1c1c;
    border: 1px solid #333;
    color: #eee;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stats-row {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    white-space: nowrap;
    font-size: 0.85rem;
    color: #bbb;
}

.draftboard-quota-stat {
    font-weight: bold;
    color: #fff;
}

/* === Global Draft Info Modal === */
.settings-group-header {
    font-size: 1.25rem;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.draft-info-link {
    color: var(--accent);
    font-size: 0.9rem;
    margin-left: 0;
    font-weight: normal;
}

.draft-info-overlay {
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
}

.draft-info-content {
    max-width: 500px;
    padding: 25px;
    text-align: left;
    background: #1a1a1a;
    border: 1px solid #333;
}

.draft-info-title {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    color: var(--accent);
}

.draft-info-row {
    margin-bottom: 15px;
}

.draft-info-row.last-row {
    margin-bottom: 25px;
}

.draft-info-label {
    color: #ccc;
}

.draft-info-value {
    color: #fff;
}

.draft-info-subtext {
    color: #888;
    font-size: 0.9em;
}

.draft-info-actions {
    text-align: center;
}

/* === Global Favorites Slide-out Panel === */
.global-favorites-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(100%);
    background: #2a2a2a;
    border: 1px solid rgba(46, 204, 113, 0.5);
    border-right: none;
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 15px rgba(0,0,0,0.6), -2px 0 12px rgba(46, 204, 113, 0.15);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 9999;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.global-favorites-panel.open {
    transform: translateY(-50%) translateX(0);
}

.global-favorites-toggle {
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    background: #2ecc71;
    border: 1px solid #2ecc71;
    border-right: none;
    border-radius: 8px 0 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    cursor: pointer;
    box-shadow: -4px 0 10px rgba(0,0,0,0.3);
    transition: background 0.2s;
}

.global-favorites-toggle:hover {
    background: #27ae60;
    border-color: #27ae60;
}

.global-favorites-toggle span {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    font-weight: bold;
    color: #eee;
    letter-spacing: 2px;
    margin-top: 10px;
    font-size: 13px;
    white-space: nowrap;
}

.global-favorites-content {
    /* Mapped to match the overview page card width for rich info layout */
    width: 320px; 
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Height adjusted to accommodate position headers and multiple cards */
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
}

.global-fav-group {
    padding: 8px 10px 4px;
    font-weight: bold;
    color: #aaa;
    font-size: 0.8em;
    text-transform: uppercase;
    border-bottom: 1px solid #333;
    margin-top: 5px;
    margin-bottom: 0px;
    letter-spacing: 0.5px;
}

.global-fav-empty {
    padding: 15px;
    color: #777;
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

.global-favorites-content .player-card {
    margin: 0 0 8px 0;
    width: 100%;
}

.global-favorites-content .card-info-left,
.global-favorites-content .player-club {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-favorites-content .player-info-right {
    flex-shrink: 0;
}

.global-favorites-content .favorite-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
}

.global-favorites-content .favorite-btn svg {
    fill: none;
    stroke: #888;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.global-favorites-content .favorite-btn.active svg {
    fill: #ffd700 !important;
    stroke: #ffd700 !important;
}

.global-favorites-content .favorite-btn:hover:not(.active) svg {
    stroke: #ccc;
}

.global-favorites-content::-webkit-scrollbar { width: 6px; }
.global-favorites-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.global-favorites-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

.global-fav-card {
    background: #222;
    border: 1px solid #444;
    border-left: 5px solid #888;
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.global-fav-card.gold { border-left-color: #ffd700; }
.global-fav-card.green { border-left-color: #4caf50; }
.global-fav-card.blue { border-left-color: #2196f3; }
.global-fav-card.red { border-left-color: #f44336; }

.global-fav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.global-fav-name { 
    font-weight: 600; 
    font-size: 13px; 
    color: #fff; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 140px; 
}

.global-fav-score { 
    font-weight: bold; 
    font-size: 13px; 
    color: #eee; 
}

.global-fav-pos { 
    font-size: 11px; 
    color: #aaa; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.draft-info-actions button {
    padding: 8px 20px;
}