:root {
  --bg: #0b0f1a;
  --card: #161c2d;
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #f1f5f9;
  --muted: #64748b;
}

/* GRUNDLAYOUT */
body {
  font-family: "Inter", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 15px;
  line-height: 1.5;
}

/* Responsive Grid (Mobile First) */
.grid-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

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

@media (min-width: 1024px) {
  .grid-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Mobile Optimization (iPhone Mini & co) */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .card {
    padding: 15px;
  }
  h2 {
    font-size: 0.7rem;
    margin-bottom: 10px;
  }
  .btn {
    padding: 12px;
    font-size: 0.85rem;
  }
  .main-nav a {
    padding: 8px 15px;
    font-size: 0.8rem;
  }
}

/* CARDS */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 15px 0;
  letter-spacing: 0.1em;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 8px;
}

/* FORMULAR ELEMENTE */
textarea,
input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  background: #0b0f1a;
  border: 1px solid #1e293b;
  color: #fefefe;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px; /* Verhindert iOS Zoom */
  box-sizing: border-box;
  font-family: inherit;
  margin-bottom: 10px;
}

.btn {
  background: var(--accent);
  color: #fefefe;
  border: none;
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
  margin-top: 10px;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:hover {
  opacity: 0.9;
}
.btn-danger {
  background: var(--danger) !important;
}
.btn-sm {
  padding: 8px;
  font-size: 0.8rem;
  margin-top: 5px;
}

/* SPIELERLISTE & MANAGEMENT */
.user-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, background 0.2s;
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(5px);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #2d3748;
  image-rendering: pixelated;
}

.user-info {
  flex-grow: 1;
}
.user-info b {
  display: block;
  font-size: 1rem;
  color: #fefefe;
}
.user-info span {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Administrator & Spieler Badges (Interaktiv) */
.badge-admin,
.badge-player {
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
  letter-spacing: 0.05em;
  font-size: 0.55rem;
  margin: 5px 0;
  transition: all 0.2s;
  display: inline-block;
}

.badge-admin {
  background: var(--warning);
  color: #000;
}
.badge-player {
  background: #573381;
  color: #a0aec0;
}
.badge-online {
  background: var(--accent);
  color: #fefefe;
}
.badge-offline {
  background: var(--danger);
  color: #fefefe;
}

.badge-admin:hover,
.badge-player:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

/* STATUS PUNKTE */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot-offline {
  background: var(--danger);
  opacity: 0.4;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.dot-online {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

/* RESSOURCEN & STATS */
.res-row {
  margin-bottom: 15px;
}
.res-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
}
.bar-bg {
  background: #1e293b;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  transition: width 0.8s ease;
}

.copy-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border: 1px solid #1e293b;
}
.copy-box code {
  font-family: monospace;
  color: var(--accent);
  font-size: 0.85rem;
}

/* TERMINAL & CHAT */
.terminal {
  background: #000;
  color: #4ade80;
  padding: 15px;
  border-radius: 8px;
  font-family: "Fira Code", "Courier New", monospace;
  height: 300px;
  overflow-y: auto;
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid #1e293b;
  white-space: pre-wrap;
}

.chat-box {
  height: 200px;
  overflow-y: auto;
  font-size: 0.9rem;
  padding-right: 5px;
}
#server-status-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap; /* Verhindert Zeilenumbruch */
  transition: all 0.3s ease; /* Macht den Farbwechsel weicher */
  min-width: 150px; /* Gibt dem Badge eine feste Basisbreite */
  text-align: center;
}

/* NAVIGATION (ADAPTED) */
.main-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.main-nav a {
  background: var(--card);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: var(--accent);
}

/* FLASH MESSAGES */
.flash-messages {
  margin-bottom: 20px;
}
.flash {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid transparent;
  background: var(--card);
}
.flash-success {
  border-color: var(--accent);
  color: var(--accent);
}
.flash-error {
  border-color: var(--danger);
  color: var(--danger);
}
.flash-warning {
  border-color: var(--warning);
  color: var(--warning);
}
