* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #14182a, #0b0d15);
  color: white;
}

/* Screens */
.screen {
  display: none;
  min-height: 100vh;
  padding: 30px;
  text-align: center;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Loader */
.loader {
  margin-top: 25px;
  width: 42px;
  height: 42px;
  border: 4px solid #2a2d3a;
  border-top: 4px solid #2ecc71;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* List */
#screen-list { justify-content: flex-start; }

.topbar {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subtitle {
  opacity: .7;
  margin: 10px 0 25px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

#server-grid {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.server-card {
  background: linear-gradient(180deg, #1a1f36, #14182a);
  border-radius: 14px;
  padding: 18px;
}

.server-header {
  display: flex;
  justify-content: space-between;
}

.status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8em;
  font-weight: 600;
}

.status.free { color: #2ecc71; }
.status.busy { color: #e74c3c; }

.server-action button {
  width: 100%;
  margin-top: 15px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.server-action button:disabled {
  background: #333;
  color: #777;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden { display: none; }

.modal-box {
  background: #14182a;
  padding: 25px;
  border-radius: 14px;
  max-width: 420px;
  text-align: center;
  white-space: pre-line;
}
