.container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--space-black);
  z-index: 1;
  overflow: hidden;
  padding: 2rem 1rem 1rem;
}

.header {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.title {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--plasma-cyan), var(--shell-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.subtitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  margin-top: 0.4rem;
}

.icon {
  color: var(--chrome-silver);
}

.spinner {
  animation: spin 1.5s linear infinite;
  color: var(--plasma-cyan);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Loading / empty states centered */
.content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.playerList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-content: start;
  gap: 0.4rem;
  width: 100%;
  max-width: 900px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: 0 0.5rem 1rem;
}

.playerList::-webkit-scrollbar {
  width: 4px;
}

.playerList::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.playerList::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.3);
  border-radius: 2px;
}

.playerCard {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-left: 3px solid var(--empire-color, var(--chrome-silver));
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}

.playerCard:hover {
  border-color: var(--empire-color, var(--plasma-cyan));
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.12);
}

.playerCard:disabled {
  opacity: 0.7;
  cursor: wait;
}

.playerName {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.playerMeta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  flex-shrink: 0;
}

.onlineDot {
  color: var(--bio-green);
}

.offlineDot {
  color: var(--chrome-silver);
  opacity: 0.5;
}

.empire {
  display: none;
}

.credits {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.dashboardLink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--star-white);
  background: linear-gradient(135deg, var(--shell-orange), var(--claw-red));
  border: none;
  border-radius: 6px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
  margin-top: 0.5rem;
}

.dashboardLink:hover {
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
  transform: translateY(-1px);
}

.searchRow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 900px;
  flex-shrink: 0;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

.searchInput {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 4px;
  outline: none;
}

.searchInput:focus {
  border-color: var(--plasma-cyan);
}

.searchInput::placeholder {
  color: rgba(157, 178, 191, 0.5);
}

.playerCount {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  flex-shrink: 0;
}

/* New Player button in player grid */
.newPlayerCard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  background: transparent;
  border: 1px dashed rgba(0, 212, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
}

.newPlayerCard:hover {
  border-color: var(--plasma-cyan);
  background: rgba(0, 212, 255, 0.05);
  color: var(--plasma-cyan);
}

/* New Player button in empty state */
.newPlayerBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--star-white);
  background: linear-gradient(135deg, var(--plasma-cyan), #0088aa);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  margin-top: 0.5rem;
}

.newPlayerBtn:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}

/* Creation form */
.createForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
  padding: 0 0.5rem;
}

.usernameInput {
  padding: 0.6rem 0.8rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--star-white);
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 4px;
  outline: none;
  width: 100%;
}

.usernameInput:focus {
  border-color: var(--plasma-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.usernameInput::placeholder {
  color: rgba(157, 178, 191, 0.5);
}

.usernameInput:disabled {
  opacity: 0.6;
}

.empireLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.empireGrid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.empireCard {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.7rem;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-left: 3px solid var(--empire-color, var(--chrome-silver));
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}

.empireCard:hover {
  border-color: var(--empire-color, var(--plasma-cyan));
  background: rgba(0, 212, 255, 0.03);
}

.empireCard:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.empireCardSelected {
  border-color: var(--empire-color, var(--plasma-cyan));
  background: rgba(0, 212, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

.empireName {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--empire-color, var(--star-white));
}

.empireTagline {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
}

.formActions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cancelBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  background: transparent;
  border: 1px solid rgba(157, 178, 191, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cancelBtn:hover {
  border-color: var(--chrome-silver);
  color: var(--star-white);
}

.cancelBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.createBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--star-white);
  background: linear-gradient(135deg, var(--plasma-cyan), #0088aa);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: box-shadow 0.2s, opacity 0.2s;
  flex: 1;
}

.createBtn:hover:not(:disabled) {
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

.createBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.errorMsg {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--claw-red, #e63946);
  padding: 0.4rem 0.6rem;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 768px) {
  .container { padding: 1rem 0.5rem 0.5rem; }
  .playerList { grid-template-columns: 1fr; gap: 0.35rem; }
  .playerCard { padding: 0.65rem 0.75rem; min-height: 44px; }
  .newPlayerCard { padding: 0.65rem 0.75rem; min-height: 44px; }
  .playerName { font-size: 0.82rem; }
  .playerMeta { font-size: 0.68rem; }
  .searchInput { font-size: 16px; padding: 0.55rem 0.65rem; min-height: 44px; }
  .playerCount { font-size: 0.72rem; }
  .dashboardLink { min-height: 44px; font-size: 0.8rem; }
  .newPlayerBtn { min-height: 44px; font-size: 0.8rem; }
  .usernameInput { font-size: 16px; padding: 0.65rem 0.8rem; min-height: 44px; }
  .empireCard { padding: 0.65rem 0.75rem; min-height: 44px; }
  .cancelBtn { min-height: 44px; }
  .createBtn { min-height: 44px; font-size: 0.78rem; }
}
