* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #111118;
  border-bottom: 1px solid #222;
}

header h1 {
  font-size: 1.4rem;
  color: #fff;
}

.status {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status.offline { background: #331111; color: #ff6b6b; }
.status.connecting { background: #332b11; color: #ffc107; }
.status.online { background: #113311; color: #51cf66; }

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background: #151520;
  border: 1px solid #252530;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #fff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #999;
}

input, select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #0a0a0f;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.95rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #5c7cfa;
}

button {
  padding: 0.6rem 1.2rem;
  background: #5c7cfa;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover { background: #4263eb; }
button:disabled { background: #333; cursor: not-allowed; }
button.secondary { background: #252530; }
button.secondary:hover { background: #333; }
button.danger { background: #c92a2a; }
button.danger:hover { background: #e03131; }

.muted { color: #666; font-size: 0.9rem; }

.hidden { display: none !important; }

/* Loading */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #252530;
  border-top-color: #5c7cfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

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

#loading-message {
  font-size: 1.1rem;
  color: #999;
}

/* Player */
#player-panel {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: #111118;
  border-bottom: 1px solid #222;
}

.toolbar span:first-child {
  flex: 1;
  font-weight: 600;
}

#latency-display {
  font-size: 0.85rem;
  color: #51cf66;
}

#neko-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: #000;
}

/* Sessions list */
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #252530;
}

.session-item:last-child { border-bottom: none; }

.session-game { font-weight: 500; }
.session-status {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.session-status.starting { background: #332b11; color: #ffc107; }
.session-status.running { background: #113311; color: #51cf66; }
.session-status.stopped { background: #331111; color: #ff6b6b; }
