body {
  margin: 0;
  padding: 20px;
  font-family: sans-serif;
}

h1 a {
    text-decoration: none;
    color: inherit;
}

h1 a:hover {
    color: #007bff;
    text-decoration: underline;
}

.spielauswahl {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.spielauswahl form {
  display: flex;
  align-items: center;
}

.spielauswahl select {
  padding: 6px;
  font-size: 1rem;
}

@media (max-width: 600px) {
  .spielauswahl {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fadeToWhite {
  0%   { background-color: #d4edda; color: #155724; }
  100% { background-color: #ffffff; color: #000000; }
}

.message {
  min-height: 40px;
  padding: 5px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  color: #000000;
  margin-bottom: 20px;
  transition: background-color 1s ease, color 1s ease;
}

.message.active {
  animation: fadeToWhite 5s ease forwards;
}

.input-wrapper {
  margin-bottom: 10px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  
  /* Zentrierung mit Flexbox */
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: fit-content;
  max-width: 90%;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 15px;
    font-size: 2em;
  }
}

.closeItem, .closePlayerItem, .closeEdit, .closePlayer, .closeDeletePlayer, .closeVermoegen, .closeGame, .closeGameDelete, .closeItemDelete, .closeRegister, .closeLogin {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.table-wrapper {
  display: block;
  white-space: nowrap;
}

.table-scroll {
  /* max-height: calc(15 * 40px - 5px); /* 10 Zeilen à ca. 40px Höhe */
  overflow-y: auto;
  overflow-x: auto;
  border: none;
  margin-top: 20px;
}

/* Fixierter Tabellenkopf */
#inventarTable thead th {
  position: sticky;
  top: 0;
  background-color: #f4f4f4;
  z-index: 2;
  margin-top: -1px;
  border: 1px solid #ccc;
}

#inventarTable td:nth-child(5) {
  max-width: 250px;
  word-break: break-word;
  white-space: normal;
}

#inventarTable tfoot td {
  position: sticky;
  bottom: 0;
  background-color: #f4f4f4;
  z-index: 2;
  font-weight: bold;
  border: 1px solid #ccc;
}

#inventarTable tbody td {
  border: 1px solid #ccc;
}

#inventarTable,
#spielerTable {
  width: auto;
}

#spielerTable {
  margin-top: 20px;
}

#spielerTable th,
#spielerTable td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

#spielerTable thead th {
  background-color: #f4f4f4;
}

.toggle-assigned-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.assigned-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  text-decoration: none;
}

.assigned-items-wrapper {
  margin-top: 6px;
}

.assigned-items-table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
}

.assigned-items-table th,
.assigned-items-table td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid #ccc;
}

table {
  border-collapse: collapse;
  width: auto;
}

th, td {
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

td:nth-child(2),
td:nth-child(3) {
  text-align: right;
}


#spielerTable td:nth-child(5){
  text-align: center;
}


#spielerTable td:nth-child(2),
#spielerTable td:nth-child(3),
#spielerTable td:nth-child(4),
#spielerTable td:nth-child(6) {
  text-align: right;
}

button.editBtn {
  background-color: #fff;
  color: #007bff;
  border: 2px solid #007bff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
button.editBtn:hover {
  background-color: #007bff;
  color: #fff;
}

button.deleteBtn {
  background-color: #fff;
  color: #dc3545;
  border: 2px solid #dc3545;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
button.deleteBtn:hover {
  background-color: #dc3545;
  color: #fff;
}

/* ROT */
.confirmDeleteBtn {
  background-color: #d9534f;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  margin-right: 10px;
}

.confirmBtn:hover {
  animation: shakeY 0.3s;
}

.confirmDeleteBtn:hover {
  animation: shakeX 0.3s;
}

@keyframes shakeX {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes shakeY {
  0% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  50% { transform: translateY(2px); }
  75% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

/* GRUEN */
button.createBtn, button.createPlayerBtn, button.createGameBtn, .confirmBtn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* BLAU */
button.editVermoegenBtn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* ROT */
button.deletePlayerBtn, button.deleteGameBtn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.cancelBtn {
  background-color: #6c757d;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
}

/* GELB */
select.selectSpielerGelb, select.selectGameGelb {
  background-color: #ffc107;
  color: black;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

select.selectSpielerGelb:hover,
select.selectSpielerGelb:focus {
  background-color: #e0a800;
  outline: none;
}

.selectSpielerGelb.assigned-group-select {
  background-color: #ffc107;
  color: #000000;
  border: none;
}

.selectSpielerGelb.assigned-player-select {
  background-color: #28a745;
  color: #ffffff;
  border: none;
}

.assigned-group-badge {
  background-color: #fff3cd;
  color: #856404;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.assigned-player-badge {
  background-color: #28a745;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

th[data-sort] {
  cursor: pointer;
  position: relative;
  padding-right: 20px;
}

th[data-sort]::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
}

th.sort-asc::after {
  content: '▲';
}

th.sort-desc::after {
  content: '▼';
}

.autocomplete-box {
  position: absolute;
  top: 100%;
  left: 200px;
  z-index: 1000;
  background: white;
  border: none;
  width: 300px;
}

.input-wrapper {
  position: relative;
}


.autocomplete-box div {
  padding: 8px;
  cursor: pointer;
}

.autocomplete-box div:hover {
  background-color: #f0f0f0;
}

.summary-row {
  background-color: #f0f0f0;
  font-weight: bold;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.logo img {
  height: 100px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.navBtn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.375rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.navBtn.default {
  background-color: #f0f0f0;
  color: #333;
  border-color: #ccc;
}

.navBtn.default:hover {
  background-color: #e0e0e0;
  border-color: #bbb;
}

.navBtn.primary {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.navBtn.primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.navBtn.logout {
  background-color: #6c757d;
  color: #fff;
  border-color: #6c757d;
}

.navBtn.logout:hover {
  background-color: #5c636a;
  border-color: #545b62;
}

.navBtn:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.4);
}

.welcome {
  font-weight: bold;
  margin-right: 10px;
}

.tooltip-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tooltip-icon {
  cursor: help;
  color: #555;
  font-size: 0.9em;
}

.custom-tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 1em;
  max-width: 320px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border-radius: 8px;
  font-size: 0.95em;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.custom-tooltip strong {
  font-size: 1.1em;
  display: block;
  margin-bottom: 6px;
}

.language-selector {
  display: inline-block;
  vertical-align: middle;
  position: relative;
}

.language-selector select {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 0.375rem;
  text-decoration: none;
  border: 1px solid transparent;
  background-color: #0d6efd;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.language-selector select:hover {
  background-color: #0b5ed7;
}

.language-select {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  font-size: 0.9em;
  color: #666;
  border-top: 1px solid #ccc;
  margin-top: 40px;
  flex-wrap: wrap;
}
.footer a {
  color: #0077cc;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

#instructions {
  transition: all 0.3s ease;
  margin-top: 0.5em;
}

.btn-outline-primary {
  color: #0d6efd;
  border: 1px solid #0d6efd;
  background-color: transparent;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.btn-outline-primary:hover {
  background-color: #0d6efd;
  color: #fff;
}

.btn-outline-primary:focus {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}


.btn-outline-primary:active {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.assigned-items-wrapper {
    margin-top: 6px;
}

.assigned-items-table {
    width: 100%;
    margin-top: 6px;
    border-collapse: collapse;
}

.assigned-items-table th,
.assigned-items-table td {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #ccc;
}