/* ===========================
   Global / Reset
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;               /* Einheitliche Breitenberechnung */
}

html {
  overflow-y: scroll;                    /* Immer vertikalen Scrollbalken anzeigen */
}

body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: #f6f6f6;
  color: #333;
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===========================
   Typografie & Links
   =========================== */
h1 {
  text-align: center;
  font-size: 1.8em;
  margin: 1em 0 0.5em;
}

a {
  color: #004080;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===========================
   Layout-Komponenten
   =========================== */
.inhalt {
  max-width: 800px;                      /* Standard-Contentbreite */
  margin: 1.0em auto;
  padding: 1.0em;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.inhalt h1 {
  text-align: center;
  margin-bottom: 0.5em;
}

.inhalt h2 {
  margin-top: 0.5em;
  font-size: 1.4em;
  border-bottom: 2px solid #004080;
  padding-bottom: 0.2em;
}

/* Optionaler Modifier: Harte Overflow-Sperre NUR wo benötigt
   -> Container: <div class="inhalt inhalt--no-overflow"> */
.inhalt.inhalt--no-overflow {
  overflow-x: clip;                       /* wie hidden, vermeidet Layout-Shift (iOS) */
}

/* Formular-/Karten-Wrapper (z. B. Karriere, Formulare) */
.form-wrapper {
  max-width: 800px;                       /* deckt Standardfälle ab */
  margin: 2em auto;
  padding: 1.5em;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Wenn Overflow-Sperre aktiv ist, den Wrapper zusätzlich absichern */
.inhalt.inhalt--no-overflow .form-wrapper {
  overflow-x: hidden;                     /* aber KEIN max-width-Override */
}

/* Dashboard-Container (zentriert) */
.dashboard {
  max-width: 800px;
  margin: 1.0em auto;                     /* zentriert mit Abstand oben/unten */
  padding: 1.0em;
  text-align: center;                     /* Inhalt zentrieren */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

/* Footer */
footer {
  text-align: center;
}

/* ===========================
   Info-Bar / Hinweise
   =========================== */
.info-bar {
  text-align: center;
  padding: 0.2em 0 !important;
  margin: 0.2em 0 !important;
  font-size: 0.9em;
  color: #333;
}

/* ===========================
   Navigation (Dropdown-Leiste)
   =========================== */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-bottom: 0.5em;
}

.main-nav select {
  padding: 0.6em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fdfdfd;
  appearance: none;
  cursor: pointer;
}

/* ===========================
   Formulare & Buttons
   =========================== */
form {
  display: flex;
  flex-direction: column;
  min-width: 0;                            /* wichtig für Flex-Container */
}

label {
  margin-top: 1em;
  font-weight: bold;
  font-size: 0.95em;
}

input[type="text"],
input[type="number"],
input[type="color"],
input[type="email"],
input[type="date"],
input[type="password"],
select,
textarea {
  padding: 0.6em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 0.2em;
  max-width: 100%;                         /* NIE breiter als Container */
}

/* Speziell: Einige Mobile-Browser machen Selects so breit wie die längste Option */
.inhalt.inhalt--no-overflow select {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;                        /* letzte Bremse */
}

button,
.button {
  padding: 0.6em;
  font-size: 1em;
  background-color: #004080;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
button:hover,
.button:hover {
  background-color: #0059b3;
}

/* Rückmeldungen / Flash-Messages */
.meldung {
  background-color: #e6f9e6;
  color: #006600;
  padding: 0.8em;
  border: 1px solid #66cc66;
  border-radius: 6px;
  margin-bottom: 1em;
  text-align: center;
}

/* ===========================
   Tabellen in .inhalt
   =========================== */
.inhalt table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.inhalt th,
.inhalt td {
  text-align: left;
  border-bottom: 1px solid #ccc;
  padding: 0.5em;
  vertical-align: top;
}

.inhalt th {
  background-color: #eee;
}

/* ===========================
   Assets / Bilder
   =========================== */
.asset-name {
  text-align: center;
  font-weight: bold;
}

.asset-image {
  width: 275px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Wenn Overflow-Sperre aktiv ist: 275px nur als Obergrenze, niemals breiter */
.inhalt.inhalt--no-overflow .asset-image {
  max-width: 100%;
  width: min(275px, 100%);
  margin-inline: auto;
}

/* Lange, untrennbare Inhalte weich umbrechen (nur innerhalb .inhalt sinnvoll) */
.inhalt p,
.inhalt div,
.inhalt span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 800px) {
  .dashboard {
    width: 90%;
    margin: 1em auto;
    padding: 0.8em;
  }

  h1 {
    font-size: 1.5em;
  }

  /* Dropdown-Menüs auf Smartphones kompakter */
  .main-nav select {
    padding: 0.4em !important;
    font-size: 0.8em !important;
    min-width: 70px !important;
    max-width: 100px !important;
    width: auto !important;
  }

  /* Content etwas kompakter */
  .inhalt {
    margin: 1em;
    padding: 1em;
  }

  .inhalt table {
    font-size: 0.9em;
  }

  /* Buttons und Form-Wrapper etwas kleiner */
  .dashboard-actions .button,
  .form-wrapper button {
    padding: 0.6em 1em;
    font-size: 0.9em;
  }
}

/* Info-Bar für Mobile feiner abstimmen */
@media (max-width: 600px) {
  .info-bar {
    font-size: 0.85em;      /* kleinerer Text */
    padding: 0.15em 0;      /* etwas schmaler */
    margin: 0.15em 0;       /* weniger Außenabstand */
  }
}

/* Kleinste Screens: Innenabstände reduzieren, damit 275px sicher passen */
@media (max-width: 360px) {
  .inhalt {
    margin: 0.6em;
    padding: 0.8em;
  }
}


/* ===== Aufstellungen (zentral) ===== */

/* Meldungen */
.meldung-success { color:#005500; }
.meldung-error   { color:#aa0000; }

/* Badge/Chips für Positionswerte */
.pos-option {
  display:inline-block;
  margin:2px;
  padding:.2em .4em;
  border-radius:4px;
  font-size:.85em;
}

/* Alte Farbklassen (Kompatibilität) */
.dunkelgruen { background:#2e8b57; color:#fff; }
.mittelgruen { background:#66bb88; color:#000; }
.orange      { background:#ffd280; color:#000; }
.rot         { background:#ff9999; color:#000; }

/* Neue Badge-Klassen → aliasieren auf die alten Farben */
.badge-strong { background:#2e8b57; color:#fff; }
.badge-good   { background:#66bb88; color:#000; }
.badge-okay   { background:#ffd280; color:#000; }
.badge-weak   { background:#ff9999; color:#000; }

/* Tabelle */
.tabelle { width:100%; border-collapse:collapse; }
.tabelle th, .tabelle td { padding:.5em; border-bottom:1px solid #ccc; vertical-align:top; }
.tabelle .name { width:200px; }

/* Trennzeile zwischen Blöcken */
.trennlinie td { height:.8em; border:0; }

/* Popup für Spieler-Details */
#spieler-popup,
.popup {
  position:absolute;
  max-width:460px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #ccc;
  border-radius:6px;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
  padding:1rem;
  z-index:10000;
  display:none;
}

/* Spielerlink */
.spieler-link {
  color:#0066cc;
  text-decoration:none;
  cursor:pointer;
}
.spieler-link:hover { text-decoration:underline; }

/* Kleine Helfer */
.nowrap { white-space:nowrap; }
.form-inline label { margin-right:.75rem; }
.mt-1 { margin-top:.75rem; }

/* Mobile Feinschliff */
@media (max-width: 640px) {
  .tabelle th, .tabelle td { padding:.4rem; }
  .tabelle .name { width:auto; }
  .pos-option { font-size:.8em; }
}

.name .mini-meta { margin-top:.15rem; font-size:.9em; line-height:1.25 }
.name .mini-age { opacity:.8; margin-bottom:.2rem }
.name .mini-badges .pos-option { margin-right:.25rem; padding:.12rem .4rem; font-size:.8em }
.badge-strong { background:#2e8b57; color:#fff; }
.badge-good   { background:#66bb88; color:#000; }
.badge-okay   { background:#ffd280; color:#000; }
.badge-weak   { background:#ff9999; color:#000; }

